Skip to content

Commit

Permalink
update README, add libraries rebuild skip flag
Browse files Browse the repository at this point in the history
Signed-off-by: r4sas <[email protected]>
  • Loading branch information
r4sas committed Jul 23, 2024
1 parent 734693b commit 27cdad5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
31 changes: 20 additions & 11 deletions binary/jni/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
;;
Expand All @@ -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
Expand All @@ -80,4 +87,6 @@ for xarch in $(ls .); do
mv $xarch/i2pd $xarch/libi2pd.so
fi
done
popd
popd > /dev/null

echo "Compilation finished"

0 comments on commit 27cdad5

Please sign in to comment.