2013-12-19 01:06:14 -05:00
|
|
|
#!/bin/bash
|
2014-04-08 00:14:19 -04:00
|
|
|
set -e
|
2013-12-19 01:06:14 -05:00
|
|
|
|
2014-08-01 18:57:28 -04:00
|
|
|
# explicit list of os/arch combos that support being a daemon
|
|
|
|
declare -A daemonSupporting
|
|
|
|
daemonSupporting=(
|
|
|
|
[linux/amd64]=1
|
2015-08-10 15:51:54 -04:00
|
|
|
[windows/amd64]=1
|
2014-08-01 18:57:28 -04:00
|
|
|
)
|
|
|
|
|
2013-12-24 01:31:53 -05:00
|
|
|
# if we have our linux/amd64 version compiled, let's symlink it in
|
2016-02-19 17:42:51 -05:00
|
|
|
if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then
|
2016-10-03 18:20:51 -04:00
|
|
|
arch=$(go env GOHOSTARCH)
|
|
|
|
mkdir -p "$DEST/linux/${arch}"
|
2013-12-24 01:31:53 -05:00
|
|
|
(
|
2016-10-03 18:20:51 -04:00
|
|
|
cd "$DEST/linux/${arch}"
|
2016-02-19 17:42:51 -05:00
|
|
|
ln -s ../../../binary-daemon/* ./
|
|
|
|
ln -s ../../../binary-client/* ./
|
2013-12-24 01:31:53 -05:00
|
|
|
)
|
2016-10-03 18:20:51 -04:00
|
|
|
echo "Created symlinks:" "$DEST/linux/${arch}/"*
|
2013-12-24 01:31:53 -05:00
|
|
|
fi
|
|
|
|
|
2013-12-19 01:06:14 -05:00
|
|
|
for platform in $DOCKER_CROSSPLATFORMS; do
|
|
|
|
(
|
2016-05-23 21:44:43 -04:00
|
|
|
export KEEPDEST=1
|
2015-05-29 16:07:16 -04:00
|
|
|
export DEST="$DEST/$platform" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION
|
|
|
|
mkdir -p "$DEST"
|
|
|
|
ABS_DEST="$(cd "$DEST" && pwd -P)"
|
2013-12-19 01:06:14 -05:00
|
|
|
export GOOS=${platform%/*}
|
|
|
|
export GOARCH=${platform##*/}
|
2016-02-19 17:42:51 -05:00
|
|
|
|
2016-06-07 03:45:21 -04:00
|
|
|
if [ "$GOOS" != "solaris" ]; then
|
|
|
|
# TODO. Solaris cannot be cross build because of CGO calls.
|
|
|
|
if [ -z "${daemonSupporting[$platform]}" ]; then
|
|
|
|
# we just need a simple client for these platforms
|
|
|
|
export LDFLAGS_STATIC_DOCKER=""
|
|
|
|
# remove the "daemon" build tag from platforms that aren't supported
|
|
|
|
export BUILDFLAGS=( "${ORIG_BUILDFLAGS[@]/ daemon/}" )
|
|
|
|
source "${MAKEDIR}/binary-client"
|
|
|
|
else
|
|
|
|
source "${MAKEDIR}/binary-client"
|
|
|
|
source "${MAKEDIR}/binary-daemon"
|
|
|
|
fi
|
2016-02-19 17:42:51 -05:00
|
|
|
fi
|
2013-12-19 01:06:14 -05:00
|
|
|
)
|
|
|
|
done
|