2017-05-12 12:07:57 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Build an osx binary from linux
|
|
|
|
#
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
source ./scripts/build/.variables
|
|
|
|
|
|
|
|
export CGO_ENABLED=1
|
|
|
|
export GOOS=darwin
|
|
|
|
export GOARCH=amd64
|
|
|
|
export CC=o64-clang
|
2017-05-22 16:22:42 -04:00
|
|
|
export LDFLAGS="$LDFLAGS -linkmode external -s"
|
2017-05-12 12:07:57 -04:00
|
|
|
export LDFLAGS_STATIC_DOCKER='-extld='${CC}
|
|
|
|
|
|
|
|
# Override TARGET
|
2017-05-14 13:24:10 -04:00
|
|
|
TARGET="build/docker-$GOOS-$GOARCH"
|
2017-05-12 12:07:57 -04:00
|
|
|
|
2017-05-14 13:24:10 -04:00
|
|
|
echo "Building $TARGET"
|
2017-05-12 12:07:57 -04:00
|
|
|
go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" "${SOURCE}"
|