android/README | 37 ++++++++ android/lib/src/main/cpp/CMakeLists.txt.in | 4 configure.ac | 131 +++++++++++++++++++---------- 3 files changed, 131 insertions(+), 41 deletions(-)
New commits: commit bd656c4172c6dfddb8fe69e9cd4ba822f83accf0 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Fri Jun 26 14:25:48 2020 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 2 10:10:42 2020 +0200 android: Add x86-64 build too. This will make it possible to create AAB's that contain 3 ABIs: armeabi-v7a, arm64-v8a and x86_64. If you want to build for just one ABI, use --with-android-abi=... where the value is one of those three above. Change-Id: I553b8ca941db67eddc1d712a96b818f9cfedd0fa Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97227 Tested-by: Jan Holesovsky <ke...@collabora.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97711 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/android/README b/android/README index f4d737c94..7b525e357 100644 --- a/android/README +++ b/android/README @@ -65,6 +65,43 @@ build the native parts on Windows. # install PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=arm64-v8a CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android-64bit +* Poco for x86_64 (if you want to add the support for that into the APK too): + + # checkout the 1.10.1 in yet another location + git clone https://github.com/pocoproject/poco poco-android-x86-64 + cd poco-android-x86-64 + git checkout -b poco-1.10.1 origin/poco-1.10.1 + + # and apply the following patch: + diff --git a/build/config/Android b/build/config/Android + index 9227a3352..1abf6df7c 100644 + --- a/build/config/Android + +++ b/build/config/Android + @@ -25,10 +25,14 @@ ifeq ($(ANDROID_ABI),x86) + TOOL = i686-linux-android + ARCHFLAGS = -march=i686 -msse3 -mstackrealign -mfpmath=sse + else + +ifeq ($(ANDROID_ABI),x86_64) + +TOOL = x86_64-linux-android + +else + $(error Invalid ABI specified in ANDROID_ABI) + endif + endif + endif + +endif + + # + # Define Tools + + # configure + ./configure --config=Android --no-samples --no-tests --omit=Crypto,NetSSL_OpenSSL,Zip,Data,Data/SQLite,Data/ODBC,Data/MySQL,MongoDB,PDF,CppParser,PageCompiler,JWT + + # build + PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=x86_64 CC=x86_64-linux-android21-clang CXX=x86_64-linux-android21-clang++ SYSLIBS=-static-libstdc++ + + # install + PATH="$PATH":~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin make -j8 ANDROID_ABI=x86_64 CC=x86_64-linux-android21-clang CXX=x86_64-linux-android21-clang++ SYSLIBS=-static-libstdc++ install INSTALLDIR=/opt/poco-android-x86-64 + * Configure the online.git (eg. in online-android folder) Don't forget to change --with-lo-builddir in the following: diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in b/android/lib/src/main/cpp/CMakeLists.txt.in index ad43e806c..02e2bbb3f 100644 --- a/android/lib/src/main/cpp/CMakeLists.txt.in +++ b/android/lib/src/main/cpp/CMakeLists.txt.in @@ -34,6 +34,10 @@ elseif(${ANDROID_ABI} STREQUAL "arm64-v8a") set(LOBUILDDIR_ABI @LOBUILDDIR_ARM64_V8A@) set(POCOINCLUDE_ABI @POCOINCLUDE_ARM64_V8A@) set(POCOLIB_ABI @POCOLIB_ARM64_V8A@) +elseif(${ANDROID_ABI} STREQUAL "x86_64") + set(LOBUILDDIR_ABI @LOBUILDDIR_X86_64@) + set(POCOINCLUDE_ABI @POCOINCLUDE_X86_64@) + set(POCOLIB_ABI @POCOLIB_X86_64@) else() MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add support for that.") endif() diff --git a/configure.ac b/configure.ac index e53a7dbdf..e2976687f 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,16 @@ AC_ARG_WITH(android-package-versioncode, [Set the versionCode for the Android package.]), ,) +AC_ARG_WITH(android-abi, + AS_HELP_STRING([--with-android-abi=x86_64], + [Allows specification of a concrete ABI that is to be built for. By default, builds for all the 3 + supported ABIs at the same time: armeabi-v7a, arm64-v8a and x86_64. + Please note that you need to specify the parameters for --with-lo-builddir, + --with-poco-includes and --with-poco-libs in the order of armeabi-v7a:arm64-v8a:x86_64. For + example, when you use --with-android-abi=x86_64, + you have to specify --with-lo-builddir=::/path/to/x86-64/builddir]), +,) + AC_ARG_WITH([app-name], AS_HELP_STRING([--with-app-name=<name>], [Set the user-visible name of the app you build.])) @@ -356,15 +366,28 @@ fi # to the Mac. # Android: We need these to setup the CMakeLists.txt properly. LOBUILDDIR= -ANDROID_ABI="armeabi-v7a" +ANDROID_ABI= LOBUILDDIR_ARM64_V8A= +LOBUILDDIR_X86_64= POCOINCLUDE= POCOINCLUDE_ARM64_V8A= +POCOINCLUDE_X86_64= POCOLIB= POCOLIB_ARM64_V8A= +POCOLIB_X86_64= POCODEBUG= CORE_VERSION_HASH="" if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_androidapp" = "yes" \); then + if test "$enable_androidapp" = "yes" ; then + AC_MSG_CHECKING([for Android ABI to build for]) + if test -z "$with_android_abi" ; then + ANDROID_ABI="armeabi-v7a arm64-v8a x86_64" + else + ANDROID_ABI=`echo $with_android_abi | sed 's/:/ /g'` + fi + AC_MSG_RESULT([$ANDROID_ABI]) + fi + AC_MSG_CHECKING([for LibreOffice build tree to build against]) if test -z "$with_lo_builddir"; then AC_MSG_ERROR([You MUST use the --with-lo-builddir option when configuring the mobile app build tree.]) @@ -372,20 +395,11 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a LOBUILDDIR="$with_lo_builddir" if test "$enable_androidapp" = "yes" ; then - if echo "$LOBUILDDIR" | grep -qs ':' ; then - ANDROID_ABI="armeabi-v7a arm64-v8a" - LOBUILDDIR=`echo $with_lo_builddir | sed 's/:.*//'` - LOBUILDDIR_ARM64_V8A=`echo $with_lo_builddir | sed 's/^.*://'` - fi - - # Sanity check, just a random object file in the LibreOffice build tree - 64bit - if test "$ANDROID_ABI" != "armeabi-v7a" ; then - if test -f "$LOBUILDDIR_ARM64_V8A/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then - AC_MSG_RESULT([$LOBUILDDIR_ARM64_V8A]) - else - AC_MSG_ERROR([This is not a LibreOffice 64bit core build directory: $LOBUILDDIR_ARM64_V8A]) - fi - fi + if echo "$LOBUILDDIR" | grep -qs ':' ; then + LOBUILDDIR=`echo $with_lo_builddir | cut -d: -f1` + LOBUILDDIR_ARM64_V8A=`echo $with_lo_builddir | cut -d: -f2` + LOBUILDDIR_X86_64=`echo $with_lo_builddir | cut -d: -f3` + fi fi # Get the git hash of the core build @@ -398,6 +412,22 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a AC_MSG_ERROR([This is not a LibreOffice core build directory: $LOBUILDDIR]) fi + if test -n "$LOBUILDDIR_ARM64_V8A" ; then + if test -f "$LOBUILDDIR_ARM64_V8A/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then + AC_MSG_RESULT([$LOBUILDDIR_ARM64_V8A]) + else + AC_MSG_ERROR([This is not a LibreOffice ARM64 core build directory: $LOBUILDDIR_ARM64_V8A]) + fi + fi + + if test -n "$LOBUILDDIR_X86_64" ; then + if test -f "$LOBUILDDIR_X86_64/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then + AC_MSG_RESULT([$LOBUILDDIR_X86_64]) + else + AC_MSG_ERROR([This is not a LibreOffice x86-64 core build directory: $LOBUILDDIR_X86_64]) + fi + fi + AC_MSG_CHECKING([for Poco include directory to build against]) if test -z "$with_poco_includes"; then AC_MSG_ERROR([You MUST use the --with-poco-includes option when configuring the mobile app build tree.]) @@ -405,19 +435,11 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a POCOINCLUDE="$with_poco_includes" if test "$enable_androidapp" = "yes" ; then - if echo "$POCOINCLUDE" | grep -qs ':' ; then - POCOINCLUDE=`echo $with_poco_includes | sed 's/:.*//'` - POCOINCLUDE_ARM64_V8A=`echo $with_poco_includes | sed 's/^.*://'` - fi - - # Sanity check - 64bit - if test "$ANDROID_ABI" != "armeabi-v7a" ; then - if test -f "$POCOINCLUDE_ARM64_V8A/Poco/Poco.h"; then - AC_MSG_RESULT([$POCOINCLUDE_ARM64_V8A]) - else - AC_MSG_ERROR([This is not a Poco 64bit include directory: $POCOINCLUDE_ARM64_V8A]) - fi - fi + if echo "$POCOINCLUDE" | grep -qs ':' ; then + POCOINCLUDE=`echo $with_poco_includes | cut -d: -f1` + POCOINCLUDE_ARM64_V8A=`echo $with_poco_includes | cut -d: -f2` + POCOINCLUDE_X86_64=`echo $with_poco_includes | cut -d: -f3` + fi fi # Sanity check @@ -427,6 +449,22 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a AC_MSG_ERROR([This is not a Poco include directory: $POCOINCLUDE]) fi + if test -n "$POCOINCLUDE_ARM64_V8A" ; then + if test -f "$POCOINCLUDE_ARM64_V8A/Poco/Poco.h"; then + AC_MSG_RESULT([$POCOINCLUDE_ARM64_V8A]) + else + AC_MSG_ERROR([This is not a Poco ARM64 include directory: $POCOINCLUDE_ARM64_V8A]) + fi + fi + + if test -n "$POCOINCLUDE_X86_64" ; then + if test -f "$POCOINCLUDE_X86_64/Poco/Poco.h"; then + AC_MSG_RESULT([$POCOINCLUDE_X86_64]) + else + AC_MSG_ERROR([This is not a Poco x86-64 include directory: $POCOINCLUDE_X86_64]) + fi + fi + AC_MSG_CHECKING([for Poco lib directory to build against]) if test -z "$with_poco_libs"; then AC_MSG_ERROR([You MUST use the --with-poco-libs option when configuring the mobile app build tree.]) @@ -434,19 +472,11 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a POCOLIB="$with_poco_libs" if test "$enable_androidapp" = "yes" ; then - if echo "$POCOLIB" | grep -qs ':' ; then - POCOLIB=`echo $with_poco_libs | sed 's/:.*//'` - POCOLIB_ARM64_V8A=`echo $with_poco_libs | sed 's/^.*://'` - fi - - # Sanity check - 64bit - if test "$ANDROID_ABI" != "armeabi-v7a" ; then - if test -f "$POCOLIB_ARM64_V8A/libPocoFoundation.a"; then - AC_MSG_RESULT([$POCOLIB_ARM64_V8A]) - else - AC_MSG_ERROR([This is not a Poco 64bit lib directory: $POCOLIB_ARM64_V8A]) - fi - fi + if echo "$POCOLIB" | grep -qs ':' ; then + POCOLIB=`echo $with_poco_libs | cut -d: -f1` + POCOLIB_ARM64_V8A=`echo $with_poco_libs | cut -d: -f2` + POCOLIB_X86_64=`echo $with_poco_libs | cut -d: -f3` + fi fi # Sanity check @@ -456,6 +486,22 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_a AC_MSG_ERROR([This is not a Poco lib directory: $POCOLIB]) fi + if test -n "$POCOLIB_ARM64_V8A" ; then + if test -f "$POCOLIB_ARM64_V8A/libPocoFoundation.a"; then + AC_MSG_RESULT([$POCOLIB_ARM64_V8A]) + else + AC_MSG_ERROR([This is not a Poco ARM64 lib directory: $POCOLIB_ARM64_V8A]) + fi + fi + + if test -n "$POCOLIB_X86_64" ; then + if test -f "$POCOLIB_X86_64/libPocoFoundation.a"; then + AC_MSG_RESULT([$POCOLIB_X86_64]) + else + AC_MSG_ERROR([This is not a Poco x86-64 lib directory: $POCOLIB_X86_64]) + fi + fi + if test "$ENABLE_DEBUG" = "true" ; then POCODEBUG=d fi @@ -463,10 +509,13 @@ fi AC_SUBST(LOBUILDDIR) AC_SUBST(ANDROID_ABI) AC_SUBST(LOBUILDDIR_ARM64_V8A) +AC_SUBST(LOBUILDDIR_X86_64) AC_SUBST(POCOINCLUDE) AC_SUBST(POCOINCLUDE_ARM64_V8A) +AC_SUBST(POCOINCLUDE_X86_64) AC_SUBST(POCOLIB) AC_SUBST(POCOLIB_ARM64_V8A) +AC_SUBST(POCOLIB_X86_64) AC_SUBST(POCODEBUG) AC_SUBST([CORE_VERSION_HASH]) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits