2017-05-11 18:52:17 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Build a dynamically linked binary for the host OS/ARCH
|
|
|
|
#
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
source ./scripts/build/.variables
|
|
|
|
|
2017-05-14 13:24:10 -04:00
|
|
|
echo "Building dynamically linked $TARGET"
|
2017-05-11 18:52:17 -04:00
|
|
|
export CGO_ENABLED=1
|
2020-05-11 21:14:36 -04:00
|
|
|
case "$(go env GOARCH)" in
|
|
|
|
mips*|ppc64)
|
|
|
|
# pie build mode is not supported on mips architectures
|
|
|
|
GO_BUILDMODE=""
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
GO_BUILDMODE="-buildmode=pie"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}"
|
2017-05-11 18:52:17 -04:00
|
|
|
|
2017-07-18 08:17:17 -04:00
|
|
|
ln -sf "$(basename "${TARGET}")" build/docker
|