2017-02-01 00:45:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
BINARY_NAME="oci-storage-$VERSION"
|
|
|
|
BINARY_EXTENSION="$(binary_extension)"
|
|
|
|
BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
|
|
|
|
|
|
|
|
source "${MAKEDIR}/.go-autogen"
|
|
|
|
|
2017-03-28 19:56:09 +00:00
|
|
|
export GCCGO=${SCRIPTDIR}/../vagrant/gccgo-wrapper.sh
|
2017-02-01 00:45:59 +00:00
|
|
|
# gccgo require explicit flag -pthread to allow goroutines to work.
|
|
|
|
go build -compiler=gccgo \
|
|
|
|
-o "$DEST/$BINARY_FULLNAME" \
|
|
|
|
"${BUILDFLAGS[@]}" \
|
|
|
|
-gccgoflags "
|
|
|
|
-g
|
|
|
|
-Wl,--no-export-dynamic
|
|
|
|
-ldl
|
|
|
|
-pthread
|
|
|
|
" \
|
|
|
|
./cmd/oci-storage
|
|
|
|
|
|
|
|
echo "Created binary: $DEST/$BINARY_FULLNAME"
|
|
|
|
ln -sf "$BINARY_FULLNAME" "$DEST/oci-storage$BINARY_EXTENSION"
|
|
|
|
|
|
|
|
hash_files "$DEST/$BINARY_FULLNAME"
|
|
|
|
|