make.bash 774 B

1234567891011121314151617181920212223242526
  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. # Make sure we have our dependencies
  8. echo 'go-getting dependencies...'
  9. go get -d -v ./...
  10. # Force an update of the go-mobile package, since it's being improved rapidly
  11. # NOTE: for some reason this either doesn't complete or stalls for a very long time.
  12. #echo 'Updating go-mobile...'
  13. #go get -u -d -v golang.org/x/mobile/...
  14. echo 'Building library...'
  15. CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7 \
  16. go build -a -v -ldflags="-shared" -o libgojni.so ./libpsi
  17. mkdir -p libs/armeabi-v7a
  18. mv -f libgojni.so libs/armeabi-v7a/libgojni.so
  19. echo 'Library can be found at: libs/armeabi-v7a/libgojni.so'