1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-30 00:01:19 +00:00

Force static linking

This commit is contained in:
Lode Hoste 2015-01-15 18:52:59 +01:00
parent 2d935b5485
commit 73a21a3c04
2 changed files with 5 additions and 4 deletions

View file

@ -34,13 +34,15 @@ if [ -z $GOROOT ] || [[ $(go version) != go\ version\ go1.4* ]] ; then
fi fi
# Add GO compiler to PATH # Add GO compiler to PATH
export PATH=$PATH:$GOROOT/bin export PATH=$GOROOT/bin:$PATH
# Disable CGO (no dynamic linking)
export CGO_ENABLED=0
# Check whether GOLANG is compiled with cross-compilation for 386 # Check whether GOLANG is compiled with cross-compilation for 386
if [ ! -f $GOROOT/bin/linux_386/go ]; then if [ ! -f $GOROOT/bin/linux_386/go ]; then
pushd $GOROOT/src pushd $GOROOT/src
# Build GO for cross-compilation # Build GO for cross-compilation
GOOS=linux GOARCH=386 ./make.bash --no-clean GOOS=linux GOARCH=386 GO386=387 ./make.bash --no-clean
popd popd
fi fi

View file

@ -106,10 +106,9 @@ task copyNative(type: Copy) {
def lib_dir = "libs/" def lib_dir = "libs/"
new File(lib_dir).mkdirs() new File(lib_dir).mkdirs()
def st_dir = "bin/"; def st_dir = "bin/";
from st_dir + 'syncthing-x86', st_dir + 'syncthing-armeabi', st_dir + 'syncthing-armeabi-v7a'; from st_dir + 'syncthing-x86', st_dir + 'syncthing-armeabi';
into lib_dir into lib_dir
rename('syncthing-x86', 'x86/libsyncthing.so') rename('syncthing-x86', 'x86/libsyncthing.so')
rename('syncthing-armeabi-v7a', 'armeabi-v7a/libsyncthing.so')
rename('syncthing-armeabi', 'armeabi/libsyncthing.so') rename('syncthing-armeabi', 'armeabi/libsyncthing.so')
} }
buildNative.finalizedBy copyNative buildNative.finalizedBy copyNative