android/README | 2 android/app/src/main/cpp/CMakeLists.txt.in | 28 +++--- configure.ac | 133 +++++++++++++++++------------ 3 files changed, 94 insertions(+), 69 deletions(-)
New commits: commit 6d8d40a2677da7318751eb216d5cb8c1967d3a67 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Wed Feb 13 12:09:36 2019 +0100 Commit: Jan Holesovsky <ke...@collabora.com> CommitDate: Wed Feb 13 12:09:36 2019 +0100 android: Use configure for the rest of the hardcoded stuff in CMakeLists.txt. Change-Id: I61ae98c87f439dffe6df4b9c61da7e7c5f968786 diff --git a/android/README b/android/README index cbb4d2d1e..83b1debde 100644 --- a/android/README +++ b/android/README @@ -26,7 +26,7 @@ * Configure the online.git - ./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-silent-rules --with-lo-builddir=/local/libreoffice/master-android --with-lokit-path=/local/libreoffice/master-android/include --with-lo-path=/local/libreoffice/master-android/instdir --with-poco-includes=/opt/poco-android/include --with-poco-libs=/opt/poco-android --with-libpng-includes=/local/libreoffice/master-android/workdir/UnpackedTarball/libpng --with-libpng-libs=/local/libreoffice/master-android/workdir/LinkTarget/StaticLibrary --disable-setcap --enable-androidapp --with-logfile=/tmp/loolwsd.log --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 --disable-setcap --enable-silent-rules --enable-debug * Build it diff --git a/android/app/src/main/cpp/CMakeLists.txt.in b/android/app/src/main/cpp/CMakeLists.txt.in index 838b8ec35..c6b293da9 100644 --- a/android/app/src/main/cpp/CMakeLists.txt.in +++ b/android/app/src/main/cpp/CMakeLists.txt.in @@ -24,21 +24,21 @@ add_library(androidapp SHARED target_compile_definitions(androidapp PRIVATE LOOLWSD_CONFIGDIR="/etc/loolwsd") # TODO somewhere in assets maybe? target_include_directories(androidapp PRIVATE - . # path to androidapp.h - ../../../../.. # path to config.h - ../../../../../common # the needed loolwsd includes + . # path to androidapp.h + ../../../../.. # path to config.h + ../../../../../common # the needed loolwsd includes ../../../../../kit ../../../../../net ../../../../../wsd - @POCOINCLUDE@ # POCO - /local/libreoffice/master-android/workdir/UnpackedTarball/libpng # libpng - /local/libreoffice/master-android/include # LibreOfficeKit + @POCOINCLUDE@ # POCO + @LIBPNG_INCLUDES@ # libpng + @LOKIT_PATH@ # LibreOfficeKit ) target_link_libraries(androidapp android log - /local/libreoffice/master-android/workdir/LinkTarget/StaticLibrary/liblibpng.a + @LIBPNG_LIBS@/liblibpng.a @POCOLIB@/libPocoEncodings.a @POCOLIB@/libPocoNet.a @POCOLIB@/libPocoRedis.a diff --git a/configure.ac b/configure.ac index ad1878fe5..b1ce4a7fb 100644 --- a/configure.ac +++ b/configure.ac @@ -281,6 +281,24 @@ AC_SUBST(LOBUILDDIR) AC_SUBST(POCOINCLUDE) AC_SUBST(POCOLIB) +LIBPNG_INCLUDES="$with_libpng_includes" +LIBPNG_LIBS="$with_libpng_libs" +LOKIT_PATH=`readlink -f $with_lokit_path` +if test "$enable_androidapp" = "yes"; then + if test -z "$LIBPNG_INCLUDES" ; then + LIBPNG_INCLUDES="$LOBUILDDIR/workdir/UnpackedTarball/libpng" + fi + if test -z "$LIBPNG_LIBS" ; then + LIBPNG_LIBS="$LOBUILDDIR/workdir/LinkTarget/StaticLibrary" + fi + if test -z "$LOKIT_PATH" ; then + LOKIT_PATH=`readlink -f $LOBUILDDIR/include` + fi +fi +AC_SUBST(LIBPNG_INCLUDES) +AC_SUBST(LIBPNG_LIBS) +AC_SUBST(LOKIT_PATH) + ENABLE_IOSAPP= MOBILE_APP_NAME="Mobile" @@ -371,10 +389,9 @@ else AC_MSG_ERROR(no) fi -with_lokit_path=`readlink -f $with_lokit_path` -AS_IF([test -n "$with_lokit_path"], - [CPPFLAGS="$CPPFLAGS -I${with_lokit_path}"]) -lokit_msg="$with_lokit_path" +AS_IF([test -n "$LOKIT_PATH"], + [CPPFLAGS="$CPPFLAGS -I${LOKIT_PATH}"]) +lokit_msg="$LOKIT_PATH" LO_PATH="/usr/lib64/libreoffice" JAIL_PATH=not-set @@ -420,11 +437,11 @@ AS_IF([test -n "$with_poco_includes"], AS_IF([test -n "$with_poco_libs"], [LDFLAGS="$LDFLAGS -L${with_poco_libs}"]) -AS_IF([test -n "$with_libpng_includes"], - [CPPFLAGS="$CPPFLAGS -isystem ${with_libpng_includes}"]) +AS_IF([test -n "$LIBPNG_INCLUDES"], + [CPPFLAGS="$CPPFLAGS -isystem ${LIBPNG_INCLUDES}"]) -AS_IF([test -n "$with_libpng_libs"], - [LDFLAGS="$LDFLAGS -L${with_libpng_libs}"]) +AS_IF([test -n "$LIBPNG_LIBS"], + [LDFLAGS="$LDFLAGS -L${LIBPNG_LIBS}"]) AS_IF([test -n "$with_cppunit_includes"], [CPPFLAGS="$CPPFLAGS -isystem ${with_cppunit_includes}"]) commit 3af9580489b9e305c58e64fc59fe5e97782de875 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Wed Feb 13 11:32:49 2019 +0100 Commit: Jan Holesovsky <ke...@collabora.com> CommitDate: Wed Feb 13 11:32:49 2019 +0100 android: Generate the CMakeLists.txt from configure. Change-Id: I9012e78adda55640c6fe74829fcb7f7a2fb25ce6 diff --git a/android/README b/android/README index 1183e77dc..cbb4d2d1e 100644 --- a/android/README +++ b/android/README @@ -26,7 +26,7 @@ * Configure the online.git - ./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-silent-rules --with-lokit-path=/local/libreoffice/master-android/include --with-lo-path=/local/libreoffice/master-android/instdir --with-poco-includes=/opt/poco-android/include --with-poco-libs=/opt/poco-android --with-libpng-includes=/local/libreoffice/master-android/workdir/UnpackedTarball/libpng --with-libpng-libs=/local/libreoffice/master-android/workdir/LinkTarget/StaticLibrary --disable-setcap --enable-androidapp --with-logfile=/tmp/loolwsd.log --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-silent-rules --with-lo-builddir=/local/libreoffice/master-android --with-lokit-path=/local/libreoffice/master-android/include --with-lo-path=/local/libreoffice/master-android/instdir --with-poco-includes=/opt/poco-android/include --with-poco-libs=/opt/poco-android --with-libpng-includes=/local/libreoffice/master-android/workdir/UnpackedTarball/libpng --with-libpng-libs=/local/libreoffice/master-android/workdir/LinkTarget/StaticLibrary --disable-setcap --enable-androidapp --with-logfile=/tmp/loolwsd.log --enable-debug * Build it diff --git a/android/app/src/main/cpp/CMakeLists.txt b/android/app/src/main/cpp/CMakeLists.txt.in similarity index 80% rename from android/app/src/main/cpp/CMakeLists.txt rename to android/app/src/main/cpp/CMakeLists.txt.in index 652575c8d..838b8ec35 100644 --- a/android/app/src/main/cpp/CMakeLists.txt +++ b/android/app/src/main/cpp/CMakeLists.txt.in @@ -30,7 +30,7 @@ target_include_directories(androidapp PRIVATE ../../../../../kit ../../../../../net ../../../../../wsd - /opt/poco-android/include # POCO + @POCOINCLUDE@ # POCO /local/libreoffice/master-android/workdir/UnpackedTarball/libpng # libpng /local/libreoffice/master-android/include # LibreOfficeKit ) @@ -39,11 +39,11 @@ target_link_libraries(androidapp android log /local/libreoffice/master-android/workdir/LinkTarget/StaticLibrary/liblibpng.a - /opt/poco-android/lib/libPocoEncodings.a - /opt/poco-android/lib/libPocoNet.a - /opt/poco-android/lib/libPocoRedis.a - /opt/poco-android/lib/libPocoUtil.a - /opt/poco-android/lib/libPocoXML.a - /opt/poco-android/lib/libPocoJSON.a - /opt/poco-android/lib/libPocoFoundation.a + @POCOLIB@/libPocoEncodings.a + @POCOLIB@/libPocoNet.a + @POCOLIB@/libPocoRedis.a + @POCOLIB@/libPocoUtil.a + @POCOLIB@/libPocoXML.a + @POCOLIB@/libPocoJSON.a + @POCOLIB@/libPocoFoundation.a ) diff --git a/configure.ac b/configure.ac index ad187b6fe..ad1878fe5 100644 --- a/configure.ac +++ b/configure.ac @@ -108,9 +108,9 @@ AC_ARG_WITH([lo-path], AC_ARG_WITH([lo-builddir], AS_HELP_STRING([--with-lo-builddir=<path>], - [Mandatory, and relevant, in a tree where building the iOS app. + [Mandatory, and relevant, in a tree where building the iOS or Android app. Path to a the build directory of the LibreOffice core source tree you want to use. - In addition you MUST manually edit the ios/Mobile.xcodeproj/project.pbxproj + In case of macOS, you MUST manually edit the ios/Mobile.xcodeproj/project.pbxproj file and change the references to "../ios-device" to refer to the corresponding LibreOffice core source directory (which typically would be the same as the build directory you specify with this option).])) @@ -230,6 +230,57 @@ if test -z "$anonym_msg"; then anonym_msg="no anonymization of usernames or filenames" fi +# macOS: When configuring for building the app itself, on macOS, we need these. +# But not when just configuring for building the JS on Linux, for copying over +# to the Mac. +# Android: We need these to setup the CMakeLists.txt properly. +LOBUILDDIR= +POCOINCLUDE= +POCOLIB= +if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_androidapp" = "yes" \); then + 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.]) + fi + + LOBUILDDIR="$with_lo_builddir" + # Sanity check, just a random object file in the LibreOffice build tree + if test \( "$enable_iosapp" = "yes" -a -f "$LOBUILDDIR/workdir/CxxObject/vcl/ios/iosinst.o" \) -o \( "$enable_androidapp" = "yes" -a -f "$LOBUILDDIR/workdir/LinkTarget/StaticLibrary/liblibpng.a" \); then + AC_MSG_RESULT([$LOBUILDDIR]) + else + AC_MSG_ERROR([This is not a LibreOffice core build directory: $LOBUILDDIR]) + 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.]) + fi + + POCOINCLUDE="$with_poco_includes" + # Sanity check + if test -f "$POCOINCLUDE/Poco/Poco.h"; then + AC_MSG_RESULT([$POCOINCLUDE]) + else + AC_MSG_ERROR([This is not a Poco include directory: $POCOINCLUDE]) + 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.]) + fi + + POCOLIB="$with_poco_libs" + # Sanity check + if test -f "$POCOLIB/libPocoFoundation.a"; then + AC_MSG_RESULT([$POCOLIB]) + else + AC_MSG_ERROR([This is not a Poco lib directory: $POCOLIB]) + fi +fi +AC_SUBST(LOBUILDDIR) +AC_SUBST(POCOINCLUDE) +AC_SUBST(POCOLIB) + ENABLE_IOSAPP= MOBILE_APP_NAME="Mobile" @@ -238,50 +289,6 @@ if test "$enable_iosapp" = "yes"; then if test -n "$with_iosapp_name"; then MOBILE_APP_NAME="$with_iosapp_name" fi - - # When configuring for building the app itself, on macOS, we need - # these. But not when just configuring for building the JS on - # Linux, for copying over to the Mac. - if test `uname -s` = "Darwin"; then - 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 iOS app build tree.]) - fi - - LOBUILDDIR="$with_lo_builddir" - # Sanity check, just a random object file in the LibreOffice build tree - if test -f "$LOBUILDDIR/workdir/CxxObject/vcl/ios/iosinst.o"; then - AC_MSG_RESULT([$LOBUILDDIR]) - else - AC_MSG_ERROR([This is not a LibreOffice core build directory: $LOBUILDDIR]) - 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 iOS app build tree.]) - fi - - POCOINCLUDE="$with_poco_includes" - # Sanity check - if test -f "$POCOINCLUDE/Poco/Poco.h"; then - AC_MSG_RESULT([$POCOINCLUDE]) - else - AC_MSG_ERROR([This is not a Poco include directory: $POCOINCLUDE]) - 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 iOS app build tree.]) - fi - - POCOLIB="$with_poco_libs" - # Sanity check - if test -f "$POCOLIB/libPocoFoundation.a"; then - AC_MSG_RESULT([$POCOLIB]) - else - AC_MSG_ERROR([This is not a Poco lib directory: $POCOLIB]) - fi - fi fi AC_SUBST(ENABLE_IOSAPP) AM_CONDITIONAL([ENABLE_IOSAPP], [test "$ENABLE_IOSAPP" = "true"]) @@ -653,6 +660,7 @@ AS_IF([test "$ENABLE_IOSAPP" = "true"], AC_SUBST(IOSAPP_FONTS) AC_CONFIG_FILES([Makefile + android/app/src/main/cpp/CMakeLists.txt gtk/Makefile ios/config.h ios/Mobile/Info.plist _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits