From 3046581a9100820486c4062a1d8e3a51e4a1c4bf Mon Sep 17 00:00:00 2001 From: clear <100709132+clear-xmr@users.noreply.github.com> Date: Thu, 31 Mar 2022 13:58:30 +0200 Subject: [PATCH] android: build: allow configuring build threads (#313) --- scripts/android/build_haven.sh | 2 +- scripts/android/build_iconv.sh | 2 +- scripts/android/build_monero.sh | 2 +- scripts/android/build_openssl.sh | 2 +- scripts/android/build_sodium.sh | 2 +- scripts/android/build_zmq.sh | 2 +- scripts/android/config.sh | 1 + scripts/android/finish_boost.sh | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/android/build_haven.sh b/scripts/android/build_haven.sh index 40dff300d..dd303071d 100755 --- a/scripts/android/build_haven.sh +++ b/scripts/android/build_haven.sh @@ -62,7 +62,7 @@ mkdir -p ./build/release cd ./build/release CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} $FLAGS ../.. -make wallet_api -j4 +make wallet_api -j$THREADS find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \; cp -r ./lib/* $DEST_LIB_DIR diff --git a/scripts/android/build_iconv.sh b/scripts/android/build_iconv.sh index 4c40845fc..3e205333d 100755 --- a/scripts/android/build_iconv.sh +++ b/scripts/android/build_iconv.sh @@ -31,7 +31,7 @@ rm -rf $ICONV_SRC_DIR tar -xzf $ICONV_FILE_PATH -C $WORKDIR cd $ICONV_SRC_DIR CC=${CLANG} CXX=${CXXLANG} ./configure --build=x86_64-linux-gnu --host=${HOST} --prefix=${PREFIX} --disable-rpath -make +make -j$THREADS make install done diff --git a/scripts/android/build_monero.sh b/scripts/android/build_monero.sh index a72ed8207..8c813b3e9 100755 --- a/scripts/android/build_monero.sh +++ b/scripts/android/build_monero.sh @@ -61,7 +61,7 @@ mkdir -p ./build/release cd ./build/release CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} $FLAGS ../.. -make wallet_api -j4 +make wallet_api -j$THREADS find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \; cp -r ./lib/* $DEST_LIB_DIR diff --git a/scripts/android/build_openssl.sh b/scripts/android/build_openssl.sh index 9d88d2591..87dc5f115 100755 --- a/scripts/android/build_openssl.sh +++ b/scripts/android/build_openssl.sh @@ -49,7 +49,7 @@ CC=clang ANDROID_NDK=$TOOLCHAIN \ --prefix=${PREFIX} \ --openssldir=${PREFIX} \ -D__ANDROID_API__=$API -make -j4 +make -j$THREADS make install done diff --git a/scripts/android/build_sodium.sh b/scripts/android/build_sodium.sh index cf7bfba97..095f45fdf 100755 --- a/scripts/android/build_sodium.sh +++ b/scripts/android/build_sodium.sh @@ -23,7 +23,7 @@ git clone https://github.com/jedisct1/libsodium.git $SODIUM_SRC_DIR -b $SODIUM_B cd $SODIUM_SRC_DIR ./autogen.sh CC=clang CXX=clang++ ./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared -make +make -j$THREADS make install done diff --git a/scripts/android/build_zmq.sh b/scripts/android/build_zmq.sh index ccd30b7d2..8bb612d5d 100755 --- a/scripts/android/build_zmq.sh +++ b/scripts/android/build_zmq.sh @@ -26,7 +26,7 @@ cd $ZMQ_SRC_DIR git checkout ${ZMQ_COMMIT_HASH} ./autogen.sh CC=clang CXX=clang++ ./configure --prefix=${PREFIX} --host=${HOST} --enable-static --disable-shared -make +make -j$THREADS make install done diff --git a/scripts/android/config.sh b/scripts/android/config.sh index 2fb7e447d..78906b1f0 100644 --- a/scripts/android/config.sh +++ b/scripts/android/config.sh @@ -8,3 +8,4 @@ export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT export TOOLCHAIN_DIR="${WORKDIR}/toolchain" export TOOLCHAIN_BASE_DIR=$TOOLCHAIN_DIR export ORIGINAL_PATH=$PATH +export THREADS=4 diff --git a/scripts/android/finish_boost.sh b/scripts/android/finish_boost.sh index 32f1d2e8d..3cf656c55 100755 --- a/scripts/android/finish_boost.sh +++ b/scripts/android/finish_boost.sh @@ -6,4 +6,4 @@ BOOST_SRC_DIR=$3 cd $BOOST_SRC_DIR -./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --build-dir=android --stagedir=android toolset=clang threading=multi threadapi=pthread target-os=android -sICONV_PATH=${PREFIX} install +./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale --build-dir=android --stagedir=android toolset=clang threading=multi threadapi=pthread target-os=android -sICONV_PATH=${PREFIX} -j$THREADS install