From fc5ed14b89a029741237ae2cfc5bf6e2ebc39891 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 29 Jan 2018 22:44:04 +0100 Subject: [PATCH] Android toolchain builder libraries update Update libraries build by android toolchain builder helper script Version of the libraries is now parametrizable via environement variables --- android-prepare-toolchain.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/android-prepare-toolchain.sh b/android-prepare-toolchain.sh index d89e071e2..f823457e9 100755 --- a/android-prepare-toolchain.sh +++ b/android-prepare-toolchain.sh @@ -6,9 +6,13 @@ [ -z ${ANDROID_NDK_ABI_VER+x} ] && export ANDROID_NDK_ABI_VER="4.9" [ -z ${ANDROID_PLATFORM_VER+x} ] && export ANDROID_PLATFORM_VER="18" [ -z ${NDK_TOOLCHAIN_PATH+x} ] && export NDK_TOOLCHAIN_PATH="${HOME}/Builds/android-toolchains/retroshare-android-${ANDROID_PLATFORM_VER}-${ANDROID_NDK_ARCH}-abi${ANDROID_NDK_ABI_VER}/" -[ -z ${HOST_NUM_CPU+x} ] && export HOST_NUM_CPU=4 +[ -z ${HOST_NUM_CPU+x} ] && export HOST_NUM_CPU=$(grep "^processor" /proc/cpuinfo | wc -l) +[ -z ${BZIP2_SOURCE_VERSION+x} ] && export BZIP2_SOURCE_VERSION="1.0.6" +[ -z ${OPENSSL_SOURCE_VERSION+x} ] && export OPENSSL_SOURCE_VERSION="1.0.2n" +[ -z ${SQLITE_SOURCE_YEAR+x} ] && export SQLITE_SOURCE_YEAR="2018" +[ -z ${SQLITE_SOURCE_VERSION+x} ] && export SQLITE_SOURCE_VERSION="3220000" +[ -z ${LIBUPNP_SOURCE_VERSION+x} ] && export LIBUPNP_SOURCE_VERSION="1.6.24" -runDir="$(pwd)" ## You should not edit the following variables if [ "${ANDROID_NDK_ARCH}" == "x86" ]; then @@ -38,9 +42,9 @@ build_toolchain() ## More information available at retroshare://file?name=Android%20Native%20Development%20Kit%20Cookbook.pdf&size=29214468&hash=0123361c1b14366ce36118e82b90faf7c7b1b136 build_bzlib() { - B_dir="bzip2-1.0.6" + B_dir="bzip2-${BZIP2_SOURCE_VERSION}" rm -rf $B_dir - [ -f $B_dir.tar.gz ] || wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz + [ -f $B_dir.tar.gz ] || wget http://www.bzip.org/${BZIP2_SOURCE_VERSION}/bzip2-${BZIP2_SOURCE_VERSION}.tar.gz tar -xf $B_dir.tar.gz cd $B_dir sed -i "/^CC=.*/d" Makefile @@ -59,7 +63,7 @@ build_bzlib() ## More information available at http://doc.qt.io/qt-5/opensslsupport.html build_openssl() { - B_dir="openssl-1.0.2h" + B_dir="openssl-${OPENSSL_SOURCE_VERSION}" rm -rf $B_dir [ -f $B_dir.tar.gz ] || wget https://www.openssl.org/source/$B_dir.tar.gz tar -xf $B_dir.tar.gz @@ -86,8 +90,8 @@ build_openssl() build_sqlite() { - B_dir="sqlite-autoconf-3130000" - [ -f $B_dir.tar.gz ] || wget https://www.sqlite.org/2016/$B_dir.tar.gz + B_dir="sqlite-autoconf-${SQLITE_SOURCE_VERSION}" + [ -f $B_dir.tar.gz ] || wget https://www.sqlite.org/${SQLITE_SOURCE_YEAR}/$B_dir.tar.gz tar -xf $B_dir.tar.gz cd $B_dir ./configure --prefix="${SYSROOT}/usr" --host=${ANDROID_NDK_ARCH}-linux @@ -113,9 +117,9 @@ build_sqlcipher() build_libupnp() { - B_dir="libupnp-1.6.20" + B_dir="libupnp-${LIBUPNP_SOURCE_VERSION}" rm -rf $B_dir - [ -f $B_dir.tar.bz2 ] || wget https://sourceforge.net/projects/pupnp/files/pupnp/libUPnP%201.6.20/$B_dir.tar.bz2 + [ -f $B_dir.tar.bz2 ] || wget https://sourceforge.net/projects/pupnp/files/pupnp/libUPnP%20${LIBUPNP_SOURCE_VERSION}/$B_dir.tar.bz2 tar -xf $B_dir.tar.bz2 cd $B_dir ## liupnp must be configured as static library because if not the linker will @@ -150,3 +154,5 @@ build_bzlib build_openssl build_sqlite build_libupnp + +echo NDK_TOOLCHAIN_PATH=${NDK_TOOLCHAIN_PATH}