diff options
author | cyBerta <cyberta@riseup.net> | 2019-07-19 17:43:31 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-08-02 01:49:37 +0200 |
commit | 7f8a7585c53321aa72410f72876aa68101d228dc (patch) | |
tree | 78812e9e8aa635e9323872a31f2d3ab03748eba3 | |
parent | f5ecd484f6ff909122a9b66669bc89e33388f1f4 (diff) |
update build_deps.sh: build shapeshifter library instead of shapeshifter-dispatcher
-rwxr-xr-x | build_deps.sh | 8 | ||||
-rwxr-xr-x | go/android_build_shapeshifter.sh (renamed from go/android_build_shapeshifter_dispatcher.sh) | 13 |
2 files changed, 16 insertions, 5 deletions
diff --git a/build_deps.sh b/build_deps.sh index 52ba7e56..b95475a3 100755 --- a/build_deps.sh +++ b/build_deps.sh @@ -10,8 +10,8 @@ DIR_OVPNASSETS=./ics-openvpn/main/build/ovpnassets DIR_OVPNLIBS=./ics-openvpn/main/build/intermediates/cmake/noovpn3/release/obj DIR_GOLANG=./go/golang/ DIR_SHAPESHIFTER_DISPATCHER=./go/src/ -FILE_X86=./go/out/x86/piedispatcher -FILE_ARM=./go/out/armeabi-v7a/piedispatcher +FILE_X86=./go/out/x86/piedispatcherlib +FILE_ARM=./go/out/armeabi-v7a/piedispatcherlib # init # look for empty dir @@ -32,7 +32,7 @@ then else echo "Clean build: compiling Go libraries" cd ./go || quit "Directory go not found" - ./android_build_shapeshifter_dispatcher.sh clean || quit "android_build_shapeshifter_dispatcher.sh clean failed" + ./android_build_shapeshifter.sh clean || quit "android_build_shapeshifter_dispatcher.sh clean failed" ./install_go.sh || quit "install_go.sh failed" - ./android_build_shapeshifter_dispatcher.sh || quit "android_build_shapeshifter_dispatcher.sh failed" + ./android_build_shapeshifter.sh --library || quit "android_build_shapeshifter_dispatcher.sh failed" fi diff --git a/go/android_build_shapeshifter_dispatcher.sh b/go/android_build_shapeshifter.sh index 185da5cc..35b85121 100755 --- a/go/android_build_shapeshifter_dispatcher.sh +++ b/go/android_build_shapeshifter.sh @@ -4,6 +4,8 @@ # Convenience script for generating shapeshifter-dispatcher binaries for Android devices # adapted for Bitmask by cyberta +BUILD_LIBRARY=false; + function quit { echo "$1." exit 1 @@ -49,6 +51,10 @@ elif [ "$1" == "clean" ]; then fi echo "Done!" else + if [[ "$1" == "--library" ]]; then + BUILD_LIBRARY=true; + fi; + if [ -z $ANDROID_NDK_HOME ]; then echo "Android NDK path not specified!" echo "Please set \$ANDROID_NDK_HOME before starting this script!" @@ -114,7 +120,12 @@ else export CC=$NDK_TOOLCHAIN/bin/clang echo "Starting compilation for $suffix..." - ./golang/go/bin/go build -buildmode=pie -ldflags '-w -s -extldflags=-pie' -o ./out/${suffix}/piedispatcher github.com/OperatorFoundation/shapeshifter-dispatcher/shapeshifter-dispatcher || quit "Failed to cross-compile shapeshifter-dispatcher" + + if [[ BUILD_LIBRARY ]]; then + ./golang/go/bin/go build -buildmode=pie -ldflags '-w -s -extldflags=-pie' -o ./out/${suffix}/piedispatcherlib se.leap.bitmaskclient/shapeshifter || quit "Failed to cross-compile shapeshifter-dispatcher-library" + else + ./golang/go/bin/go build -buildmode=pie -ldflags '-w -s -extldflags=-pie' -o ./out/${suffix}/piedispatcher github.com/OperatorFoundation/shapeshifter-dispatcher/shapeshifter-dispatcher || quit "Failed to cross-compile shapeshifter-dispatcher" + fi echo "Build succeeded!" done |