diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2022-10-11 15:39:46 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-11-02 12:09:53 +0100 |
commit | ccc2c4beb90bfe6875662f0152551e68b87c6c31 (patch) | |
tree | 4e95435206379ba690e488dee97da0399fde03f1 | |
parent | Android - add --with-zstd-includes and libs and build instructions. (diff) | |
download | online-ccc2c4beb90bfe6875662f0152551e68b87c6c31.tar.gz online-ccc2c4beb90bfe6875662f0152551e68b87c6c31.zip |
Simplify building multiple zstds for Android.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I58f31f3ff7be19e4770accd88a7520cc112b1e47
-rw-r--r-- | android/README | 12 | ||||
-rwxr-xr-x | scripts/build-zstd.sh | 36 |
2 files changed, 44 insertions, 4 deletions
diff --git a/android/README b/android/README index 3ba2147e02..2c4cecadd3 100644 --- a/android/README +++ b/android/README @@ -19,10 +19,10 @@ build the native parts on Windows. git clone https://android.googlesource.com/platform/external/zstd/ android-zstd cd android-zstd -mkdir armabi-v7a -cd armabi-v7a +mkdir -p install/armeabi-v7a +cd install/armeabi-v7a -NDK_PATH=/opt/libreoffice/android-ndk-r20b +NDK_PATH=~/Android/Sdk/ndk-bundle cmake \ -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \ -DANDROID_ABI=armeabi-v7a \ @@ -34,7 +34,11 @@ cmake \ ../build/cmake make +* Build zstd for several platforms: + scripts/build-zstd.sh ~/Android/Sdk/ndk-bundle /opt/libreoffice + +This will create a set of folders in install/ that you can configure with. * Build the POCO for Android @@ -146,7 +150,7 @@ make Don't forget to change --with-lo-builddir in the following: - ./autogen.sh && ./configure CC=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang CXX=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++ --host=arm-linux-androideabi --enable-androidapp --with-lo-builddir=/local/libreoffice/master-android --with-poco-includes=/opt/poco-android/include --with-poco-libs=/opt/poco-android/lib --with-zstd-includes=/opt/zstd-android/lib --with-zstd-libs=/opt/zstd-android/armabi-v7a/lib --disable-setcap --enable-silent-rules --enable-debug + ./autogen.sh && ./configure CC=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang CXX=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++ --host=arm-linux-androideabi --enable-androidapp --with-lo-builddir=/local/libreoffice/master-android --with-poco-includes=/opt/poco-android/include --with-poco-libs=/opt/poco-android/lib --with-zstd-includes=/opt/libreoffice/android-zstd/lib --with-zstd-libs=/opt/libreoffice/android-zstd/install/armeabi-v7a/lib --disable-setcap --enable-silent-rules --enable-debug * Build the JavaScript, HTML and CSS files also in the online-android folder diff --git a/scripts/build-zstd.sh b/scripts/build-zstd.sh new file mode 100755 index 0000000000..af998e1760 --- /dev/null +++ b/scripts/build-zstd.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "build-zstd.sh <abs-path-to-ndk-toplevel> <abs-path-to-build-top-dir>" + exit; +fi + +NDK_PATH=$1 # eg. /opt/libreoffice/android-ndk-r20b +BUILD_PATH=$2 # eg. /opt/libreoffice/ + +PLATFORMS="armeabi-v7a arm64-v8a x86 x86_64" + +mkdir -p $BUILD_PATH +cd $BUILD_PATH +if ! test -f android-zstd/.git/config; then + git clone https://android.googlesource.com/platform/external/zstd/ android-zstd +fi +cd android-zstd + +TOP_PATH=$BUILD_PATH/android-zstd +mkdir -p $TOP_PATH/install +for p in $PLATFORMS; do + echo "Building $p:" + mkdir -p $TOP_PATH/install/$p + cd $TOP_PATH/install/$p + cmake \ + -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake \ + -DANDROID_ABI=$p \ + -DCMAKE_ANDROID_ARCH_ABI=$p \ + -DANDROID_NDK=${NDK_PATH} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SYSTEM_NAME=Android \ + -DCMAKE_SYSTEM_VERSION=21 \ + $TOP_PATH/build/cmake || exit 1; + make +done |