diff options
author | Parménides GV <parmegv@sdf.org> | 2014-07-31 12:09:49 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-07-31 12:09:49 +0200 |
commit | 0393ba6656ce6cf679a2c4663275b3ed0f1a34b9 (patch) | |
tree | f000311e97598ab3fc42e2bea23e6cb342ad166c /ics-openvpn-stripped/main/misc/build-native.sh | |
parent | b28eeb08e8ec3baafdd9388cc5b70c6c84db9cf1 (diff) |
Updated ics-openvpn to rev 859 + no 2nd notification.
Diffstat (limited to 'ics-openvpn-stripped/main/misc/build-native.sh')
-rwxr-xr-x | ics-openvpn-stripped/main/misc/build-native.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ics-openvpn-stripped/main/misc/build-native.sh b/ics-openvpn-stripped/main/misc/build-native.sh new file mode 100755 index 00000000..f27384cd --- /dev/null +++ b/ics-openvpn-stripped/main/misc/build-native.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# Exit on errors +set -e + +# Generate git config if the openvpn directory is checked out from git +if [ -d openvpn/.git ]; then + GIT=git + cd openvpn + CONFIGURE_GIT_CHFILES=$($GIT diff-files --name-status -r --ignore-submodules --quiet -- || echo "+") + CONFIGURE_GIT_UNCOMMITTED=$($GIT diff-index --cached --quiet --ignore-submodules HEAD || echo "*") + CONFIGURE_GIT_REVISION=$($GIT rev-parse --symbolic-full-name HEAD | cut -d/ -f3)-$($GIT rev-parse --short=16 HEAD) + echo "#define CONFIGURE_GIT_REVISION \"${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \ + echo "#define CONFIGURE_GIT_FLAGS \"${CONFIGURE_GIT_CHFILES}${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp + + if ! [ -f config-version.h ] || ! cmp -s config-version.h.tmp config-version.h; then \ + echo "replacing config-version.h" + mv config-version.h.tmp config-version.h + else + rm -f config-version.h.tmp + fi + cd .. +fi + +if [ "x$1" = "x" ]; then + ndk-build APP_API=all -j 8 +else + ndk-build $@ +fi + +if [ $? = 0 ]; then + rm -rf ovpnlibs/ + + cd libs + mkdir -p ../ovpnlibs/assets + for i in * + do + cp -v $i/nopievpn ../ovpnlibs/assets/nopievpn.$i + cp -v $i/pievpn ../ovpnlibs/assets/pievpn.$i + done + # Removed compiled openssl libs, will use platform so libs + # Reduces size of apk + # + rm -v */libcrypto.so */libssl.so + + for arch in * + do + builddir=../ovpnlibs/jniLibs/$arch + mkdir -p $builddir + cp -v $arch/*.so $builddir + done +else + exit $? +fi |