diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-12-13 23:07:45 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-12-15 19:53:44 +0100 |
commit | 79ca2a6a7c8e0102aa8e7e3af709d5cf2e4d9532 (patch) | |
tree | 58263bf5e320f65f5023d25e76e5c3e1972d1979 | |
parent | 7c22bed187c12122fe29459279771ca414799ac8 (diff) |
Simplify CURL and LIBCMIS tests
... by expanding libo_CHECK_SYSTEM_MODULE with yet an other
parameter to optionally disable the feature completely and
adding the matching AC_ARG_ENABLE.
As a result, --disable-cmis becomes --disable-libcmis.
Also adds more documentation to m4/libo_externals.m4.
And use simpler help strings, now hopefully correctly escaped.
Change-Id: I8ac67145721d8518cca6f6867bc05738a87ed77a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126771
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r-- | configure.ac | 55 | ||||
-rw-r--r-- | distro-configs/LibreOfficeOssFuzz.conf | 2 | ||||
-rw-r--r-- | m4/libo_externals.m4 | 30 |
3 files changed, 30 insertions, 57 deletions
diff --git a/configure.ac b/configure.ac index 12e90717037f..9e15af8f3f6f 100644 --- a/configure.ac +++ b/configure.ac @@ -818,7 +818,6 @@ disable_database_connectivity_dependencies() # This is also true for most test_* variables. # =================================================================== build_crypto=yes -test_cmis=yes test_gdb_index=no test_openldap=yes test_split_debug=no @@ -967,7 +966,7 @@ ios*) # iOS using_vclplug=no using_x11=no build_crypto=no - test_cmis=no + test_libcmis=no test_openldap=no test_webdav=no if test -n "$LODE_HOME" ; then @@ -1108,7 +1107,7 @@ emscripten) using_x11=no test_openldap=no enable_compiler_plugins=no - test_cmis=no + test_libcmis=no test_webdav=no enable_database_connectivity=no enable_lpsolve=no @@ -1950,16 +1949,6 @@ libo_FUZZ_ARG_ENABLE(librelogo, [Do not build LibreLogo.]), ,enable_librelogo=yes) -AC_ARG_ENABLE(cmis, - AS_HELP_STRING([--disable-cmis], - [Disable CMIS support.]), -,enable_cmis=yes) - -AC_ARG_ENABLE(curl, - AS_HELP_STRING([--disable-curl], - [Disable CURL support.]), -,enable_curl=yes) - AC_ARG_ENABLE(wasm-strip, AS_HELP_STRING([--enable-wasm-strip], [Strip the static build like for WASM/emscripten platform.]), @@ -2358,11 +2347,6 @@ AC_ARG_WITH(system-bluez, [Use bluetooth.h already on system.]),, [with_system_bluez="$with_system_headers"]) -AC_ARG_WITH(system-curl, - AS_HELP_STRING([--with-system-curl], - [Use curl already on system.]),, - [with_system_curl=auto]) - AC_ARG_WITH(system-boost, AS_HELP_STRING([--with-system-boost], [Use boost already on system.]),, @@ -5526,6 +5510,7 @@ if test "$cross_compiling" = "yes"; then --disable-gstreamer-1-0 \ --disable-gtk3 \ --disable-gtk4 \ + --disable-libcmis \ --disable-mariadb-sdbc \ --disable-nss \ --disable-online-update \ @@ -7294,14 +7279,7 @@ AC_SUBST(GPERF) dnl =================================================================== dnl Check for system libcmis dnl =================================================================== -# libcmis requires curl and we can't build curl for iOS -if test "$test_cmis" = "yes" -a "$enable_cmis" = "yes"; then - libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2]) - ENABLE_LIBCMIS=TRUE -else - ENABLE_LIBCMIS= -fi -AC_SUBST(ENABLE_LIBCMIS) +libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2],,,,TRUE) dnl =================================================================== dnl C++11 @@ -10304,30 +10282,7 @@ AC_SUBST(LIBTOMMATH_LIBS) dnl =================================================================== dnl Check for system curl dnl =================================================================== -AC_MSG_CHECKING([which libcurl to use]) -if test "$with_system_curl" = "auto"; then - with_system_curl="$with_system_libs" -fi - -if test "$enable_curl" = "yes" -a "$with_system_curl" = "yes"; then - AC_MSG_RESULT([external]) - SYSTEM_CURL=TRUE - - PKG_CHECK_MODULES(CURL, libcurl >= 7.68.0) - - ENABLE_CURL=TRUE -elif test "$enable_curl" = "no"; then - AC_MSG_RESULT([none]) -else - AC_MSG_RESULT([internal]) - SYSTEM_CURL= - BUILD_TYPE="$BUILD_TYPE CURL" - ENABLE_CURL=TRUE -fi -AC_SUBST(SYSTEM_CURL) -AC_SUBST(CURL_CFLAGS) -AC_SUBST(CURL_LIBS) -AC_SUBST(ENABLE_CURL) +libo_CHECK_SYSTEM_MODULE([curl],[CURL],[libcurl >= 7.68.0],,,,TRUE) dnl =================================================================== dnl Check for system boost diff --git a/distro-configs/LibreOfficeOssFuzz.conf b/distro-configs/LibreOfficeOssFuzz.conf index ff201815efe5..5b1d167dbc37 100644 --- a/distro-configs/LibreOfficeOssFuzz.conf +++ b/distro-configs/LibreOfficeOssFuzz.conf @@ -5,7 +5,6 @@ --disable-avmedia --disable-scripting --disable-cairo-canvas ---disable-cmis --disable-coinmp --disable-cups --disable-dbus @@ -15,6 +14,7 @@ --disable-gtk3 --disable-gui --disable-ldap +--disable-libcmis --disable-librelogo --disable-lpsolve --disable-mariadb-sdbc diff --git a/m4/libo_externals.m4 b/m4/libo_externals.m4 index b2b314fec933..dc493154a726 100644 --- a/m4/libo_externals.m4 +++ b/m4/libo_externals.m4 @@ -7,16 +7,30 @@ dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -* # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # <lowercase check>,<variable prefix>,<pkg-config query>, -# <internal CFLAGS>,<internal LIBS>,<external (default: FALSE)> +# <internal CFLAGS>,<internal LIBS>,<prefer external (default: FALSE)>, +# <can be disabled (default: FALSE)> +# +# FALSE is actually a blank value, so TRUE matches any not-blank value. +# +# Used configure.ac variables: +# - enable_$1: should normally not be set manually; use test_$1 instead +# - test_$1: set to no, if the feature shouldn't be tested at all +# - test_system_$1: set to no, if the system library should not be used +# AC_DEFUN([libo_CHECK_SYSTEM_MODULE], [ AC_ARG_WITH(system-$1, AS_HELP_STRING([m4_ifnblank([$6],[--without-system-$1],[--with-system-$1])], - [m4_ifnblank([$6], - Build and bundle the internal $1 instead of using the operating system one., - Use $1 from the operating system instead of building and bundling it.)]), + m4_ifnblank([$6], + [Build and bundle the internal $1.], + [Use $1 from the operating system.])), ,[m4_ifnblank([$6],[with_system_$1="yes"],[with_system_$1="$with_system_libs"])]) +m4_ifnblank([$7],[ + AC_ARG_ENABLE([$1], + AS_HELP_STRING([--disable-$1],[Disable $1 support.]), + ,[enable_$1="yes"]) +]) AC_MSG_CHECKING([which $1 to use]) -if test "$test_$1" != "no"; then +if test "$test_$1" != no -a "$enable_$1" != no; then ENABLE_$2=TRUE if test "$with_system_$1" = yes -a "$test_system_$1" != no; then AC_MSG_RESULT([external]) @@ -33,7 +47,11 @@ if test "$test_$1" != "no"; then BUILD_TYPE="$BUILD_TYPE $2" fi else - AC_MSG_RESULT([ignored]) + if test "$test_$1" != no -a "$enable_$1" = no; then + AC_MSG_RESULT([disabled]) + else + AC_MSG_RESULT([ignored / not supported by OS]) + fi fi AC_SUBST([ENABLE_$2]) AC_SUBST([SYSTEM_$2]) |