make.bash 792 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. set -e
  3. if [ ! -f make.bash ]; then
  4. echo 'make.bash must be run from $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/AndroidLibrary'
  5. exit 1
  6. fi
  7. ANDROID_APP=$PWD
  8. # Make sure we have our dependencies
  9. echo 'go-getting dependencies...'
  10. go get -d -v ./...
  11. # Force an update of the go-mobile package, since it's being improved rapidly
  12. # NOTE: for some reason this either doesn't complete or stalls for a very long time.
  13. #echo 'Updating go-mobile...'
  14. #go get -u -d -v golang.org/x/mobile/...
  15. echo 'Building library...'
  16. CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 \
  17. go build -a -v -ldflags="-shared" -o libgojni.so ./libpsi
  18. mkdir -p libs/armeabi-v7a
  19. mv -f libgojni.so libs/armeabi-v7a/libgojni.so
  20. echo 'Library can be found at: libs/armeabi-v7a/libgojni.so'