From fce35f15016ae315fa6a68bb0dc078efaea147e5 Mon Sep 17 00:00:00 2001 From: Lode Hoste Date: Wed, 10 Feb 2016 19:07:38 +0100 Subject: [PATCH 1/3] Build without cgo --- make-go.bash | 26 +++----------------------- make-syncthing.bash | 26 +++----------------------- 2 files changed, 6 insertions(+), 46 deletions(-) diff --git a/make-go.bash b/make-go.bash index e902cb9c..7b02c294 100755 --- a/make-go.bash +++ b/make-go.bash @@ -6,11 +6,6 @@ RESET=1 MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ -z "$ANDROID_NDK" ]; then - echo "Error: unspecified ANDROID_NDK" - exit 1 -fi - if [ -z "$GOROOT_BOOTSTRAP" ]; then # We need Go 1.4 to bootstrap Go 1.5 if [ -z $GOROOT ] || [[ $(go version) != go\ version\ go1.4* ]] ; then @@ -28,34 +23,19 @@ fi case "$1" in arm) - if [ ! -d "${MYDIR}/build/ndk-$1" ]; then - sh ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.9 --install-dir=${MYDIR}/build/ndk-$1 - fi - export CC_FOR_TARGET=${MYDIR}/build/ndk-arm/bin/arm-linux-androideabi-gcc - export CXX_FOR_TARGET=${MYDIR}/build/ndk-arm/bin/arm-linux-androideabi-g++ - export CGO_ENABLED=1 + export CGO_ENABLED=0 export GOOS=android export GOARCH=arm export GOARM=5 ;; 386) - if [ ! -d "${MYDIR}/build/ndk-$1" ]; then - sh ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=x86-4.9 --install-dir=${MYDIR}/build/ndk-$1 - fi - export CC_FOR_TARGET=${MYDIR}/build/ndk-386/bin/i686-linux-android-gcc - export CXX_FOR_TARGET=${MYDIR}/build/ndk-386/bin/i686-linux-android-g++ - export CGO_ENABLED=1 + export CGO_ENABLED=0 export GOOS=android export GOARCH=386 export GO386=387 ;; amd64) - if [ ! -d "${MYDIR}/build/ndk-$1" ]; then - sh ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=x86_64-4.9 --install-dir=${MYDIR}/build/ndk-$1 - fi - export CC_FOR_TARGET=${MYDIR}/build/ndk-amd64/bin/x86_64-linux-android-gcc - export CXX_FOR_TARGET=${MYDIR}/build/ndk-amd64/bin/x86_64-linux-android-g++ - export CGO_ENABLED=1 + export CGO_ENABLED=0 export GOOS=android export GOARCH=amd64 ;; diff --git a/make-syncthing.bash b/make-syncthing.bash index 1626adaa..fcb2acac 100755 --- a/make-syncthing.bash +++ b/make-syncthing.bash @@ -6,43 +6,23 @@ RESET=1 MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ -z "$ANDROID_NDK" ]; then - echo "Error: unspecified ANDROID_NDK" - exit 1 -fi - case "$1" in arm) - if [ ! -d "${MYDIR}/build/ndk-$1" ]; then - sh ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.9 --install-dir=${MYDIR}/build/ndk-$1 - fi - export CC=${MYDIR}/build/ndk-$1/bin/arm-linux-androideabi-gcc - export CXX=${MYDIR}/build/ndk-$1/bin/arm-linux-androideabi-g++ - export CGO_ENABLED=1 + export CGO_ENABLED=0 export GOOS=android export GOARCH=arm export GOARM=5 export TARGETDIR=${MYDIR}/libs/armeabi ;; 386) - if [ ! -d "${MYDIR}/build/ndk-$1" ]; then - sh ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=x86-4.9 --install-dir=${MYDIR}/build/ndk-$1 - fi - export CC_FOR_TARGET=${MYDIR}/build/ndk-$1/bin/i686-linux-android-gcc - export CXX_FOR_TARGET=${MYDIR}/build/ndk-$1/bin/i686-linux-android-g++ - export CGO_ENABLED=1 + export CGO_ENABLED=0 export GOOS=android export GOARCH=386 export GO386=387 export TARGETDIR=${MYDIR}/libs/x86 ;; amd64) - if [ ! -d "${MYDIR}/build/ndk-$1" ]; then - sh ${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=x86_64-4.9 --install-dir=${MYDIR}/build/ndk-$1 - fi - export CC_FOR_TARGET=${MYDIR}/build/ndk-$1/bin/x86_64-linux-android-gcc - export CXX_FOR_TARGET=${MYDIR}/build/ndk-$1/bin/x86_64-linux-android-g++ - export CGO_ENABLED=1 + export CGO_ENABLED=0 export GOOS=android export GOARCH=amd64 export TARGETDIR=${MYDIR}/libs/x86_64 From 479a75462c7511fca102e2b485b1f6c6b7b8b4be Mon Sep 17 00:00:00 2001 From: Lode Hoste Date: Wed, 10 Feb 2016 19:21:39 +0100 Subject: [PATCH 2/3] Set GOOS=linux instead of Android (due to upstream build issues) --- make-go.bash | 6 +++--- make-syncthing.bash | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/make-go.bash b/make-go.bash index 7b02c294..266d371f 100755 --- a/make-go.bash +++ b/make-go.bash @@ -24,19 +24,19 @@ fi case "$1" in arm) export CGO_ENABLED=0 - export GOOS=android + export GOOS=linux export GOARCH=arm export GOARM=5 ;; 386) export CGO_ENABLED=0 - export GOOS=android + export GOOS=linux export GOARCH=386 export GO386=387 ;; amd64) export CGO_ENABLED=0 - export GOOS=android + export GOOS=linux export GOARCH=amd64 ;; *) diff --git a/make-syncthing.bash b/make-syncthing.bash index fcb2acac..f1838850 100755 --- a/make-syncthing.bash +++ b/make-syncthing.bash @@ -9,21 +9,21 @@ MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" case "$1" in arm) export CGO_ENABLED=0 - export GOOS=android + export GOOS=linux export GOARCH=arm export GOARM=5 export TARGETDIR=${MYDIR}/libs/armeabi ;; 386) export CGO_ENABLED=0 - export GOOS=android + export GOOS=linux export GOARCH=386 export GO386=387 export TARGETDIR=${MYDIR}/libs/x86 ;; amd64) export CGO_ENABLED=0 - export GOOS=android + export GOOS=linux export GOARCH=amd64 export TARGETDIR=${MYDIR}/libs/x86_64 ;; From edfa9c0a2a25c6f8b6998bf965b205c65b531c9b Mon Sep 17 00:00:00 2001 From: Lode Hoste Date: Wed, 10 Feb 2016 20:15:18 +0100 Subject: [PATCH 3/3] Disable amd64 build --- make-all.bash | 3 --- 1 file changed, 3 deletions(-) diff --git a/make-all.bash b/make-all.bash index 45d63327..6813b543 100755 --- a/make-all.bash +++ b/make-all.bash @@ -8,6 +8,3 @@ ./make-go.bash 386 ./make-syncthing.bash 386 -./make-go.bash amd64 -./make-syncthing.bash amd64 -