From aa36f37ff46a44f02a36f367090caa80270f0ce9 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Wed, 5 Jul 2017 16:19:56 -0600 Subject: [PATCH] [ADDED] Build for ARMv7 The cross compile script compiled an ARM executable, but the ARM default version varies based on the host, etc.. Made a change to the cross compile script to explicitly compile ARMv5 and ARMv7. --- scripts/cross_compile.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/cross_compile.sh b/scripts/cross_compile.sh index 57d7e786..20db2559 100755 --- a/scripts/cross_compile.sh +++ b/scripts/cross_compile.sh @@ -5,8 +5,8 @@ go get github.com/mitchellh/gox go get github.com/tcnksm/ghr export APPNAME="gnatsd" -export OSARCH="linux/386 linux/amd64 linux/arm darwin/amd64 windows/386 windows/amd64" -export DIRS="linux-386 linux-amd64 linux-arm darwin-amd64 windows-386 windows-amd64" +export OSARCH="linux/386 linux/amd64 darwin/amd64 windows/386 windows/amd64" +export DIRS="linux-386 linux-amd64 linux-arm5 linux-arm7 darwin-amd64 windows-386 windows-amd64" export OUTDIR="pkg" # If we have an arg, assume its a version tag and rename as appropriate. @@ -14,7 +14,16 @@ if [[ -n $1 ]]; then export APPNAME=$APPNAME-$1 fi +# Build all from OSARCH list env CGO_ENABLED=0 gox -osarch="$OSARCH" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-{{.OS}}-{{.Arch}}/gnatsd" + +# Be explicit about the ARM builds +# ARMv5 +env CGO_ENABLED=0 GOARM=5 gox -osarch="linux/arm" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-linux-arm5/gnatsd" +# ARMv7 +env CGO_ENABLED=0 GOARM=7 gox -osarch="linux/arm" -ldflags="-s -w" -output "$OUTDIR/$APPNAME-linux-arm7/gnatsd" + +# Create the zip files for dir in $DIRS; do \ (cp README.md $OUTDIR/$APPNAME-$dir/README.md) ;\ (cp LICENSE $OUTDIR/$APPNAME-$dir/LICENSE) ;\