From 27cdad53ba7d6d2b8dbcc6425990789daf9cff12 Mon Sep 17 00:00:00 2001 From: r4sas Date: Tue, 23 Jul 2024 19:02:05 +0000 Subject: [PATCH] update README, add libraries rebuild skip flag Signed-off-by: r4sas --- README.md | 4 ++-- binary/jni/build.sh | 31 ++++++++++++++++++++----------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ccc84f1..883da4e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ unzip commandlinetools-linux-8092744_latest.zip ```bash git clone --recurse-submodules https://github.com/PurpleI2P/i2pd-android.git +cd i2pd-android ``` ### Compile application @@ -54,8 +55,7 @@ export ANDROID_HOME=/opt/android-sdk export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313 pushd binary/jni -export BUILD_SO=1 -./build_debug.sh +./build.sh -md popd gradle clean assembleDebug diff --git a/binary/jni/build.sh b/binary/jni/build.sh index 174c4cd..6b4b472 100755 --- a/binary/jni/build.sh +++ b/binary/jni/build.sh @@ -30,12 +30,13 @@ help() echo "m Rename binaries as libraries." echo "d Debug build." echo "s Strip binaries." - echo "h Print this Help." + echo "x Skip libraries rebuild." echo "v Verbose NDK output." + echo "h Print this Help." echo } -while getopts ":dmsvh" option; do +while getopts ":dmsvxh" option; do case $option in d) # debug build _NDK_OPTS="$_NDK_OPTS NDK_DEBUG=1" @@ -46,6 +47,9 @@ while getopts ":dmsvh" option; do s) # strip binaries _STRIP=1 ;; + x) # skip libraries rebuild + _SKIP_LIBS=1 + ;; v) # verbose output _NDK_OPTS="$_NDK_OPTS V=1 NDK_LOG=1" ;; @@ -59,19 +63,22 @@ while getopts ":dmsvh" option; do done # Building -echo Building boost... -./build_boost.sh +if [ -z "$_SKIP_LIBS" ]; then + echo "Building boost..." + ./build_boost.sh -echo Building openssl... -./build_openssl.sh + echo "Building openssl..." + ./build_openssl.sh -echo Building miniupnpc... -./build_miniupnpc.sh + echo "Building miniupnpc..." + ./build_miniupnpc.sh +fi -echo Building i2pd... +echo "Building i2pd..." $ANDROID_NDK_HOME/ndk-build $_NDK_OPTS -pushd $DIR/../libs +echo "Processing binaries (if requested)..." +pushd $DIR/../libs > /dev/null for xarch in $(ls .); do if [ ! -z "$_STRIP" ]; then $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip -s $xarch/i2pd @@ -80,4 +87,6 @@ for xarch in $(ls .); do mv $xarch/i2pd $xarch/libi2pd.so fi done -popd +popd > /dev/null + +echo "Compilation finished"