summaryrefslogtreecommitdiffhomepage
path: root/wireguard
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-03-17 15:24:29 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-03-22 14:09:29 +0000
commit6bde501c1c0484f40d093ad2e73b5ffb046513ea (patch)
treee656a40f06632eea3d0d3bac7ad2399ceac18fe8 /wireguard
parent022ffd5af2e5f15770a08e4791a77ce8d11d6c99 (diff)
downloadmullvadvpn-6bde501c1c0484f40d093ad2e73b5ffb046513ea.tar.xz
mullvadvpn-6bde501c1c0484f40d093ad2e73b5ffb046513ea.zip
Change built `libwg.so` output path
Change the makefile to output to the path that will be used when building the `mullvad-jni` crate, then copy that file to the path where the APK build process will look for it. This is the reverse of how it was previously handled. The reason for doing is is that the APK library will be stripped, so having that be the output of the makefile will always cause `make` to rebuild it unnecessary if it's stripped in place. Therefore, we keep the `make` output library unstripped, and copy a stripped version to the APK path.
Diffstat (limited to 'wireguard')
-rw-r--r--wireguard/libwg/Android.mk2
-rwxr-xr-xwireguard/libwg/build-android.sh10
2 files changed, 4 insertions, 8 deletions
diff --git a/wireguard/libwg/Android.mk b/wireguard/libwg/Android.mk
index 76cc620139..cfbf5e3eb5 100644
--- a/wireguard/libwg/Android.mk
+++ b/wireguard/libwg/Android.mk
@@ -2,7 +2,7 @@
#
# Copyright © 2017-2019 WireGuard LLC. All Rights Reserved.
-DESTDIR ?= $(CURDIR)/../../android/build/extraJni/$(ANDROID_ABI)
+DESTDIR ?= $(CURDIR)/../../build/lib/$(RUST_TARGET_TRIPLE)
NDK_GO_ARCH_MAP_x86 := 386
NDK_GO_ARCH_MAP_x86_64 := amd64
diff --git a/wireguard/libwg/build-android.sh b/wireguard/libwg/build-android.sh
index 9a699f0426..175ad49c5a 100755
--- a/wireguard/libwg/build-android.sh
+++ b/wireguard/libwg/build-android.sh
@@ -45,13 +45,9 @@ for arch in $ARCHITECTURES; do
export CFLAGS="-D__ANDROID_API__=21"
make -f Android.mk
- # Copy build artifacts to `build/libs/$RUST_TARGET_TRIPLE` to be able to build `mullvad-jni`
- chmod 777 ../../android/build/
- chmod 777 ../../android/build/extraJni
- chmod 777 ../../android/build/extraJni/*
- mkdir -p ../../build/lib/$RUST_TARGET_TRIPLE
- cp ../../android/build/extraJni/$ANDROID_ABI/libwg.so ../../build/lib/$RUST_TARGET_TRIPLE
- chmod 777 ../../android/build/extraJni/$ANDROID_ABI/libwg.so ../../build/lib/$RUST_TARGET_TRIPLE
+ # Copy build artifacts to `android/build/extraJni/$ANDROID_ABI` to be able to build the APK
+ mkdir -p ../../android/build/extraJni/$ANDROID_ABI
+ cp ../../build/lib/$RUST_TARGET_TRIPLE/libwg.so ../../android/build/extraJni/$ANDROID_ABI
rm -rf build
done