1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
2 dnl configure.ac serves as input for the GNU autoconf package
3 dnl in order to create a configure script.
5 # The version number in the second argument to AC_INIT should be four numbers separated by
6 # periods. Some parts of the code requires the first one to be less than 128 and the others to be less
7 # than 256. The four numbers can optionally be followed by a period and a free-form string containing
8 # no spaces or periods, like "frobozz-mumble-42" or "alpha0". If the free-form string ends with one or
9 # several non-alphanumeric characters, those are split off and used only for the
10 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
12 AC_INIT([LibreOffice],[6.4.0.0.alpha0+],[],[],[http://documentfoundation.org/])
14 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed
15 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard
16 dnl so check for the version of autoconf that is actually used to create the configure script
18 m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.68]), -1,
19 [AC_MSG_ERROR([at least autoconf version 2.68 is needed (you can use AUTOCONF environment variable to point to a suitable one)])])
21 if test -n "$BUILD_TYPE"; then
22 AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
36 CC_BASE=`first_arg_basename "$CC"`
37 CXX_BASE=`first_arg_basename "$CXX"`
41 GIT_NEEDED_SUBMODULES=""
42 LO_PATH= # used by path_munge to construct a PATH variable
49 # let's start with Fedora's paths for now
50 -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
51 # ignore it: on UNIXoids it is searched by default anyway
52 # but if it's given explicitly then it may override other paths
53 # (on macOS it would be an error to use it instead of SDK)
56 filteredlibs="$filteredlibs $f"
65 if test "$build_os" = "cygwin"; then
67 # spaces,parentheses,brackets,braces are problematic in pathname
69 case "$formatted_path" in
70 *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
74 if test "$pf_conv_to_dos" = "yes"; then
75 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
76 formatted_path=`cygpath -sm "$formatted_path"`
78 formatted_path=`cygpath -d "$formatted_path"`
80 if test $? -ne 0; then
81 AC_MSG_ERROR([path conversion failed for "$1".])
84 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
85 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
86 if test "$fp_count_slash$fp_count_colon" != "00"; then
87 if test "$fp_count_colon" = "0"; then
88 new_formatted_path=`realpath "$formatted_path"`
89 if test $? -ne 0; then
90 AC_MSG_WARN([realpath failed for "$1", not necessarily a problem.])
92 formatted_path="$new_formatted_path"
95 formatted_path=`cygpath -m "$formatted_path"`
96 if test $? -ne 0; then
97 AC_MSG_ERROR([path conversion failed for "$1".])
100 fp_count_space=`echo "$formatted_path" | $GREP -c "[ ]"`
101 if test "$fp_count_space" != "0"; then
102 AC_MSG_ERROR([converted path "$formatted_path" still contains spaces. Short filenames (8.3 filenames) support was disabled on this system?])
109 # There appears to be no simple and portable method to get an absolute and
110 # canonical path, so we try creating the directory if does not exist and
111 # utilizing the shell and pwd.
114 test ! -e "$rel" && mkdir -p "$rel"
115 if test -d "$rel" ; then
116 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
117 absolute_path="$(pwd)"
120 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
128 if test "$have_WARNINGS" = "no"; then
129 echo "*************************************" > warn
131 if which tput >/dev/null && test "`tput colors 2>/dev/null || echo 0`" -ge 8; then
132 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
133 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
135 COLORWARN="* WARNING :"
138 echo "$COLORWARN $@" >> warn
141 dnl Some Mac User have the bad habit of letting a lot of crap
142 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
143 dnl that confuse the build.
144 dnl For the ones that use LODE, let's be nice and protect them
149 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
150 dnl a common but nevertheless necessary thing that may be in a fancy
151 dnl path location is git, so make sure we have it
152 mac_git_path=`which git 2>/dev/null`
153 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
154 mac_path="$mac_path:`dirname $mac_git_path`"
156 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
157 dnl path location is gpg, so make sure we find it
158 mac_gpg_path=`which gpg 2>/dev/null`
159 if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
160 mac_path="$mac_path:`dirname $mac_gpg_path`"
168 echo "********************************************************************"
170 echo "* Running ${PACKAGE_NAME} build configuration."
172 echo "********************************************************************"
175 dnl ===================================================================
176 dnl checks build and host OSes
177 dnl do this before argument processing to allow for platform dependent defaults
178 dnl ===================================================================
181 AC_MSG_CHECKING([for product name])
182 PRODUCTNAME="AC_PACKAGE_NAME"
183 if test -n "$with_product_name" -a "$with_product_name" != no; then
184 PRODUCTNAME="$with_product_name"
186 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
187 PRODUCTNAME="${PRODUCTNAME}Dev"
189 AC_MSG_RESULT([$PRODUCTNAME])
190 AC_SUBST(PRODUCTNAME)
191 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
192 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
194 dnl ===================================================================
195 dnl Our version is defined by the AC_INIT() at the top of this script.
196 dnl ===================================================================
198 AC_MSG_CHECKING([for package version])
199 if test -n "$with_package_version" -a "$with_package_version" != no; then
200 PACKAGE_VERSION="$with_package_version"
202 AC_MSG_RESULT([$PACKAGE_VERSION])
204 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
206 LIBO_VERSION_MAJOR=$1
207 LIBO_VERSION_MINOR=$2
208 LIBO_VERSION_MICRO=$3
209 LIBO_VERSION_PATCH=$4
211 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
212 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
213 # no way to encode that into an integer in general.
214 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
216 LIBO_VERSION_SUFFIX=$5
217 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
218 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
219 # they get undoubled before actually passed to sed.
220 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
221 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
222 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
223 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
225 AC_SUBST(LIBO_VERSION_MAJOR)
226 AC_SUBST(LIBO_VERSION_MINOR)
227 AC_SUBST(LIBO_VERSION_MICRO)
228 AC_SUBST(LIBO_VERSION_PATCH)
229 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
230 AC_SUBST(LIBO_VERSION_SUFFIX)
231 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
233 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
234 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
235 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
236 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
238 LIBO_THIS_YEAR=`date +%Y`
239 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
241 dnl ===================================================================
243 dnl ===================================================================
244 AC_MSG_CHECKING([for product version])
245 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
246 AC_MSG_RESULT([$PRODUCTVERSION])
247 AC_SUBST(PRODUCTVERSION)
250 # AC_PROG_EGREP doesn't set GREP on all systems as well
251 AC_PATH_PROG(GREP, grep)
259 dnl ======================================
260 dnl Required GObject introspection version
261 dnl ======================================
262 INTROSPECTION_REQUIRED_VERSION=1.32.0
264 dnl ===================================================================
265 dnl Search all the common names for GNU Make
266 dnl ===================================================================
267 AC_MSG_CHECKING([for GNU Make])
269 # try to use our own make if it is available and GNUMAKE was not already defined
270 if test -z "$GNUMAKE"; then
271 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
272 GNUMAKE="$LODE_HOME/opt/bin/make"
273 elif test -x "/opt/lo/bin/make"; then
274 GNUMAKE="/opt/lo/bin/make"
279 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
280 if test -n "$a"; then
281 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
282 if test $? -eq 0; then
283 if test "$build_os" = "cygwin"; then
284 if test -n "$($a -v | grep 'Built for Windows')" ; then
285 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
286 GNUMAKE_WIN_NATIVE="TRUE"
297 AC_MSG_RESULT($GNUMAKE)
298 if test -z "$GNUMAKE"; then
299 AC_MSG_ERROR([not found. install GNU Make.])
301 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
302 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
306 win_short_path_for_make()
308 local_short_path="$1"
309 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
310 cygpath -sm "$local_short_path"
312 cygpath -u "$(cygpath -d "$local_short_path")"
317 if test "$build_os" = "cygwin"; then
318 PathFormat "$SRC_ROOT"
319 SRC_ROOT="$formatted_path"
320 PathFormat "$BUILDDIR"
321 BUILDDIR="$formatted_path"
323 AC_MSG_CHECKING(for explicit COMSPEC)
324 if test -z "$COMSPEC"; then
325 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
327 AC_MSG_RESULT([found: $COMSPEC])
334 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
335 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
337 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
338 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
341 # need sed in os checks...
342 AC_PATH_PROGS(SED, sed)
343 if test -z "$SED"; then
344 AC_MSG_ERROR([install sed to run this script])
347 # Set the ENABLE_LTO variable
348 # ===================================================================
349 AC_MSG_CHECKING([whether to use link-time optimization])
350 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
353 AC_DEFINE(STATIC_LINKING)
360 AC_ARG_ENABLE(fuzz-options,
361 AS_HELP_STRING([--enable-fuzz-options],
362 [Randomly enable or disable each of those configurable options
363 that are supposed to be freely selectable without interdependencies,
364 or where bad interaction from interdependencies is automatically avoided.])
367 dnl ===================================================================
368 dnl When building for Android, --with-android-ndk,
369 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
371 dnl ===================================================================
373 AC_ARG_WITH(android-ndk,
374 AS_HELP_STRING([--with-android-ndk],
375 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
378 AC_ARG_WITH(android-ndk-toolchain-version,
379 AS_HELP_STRING([--with-android-ndk-toolchain-version],
380 [Specify which toolchain version to use, of those present in the
381 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
382 with_android_ndk_toolchain_version=clang5.0)
384 AC_ARG_WITH(android-sdk,
385 AS_HELP_STRING([--with-android-sdk],
386 [Specify location of the Android SDK. Mandatory when building for Android.]),
390 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
391 with_android_ndk="$SRC_ROOT/external/android-ndk"
393 if test -n "$with_android_ndk"; then
394 ANDROID_NDK_HOME=$with_android_ndk
396 # Set up a lot of pre-canned defaults
398 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
399 if test ! -f $ANDROID_NDK_HOME/source.properties; then
400 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
402 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
404 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
406 if test -z "$ANDROID_NDK_VERSION"; then
407 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
409 case $ANDROID_NDK_VERSION in
411 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
413 11.1.*|12.1.*|13.1.*|14.1.*)
414 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
416 16.*|17.*|18.*|19.*|20.*)
419 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk.])
420 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk."
425 android_cpu=$host_cpu
426 if test $host_cpu = arm; then
427 android_platform_prefix=arm-linux-androideabi
428 android_gnu_prefix=$android_platform_prefix
429 LLVM_TRIPLE=armv7a-linux-androideabi
430 ANDROID_APP_ABI=armeabi-v7a
431 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
432 elif test $host_cpu = aarch64; then
433 android_platform_prefix=aarch64-linux-android
434 android_gnu_prefix=$android_platform_prefix
435 LLVM_TRIPLE=$android_platform_prefix
436 # minimum android version that supports aarch64
438 ANDROID_APP_ABI=arm64-v8a
440 # host_cpu is something like "i386" or "i686" I guess, NDK uses
441 # "x86" in some contexts
443 android_platform_prefix=$android_cpu
444 android_gnu_prefix=i686-linux-android
445 LLVM_TRIPLE=$android_gnu_prefix
449 case "$with_android_ndk_toolchain_version" in
451 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
454 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
457 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
458 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
459 # manage to link the (app-specific) single huge .so that is built for the app in
460 # android/source/ if there is debug information in a significant part of the object files.
461 # (A 64-bit ld.gold grows too much over 10 gigabytes of virtual space when linking such a .so if
462 # all objects have been built with debug information.)
465 android_HOST_TAG=linux-x86_64
468 android_HOST_TAG=darwin-x86_64
471 AC_MSG_ERROR([We only support building for Android from Linux or macOS])
472 # ndk would also support windows and windows-x86_64
475 android_TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$android_HOST_TAG
476 ANDROID_COMPILER_BIN=$android_TOOLCHAIN/bin
477 dnl TODO: NSS build uses it...
478 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG
479 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
481 test -z "$AR" && AR=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ar
482 test -z "$NM" && NM=$ANDROID_COMPILER_BIN/$android_gnu_prefix-nm
483 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-objdump
484 test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ranlib
485 test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-strip
487 ANDROIDCFLAGS="$ANDROIDCFLAGS -target ${LLVM_TRIPLE}${ANDROID_API_LEVEL}"
488 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes -ffunction-sections -fdata-sections -Qunused-arguments"
489 if test "$ENABLE_LTO" = TRUE; then
490 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
491 # $CC and $CXX when building external libraries
492 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
495 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -stdlib=libc++"
497 if test -z "$CC"; then
498 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
501 if test -z "$CXX"; then
502 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
506 # remember to download the ownCloud Android library later
507 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
509 AC_SUBST(ANDROID_NDK_HOME)
510 AC_SUBST(ANDROID_APP_ABI)
511 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
513 dnl ===================================================================
514 dnl --with-android-sdk
515 dnl ===================================================================
517 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
518 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
520 if test -n "$with_android_sdk"; then
521 ANDROID_SDK_HOME=$with_android_sdk
522 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
524 AC_SUBST(ANDROID_SDK_HOME)
526 libo_FUZZ_ARG_ENABLE([android-editing],
527 AS_HELP_STRING([--enable-android-editing],
528 [Enable the experimental editing feature on Android.])
530 ENABLE_ANDROID_EDITING=
531 if test "$enable_android_editing" = yes; then
532 ENABLE_ANDROID_EDITING=TRUE
534 AC_SUBST([ENABLE_ANDROID_EDITING])
536 dnl ===================================================================
537 dnl The following is a list of supported systems.
538 dnl Sequential to keep the logic very simple
539 dnl These values may be checked and reset later.
540 dnl ===================================================================
541 #defaults unless the os test overrides this:
551 # Default values, as such probably valid just for Linux, set
552 # differently below just for Mac OSX, but at least better than
553 # hardcoding these as we used to do. Much of this is duplicated also
554 # in solenv for old build system and for gbuild, ideally we should
555 # perhaps define stuff like this only here in configure.ac?
557 LINKFLAGSSHL="-shared"
561 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
564 INSTROOTCONTENTSUFFIX=
571 build_gstreamer_1_0=yes
575 dnl ===========================================================
576 dnl Check whether we're using Solaris 10 - SPARC or Intel.
577 dnl ===========================================================
578 AC_MSG_CHECKING([the Solaris operating system release])
579 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
580 if test "$_os_release" -lt "10"; then
581 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
583 AC_MSG_RESULT([ok ($_os_release)])
586 dnl Check whether we're using a SPARC or i386 processor
587 AC_MSG_CHECKING([the processor type])
588 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
589 AC_MSG_RESULT([ok ($host_cpu)])
591 AC_MSG_ERROR([only SPARC and i386 processors are supported])
595 linux-gnu*|k*bsd*-gnu*)
597 build_gstreamer_1_0=yes
602 if test "$enable_fuzzers" != yes; then
608 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
621 # When building on Windows normally with MSVC under Cygwin,
622 # configure thinks that the host platform (the platform the
623 # built code will run on) is Cygwin, even if it obviously is
624 # Windows, which in Autoconf terminology is called
625 # "mingw32". (Which is misleading as MinGW is the name of the
626 # tool-chain, not an operating system.)
628 # Somewhat confusing, yes. But this configure script doesn't
629 # look at $host etc that much, it mostly uses its own $_os
630 # variable, set here in this case statement.
644 darwin*) # macOS or iOS
651 if test -n "$LODE_HOME" ; then
653 AC_MSG_NOTICE([sanitized the PATH to $PATH])
655 if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
660 enable_mpl_subset=yes
661 enable_lotuswordpro=no
664 enable_postgresql_sdbc=no
665 enable_extension_integration=no
666 enable_report_builder=no
668 if test "$enable_ios_simulator" = "yes"; then
669 host=x86_64-apple-darwin
673 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
674 INSTROOTCONTENTSUFFIX=/Contents
675 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
677 # See comment above the case "$host_os"
678 LINKFLAGSSHL="-dynamiclib -single_module"
685 # -undefined error is the default
691 build_gstreamer_1_0=yes
695 AC_MSG_CHECKING([the FreeBSD operating system release])
696 if test -n "$with_os_version"; then
697 OSVERSION="$with_os_version"
699 OSVERSION=`/sbin/sysctl -n kern.osreldate`
701 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
702 AC_MSG_CHECKING([which thread library to use])
703 if test "$OSVERSION" -lt "500016"; then
704 PTHREAD_CFLAGS="-D_THREAD_SAFE"
705 PTHREAD_LIBS="-pthread"
706 elif test "$OSVERSION" -lt "502102"; then
707 PTHREAD_CFLAGS="-D_THREAD_SAFE"
711 PTHREAD_LIBS="-pthread"
713 AC_MSG_RESULT([$PTHREAD_LIBS])
719 build_gstreamer_1_0=yes
723 PTHREAD_LIBS="-pthread -lpthread"
730 PTHREAD_LIBS=-pthread
737 PTHREAD_CFLAGS="-D_THREAD_SAFE"
738 PTHREAD_LIBS="-pthread"
744 build_gstreamer_1_0=yes
748 PTHREAD_LIBS="-pthread"
753 build_gstreamer_1_0=no
754 enable_lotuswordpro=no
755 enable_mpl_subset=yes
758 enable_report_builder=no
760 enable_postgresql_sdbc=no
774 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
775 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
785 enable_gstreamer_1_0=no
790 enable_postgresql_sdbc=no
791 enable_firebird_sdbc=no
796 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
800 if test "$_os" = "Android" ; then
801 # Verify that the NDK and SDK options are proper
802 if test -z "$with_android_ndk"; then
803 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
804 elif test ! -f "$ANDROID_NDK_HOME/meta/abis.json"; then
805 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
808 if test -z "$ANDROID_SDK_HOME"; then
809 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
810 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
811 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
814 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
815 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
816 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
817 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
818 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
819 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
820 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
821 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
823 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
824 AC_MSG_WARN([android support repository not found - install with
825 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
826 to allow the build to download the specified version of the android support libraries])
827 add_warning "android support repository not found - install with"
828 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
829 add_warning "to allow the build to download the specified version of the android support libraries"
833 if test "$_os" = "AIX"; then
834 AC_PATH_PROG(GAWK, gawk)
835 if test -z "$GAWK"; then
836 AC_MSG_ERROR([gawk not found in \$PATH])
842 AC_SUBST(PTHREAD_CFLAGS)
843 AC_SUBST(PTHREAD_LIBS)
845 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
846 # By default use the ones specified by our build system,
847 # but explicit override is possible.
848 AC_MSG_CHECKING(for explicit AFLAGS)
849 if test -n "$AFLAGS"; then
850 AC_MSG_RESULT([$AFLAGS])
856 AC_MSG_CHECKING(for explicit CFLAGS)
857 if test -n "$CFLAGS"; then
858 AC_MSG_RESULT([$CFLAGS])
864 AC_MSG_CHECKING(for explicit CXXFLAGS)
865 if test -n "$CXXFLAGS"; then
866 AC_MSG_RESULT([$CXXFLAGS])
872 AC_MSG_CHECKING(for explicit OBJCFLAGS)
873 if test -n "$OBJCFLAGS"; then
874 AC_MSG_RESULT([$OBJCFLAGS])
880 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
881 if test -n "$OBJCXXFLAGS"; then
882 AC_MSG_RESULT([$OBJCXXFLAGS])
888 AC_MSG_CHECKING(for explicit LDFLAGS)
889 if test -n "$LDFLAGS"; then
890 AC_MSG_RESULT([$LDFLAGS])
900 AC_SUBST(OBJCXXFLAGS)
905 AC_SUBST(x_OBJCFLAGS)
906 AC_SUBST(x_OBJCXXFLAGS)
909 dnl These are potentially set for MSVC, in the code checking for UCRT below:
910 my_original_CFLAGS=$CFLAGS
911 my_original_CXXFLAGS=$CXXFLAGS
912 my_original_CPPFLAGS=$CPPFLAGS
914 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
915 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
916 dnl AC_PROG_CC internally.
917 if test "$_os" != "WINNT"; then
918 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
922 if test -z "$CC_BASE"; then
923 CC_BASE=`first_arg_basename "$CC"`
927 if test "$_os" != "WINNT"; then
928 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
934 if test $_os != "WINNT"; then
936 AC_SEARCH_LIBS([dlsym], [dl],
937 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
938 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
941 AC_SUBST(DLOPEN_LIBS)
943 AC_ARG_ENABLE(ios-simulator,
944 AS_HELP_STRING([--enable-ios-simulator],
945 [build i386 or x86_64 for ios simulator])
948 AC_ARG_ENABLE(ios-libreofficelight-app,
949 AS_HELP_STRING([--enable-ios-libreofficelight-app],
950 [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
951 (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
952 and also that its actual build (in Xcode) requires some obvious modifications to the project.])
955 ENABLE_IOS_LIBREOFFICELIGHT_APP=
956 if test "$enable_ios_libreofficelight_app" = yes; then
957 ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
959 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
961 ###############################################################################
962 # Extensions switches --enable/--disable
963 ###############################################################################
964 # By default these should be enabled unless having extra dependencies.
965 # If there is extra dependency over configure options then the enable should
966 # be automagic based on whether the requiring feature is enabled or not.
967 # All this options change anything only with --enable-extension-integration.
969 # The name of this option and its help string makes it sound as if
970 # extensions are built anyway, just not integrated in the installer,
971 # if you use --disable-extension-integration. Is that really the
974 libo_FUZZ_ARG_ENABLE(extension-integration,
975 AS_HELP_STRING([--disable-extension-integration],
976 [Disable integration of the built extensions in the installer of the
977 product. Use this switch to disable the integration.])
980 AC_ARG_ENABLE(avmedia,
981 AS_HELP_STRING([--disable-avmedia],
982 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
985 AC_ARG_ENABLE(database-connectivity,
986 AS_HELP_STRING([--disable-database-connectivity],
987 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
990 # This doesn't mean not building (or "integrating") extensions
991 # (although it probably should; i.e. it should imply
992 # --disable-extension-integration I guess), it means not supporting
993 # any extension mechanism at all
994 libo_FUZZ_ARG_ENABLE(extensions,
995 AS_HELP_STRING([--disable-extensions],
996 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
999 AC_ARG_ENABLE(scripting,
1000 AS_HELP_STRING([--disable-scripting],
1001 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1004 # This is mainly for Android and iOS, but could potentially be used in some
1005 # special case otherwise, too, so factored out as a separate setting
1007 AC_ARG_ENABLE(dynamic-loading,
1008 AS_HELP_STRING([--disable-dynamic-loading],
1009 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1012 libo_FUZZ_ARG_ENABLE(report-builder,
1013 AS_HELP_STRING([--disable-report-builder],
1014 [Disable the Report Builder.])
1017 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1018 AS_HELP_STRING([--enable-ext-wiki-publisher],
1019 [Enable the Wiki Publisher extension.])
1022 libo_FUZZ_ARG_ENABLE(lpsolve,
1023 AS_HELP_STRING([--disable-lpsolve],
1024 [Disable compilation of the lp solve solver ])
1026 libo_FUZZ_ARG_ENABLE(coinmp,
1027 AS_HELP_STRING([--disable-coinmp],
1028 [Disable compilation of the CoinMP solver ])
1031 libo_FUZZ_ARG_ENABLE(pdfimport,
1032 AS_HELP_STRING([--disable-pdfimport],
1033 [Disable building the PDF import feature.])
1036 libo_FUZZ_ARG_ENABLE(pdfium,
1037 AS_HELP_STRING([--disable-pdfium],
1038 [Disable building PDFium.])
1041 ###############################################################################
1043 dnl ---------- *** ----------
1045 libo_FUZZ_ARG_ENABLE(mergelibs,
1046 AS_HELP_STRING([--enable-mergelibs],
1047 [Merge several of the smaller libraries into one big, "merged", one.])
1050 libo_FUZZ_ARG_ENABLE(breakpad,
1051 AS_HELP_STRING([--enable-breakpad],
1052 [Enables breakpad for crash reporting.])
1055 AC_ARG_ENABLE(fetch-external,
1056 AS_HELP_STRING([--disable-fetch-external],
1057 [Disables fetching external tarballs from web sources.])
1060 AC_ARG_ENABLE(fuzzers,
1061 AS_HELP_STRING([--enable-fuzzers],
1062 [Enables building libfuzzer targets for fuzz testing.])
1065 libo_FUZZ_ARG_ENABLE(pch,
1066 AS_HELP_STRING([--enable-pch=<yes/no/system/base/normal/full>],
1067 [Enables precompiled header support for C++. Forced default on Windows/VC build.
1068 Using 'system' will include only external headers, 'base' will add also headers
1069 from base modules, 'normal' will also add all headers except from the module built,
1070 'full' will use all suitable headers even from a module itself.])
1073 libo_FUZZ_ARG_ENABLE(epm,
1074 AS_HELP_STRING([--enable-epm],
1075 [LibreOffice includes self-packaging code, that requires epm, however epm is
1076 useless for large scale package building.])
1079 libo_FUZZ_ARG_ENABLE(odk,
1080 AS_HELP_STRING([--disable-odk],
1081 [LibreOffice includes an ODK, office development kit which some packagers may
1082 wish to build without.])
1085 AC_ARG_ENABLE(mpl-subset,
1086 AS_HELP_STRING([--enable-mpl-subset],
1087 [Don't compile any pieces which are not MPL or more liberally licensed])
1090 libo_FUZZ_ARG_ENABLE(evolution2,
1091 AS_HELP_STRING([--enable-evolution2],
1092 [Allows the built-in evolution 2 addressbook connectivity build to be
1096 AC_ARG_ENABLE(avahi,
1097 AS_HELP_STRING([--enable-avahi],
1098 [Determines whether to use Avahi to advertise Impress to remote controls.])
1101 libo_FUZZ_ARG_ENABLE(werror,
1102 AS_HELP_STRING([--enable-werror],
1103 [Turn warnings to errors. (Has no effect in modules where the treating
1104 of warnings as errors is disabled explicitly.)]),
1107 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1108 AS_HELP_STRING([--enable-assert-always-abort],
1109 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1112 libo_FUZZ_ARG_ENABLE(dbgutil,
1113 AS_HELP_STRING([--enable-dbgutil],
1114 [Provide debugging support from --enable-debug and include additional debugging
1115 utilities such as object counting or more expensive checks.
1116 This is the recommended option for developers.
1117 Note that this makes the build ABI incompatible, it is not possible to mix object
1118 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1120 libo_FUZZ_ARG_ENABLE(debug,
1121 AS_HELP_STRING([--enable-debug],
1122 [Include debugging information, disable compiler optimization and inlining plus
1123 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1125 libo_FUZZ_ARG_ENABLE(split-debug,
1126 AS_HELP_STRING([--disable-split-debug],
1127 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1128 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1130 libo_FUZZ_ARG_ENABLE(gdb-index,
1131 AS_HELP_STRING([--disable-gdb-index],
1132 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1133 The feature requires the gold or lld linker.]))
1135 libo_FUZZ_ARG_ENABLE(sal-log,
1136 AS_HELP_STRING([--enable-sal-log],
1137 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1139 libo_FUZZ_ARG_ENABLE(symbols,
1140 AS_HELP_STRING([--enable-symbols],
1141 [Generate debug information.
1142 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1143 otherwise. It is possible to explicitly specify gbuild build targets
1144 (where 'all' means everything, '-' prepended means to not enable, '/' appended means
1145 everything in the directory; there is no ordering, more specific overrides
1146 more general, and disabling takes precedence).
1147 Example: --enable-symbols="all -sw/ -Library_sc".]))
1149 libo_FUZZ_ARG_ENABLE(optimized,
1150 AS_HELP_STRING([--disable-optimized],
1151 [Whether to compile with optimization flags.
1152 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1155 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1156 AS_HELP_STRING([--disable-runtime-optimizations],
1157 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1158 JVM JIT) that are known to interact badly with certain dynamic analysis
1159 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1160 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1161 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1163 AC_ARG_WITH(valgrind,
1164 AS_HELP_STRING([--with-valgrind],
1165 [Make availability of Valgrind headers a hard requirement.]))
1167 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1168 AS_HELP_STRING([--enable-compiler-plugins],
1169 [Enable compiler plugins that will perform additional checks during
1170 building. Enabled automatically by --enable-dbgutil.
1171 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1172 COMPILER_PLUGINS_DEBUG=
1173 if test "$enable_compiler_plugins" = debug; then
1174 enable_compiler_plugins=yes
1175 COMPILER_PLUGINS_DEBUG=TRUE
1178 libo_FUZZ_ARG_ENABLE(ooenv,
1179 AS_HELP_STRING([--disable-ooenv],
1180 [Disable ooenv for the instdir installation.]))
1182 libo_FUZZ_ARG_ENABLE(libnumbertext,
1183 AS_HELP_STRING([--disable-libnumbertext],
1184 [Disable use of numbertext external library.]))
1187 AS_HELP_STRING([--enable-lto],
1188 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1189 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1190 linker. For MSVC, this option is broken at the moment. This is experimental work
1191 in progress that shouldn't be used unless you are working on it.)]))
1193 AC_ARG_ENABLE(python,
1194 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1195 [Enables or disables Python support at run-time.
1196 Also specifies what Python to use. 'auto' is the default.
1197 'fully-internal' even forces the internal version for uses of Python
1198 during the build.]))
1200 libo_FUZZ_ARG_ENABLE(gtk,
1201 AS_HELP_STRING([--disable-gtk],
1202 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
1203 ,test "${enable_gtk+set}" = set || enable_gtk=yes)
1205 libo_FUZZ_ARG_ENABLE(gtk3,
1206 AS_HELP_STRING([--disable-gtk3],
1207 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1208 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1210 AC_ARG_ENABLE(introspection,
1211 AS_HELP_STRING([--enable-introspection],
1212 [Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
1213 Linux distributions.)]))
1215 AC_ARG_ENABLE(split-app-modules,
1216 AS_HELP_STRING([--enable-split-app-modules],
1217 [Split file lists for app modules, e.g. base, calc.
1218 Has effect only with make distro-pack-install]),
1221 AC_ARG_ENABLE(split-opt-features,
1222 AS_HELP_STRING([--enable-split-opt-features],
1223 [Split file lists for some optional features, e.g. pyuno, testtool.
1224 Has effect only with make distro-pack-install]),
1227 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1228 AS_HELP_STRING([--disable-cairo-canvas],
1229 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1232 libo_FUZZ_ARG_ENABLE(dbus,
1233 AS_HELP_STRING([--disable-dbus],
1234 [Determines whether to enable features that depend on dbus.
1235 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1236 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1238 libo_FUZZ_ARG_ENABLE(sdremote,
1239 AS_HELP_STRING([--disable-sdremote],
1240 [Determines whether to enable Impress remote control (i.e. the server component).]),
1241 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1243 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1244 AS_HELP_STRING([--disable-sdremote-bluetooth],
1245 [Determines whether to build sdremote with bluetooth support.
1246 Requires dbus on Linux.]))
1248 libo_FUZZ_ARG_ENABLE(gio,
1249 AS_HELP_STRING([--disable-gio],
1250 [Determines whether to use the GIO support.]),
1251 ,test "${enable_gio+set}" = set || enable_gio=yes)
1254 AS_HELP_STRING([--enable-qt5],
1255 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1260 AS_HELP_STRING([--enable-kf5],
1261 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1262 KF5 are available.]),
1266 AS_HELP_STRING([--enable-kde5],
1267 [Compatibility switch for the kde5 => kf5 rename. Use --enable-kf5!])
1270 AC_ARG_ENABLE(gtk3_kde5,
1271 AS_HELP_STRING([--enable-gtk3-kde5],
1272 [Determines whether to use Gtk3 vclplug with KF5 file dialogs on
1273 platforms where Gtk3, Qt5 and Plasma is available.]),
1277 AS_HELP_STRING([--disable-gui],
1278 [Disable use of X11 or Wayland to reduce dependencies. Not related to the --headless
1279 command-line option. Not related to LibreOffice Online functionality. Don't use
1280 unless you are certain you need to. Nobody will help you if you insist on trying
1281 this and run into problems.]),
1284 libo_FUZZ_ARG_ENABLE(randr,
1285 AS_HELP_STRING([--disable-randr],
1286 [Disable RandR support in the vcl project.]),
1287 ,test "${enable_randr+set}" = set || enable_randr=yes)
1289 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1290 AS_HELP_STRING([--disable-gstreamer-1-0],
1291 [Disable building with the gstreamer 1.0 avmedia backend.]),
1292 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1294 libo_FUZZ_ARG_ENABLE(vlc,
1295 AS_HELP_STRING([--enable-vlc],
1296 [Enable building with the (experimental) VLC avmedia backend.]),
1297 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1299 libo_FUZZ_ARG_ENABLE(neon,
1300 AS_HELP_STRING([--disable-neon],
1301 [Disable neon and the compilation of webdav binding.]),
1304 libo_FUZZ_ARG_ENABLE([eot],
1305 [AS_HELP_STRING([--enable-eot],
1306 [Enable support for Embedded OpenType fonts.])],
1307 ,test "${enable_eot+set}" = set || enable_eot=no)
1309 libo_FUZZ_ARG_ENABLE(cve-tests,
1310 AS_HELP_STRING([--disable-cve-tests],
1311 [Prevent CVE tests to be executed]),
1314 libo_FUZZ_ARG_ENABLE(chart-tests,
1315 AS_HELP_STRING([--enable-chart-tests],
1316 [Executes chart XShape tests. In a perfect world these tests would be
1317 stable and everyone could run them, in reality it is best to run them
1318 only on a few machines that are known to work and maintained by people
1319 who can judge if a test failure is a regression or not.]),
1322 AC_ARG_ENABLE(build-unowinreg,
1323 AS_HELP_STRING([--enable-build-unowinreg],
1324 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1325 compiler is needed on Linux.]),
1328 AC_ARG_ENABLE(build-opensymbol,
1329 AS_HELP_STRING([--enable-build-opensymbol],
1330 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1331 fontforge installed.]),
1334 AC_ARG_ENABLE(dependency-tracking,
1335 AS_HELP_STRING([--enable-dependency-tracking],
1336 [Do not reject slow dependency extractors.])[
1337 --disable-dependency-tracking
1338 Disables generation of dependency information.
1339 Speed up one-time builds.],
1342 AC_ARG_ENABLE(icecream,
1343 AS_HELP_STRING([--enable-icecream],
1344 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1345 It defaults to /opt/icecream for the location of the icecream gcc/g++
1346 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1350 AS_HELP_STRING([--enable-ld=<linker>],
1351 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1352 By default tries to use the best linker possible, use --disable-ld to use the default linker.]),
1355 libo_FUZZ_ARG_ENABLE(cups,
1356 AS_HELP_STRING([--disable-cups],
1357 [Do not build cups support.])
1360 AC_ARG_ENABLE(ccache,
1361 AS_HELP_STRING([--disable-ccache],
1362 [Do not try to use ccache automatically.
1363 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1364 CC/CXX are not yet set, and --enable-icecream is not given, we
1365 attempt to use ccache. --disable-ccache disables ccache completely.
1366 Additionally ccache's depend mode is enabled if possible,
1367 use --enable-ccache=nodepend to enable ccache without depend mode.
1371 AC_ARG_ENABLE(64-bit,
1372 AS_HELP_STRING([--enable-64-bit],
1373 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1374 At the moment meaningful only for Windows.]), ,)
1376 libo_FUZZ_ARG_ENABLE(online-update,
1377 AS_HELP_STRING([--enable-online-update],
1378 [Enable the online update service that will check for new versions of
1379 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1380 If the value is "mar", the experimental Mozilla-like update will be
1381 enabled instead of the traditional update mechanism.]),
1384 AC_ARG_WITH(update-config,
1385 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1386 [Path to the update config ini file]))
1388 libo_FUZZ_ARG_ENABLE(extension-update,
1389 AS_HELP_STRING([--disable-extension-update],
1390 [Disable possibility to update installed extensions.]),
1393 libo_FUZZ_ARG_ENABLE(release-build,
1394 AS_HELP_STRING([--enable-release-build],
1395 [Enable release build. Note that the "release build" choice is orthogonal to
1396 whether symbols are present, debug info is generated, or optimization
1398 See http://wiki.documentfoundation.org/Development/DevBuild]),
1401 AC_ARG_ENABLE(windows-build-signing,
1402 AS_HELP_STRING([--enable-windows-build-signing],
1403 [Enable signing of windows binaries (*.exe, *.dll)]),
1406 AC_ARG_ENABLE(silent-msi,
1407 AS_HELP_STRING([--enable-silent-msi],
1408 [Enable MSI with LIMITUI=1 (silent install).]),
1411 AC_ARG_ENABLE(macosx-code-signing,
1412 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1413 [Sign executables, dylibs, frameworks and the app bundle. If you
1414 don't provide an identity the first suitable certificate
1415 in your keychain is used.]),
1418 AC_ARG_ENABLE(macosx-package-signing,
1419 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1420 [Create a .pkg suitable for uploading to the Mac App Store and sign
1421 it. If you don't provide an identity the first suitable certificate
1422 in your keychain is used.]),
1425 AC_ARG_ENABLE(macosx-sandbox,
1426 AS_HELP_STRING([--enable-macosx-sandbox],
1427 [Make the app bundle run in a sandbox. Requires code signing.
1428 Is required by apps distributed in the Mac App Store, and implies
1429 adherence to App Store rules.]),
1432 AC_ARG_WITH(macosx-bundle-identifier,
1433 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1434 [Define the macOS bundle identifier. Default is the somewhat weird
1435 org.libreoffice.script ("script", huh?).]),
1436 ,with_macosx_bundle_identifier=org.libreoffice.script)
1438 AC_ARG_WITH(product-name,
1439 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1440 [Define the product name. Default is AC_PACKAGE_NAME.]),
1441 ,with_product_name=$PRODUCTNAME)
1443 AC_ARG_WITH(package-version,
1444 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1445 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1448 libo_FUZZ_ARG_ENABLE(readonly-installset,
1449 AS_HELP_STRING([--enable-readonly-installset],
1450 [Prevents any attempts by LibreOffice to write into its installation. That means
1451 at least that no "system-wide" extensions can be added. Partly experimental work in
1452 progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
1455 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1456 AS_HELP_STRING([--disable-postgresql-sdbc],
1457 [Disable the build of the PostgreSQL-SDBC driver.])
1460 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1461 AS_HELP_STRING([--disable-lotuswordpro],
1462 [Disable the build of the Lotus Word Pro filter.]),
1463 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1465 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1466 AS_HELP_STRING([--disable-firebird-sdbc],
1467 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1468 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1470 AC_ARG_ENABLE(bogus-pkg-config,
1471 AS_HELP_STRING([--enable-bogus-pkg-config],
1472 [MACOSX only: on MacOSX pkg-config can cause trouble. by default if one is found in the PATH, an error is issued. This flag turn that error into a warning.]),
1475 AC_ARG_ENABLE(openssl,
1476 AS_HELP_STRING([--disable-openssl],
1477 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1478 components will either use GNUTLS or NSS. Work in progress,
1479 use only if you are hacking on it.]),
1480 ,enable_openssl=yes)
1482 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1483 AS_HELP_STRING([--enable-cipher-openssl-backend],
1484 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1485 Requires --enable-openssl.]))
1487 AC_ARG_ENABLE(library-bin-tar,
1488 AS_HELP_STRING([--enable-library-bin-tar],
1489 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1490 Some libraries can save their build result in a tarball
1491 stored in TARFILE_LOCATION. That binary tarball is
1492 uniquely identified by the source tarball,
1493 the content of the config_host.mk file and the content
1494 of the top-level directory in core for that library
1495 If this option is enabled, then if such a tarfile exist, it will be untarred
1496 instead of the source tarfile, and the build step will be skipped for that
1498 If a proper tarfile does not exist, then the normal source-based
1499 build is done for that library and a proper binary tarfile is created
1500 for the next time.]),
1503 AC_ARG_ENABLE(dconf,
1504 AS_HELP_STRING([--disable-dconf],
1505 [Disable the dconf configuration backend (enabled by default where
1508 libo_FUZZ_ARG_ENABLE(formula-logger,
1510 [--enable-formula-logger],
1511 [Enable formula logger for logging formula calculation flow in Calc.]
1516 AS_HELP_STRING([--disable-ldap],
1517 [Disable LDAP support.]),
1520 dnl ===================================================================
1521 dnl Optional Packages (--with/without-)
1522 dnl ===================================================================
1524 AC_ARG_WITH(gcc-home,
1525 AS_HELP_STRING([--with-gcc-home],
1526 [Specify the location of gcc/g++ manually. This can be used in conjunction
1527 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1528 non-default path.]),
1531 AC_ARG_WITH(gnu-patch,
1532 AS_HELP_STRING([--with-gnu-patch],
1533 [Specify location of GNU patch on Solaris or FreeBSD.]),
1536 AC_ARG_WITH(build-platform-configure-options,
1537 AS_HELP_STRING([--with-build-platform-configure-options],
1538 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1542 AS_HELP_STRING([--with-gnu-cp],
1543 [Specify location of GNU cp on Solaris or FreeBSD.]),
1546 AC_ARG_WITH(external-tar,
1547 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1548 [Specify an absolute path of where to find (and store) tarfiles.]),
1549 TARFILE_LOCATION=$withval ,
1552 AC_ARG_WITH(referenced-git,
1553 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1554 [Specify another checkout directory to reference. This makes use of
1555 git submodule update --reference, and saves a lot of diskspace
1556 when having multiple trees side-by-side.]),
1557 GIT_REFERENCE_SRC=$withval ,
1560 AC_ARG_WITH(linked-git,
1561 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1562 [Specify a directory where the repositories of submodules are located.
1563 This uses a method similar to git-new-workdir to get submodules.]),
1564 GIT_LINK_SRC=$withval ,
1567 AC_ARG_WITH(galleries,
1568 AS_HELP_STRING([--with-galleries],
1569 [Specify how galleries should be built. It is possible either to
1570 build these internally from source ("build"),
1571 or to disable them ("no")]),
1575 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1576 [Choose which themes to include. By default those themes with an '*' are included.
1577 Possible choices: *breeze, *breeze_dark, *breeze_svg, *colibre, *colibre_svg, *elementary,
1578 *elementary_svg, *karasa_jaga, *sifr, *sif_svg, *sifr_dark, *tango.]),
1581 libo_FUZZ_ARG_WITH(helppack-integration,
1582 AS_HELP_STRING([--without-helppack-integration],
1583 [It will not integrate the helppacks to the installer
1584 of the product. Please use this switch to use the online help
1585 or separate help packages.]),
1588 libo_FUZZ_ARG_WITH(fonts,
1589 AS_HELP_STRING([--without-fonts],
1590 [LibreOffice includes some third-party fonts to provide a reliable basis for
1591 help content, templates, samples, etc. When these fonts are already
1592 known to be available on the system then you should use this option.]),
1596 AS_HELP_STRING([--with-epm],
1597 [Decides which epm to use. Default is to use the one from the system if
1598 one is built. When either this is not there or you say =internal epm
1602 AC_ARG_WITH(package-format,
1603 AS_HELP_STRING([--with-package-format],
1604 [Specify package format(s) for LibreOffice installation sets. The
1605 implicit --without-package-format leads to no installation sets being
1606 generated. Possible values: aix, archive, bsd, deb, dmg,
1607 installed, msi, pkg, and rpm.
1608 Example: --with-package-format='deb rpm']),
1612 AS_HELP_STRING([--with-tls],
1613 [Decides which TLS/SSL and cryptographic implementations to use for
1614 LibreOffice's code. Notice that this doesn't apply for depending
1615 libraries like "neon", for example. Default is to use OpenSSL
1616 although NSS is also possible. Notice that selecting NSS restricts
1617 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1618 restrict by now the usage of NSS in LO's code. Possible values:
1619 openssl, nss. Example: --with-tls="nss"]),
1622 AC_ARG_WITH(system-libs,
1623 AS_HELP_STRING([--with-system-libs],
1624 [Use libraries already on system -- enables all --with-system-* flags.]),
1627 AC_ARG_WITH(system-bzip2,
1628 AS_HELP_STRING([--with-system-bzip2],
1629 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1630 [with_system_bzip2="$with_system_libs"])
1632 AC_ARG_WITH(system-headers,
1633 AS_HELP_STRING([--with-system-headers],
1634 [Use headers already on system -- enables all --with-system-* flags for
1635 external packages whose headers are the only entities used i.e.
1636 boost/odbc/sane-header(s).]),,
1637 [with_system_headers="$with_system_libs"])
1639 AC_ARG_WITH(system-jars,
1640 AS_HELP_STRING([--without-system-jars],
1641 [When building with --with-system-libs, also the needed jars are expected
1642 on the system. Use this to disable that]),,
1643 [with_system_jars="$with_system_libs"])
1645 AC_ARG_WITH(system-cairo,
1646 AS_HELP_STRING([--with-system-cairo],
1647 [Use cairo libraries already on system. Happens automatically for
1648 (implicit) --enable-gtk and for --enable-gtk3.]))
1650 AC_ARG_WITH(system-epoxy,
1651 AS_HELP_STRING([--with-system-epoxy],
1652 [Use epoxy libraries already on system. Happens automatically for
1654 [with_system_epoxy="$with_system_libs"])
1656 AC_ARG_WITH(myspell-dicts,
1657 AS_HELP_STRING([--with-myspell-dicts],
1658 [Adds myspell dictionaries to the LibreOffice installation set]),
1661 AC_ARG_WITH(system-dicts,
1662 AS_HELP_STRING([--without-system-dicts],
1663 [Do not use dictionaries from system paths.]),
1666 AC_ARG_WITH(external-dict-dir,
1667 AS_HELP_STRING([--with-external-dict-dir],
1668 [Specify external dictionary dir.]),
1671 AC_ARG_WITH(external-hyph-dir,
1672 AS_HELP_STRING([--with-external-hyph-dir],
1673 [Specify external hyphenation pattern dir.]),
1676 AC_ARG_WITH(external-thes-dir,
1677 AS_HELP_STRING([--with-external-thes-dir],
1678 [Specify external thesaurus dir.]),
1681 AC_ARG_WITH(system-zlib,
1682 AS_HELP_STRING([--with-system-zlib],
1683 [Use zlib already on system.]),,
1684 [with_system_zlib=auto])
1686 AC_ARG_WITH(system-jpeg,
1687 AS_HELP_STRING([--with-system-jpeg],
1688 [Use jpeg already on system.]),,
1689 [with_system_jpeg="$with_system_libs"])
1691 AC_ARG_WITH(system-clucene,
1692 AS_HELP_STRING([--with-system-clucene],
1693 [Use clucene already on system.]),,
1694 [with_system_clucene="$with_system_libs"])
1696 AC_ARG_WITH(system-expat,
1697 AS_HELP_STRING([--with-system-expat],
1698 [Use expat already on system.]),,
1699 [with_system_expat="$with_system_libs"])
1701 AC_ARG_WITH(system-libxml,
1702 AS_HELP_STRING([--with-system-libxml],
1703 [Use libxml/libxslt already on system.]),,
1704 [with_system_libxml=auto])
1706 AC_ARG_WITH(system-icu,
1707 AS_HELP_STRING([--with-system-icu],
1708 [Use icu already on system.]),,
1709 [with_system_icu="$with_system_libs"])
1711 AC_ARG_WITH(system-ucpp,
1712 AS_HELP_STRING([--with-system-ucpp],
1713 [Use ucpp already on system.]),,
1716 AC_ARG_WITH(system-openldap,
1717 AS_HELP_STRING([--with-system-openldap],
1718 [Use the OpenLDAP LDAP SDK already on system.]),,
1719 [with_system_openldap="$with_system_libs"])
1721 libo_FUZZ_ARG_ENABLE(poppler,
1722 AS_HELP_STRING([--disable-poppler],
1723 [Disable building Poppler.])
1726 AC_ARG_WITH(system-poppler,
1727 AS_HELP_STRING([--with-system-poppler],
1728 [Use system poppler (only needed for PDF import).]),,
1729 [with_system_poppler="$with_system_libs"])
1731 AC_ARG_WITH(system-gpgmepp,
1732 AS_HELP_STRING([--with-system-gpgmepp],
1733 [Use gpgmepp already on system]),,
1734 [with_system_gpgmepp="$with_system_libs"])
1736 AC_ARG_WITH(system-apache-commons,
1737 AS_HELP_STRING([--with-system-apache-commons],
1738 [Use Apache commons libraries already on system.]),,
1739 [with_system_apache_commons="$with_system_jars"])
1741 AC_ARG_WITH(system-mariadb,
1742 AS_HELP_STRING([--with-system-mariadb],
1743 [Use MariaDB/MySQL libraries already on system.]),,
1744 [with_system_mariadb="$with_system_libs"])
1746 AC_ARG_ENABLE(bundle-mariadb,
1747 AS_HELP_STRING([--enable-bundle-mariadb],
1748 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
1751 AC_ARG_WITH(system-postgresql,
1752 AS_HELP_STRING([--with-system-postgresql],
1753 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1754 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1755 [with_system_postgresql="$with_system_libs"])
1757 AC_ARG_WITH(libpq-path,
1758 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1759 [Use this PostgreSQL C interface (libpq) installation for building
1760 the PostgreSQL-SDBC extension.]),
1763 AC_ARG_WITH(system-firebird,
1764 AS_HELP_STRING([--with-system-firebird],
1765 [Use Firebird libraries already on system, for building the Firebird-SDBC
1766 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1767 [with_system_firebird="$with_system_libs"])
1769 AC_ARG_WITH(system-libtommath,
1770 AS_HELP_STRING([--with-system-libtommath],
1771 [Use libtommath already on system]),,
1772 [with_system_libtommath="$with_system_libs"])
1774 AC_ARG_WITH(system-hsqldb,
1775 AS_HELP_STRING([--with-system-hsqldb],
1776 [Use hsqldb already on system.]))
1778 AC_ARG_WITH(hsqldb-jar,
1779 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1780 [Specify path to jarfile manually.]),
1781 HSQLDB_JAR=$withval)
1783 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1784 AS_HELP_STRING([--disable-scripting-beanshell],
1785 [Disable support for scripts in BeanShell.]),
1789 AC_ARG_WITH(system-beanshell,
1790 AS_HELP_STRING([--with-system-beanshell],
1791 [Use beanshell already on system.]),,
1792 [with_system_beanshell="$with_system_jars"])
1794 AC_ARG_WITH(beanshell-jar,
1795 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1796 [Specify path to jarfile manually.]),
1799 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1800 AS_HELP_STRING([--disable-scripting-javascript],
1801 [Disable support for scripts in JavaScript.]),
1805 AC_ARG_WITH(system-rhino,
1806 AS_HELP_STRING([--with-system-rhino],
1807 [Use rhino already on system.]),,)
1808 # [with_system_rhino="$with_system_jars"])
1809 # Above is not used as we have different debug interface
1810 # patched into internal rhino. This code needs to be fixed
1811 # before we can enable it by default.
1813 AC_ARG_WITH(rhino-jar,
1814 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1815 [Specify path to jarfile manually.]),
1818 AC_ARG_WITH(commons-logging-jar,
1819 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1820 [Specify path to jarfile manually.]),
1821 COMMONS_LOGGING_JAR=$withval)
1823 AC_ARG_WITH(system-jfreereport,
1824 AS_HELP_STRING([--with-system-jfreereport],
1825 [Use JFreeReport already on system.]),,
1826 [with_system_jfreereport="$with_system_jars"])
1828 AC_ARG_WITH(sac-jar,
1829 AS_HELP_STRING([--with-sac-jar=JARFILE],
1830 [Specify path to jarfile manually.]),
1833 AC_ARG_WITH(libxml-jar,
1834 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1835 [Specify path to jarfile manually.]),
1836 LIBXML_JAR=$withval)
1838 AC_ARG_WITH(flute-jar,
1839 AS_HELP_STRING([--with-flute-jar=JARFILE],
1840 [Specify path to jarfile manually.]),
1843 AC_ARG_WITH(jfreereport-jar,
1844 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1845 [Specify path to jarfile manually.]),
1846 JFREEREPORT_JAR=$withval)
1848 AC_ARG_WITH(liblayout-jar,
1849 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1850 [Specify path to jarfile manually.]),
1851 LIBLAYOUT_JAR=$withval)
1853 AC_ARG_WITH(libloader-jar,
1854 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1855 [Specify path to jarfile manually.]),
1856 LIBLOADER_JAR=$withval)
1858 AC_ARG_WITH(libformula-jar,
1859 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1860 [Specify path to jarfile manually.]),
1861 LIBFORMULA_JAR=$withval)
1863 AC_ARG_WITH(librepository-jar,
1864 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1865 [Specify path to jarfile manually.]),
1866 LIBREPOSITORY_JAR=$withval)
1868 AC_ARG_WITH(libfonts-jar,
1869 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1870 [Specify path to jarfile manually.]),
1871 LIBFONTS_JAR=$withval)
1873 AC_ARG_WITH(libserializer-jar,
1874 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1875 [Specify path to jarfile manually.]),
1876 LIBSERIALIZER_JAR=$withval)
1878 AC_ARG_WITH(libbase-jar,
1879 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1880 [Specify path to jarfile manually.]),
1881 LIBBASE_JAR=$withval)
1883 AC_ARG_WITH(system-odbc,
1884 AS_HELP_STRING([--with-system-odbc],
1885 [Use the odbc headers already on system.]),,
1886 [with_system_odbc="auto"])
1888 AC_ARG_WITH(system-sane,
1889 AS_HELP_STRING([--with-system-sane],
1890 [Use sane.h already on system.]),,
1891 [with_system_sane="$with_system_headers"])
1893 AC_ARG_WITH(system-bluez,
1894 AS_HELP_STRING([--with-system-bluez],
1895 [Use bluetooth.h already on system.]),,
1896 [with_system_bluez="$with_system_headers"])
1898 AC_ARG_WITH(system-curl,
1899 AS_HELP_STRING([--with-system-curl],
1900 [Use curl already on system.]),,
1901 [with_system_curl=auto])
1903 AC_ARG_WITH(system-boost,
1904 AS_HELP_STRING([--with-system-boost],
1905 [Use boost already on system.]),,
1906 [with_system_boost="$with_system_headers"])
1908 AC_ARG_WITH(system-glm,
1909 AS_HELP_STRING([--with-system-glm],
1910 [Use glm already on system.]),,
1911 [with_system_glm="$with_system_headers"])
1913 AC_ARG_WITH(system-hunspell,
1914 AS_HELP_STRING([--with-system-hunspell],
1915 [Use libhunspell already on system.]),,
1916 [with_system_hunspell="$with_system_libs"])
1918 AC_ARG_WITH(system-qrcodegen,
1919 AS_HELP_STRING([--with-system-qrcodegen],
1920 [Use libqrcodegen already on system.]),,
1921 [with_system_qrcodegen="$with_system_libs"])
1923 AC_ARG_WITH(system-mythes,
1924 AS_HELP_STRING([--with-system-mythes],
1925 [Use mythes already on system.]),,
1926 [with_system_mythes="$with_system_libs"])
1928 AC_ARG_WITH(system-altlinuxhyph,
1929 AS_HELP_STRING([--with-system-altlinuxhyph],
1930 [Use ALTLinuxhyph already on system.]),,
1931 [with_system_altlinuxhyph="$with_system_libs"])
1933 AC_ARG_WITH(system-lpsolve,
1934 AS_HELP_STRING([--with-system-lpsolve],
1935 [Use lpsolve already on system.]),,
1936 [with_system_lpsolve="$with_system_libs"])
1938 AC_ARG_WITH(system-coinmp,
1939 AS_HELP_STRING([--with-system-coinmp],
1940 [Use CoinMP already on system.]),,
1941 [with_system_coinmp="$with_system_libs"])
1943 AC_ARG_WITH(system-liblangtag,
1944 AS_HELP_STRING([--with-system-liblangtag],
1945 [Use liblangtag library already on system.]),,
1946 [with_system_liblangtag="$with_system_libs"])
1949 AS_HELP_STRING([--with-webdav],
1950 [Specify which library to use for webdav implementation.
1951 Possible values: "neon", "serf", "no". The default value is "neon".
1952 Example: --with-webdav="serf"]),
1953 WITH_WEBDAV=$withval,
1956 AC_ARG_WITH(linker-hash-style,
1957 AS_HELP_STRING([--with-linker-hash-style],
1958 [Use linker with --hash-style=<style> when linking shared objects.
1959 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1960 if supported on the build system, and "sysv" otherwise.]))
1962 AC_ARG_WITH(jdk-home,
1963 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
1964 [If you have installed JDK 8 or later on your system please supply the
1965 path here. Note that this is not the location of the java command but the
1966 location of the entire distribution.]),
1970 AS_HELP_STRING([--with-help],
1971 [Enable the build of help. There is a special parameter "common" that
1972 can be used to bundle only the common part, .e.g help-specific icons.
1973 This is useful when you build the helpcontent separately.])
1975 Usage: --with-help build the old local help
1976 --without-help no local help (default)
1977 --with-help=html build the new HTML local help
1978 --with-help=online build the new HTML online help
1982 libo_FUZZ_ARG_WITH(java,
1983 AS_HELP_STRING([--with-java=<java command>],
1984 [Specify the name of the Java interpreter command. Typically "java"
1985 which is the default.
1987 To build without support for Java components, applets, accessibility
1988 or the XML filters written in Java, use --without-java or --with-java=no.]),
1989 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1990 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
1993 AC_ARG_WITH(jvm-path,
1994 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
1995 [Use a specific JVM search path at runtime.
1996 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
1999 AC_ARG_WITH(ant-home,
2000 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2001 [If you have installed Apache Ant on your system, please supply the path here.
2002 Note that this is not the location of the Ant binary but the location
2003 of the entire distribution.]),
2006 AC_ARG_WITH(symbol-config,
2007 AS_HELP_STRING([--with-symbol-config],
2008 [Configuration for the crashreport symbol upload]),
2010 [with_symbol_config=no])
2012 AC_ARG_WITH(export-validation,
2013 AS_HELP_STRING([--without-export-validation],
2014 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2015 ,with_export_validation=auto)
2017 AC_ARG_WITH(bffvalidator,
2018 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2019 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2020 Requires installed Microsoft Office Binary File Format Validator.
2021 Note: export-validation (--with-export-validation) is required to be turned on.
2022 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2023 ,with_bffvalidator=no)
2025 libo_FUZZ_ARG_WITH(junit,
2026 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2027 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2028 --without-junit disables those tests. Not relevant in the --without-java case.]),
2031 AC_ARG_WITH(hamcrest,
2032 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2033 [Specifies the hamcrest jar file to use for JUnit-based tests.
2034 --without-junit disables those tests. Not relevant in the --without-java case.]),
2037 AC_ARG_WITH(perl-home,
2038 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2039 [If you have installed Perl 5 Distribution, on your system, please
2040 supply the path here. Note that this is not the location of the Perl
2041 binary but the location of the entire distribution.]),
2044 libo_FUZZ_ARG_WITH(doxygen,
2046 [--with-doxygen=<absolute path to doxygen executable>],
2047 [Specifies the doxygen executable to use when generating ODK C/C++
2048 documentation. --without-doxygen disables generation of ODK C/C++
2049 documentation. Not relevant in the --disable-odk case.]),
2052 AC_ARG_WITH(visual-studio,
2053 AS_HELP_STRING([--with-visual-studio=<2017>],
2054 [Specify which Visual Studio version to use in case several are
2055 installed. Currently only 2017 is supported.]),
2058 AC_ARG_WITH(windows-sdk,
2059 AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10>],
2060 [Specify which Windows SDK, or "Windows Kit", version to use
2061 in case the one that came with the selected Visual Studio
2062 is not what you want for some reason. Note that not all compiler/SDK
2063 combinations are supported. The intent is that this option should not
2068 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2069 [Use this option to build LibreOffice with additional UI language support.
2070 English (US) is always included by default.
2071 Separate multiple languages with space.
2072 For all languages, use --with-lang=ALL.]),
2075 AC_ARG_WITH(locales,
2076 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2077 [Use this option to limit the locale information built in.
2078 Separate multiple locales with space.
2079 Very experimental and might well break stuff.
2080 Just a desperate measure to shrink code and data size.
2081 By default all the locales available is included.
2082 This option is completely unrelated to --with-lang.])
2084 Affects also our character encoding conversion
2085 tables for encodings mainly targeted for a
2086 particular locale, like EUC-CN and EUC-TW for
2087 zh, ISO-2022-JP for ja.
2089 Affects also our add-on break iterator data for
2092 For the default, all locales, don't use this switch at all.
2093 Specifying just the language part of a locale means all matching
2094 locales will be included.
2098 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2099 libo_FUZZ_ARG_WITH(krb5,
2100 AS_HELP_STRING([--with-krb5],
2101 [Enable MIT Kerberos 5 support in modules that support it.
2102 By default automatically enabled on platforms
2103 where a good system Kerberos 5 is available.]),
2106 libo_FUZZ_ARG_WITH(gssapi,
2107 AS_HELP_STRING([--with-gssapi],
2108 [Enable GSSAPI support in modules that support it.
2109 By default automatically enabled on platforms
2110 where a good system GSSAPI is available.]),
2114 AS_HELP_STRING([--with-iwyu],
2115 [Use given IWYU binary path to check unneeded includes instead of building.
2116 Use only if you are hacking on it.]),
2119 libo_FUZZ_ARG_WITH(lxml,
2120 AS_HELP_STRING([--without-lxml],
2121 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2122 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2123 report widget classes and ids.]),
2126 dnl ===================================================================
2128 dnl ===================================================================
2130 AC_ARG_WITH(branding,
2131 AS_HELP_STRING([--with-branding=/path/to/images],
2132 [Use given path to retrieve branding images set.])
2134 Search for intro.png about.svg and flat_logo.svg.
2135 If any is missing, default ones will be used instead.
2137 Search also progress.conf for progress
2138 settings on intro screen :
2140 PROGRESSBARCOLOR="255,255,255" Set color of
2141 progress bar. Comma separated RGB decimal values.
2142 PROGRESSSIZE="407,6" Set size of progress bar.
2143 Comma separated decimal values (width, height).
2144 PROGRESSPOSITION="61,317" Set position of progress
2145 bar from left,top. Comma separated decimal values.
2146 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2147 bar frame. Comma separated RGB decimal values.
2148 PROGRESSTEXTCOLOR="0,0,0" Set color of progress
2149 bar text. Comma separated RGB decimal values.
2150 PROGRESSTEXTBASELINE="287" Set vertical position of
2151 progress bar text from top. Decimal value.
2153 Default values will be used if not found.
2158 AC_ARG_WITH(extra-buildid,
2159 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2160 [Show addition build identification in about dialog.]),
2165 AS_HELP_STRING([--with-vendor="John the Builder"],
2166 [Set vendor of the build.]),
2169 AC_ARG_WITH(android-package-name,
2170 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2171 [Set Android package name of the build.]),
2174 AC_ARG_WITH(compat-oowrappers,
2175 AS_HELP_STRING([--with-compat-oowrappers],
2176 [Install oo* wrappers in parallel with
2177 lo* ones to keep backward compatibility.
2178 Has effect only with make distro-pack-install]),
2181 AC_ARG_WITH(os-version,
2182 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2183 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2186 AC_ARG_WITH(mingw-cross-compiler,
2187 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2188 [Specify the MinGW cross-compiler to use.
2189 When building on the ODK on Unix and building unowinreg.dll,
2190 specify the MinGW C++ cross-compiler.]),
2193 AC_ARG_WITH(idlc-cpp,
2194 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2195 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2198 AC_ARG_WITH(build-version,
2199 AS_HELP_STRING([--with-build-version="Built by Jim"],
2200 [Allows the builder to add a custom version tag that will appear in the
2201 Help/About box for QA purposes.]),
2202 with_build_version=$withval,
2205 AC_ARG_WITH(parallelism,
2206 AS_HELP_STRING([--with-parallelism],
2207 [Number of jobs to run simultaneously during build. Parallel builds can
2208 save a lot of time on multi-cpu machines. Defaults to the number of
2209 CPUs on the machine, unless you configure --enable-icecream - then to
2213 AC_ARG_WITH(all-tarballs,
2214 AS_HELP_STRING([--with-all-tarballs],
2215 [Download all external tarballs unconditionally]))
2217 AC_ARG_WITH(gdrive-client-id,
2218 AS_HELP_STRING([--with-gdrive-client-id],
2219 [Provides the client id of the application for OAuth2 authentication
2220 on Google Drive. If either this or --with-gdrive-client-secret is
2221 empty, the feature will be disabled]),
2224 AC_ARG_WITH(gdrive-client-secret,
2225 AS_HELP_STRING([--with-gdrive-client-secret],
2226 [Provides the client secret of the application for OAuth2
2227 authentication on Google Drive. If either this or
2228 --with-gdrive-client-id is empty, the feature will be disabled]),
2231 AC_ARG_WITH(alfresco-cloud-client-id,
2232 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2233 [Provides the client id of the application for OAuth2 authentication
2234 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2235 empty, the feature will be disabled]),
2238 AC_ARG_WITH(alfresco-cloud-client-secret,
2239 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2240 [Provides the client secret of the application for OAuth2
2241 authentication on Alfresco Cloud. If either this or
2242 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2245 AC_ARG_WITH(onedrive-client-id,
2246 AS_HELP_STRING([--with-onedrive-client-id],
2247 [Provides the client id of the application for OAuth2 authentication
2248 on OneDrive. If either this or --with-onedrive-client-secret is
2249 empty, the feature will be disabled]),
2252 AC_ARG_WITH(onedrive-client-secret,
2253 AS_HELP_STRING([--with-onedrive-client-secret],
2254 [Provides the client secret of the application for OAuth2
2255 authentication on OneDrive. If either this or
2256 --with-onedrive-client-id is empty, the feature will be disabled]),
2258 dnl ===================================================================
2259 dnl Do we want to use pre-build binary tarball for recompile
2260 dnl ===================================================================
2262 if test "$enable_library_bin_tar" = "yes" ; then
2263 USE_LIBRARY_BIN_TAR=TRUE
2265 USE_LIBRARY_BIN_TAR=
2267 AC_SUBST(USE_LIBRARY_BIN_TAR)
2269 dnl ===================================================================
2270 dnl Test whether build target is Release Build
2271 dnl ===================================================================
2272 AC_MSG_CHECKING([whether build target is Release Build])
2273 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2275 ENABLE_RELEASE_BUILD=
2277 AC_MSG_RESULT([yes])
2278 ENABLE_RELEASE_BUILD=TRUE
2280 AC_SUBST(ENABLE_RELEASE_BUILD)
2282 dnl ===================================================================
2283 dnl Test whether to sign Windows Build
2284 dnl ===================================================================
2285 AC_MSG_CHECKING([whether to sign windows build])
2286 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2287 AC_MSG_RESULT([yes])
2288 WINDOWS_BUILD_SIGNING="TRUE"
2291 WINDOWS_BUILD_SIGNING="FALSE"
2293 AC_SUBST(WINDOWS_BUILD_SIGNING)
2295 dnl ===================================================================
2296 dnl MacOSX build and runtime environment options
2297 dnl ===================================================================
2299 AC_ARG_WITH(macosx-sdk,
2300 AS_HELP_STRING([--with-macosx-sdk=<version>],
2301 [Prefer a specific SDK for building.])
2303 If the requested SDK is not available, a search for the oldest one will be done.
2304 With current Xcode versions, only the latest SDK is included, so this option is
2305 not terribly useful. It works fine to build with a new SDK and run the result
2308 e. g.: --with-macosx-sdk=10.10
2310 there are 3 options to control the MacOSX build:
2311 --with-macosx-sdk (referred as 'sdk' below)
2312 --with-macosx-version-min-required (referred as 'min' below)
2313 --with-macosx-version-max-allowed (referred as 'max' below)
2315 the connection between these value and the default they take is as follow:
2316 ( ? means not specified on the command line, s means the SDK version found,
2317 constraint: 8 <= x <= y <= z)
2319 ==========================================
2320 command line || config result
2321 ==========================================
2322 min | max | sdk || min | max | sdk |
2323 ? | ? | ? || 10.10 | 10.s | 10.s |
2324 ? | ? | 10.x || 10.10 | 10.x | 10.x |
2325 ? | 10.x | ? || 10.10 | 10.s | 10.s |
2326 ? | 10.x | 10.y || 10.10 | 10.x | 10.y |
2327 10.x | ? | ? || 10.x | 10.s | 10.s |
2328 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2329 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2330 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2333 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2334 for a detailed technical explanation of these variables
2336 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2340 AC_ARG_WITH(macosx-version-min-required,
2341 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2342 [set the minimum OS version needed to run the built LibreOffice])
2344 e. g.: --with-macos-version-min-required=10.10
2345 see --with-macosx-sdk for more info
2349 AC_ARG_WITH(macosx-version-max-allowed,
2350 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2351 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2353 e. g.: --with-macos-version-max-allowed=10.10
2354 see --with-macosx-sdk for more info
2359 dnl ===================================================================
2360 dnl options for stuff used during cross-compilation build
2361 dnl Not quite superseded by --with-build-platform-configure-options.
2362 dnl TODO: check, if the "force" option is still needed anywhere.
2363 dnl ===================================================================
2365 AC_ARG_WITH(system-icu-for-build,
2366 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2367 [Use icu already on system for build tools (cross-compilation only).]))
2370 dnl ===================================================================
2371 dnl Check for incompatible options set by fuzzing, and reset those
2372 dnl automatically to working combinations
2373 dnl ===================================================================
2375 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2376 "$enable_dbus" != "$enable_avahi"; then
2377 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2378 enable_avahi=$enable_dbus
2383 if ! echo "$LO_PATH" | $EGREP -q "(^|${P_SEP})$1($|${P_SEP})"; then
2384 LO_PATH="${LO_PATH:+$LO_PATH$P_SEP}$1"
2388 add_lopath_before ()
2393 for dir in $LO_PATH ; do
2394 if test "$dir" != "$1" ; then
2395 path_cleanup=${path_cleanup:+$path_cleanup$P_SEP}$dir
2398 LO_PATH="$1${path_cleanup:+$P_SEP$path_cleanup}"
2401 dnl ===================================================================
2402 dnl check for required programs (grep, awk, sed, bash)
2403 dnl ===================================================================
2407 if test -n "$1"; then
2408 if test "$build_os" = "cygwin"; then
2409 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2411 new_path=`cygpath -sm "$formatted_path"`
2414 new_path=`cygpath -u "$formatted_path"`
2419 if test "$2" = "after"; then
2420 add_lopath_after "$new_path"
2422 add_lopath_before "$new_path"
2429 AC_PATH_PROG( AWK, $AWK)
2430 if test -z "$AWK"; then
2431 AC_MSG_ERROR([install awk to run this script])
2434 AC_PATH_PROG(BASH, bash)
2435 if test -z "$BASH"; then
2436 AC_MSG_ERROR([bash not found in \$PATH])
2440 AC_MSG_CHECKING([for GNU or BSD tar])
2441 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2442 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2443 if test $? -eq 0; then
2448 AC_MSG_RESULT($GNUTAR)
2449 if test -z "$GNUTAR"; then
2450 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2454 AC_MSG_CHECKING([for tar's option to strip components])
2455 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2456 if test $? -eq 0; then
2457 STRIP_COMPONENTS="--strip-components"
2459 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2460 if test $? -eq 0; then
2461 STRIP_COMPONENTS="--strip-path"
2463 STRIP_COMPONENTS="unsupported"
2466 AC_MSG_RESULT($STRIP_COMPONENTS)
2467 if test x$STRIP_COMPONENTS = xunsupported; then
2468 AC_MSG_ERROR([you need a tar that is able to strip components.])
2470 AC_SUBST(STRIP_COMPONENTS)
2472 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2473 dnl desktop OSes from "mobile" ones.
2475 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2476 dnl In other words, that when building for an OS that is not a
2477 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2479 dnl Note the direction of the implication; there is no assumption that
2480 dnl cross-compiling would imply a non-desktop OS.
2482 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2483 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2484 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2485 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2488 # Whether to build "avmedia" functionality or not.
2490 if test -z "$enable_avmedia"; then
2494 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2495 if test "$enable_avmedia" = yes; then
2496 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2498 USE_AVMEDIA_DUMMY='TRUE'
2500 AC_SUBST(USE_AVMEDIA_DUMMY)
2502 # Decide whether to build database connectivity stuff (including
2503 # Base) or not. We probably don't want to on non-desktop OSes.
2504 if test -z "$enable_database_connectivity"; then
2505 # --disable-database-connectivity is unfinished work in progress
2506 # and the iOS test app doesn't link if we actually try to use it.
2507 # if test $_os != iOS -a $_os != Android; then
2508 if test $_os != iOS; then
2509 enable_database_connectivity=yes
2513 if test "$enable_database_connectivity" = yes; then
2514 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2515 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2518 if test -z "$enable_extensions"; then
2519 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2520 if test $_os != iOS -a $_os != Android; then
2521 enable_extensions=yes
2525 if test "$enable_extensions" = yes; then
2526 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2527 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2530 if test -z "$enable_scripting"; then
2531 # Disable scripting for iOS unless specifically overridden
2532 # with --enable-scripting.
2533 if test $_os != iOS; then
2534 enable_scripting=yes
2538 DISABLE_SCRIPTING=''
2539 if test "$enable_scripting" = yes; then
2540 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2541 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2543 DISABLE_SCRIPTING='TRUE'
2544 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2547 if test $_os = iOS -o $_os = Android; then
2548 # Disable dynamic_loading always for iOS and Android
2549 enable_dynamic_loading=no
2550 elif test -z "$enable_dynamic_loading"; then
2551 # Otherwise enable it unless specifically disabled
2552 enable_dynamic_loading=yes
2555 DISABLE_DYNLOADING=''
2556 if test "$enable_dynamic_loading" = yes; then
2557 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2559 DISABLE_DYNLOADING='TRUE'
2561 AC_SUBST(DISABLE_DYNLOADING)
2563 # remember SYSBASE value
2566 dnl ===================================================================
2567 dnl Sort out various gallery compilation options
2568 dnl ===================================================================
2569 AC_MSG_CHECKING([how to build and package galleries])
2570 if test -n "${with_galleries}"; then
2571 if test "$with_galleries" = "build"; then
2572 WITH_GALLERY_BUILD=TRUE
2573 AC_MSG_RESULT([build from source images internally])
2574 elif test "$with_galleries" = "no"; then
2576 AC_MSG_RESULT([disable non-internal gallery build])
2578 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2581 if test $_os != iOS -a $_os != Android; then
2582 WITH_GALLERY_BUILD=TRUE
2583 AC_MSG_RESULT([internal src images for desktop])
2586 AC_MSG_RESULT([disable src image build])
2589 AC_SUBST(WITH_GALLERY_BUILD)
2591 dnl ===================================================================
2592 dnl Checks if ccache is available
2593 dnl ===================================================================
2595 if test "$_os" = "WINNT"; then
2596 # on windows/VC build do not use ccache
2598 elif test "$enable_ccache" = "no"; then
2600 elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2601 case "%$CC%$CXX%" in
2602 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2603 # assume that's good then
2604 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2605 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2606 CCACHE_DEPEND_MODE=1
2609 AC_PATH_PROG([CCACHE],[ccache],[not found])
2610 if test "$CCACHE" = "not found"; then
2613 CCACHE_DEPEND_MODE=1
2614 # Need to check for ccache version: otherwise prevents
2615 # caching of the results (like "-x objective-c++" for Mac)
2616 if test $_os = Darwin -o $_os = iOS; then
2617 # Check ccache version
2618 AC_MSG_CHECKING([whether version of ccache is suitable])
2619 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2620 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2621 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2622 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2624 AC_MSG_RESULT([no, $CCACHE_VERSION])
2635 if test "$enable_ccache" = "nodepend"; then
2636 CCACHE_DEPEND_MODE=""
2638 AC_SUBST(CCACHE_DEPEND_MODE)
2640 if test "$CCACHE" != ""; then
2641 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2642 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2643 if test "$ccache_size" = ""; then
2644 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2645 if test "$ccache_size" = ""; then
2648 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2649 if test $ccache_size -lt 1024; then
2651 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2652 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2654 # warn that ccache may be too small for debug build
2655 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2656 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2659 if test $ccache_size -lt 5; then
2660 #warn that ccache may be too small for debug build
2661 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2662 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2667 dnl ===================================================================
2668 dnl Checks for C compiler,
2669 dnl The check for the C++ compiler is later on.
2670 dnl ===================================================================
2671 if test "$_os" != "WINNT"; then
2673 AC_MSG_CHECKING([gcc home])
2674 if test -z "$with_gcc_home"; then
2675 if test "$enable_icecream" = "yes"; then
2676 if test -d "/usr/lib/icecc/bin"; then
2677 GCC_HOME="/usr/lib/icecc/"
2678 elif test -d "/usr/libexec/icecc/bin"; then
2679 GCC_HOME="/usr/libexec/icecc/"
2680 elif test -d "/opt/icecream/bin"; then
2681 GCC_HOME="/opt/icecream/"
2683 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
2687 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2688 GCC_HOME_SET="false"
2691 GCC_HOME="$with_gcc_home"
2693 AC_MSG_RESULT($GCC_HOME)
2696 if test "$GCC_HOME_SET" = "true"; then
2697 if test -z "$CC"; then
2698 CC="$GCC_HOME/bin/gcc"
2701 if test -z "$CXX"; then
2702 CXX="$GCC_HOME/bin/g++"
2708 COMPATH=`dirname "$CC"`
2709 if test "$COMPATH" = "."; then
2710 AC_PATH_PROGS(COMPATH, $CC)
2711 dnl double square bracket to get single because of M4 quote...
2712 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2714 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2716 dnl ===================================================================
2718 dnl ===================================================================
2719 AC_MSG_CHECKING([whether to build with Java support])
2720 if test "$with_java" != "no"; then
2721 if test "$DISABLE_SCRIPTING" = TRUE; then
2722 AC_MSG_RESULT([no, overridden by --disable-scripting])
2726 AC_MSG_RESULT([yes])
2728 AC_DEFINE(HAVE_FEATURE_JAVA)
2735 AC_SUBST(ENABLE_JAVA)
2737 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2739 dnl ENABLE_JAVA="" indicate no Java support at all
2741 dnl ===================================================================
2742 dnl Check macOS SDK and compiler
2743 dnl ===================================================================
2745 if test $_os = Darwin -o $_os = iOS; then
2747 # If no --with-macosx-sdk option is given, look for one
2749 # The intent is that for "most" Mac-based developers, a suitable
2750 # SDK will be found automatically without any configure options.
2752 # For developers with a current Xcode, the lowest-numbered SDK
2753 # higher than or equal to the minimum required should be found.
2755 AC_MSG_CHECKING([what macOS SDK to use])
2756 for _macosx_sdk in ${with_macosx_sdk-10.15 10.14 10.13 10.12}; do
2757 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2758 if test -d "$MACOSX_SDK_PATH"; then
2759 with_macosx_sdk="${_macosx_sdk}"
2762 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2763 if test -d "$MACOSX_SDK_PATH"; then
2764 with_macosx_sdk="${_macosx_sdk}"
2769 if test ! -d "$MACOSX_SDK_PATH"; then
2770 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
2773 if test $_os = iOS; then
2774 if test "$enable_ios_simulator" = "yes"; then
2775 useos=iphonesimulator
2779 MACOSX_SDK_PATH=`xcrun --sdk ${useos} --show-sdk-path 2> /dev/null`
2781 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2784 case $with_macosx_sdk in
2786 MACOSX_SDK_VERSION=101200
2789 MACOSX_SDK_VERSION=101300
2792 MACOSX_SDK_VERSION=101400
2795 MACOSX_SDK_VERSION=101500
2798 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--15])
2802 if test "$with_macosx_version_min_required" = "" ; then
2803 with_macosx_version_min_required="10.10";
2806 if test "$with_macosx_version_max_allowed" = "" ; then
2807 with_macosx_version_max_allowed="$with_macosx_sdk"
2810 # export this so that "xcrun" invocations later return matching values
2811 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2812 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2813 export DEVELOPER_DIR
2814 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2815 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2817 AC_MSG_CHECKING([whether Xcode is new enough])
2818 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
2819 my_xcode_ver2=${my_xcode_ver1#Xcode }
2820 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
2821 if test "$my_xcode_ver3" -ge 903; then
2822 AC_MSG_RESULT([yes ($my_xcode_ver2)])
2824 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 9.3])
2827 case "$with_macosx_version_min_required" in
2829 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2832 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2835 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2838 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2841 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
2844 MAC_OS_X_VERSION_MIN_REQUIRED="101500"
2847 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--15])
2850 MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
2852 LIBTOOL=/usr/bin/libtool
2853 INSTALL_NAME_TOOL=install_name_tool
2854 if test -z "$save_CC"; then
2855 stdlib=-stdlib=libc++
2856 if test "$ENABLE_LTO" = TRUE; then
2860 AC_MSG_CHECKING([what C compiler to use])
2861 CC="`xcrun -find clang`"
2862 CC_BASE=`first_arg_basename "$CC"`
2863 CC+=" -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2864 AC_MSG_RESULT([$CC])
2866 AC_MSG_CHECKING([what C++ compiler to use])
2867 CXX="`xcrun -find clang++`"
2868 CXX_BASE=`first_arg_basename "$CXX"`
2869 CXX+=" -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2870 AC_MSG_RESULT([$CXX])
2872 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2875 STRIP=`xcrun -find strip`
2876 LIBTOOL=`xcrun -find libtool`
2877 RANLIB=`xcrun -find ranlib`
2880 case "$with_macosx_version_max_allowed" in
2882 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2885 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2888 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2891 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2894 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
2897 MAC_OS_X_VERSION_MAX_ALLOWED="101500"
2900 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--15])
2904 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2905 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2906 AC_MSG_ERROR([the version minimum required, $MAC_OS_X_VERSION_MIN_REQUIRED, must be <= the version maximum allowed, $MAC_OS_X_VERSION_MAX_ALLOWED])
2911 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2912 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2913 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2917 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2918 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2920 AC_MSG_CHECKING([whether to do code signing])
2922 if test "$enable_macosx_code_signing" = yes; then
2923 # By default use the first suitable certificate (?).
2925 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2926 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2927 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2928 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2929 # "Developer ID Application" one.
2931 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2932 if test -n "$identity"; then
2933 MACOSX_CODESIGNING_IDENTITY=$identity
2934 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2935 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2937 AC_MSG_ERROR([cannot determine identity to use])
2939 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2940 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2941 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2942 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2947 AC_MSG_CHECKING([whether to create a Mac App Store package])
2949 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2950 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2951 elif test "$enable_macosx_package_signing" = yes; then
2952 # By default use the first suitable certificate.
2953 # It should be a "3rd Party Mac Developer Installer" one
2955 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2956 if test -n "$identity"; then
2957 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2958 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2959 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2961 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2963 elif test -n "$enable_macosx_package_signing"; then
2964 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2965 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2966 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2971 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2972 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2975 AC_MSG_CHECKING([whether to sandbox the application])
2977 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2978 AC_MSG_ERROR([macOS sandboxing requires code signing])
2979 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
2980 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
2981 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2982 ENABLE_MACOSX_SANDBOX=TRUE
2983 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
2984 AC_MSG_RESULT([yes])
2989 AC_MSG_CHECKING([what macOS app bundle identifier to use])
2990 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
2991 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
2993 AC_SUBST(MACOSX_SDK_PATH)
2994 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2995 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2996 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
2997 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2998 AC_SUBST(INSTALL_NAME_TOOL)
2999 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
3000 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3001 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3002 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3003 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3005 dnl ===================================================================
3006 dnl Check iOS SDK and compiler
3007 dnl ===================================================================
3009 if test $_os = iOS; then
3010 AC_MSG_CHECKING([what iOS SDK to use])
3011 current_sdk_ver=12.4
3012 older_sdk_vers="13.0 12.2 12.1 12.0 11.4"
3013 if test "$enable_ios_simulator" = "yes"; then
3014 platform=iPhoneSimulator
3015 versionmin=-mios-simulator-version-min=11.0
3018 versionmin=-miphoneos-version-min=11.0
3020 xcode_developer=`xcode-select -print-path`
3022 for sdkver in $current_sdk_ver $older_sdk_vers; do
3023 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3030 if test -z "$sysroot"; then
3031 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
3034 AC_MSG_RESULT($sysroot)
3036 # LTO is not really recommended for iOS builds,
3037 # the link time will be astronomical
3038 if test "$ENABLE_LTO" = TRUE; then
3042 stdlib="-stdlib=libc++"
3044 AC_MSG_CHECKING([what C compiler to use])
3045 CC="`xcrun -find clang`"
3046 CC_BASE=`first_arg_basename "$CC"`
3047 CC+=" -arch $host_cpu -isysroot $sysroot $lto $versionmin"
3048 AC_MSG_RESULT([$CC])
3050 AC_MSG_CHECKING([what C++ compiler to use])
3051 CXX="`xcrun -find clang++`"
3052 CXX_BASE=`first_arg_basename "$CXX"`
3053 CXX+=" -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
3054 AC_MSG_RESULT([$CXX])
3056 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3059 STRIP=`xcrun -find strip`
3060 LIBTOOL=`xcrun -find libtool`
3061 RANLIB=`xcrun -find ranlib`
3064 AC_MSG_CHECKING([whether to treat the installation as read-only])
3066 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3067 "$enable_extensions" != yes; then
3068 enable_readonly_installset=yes
3070 if test "$enable_readonly_installset" = yes; then
3071 AC_MSG_RESULT([yes])
3072 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3077 dnl ===================================================================
3078 dnl Structure of install set
3079 dnl ===================================================================
3081 if test $_os = Darwin; then
3082 LIBO_BIN_FOLDER=MacOS
3083 LIBO_ETC_FOLDER=Resources
3084 LIBO_LIBEXEC_FOLDER=MacOS
3085 LIBO_LIB_FOLDER=Frameworks
3086 LIBO_LIB_PYUNO_FOLDER=Resources
3087 LIBO_SHARE_FOLDER=Resources
3088 LIBO_SHARE_HELP_FOLDER=Resources/help
3089 LIBO_SHARE_JAVA_FOLDER=Resources/java
3090 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3091 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3092 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3093 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3094 LIBO_URE_BIN_FOLDER=MacOS
3095 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3096 LIBO_URE_LIB_FOLDER=Frameworks
3097 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3098 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3099 elif test $_os = WINNT; then
3100 LIBO_BIN_FOLDER=program
3101 LIBO_ETC_FOLDER=program
3102 LIBO_LIBEXEC_FOLDER=program
3103 LIBO_LIB_FOLDER=program
3104 LIBO_LIB_PYUNO_FOLDER=program
3105 LIBO_SHARE_FOLDER=share
3106 LIBO_SHARE_HELP_FOLDER=help
3107 LIBO_SHARE_JAVA_FOLDER=program/classes
3108 LIBO_SHARE_PRESETS_FOLDER=presets
3109 LIBO_SHARE_READMES_FOLDER=readmes
3110 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3111 LIBO_SHARE_SHELL_FOLDER=program/shell
3112 LIBO_URE_BIN_FOLDER=program
3113 LIBO_URE_ETC_FOLDER=program
3114 LIBO_URE_LIB_FOLDER=program
3115 LIBO_URE_MISC_FOLDER=program
3116 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3118 LIBO_BIN_FOLDER=program
3119 LIBO_ETC_FOLDER=program
3120 LIBO_LIBEXEC_FOLDER=program
3121 LIBO_LIB_FOLDER=program
3122 LIBO_LIB_PYUNO_FOLDER=program
3123 LIBO_SHARE_FOLDER=share
3124 LIBO_SHARE_HELP_FOLDER=help
3125 LIBO_SHARE_JAVA_FOLDER=program/classes
3126 LIBO_SHARE_PRESETS_FOLDER=presets
3127 LIBO_SHARE_READMES_FOLDER=readmes
3128 if test "$enable_fuzzers" != yes; then
3129 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3131 LIBO_SHARE_RESOURCE_FOLDER=resource
3133 LIBO_SHARE_SHELL_FOLDER=program/shell
3134 LIBO_URE_BIN_FOLDER=program
3135 LIBO_URE_ETC_FOLDER=program
3136 LIBO_URE_LIB_FOLDER=program
3137 LIBO_URE_MISC_FOLDER=program
3138 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3140 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3141 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3142 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3143 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3144 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3145 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3146 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3147 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3148 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3149 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3150 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3151 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3152 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3153 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3154 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3155 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3157 # Not all of them needed in config_host.mk, add more if need arises
3158 AC_SUBST(LIBO_BIN_FOLDER)
3159 AC_SUBST(LIBO_ETC_FOLDER)
3160 AC_SUBST(LIBO_LIB_FOLDER)
3161 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3162 AC_SUBST(LIBO_SHARE_FOLDER)
3163 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3164 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3165 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3166 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3167 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3168 AC_SUBST(LIBO_URE_BIN_FOLDER)
3169 AC_SUBST(LIBO_URE_ETC_FOLDER)
3170 AC_SUBST(LIBO_URE_LIB_FOLDER)
3171 AC_SUBST(LIBO_URE_MISC_FOLDER)
3172 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3174 dnl ===================================================================
3175 dnl Windows specific tests and stuff
3176 dnl ===================================================================
3180 # Return value: $regvalue
3183 local _regentry="/proc/registry${1}/${2}"
3184 if test -f "$_regentry"; then
3185 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3186 # Registry keys read via /proc/registry* are always \0 terminated!
3187 local _regvalue=$(tr -d '\0' < "$_regentry")
3188 if test $? -eq 0; then
3194 # Get a value from the 32-bit side of the Registry
3197 reg_get_value "32" "$1"
3200 # Get a value from the 64-bit side of the Registry
3203 reg_get_value "64" "$1"
3206 if test "$_os" = "WINNT"; then
3207 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3208 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3210 WINDOWS_SDK_ARCH="x86"
3212 AC_MSG_RESULT([yes])
3213 WINDOWS_SDK_ARCH="x64"
3217 if test "$_os" = "iOS"; then
3218 cross_compiling="yes"
3221 if test "$cross_compiling" = "yes"; then
3222 export CROSS_COMPILING=TRUE
3225 BUILD_TYPE="$BUILD_TYPE NATIVE"
3227 AC_SUBST(CROSS_COMPILING)
3229 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3230 # NOTE: must _not_ be used for bundled external libraries!
3232 if test "$GCC" = "yes"; then
3233 AC_MSG_CHECKING( for -isystem )
3235 CFLAGS="$CFLAGS -Werror"
3236 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3238 if test -n "$ISYSTEM"; then
3244 if test -z "$ISYSTEM"; then
3245 # fall back to using -I
3250 dnl ===================================================================
3251 dnl Check which Visual Studio compiler is used
3252 dnl ===================================================================
3254 map_vs_year_to_version()
3256 # Return value: $vsversion
3266 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3270 vs_versions_to_check()
3272 # Args: $1 (optional) : versions to check, in the order of preference
3273 # Return value: $vsversions
3277 if test -n "$1"; then
3278 map_vs_year_to_version "$1"
3279 vsversions=$vsversion
3281 # We accept only 2017
3286 win_get_env_from_vsvars32bat()
3288 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3289 # Also seems to be located in another directory under the same name: vsvars32.bat
3290 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3291 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3292 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3293 chmod +x $WRAPPERBATCHFILEPATH
3294 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3295 rm -f $WRAPPERBATCHFILEPATH
3296 printf '%s' "$_win_get_env_from_vsvars32bat"
3301 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3302 if test -n "$regvalue"; then
3303 PathFormat "$regvalue"
3304 UCRTSDKDIR=$formatted_path
3305 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3306 UCRTVERSION=$regvalue
3308 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3312 if test -z "$UCRTSDKDIR"; then
3313 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3314 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3315 if test -f "$ide_env_file"; then
3316 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3317 UCRTSDKDIR=$formatted_path
3318 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3319 dnl Hack needed at least by tml:
3320 if test "$UCRTVERSION" = 10.0.15063.0 \
3321 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3322 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3324 UCRTVERSION=10.0.14393.0
3327 AC_MSG_ERROR([No UCRT found])
3334 # Find Visual C++ 2017/2019
3335 # Args: $1 (optional) : The VS version year
3336 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3338 unset vctest vcnum vcnumwithdot vcbuildnumber
3340 vs_versions_to_check "$1"
3341 vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
3342 vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
3343 PathFormat "$vswhere"
3344 vswhere=$formatted_path
3345 for ver in $vsversions; do
3346 vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
3347 if test -n "$vswhereoutput"; then
3348 PathFormat "$vswhereoutput"
3349 vctest=$formatted_path
3354 # This fallback is needed on *some* (but not all) VS 2017 installations, where vswhere turns up
3355 # with the empty list for unclear reason. The below hack does not work for VS 2019 anyway, so
3356 # should be removed when upgrading baseline.
3357 if ! test -n "$vctest"; then
3358 for ver in $vsversions; do
3359 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver.0/Setup/VC/ProductDir
3360 if test -n "$regvalue"; then
3364 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver.0
3365 if test -n "$regvalue"; then
3366 AC_MSG_RESULT([found: $regvalue])
3367 PathFormat "$regvalue"
3368 vctest=$formatted_path
3374 if test -n "$vctest"; then
3375 vcnumwithdot="$ver.0"
3376 case "$vcnumwithdot" in
3386 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3394 if test "$_os" = "WINNT"; then
3395 AC_MSG_CHECKING([Visual C++])
3396 find_msvc "$with_visual_studio"
3397 if test -z "$vctest"; then
3398 if test -n "$with_visual_studio"; then
3399 AC_MSG_ERROR([no Visual Studio $with_visual_studio installation found])
3401 AC_MSG_ERROR([no Visual Studio 2017 installation found])
3405 if test "$BITNESS_OVERRIDE" = ""; then
3406 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3407 VC_PRODUCT_DIR=$vctest/VC
3409 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86])
3412 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3413 VC_PRODUCT_DIR=$vctest/VC
3415 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64])
3418 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3420 AC_MSG_CHECKING([for short pathname of VC product directory])
3421 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3422 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3427 AC_MSG_CHECKING([for UCRT location])
3429 # find_ucrt errors out if it doesn't find it
3430 AC_MSG_RESULT([found])
3431 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3432 ucrtincpath_formatted=$formatted_path
3433 # SOLARINC is used for external modules and must be set too.
3434 # And no, it's not sufficient to set SOLARINC only, as configure
3435 # itself doesn't honour it.
3436 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3437 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3438 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3439 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3441 AC_SUBST(UCRTSDKDIR)
3442 AC_SUBST(UCRTVERSION)
3444 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3445 # Find the proper version of MSBuild.exe to use based on the VS version
3446 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3447 if test -n "$regvalue" ; then
3448 AC_MSG_RESULT([found: $regvalue])
3449 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3451 if test "$vcnumwithdot" = "16.0"; then
3452 if test "$BITNESS_OVERRIDE" = ""; then
3453 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
3455 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
3458 if test "$BITNESS_OVERRIDE" = ""; then
3459 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3461 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3464 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3465 AC_MSG_RESULT([$regvalue])
3468 # Find the version of devenv.exe
3469 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3470 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3471 if test ! -e "$DEVENV"; then
3472 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3475 dnl ===========================================================
3476 dnl Check for the corresponding mspdb*.dll
3477 dnl ===========================================================
3483 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3484 VC_HOST_DIR="HostX64"
3485 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3487 VC_HOST_DIR="HostX86"
3488 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3491 if test "$BITNESS_OVERRIDE" = ""; then
3492 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3494 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3497 # MSVC 15.0 has libraries from 14.0?
3500 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3501 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3504 dnl The path needs to be added before cl is called
3505 TEMP_PATH=`cygpath -d "$MSPDB_PATH"`
3506 PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
3508 AC_MSG_CHECKING([cl.exe])
3510 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3511 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3512 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3515 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3516 dnl needed when building CLR code:
3517 if test -z "$MSVC_CXX"; then
3518 if test -f "$CL_PATH/cl.exe"; then
3519 MSVC_CXX="$CL_PATH/cl.exe"
3522 # This gives us a posix path with 8.3 filename restrictions
3523 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3524 CXX_BASE=`first_arg_basename "$MSVC_CXX"`
3527 if test -z "$CC"; then
3529 CC_BASE=`first_arg_basename "$CC"`
3531 if test "$BITNESS_OVERRIDE" = ""; then
3532 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3533 MSVC_CXX="$MSVC_CXX -arch:SSE"
3536 if test -n "$CC"; then
3537 # Remove /cl.exe from CC case insensitive
3538 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3539 if test "$BITNESS_OVERRIDE" = ""; then
3540 COMPATH="$VC_PRODUCT_DIR"
3542 if test -n "$VC_PRODUCT_DIR"; then
3543 COMPATH=$VC_PRODUCT_DIR
3546 if test "$BITNESS_OVERRIDE" = ""; then
3547 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3551 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3553 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3555 PathFormat "$COMPATH"
3556 COMPATH=`win_short_path_for_make "$formatted_path"`
3561 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3562 # are always "better", we list them in reverse chronological order.
3566 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
3570 # The expectation is that --with-windows-sdk should not need to be used
3571 if test -n "$with_windows_sdk"; then
3572 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3573 *" "$with_windows_sdk" "*)
3574 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3577 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3582 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3587 AC_MSG_ERROR([Visual C++ not found after all, huh])
3590 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2017 version 15.7])
3591 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3592 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
3593 // between Visual Studio versions and _MSC_VER:
3597 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
3599 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3600 # version of the Explorer extension (and maybe other small
3601 # bits, too) needed when installing a 32-bit LibreOffice on a
3602 # 64-bit OS. The 64-bit Explorer extension is a feature that
3603 # has been present since long in OOo. Don't confuse it with
3604 # building LibreOffice itself as 64-bit code.
3609 if test "$BITNESS_OVERRIDE" = ""; then
3610 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3611 if test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib" || \
3612 test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/spectre/x64/atls.lib"; then
3613 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3615 CXX_X64_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe"`
3618 if test "$BUILD_X64" = TRUE; then
3619 AC_MSG_RESULT([found])
3621 AC_MSG_RESULT([not found])
3622 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3625 CXX_X64_BINARY=$MSVC_CXX
3629 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3630 AC_SUBST(CXX_X64_BINARY)
3632 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
3633 # needed to support TWAIN scan on both 32- and 64-bit systems
3637 if test "$BITNESS_OVERRIDE" = "64"; then
3638 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
3639 if test -n "$CXX_X86_BINARY"; then
3641 AC_MSG_RESULT([preset])
3642 elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then
3644 CXX_X86_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe"`
3645 CXX_X86_BINARY+=" /arch:SSE"
3646 AC_MSG_RESULT([found])
3649 AC_MSG_RESULT([not found])
3650 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
3654 CXX_X86_BINARY=$MSVC_CXX
3657 AC_SUBST(CXX_X86_BINARY)
3666 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3667 AC_SUBST(UNOWINREG_DLL)
3670 AC_MSG_CHECKING([whether the compiler is actually Clang])
3671 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3677 [AC_MSG_RESULT([yes])
3679 [AC_MSG_RESULT([no])])
3680 AC_SUBST(COM_IS_CLANG)
3684 if test "$COM_IS_CLANG" = TRUE; then
3685 AC_MSG_CHECKING([whether Clang is new enough])
3686 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3687 #if !defined __apple_build_version__
3691 [my_apple_clang=yes],[my_apple_clang=])
3692 if test "$my_apple_clang" = yes; then
3693 AC_MSG_RESULT([assumed yes (Apple Clang)])
3695 if test "$_os" = WINNT; then
3696 dnl In which case, assume clang-cl:
3698 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3706 CC_PLAIN="$CC_PLAIN $i"
3713 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args - | sed 's/ //g'`
3714 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3715 CLANGVER=`echo $clang_version \
3716 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3717 if test "$CLANGVER" -ge 50002; then
3718 AC_MSG_RESULT([yes ($clang_version)])
3720 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
3722 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3723 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3727 SHOWINCLUDES_PREFIX=
3728 if test "$_os" = WINNT; then
3729 dnl We need to guess the prefix of the -showIncludes output, it can be
3731 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3732 echo "#include <stdlib.h>" > conftest.c
3733 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3734 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3735 rm -f conftest.c conftest.obj
3736 if test -z "$SHOWINCLUDES_PREFIX"; then
3737 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3739 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3742 AC_SUBST(SHOWINCLUDES_PREFIX)
3745 # prefix C with ccache if needed
3747 if test "$CCACHE" != ""; then
3748 AC_MSG_CHECKING([whether $CC_BASE is already ccached])
3752 CFLAGS="$CFLAGS --ccache-skip -O2"
3753 dnl an empty program will do, we're checking the compiler flags
3754 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3755 [use_ccache=yes], [use_ccache=no])
3756 if test $use_ccache = yes; then
3757 AC_MSG_RESULT([yes])
3760 CC_BASE="ccache $CC_BASE"
3767 # ===================================================================
3768 # check various GCC options that Clang does not support now but maybe
3769 # will somewhen in the future, check them even for GCC, so that the
3771 # ===================================================================
3774 if test "$GCC" = "yes"; then
3775 AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
3777 CFLAGS="$CFLAGS -Werror -ggdb2"
3778 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3780 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3781 AC_MSG_RESULT([yes])
3786 if test "$host_cpu" = "m68k"; then
3787 AC_MSG_CHECKING([whether $CC_BASE supports -mlong-jump-table-offsets])
3789 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3790 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3792 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3793 AC_MSG_RESULT([yes])
3799 AC_SUBST(HAVE_GCC_GGDB2)
3801 dnl ===================================================================
3802 dnl Test the gcc version
3803 dnl ===================================================================
3804 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3805 AC_MSG_CHECKING([the GCC version])
3806 _gcc_version=`$CC -dumpversion`
3807 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3808 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3809 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3811 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3813 if test "$gcc_full_version" -lt 70000; then
3814 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 7.0.0])
3817 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3818 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3819 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3820 # (which reports itself as GCC 4.2.1).
3823 AC_SUBST(GCC_VERSION)
3825 dnl Set the ENABLE_DBGUTIL variable
3826 dnl ===================================================================
3827 AC_MSG_CHECKING([whether to build with additional debug utilities])
3828 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3829 ENABLE_DBGUTIL="TRUE"
3830 # this is an extra var so it can have different default on different MSVC
3831 # versions (in case there are version specific problems with it)
3832 MSVC_USE_DEBUG_RUNTIME="TRUE"
3834 AC_MSG_RESULT([yes])
3835 # cppunit and graphite expose STL in public headers
3836 if test "$with_system_cppunit" = "yes"; then
3837 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3839 with_system_cppunit=no
3841 if test "$with_system_graphite" = "yes"; then
3842 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3844 with_system_graphite=no
3846 if test "$with_system_orcus" = "yes"; then
3847 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3849 with_system_orcus=no
3851 if test "$with_system_libcmis" = "yes"; then
3852 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3854 with_system_libcmis=no
3856 if test "$with_system_hunspell" = "yes"; then
3857 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3859 with_system_hunspell=no
3861 if test "$with_system_gpgmepp" = "yes"; then
3862 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3864 with_system_gpgmepp=no
3866 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
3867 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
3868 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
3869 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
3870 # of those two is using the system variant:
3871 if test "$with_system_libnumbertext" = "yes"; then
3872 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
3874 with_system_libnumbertext=no
3876 if test "$with_system_libwps" = "yes"; then
3877 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
3879 with_system_libwps=no
3883 MSVC_USE_DEBUG_RUNTIME=""
3886 AC_SUBST(ENABLE_DBGUTIL)
3887 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3889 dnl Set the ENABLE_DEBUG variable.
3890 dnl ===================================================================
3891 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3892 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
3894 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3895 if test -z "$libo_fuzzed_enable_debug"; then
3896 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3898 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3903 AC_MSG_CHECKING([whether to do a debug build])
3904 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3906 if test -n "$ENABLE_DBGUTIL" ; then
3907 AC_MSG_RESULT([yes (dbgutil)])
3909 AC_MSG_RESULT([yes])
3915 AC_SUBST(ENABLE_DEBUG)
3917 AC_MSG_CHECKING([whether special RTTI visibility flags are needed for Clang Linux UBSan])
3918 NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY=
3919 dnl Clang 9 is known fixed since
3920 dnl <https://github.com/llvm/llvm-project/commit/5745eccef54ddd3caca278d1d292a88b2281528b> "Adapt
3921 dnl -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO":
3922 if test "$COM_IS_CLANG" = TRUE -a "$_os" = Linux; then
3923 if test "$CLANGVER" -lt 90000; then
3927 NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY=TRUE
3934 if test "$NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY" = TRUE; then
3935 AC_MSG_RESULT([yes])
3939 AC_SUBST([NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY])
3941 dnl ===================================================================
3942 dnl Select the linker to use (gold/lld/ld.bfd).
3943 dnl This is done only after compiler checks (need to know if Clang is
3944 dnl used, for different defaults) and after checking if a debug build
3945 dnl is wanted (non-debug builds get the default linker if not explicitly
3946 dnl specified otherwise).
3947 dnl All checks for linker features/options should come after this.
3948 dnl ===================================================================
3952 use_ld_fail_if_error=$2
3954 AC_MSG_CHECKING([for -fuse-ld=$use_ld linker support])
3955 use_ld_ldflags_save="$LDFLAGS"
3956 LDFLAGS="$LDFLAGS -fuse-ld=$use_ld"
3957 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3960 printf ("hello world\n");
3961 ])], USE_LD=$use_ld, [])
3962 if test -n "$USE_LD"; then
3963 AC_MSG_RESULT( yes )
3965 dnl For obscure reasons, unxgcc.mk uses the --dynamic-list-cpp-typeinfo linker option
3966 dnl if NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY, and lld doesn't support this option.
3967 if test -n "$NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY"; then
3968 AC_MSG_CHECKING([for --dynamic-list-cpp-typeinfo linker support (-fuse-ld=$use_ld)])
3969 use_ld_ldflags_save_2="$LDFLAGS"
3970 LDFLAGS="$LDFLAGS -Wl,--dynamic-list-cpp-typeinfo"
3971 use_ld_has_cpp_typeinfo=
3972 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3975 printf ("hello world\n");
3976 ])], use_ld_has_cpp_typeinfo=yes, [])
3977 LDFLAGS="$use_ld_ldflags_save_2"
3978 if test -n "$use_ld_has_cpp_typeinfo"; then
3979 AC_MSG_RESULT( yes )
3981 if test -n "$use_ld_fail_if_error"; then
3990 if test -n "$use_ld_fail_if_error"; then
3996 if test -n "$use_ld_ok"; then
3997 dnl keep the value of LDFLAGS
4000 LDFLAGS="$use_ld_ldflags_save"
4004 if test "$enable_ld" != "no"; then
4005 if test "$GCC" = "yes"; then
4006 if test -n "$enable_ld"; then
4007 check_use_ld "$enable_ld" fail_if_error
4008 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4009 dnl non-debug builds default to the default linker
4011 elif test -n "$COM_IS_CLANG"; then
4013 if test $? -ne 0; then
4017 # For gcc first try gold, new versions also support lld.
4019 if test $? -ne 0; then
4023 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
4025 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD)')
4026 if test -z "$ld_used"; then
4029 AC_MSG_CHECKING([for linker that is used])
4030 AC_MSG_RESULT([$ld_used])
4031 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4032 if echo "$ld_used" | grep -q "^GNU ld"; then
4033 AC_MSG_WARN([The default GNU linker is slow, consider using the LLD or the GNU gold linker.])
4034 add_warning "The default GNU linker is slow, consider using the LLD or the GNU gold linker."
4038 if test "$enable_ld" = "yes"; then
4039 AC_MSG_ERROR([--enable-ld not supported])
4045 HAVE_LD_BSYMBOLIC_FUNCTIONS=
4046 if test "$GCC" = "yes"; then
4047 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
4048 bsymbolic_functions_ldflags_save=$LDFLAGS
4049 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
4050 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4053 printf ("hello world\n");
4054 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
4055 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
4056 AC_MSG_RESULT( found )
4058 AC_MSG_RESULT( not found )
4060 LDFLAGS=$bsymbolic_functions_ldflags_save
4062 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
4066 if test "$enable_split_debug" != no; then
4067 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
4068 if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4069 AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
4071 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
4072 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
4074 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
4075 AC_MSG_RESULT([yes])
4077 if test "$enable_split_debug" = yes; then
4084 if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4085 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
4086 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
4089 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
4092 if test "$enable_gdb_index" != "no"; then
4093 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
4094 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -o -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4095 AC_MSG_CHECKING([whether $CC_BASE supports -ggnu-pubnames])
4097 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
4099 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
4100 if test "$have_ggnu_pubnames" != "TRUE"; then
4101 if test "$enable_gdb_index" = "yes"; then
4102 AC_MSG_ERROR( no, --enable-gdb-index not supported )
4107 AC_MSG_RESULT( yes )
4108 AC_MSG_CHECKING([whether $CC_BASE supports -Wl,--gdb-index])
4109 ldflags_save=$LDFLAGS
4110 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
4111 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4114 printf ("hello world\n");
4115 ])], ENABLE_GDB_INDEX=TRUE, [])
4116 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
4117 AC_MSG_RESULT( yes )
4119 if test "$enable_gdb_index" = "yes"; then
4125 LDFLAGS=$ldflags_save
4129 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4130 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
4131 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
4134 AC_SUBST(ENABLE_GDB_INDEX)
4136 if test "$enable_sal_log" = yes; then
4139 AC_SUBST(ENABLE_SAL_LOG)
4141 dnl Check for enable symbols option
4142 dnl ===================================================================
4143 AC_MSG_CHECKING([whether to generate debug information])
4144 if test -z "$enable_symbols"; then
4145 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4151 if test "$enable_symbols" = yes; then
4152 ENABLE_SYMBOLS_FOR=all
4153 AC_MSG_RESULT([yes])
4154 elif test "$enable_symbols" = no; then
4158 # Selective debuginfo.
4159 ENABLE_SYMBOLS_FOR="$enable_symbols"
4160 AC_MSG_RESULT([for "$enable_symbols"])
4162 AC_SUBST(ENABLE_SYMBOLS_FOR)
4164 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
4165 # Building on Android with full symbols: without enough memory the linker never finishes currently.
4166 AC_MSG_CHECKING([whether enough memory is available for linking])
4167 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
4168 # Check for 15GB, as Linux reports a bit less than the physical memory size.
4169 if test -n "$mem_size" -a $mem_size -lt 15728640; then
4170 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
4172 AC_MSG_RESULT([yes])
4176 AC_MSG_CHECKING([whether to compile with optimization flags])
4177 if test -z "$enable_optimized"; then
4178 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4181 enable_optimized=yes
4184 if test "$enable_optimized" != no; then
4185 ENABLE_OPTIMIZED=TRUE
4186 AC_MSG_RESULT([yes])
4191 AC_SUBST(ENABLE_OPTIMIZED)
4194 # determine CPUNAME, OS, ...
4195 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
4206 PLATFORMID=aix_powerpc
4215 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4222 if test "$BITNESS_OVERRIDE" = 64; then
4225 PLATFORMID=windows_x86_64
4227 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4231 PLATFORMID=windows_x86
4235 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4238 SCPDEFS="$SCPDEFS -D_MSC_VER"
4250 AC_MSG_ERROR([Can't build 32-bit code for iOS])
4254 if test "$enable_ios_simulator" = "yes"; then
4255 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
4259 PLATFORMID=ios_arm64
4263 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4266 if test "$enable_ios_simulator" = "yes"; then
4271 PLATFORMID=macosx_x86_64
4274 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4290 PLATFORMID=dragonfly_x86
4295 PLATFORMID=dragonfly_x86_64
4298 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4314 PLATFORMID=freebsd_x86
4319 PLATFORMID=freebsd_x86_64
4322 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4339 PLATFORMID=haiku_x86
4344 PLATFORMID=haiku_x86_64
4347 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4364 PLATFORMID=kfreebsd_x86
4369 PLATFORMID=kfreebsd_x86_64
4372 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4388 PLATFORMID=linux_aarch64
4394 PLATFORMID=linux_alpha
4400 PLATFORMID=linux_arm_eabi
4404 PLATFORMID=linux_arm_oabi
4412 PLATFORMID=linux_hppa
4417 PLATFORMID=linux_x86
4422 PLATFORMID=linux_ia64
4428 PLATFORMID=linux_mips_eb
4433 EPM_FLAGS="-a mips64"
4434 PLATFORMID=linux_mips64_eb
4439 EPM_FLAGS="-a mips64el"
4440 PLATFORMID=linux_mips64_el
4445 EPM_FLAGS="-a mipsel"
4446 PLATFORMID=linux_mips_el
4451 PLATFORMID=linux_m68k
4456 PLATFORMID=linux_powerpc
4461 PLATFORMID=linux_powerpc64
4465 RTL_ARCH=PowerPC_64_LE
4466 PLATFORMID=linux_powerpc64_le
4471 PLATFORMID=linux_sparc
4476 PLATFORMID=linux_sparc64
4481 PLATFORMID=linux_s390
4486 PLATFORMID=linux_s390x
4491 PLATFORMID=linux_x86_64
4494 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4511 PLATFORMID=android_arm_eabi
4516 PLATFORMID=android_aarch64
4521 PLATFORMID=android_x86
4524 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4540 PLATFORMID=netbsd_x86
4545 PLATFORMID=netbsd_powerpc
4550 PLATFORMID=netbsd_sparc
4555 PLATFORMID=netbsd_x86_64
4558 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4574 PLATFORMID=openbsd_x86
4579 PLATFORMID=openbsd_x86_64
4582 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4585 SOLARINC="$SOLARINC -I/usr/local/include"
4599 PLATFORMID=solaris_x86
4604 PLATFORMID=solaris_sparc
4609 PLATFORMID=solaris_sparc64
4612 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4615 SOLARINC="$SOLARINC -I/usr/local/include"
4619 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4623 if test "$with_x" = "no"; then
4624 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4628 if test "$enable_gui" = "no"; then
4629 if test "$USING_X11" != TRUE; then
4630 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4634 AC_DEFINE(HAVE_FEATURE_UI,0)
4637 AC_SUBST(DISABLE_GUI)
4639 WORKDIR="${BUILDDIR}/workdir"
4640 INSTDIR="${BUILDDIR}/instdir"
4641 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4642 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4643 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4651 AC_SUBST([INSTROOT])
4652 AC_SUBST([INSTROOTBASE])
4656 AC_SUBST(PLATFORMID)
4657 AC_SUBST(WINDOWS_X64)
4658 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4660 dnl ===================================================================
4661 dnl Test which package format to use
4662 dnl ===================================================================
4663 AC_MSG_CHECKING([which package format to use])
4664 if test -n "$with_package_format" -a "$with_package_format" != no; then
4665 for i in $with_package_format; do
4667 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4670 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4671 aix - AIX software distribution
4672 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4673 deb - Debian software distribution
4674 pkg - Solaris software distribution
4675 rpm - RedHat software distribution
4677 LibreOffice additionally supports:
4678 archive - .tar.gz or .zip
4680 installed - installation tree
4686 # fakeroot is needed to ensure correct file ownerships/permissions
4687 # inside deb packages and tar archives created on Linux and Solaris.
4688 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4689 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4690 if test "$FAKEROOT" = "no"; then
4692 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4695 PKGFORMAT="$with_package_format"
4696 AC_MSG_RESULT([$PKGFORMAT])
4699 AC_MSG_RESULT([none])
4703 dnl ===================================================================
4704 dnl Set up a different compiler to produce tools to run on the build
4705 dnl machine when doing cross-compilation
4706 dnl ===================================================================
4708 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4709 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4710 if test "$cross_compiling" = "yes"; then
4711 AC_MSG_CHECKING([for BUILD platform configuration])
4713 rm -rf CONF-FOR-BUILD config_build.mk
4714 mkdir CONF-FOR-BUILD
4715 # Here must be listed all files needed when running the configure script. In particular, also
4716 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4717 # keep them in the same order as there.
4718 (cd $SRC_ROOT && tar cf - \
4720 bin/get_config_variables \
4721 solenv/bin/getcompver.awk \
4722 solenv/inc/langlist.mk \
4725 config_host_lang.mk.in \
4727 bin/bffvalidator.sh.in \
4728 bin/odfvalidator.sh.in \
4729 bin/officeotron.sh.in \
4730 instsetoo_native/util/openoffice.lst.in \
4732 sysui/desktop/macosx/Info.plist.in) \
4733 | (cd CONF-FOR-BUILD && tar xf -)
4734 cp configure CONF-FOR-BUILD
4735 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4737 unset COM USING_X11 OS CPUNAME
4738 unset CC CXX SYSBASE CFLAGS
4739 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4740 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4741 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4742 if test -n "$CC_FOR_BUILD"; then
4743 export CC="$CC_FOR_BUILD"
4744 CC_BASE=`first_arg_basename "$CC"`
4746 if test -n "$CXX_FOR_BUILD"; then
4747 export CXX="$CXX_FOR_BUILD"
4748 CXX_BASE=`first_arg_basename "$CXX"`
4750 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4753 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4754 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4755 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4756 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4757 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4758 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4759 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4760 # Don't bother having configure look for stuff not needed for the build platform anyway
4763 --disable-gstreamer-1-0 \
4766 --disable-pdfimport \
4767 --disable-postgresql-sdbc \
4768 --with-parallelism="$with_parallelism" \
4773 2>&1 | sed -e 's/^/ /'
4774 test -f ./config_host.mk 2>/dev/null || exit
4775 cp config_host.mk ../config_build.mk
4776 cp config_host_lang.mk ../config_build_lang.mk
4777 mv config.log ../config.Build.log
4778 mkdir -p ../config_build
4779 mv config_host/*.h ../config_build
4780 . ./bin/get_config_variables CC CXX INSTDIR INSTROOT LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS PATH SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT WORKDIR
4782 for V in CC CXX LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT; do
4784 VV=`eval "echo $VV"`
4785 if test -n "$VV"; then
4786 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4787 echo "$line" >>build-config
4791 for V in INSTDIR INSTROOT WORKDIR; do
4793 VV=`eval "echo $VV"`
4794 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4795 if test -n "$VV"; then
4796 line="${V}_FOR_BUILD='$VV'"
4797 echo "$line" >>build-config
4801 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4802 echo "$line" >>build-config
4805 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4806 test -f config_build.mk || AC_MSG_ERROR([A file called config_build.mk was supposed to have been copied here, but it isn't found])
4807 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4808 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4810 eval `cat CONF-FOR-BUILD/build-config`
4812 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4814 rm -rf CONF-FOR-BUILD
4818 CXX_FOR_BUILD="$CXX"
4819 INSTDIR_FOR_BUILD="$INSTDIR"
4820 INSTROOT_FOR_BUILD="$INSTROOT"
4821 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4822 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4823 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4824 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4825 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4826 WORKDIR_FOR_BUILD="$WORKDIR"
4828 AC_SUBST(OS_FOR_BUILD)
4829 AC_SUBST(INSTDIR_FOR_BUILD)
4830 AC_SUBST(INSTROOT_FOR_BUILD)
4831 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4832 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4833 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4834 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4835 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4836 AC_SUBST(WORKDIR_FOR_BUILD)
4838 dnl ===================================================================
4839 dnl Check for syslog header
4840 dnl ===================================================================
4841 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4843 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4844 dnl ===================================================================
4845 AC_MSG_CHECKING([whether to turn warnings to errors])
4846 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4847 ENABLE_WERROR="TRUE"
4848 AC_MSG_RESULT([yes])
4850 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4851 ENABLE_WERROR="TRUE"
4852 AC_MSG_RESULT([yes])
4857 AC_SUBST(ENABLE_WERROR)
4859 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4860 dnl ===================================================================
4861 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4862 if test -z "$enable_assert_always_abort"; then
4863 if test "$ENABLE_DEBUG" = TRUE; then
4864 enable_assert_always_abort=yes
4866 enable_assert_always_abort=no
4869 if test "$enable_assert_always_abort" = "yes"; then
4870 ASSERT_ALWAYS_ABORT="TRUE"
4871 AC_MSG_RESULT([yes])
4873 ASSERT_ALWAYS_ABORT="FALSE"
4876 AC_SUBST(ASSERT_ALWAYS_ABORT)
4878 # Determine whether to use ooenv for the instdir installation
4879 # ===================================================================
4880 if test $_os != "WINNT" -a $_os != "Darwin"; then
4881 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4882 if test "$enable_ooenv" = "no"; then
4886 AC_MSG_RESULT([yes])
4889 AC_SUBST(ENABLE_OOENV)
4891 if test "$USING_X11" != TRUE; then
4892 # be sure to do not mess with unneeded stuff
4898 build_gstreamer_1_0=no
4902 enable_cairo_canvas=no
4905 if test "$OS" = "HAIKU"; then
4906 enable_cairo_canvas=yes
4910 if test "$test_kf5" = "yes" -a "$enable_kde5" = "yes"; then
4911 AC_MSG_WARN([The kde5 VCL plugin was renamed to kf5. Please update your configuration to use --enable-kf5, as --enable-kde5 will be removed after the next major release!])
4912 add_warning "The kde5 VCL plugin was renamed to kf5. Please update your configuration to use --enable-kf5, as --enable-kde5 will be removed after the next major release!"
4916 if test "$test_kf5" = "yes"; then
4920 if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; then
4921 if test "$enable_qt5" = "no"; then
4922 AC_MSG_ERROR([KF5 support depends on QT5, so it conflicts with --disable-qt5])
4928 dnl ===================================================================
4929 dnl check for cups support
4930 dnl ===================================================================
4933 if test "$enable_cups" = "no"; then
4937 AC_MSG_CHECKING([whether to enable CUPS support])
4938 if test "$test_cups" = "yes"; then
4940 AC_MSG_RESULT([yes])
4942 AC_MSG_CHECKING([whether cups support is present])
4943 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4944 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4945 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4946 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4953 AC_SUBST(ENABLE_CUPS)
4956 if test "$test_fontconfig" = "yes"; then
4957 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4958 SYSTEM_FONTCONFIG=TRUE
4959 FilterLibs "${FONTCONFIG_LIBS}"
4960 FONTCONFIG_LIBS="${filteredlibs}"
4962 AC_SUBST(FONTCONFIG_CFLAGS)
4963 AC_SUBST(FONTCONFIG_LIBS)
4964 AC_SUBST([SYSTEM_FONTCONFIG])
4966 dnl whether to find & fetch external tarballs?
4967 dnl ===================================================================
4968 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4969 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4970 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4972 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4975 if test -z "$TARFILE_LOCATION"; then
4976 if test -d "$SRC_ROOT/src" ; then
4977 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4978 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4980 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4982 AbsolutePath "$TARFILE_LOCATION"
4983 PathFormat "${absolute_path}"
4984 TARFILE_LOCATION="${formatted_path}"
4986 AC_SUBST(TARFILE_LOCATION)
4988 AC_MSG_CHECKING([whether we want to fetch tarballs])
4989 if test "$enable_fetch_external" != "no"; then
4990 if test "$with_all_tarballs" = "yes"; then
4991 AC_MSG_RESULT([yes, all of them])
4992 DO_FETCH_TARBALLS="ALL"
4994 AC_MSG_RESULT([yes, if we use them])
4995 DO_FETCH_TARBALLS="TRUE"
5001 AC_SUBST(DO_FETCH_TARBALLS)
5003 AC_MSG_CHECKING([whether to build help])
5004 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
5005 BUILD_TYPE="$BUILD_TYPE HELP"
5006 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5007 case "$with_help" in
5009 ENABLE_HTMLHELP=TRUE
5010 SCPDEFS="$SCPDEFS -DWITH_HELP"
5011 AC_MSG_RESULT([HTML])
5014 ENABLE_HTMLHELP=TRUE
5016 AC_MSG_RESULT([HTML])
5019 SCPDEFS="$SCPDEFS -DWITH_HELP"
5020 AC_MSG_RESULT([yes])
5023 AC_MSG_ERROR([Unknown --with-help=$with_help])
5029 AC_SUBST([ENABLE_HTMLHELP])
5030 AC_SUBST([HELP_ONLINE])
5032 dnl Test whether to include MySpell dictionaries
5033 dnl ===================================================================
5034 AC_MSG_CHECKING([whether to include MySpell dictionaries])
5035 if test "$with_myspell_dicts" = "yes"; then
5036 AC_MSG_RESULT([yes])
5037 WITH_MYSPELL_DICTS=TRUE
5038 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
5039 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
5044 AC_SUBST(WITH_MYSPELL_DICTS)
5046 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
5047 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
5048 if test "$with_system_dicts" = yes; then
5049 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
5051 with_system_dicts=no
5054 AC_MSG_CHECKING([whether to use dicts from external paths])
5055 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
5056 AC_MSG_RESULT([yes])
5058 AC_MSG_CHECKING([for spelling dictionary directory])
5059 if test -n "$with_external_dict_dir"; then
5060 DICT_SYSTEM_DIR=file://$with_external_dict_dir
5062 DICT_SYSTEM_DIR=file:///usr/share/hunspell
5063 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
5064 DICT_SYSTEM_DIR=file:///usr/share/myspell
5067 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
5068 AC_MSG_CHECKING([for hyphenation patterns directory])
5069 if test -n "$with_external_hyph_dir"; then
5070 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
5072 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
5074 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
5075 AC_MSG_CHECKING([for thesaurus directory])
5076 if test -n "$with_external_thes_dir"; then
5077 THES_SYSTEM_DIR=file://$with_external_thes_dir
5079 THES_SYSTEM_DIR=file:///usr/share/mythes
5081 AC_MSG_RESULT([$THES_SYSTEM_DIR])
5086 AC_SUBST(SYSTEM_DICTS)
5087 AC_SUBST(DICT_SYSTEM_DIR)
5088 AC_SUBST(HYPH_SYSTEM_DIR)
5089 AC_SUBST(THES_SYSTEM_DIR)
5091 dnl ===================================================================
5092 dnl Precompiled headers.
5094 AC_MSG_CHECKING([whether to enable pch feature])
5095 if test -z "$enable_pch"; then
5096 if test "$_os" = "WINNT"; then
5097 # Enabled by default on Windows.
5103 if test "$enable_pch" != "no" -a "$_os" != "WINNT" -a "$GCC" != "yes" ; then
5104 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
5106 if test "$enable_pch" = "system"; then
5108 AC_MSG_RESULT([yes (system headers)])
5109 elif test "$enable_pch" = "base"; then
5111 AC_MSG_RESULT([yes (system and base headers)])
5112 elif test "$enable_pch" = "normal"; then
5114 AC_MSG_RESULT([yes (normal)])
5115 elif test "$enable_pch" = "full"; then
5117 AC_MSG_RESULT([yes (full)])
5118 elif test "$enable_pch" = "yes"; then
5119 # Pick a suitable default.
5120 if test "$GCC" = "yes"; then
5121 # With Clang and GCC higher levels do not seem to make a noticeable improvement,
5122 # while making the PCHs larger and rebuilds more likely.
5124 AC_MSG_RESULT([yes (system and base headers)])
5126 # With MSVC the highest level makes a significant difference,
5127 # and it was the default when there used to be no PCH levels.
5129 AC_MSG_RESULT([yes (full)])
5131 elif test "$enable_pch" = "no"; then
5134 AC_MSG_ERROR([Unknown value for --enable-pch])
5136 AC_SUBST(ENABLE_PCH)
5137 # ccache 3.7.1 and older do not properly detect/handle -include .gch in CCACHE_DEPEND mode
5138 if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_IS_CLANG" != "TRUE"; then
5139 AC_PATH_PROG([CCACHE_BIN],[ccache],[not found])
5140 if test "$CCACHE_BIN" != "not found"; then
5141 AC_MSG_CHECKING([ccache version])
5142 CCACHE_VERSION=`"$CCACHE_BIN" -V | "$AWK" '/^ccache version/{print $3}'`
5143 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5144 AC_MSG_RESULT([$CCACHE_VERSION])
5145 AC_MSG_CHECKING([whether ccache depend mode works properly with GCC PCH])
5146 if test "$CCACHE_NUMVER" -gt "030701"; then
5147 AC_MSG_RESULT([yes])
5149 AC_MSG_RESULT([no (not newer than 3.7.1)])
5157 AC_MSG_CHECKING([the GNU Make version])
5158 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5159 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5160 if test "$_make_longver" -ge "038200"; then
5161 AC_MSG_RESULT([$GNUMAKE $_make_version])
5163 elif test "$_make_longver" -ge "038100"; then
5164 if test "$build_os" = "cygwin"; then
5165 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
5167 AC_MSG_RESULT([$GNUMAKE $_make_version])
5169 dnl ===================================================================
5170 dnl Search all the common names for sha1sum
5171 dnl ===================================================================
5172 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
5173 if test -z "$SHA1SUM"; then
5174 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
5175 elif test "$SHA1SUM" = "openssl"; then
5176 SHA1SUM="openssl sha1"
5178 AC_MSG_CHECKING([for GNU Make bug 20033])
5179 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
5180 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
5181 A := \$(wildcard *.a)
5185 <TAB>@echo survived bug20033.
5189 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5202 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5203 <TAB>\$(call d1,\$(CHECKSUM)),\
5204 <TAB>\$(call d2,\$(CHECKSUM)))
5206 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5207 no_parallelism_make="YES"
5208 AC_MSG_RESULT([yes, disable parallelism])
5210 AC_MSG_RESULT([no, keep parallelism enabled])
5212 rm -rf $TESTGMAKEBUG20033
5214 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5217 # find if gnumake support file function
5218 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5219 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5220 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5221 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5223 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5224 \$(file >test.txt,Success )
5231 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5232 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5233 HAVE_GNUMAKE_FILE_FUNC=TRUE
5234 AC_MSG_RESULT([yes])
5238 rm -rf $TESTGMAKEFILEFUNC
5239 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5240 AC_SUBST(GNUMAKE_WIN_NATIVE)
5242 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5244 if test "$_make_ver_check" = ""; then
5248 HAVE_LD_HASH_STYLE=FALSE
5249 WITH_LINKER_HASH_STYLE=
5250 AC_MSG_CHECKING([for --hash-style gcc linker support])
5251 if test "$GCC" = "yes"; then
5252 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5253 hash_styles="gnu sysv"
5254 elif test "$with_linker_hash_style" = "no"; then
5257 hash_styles="$with_linker_hash_style"
5260 for hash_style in $hash_styles; do
5261 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5262 hash_style_ldflags_save=$LDFLAGS
5263 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5265 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5272 HAVE_LD_HASH_STYLE=TRUE
5273 WITH_LINKER_HASH_STYLE=$hash_style
5275 [HAVE_LD_HASH_STYLE=FALSE],
5276 [HAVE_LD_HASH_STYLE=FALSE])
5277 LDFLAGS=$hash_style_ldflags_save
5280 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5281 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5285 LDFLAGS=$hash_style_ldflags_save
5289 AC_SUBST(HAVE_LD_HASH_STYLE)
5290 AC_SUBST(WITH_LINKER_HASH_STYLE)
5292 dnl ===================================================================
5293 dnl Check whether there's a Perl version available.
5294 dnl ===================================================================
5295 if test -z "$with_perl_home"; then
5296 AC_PATH_PROG(PERL, perl)
5298 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5299 _perl_path="$with_perl_home/bin/perl"
5300 if test -x "$_perl_path"; then
5303 AC_MSG_ERROR([$_perl_path not found])
5307 dnl ===================================================================
5308 dnl Testing for Perl version 5 or greater.
5309 dnl $] is the Perl version variable, it is returned as an integer
5310 dnl ===================================================================
5311 if test "$PERL"; then
5312 AC_MSG_CHECKING([the Perl version])
5313 ${PERL} -e "exit($]);"
5315 if test "$_perl_version" -lt 5; then
5316 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
5318 AC_MSG_RESULT([Perl $_perl_version])
5320 AC_MSG_ERROR([Perl not found, install Perl 5])
5323 dnl ===================================================================
5324 dnl Testing for required Perl modules
5325 dnl ===================================================================
5327 AC_MSG_CHECKING([for required Perl modules])
5328 perl_use_string="use Cwd ; use Digest::MD5"
5329 if test "$_os" = "WINNT"; then
5330 if test -n "$PKGFORMAT"; then
5331 for i in $PKGFORMAT; do
5334 # for getting fonts versions to use in MSI
5335 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5341 if test "$with_system_hsqldb" = "yes"; then
5342 perl_use_string="$perl_use_string ; use Archive::Zip"
5344 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
5345 AC_MSG_RESULT([all modules found])
5347 AC_MSG_RESULT([failed to find some modules])
5348 # Find out which modules are missing.
5349 for i in $perl_use_string; do
5350 if test "$i" != "use" -a "$i" != ";"; then
5351 if ! $PERL -e "use $i;">/dev/null 2>&1; then
5352 missing_perl_modules="$missing_perl_modules $i"
5357 The missing Perl modules are: $missing_perl_modules
5358 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5361 dnl ===================================================================
5362 dnl Check for pkg-config
5363 dnl ===================================================================
5364 if test "$_os" != "WINNT"; then
5368 if test "$_os" != "WINNT"; then
5370 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5371 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5372 # explicitly. Or put /path/to/compiler in PATH yourself.
5374 # Use wrappers for LTO
5375 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5376 AC_CHECK_TOOL(AR,gcc-ar)
5377 AC_CHECK_TOOL(NM,gcc-nm)
5378 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5380 AC_CHECK_TOOL(AR,ar)
5381 AC_CHECK_TOOL(NM,nm)
5382 AC_CHECK_TOOL(RANLIB,ranlib)
5384 AC_CHECK_TOOL(OBJDUMP,objdump)
5385 AC_CHECK_TOOL(READELF,readelf)
5386 AC_CHECK_TOOL(STRIP,strip)
5387 if test "$_os" = "WINNT"; then
5388 AC_CHECK_TOOL(DLLTOOL,dlltool)
5389 AC_CHECK_TOOL(WINDRES,windres)
5396 AC_SUBST(PKG_CONFIG)
5402 dnl ===================================================================
5403 dnl pkg-config checks on macOS
5404 dnl ===================================================================
5406 if test $_os = Darwin; then
5407 AC_MSG_CHECKING([for bogus pkg-config])
5408 if test -n "$PKG_CONFIG"; then
5409 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5410 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5412 if test "$enable_bogus_pkg_config" = "yes"; then
5413 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5415 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please modify your PATH variable so that $PKG_CONFIG is no longer found by configure scripts.])
5419 AC_MSG_RESULT([no, good])
5425 # Return value: $csctest
5429 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5430 if test -n "$regvalue"; then
5438 # Return value: $altest
5442 # We need this check to detect 4.6.1 or above.
5443 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
5444 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5445 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5451 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5452 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5453 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5466 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
5467 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5468 if test -n "$regvalue"; then
5475 find_winsdk_version()
5477 # Args: $1 : SDK version as in "8.0", "8.1A" etc
5478 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5480 unset winsdktest winsdkbinsubdir winsdklibsubdir
5484 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5485 if test -n "$regvalue"; then
5486 winsdktest=$regvalue
5487 winsdklibsubdir=win8
5492 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5493 if test -n "$regvalue"; then
5494 winsdktest=$regvalue
5495 winsdklibsubdir=winv6.3
5500 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5501 if test -n "$regvalue"; then
5502 winsdktest=$regvalue
5503 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5504 if test -n "$regvalue"; then
5505 winsdkbinsubdir="$regvalue".0
5506 winsdklibsubdir=$winsdkbinsubdir
5507 tmppath="$winsdktest\\Include\\$winsdklibsubdir"
5508 # test exist the SDK path
5509 if test -d "$tmppath"; then
5510 # when path is convertible to a short path then path is okay
5511 cygpath -d "$tmppath" >/dev/null 2>&1
5512 if test $? -ne 0; then
5513 AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
5516 AC_MSG_ERROR([The Windows SDK not found, check the installation])
5527 # Return value: From find_winsdk_version
5531 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5532 find_winsdk_version $ver
5533 if test -n "$winsdktest"; then
5541 AC_MSG_CHECKING([for MSVC merge modules directory])
5542 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5545 my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm ${my_msm_files}"
5548 for f in $my_msm_files; do
5549 echo "$as_me:$LINENO: searching for $f" >&5
5553 for ver in 14.0 15.0; do
5554 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5555 if test -n "$regvalue"; then
5556 for f in ${my_msm_files}; do
5557 if test -e "$regvalue/${f}"; then
5564 dnl Is the following fallback really necessary, or was it added in response
5565 dnl to never having started Visual Studio on a given machine, so the
5566 dnl registry keys checked above had presumably not yet been created?
5567 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5568 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5569 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5570 dnl expanding to "C:\Program Files\Common Files"), which would need
5571 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5572 dnl obtain its value from cygwin:
5573 if test -z "$msmdir"; then
5574 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5575 for f in ${my_msm_files}; do
5576 if test -e "$my_msm_dir/${f}"; then
5582 dnl Starting from MSVC 15.0, merge modules are located in different directory
5585 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5586 echo "$as_me:$LINENO: looking in $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])" >&5
5587 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5588 for f in ${my_msm_files}; do
5589 if test -e "$my_msm_dir/${f}"; then
5598 if test -n "$msmdir"; then
5599 msmdir=`cygpath -m "$msmdir"`
5600 AC_MSG_RESULT([$msmdir])
5602 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5603 AC_MSG_FAILURE([not found])
5605 AC_MSG_WARN([not found (check config.log)])
5606 add_warning "MSM none of ${my_msm_files} found"
5611 find_msvc_x64_dlls()
5613 AC_MSG_CHECKING([for MSVC x64 DLL path])
5614 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5617 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5618 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT" >&5
5619 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5620 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5623 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT" >&5
5624 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"; then
5625 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"
5628 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC150.CRT" >&5
5629 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
5630 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
5636 AC_MSG_RESULT([$msvcdllpath])
5637 AC_MSG_CHECKING([for MSVC x64 DLLs])
5638 msvcdlls="msvcp140.dll vcruntime140.dll"
5639 for dll in $msvcdlls; do
5640 if ! test -f "$msvcdllpath/$dll"; then
5641 AC_MSG_FAILURE([missing $dll])
5644 AC_MSG_RESULT([found all ($msvcdlls)])
5647 dnl =========================================
5648 dnl Check for the Windows SDK.
5649 dnl =========================================
5650 if test "$_os" = "WINNT"; then
5651 AC_MSG_CHECKING([for Windows SDK])
5652 if test "$build_os" = "cygwin"; then
5654 WINDOWS_SDK_HOME=$winsdktest
5656 # normalize if found
5657 if test -n "$WINDOWS_SDK_HOME"; then
5658 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5659 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5662 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5665 if test -n "$WINDOWS_SDK_HOME"; then
5666 # Remove a possible trailing backslash
5667 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5669 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5670 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5671 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5672 have_windows_sdk_headers=yes
5673 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5674 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5675 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5676 have_windows_sdk_headers=yes
5677 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5678 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5679 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5680 have_windows_sdk_headers=yes
5682 have_windows_sdk_headers=no
5685 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5686 have_windows_sdk_libs=yes
5687 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5688 have_windows_sdk_libs=yes
5690 have_windows_sdk_libs=no
5693 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5694 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5695 the Windows SDK are installed.])
5699 if test -z "$WINDOWS_SDK_HOME"; then
5700 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5701 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5702 WINDOWS_SDK_VERSION=80
5703 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5704 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5705 WINDOWS_SDK_VERSION=81
5706 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5707 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5708 WINDOWS_SDK_VERSION=10
5709 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5711 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5713 PathFormat "$WINDOWS_SDK_HOME"
5714 WINDOWS_SDK_HOME="$formatted_path"
5715 if test "$build_os" = "cygwin"; then
5716 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5717 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5718 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5719 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5720 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5724 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5725 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5726 dnl but not in v8.0), so allow this to be overridden with a
5727 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5728 dnl and configuration error if no WiLangId.vbs is found would arguably be
5729 dnl better, but I do not know under which conditions exactly it is needed by
5731 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5732 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5733 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5734 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5736 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5737 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5739 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5740 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5743 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5744 if test -n "$with_package_format" -a "$with_package_format" != no; then
5745 for i in "$with_package_format"; do
5746 if test "$i" = "msi"; then
5747 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5748 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5755 AC_SUBST(WINDOWS_SDK_HOME)
5756 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5757 AC_SUBST(WINDOWS_SDK_VERSION)
5758 AC_SUBST(WINDOWS_SDK_WILANGID)
5760 if test "$build_os" = "cygwin"; then
5761 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5762 dnl dir, it also determines that dir's path w/o an arch segment if any,
5763 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5764 AC_MSG_CHECKING([for midl.exe])
5767 if test -n "$winsdkbinsubdir" \
5768 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5770 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5771 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5772 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5773 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5774 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5775 elif test -f "$winsdktest/Bin/midl.exe"; then
5776 MIDL_PATH=$winsdktest/Bin
5777 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5779 if test ! -f "$MIDL_PATH/midl.exe"; then
5780 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5782 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5785 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5786 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5788 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5789 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5790 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5791 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5792 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5793 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5794 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5795 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5796 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5797 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5798 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5799 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5801 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5805 AC_MSG_CHECKING([for csc.exe])
5807 if test -f "$csctest/csc.exe"; then
5810 if test ! -f "$CSC_PATH/csc.exe"; then
5811 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5813 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5816 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5819 AC_MSG_CHECKING([for al.exe])
5821 if test -n "$winsdkbinsubdir" \
5822 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5824 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5825 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5826 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5827 elif test -f "$winsdktest/Bin/al.exe"; then
5828 AL_PATH="$winsdktest/Bin"
5831 if test -z "$AL_PATH"; then
5833 if test -f "$altest/bin/al.exe"; then
5834 AL_PATH="$altest/bin"
5835 elif test -f "$altest/al.exe"; then
5839 if test ! -f "$AL_PATH/al.exe"; then
5840 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5842 AC_MSG_RESULT([$AL_PATH/al.exe])
5845 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5847 dnl Check mscoree.lib / .NET Framework dir
5848 AC_MSG_CHECKING(.NET Framework)
5850 PathFormat "$frametest"
5851 frametest="$formatted_path"
5852 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5853 DOTNET_FRAMEWORK_HOME="$frametest"
5856 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5857 DOTNET_FRAMEWORK_HOME="$winsdktest"
5860 if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5861 AC_MSG_ERROR([mscoree.lib not found])
5863 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5865 PathFormat "$MIDL_PATH"
5866 MIDL_PATH="$formatted_path"
5868 PathFormat "$AL_PATH"
5869 AL_PATH="$formatted_path"
5871 PathFormat "$DOTNET_FRAMEWORK_HOME"
5872 DOTNET_FRAMEWORK_HOME="$formatted_path"
5874 PathFormat "$CSC_PATH"
5875 CSC_PATH="$formatted_path"
5878 dnl ===================================================================
5879 dnl Check if stdc headers are available excluding MSVC.
5880 dnl ===================================================================
5881 if test "$_os" != "WINNT"; then
5885 dnl ===================================================================
5886 dnl Testing for C++ compiler and version...
5887 dnl ===================================================================
5889 if test "$_os" != "WINNT"; then
5890 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5891 save_CXXFLAGS=$CXXFLAGS
5893 CXXFLAGS=$save_CXXFLAGS
5894 if test -z "$CXX_BASE"; then
5895 CXX_BASE=`first_arg_basename "$CXX"`
5898 if test -n "$CC" -a -z "$CXX"; then
5904 dnl check for GNU C++ compiler version
5905 if test "$GXX" = "yes" -a -z "$COM_IS_CLANG"; then
5906 AC_MSG_CHECKING([the GNU C++ compiler version])
5908 _gpp_version=`$CXX -dumpversion`
5909 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5911 if test "$_gpp_majmin" -lt "700"; then
5912 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 7.0 to build LibreOffice, you have $_gpp_version.])
5914 AC_MSG_RESULT([ok (g++ $_gpp_version)])
5917 dnl see https://code.google.com/p/android/issues/detail?id=41770
5921 AC_MSG_CHECKING([whether $CXX_BASE is broken with boost.thread])
5922 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5923 #include <bits/c++config.h>]],[[
5924 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5925 && !defined(_GLIBCXX__PTHREADS) \
5926 && !defined(_GLIBCXX_HAS_GTHREADS)
5929 ]])],[AC_MSG_RESULT([yes])
5930 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5932 if test $glibcxx_threads = yes; then
5933 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5936 AC_SUBST(BOOST_CXXFLAGS)
5939 # prefx CXX with ccache if needed
5941 if test "$CCACHE" != ""; then
5942 AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
5944 save_CXXFLAGS=$CXXFLAGS
5945 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5946 dnl an empty program will do, we're checking the compiler flags
5947 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5948 [use_ccache=yes], [use_ccache=no])
5949 if test $use_ccache = yes; then
5950 AC_MSG_RESULT([yes])
5953 CXX_BASE="ccache $CXX_BASE"
5956 CXXFLAGS=$save_CXXFLAGS
5960 dnl ===================================================================
5961 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5962 dnl ===================================================================
5964 if test "$_os" != "WINNT"; then
5967 dnl Check whether there's a C pre-processor.
5972 dnl ===================================================================
5973 dnl Find integral type sizes and alignments
5974 dnl ===================================================================
5976 if test "$_os" != "WINNT"; then
5978 if test "$_os" == "iOS"; then
5979 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
5981 ac_cv_sizeof_short=2
5983 ac_cv_sizeof_long_long=8
5984 ac_cv_sizeof_double=8
5985 ac_cv_sizeof_voidp=8
5987 AC_CHECK_SIZEOF(long)
5988 AC_CHECK_SIZEOF(short)
5989 AC_CHECK_SIZEOF(int)
5990 AC_CHECK_SIZEOF(long long)
5991 AC_CHECK_SIZEOF(double)
5992 AC_CHECK_SIZEOF(void*)
5995 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5996 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5997 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5998 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5999 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
6001 dnl Allow build without AC_CHECK_ALIGNOF, grrr
6002 m4_pattern_allow([AC_CHECK_ALIGNOF])
6003 m4_ifdef([AC_CHECK_ALIGNOF],
6005 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
6006 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
6007 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
6008 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
6011 case "$_os-$host_cpu" in
6013 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6014 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6015 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
6016 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
6019 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6020 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6021 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
6022 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
6025 if test -z "$ac_cv_alignof_short" -o \
6026 -z "$ac_cv_alignof_int" -o \
6027 -z "$ac_cv_alignof_long" -o \
6028 -z "$ac_cv_alignof_double"; then
6029 AC_MSG_ERROR([Your Autoconf doesn't have [AC_][CHECK_ALIGNOF]. You need to set the environment variables ac_cv_alignof_short, ac_cv_alignof_int, ac_cv_alignof_long and ac_cv_alignof_double.])
6035 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
6036 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
6037 if test $ac_cv_sizeof_long -eq 8; then
6038 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
6039 elif test $ac_cv_sizeof_double -eq 8; then
6040 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
6042 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
6045 dnl Check for large file support
6047 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
6048 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
6050 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
6051 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
6055 SAL_TYPES_SIZEOFSHORT=2
6056 SAL_TYPES_SIZEOFINT=4
6057 SAL_TYPES_SIZEOFLONG=4
6058 SAL_TYPES_SIZEOFLONGLONG=8
6059 if test "$BITNESS_OVERRIDE" = ""; then
6060 SAL_TYPES_SIZEOFPOINTER=4
6062 SAL_TYPES_SIZEOFPOINTER=8
6064 SAL_TYPES_ALIGNMENT2=2
6065 SAL_TYPES_ALIGNMENT4=4
6066 SAL_TYPES_ALIGNMENT8=8
6069 AC_SUBST(LFS_CFLAGS)
6071 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
6072 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
6073 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
6074 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
6075 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
6076 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
6077 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
6078 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
6080 dnl ===================================================================
6081 dnl Check whether to enable runtime optimizations
6082 dnl ===================================================================
6083 ENABLE_RUNTIME_OPTIMIZATIONS=
6084 AC_MSG_CHECKING([whether to enable runtime optimizations])
6085 if test -z "$enable_runtime_optimizations"; then
6089 enable_runtime_optimizations=no
6095 if test "$enable_runtime_optimizations" != no; then
6096 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
6097 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
6098 AC_MSG_RESULT([yes])
6102 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
6104 dnl ===================================================================
6105 dnl Check if valgrind headers are available
6106 dnl ===================================================================
6108 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
6109 prev_cppflags=$CPPFLAGS
6110 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
6111 # or where does it come from?
6112 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
6113 AC_CHECK_HEADER([valgrind/valgrind.h],
6114 [ENABLE_VALGRIND=TRUE])
6115 CPPFLAGS=$prev_cppflags
6117 AC_SUBST([ENABLE_VALGRIND])
6118 if test -z "$ENABLE_VALGRIND"; then
6119 if test "$with_valgrind" = yes; then
6120 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
6124 AC_SUBST([VALGRIND_CFLAGS])
6127 dnl ===================================================================
6128 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
6129 dnl ===================================================================
6131 # We need at least the sys/sdt.h include header.
6132 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
6133 if test "$SDT_H_FOUND" = "TRUE"; then
6134 # Found sys/sdt.h header, now make sure the c++ compiler works.
6135 # Old g++ versions had problems with probes in constructors/destructors.
6136 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
6138 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6139 #include <sys/sdt.h>
6147 ProbeClass(int& v, const char *n) : ref(v), name(n)
6149 DTRACE_PROBE2(_test_, cons, name, ref);
6152 void method(int min)
6154 DTRACE_PROBE3(_test_, meth, name, ref, min);
6160 DTRACE_PROBE2(_test_, dest, name, ref);
6165 DTRACE_PROBE1(_test_, call, i);
6166 ProbeClass inst = ProbeClass(i, "call");
6168 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
6169 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
6172 AC_CONFIG_HEADERS([config_host/config_probes.h])
6174 dnl ===================================================================
6176 dnl ===================================================================
6177 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6178 AC_MSG_CHECKING([whether $CC_BASE supports -mno-avx])
6180 CFLAGS="$CFLAGS -Werror -mno-avx"
6181 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
6183 if test "$HAVE_GCC_AVX" = "TRUE"; then
6184 AC_MSG_RESULT([yes])
6189 AC_MSG_CHECKING([whether $CC_BASE supports -fstack-protector-strong])
6191 CFLAGS="$CFLAGS -O0 -Werror -fstack-protector-strong"
6192 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; a[7] = 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
6194 if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
6195 AC_MSG_RESULT([yes])
6200 AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
6201 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6203 if (__sync_add_and_fetch(&v, 1) != 1 ||
6204 __sync_sub_and_fetch(&v, 1) != 0)
6206 __sync_synchronize();
6207 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6211 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6212 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6213 AC_MSG_RESULT([yes])
6214 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6219 AC_MSG_CHECKING([whether $CC_BASE supports __builtin_ffs])
6220 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
6221 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
6222 AC_MSG_RESULT([yes])
6223 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
6228 AC_MSG_CHECKING([whether $CC_BASE supports __attribute__((deprecated(message)))])
6230 CFLAGS="$CFLAGS -Werror"
6231 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6232 __attribute__((deprecated("test"))) void f();
6234 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6235 AC_MSG_RESULT([yes])
6236 ], [AC_MSG_RESULT([no])])
6239 AC_MSG_CHECKING([whether $CXX_BASE defines __base_class_type_info in cxxabi.h])
6241 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6244 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
6246 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
6247 AC_MSG_RESULT([yes])
6248 ], [AC_MSG_RESULT([no])])
6251 AC_MSG_CHECKING([whether $CXX_BASE defines __class_type_info in cxxabi.h])
6253 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6256 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
6258 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
6259 AC_MSG_RESULT([yes])
6260 ], [AC_MSG_RESULT([no])])
6263 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_allocate_exception in cxxabi.h])
6265 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6267 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6269 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6270 AC_MSG_RESULT([yes])
6271 ], [AC_MSG_RESULT([no])])
6274 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_eh_globals in cxxabi.h])
6276 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6279 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6281 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6282 AC_MSG_RESULT([yes])
6283 ], [AC_MSG_RESULT([no])])
6286 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exceptions in cxxabi.h])
6288 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6291 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6293 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6294 AC_MSG_RESULT([yes])
6295 ], [AC_MSG_RESULT([no])])
6298 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_get_globals in cxxabi.h])
6300 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6302 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6304 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6305 AC_MSG_RESULT([yes])
6306 ], [AC_MSG_RESULT([no])])
6309 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_current_exception_type in cxxabi.h])
6311 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6313 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6315 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6316 AC_MSG_RESULT([yes])
6317 ], [AC_MSG_RESULT([no])])
6320 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_throw in cxxabi.h])
6322 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6324 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6326 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6327 AC_MSG_RESULT([yes])
6328 ], [AC_MSG_RESULT([no])])
6331 AC_MSG_CHECKING([whether $CXX_BASE defines __si_class_type_info in cxxabi.h])
6333 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6336 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6338 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6339 AC_MSG_RESULT([yes])
6340 ], [AC_MSG_RESULT([no])])
6343 AC_MSG_CHECKING([whether $CXX_BASE defines __vmi_class_type_info in cxxabi.h])
6345 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6348 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6350 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6351 AC_MSG_RESULT([yes])
6352 ], [AC_MSG_RESULT([no])])
6355 dnl Available in GCC 4.9 and at least since Clang 3.4:
6356 AC_MSG_CHECKING([whether $CXX_BASE supports __attribute__((warn_unused))])
6358 save_CXXFLAGS=$CXXFLAGS
6359 CXXFLAGS="$CXXFLAGS -Werror"
6360 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6361 struct __attribute__((warn_unused)) dummy {};
6363 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6364 AC_MSG_RESULT([yes])
6365 ], [AC_MSG_RESULT([no])])
6366 CXXFLAGS=$save_CXXFLAGS
6370 AC_SUBST(HAVE_GCC_AVX)
6371 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
6372 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6373 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6375 dnl ===================================================================
6376 dnl Identify the C++ library
6377 dnl ===================================================================
6379 AC_MSG_CHECKING([what the C++ library is])
6381 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6387 [CPP_LIBRARY=GLIBCXX
6388 cpp_library_name="GNU libstdc++"
6390 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6392 #ifndef _LIBCPP_VERSION
6397 cpp_library_name="LLVM libc++"
6398 AC_DEFINE([HAVE_LIBCXX])
6400 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6407 cpp_library_name="Microsoft"
6409 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6410 AC_MSG_RESULT([$cpp_library_name])
6413 dnl ===================================================================
6415 dnl ===================================================================
6416 AC_PATH_PROG(GPERF, gperf)
6417 if test -z "$GPERF"; then
6418 AC_MSG_ERROR([gperf not found but needed. Install it.])
6420 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6421 GPERF=`cygpath -m $GPERF`
6423 AC_MSG_CHECKING([whether gperf is new enough])
6424 my_gperf_ver1=$($GPERF --version | head -n 1)
6425 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
6426 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
6427 if test "$my_gperf_ver3" -ge 301; then
6428 AC_MSG_RESULT([yes ($my_gperf_ver2)])
6430 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
6434 dnl ===================================================================
6435 dnl Check for system libcmis
6436 dnl ===================================================================
6437 # libcmis requires curl and we can't build curl for iOS
6438 if test $_os != iOS; then
6439 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2])
6444 AC_SUBST(ENABLE_LIBCMIS)
6446 dnl ===================================================================
6448 dnl ===================================================================
6450 AC_MSG_CHECKING([whether $CXX_BASE supports C++17])
6452 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6453 CXXFLAGS_CXX11='-std:c++17 -Zc:__cplusplus'
6454 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6455 my_flags='-std=gnu++2a -std=c++2a -std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z'
6456 for flag in $my_flags; do
6457 if test "$COM" = MSC; then
6458 flag="-Xclang $flag"
6460 save_CXXFLAGS=$CXXFLAGS
6461 CXXFLAGS="$CXXFLAGS $flag -Werror"
6462 if test "$SYSTEM_LIBCMIS" = TRUE; then
6463 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6466 dnl Clang 3.9 supports __float128 since
6467 dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
6468 dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
6469 dnl hacky workaround to be able to include <vector> (as is done in the main check whether
6470 dnl $flag is supported below, so check this first):
6472 my_float128hack_impl=-D__float128=void
6473 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6475 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6479 dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
6480 dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
6481 dnl is available during its build, but it's usually built using GCC, and so c++config.h
6482 dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
6483 dnl place where __float128 is used is in a template specialization, -D__float128=void
6484 dnl will avoid the problem there while still causing a problem if somebody actually uses
6485 dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
6486 dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
6487 dnl "fixed" with this hack):
6488 CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
6489 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6491 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6494 ],[my_float128hack=$my_float128hack_impl])
6496 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6497 #include <algorithm>
6499 #include <functional>
6502 #if defined SYSTEM_LIBCMIS
6503 // See ucb/source/ucp/cmis/auth_provider.hxx:
6504 #if !defined __clang__
6505 #pragma GCC diagnostic push
6506 #pragma GCC diagnostic ignored "-Wdeprecated"
6507 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6509 #include <libcmis/libcmis.hxx>
6510 #if !defined __clang__
6511 #pragma GCC diagnostic pop
6515 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6516 std::sort(v.begin(), v.end(), fn);
6519 // At least with glibc-headers-2.28-26.fc29.x86_64, when building for Linux x86 32-bit
6520 // (via -m32) and passed-in CXXFLAGS setting -O1 (or higher; overriding -Os as set in
6521 // solenv/gbuild/platform/LINUX_INTEL_GCC.mk), std=gnu* would cause math_errhandling to
6522 // get undef'ed in /usr/include/bits/mathinline.h, while std=c* keeps it defined (as
6523 // needed by sc/source/core/tool/math.cxx):
6524 int g() { return math_errhandling; }
6525 ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
6527 CXXFLAGS=$save_CXXFLAGS
6528 if test -n "$CXXFLAGS_CXX11"; then
6533 if test -n "$CXXFLAGS_CXX11"; then
6534 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6538 AC_SUBST(CXXFLAGS_CXX11)
6540 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6541 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6542 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6543 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6544 dnl again towards 4.7.2:
6545 if test $CPP_LIBRARY = GLIBCXX; then
6546 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6548 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6550 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6551 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6552 // GCC 4.7.0: 20120322
6553 // GCC 4.7.1: 20120614
6554 // and using a range check is not possible as the mapping between
6555 // __GLIBCXX__ values and GCC versions is not monotonic
6560 ]])], [AC_MSG_RESULT(no, ok)],
6561 [AC_MSG_ERROR(yes)])
6565 AC_MSG_CHECKING([whether $CXX_BASE supports C++11 without Language Defect 757])
6566 save_CXXFLAGS=$CXXFLAGS
6567 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6570 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6573 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6589 a thinga[]={{0,0}, {1,1}};
6590 b thingb[]={{0,0}, {1,1}};
6591 size_t i = sizeof(sal_n_array_size(thinga));
6592 size_t j = sizeof(sal_n_array_size(thingb));
6593 return !(i != 0 && j != 0);
6595 ], [ AC_MSG_RESULT(yes) ],
6596 [ AC_MSG_ERROR(no)])
6598 CXXFLAGS=$save_CXXFLAGS
6600 dnl _Pragma support (may require C++11)
6601 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6602 AC_MSG_CHECKING([whether $CXX_BASE supports _Pragma operator])
6604 save_CXXFLAGS=$CXXFLAGS
6605 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6606 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6607 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6609 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6610 AC_MSG_RESULT([yes])
6611 ], [AC_MSG_RESULT([no])])
6613 CXXFLAGS=$save_CXXFLAGS
6616 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6617 if test "$GCC" = yes; then
6618 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
6620 save_CXXFLAGS=$CXXFLAGS
6621 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6622 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6623 CXXFLAGS=$save_CXXFLAGS
6625 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6626 AC_MSG_RESULT([yes])
6631 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6633 AC_MSG_CHECKING([whether $CXX_BASE supports guaranteed copy elision])
6635 save_CXXFLAGS=$CXXFLAGS
6636 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6637 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6638 // At least VS 2017 15.8.1 defines __cpp_guaranteed_copy_elision as 201606L without actually
6640 #if !defined __cpp_guaranteed_copy_elision || (defined _MSC_VER && !defined __clang__)
6649 void f() { S c(copy()); }
6652 AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
6653 AC_MSG_RESULT([yes])
6654 ], [AC_MSG_RESULT([no])])
6655 CXXFLAGS=$save_CXXFLAGS
6658 AC_MSG_CHECKING([whether $CXX_BASE has GCC bug 87150])
6660 save_CXXFLAGS=$CXXFLAGS
6661 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6662 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6663 struct S1 { S1(S1 &&); };
6665 S1 f(S2 s) { return s; }
6667 AC_DEFINE([HAVE_GCC_BUG_87150],[1])
6668 AC_MSG_RESULT([yes])
6669 ], [AC_MSG_RESULT([no])])
6670 CXXFLAGS=$save_CXXFLAGS
6673 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
6674 dnl uninitialized warning for code like
6677 dnl boost::optional<OString> * g(bool b) {
6678 dnl boost::optional<OString> o;
6680 dnl return new boost::optional<OString>(o);
6683 dnl (as is e.g. present, in a slightly more elaborate form, in
6684 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
6685 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
6686 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
6687 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
6688 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=maybe-uninitialized])
6690 save_CXXFLAGS=$CXXFLAGS
6691 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
6692 if test "$ENABLE_OPTIMIZED" = TRUE; then
6693 CXXFLAGS="$CXXFLAGS -O2"
6695 CXXFLAGS="$CXXFLAGS -O0"
6697 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6706 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
6707 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
6713 char stg[sizeof (S1)];
6721 ]])], [AC_MSG_RESULT([no])], [
6722 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
6723 AC_MSG_RESULT([yes])
6725 CXXFLAGS=$save_CXXFLAGS
6728 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
6730 dnl ===================================================================
6731 dnl CPU Intrinsics support - SSE, AVX
6732 dnl ===================================================================
6734 INTRINSICS_CXXFLAGS=""
6736 if test "$GCC" = "yes"; then
6737 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
6739 save_CXXFLAGS=$CXXFLAGS
6740 CXXFLAGS="$CXXFLAGS -msse2"
6741 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6742 #include <emmintrin.h>
6744 volatile __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6745 c = _mm_xor_si128 (a, b);
6749 [can_compile_sse2=yes],
6750 [can_compile_sse2=no])
6752 CXXFLAGS=$save_CXXFLAGS
6753 AC_MSG_RESULT([${can_compile_sse2}])
6754 if test "${can_compile_sse2}" = "yes" ; then
6755 INTRINSICS_CXXFLAGS="-msse2"
6757 AC_MSG_WARN([cannot compile SSE2 intrinsics])
6760 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
6762 save_CXXFLAGS=$CXXFLAGS
6763 CXXFLAGS="$CXXFLAGS -mssse3"
6764 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6765 #include <tmmintrin.h>
6767 volatile __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6768 c = _mm_maddubs_epi16 (a, b);
6772 [can_compile_ssse3=yes],
6773 [can_compile_ssse3=no])
6775 CXXFLAGS=$save_CXXFLAGS
6776 AC_MSG_RESULT([${can_compile_ssse3}])
6777 if test "${can_compile_ssse3}" = "yes" ; then
6778 INTRINSICS_CXXFLAGS="-mssse3"
6780 AC_MSG_WARN([cannot compile SSSE3 intrinsics])
6783 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
6785 save_CXXFLAGS=$CXXFLAGS
6786 CXXFLAGS="$CXXFLAGS -mavx"
6787 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6788 #include <immintrin.h>
6790 volatile __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
6791 c = _mm256_xor_ps(a, b);
6795 [can_compile_avx=yes],
6796 [can_compile_avx=no])
6798 CXXFLAGS=$save_CXXFLAGS
6799 AC_MSG_RESULT([${can_compile_avx}])
6800 if test "${can_compile_avx}" = "yes" ; then
6801 INTRINSICS_CXXFLAGS="-mavx"
6803 AC_MSG_WARN([cannot compile AVX intrinsics])
6806 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
6808 save_CXXFLAGS=$CXXFLAGS
6809 CXXFLAGS="$CXXFLAGS -mavx2"
6810 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6811 #include <immintrin.h>
6813 volatile __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
6814 c = _mm256_maddubs_epi16(a, b);
6818 [can_compile_avx2=yes],
6819 [can_compile_avx2=no])
6821 CXXFLAGS=$save_CXXFLAGS
6822 AC_MSG_RESULT([${can_compile_avx2}])
6823 if test "${can_compile_avx2}" = "yes" ; then
6824 INTRINSICS_CXXFLAGS="-mavx2"
6826 AC_MSG_WARN([cannot compile AVX2 intrinsics])
6830 AC_SUBST([INTRINSICS_CXXFLAGS])
6832 dnl ===================================================================
6833 dnl system stl sanity tests
6834 dnl ===================================================================
6835 if test "$_os" != "WINNT"; then
6839 save_CPPFLAGS="$CPPFLAGS"
6840 if test -n "$MACOSX_SDK_PATH"; then
6841 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6844 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6846 if test "$CPP_LIBRARY" = GLIBCXX; then
6847 dnl gcc#19664, gcc#22482, rhbz#162935
6848 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6849 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6850 AC_MSG_RESULT([$stlvisok])
6851 if test "$stlvisok" = "no"; then
6852 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
6856 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6857 # when we don't make any dynamic libraries?
6858 if test "$DISABLE_DYNLOADING" = ""; then
6859 AC_MSG_CHECKING([if $CXX_BASE is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6860 cat > conftestlib1.cc <<_ACEOF
6861 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6862 struct S2: S1<int> { virtual ~S2(); };
6865 cat > conftestlib2.cc <<_ACEOF
6866 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6867 struct S2: S1<int> { virtual ~S2(); };
6868 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6870 gccvisinlineshiddenok=yes
6871 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6872 gccvisinlineshiddenok=no
6874 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6875 dnl known to not work with -z defs (unsetting which makes the test
6877 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6878 if test "$COM_IS_CLANG" = TRUE; then
6879 for i in $CXX $CXXFLAGS; do
6882 my_linkflagsnoundefs=
6888 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6889 gccvisinlineshiddenok=no
6894 AC_MSG_RESULT([$gccvisinlineshiddenok])
6895 if test "$gccvisinlineshiddenok" = "no"; then
6896 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6900 AC_MSG_CHECKING([if $CXX_BASE has a visibility bug with class-level attributes (GCC bug 26905)])
6901 cat >visibility.cxx <<_ACEOF
6902 #pragma GCC visibility push(hidden)
6903 struct __attribute__ ((visibility ("default"))) TestStruct {
6906 __attribute__ ((visibility ("default"))) void TestFunc() {
6910 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
6915 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
6918 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
6930 rm -f visibility.s visibility.cxx
6932 AC_MSG_RESULT([$gccvisbroken])
6933 if test "$gccvisbroken" = "yes"; then
6934 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
6937 CPPFLAGS="$save_CPPFLAGS"
6942 dnl ===================================================================
6944 dnl ===================================================================
6946 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6947 if test "$GCC" = "yes"; then
6948 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-enforce-eh-specs])
6950 save_CXXFLAGS=$CXXFLAGS
6951 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6952 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6953 CXXFLAGS=$save_CXXFLAGS
6955 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6956 AC_MSG_RESULT([yes])
6961 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6963 dnl ===================================================================
6964 dnl Compiler plugins
6965 dnl ===================================================================
6968 # currently only Clang
6970 if test "$COM_IS_CLANG" != "TRUE"; then
6971 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
6972 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
6973 enable_compiler_plugins=no
6977 if test "$COM_IS_CLANG" = "TRUE"; then
6978 if test -n "$enable_compiler_plugins"; then
6979 compiler_plugins="$enable_compiler_plugins"
6980 elif test -n "$ENABLE_DBGUTIL"; then
6981 compiler_plugins=test
6985 if test "$compiler_plugins" != no -a "$my_apple_clang" != yes; then
6986 if test "$CLANGVER" -lt 50002; then
6987 if test "$compiler_plugins" = yes; then
6988 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 5.0.2.])
6994 if test "$compiler_plugins" != "no"; then
6995 dnl The prefix where Clang resides, override to where Clang resides if
6996 dnl using a source build:
6997 if test -z "$CLANGDIR"; then
6998 CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $CXX))))
7001 save_CPPFLAGS=$CPPFLAGS
7004 # compiler plugins must be built with "native" compiler that was used to build Clang itself:
7005 : "${COMPILER_PLUGINS_CXX=g++ -std=c++11}"
7006 CXX=$COMPILER_PLUGINS_CXX
7007 CXXCPP="$COMPILER_PLUGINS_CXX -E"
7008 CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
7009 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
7010 [COMPILER_PLUGINS=TRUE],
7012 if test "$compiler_plugins" = "yes"; then
7013 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
7015 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
7016 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
7021 CPPFLAGS=$save_CPPFLAGS
7025 if test "$enable_compiler_plugins" = "yes"; then
7026 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
7029 AC_SUBST(COMPILER_PLUGINS)
7030 AC_SUBST(COMPILER_PLUGINS_CXX)
7031 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
7032 AC_SUBST(COMPILER_PLUGINS_DEBUG)
7033 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
7035 AC_SUBST(CLANGLIBDIR)
7037 # Plugin to help linker.
7038 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
7039 # This makes --enable-lto build with clang work.
7042 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
7043 AC_SUBST(HAVE_POSIX_FALLOCATE)
7045 dnl ===================================================================
7046 dnl Custom build version
7047 dnl ===================================================================
7049 AC_MSG_CHECKING([whether to add custom build version])
7050 if test "$with_build_version" != ""; then
7051 BUILD_VER_STRING=$with_build_version
7052 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
7057 AC_SUBST(BUILD_VER_STRING)
7059 JITC_PROCESSOR_TYPE=""
7060 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
7061 # IBMs JDK needs this...
7062 JITC_PROCESSOR_TYPE=6
7063 export JITC_PROCESSOR_TYPE
7065 AC_SUBST([JITC_PROCESSOR_TYPE])
7067 # Misc Windows Stuff
7068 AC_ARG_WITH(ucrt-dir,
7069 AS_HELP_STRING([--with-ucrt-dir],
7070 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
7071 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
7072 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
7073 Windows6.1-KB2999226-x64.msu
7074 Windows6.1-KB2999226-x86.msu
7075 Windows8.1-KB2999226-x64.msu
7076 Windows8.1-KB2999226-x86.msu
7077 Windows8-RT-KB2999226-x64.msu
7078 Windows8-RT-KB2999226-x86.msu
7079 A zip archive including those files is available from Microsoft site:
7080 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
7082 UCRT_REDISTDIR="$with_ucrt_dir"
7083 if test $_os = "WINNT"; then
7086 MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
7087 MSVC_DLLS="$msvcdlls"
7088 MSM_PATH=`win_short_path_for_make "$msmdir"`
7089 # MSVC 15.3 changed it to VC141
7090 if echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
7091 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
7093 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
7096 if test "$UCRT_REDISTDIR" = "no"; then
7097 dnl explicitly disabled
7100 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
7101 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
7102 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
7103 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
7104 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
7105 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
7107 if test -n "$PKGFORMAT"; then
7108 for i in $PKGFORMAT; do
7111 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
7112 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
7121 AC_SUBST(UCRT_REDISTDIR)
7122 AC_SUBST(MSVC_DLL_PATH)
7126 dnl ===================================================================
7128 dnl ===================================================================
7129 if test "$ENABLE_JAVA" != ""; then
7131 # Windows-specific tests
7132 if test "$build_os" = "cygwin"; then
7133 if test "$BITNESS_OVERRIDE" = 64; then
7139 if test -z "$with_jdk_home"; then
7140 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
7141 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
7142 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
7143 if test -n "$regvalue"; then
7145 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
7148 if test -z "$with_jdk_home"; then
7150 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
7151 if test -n "$regvalue"; then
7157 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
7158 with_jdk_home="$_jdk_home"
7159 howfound="found automatically"
7161 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
7164 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
7165 howfound="you passed"
7169 # macOS: /usr/libexec/java_home helps to set the current JDK_HOME. Actually JDK_HOME should NOT be set where java (/usr/bin/java) is located.
7170 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
7171 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
7172 with_jdk_home=`/usr/libexec/java_home`
7175 JAVA_HOME=; export JAVA_HOME
7176 if test -z "$with_jdk_home"; then
7177 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
7179 _java_path="$with_jdk_home/bin/$with_java"
7180 dnl Check if there is a Java interpreter at all.
7181 if test -x "$_java_path"; then
7182 JAVAINTERPRETER=$_java_path
7184 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
7188 dnl Check that the JDK found is correct architecture (at least 2 reasons to
7189 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
7190 dnl loaded by java to run JunitTests:
7191 if test "$build_os" = "cygwin"; then
7192 shortjdkhome=`cygpath -d "$with_jdk_home"`
7193 if test "$BITNESS_OVERRIDE" = 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
7194 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
7195 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7196 elif test "$BITNESS_OVERRIDE" = "" -a -f "$_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
7197 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7198 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7201 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
7202 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
7204 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
7205 elif test "$cross_compiling" != "yes"; then
7207 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
7208 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
7209 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
7210 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7213 *) # assumption: everything else 32-bit
7214 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
7215 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7216 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7223 dnl ===================================================================
7225 dnl ===================================================================
7227 # Note that JAVA_HOME as for now always means the *build* platform's
7228 # JAVA_HOME. Whether all the complexity here actually is needed any
7229 # more or not, no idea.
7231 if test "$ENABLE_JAVA" != ""; then
7233 AC_MSG_CHECKING([the installed JDK])
7234 if test -n "$JAVAINTERPRETER"; then
7235 dnl java -version sends output to stderr!
7236 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
7237 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7238 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
7239 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7240 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
7241 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7242 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
7245 dnl IBM JDK specific tests
7246 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
7247 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7249 if test "$_jdk_ver" -lt 10800; then
7250 AC_MSG_ERROR([IBM JDK is too old, you need at least 8])
7253 AC_MSG_RESULT([found (IBM JDK $_jdk)])
7255 if test "$with_jdk_home" = ""; then
7256 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
7257 you must use the "--with-jdk-home" configure option explicitly])
7260 JAVA_HOME=$with_jdk_home
7264 dnl Sun JDK specific tests
7265 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
7266 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7268 if test "$_jdk_ver" -lt 10800; then
7269 AC_MSG_ERROR([JDK is too old, you need at least 8])
7271 if test "$_jdk_ver" -gt 10800; then
7272 JAVA_CLASSPATH_NOT_SET=TRUE
7275 AC_MSG_RESULT([found (JDK $_jdk)])
7276 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
7277 if test "$_os" = "WINNT"; then
7278 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
7281 # set to limit VM usage for JunitTests
7283 # set to limit VM usage for javac
7284 JAVAFLAGS=-J-Xmx128M
7287 AC_MSG_ERROR([Java not found. You need at least JDK 8])
7295 dnl ===================================================================
7296 dnl Checks for javac
7297 dnl ===================================================================
7298 if test "$ENABLE_JAVA" != ""; then
7299 javacompiler="javac"
7300 : ${JAVA_SOURCE_VER=8}
7301 : ${JAVA_TARGET_VER=8}
7302 if test -z "$with_jdk_home"; then
7303 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
7305 _javac_path="$with_jdk_home/bin/$javacompiler"
7306 dnl Check if there is a Java compiler at all.
7307 if test -x "$_javac_path"; then
7308 JAVACOMPILER=$_javac_path
7311 if test -z "$JAVACOMPILER"; then
7312 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7314 if test "$build_os" = "cygwin"; then
7315 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7316 JAVACOMPILER="${JAVACOMPILER}.exe"
7318 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7322 dnl ===================================================================
7323 dnl Checks for javadoc
7324 dnl ===================================================================
7325 if test "$ENABLE_JAVA" != ""; then
7326 if test -z "$with_jdk_home"; then
7327 AC_PATH_PROG(JAVADOC, javadoc)
7329 _javadoc_path="$with_jdk_home/bin/javadoc"
7330 dnl Check if there is a javadoc at all.
7331 if test -x "$_javadoc_path"; then
7332 JAVADOC=$_javadoc_path
7334 AC_PATH_PROG(JAVADOC, javadoc)
7337 if test -z "$JAVADOC"; then
7338 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7340 if test "$build_os" = "cygwin"; then
7341 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7342 JAVADOC="${JAVADOC}.exe"
7344 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7347 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7348 JAVADOCISGJDOC="yes"
7351 AC_SUBST(JAVADOCISGJDOC)
7353 if test "$ENABLE_JAVA" != ""; then
7354 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7355 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7356 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7357 # try to recover first by looking whether we have an alternative
7358 # system as in Debian or newer SuSEs where following /usr/bin/javac
7359 # over /etc/alternatives/javac leads to the right bindir where we
7360 # just need to strip a bit away to get a valid JAVA_HOME
7361 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7362 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7363 # maybe only one level of symlink (e.g. on Mac)
7364 JAVA_HOME=$(readlink $JAVACOMPILER)
7365 if test "$(dirname $JAVA_HOME)" = "."; then
7366 # we've got no path to trim back
7371 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7372 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7373 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7374 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7376 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
7377 if test "$JAVA_HOME" != "/usr"; then
7378 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7379 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7380 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7381 dnl Tiger already returns a JDK path..
7382 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7384 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7385 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7386 dnl that checks which version to run
7387 if test -f "$JAVA_HOME"; then
7388 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7393 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7395 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7396 if test -z "$JAVA_HOME"; then
7397 if test "x$with_jdk_home" = "x"; then
7398 cat > findhome.java <<_ACEOF
7399 [import java.io.File;
7403 public static void main(String args[])
7405 String jrelocation = System.getProperty("java.home");
7406 File jre = new File(jrelocation);
7407 System.out.println(jre.getParent());
7411 AC_MSG_CHECKING([if javac works])
7412 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7413 AC_TRY_EVAL(javac_cmd)
7414 if test $? = 0 -a -f ./findhome.class; then
7415 AC_MSG_RESULT([javac works])
7417 echo "configure: javac test failed" >&5
7418 cat findhome.java >&5
7419 AC_MSG_ERROR([javac does not work - java projects will not build!])
7421 AC_MSG_CHECKING([if gij knows its java.home])
7422 JAVA_HOME=`$JAVAINTERPRETER findhome`
7423 if test $? = 0 -a "$JAVA_HOME" != ""; then
7424 AC_MSG_RESULT([$JAVA_HOME])
7426 echo "configure: java test failed" >&5
7427 cat findhome.java >&5
7428 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7430 # clean-up after ourselves
7431 rm -f ./findhome.java ./findhome.class
7433 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7437 # now check if $JAVA_HOME is really valid
7438 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7439 case "${JAVA_HOME}" in
7440 /Library/Java/JavaVirtualMachines/*)
7443 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7446 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7449 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7452 if test "$JAVA_HOME_OK" = "NO"; then
7453 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7454 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7455 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
7456 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7457 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7458 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
7460 PathFormat "$JAVA_HOME"
7461 JAVA_HOME="$formatted_path"
7464 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7467 AC_MSG_CHECKING([for JAWT lib])
7468 if test "$_os" = WINNT; then
7469 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7474 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7475 JAVA_ARCH=$my_java_arch
7490 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7491 JAVA_ARCH=$my_java_arch
7494 my_java_arch=sparcv9
7500 my_java_arch=$host_cpu
7503 # This is where JDK9 puts the library
7504 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7505 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7507 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7509 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7511 AC_MSG_RESULT([$JAWTLIB])
7515 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7519 JAVAINC="-I$JAVA_HOME/include"
7520 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7521 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7525 JAVAINC="-I$JAVA_HOME/include/win32"
7526 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7530 if test -d "$JAVA_HOME/include/darwin"; then
7531 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7533 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7538 JAVAINC="-I$JAVA_HOME/include"
7539 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7543 JAVAINC="-I$JAVA_HOME/include"
7544 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7545 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7546 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7547 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7551 JAVAINC="-I$JAVA_HOME/include"
7552 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7553 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7557 JAVAINC="-I$JAVA_HOME/include"
7558 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7559 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7563 JAVAINC="-I$JAVA_HOME/include"
7564 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7565 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7569 JAVAINC="-I$JAVA_HOME/include"
7570 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7571 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7575 JAVAINC="-I$JAVA_HOME/include"
7576 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7577 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7581 SOLARINC="$SOLARINC $JAVAINC"
7583 if test "$ENABLE_JAVA" != "" -a "x" != "x$JAVACOMPILER" && test "$_jdk_ver" -ge 10900; then
7585 java_base="testurlcheck"
7586 java_src="${java_base}.java"
7587 java_cls="${java_base}.class"
7588 cat > "${java_src}" <<_ACEOF
7589 [import jdk.internal.loader.URLClassPath;
7590 import java.lang.reflect.Field;
7591 import java.net.URL;
7595 public static void main(String args[])
7598 URLClassPath cp = new URLClassPath(new URL[0], null);
7599 Field field = cp.getClass().getDeclaredField("DISABLE_CP_URL_CHECK");
7600 field.setAccessible(true);
7601 System.out.println(field.get(cp).toString());
7602 } catch(Exception e) {
7603 System.out.println("unknown");
7608 AC_MSG_CHECKING([if jdk.net.URLClassPath.ClassPathURLCheck is disabled])
7609 java_cmd="$JAVACOMPILER --add-exports java.base/jdk.internal.loader=ALL-UNNAMED ${java_src} 1>&2"
7610 AC_TRY_EVAL(java_cmd)
7611 if test $? = 0 -a -f "./${java_cls}"; then
7612 java_res=`$JAVAINTERPRETER --add-opens java.base/jdk.internal.loader=ALL-UNNAMED ${java_base} 2>/dev/null`
7613 if test $? = 0; then
7614 case "${java_res}" in
7615 true) AC_MSG_RESULT([yes]) ;;
7617 rm -f "./${java_src}" "./${java_cls}"
7618 AC_MSG_ERROR([no - Java unit tests will break!])
7620 *) url_check_unknown=1 ;;
7628 if test $url_check_unknown -eq 1; then
7629 AC_MSG_RESULT([unknown - assuming yes])
7630 add_warning "Unable to find the default value for jdk.net.URLClassPath.ClassPathURLCheck - java tests might fail!"
7632 rm -f "./${java_src}" "./${java_cls}"
7635 AC_SUBST(JAVACOMPILER)
7637 AC_SUBST(JAVAINTERPRETER)
7638 AC_SUBST(JAVAIFLAGS)
7640 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7642 AC_SUBST(JAVA_SOURCE_VER)
7643 AC_SUBST(JAVA_TARGET_VER)
7647 dnl ===================================================================
7648 dnl Export file validation
7649 dnl ===================================================================
7650 AC_MSG_CHECKING([whether to enable export file validation])
7651 if test "$with_export_validation" != "no"; then
7652 if test -z "$ENABLE_JAVA"; then
7653 if test "$with_export_validation" = "yes"; then
7654 AC_MSG_ERROR([requested, but Java is disabled])
7656 AC_MSG_RESULT([no, as Java is disabled])
7658 elif ! test -d "${SRC_ROOT}/schema"; then
7659 if test "$with_export_validation" = "yes"; then
7660 AC_MSG_ERROR([requested, but schema directory is missing (it is excluded from tarballs)])
7662 AC_MSG_RESULT([no, schema directory is missing (it is excluded from tarballs)])
7665 AC_MSG_RESULT([yes])
7666 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7668 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7669 if test -z "$ODFVALIDATOR"; then
7670 # remember to download the ODF toolkit with validator later
7671 AC_MSG_NOTICE([no odfvalidator found, will download it])
7672 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7673 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7675 # and fetch name of odfvalidator jar name from download.lst
7676 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7677 AC_SUBST(ODFVALIDATOR_JAR)
7679 if test -z "$ODFVALIDATOR_JAR"; then
7680 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7683 if test "$build_os" = "cygwin"; then
7684 # In case of Cygwin it will be executed from Windows,
7685 # so we need to run bash and absolute path to validator
7686 # so instead of "odfvalidator" it will be
7687 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7688 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7690 ODFVALIDATOR="sh $ODFVALIDATOR"
7692 AC_SUBST(ODFVALIDATOR)
7695 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7696 if test -z "$OFFICEOTRON"; then
7697 # remember to download the officeotron with validator later
7698 AC_MSG_NOTICE([no officeotron found, will download it])
7699 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7700 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7702 # and fetch name of officeotron jar name from download.lst
7703 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7704 AC_SUBST(OFFICEOTRON_JAR)
7706 if test -z "$OFFICEOTRON_JAR"; then
7707 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7710 # check version of existing officeotron
7711 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7712 if test 0"$OFFICEOTRON_VER" -lt 704; then
7713 AC_MSG_ERROR([officeotron too old])
7716 if test "$build_os" = "cygwin"; then
7717 # In case of Cygwin it will be executed from Windows,
7718 # so we need to run bash and absolute path to validator
7719 # so instead of "odfvalidator" it will be
7720 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7721 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7723 OFFICEOTRON="sh $OFFICEOTRON"
7726 AC_SUBST(OFFICEOTRON)
7731 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7732 if test "$with_bffvalidator" != "no"; then
7733 AC_DEFINE(HAVE_BFFVALIDATOR)
7735 if test "$with_export_validation" = "no"; then
7736 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7739 if test "$with_bffvalidator" = "yes"; then
7740 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7742 BFFVALIDATOR="$with_bffvalidator"
7745 if test "$build_os" = "cygwin"; then
7746 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7747 AC_MSG_RESULT($BFFVALIDATOR)
7749 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7751 elif test -n "$BFFVALIDATOR"; then
7752 # We are not in Cygwin but need to run Windows binary with wine
7753 AC_PATH_PROGS(WINE, wine)
7755 # so swap in a shell wrapper that converts paths transparently
7756 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7757 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7758 AC_SUBST(BFFVALIDATOR_EXE)
7759 AC_MSG_RESULT($BFFVALIDATOR)
7761 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7763 AC_SUBST(BFFVALIDATOR)
7768 dnl ===================================================================
7769 dnl Check for C preprocessor to use
7770 dnl ===================================================================
7771 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7772 if test -n "$with_idlc_cpp"; then
7773 AC_MSG_RESULT([$with_idlc_cpp])
7774 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7776 AC_MSG_RESULT([ucpp])
7777 AC_MSG_CHECKING([which ucpp tp use])
7778 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7779 AC_MSG_RESULT([external])
7780 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7782 AC_MSG_RESULT([internal])
7783 BUILD_TYPE="$BUILD_TYPE UCPP"
7786 AC_SUBST(SYSTEM_UCPP)
7788 dnl ===================================================================
7789 dnl Check for epm (not needed for Windows)
7790 dnl ===================================================================
7791 AC_MSG_CHECKING([whether to enable EPM for packing])
7792 if test "$enable_epm" = "yes"; then
7793 AC_MSG_RESULT([yes])
7794 if test "$_os" != "WINNT"; then
7795 if test $_os = Darwin; then
7797 elif test -n "$with_epm"; then
7800 AC_PATH_PROG(EPM, epm, no)
7802 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7803 AC_MSG_NOTICE([EPM will be built.])
7804 BUILD_TYPE="$BUILD_TYPE EPM"
7805 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7807 # Gentoo has some epm which is something different...
7808 AC_MSG_CHECKING([whether the found epm is the right epm])
7809 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7810 AC_MSG_RESULT([yes])
7812 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7814 AC_MSG_CHECKING([epm version])
7815 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7816 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7817 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7818 AC_MSG_RESULT([OK, >= 3.7])
7820 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7821 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7826 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7827 AC_MSG_CHECKING([for rpm])
7828 for a in "$RPM" rpmbuild rpm; do
7829 $a --usage >/dev/null 2> /dev/null
7830 if test $? -eq 0; then
7834 $a --version >/dev/null 2> /dev/null
7835 if test $? -eq 0; then
7841 if test -z "$RPM"; then
7842 AC_MSG_ERROR([not found])
7843 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7844 RPM_PATH=`which $RPM`
7845 AC_MSG_RESULT([$RPM_PATH])
7846 SCPDEFS="$SCPDEFS -DWITH_RPM"
7848 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7851 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7852 AC_PATH_PROG(DPKG, dpkg, no)
7853 if test "$DPKG" = "no"; then
7854 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7857 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7858 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7859 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7860 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7861 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7862 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
7863 AC_MSG_RESULT([yes])
7866 if echo "$PKGFORMAT" | $GREP -q rpm; then
7868 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7869 add_warning "the rpms will need to be installed with --nodeps"
7873 AC_MSG_WARN([the ${_pt}s will not be relocatable])
7874 add_warning "the ${_pt}s will not be relocatable"
7875 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7876 relocation will work, you need to patch your epm with the
7877 patch in epm/epm-3.7.patch or build with
7878 --with-epm=internal which will build a suitable epm])
7883 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7884 AC_PATH_PROG(PKGMK, pkgmk, no)
7885 if test "$PKGMK" = "no"; then
7886 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7893 for i in $PKGFORMAT; do
7895 aix | bsd | deb | pkg | rpm | native | portable)
7897 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7907 if test "$enable_lotuswordpro" = "yes"; then
7910 AC_SUBST(ENABLE_LWP)
7912 dnl ===================================================================
7913 dnl Check for building ODK
7914 dnl ===================================================================
7915 if test "$enable_odk" = no; then
7918 if test "$with_doxygen" = no; then
7919 AC_MSG_CHECKING([for doxygen])
7923 if test "$with_doxygen" = yes; then
7924 AC_PATH_PROG([DOXYGEN], [doxygen])
7925 if test -z "$DOXYGEN"; then
7926 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7928 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
7929 if ! dot -V 2>/dev/null; then
7930 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
7934 AC_MSG_CHECKING([for doxygen])
7935 DOXYGEN=$with_doxygen
7936 AC_MSG_RESULT([$DOXYGEN])
7938 if test -n "$DOXYGEN"; then
7939 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7940 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7941 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7942 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7949 AC_MSG_CHECKING([whether to build the ODK])
7950 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7951 AC_MSG_RESULT([yes])
7953 if test "$with_java" != "no"; then
7954 AC_MSG_CHECKING([whether to build unowinreg.dll])
7955 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7956 # build on Win by default
7957 enable_build_unowinreg=yes
7959 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7963 AC_MSG_RESULT([yes])
7964 BUILD_UNOWINREG=TRUE
7966 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7967 if test -z "$with_mingw_cross_compiler"; then
7969 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7970 elif test -x "$with_mingw_cross_compiler"; then
7971 MINGWCXX="$with_mingw_cross_compiler"
7973 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7976 if test "$MINGWCXX" = "false"; then
7977 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7980 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7981 if test -x "$mingwstrip_test"; then
7982 MINGWSTRIP="$mingwstrip_test"
7984 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7987 if test "$MINGWSTRIP" = "false"; then
7988 AC_MSG_ERROR(MinGW32 binutils not found.)
7992 BUILD_TYPE="$BUILD_TYPE ODK"
7997 AC_SUBST(BUILD_UNOWINREG)
7999 AC_SUBST(MINGWSTRIP)
8001 dnl ===================================================================
8002 dnl Check for system zlib
8003 dnl ===================================================================
8004 if test "$with_system_zlib" = "auto"; then
8007 with_system_zlib="$with_system_libs"
8010 if test "$enable_fuzzers" != "yes"; then
8011 with_system_zlib=yes
8019 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
8020 dnl and has no pkg-config for it at least on some tinderboxes,
8021 dnl so leaving that out for now
8022 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
8023 AC_MSG_CHECKING([which zlib to use])
8024 if test "$with_system_zlib" = "yes"; then
8025 AC_MSG_RESULT([external])
8027 AC_CHECK_HEADER(zlib.h, [],
8028 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
8029 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
8030 [AC_MSG_ERROR(zlib not found or functional)], [])
8032 AC_MSG_RESULT([internal])
8034 BUILD_TYPE="$BUILD_TYPE ZLIB"
8035 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
8036 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
8038 AC_SUBST(ZLIB_CFLAGS)
8040 AC_SUBST(SYSTEM_ZLIB)
8042 dnl ===================================================================
8043 dnl Check for system jpeg
8044 dnl ===================================================================
8045 AC_MSG_CHECKING([which libjpeg to use])
8046 if test "$with_system_jpeg" = "yes"; then
8047 AC_MSG_RESULT([external])
8049 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
8050 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
8051 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
8052 [AC_MSG_ERROR(jpeg library not found or functional)], [])
8055 AC_MSG_RESULT([internal, libjpeg-turbo])
8056 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
8057 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
8058 if test "$COM" = "MSC"; then
8059 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
8061 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
8065 x86_64 | amd64 | i*86 | x86 | ia32)
8066 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
8067 if test -z "$NASM" -a "$build_os" = "cygwin"; then
8068 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
8069 NASM="$LODE_HOME/opt/bin/nasm"
8070 elif test -x "/opt/lo/bin/nasm"; then
8071 NASM="/opt/lo/bin/nasm"
8075 if test -n "$NASM"; then
8076 AC_MSG_CHECKING([for object file format of host system])
8078 cygwin* | mingw* | pw32* | interix*)
8088 msdosdjgpp* | go32*)
8091 os2-emx*) # not tested
8092 objfmt='MSOMF' # obj
8094 linux*coff* | linux*oldld*)
8110 kfreebsd* | freebsd* | netbsd* | openbsd*)
8111 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8124 solaris* | sunos* | sysv* | sco*)
8134 darwin* | rhapsody* | nextstep* | openstep* | macos*)
8149 AC_MSG_RESULT([$objfmt])
8150 if test "$objfmt" = 'ELF ?'; then
8152 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
8155 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
8157 MSOMF) NAFLAGS='-fobj -DOBJ32';;
8158 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
8159 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
8160 COFF) NAFLAGS='-fcoff -DCOFF';;
8161 a.out) NAFLAGS='-faout -DAOUT';;
8162 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
8163 ELF) NAFLAGS='-felf -DELF';;
8164 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
8165 RDF) NAFLAGS='-frdf -DRDF';;
8166 Mach-O) NAFLAGS='-fmacho -DMACHO';;
8167 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
8169 AC_MSG_RESULT([$NAFLAGS])
8171 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
8172 cat > conftest.asm << EOF
8173 [%line __oline__ "configure"
8181 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
8182 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
8185 echo "configure: failed program was:" >&AC_FD_CC
8186 cat conftest.asm >&AC_FD_CC
8189 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
8195 if test -z "$NASM"; then
8197 ****************************************************************************
8198 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
8202 if test "$build_os" = "cygwin"; then
8204 install a pre-compiled binary for Win32
8206 mkdir -p /opt/lo/bin
8208 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
8211 or get and install one from http://www.nasm.us/
8213 Then re-run autogen.sh
8215 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
8216 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
8221 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
8225 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
8226 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
8233 AC_SUBST(LIBJPEG_CFLAGS)
8234 AC_SUBST(LIBJPEG_LIBS)
8235 AC_SUBST(SYSTEM_LIBJPEG)
8237 dnl ===================================================================
8238 dnl Check for system clucene
8239 dnl ===================================================================
8240 dnl we should rather be using
8241 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
8242 dnl but the contribs-lib check seems tricky
8243 AC_MSG_CHECKING([which clucene to use])
8244 if test "$with_system_clucene" = "yes"; then
8245 AC_MSG_RESULT([external])
8247 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
8248 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
8249 FilterLibs "${CLUCENE_LIBS}"
8250 CLUCENE_LIBS="${filteredlibs}"
8252 save_CXXFLAGS=$CXXFLAGS
8253 save_CPPFLAGS=$CPPFLAGS
8254 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
8255 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
8256 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
8257 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
8258 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
8259 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
8260 CXXFLAGS=$save_CXXFLAGS
8261 CPPFLAGS=$save_CPPFLAGS
8264 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
8266 AC_MSG_RESULT([internal])
8268 BUILD_TYPE="$BUILD_TYPE CLUCENE"
8270 AC_SUBST(SYSTEM_CLUCENE)
8271 AC_SUBST(CLUCENE_CFLAGS)
8272 AC_SUBST(CLUCENE_LIBS)
8274 dnl ===================================================================
8275 dnl Check for system expat
8276 dnl ===================================================================
8277 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
8279 dnl ===================================================================
8280 dnl Check for system xmlsec
8281 dnl ===================================================================
8282 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.28])
8284 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
8285 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
8287 AC_DEFINE([ENABLE_EOT])
8288 AC_MSG_RESULT([yes])
8290 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
8295 AC_SUBST([ENABLE_EOT])
8297 dnl ===================================================================
8298 dnl Check for DLP libs
8299 dnl ===================================================================
8300 AS_IF([test "$COM" = "MSC"],
8301 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
8302 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
8304 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
8306 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
8308 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
8310 AS_IF([test "$COM" = "MSC"],
8311 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
8312 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
8314 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
8316 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
8318 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
8319 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
8321 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
8323 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
8325 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
8327 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
8328 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.15])
8330 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
8331 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
8333 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
8335 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
8336 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
8338 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
8340 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
8342 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
8344 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
8346 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
8347 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
8349 dnl ===================================================================
8350 dnl Check for system lcms2
8351 dnl ===================================================================
8352 if test "$with_system_lcms2" != "yes"; then
8355 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
8356 if test "$GCC" = "yes"; then
8357 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
8359 if test "$COM" = "MSC"; then # override the above
8360 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
8363 dnl ===================================================================
8364 dnl Check for system cppunit
8365 dnl ===================================================================
8366 if test "$_os" != "Android" ; then
8367 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
8370 dnl ===================================================================
8371 dnl Check whether freetype is available
8372 dnl ===================================================================
8373 if test "$test_freetype" = "yes"; then
8374 AC_MSG_CHECKING([whether freetype is available])
8375 # FreeType has 3 different kinds of versions
8376 # * release, like 2.4.10
8377 # * libtool, like 13.0.7 (this what pkg-config returns)
8379 # FreeType's docs/VERSION.DLL provides a table mapping between the three
8382 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
8383 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8384 FilterLibs "${FREETYPE_LIBS}"
8385 FREETYPE_LIBS="${filteredlibs}"
8386 SYSTEM_FREETYPE=TRUE
8388 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
8389 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
8391 AC_SUBST(FREETYPE_CFLAGS)
8392 AC_SUBST(FREETYPE_LIBS)
8393 AC_SUBST([SYSTEM_FREETYPE])
8395 # ===================================================================
8396 # Check for system libxslt
8397 # to prevent incompatibilities between internal libxml2 and external libxslt,
8398 # or vice versa, use with_system_libxml here
8399 # ===================================================================
8400 if test "$with_system_libxml" = "auto"; then
8403 with_system_libxml="$with_system_libs"
8406 if test "$enable_fuzzers" != "yes"; then
8407 with_system_libxml=yes
8409 with_system_libxml=no
8415 AC_MSG_CHECKING([which libxslt to use])
8416 if test "$with_system_libxml" = "yes"; then
8417 AC_MSG_RESULT([external])
8419 if test "$_os" = "Darwin"; then
8420 dnl make sure to use SDK path
8421 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8422 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8424 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8425 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8427 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8428 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8429 FilterLibs "${LIBXSLT_LIBS}"
8430 LIBXSLT_LIBS="${filteredlibs}"
8431 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8432 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8433 FilterLibs "${LIBEXSLT_LIBS}"
8434 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8437 dnl Check for xsltproc
8438 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8439 if test "$XSLTPROC" = "no"; then
8440 AC_MSG_ERROR([xsltproc is required])
8443 AC_MSG_RESULT([internal])
8445 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8447 if test "$cross_compiling" = "yes"; then
8448 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8449 if test "$XSLTPROC" = "no"; then
8450 AC_MSG_ERROR([xsltproc is required])
8454 AC_SUBST(SYSTEM_LIBXSLT)
8455 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8456 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8458 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8460 AC_SUBST(LIBEXSLT_CFLAGS)
8461 AC_SUBST(LIBEXSLT_LIBS)
8462 AC_SUBST(LIBXSLT_CFLAGS)
8463 AC_SUBST(LIBXSLT_LIBS)
8466 # ===================================================================
8467 # Check for system libxml
8468 # ===================================================================
8469 AC_MSG_CHECKING([which libxml to use])
8470 if test "$with_system_libxml" = "yes"; then
8471 AC_MSG_RESULT([external])
8473 if test "$_os" = "Darwin"; then
8474 dnl make sure to use SDK path
8475 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8477 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8478 elif test $_os = iOS; then
8479 dnl make sure to use SDK path
8480 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8481 LIBXML_CFLAGS="-I$usr/include/libxml2"
8482 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8484 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8485 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8486 FilterLibs "${LIBXML_LIBS}"
8487 LIBXML_LIBS="${filteredlibs}"
8490 dnl Check for xmllint
8491 AC_PATH_PROG(XMLLINT, xmllint, no)
8492 if test "$XMLLINT" = "no"; then
8493 AC_MSG_ERROR([xmllint is required])
8496 AC_MSG_RESULT([internal])
8498 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8499 if test "$COM" = "MSC"; then
8500 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8502 if test "$COM" = "MSC"; then
8503 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8505 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8507 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8509 AC_SUBST(SYSTEM_LIBXML)
8510 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8511 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8513 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8514 AC_SUBST(LIBXML_CFLAGS)
8515 AC_SUBST(LIBXML_LIBS)
8518 # =====================================================================
8519 # Checking for a Python interpreter with version >= 2.7.
8520 # Build and runtime requires Python 3 compatible version (>= 2.7).
8521 # Optionally user can pass an option to configure, i. e.
8522 # ./configure PYTHON=/usr/bin/python
8523 # =====================================================================
8524 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8525 if test -n "$PYTHON"; then
8526 PYTHON_FOR_BUILD=$PYTHON
8528 # This allows a lack of system python with no error, we use internal one in that case.
8529 AM_PATH_PYTHON([2.7],, [:])
8530 # Clean PYTHON_VERSION checked below if cross-compiling
8532 if test "$PYTHON" != ":"; then
8533 PYTHON_FOR_BUILD=$PYTHON
8537 AC_SUBST(PYTHON_FOR_BUILD)
8539 # Checks for Python to use for Pyuno
8540 AC_MSG_CHECKING([which Python to use for Pyuno])
8541 case "$enable_python" in
8543 if test -z $PYTHON_FOR_BUILD; then
8544 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8545 # requirement from the choice whether to include Python stuff in the installer, but why
8547 AC_MSG_ERROR([Python is required at build time.])
8550 AC_MSG_RESULT([none])
8553 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8554 AC_MSG_RESULT([no, overridden by --disable-scripting])
8556 elif test $build_os = cygwin; then
8557 dnl When building on Windows we don't attempt to use any installed
8558 dnl "system" Python.
8559 AC_MSG_RESULT([fully internal])
8560 enable_python=internal
8561 elif test "$cross_compiling" = yes; then
8562 AC_MSG_RESULT([system])
8563 enable_python=system
8565 # Unset variables set by the above AM_PATH_PYTHON so that
8566 # we actually do check anew.
8568 unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON am_cv_python_version am_cv_python_platform am_cv_python_pythondir am_cv_python_pyexecdir
8569 AM_PATH_PYTHON([3.3],, [:])
8570 AC_MSG_CHECKING([which Python to use for Pyuno])
8571 if test "$PYTHON" = ":"; then
8572 if test -z "$PYTHON_FOR_BUILD"; then
8573 AC_MSG_RESULT([fully internal])
8575 AC_MSG_RESULT([internal])
8577 enable_python=internal
8579 AC_MSG_RESULT([system])
8580 enable_python=system
8585 AC_MSG_RESULT([internal])
8588 AC_MSG_RESULT([fully internal])
8589 enable_python=internal
8592 AC_MSG_RESULT([system])
8593 if test "$_os" = Darwin; then
8594 AC_MSG_ERROR([--enable-python=system doesn't work on macOS: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h is known to contain uses of "register", which is removed from C++17])
8598 AC_MSG_ERROR([Incorrect --enable-python option])
8602 if test $enable_python != no; then
8603 BUILD_TYPE="$BUILD_TYPE PYUNO"
8606 if test $enable_python = system; then
8607 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8608 # Fallback: Accept these in the environment, or as set above
8611 elif test "$cross_compiling" != yes; then
8612 # Unset variables set by the above AM_PATH_PYTHON so that
8613 # we actually do check anew.
8614 unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON am_cv_python_version am_cv_python_platform am_cv_python_pythondir am_cv_python_pyexecdir
8615 # This causes an error if no python command is found
8616 AM_PATH_PYTHON([3.3])
8617 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8618 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8619 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8620 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8621 if test -z "$PKG_CONFIG"; then
8622 PYTHON_CFLAGS="-I$python_include"
8623 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8624 elif $PKG_CONFIG --exists python-$python_version-embed; then
8625 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
8626 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
8627 elif $PKG_CONFIG --exists python-$python_version; then
8628 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8629 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8631 PYTHON_CFLAGS="-I$python_include"
8632 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8634 FilterLibs "${PYTHON_LIBS}"
8635 PYTHON_LIBS="${filteredlibs}"
8637 dnl How to find out the cross-compilation Python installation path?
8638 AC_MSG_CHECKING([for python version])
8639 AS_IF([test -n "$PYTHON_VERSION"],
8640 [AC_MSG_RESULT([$PYTHON_VERSION])],
8641 [AC_MSG_RESULT([not found])
8642 AC_MSG_ERROR([no usable python found])])
8643 test -n "$PYTHON_CFLAGS" && break
8646 dnl Check if the headers really work
8647 save_CPPFLAGS="$CPPFLAGS"
8648 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8649 AC_CHECK_HEADER(Python.h)
8650 CPPFLAGS="$save_CPPFLAGS"
8652 # let the PYTHON_FOR_BUILD match the same python installation that
8653 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8654 # better for PythonTests.
8655 PYTHON_FOR_BUILD=$PYTHON
8658 if test "$with_lxml" != no; then
8659 if test -z "$PYTHON_FOR_BUILD"; then
8662 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8665 if test "$cross_compiling" != yes ; then
8666 BUILD_TYPE="$BUILD_TYPE LXML"
8671 AC_MSG_CHECKING([for python lxml])
8672 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8673 AC_MSG_RESULT([yes])
8677 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8680 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8681 BUILD_TYPE="$BUILD_TYPE LXML"
8682 AC_MSG_RESULT([no, using internal lxml])
8684 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8692 dnl By now enable_python should be "system", "internal" or "no"
8693 case $enable_python in
8697 if test "x$ac_cv_header_Python_h" != "xyes"; then
8698 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8702 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8703 AC_MSG_CHECKING([for correct python library version])
8704 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8707 int main(int argc, char **argv) {
8708 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
8709 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8712 ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.7 when building with Python 2])],[AC_MSG_RESULT([skipped; cross-compiling])])
8716 dnl FIXME Check if the Python library can be linked with, too?
8721 PYTHON_VERSION_MAJOR=3
8722 PYTHON_VERSION_MINOR=5
8723 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.7
8724 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
8725 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
8727 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8728 BUILD_TYPE="$BUILD_TYPE PYTHON"
8729 # Embedded Python dies without Home set
8730 if test "$HOME" = ""; then
8739 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8743 AC_SUBST(DISABLE_PYTHON)
8744 AC_SUBST(SYSTEM_PYTHON)
8745 AC_SUBST(PYTHON_CFLAGS)
8746 AC_SUBST(PYTHON_LIBS)
8747 AC_SUBST(PYTHON_VERSION)
8748 AC_SUBST(PYTHON_VERSION_MAJOR)
8749 AC_SUBST(PYTHON_VERSION_MINOR)
8751 ENABLE_MARIADBC=TRUE
8752 if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then
8758 if test "$ENABLE_MARIADBC" = "TRUE"; then
8759 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8762 AC_SUBST(ENABLE_MARIADBC)
8763 AC_SUBST(MARIADBC_MAJOR)
8764 AC_SUBST(MARIADBC_MINOR)
8765 AC_SUBST(MARIADBC_MICRO)
8767 if test "$ENABLE_MARIADBC" = "TRUE"; then
8768 dnl ===================================================================
8769 dnl Check for system MariaDB
8770 dnl ===================================================================
8771 AC_MSG_CHECKING([which MariaDB to use])
8772 if test "$with_system_mariadb" = "yes"; then
8773 AC_MSG_RESULT([external])
8774 SYSTEM_MARIADB_CONNECTOR_C=TRUE
8775 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8776 if test -z "$MARIADBCONFIG"; then
8777 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8778 if test -z "$MARIADBCONFIG"; then
8779 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8780 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8783 AC_MSG_CHECKING([MariaDB version])
8784 MARIADB_VERSION=`$MARIADBCONFIG --version`
8785 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8786 if test "$MARIADB_MAJOR" -ge "5"; then
8789 AC_MSG_ERROR([too old, use 5.0.x or later])
8791 AC_MSG_CHECKING([for MariaDB Client library])
8792 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8793 if test "$COM_IS_CLANG" = TRUE; then
8794 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8796 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8797 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8798 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8800 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8801 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8802 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8803 | sed -e 's|/lib64/|/lib/|')
8805 FilterLibs "${MARIADB_LIBS}"
8806 MARIADB_LIBS="${filteredlibs}"
8807 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8808 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8809 if test "$enable_bundle_mariadb" = "yes"; then
8810 AC_MSG_RESULT([yes])
8811 BUNDLE_MARIADB_CONNECTOR_C=TRUE
8812 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8814 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8816 /g' | grep -E '(mysqlclient|mariadb)')
8817 if test "$_os" = "Darwin"; then
8818 LIBMARIADB=${LIBMARIADB}.dylib
8819 elif test "$_os" = "WINNT"; then
8820 LIBMARIADB=${LIBMARIADB}.dll
8822 LIBMARIADB=${LIBMARIADB}.so
8824 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8825 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8826 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8827 AC_MSG_RESULT([found.])
8828 PathFormat "$LIBMARIADB_PATH"
8829 LIBMARIADB_PATH="$formatted_path"
8831 AC_MSG_ERROR([not found.])
8835 BUNDLE_MARIADB_CONNECTOR_C=
8838 AC_MSG_RESULT([internal])
8839 SYSTEM_MARIADB_CONNECTOR_C=
8840 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
8841 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
8842 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
8845 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
8846 AC_SUBST(MARIADB_CFLAGS)
8847 AC_SUBST(MARIADB_LIBS)
8848 AC_SUBST(LIBMARIADB)
8849 AC_SUBST(LIBMARIADB_PATH)
8850 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
8853 dnl ===================================================================
8854 dnl Check for system hsqldb
8855 dnl ===================================================================
8856 if test "$with_java" != "no"; then
8857 HSQLDB_USE_JDBC_4_1=
8858 AC_MSG_CHECKING([which hsqldb to use])
8859 if test "$with_system_hsqldb" = "yes"; then
8860 AC_MSG_RESULT([external])
8862 if test -z $HSQLDB_JAR; then
8863 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8865 if ! test -f $HSQLDB_JAR; then
8866 AC_MSG_ERROR(hsqldb.jar not found.)
8868 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8872 my $file = "$ENV{'HSQLDB_JAR'}";
8873 my $zip = Archive::Zip->new( $file );
8874 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8875 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8877 push @l, split(/\n/, $mf);
8878 foreach my $line (@l)
8880 if ($line =~ m/Specification-Version:/)
8882 ($t, $version) = split (/:/,$line);
8883 $version =~ s/^\s//;
8884 ($a, $b, $c, $d) = split (/\./,$version);
8885 if ($c == "0" && $d > "8")
8900 AC_MSG_RESULT([yes])
8902 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8905 AC_MSG_RESULT([internal])
8907 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8909 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8910 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8911 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8912 AC_MSG_RESULT([yes])
8913 HSQLDB_USE_JDBC_4_1=TRUE
8918 AC_SUBST(SYSTEM_HSQLDB)
8919 AC_SUBST(HSQLDB_JAR)
8920 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8923 dnl ===================================================================
8924 dnl Check for PostgreSQL stuff
8925 dnl ===================================================================
8926 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
8927 if test "x$enable_postgresql_sdbc" != "xno"; then
8928 AC_MSG_RESULT([yes])
8929 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8931 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8932 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8934 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8935 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8938 postgres_interface=""
8939 if test "$with_system_postgresql" = "yes"; then
8940 postgres_interface="external PostgreSQL"
8941 SYSTEM_POSTGRESQL=TRUE
8942 if test "$_os" = Darwin; then
8944 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8945 pg_supp_path="$P_SEP$d$pg_supp_path"
8948 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8949 if test -n "$PGCONFIG"; then
8950 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8951 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8953 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
8954 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
8955 POSTGRESQL_LIB=$POSTGRESQL_LIBS
8957 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
8960 FilterLibs "${POSTGRESQL_LIB}"
8961 POSTGRESQL_LIB="${filteredlibs}"
8963 # if/when anything else than PostgreSQL uses Kerberos,
8964 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8969 # macOS has system MIT Kerberos 5 since 10.4
8970 if test "$with_krb5" != "no"; then
8973 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
8974 # that the libraries where these functions are located on macOS will change, is it?
8975 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8976 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8979 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8980 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8981 KRB5_LIBS="$KRB5_LIBS $LIBS"
8984 if test "$with_gssapi" != "no"; then
8987 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8988 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8994 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8995 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8998 Linux|GNU|*BSD|DragonFly)
8999 if test "$with_krb5" != "no"; then
9002 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9003 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9006 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9007 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9008 KRB5_LIBS="$KRB5_LIBS $LIBS"
9011 if test "$with_gssapi" != "no"; then
9014 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9015 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9021 if test "$with_krb5" = "yes"; then
9024 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9025 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9028 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9029 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9030 KRB5_LIBS="$KRB5_LIBS $LIBS"
9033 if test "$with_gssapi" = "yes"; then
9036 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9037 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9043 if test -n "$with_libpq_path"; then
9044 SYSTEM_POSTGRESQL=TRUE
9045 postgres_interface="external libpq"
9046 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
9047 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
9050 postgres_interface="internal"
9052 POSTGRESQL_INC="%OVERRIDE_ME%"
9053 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
9057 AC_MSG_CHECKING([PostgreSQL C interface])
9058 AC_MSG_RESULT([$postgres_interface])
9060 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
9061 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
9063 save_CPPFLAGS=$CPPFLAGS
9065 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
9066 LIBS="${LIBS} ${POSTGRESQL_LIB}"
9067 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
9068 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
9069 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
9071 CPPFLAGS=$save_CPPFLAGS
9074 BUILD_POSTGRESQL_SDBC=TRUE
9079 AC_SUBST(WITH_GSSAPI)
9080 AC_SUBST(GSSAPI_LIBS)
9082 AC_SUBST(BUILD_POSTGRESQL_SDBC)
9083 AC_SUBST(SYSTEM_POSTGRESQL)
9084 AC_SUBST(POSTGRESQL_INC)
9085 AC_SUBST(POSTGRESQL_LIB)
9087 dnl ===================================================================
9088 dnl Check for Firebird stuff
9089 dnl ===================================================================
9090 ENABLE_FIREBIRD_SDBC=
9091 if test "$enable_firebird_sdbc" = "yes" ; then
9092 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
9094 dnl ===================================================================
9095 dnl Check for system Firebird
9096 dnl ===================================================================
9097 AC_MSG_CHECKING([which Firebird to use])
9098 if test "$with_system_firebird" = "yes"; then
9099 AC_MSG_RESULT([external])
9100 SYSTEM_FIREBIRD=TRUE
9101 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
9102 if test -z "$FIREBIRDCONFIG"; then
9103 AC_MSG_NOTICE([No fb_config -- using pkg-config])
9104 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
9105 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
9107 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
9109 AC_MSG_NOTICE([fb_config found])
9110 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
9111 AC_MSG_CHECKING([for Firebird Client library])
9112 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
9113 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
9114 FilterLibs "${FIREBIRD_LIBS}"
9115 FIREBIRD_LIBS="${filteredlibs}"
9117 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
9118 AC_MSG_CHECKING([Firebird version])
9119 if test -n "${FIREBIRD_VERSION}"; then
9120 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
9121 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
9122 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
9125 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
9128 __save_CFLAGS="${CFLAGS}"
9129 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
9130 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
9131 #if defined(FB_API_VER) && FB_API_VER == 30
9132 int fb_api_is_30(void) { return 0; }
9134 #error "Wrong Firebird API version"
9135 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
9136 CFLAGS="${__save_CFLAGS}"
9138 ENABLE_FIREBIRD_SDBC=TRUE
9139 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9140 elif test "$enable_database_connectivity" != yes; then
9141 AC_MSG_RESULT([none])
9142 elif test "$cross_compiling" = "yes"; then
9143 AC_MSG_RESULT([none])
9145 dnl Embedded Firebird has version 3.0
9146 AC_DEFINE(HAVE_FIREBIRD_30, 1)
9147 dnl We need libatomic_ops for any non X86/X64 system
9148 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
9149 dnl ===================================================================
9150 dnl Check for system libatomic_ops
9151 dnl ===================================================================
9152 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
9153 if test "$with_system_libatomic_ops" = "yes"; then
9154 SYSTEM_LIBATOMIC_OPS=TRUE
9155 AC_CHECK_HEADERS(atomic_ops.h, [],
9156 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
9158 SYSTEM_LIBATOMIC_OPS=
9159 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
9160 LIBATOMIC_OPS_LIBS="-latomic_ops"
9161 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
9165 AC_MSG_RESULT([internal])
9167 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
9168 FIREBIRD_LIBS="-lfbclient"
9170 if test "$with_system_libtommath" = "yes"; then
9171 SYSTEM_LIBTOMMATH=TRUE
9172 dnl check for tommath presence
9174 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
9175 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
9179 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
9180 LIBTOMMATH_LIBS="-ltommath"
9181 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
9184 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
9185 ENABLE_FIREBIRD_SDBC=TRUE
9186 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9189 AC_SUBST(ENABLE_FIREBIRD_SDBC)
9190 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
9191 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
9192 AC_SUBST(LIBATOMIC_OPS_LIBS)
9193 AC_SUBST(SYSTEM_FIREBIRD)
9194 AC_SUBST(FIREBIRD_CFLAGS)
9195 AC_SUBST(FIREBIRD_LIBS)
9196 AC_SUBST([TOMMATH_CFLAGS])
9197 AC_SUBST([TOMMATH_LIBS])
9199 dnl ===================================================================
9200 dnl Check for system curl
9201 dnl ===================================================================
9202 AC_MSG_CHECKING([which libcurl to use])
9203 if test "$with_system_curl" = "auto"; then
9204 with_system_curl="$with_system_libs"
9207 if test "$with_system_curl" = "yes"; then
9208 AC_MSG_RESULT([external])
9211 # First try PKGCONFIG and then fall back
9212 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
9214 if test -n "$CURL_PKG_ERRORS"; then
9215 AC_PATH_PROG(CURLCONFIG, curl-config)
9216 if test -z "$CURLCONFIG"; then
9217 AC_MSG_ERROR([curl development files not found])
9219 CURL_LIBS=`$CURLCONFIG --libs`
9220 FilterLibs "${CURL_LIBS}"
9221 CURL_LIBS="${filteredlibs}"
9222 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
9223 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
9225 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
9226 case $curl_version in
9227 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
9228 dnl so they need to be doubled to end up in the configure script
9229 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
9230 AC_MSG_RESULT([yes])
9233 AC_MSG_ERROR([no, you have $curl_version])
9239 elif test $_os = iOS; then
9240 # Let's see if we need curl, I think not?
9241 AC_MSG_RESULT([none])
9244 AC_MSG_RESULT([internal])
9246 BUILD_TYPE="$BUILD_TYPE CURL"
9249 AC_SUBST(SYSTEM_CURL)
9250 AC_SUBST(CURL_CFLAGS)
9252 AC_SUBST(ENABLE_CURL)
9254 dnl ===================================================================
9255 dnl Check for system boost
9256 dnl ===================================================================
9257 AC_MSG_CHECKING([which boost to use])
9258 if test "$with_system_boost" = "yes"; then
9259 AC_MSG_RESULT([external])
9267 save_CXXFLAGS=$CXXFLAGS
9268 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
9269 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
9270 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
9271 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
9272 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
9273 CXXFLAGS=$save_CXXFLAGS
9275 # this is in m4/ax_boost_base.m4
9276 FilterLibs "${BOOST_LDFLAGS}"
9277 BOOST_LDFLAGS="${filteredlibs}"
9279 AC_MSG_RESULT([internal])
9280 BUILD_TYPE="$BUILD_TYPE BOOST"
9282 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
9283 # use warning-suppressing wrapper headers
9284 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
9286 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
9289 AC_SUBST(SYSTEM_BOOST)
9291 dnl ===================================================================
9292 dnl Check for system mdds
9293 dnl ===================================================================
9294 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.5 >= 1.5.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
9296 dnl ===================================================================
9297 dnl Check for system glm
9298 dnl ===================================================================
9299 AC_MSG_CHECKING([which glm to use])
9300 if test "$with_system_glm" = "yes"; then
9301 AC_MSG_RESULT([external])
9304 AC_CHECK_HEADER([glm/glm.hpp], [],
9305 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
9308 AC_MSG_RESULT([internal])
9309 BUILD_TYPE="$BUILD_TYPE GLM"
9311 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
9313 AC_SUBST([GLM_CFLAGS])
9314 AC_SUBST([SYSTEM_GLM])
9316 dnl ===================================================================
9317 dnl Check for system odbc
9318 dnl ===================================================================
9319 AC_MSG_CHECKING([which odbc headers to use])
9320 if test "$with_system_odbc" = "yes" -o '(' "$with_system_headers" = "yes" -a "$with_system_odbc" = "auto" ')' -o '(' "$_os" = "WINNT" -a "$with_system_odbc" != "no" ')'; then
9321 AC_MSG_RESULT([external])
9322 SYSTEM_ODBC_HEADERS=TRUE
9324 if test "$build_os" = "cygwin"; then
9325 save_CPPFLAGS=$CPPFLAGS
9327 PathFormat "$winsdktest"
9328 CPPFLAGS="$CPPFLAGS -I$formatted_path/include/um -I$formatted_path/Include/$winsdklibsubdir/um -I$formatted_path/include -I$formatted_path/include/shared -I$formatted_path/include/$winsdklibsubdir/shared"
9329 AC_CHECK_HEADER(sqlext.h, [],
9330 [AC_MSG_ERROR(odbc not found. install odbc)],
9331 [#include <windows.h>])
9332 CPPFLAGS=$save_CPPFLAGS
9334 AC_CHECK_HEADER(sqlext.h, [],
9335 [AC_MSG_ERROR(odbc not found. install odbc)],[])
9337 elif test "$enable_database_connectivity" != yes; then
9338 AC_MSG_RESULT([none])
9340 AC_MSG_RESULT([internal])
9341 SYSTEM_ODBC_HEADERS=
9343 AC_SUBST(SYSTEM_ODBC_HEADERS)
9345 dnl ===================================================================
9346 dnl Enable LDAP support
9347 dnl ===================================================================
9349 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
9350 AC_MSG_CHECKING([whether to enable LDAP support])
9351 if test "$enable_ldap" != "yes"; then
9356 AC_MSG_RESULT([yes])
9358 AC_DEFINE(HAVE_FEATURE_LDAP)
9361 AC_SUBST(ENABLE_LDAP)
9363 dnl ===================================================================
9364 dnl Check for system openldap
9365 dnl ===================================================================
9367 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android" -a "$ENABLE_LDAP" != ""; then
9368 AC_MSG_CHECKING([which openldap library to use])
9369 if test "$with_system_openldap" = "yes"; then
9370 AC_MSG_RESULT([external])
9371 SYSTEM_OPENLDAP=TRUE
9372 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
9373 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9374 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9376 AC_MSG_RESULT([internal])
9378 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
9381 AC_SUBST(SYSTEM_OPENLDAP)
9383 dnl ===================================================================
9384 dnl Check for system NSS
9385 dnl ===================================================================
9386 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
9387 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
9388 AC_DEFINE(HAVE_FEATURE_NSS)
9390 AC_DEFINE(ENABLE_NSS)
9391 elif test $_os != iOS ; then
9394 AC_SUBST(ENABLE_NSS)
9396 dnl ===================================================================
9397 dnl Check for TLS/SSL and cryptographic implementation to use
9398 dnl ===================================================================
9399 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
9400 if test -n "$with_tls"; then
9403 AC_DEFINE(USE_TLS_OPENSSL)
9406 if test "$enable_openssl" != "yes"; then
9407 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9410 # warn that OpenSSL has been selected but not all TLS code has this option
9411 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
9412 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
9415 AC_DEFINE(USE_TLS_NSS)
9419 AC_MSG_WARN([Skipping TLS/SSL])
9422 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9424 nss - Mozilla's Network Security Services (NSS)
9429 # default to using NSS, it results in smaller oox lib
9430 AC_DEFINE(USE_TLS_NSS)
9433 AC_MSG_RESULT([$TLS])
9436 dnl ===================================================================
9437 dnl Check for system sane
9438 dnl ===================================================================
9439 AC_MSG_CHECKING([which sane header to use])
9440 if test "$with_system_sane" = "yes"; then
9441 AC_MSG_RESULT([external])
9442 AC_CHECK_HEADER(sane/sane.h, [],
9443 [AC_MSG_ERROR(sane not found. install sane)], [])
9445 AC_MSG_RESULT([internal])
9446 BUILD_TYPE="$BUILD_TYPE SANE"
9449 dnl ===================================================================
9450 dnl Check for system icu
9451 dnl ===================================================================
9458 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9459 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9460 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9461 AC_MSG_CHECKING([which icu to use])
9462 if test "$with_system_icu" = "yes"; then
9463 AC_MSG_RESULT([external])
9466 AC_MSG_CHECKING([for unicode/rbbi.h])
9467 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([icu headers not found])])
9470 if test "$cross_compiling" != "yes"; then
9471 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9472 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9473 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9474 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9477 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9478 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9479 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9480 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9481 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9482 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9483 AC_MSG_RESULT([yes])
9486 if test "$with_system_icu_for_build" != "force"; then
9487 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9488 You can use --with-system-icu-for-build=force to use it anyway.])
9493 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9494 # using the system icu tools can lead to version confusion, use the
9495 # ones from the build environment when cross-compiling
9496 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9497 if test -z "$SYSTEM_GENBRK"; then
9498 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9500 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9501 if test -z "$SYSTEM_GENCCODE"; then
9502 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9504 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9505 if test -z "$SYSTEM_GENCMN"; then
9506 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9508 if test "$ICU_MAJOR" -ge "49"; then
9509 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9510 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9511 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9513 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9514 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9515 ICU_RECLASSIFIED_HEBREW_LETTER=
9519 if test "$cross_compiling" = "yes"; then
9520 if test "$ICU_MAJOR" -ge "50"; then
9521 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9526 AC_MSG_RESULT([internal])
9528 BUILD_TYPE="$BUILD_TYPE ICU"
9529 # surprisingly set these only for "internal" (to be used by various other
9530 # external libs): the system icu-config is quite unhelpful and spits out
9531 # dozens of weird flags and also default path -I/usr/include
9532 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9533 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9535 if test "$ICU_MAJOR" -ge "59"; then
9536 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9537 # with -std=c++11 but not all external libraries can be built with that,
9538 # for those use a bit-compatible typedef uint16_t UChar; see
9539 # icu/source/common/unicode/umachine.h
9540 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9544 AC_SUBST(SYSTEM_ICU)
9545 AC_SUBST(SYSTEM_GENBRK)
9546 AC_SUBST(SYSTEM_GENCCODE)
9547 AC_SUBST(SYSTEM_GENCMN)
9550 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9551 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9552 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9553 AC_SUBST(ICU_CFLAGS)
9555 AC_SUBST(ICU_UCHAR_TYPE)
9557 dnl ==================================================================
9559 dnl ==================================================================
9560 AC_MSG_CHECKING([whether to enable breakpad])
9561 if test "$enable_breakpad" != yes; then
9564 AC_MSG_RESULT([yes])
9565 ENABLE_BREAKPAD="TRUE"
9566 AC_DEFINE(ENABLE_BREAKPAD)
9567 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9568 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9570 AC_MSG_CHECKING([for crashreport config])
9571 if test "$with_symbol_config" = "no"; then
9572 BREAKPAD_SYMBOL_CONFIG="invalid"
9575 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9576 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9577 AC_MSG_RESULT([yes])
9579 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9581 AC_SUBST(ENABLE_BREAKPAD)
9583 dnl ==================================================================
9585 dnl ==================================================================
9586 AC_MSG_CHECKING([whether to enable fuzzers])
9587 if test "$enable_fuzzers" != yes; then
9590 AC_MSG_RESULT([yes])
9591 ENABLE_FUZZERS="TRUE"
9592 AC_DEFINE([ENABLE_FUZZERS],1)
9593 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9595 AC_SUBST(ENABLE_FUZZERS)
9597 dnl ===================================================================
9599 dnl ===================================================================
9600 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.15 >= 0.15.0])
9601 if test "$with_system_orcus" != "yes"; then
9602 if test "$SYSTEM_BOOST" = "TRUE"; then
9603 # ===========================================================
9604 # Determine if we are going to need to link with Boost.System
9605 # ===========================================================
9606 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9607 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9608 dnl in documentation has no effect.
9609 AC_MSG_CHECKING([if we need to link with Boost.System])
9611 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9612 @%:@include <boost/version.hpp>
9614 #if BOOST_VERSION >= 105000
9615 # error yes, we need to link with Boost.System
9620 AC_MSG_RESULT([yes])
9626 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9627 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9628 AC_SUBST([BOOST_SYSTEM_LIB])
9629 AC_SUBST(SYSTEM_LIBORCUS)
9631 dnl ===================================================================
9633 dnl ===================================================================
9634 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9635 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9636 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9638 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9639 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9640 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9642 if test "$COM" = "MSC"; then # override the above
9643 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9644 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9647 if test "$with_system_harfbuzz" = "yes"; then
9648 if test "$with_system_graphite" = "no"; then
9649 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9651 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9653 _save_cflags="$CFLAGS"
9654 LIBS="$LIBS $HARFBUZZ_LIBS"
9655 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9656 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9658 CFLAGS="$_save_cflags"
9660 if test "$with_system_graphite" = "yes"; then
9661 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9665 AC_MSG_CHECKING([whether to use X11])
9666 dnl ***************************************
9667 dnl testing for X libraries and includes...
9668 dnl ***************************************
9669 if test "$USING_X11" = TRUE; then
9670 AC_DEFINE(HAVE_FEATURE_X11)
9672 AC_MSG_RESULT([$USING_X11])
9674 if test "$USING_X11" = TRUE; then
9677 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9679 if test -z "$x_includes"; then
9680 x_includes="default_x_includes"
9682 if test -z "$x_libraries"; then
9683 x_libraries="default_x_libraries"
9685 CFLAGS="$CFLAGS $X_CFLAGS"
9686 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9687 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9689 x_includes="no_x_includes"
9690 x_libraries="no_x_libraries"
9693 if test "$USING_X11" = TRUE; then
9694 dnl ===================================================================
9695 dnl Check for extension headers
9696 dnl ===================================================================
9697 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9698 [#include <X11/extensions/shape.h>])
9700 # vcl needs ICE and SM
9701 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9702 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9703 [AC_MSG_ERROR(ICE library not found)])
9704 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9705 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9706 [AC_MSG_ERROR(SM library not found)])
9709 dnl ===================================================================
9710 dnl Check for system Xrender
9711 dnl ===================================================================
9712 AC_MSG_CHECKING([whether to use Xrender])
9713 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9714 AC_MSG_RESULT([yes])
9715 PKG_CHECK_MODULES(XRENDER, xrender)
9716 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9717 FilterLibs "${XRENDER_LIBS}"
9718 XRENDER_LIBS="${filteredlibs}"
9719 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9720 [AC_MSG_ERROR(libXrender not found or functional)], [])
9721 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9722 [AC_MSG_ERROR(Xrender not found. install X)], [])
9726 AC_SUBST(XRENDER_CFLAGS)
9727 AC_SUBST(XRENDER_LIBS)
9729 dnl ===================================================================
9730 dnl Check for XRandr
9731 dnl ===================================================================
9732 AC_MSG_CHECKING([whether to enable RandR support])
9733 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9734 AC_MSG_RESULT([yes])
9735 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9736 if test "$ENABLE_RANDR" != "TRUE"; then
9737 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9738 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9740 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9741 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9742 XRANDR_LIBS="-lXrandr "
9745 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9746 FilterLibs "${XRANDR_LIBS}"
9747 XRANDR_LIBS="${filteredlibs}"
9752 AC_SUBST(XRANDR_CFLAGS)
9753 AC_SUBST(XRANDR_LIBS)
9754 AC_SUBST(ENABLE_RANDR)
9756 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9759 if test $_os = iOS -o $_os = Android; then
9762 AC_MSG_CHECKING([for webdav library])
9763 case "$WITH_WEBDAV" in
9765 AC_MSG_RESULT([serf])
9766 # Check for system apr-util
9767 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9768 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9769 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9770 if test "$COM" = "MSC"; then
9772 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9773 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9776 # Check for system serf
9777 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9778 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9779 if test "$COM" = "MSC"; then
9780 SERF_LIB_DIR="Release"
9781 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9782 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9786 AC_MSG_RESULT([neon])
9787 # Check for system neon
9788 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9789 if test "$with_system_neon" = "yes"; then
9790 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9794 AC_SUBST(NEON_VERSION)
9797 AC_MSG_RESULT([none, disabled])
9801 AC_SUBST(WITH_WEBDAV)
9803 dnl ===================================================================
9804 dnl Check for disabling cve_tests
9805 dnl ===================================================================
9806 AC_MSG_CHECKING([whether to execute CVE tests])
9807 # If not explicitly enabled or disabled, default
9808 if test -z "$enable_cve_tests"; then
9811 # Default cves off for Windows with its wild and wonderful
9812 # variety of AV software kicking in and panicking
9817 enable_cve_tests=yes
9821 if test "$enable_cve_tests" = "no"; then
9823 DISABLE_CVE_TESTS=TRUE
9824 AC_SUBST(DISABLE_CVE_TESTS)
9826 AC_MSG_RESULT([yes])
9829 dnl ===================================================================
9830 dnl Check for enabling chart XShape tests
9831 dnl ===================================================================
9832 AC_MSG_CHECKING([whether to execute chart XShape tests])
9833 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
9834 AC_MSG_RESULT([yes])
9835 ENABLE_CHART_TESTS=TRUE
9836 AC_SUBST(ENABLE_CHART_TESTS)
9841 dnl ===================================================================
9842 dnl Check for system openssl
9843 dnl ===================================================================
9845 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9846 if test "$enable_openssl" = "yes"; then
9848 if test "$_os" = Darwin ; then
9849 # OpenSSL is deprecated when building for 10.7 or later.
9851 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9852 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9854 with_system_openssl=no
9855 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9856 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9857 && test "$with_system_openssl" != "no"; then
9858 with_system_openssl=yes
9861 OPENSSL_LIBS="-lssl -lcrypto"
9863 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9865 if test "$with_system_openssl" = "yes"; then
9866 AC_MSG_CHECKING([whether openssl supports SHA512])
9868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9870 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9874 AC_MSG_RESULT([yes])
9875 DISABLE_OPENSSL=TRUE
9877 # warn that although OpenSSL is disabled, system libraries may depend on it
9878 AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
9879 add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
9882 AC_SUBST([DISABLE_OPENSSL])
9884 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
9885 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
9886 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
9887 enable_cipher_openssl_backend=no
9889 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
9892 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
9893 ENABLE_CIPHER_OPENSSL_BACKEND=
9894 if test "$enable_cipher_openssl_backend" = yes; then
9895 AC_MSG_RESULT([yes])
9896 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
9900 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
9902 dnl ===================================================================
9903 dnl Check for building gnutls
9904 dnl ===================================================================
9905 AC_MSG_CHECKING([whether to use gnutls])
9906 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
9907 AC_MSG_RESULT([yes])
9909 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9910 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9911 available in the system to use as replacement.]]))
9912 FilterLibs "${LIBGCRYPT_LIBS}"
9913 LIBGCRYPT_LIBS="${filteredlibs}"
9918 AC_SUBST([LIBGCRYPT_CFLAGS])
9919 AC_SUBST([LIBGCRYPT_LIBS])
9921 dnl ===================================================================
9922 dnl Check for system redland
9923 dnl ===================================================================
9924 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9925 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9926 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9927 if test "$with_system_redland" = "yes"; then
9928 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9929 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9935 AC_SUBST(RAPTOR_MAJOR)
9936 AC_SUBST(RASQAL_MAJOR)
9937 AC_SUBST(REDLAND_MAJOR)
9939 dnl ===================================================================
9940 dnl Check for system hunspell
9941 dnl ===================================================================
9942 AC_MSG_CHECKING([which libhunspell to use])
9943 if test "$with_system_hunspell" = "yes"; then
9944 AC_MSG_RESULT([external])
9945 SYSTEM_HUNSPELL=TRUE
9947 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9948 if test "$HUNSPELL_PC" != "TRUE"; then
9949 AC_CHECK_HEADER(hunspell.hxx, [],
9951 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9952 [AC_MSG_ERROR(hunspell headers not found.)], [])
9954 AC_CHECK_LIB([hunspell], [main], [:],
9955 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9956 HUNSPELL_LIBS=-lhunspell
9959 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9960 FilterLibs "${HUNSPELL_LIBS}"
9961 HUNSPELL_LIBS="${filteredlibs}"
9963 AC_MSG_RESULT([internal])
9965 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9966 if test "$COM" = "MSC"; then
9967 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9969 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
9971 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9973 AC_SUBST(SYSTEM_HUNSPELL)
9974 AC_SUBST(HUNSPELL_CFLAGS)
9975 AC_SUBST(HUNSPELL_LIBS)
9977 dnl ===================================================================
9978 dnl Check for system qrcodegen
9979 dnl ===================================================================
9980 AC_MSG_CHECKING([which libqrcodegen to use])
9981 if test "$with_system_qrcodegen" = "yes"; then
9982 AC_MSG_RESULT([external])
9983 SYSTEM_QRCODEGEN=TRUE
9985 AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
9986 [AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
9987 AC_CHECK_LIB([qrcodegencpp], [main], [:],
9988 [ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
9989 QRCODEGEN_LIBS=-lqrcodegencpp
9991 QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9992 FilterLibs "${QRCODEGEN_LIBS}"
9993 QRCODEGEN_LIBS="${filteredlibs}"
9995 AC_MSG_RESULT([internal])
9997 BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
9999 AC_SUBST(SYSTEM_QRCODEGEN)
10000 AC_SUBST(QRCODEGEN_CFLAGS)
10001 AC_SUBST(QRCODEGEN_LIBS)
10003 dnl ===================================================================
10004 dnl Checking for altlinuxhyph
10005 dnl ===================================================================
10006 AC_MSG_CHECKING([which altlinuxhyph to use])
10007 if test "$with_system_altlinuxhyph" = "yes"; then
10008 AC_MSG_RESULT([external])
10010 AC_CHECK_HEADER(hyphen.h, [],
10011 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
10012 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
10013 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
10014 [#include <hyphen.h>])
10015 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
10016 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10017 if test -z "$HYPHEN_LIB"; then
10018 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
10019 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10021 if test -z "$HYPHEN_LIB"; then
10022 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
10023 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10026 AC_MSG_RESULT([internal])
10028 BUILD_TYPE="$BUILD_TYPE HYPHEN"
10029 if test "$COM" = "MSC"; then
10030 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
10032 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
10035 AC_SUBST(SYSTEM_HYPH)
10036 AC_SUBST(HYPHEN_LIB)
10038 dnl ===================================================================
10039 dnl Checking for mythes
10040 dnl ===================================================================
10041 AC_MSG_CHECKING([which mythes to use])
10042 if test "$with_system_mythes" = "yes"; then
10043 AC_MSG_RESULT([external])
10045 AC_LANG_PUSH([C++])
10046 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
10047 if test "$MYTHES_PKGCONFIG" = "no"; then
10048 AC_CHECK_HEADER(mythes.hxx, [],
10049 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
10050 AC_CHECK_LIB([mythes-1.2], [main], [:],
10051 [ MYTHES_FOUND=no], [])
10052 if test "$MYTHES_FOUND" = "no"; then
10053 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
10054 [ MYTHES_FOUND=no], [])
10056 if test "$MYTHES_FOUND" = "no"; then
10057 AC_MSG_ERROR([mythes library not found!.])
10061 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10062 FilterLibs "${MYTHES_LIBS}"
10063 MYTHES_LIBS="${filteredlibs}"
10065 AC_MSG_RESULT([internal])
10067 BUILD_TYPE="$BUILD_TYPE MYTHES"
10068 if test "$COM" = "MSC"; then
10069 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
10071 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
10074 AC_SUBST(SYSTEM_MYTHES)
10075 AC_SUBST(MYTHES_CFLAGS)
10076 AC_SUBST(MYTHES_LIBS)
10078 dnl ===================================================================
10079 dnl How should we build the linear programming solver ?
10080 dnl ===================================================================
10083 AC_MSG_CHECKING([whether to build with CoinMP])
10084 if test "$enable_coinmp" != "no"; then
10086 AC_MSG_RESULT([yes])
10087 if test "$with_system_coinmp" = "yes"; then
10089 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
10090 FilterLibs "${COINMP_LIBS}"
10091 COINMP_LIBS="${filteredlibs}"
10093 BUILD_TYPE="$BUILD_TYPE COINMP"
10096 AC_MSG_RESULT([no])
10098 AC_SUBST(ENABLE_COINMP)
10099 AC_SUBST(SYSTEM_COINMP)
10100 AC_SUBST(COINMP_CFLAGS)
10101 AC_SUBST(COINMP_LIBS)
10104 AC_MSG_CHECKING([whether to build with lpsolve])
10105 if test "$enable_lpsolve" != "no"; then
10106 ENABLE_LPSOLVE=TRUE
10107 AC_MSG_RESULT([yes])
10109 AC_MSG_RESULT([no])
10111 AC_SUBST(ENABLE_LPSOLVE)
10113 if test "$ENABLE_LPSOLVE" = TRUE; then
10114 AC_MSG_CHECKING([which lpsolve to use])
10115 if test "$with_system_lpsolve" = "yes"; then
10116 AC_MSG_RESULT([external])
10117 SYSTEM_LPSOLVE=TRUE
10118 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
10119 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
10121 # some systems need this. Like Ubuntu....
10122 AC_CHECK_LIB(m, floor)
10123 AC_CHECK_LIB(dl, dlopen)
10124 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
10125 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
10128 AC_MSG_RESULT([internal])
10130 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
10133 AC_SUBST(SYSTEM_LPSOLVE)
10135 dnl ===================================================================
10136 dnl Checking for libexttextcat
10137 dnl ===================================================================
10138 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
10139 if test "$with_system_libexttextcat" = "yes"; then
10140 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
10142 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
10144 dnl ===================================================================
10145 dnl Checking for libnumbertext
10146 dnl ===================================================================
10147 AC_MSG_CHECKING([whether to use libnumbertext])
10148 if test "$enable_libnumbertext" = "no"; then
10149 AC_MSG_RESULT([no])
10150 ENABLE_LIBNUMBERTEXT=
10151 SYSTEM_LIBNUMBERTEXT=
10153 AC_MSG_RESULT([yes])
10154 ENABLE_LIBNUMBERTEXT=TRUE
10155 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
10156 if test "$with_system_libnumbertext" = "yes"; then
10157 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
10158 SYSTEM_LIBNUMBERTEXT=YES
10160 SYSTEM_LIBNUMBERTEXT=
10161 AC_LANG_PUSH([C++])
10162 save_CPPFLAGS=$CPPFLAGS
10163 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
10164 AC_CHECK_HEADERS([codecvt regex])
10165 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
10166 [ ENABLE_LIBNUMBERTEXT=''
10167 LIBNUMBERTEXT_CFLAGS=''
10168 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
10169 Enable libnumbertext fallback (missing number to number name conversion).])
10171 CPPFLAGS=$save_CPPFLAGS
10174 if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
10175 AC_DEFINE(ENABLE_LIBNUMBERTEXT)
10178 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
10179 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
10180 AC_SUBST(ENABLE_LIBNUMBERTEXT)
10181 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
10183 dnl ***************************************
10184 dnl testing libc version for Linux...
10185 dnl ***************************************
10186 if test "$_os" = "Linux"; then
10187 AC_MSG_CHECKING([whether libc is >= 2.1.1])
10188 exec 6>/dev/null # no output
10189 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
10190 exec 6>&1 # output on again
10191 if test "$HAVE_LIBC"; then
10192 AC_MSG_RESULT([yes])
10194 AC_MSG_ERROR([no, upgrade libc])
10198 dnl =========================================
10199 dnl Check for uuidgen
10200 dnl =========================================
10201 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
10202 # presence is already tested above in the WINDOWS_SDK_HOME check
10203 UUIDGEN=uuidgen.exe
10206 AC_PATH_PROG([UUIDGEN], [uuidgen])
10207 if test -z "$UUIDGEN"; then
10208 AC_MSG_WARN([uuid is needed for building installation sets])
10212 dnl ***************************************
10213 dnl Checking for bison and flex
10214 dnl ***************************************
10215 AC_PATH_PROG(BISON, bison)
10216 if test -z "$BISON"; then
10217 AC_MSG_ERROR([no bison found in \$PATH, install it])
10219 AC_MSG_CHECKING([the bison version])
10220 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
10221 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
10222 # Accept newer than 2.0
10223 if test "$_bison_longver" -lt 2000; then
10224 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
10228 AC_PATH_PROG(FLEX, flex)
10229 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10230 FLEX=`cygpath -m $FLEX`
10232 if test -z "$FLEX"; then
10233 AC_MSG_ERROR([no flex found in \$PATH, install it])
10235 AC_MSG_CHECKING([the flex version])
10236 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
10237 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
10238 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
10242 dnl ***************************************
10243 dnl Checking for patch
10244 dnl ***************************************
10245 AC_PATH_PROG(PATCH, patch)
10246 if test -z "$PATCH"; then
10247 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
10250 dnl On Solaris, FreeBSD or macOS, check if --with-gnu-patch was used
10251 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
10252 if test -z "$with_gnu_patch"; then
10255 if test -x "$with_gnu_patch"; then
10256 GNUPATCH=$with_gnu_patch
10258 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
10262 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
10263 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
10264 AC_MSG_RESULT([yes])
10266 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
10272 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10273 GNUPATCH=`cygpath -m $GNUPATCH`
10276 dnl We also need to check for --with-gnu-cp
10278 if test -z "$with_gnu_cp"; then
10279 # check the place where the good stuff is hidden on Solaris...
10280 if test -x /usr/gnu/bin/cp; then
10281 GNUCP=/usr/gnu/bin/cp
10283 AC_PATH_PROGS(GNUCP, gnucp cp)
10285 if test -z $GNUCP; then
10286 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
10289 if test -x "$with_gnu_cp"; then
10292 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
10296 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10297 GNUCP=`cygpath -m $GNUCP`
10300 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
10301 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
10302 AC_MSG_RESULT([yes])
10303 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
10304 AC_MSG_RESULT([yes])
10306 case "$build_os" in
10307 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
10310 AC_MSG_RESULT([no gnucp found - using the system's cp command])
10313 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
10322 dnl ***************************************
10323 dnl testing assembler path
10324 dnl ***************************************
10326 if test "$_os" = "WINNT"; then
10327 if test "$BITNESS_OVERRIDE" = ""; then
10333 AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
10334 if test -f "$CL_PATH/$assembler"; then
10335 ML_EXE=`win_short_path_for_make "$CL_PATH/$assembler"`
10336 AC_MSG_RESULT([$ML_EXE])
10338 AC_MSG_ERROR([not found])
10344 dnl ===================================================================
10345 dnl We need zip and unzip
10346 dnl ===================================================================
10347 AC_PATH_PROG(ZIP, zip)
10348 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10349 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10350 AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install it and make sure it is the one found first in PATH],,)
10353 AC_PATH_PROG(UNZIP, unzip)
10354 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10356 dnl ===================================================================
10357 dnl Zip must be a specific type for different build types.
10358 dnl ===================================================================
10359 if test $build_os = cygwin; then
10360 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10361 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10365 dnl ===================================================================
10366 dnl We need touch with -h option support.
10367 dnl ===================================================================
10368 AC_PATH_PROG(TOUCH, touch)
10369 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10371 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10372 AC_MSG_ERROR([touch version with -h option support is required to build, please install it and make sure it is the one found first in PATH],,)
10375 dnl ===================================================================
10376 dnl Check for system epoxy
10377 dnl ===================================================================
10378 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
10380 dnl ===================================================================
10381 dnl Set vcl option: coordinate device in double or sal_Int32
10382 dnl ===================================================================
10384 dnl disabled for now, we don't want subtle differences between OSs
10385 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10386 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
10387 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10388 dnl AC_MSG_RESULT([double])
10390 dnl AC_MSG_RESULT([sal_Int32])
10393 dnl ===================================================================
10394 dnl Test which vclplugs have to be built.
10395 dnl ===================================================================
10397 if test "$USING_X11" != TRUE; then
10404 if test "x$enable_gtk3" = "xyes"; then
10405 if test "$with_system_cairo" = no; then
10406 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10408 : ${with_system_cairo:=yes}
10409 PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.18 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
10410 if test "x$ENABLE_GTK3" = "xTRUE"; then
10411 AC_DEFINE(ENABLE_GTK3)
10414 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10416 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10417 FilterLibs "${GTK3_LIBS}"
10418 GTK3_LIBS="${filteredlibs}"
10420 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10421 if test "$with_system_epoxy" != "yes"; then
10422 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10423 AC_CHECK_HEADER(EGL/eglplatform.h, [],
10424 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10427 AC_SUBST(GTK3_LIBS)
10428 AC_SUBST(GTK3_CFLAGS)
10429 AC_SUBST(ENABLE_GTK3)
10431 if test "$enable_introspection" = yes; then
10432 if test "$ENABLE_GTK3" = TRUE; then
10433 GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
10435 AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
10440 if test "x$enable_gtk" = "xyes"; then
10441 if test "$with_system_cairo" = no; then
10442 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10444 : ${with_system_cairo:=yes}
10446 AC_DEFINE(ENABLE_GTK)
10449 AC_SUBST(ENABLE_GTK)
10452 if test "x$enable_qt5" = "xyes"; then
10454 AC_DEFINE(ENABLE_QT5)
10457 AC_SUBST(ENABLE_QT5)
10460 if test "x$enable_kf5" = "xyes"; then
10462 AC_DEFINE(ENABLE_KF5)
10465 AC_SUBST(ENABLE_KF5)
10467 ENABLE_GTK3_KDE5=""
10468 if test "x$enable_gtk3_kde5" = "xyes"; then
10469 ENABLE_GTK3_KDE5="TRUE"
10470 AC_DEFINE(ENABLE_GTK3_KDE5)
10473 AC_SUBST(ENABLE_GTK3_KDE5)
10475 if test "$_os" = "WINNT"; then
10477 elif test "$_os" = "Darwin"; then
10479 elif test "$_os" = "iOS"; then
10483 build_vcl_plugins="$R"
10484 if test -z "$build_vcl_plugins"; then
10485 build_vcl_plugins="none"
10487 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10489 dnl ===================================================================
10490 dnl check for dbus support
10491 dnl ===================================================================
10495 DBUS_GLIB_CFLAGS=""
10499 if test "$enable_dbus" = "no"; then
10503 AC_MSG_CHECKING([whether to enable DBUS support])
10504 if test "$test_dbus" = "yes"; then
10506 AC_MSG_RESULT([yes])
10507 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10508 AC_DEFINE(ENABLE_DBUS)
10509 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10510 FilterLibs "${DBUS_LIBS}"
10511 DBUS_LIBS="${filteredlibs}"
10513 # Glib is needed for BluetoothServer
10514 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10515 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10517 DBUS_HAVE_GLIB="TRUE"
10518 AC_DEFINE(DBUS_HAVE_GLIB,1)
10520 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10523 AC_MSG_RESULT([no])
10526 AC_SUBST(ENABLE_DBUS)
10527 AC_SUBST(DBUS_CFLAGS)
10528 AC_SUBST(DBUS_LIBS)
10529 AC_SUBST(DBUS_GLIB_CFLAGS)
10530 AC_SUBST(DBUS_GLIB_LIBS)
10531 AC_SUBST(DBUS_HAVE_GLIB)
10533 AC_MSG_CHECKING([whether to enable Impress remote control])
10534 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10535 AC_MSG_RESULT([yes])
10536 ENABLE_SDREMOTE=TRUE
10537 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10539 if test $OS = MACOSX && test "$MAC_OS_X_VERSION_MAX_ALLOWED" -ge 101500; then
10540 # The Bluetooth code doesn't compile with macOS SDK 10.15
10541 enable_sdremote_bluetooth=no
10543 # If not explicitly enabled or disabled, default
10544 if test -z "$enable_sdremote_bluetooth"; then
10547 # Default to yes for these
10548 enable_sdremote_bluetooth=yes
10552 enable_sdremote_bluetooth=no
10556 # $enable_sdremote_bluetooth is guaranteed non-empty now
10558 if test "$enable_sdremote_bluetooth" != "no"; then
10559 if test "$OS" = "LINUX"; then
10560 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10561 AC_MSG_RESULT([yes])
10562 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10563 dnl ===================================================================
10564 dnl Check for system bluez
10565 dnl ===================================================================
10566 AC_MSG_CHECKING([which Bluetooth header to use])
10567 if test "$with_system_bluez" = "yes"; then
10568 AC_MSG_RESULT([external])
10569 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10570 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10573 AC_MSG_RESULT([internal])
10577 AC_MSG_RESULT([no, dbus disabled])
10578 ENABLE_SDREMOTE_BLUETOOTH=
10582 AC_MSG_RESULT([yes])
10583 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10587 AC_MSG_RESULT([no])
10588 ENABLE_SDREMOTE_BLUETOOTH=
10594 AC_MSG_RESULT([no])
10596 AC_SUBST(ENABLE_SDREMOTE)
10597 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10598 AC_SUBST(SYSTEM_BLUEZ)
10600 dnl ===================================================================
10601 dnl Check whether the gtk 2.0 libraries are available.
10602 dnl ===================================================================
10606 if test "$test_gtk" = "yes"; then
10608 if test "$ENABLE_GTK" = "TRUE"; then
10609 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met (gtk+-2.0 >= 2.18.0). Use --disable-gtk or install the missing packages]))
10610 PKG_CHECK_MODULES(GTK, gdk-pixbuf-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met (gdk-pixbuf-2.0 >= 2.2). Use --disable-gtk or install the missing packages]))
10611 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10612 FilterLibs "${GTK_LIBS}"
10613 GTK_LIBS="${filteredlibs}"
10614 PKG_CHECK_MODULES(GTHREAD, gthread-2.0,,AC_MSG_ERROR([requirements to build the gtk-plugin not met (gthread-2.0). Use --disable-gtk or install the missing packages]))
10615 BUILD_TYPE="$BUILD_TYPE GTK"
10616 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10617 FilterLibs "${GTHREAD_LIBS}"
10618 GTHREAD_LIBS="${filteredlibs}"
10620 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10621 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10622 [ENABLE_GTK_PRINT="TRUE"],
10623 [ENABLE_GTK_PRINT=""])
10624 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10625 FilterLibs "${GTK_PRINT_LIBS}"
10626 GTK_PRINT_LIBS="${filteredlibs}"
10629 if test "$ENABLE_GTK" = "TRUE" || test "$ENABLE_GTK3" = "TRUE"; then
10630 AC_MSG_CHECKING([whether to enable GIO support])
10631 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10632 dnl Need at least 2.26 for the dbus support.
10633 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10634 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10635 if test "$ENABLE_GIO" = "TRUE"; then
10636 AC_DEFINE(ENABLE_GIO)
10637 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10638 FilterLibs "${GIO_LIBS}"
10639 GIO_LIBS="${filteredlibs}"
10642 AC_MSG_RESULT([no])
10646 AC_SUBST(ENABLE_GIO)
10647 AC_SUBST(GIO_CFLAGS)
10649 AC_SUBST(GTK_CFLAGS)
10651 AC_SUBST(GTHREAD_CFLAGS)
10652 AC_SUBST(GTHREAD_LIBS)
10653 AC_SUBST([ENABLE_GTK_PRINT])
10654 AC_SUBST([GTK_PRINT_CFLAGS])
10655 AC_SUBST([GTK_PRINT_LIBS])
10658 dnl ===================================================================
10660 SPLIT_APP_MODULES=""
10661 if test "$enable_split_app_modules" = "yes"; then
10662 SPLIT_APP_MODULES="TRUE"
10664 AC_SUBST(SPLIT_APP_MODULES)
10666 SPLIT_OPT_FEATURES=""
10667 if test "$enable_split_opt_features" = "yes"; then
10668 SPLIT_OPT_FEATURES="TRUE"
10670 AC_SUBST(SPLIT_OPT_FEATURES)
10672 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10673 if test "$enable_cairo_canvas" = yes; then
10674 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10676 enable_cairo_canvas=no
10677 elif test -z "$enable_cairo_canvas"; then
10678 enable_cairo_canvas=yes
10681 ENABLE_CAIRO_CANVAS=""
10682 if test "$enable_cairo_canvas" = "yes"; then
10684 ENABLE_CAIRO_CANVAS="TRUE"
10685 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10687 AC_SUBST(ENABLE_CAIRO_CANVAS)
10689 dnl ===================================================================
10690 dnl Check whether the GStreamer libraries are available.
10691 dnl ===================================================================
10693 ENABLE_GSTREAMER_1_0=""
10695 if test "$build_gstreamer_1_0" = "yes"; then
10697 AC_MSG_CHECKING([whether to enable the GStreamer 1.0 avmedia backend])
10698 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10699 ENABLE_GSTREAMER_1_0="TRUE"
10700 AC_MSG_RESULT([yes])
10701 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10702 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10703 FilterLibs "${GSTREAMER_1_0_LIBS}"
10704 GSTREAMER_1_0_LIBS="${filteredlibs}"
10705 AC_DEFINE(ENABLE_GSTREAMER_1_0)
10707 AC_MSG_RESULT([no])
10710 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10711 AC_SUBST(GSTREAMER_1_0_LIBS)
10712 AC_SUBST(ENABLE_GSTREAMER_1_0)
10714 dnl ===================================================================
10715 dnl Check whether to build the VLC avmedia backend
10716 dnl ===================================================================
10720 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10721 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10723 AC_MSG_RESULT([yes])
10725 AC_MSG_RESULT([no])
10727 AC_SUBST(ENABLE_VLC)
10729 ENABLE_OPENGL_TRANSITIONS=
10730 ENABLE_OPENGL_CANVAS=
10731 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10733 elif test "$_os" = "Darwin"; then
10734 # We use frameworks on macOS, no need for detail checks
10735 ENABLE_OPENGL_TRANSITIONS=TRUE
10736 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10737 ENABLE_OPENGL_CANVAS=TRUE
10738 elif test $_os = WINNT; then
10739 ENABLE_OPENGL_TRANSITIONS=TRUE
10740 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10741 ENABLE_OPENGL_CANVAS=TRUE
10743 if test "$USING_X11" = TRUE; then
10744 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10745 ENABLE_OPENGL_TRANSITIONS=TRUE
10746 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10747 ENABLE_OPENGL_CANVAS=TRUE
10751 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10752 AC_SUBST(ENABLE_OPENGL_CANVAS)
10754 dnl =================================================
10755 dnl Check whether to build with OpenCL support.
10756 dnl =================================================
10758 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10759 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10760 # platform (optional at run-time, used through clew).
10761 BUILD_TYPE="$BUILD_TYPE OPENCL"
10762 AC_DEFINE(HAVE_FEATURE_OPENCL)
10765 dnl =================================================
10766 dnl Check whether to build with dconf support.
10767 dnl =================================================
10769 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
10770 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10771 if test "$enable_dconf" = yes; then
10772 AC_MSG_ERROR([dconf not found])
10777 AC_MSG_CHECKING([whether to enable dconf])
10778 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
10782 AC_MSG_RESULT([no])
10785 AC_DEFINE(ENABLE_DCONF)
10786 AC_MSG_RESULT([yes])
10788 AC_SUBST([DCONF_CFLAGS])
10789 AC_SUBST([DCONF_LIBS])
10790 AC_SUBST([ENABLE_DCONF])
10793 AC_MSG_CHECKING([whether to build the PDF import feature])
10795 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10796 AC_MSG_RESULT([yes])
10797 ENABLE_PDFIMPORT=TRUE
10798 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10800 AC_MSG_RESULT([no])
10804 AC_MSG_CHECKING([whether to build PDFium])
10806 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" == "TRUE" \) -o "$enable_pdfium" = yes; then
10807 AC_MSG_RESULT([yes])
10809 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10810 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10812 AC_MSG_RESULT([no])
10814 AC_SUBST(ENABLE_PDFIUM)
10816 dnl ===================================================================
10817 dnl Check for poppler
10818 dnl ===================================================================
10820 AC_MSG_CHECKING([whether to build Poppler])
10821 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" == "TRUE" \) -o "$enable_poppler" = yes; then
10822 AC_MSG_RESULT([yes])
10823 ENABLE_POPPLER=TRUE
10824 AC_DEFINE(HAVE_FEATURE_POPPLER)
10826 AC_MSG_RESULT([no])
10828 AC_SUBST(ENABLE_POPPLER)
10830 if test "$ENABLE_PDFIMPORT" == "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
10831 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
10834 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" == "TRUE" -o "$ENABLE_PDFIUM" == "TRUE" \); then
10835 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
10838 if test "$ENABLE_PDFIMPORT" == "TRUE" -a "$ENABLE_POPPLER" == "TRUE"; then
10839 dnl ===================================================================
10840 dnl Check for system poppler
10841 dnl ===================================================================
10842 AC_MSG_CHECKING([which PDF import poppler to use])
10843 if test "$with_system_poppler" = "yes"; then
10844 AC_MSG_RESULT([external])
10845 SYSTEM_POPPLER=TRUE
10846 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10847 AC_LANG_PUSH([C++])
10848 save_CXXFLAGS=$CXXFLAGS
10849 save_CPPFLAGS=$CPPFLAGS
10850 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10851 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10852 AC_CHECK_HEADER([cpp/poppler-version.h],
10853 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10855 CXXFLAGS=$save_CXXFLAGS
10856 CPPFLAGS=$save_CPPFLAGS
10858 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10860 FilterLibs "${POPPLER_LIBS}"
10861 POPPLER_LIBS="${filteredlibs}"
10863 AC_MSG_RESULT([internal])
10865 BUILD_TYPE="$BUILD_TYPE POPPLER"
10866 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10868 AC_DEFINE([ENABLE_PDFIMPORT],1)
10870 AC_SUBST(ENABLE_PDFIMPORT)
10871 AC_SUBST(SYSTEM_POPPLER)
10872 AC_SUBST(POPPLER_CFLAGS)
10873 AC_SUBST(POPPLER_LIBS)
10877 if test "$build_for_ios" = "YES"; then
10878 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
10879 AC_MSG_RESULT([yes])
10880 elif test "$enable_mpl_subset" = "yes"; then
10881 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
10882 AC_MSG_RESULT([yes])
10883 elif test "$enable_fuzzers" = "yes"; then
10884 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
10885 AC_MSG_RESULT([yes])
10886 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
10887 dnl ===================================================================
10888 dnl Check for system gpgme
10889 dnl ===================================================================
10890 AC_MSG_CHECKING([which gpgmepp to use])
10891 if test "$with_system_gpgmepp" = "yes"; then
10892 AC_MSG_RESULT([external])
10893 SYSTEM_GPGMEPP=TRUE
10895 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
10896 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
10897 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
10898 # progress_callback is the only func with plain C linkage
10899 # checking for it also filters out older, KDE-dependent libgpgmepp versions
10900 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
10901 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
10902 AC_CHECK_HEADER(gpgme.h, [],
10903 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
10905 AC_MSG_RESULT([internal])
10906 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
10907 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
10909 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
10910 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
10911 if test "$_os" != "WINNT"; then
10912 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
10913 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
10914 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
10915 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
10918 ENABLE_GPGMEPP=TRUE
10919 AC_DEFINE([HAVE_FEATURE_GPGME])
10920 AC_PATH_PROG(GPG, gpg)
10921 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
10922 # so let's exclude that manually for the moment
10923 if test -n "$GPG" -a "$_os" != "WINNT"; then
10924 # make sure we not only have a working gpgme, but a full working
10925 # gpg installation to run OpenPGP signature verification
10926 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
10928 if test "$_os" = "Linux"; then
10930 AC_MSG_CHECKING([for /run/user/$uid])
10931 if test -d /run/user/$uid; then
10932 AC_MSG_RESULT([yes])
10933 AC_PATH_PROG(GPGCONF, gpgconf)
10935 # Older versions of gpgconf are not working as expected, since
10936 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
10937 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
10938 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
10939 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
10940 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
10941 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
10942 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
10943 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
10944 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
10945 if $GPGCONF --dump-options > /dev/null ; then
10946 if $GPGCONF --dump-options | grep -q create-socketdir ; then
10947 AC_MSG_RESULT([yes])
10948 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
10949 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
10951 AC_MSG_RESULT([no])
10954 AC_MSG_RESULT([no. missing or broken gpgconf?])
10957 AC_MSG_RESULT([no, $GPGCONF_VERSION])
10960 AC_MSG_RESULT([no])
10964 AC_SUBST(ENABLE_GPGMEPP)
10965 AC_SUBST(SYSTEM_GPGMEPP)
10966 AC_SUBST(GPG_ERROR_CFLAGS)
10967 AC_SUBST(GPG_ERROR_LIBS)
10968 AC_SUBST(LIBASSUAN_CFLAGS)
10969 AC_SUBST(LIBASSUAN_LIBS)
10970 AC_SUBST(GPGMEPP_CFLAGS)
10971 AC_SUBST(GPGMEPP_LIBS)
10973 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10974 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10975 AC_MSG_RESULT([yes])
10976 ENABLE_MEDIAWIKI=TRUE
10977 BUILD_TYPE="$BUILD_TYPE XSLTML"
10978 if test "x$with_java" = "xno"; then
10979 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10982 AC_MSG_RESULT([no])
10984 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10986 AC_SUBST(ENABLE_MEDIAWIKI)
10988 AC_MSG_CHECKING([whether to build the Report Builder])
10989 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10990 AC_MSG_RESULT([yes])
10991 ENABLE_REPORTBUILDER=TRUE
10992 AC_MSG_CHECKING([which jfreereport libs to use])
10993 if test "$with_system_jfreereport" = "yes"; then
10994 SYSTEM_JFREEREPORT=TRUE
10995 AC_MSG_RESULT([external])
10996 if test -z $SAC_JAR; then
10997 SAC_JAR=/usr/share/java/sac.jar
10999 if ! test -f $SAC_JAR; then
11000 AC_MSG_ERROR(sac.jar not found.)
11003 if test -z $LIBXML_JAR; then
11004 if test -f /usr/share/java/libxml-1.0.0.jar; then
11005 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
11006 elif test -f /usr/share/java/libxml.jar; then
11007 LIBXML_JAR=/usr/share/java/libxml.jar
11009 AC_MSG_ERROR(libxml.jar replacement not found.)
11011 elif ! test -f $LIBXML_JAR; then
11012 AC_MSG_ERROR(libxml.jar not found.)
11015 if test -z $FLUTE_JAR; then
11016 if test -f/usr/share/java/flute-1.3.0.jar; then
11017 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
11018 elif test -f /usr/share/java/flute.jar; then
11019 FLUTE_JAR=/usr/share/java/flute.jar
11021 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
11023 elif ! test -f $FLUTE_JAR; then
11024 AC_MSG_ERROR(flute-1.3.0.jar not found.)
11027 if test -z $JFREEREPORT_JAR; then
11028 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
11029 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
11030 elif test -f /usr/share/java/flow-engine.jar; then
11031 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
11033 AC_MSG_ERROR(jfreereport.jar replacement not found.)
11035 elif ! test -f $JFREEREPORT_JAR; then
11036 AC_MSG_ERROR(jfreereport.jar not found.)
11039 if test -z $LIBLAYOUT_JAR; then
11040 if test -f /usr/share/java/liblayout-0.2.9.jar; then
11041 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
11042 elif test -f /usr/share/java/liblayout.jar; then
11043 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
11045 AC_MSG_ERROR(liblayout.jar replacement not found.)
11047 elif ! test -f $LIBLAYOUT_JAR; then
11048 AC_MSG_ERROR(liblayout.jar not found.)
11051 if test -z $LIBLOADER_JAR; then
11052 if test -f /usr/share/java/libloader-1.0.0.jar; then
11053 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
11054 elif test -f /usr/share/java/libloader.jar; then
11055 LIBLOADER_JAR=/usr/share/java/libloader.jar
11057 AC_MSG_ERROR(libloader.jar replacement not found.)
11059 elif ! test -f $LIBLOADER_JAR; then
11060 AC_MSG_ERROR(libloader.jar not found.)
11063 if test -z $LIBFORMULA_JAR; then
11064 if test -f /usr/share/java/libformula-0.2.0.jar; then
11065 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
11066 elif test -f /usr/share/java/libformula.jar; then
11067 LIBFORMULA_JAR=/usr/share/java/libformula.jar
11069 AC_MSG_ERROR(libformula.jar replacement not found.)
11071 elif ! test -f $LIBFORMULA_JAR; then
11072 AC_MSG_ERROR(libformula.jar not found.)
11075 if test -z $LIBREPOSITORY_JAR; then
11076 if test -f /usr/share/java/librepository-1.0.0.jar; then
11077 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
11078 elif test -f /usr/share/java/librepository.jar; then
11079 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
11081 AC_MSG_ERROR(librepository.jar replacement not found.)
11083 elif ! test -f $LIBREPOSITORY_JAR; then
11084 AC_MSG_ERROR(librepository.jar not found.)
11087 if test -z $LIBFONTS_JAR; then
11088 if test -f /usr/share/java/libfonts-1.0.0.jar; then
11089 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
11090 elif test -f /usr/share/java/libfonts.jar; then
11091 LIBFONTS_JAR=/usr/share/java/libfonts.jar
11093 AC_MSG_ERROR(libfonts.jar replacement not found.)
11095 elif ! test -f $LIBFONTS_JAR; then
11096 AC_MSG_ERROR(libfonts.jar not found.)
11099 if test -z $LIBSERIALIZER_JAR; then
11100 if test -f /usr/share/java/libserializer-1.0.0.jar; then
11101 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
11102 elif test -f /usr/share/java/libserializer.jar; then
11103 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
11105 AC_MSG_ERROR(libserializer.jar replacement not found.)
11107 elif ! test -f $LIBSERIALIZER_JAR; then
11108 AC_MSG_ERROR(libserializer.jar not found.)
11111 if test -z $LIBBASE_JAR; then
11112 if test -f /usr/share/java/libbase-1.0.0.jar; then
11113 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
11114 elif test -f /usr/share/java/libbase.jar; then
11115 LIBBASE_JAR=/usr/share/java/libbase.jar
11117 AC_MSG_ERROR(libbase.jar replacement not found.)
11119 elif ! test -f $LIBBASE_JAR; then
11120 AC_MSG_ERROR(libbase.jar not found.)
11124 AC_MSG_RESULT([internal])
11125 SYSTEM_JFREEREPORT=
11126 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
11130 AC_MSG_RESULT([no])
11131 ENABLE_REPORTBUILDER=
11132 SYSTEM_JFREEREPORT=
11134 AC_SUBST(ENABLE_REPORTBUILDER)
11135 AC_SUBST(SYSTEM_JFREEREPORT)
11137 AC_SUBST(LIBXML_JAR)
11138 AC_SUBST(FLUTE_JAR)
11139 AC_SUBST(JFREEREPORT_JAR)
11140 AC_SUBST(LIBBASE_JAR)
11141 AC_SUBST(LIBLAYOUT_JAR)
11142 AC_SUBST(LIBLOADER_JAR)
11143 AC_SUBST(LIBFORMULA_JAR)
11144 AC_SUBST(LIBREPOSITORY_JAR)
11145 AC_SUBST(LIBFONTS_JAR)
11146 AC_SUBST(LIBSERIALIZER_JAR)
11148 # this has to be here because both the Wiki Publisher and the SRB use
11150 COMMONS_LOGGING_VERSION=1.2
11151 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
11152 AC_MSG_CHECKING([which Apache commons-* libs to use])
11153 if test "$with_system_apache_commons" = "yes"; then
11154 SYSTEM_APACHE_COMMONS=TRUE
11155 AC_MSG_RESULT([external])
11156 if test -z $COMMONS_LOGGING_JAR; then
11157 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
11158 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
11159 elif test -f /usr/share/java/commons-logging.jar; then
11160 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
11162 AC_MSG_ERROR(commons-logging.jar replacement not found.)
11164 elif ! test -f $COMMONS_LOGGING_JAR; then
11165 AC_MSG_ERROR(commons-logging.jar not found.)
11168 AC_MSG_RESULT([internal])
11169 SYSTEM_APACHE_COMMONS=
11170 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
11174 AC_SUBST(SYSTEM_APACHE_COMMONS)
11175 AC_SUBST(COMMONS_LOGGING_JAR)
11176 AC_SUBST(COMMONS_LOGGING_VERSION)
11178 # scripting provider for BeanShell?
11179 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
11180 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
11181 AC_MSG_RESULT([yes])
11182 ENABLE_SCRIPTING_BEANSHELL=TRUE
11184 dnl ===================================================================
11185 dnl Check for system beanshell
11186 dnl ===================================================================
11187 AC_MSG_CHECKING([which beanshell to use])
11188 if test "$with_system_beanshell" = "yes"; then
11189 AC_MSG_RESULT([external])
11191 if test -z $BSH_JAR; then
11192 BSH_JAR=/usr/share/java/bsh.jar
11194 if ! test -f $BSH_JAR; then
11195 AC_MSG_ERROR(bsh.jar not found.)
11198 AC_MSG_RESULT([internal])
11200 BUILD_TYPE="$BUILD_TYPE BSH"
11203 AC_MSG_RESULT([no])
11204 ENABLE_SCRIPTING_BEANSHELL=
11205 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
11207 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
11208 AC_SUBST(SYSTEM_BSH)
11211 # scripting provider for JavaScript?
11212 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
11213 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
11214 AC_MSG_RESULT([yes])
11215 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
11217 dnl ===================================================================
11218 dnl Check for system rhino
11219 dnl ===================================================================
11220 AC_MSG_CHECKING([which rhino to use])
11221 if test "$with_system_rhino" = "yes"; then
11222 AC_MSG_RESULT([external])
11224 if test -z $RHINO_JAR; then
11225 RHINO_JAR=/usr/share/java/js.jar
11227 if ! test -f $RHINO_JAR; then
11228 AC_MSG_ERROR(js.jar not found.)
11231 AC_MSG_RESULT([internal])
11233 BUILD_TYPE="$BUILD_TYPE RHINO"
11237 AC_MSG_RESULT([no])
11238 ENABLE_SCRIPTING_JAVASCRIPT=
11239 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
11241 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
11242 AC_SUBST(SYSTEM_RHINO)
11243 AC_SUBST(RHINO_JAR)
11245 # This is only used in Qt5/KF5 checks to determine if /usr/lib64
11246 # paths should be added to library search path. So lets put all 64-bit
11249 case "$host_cpu" in
11250 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
11251 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
11252 supports_multilib="yes"
11259 dnl ===================================================================
11260 dnl QT5 Integration
11261 dnl ===================================================================
11267 QT5_GOBJECT_CFLAGS=""
11268 QT5_GOBJECT_LIBS=""
11269 QT5_HAVE_GOBJECT=""
11270 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11271 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11272 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11274 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11275 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11277 if test -n "$supports_multilib"; then
11278 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11281 qt5_test_include="QtWidgets/qapplication.h"
11282 qt5_test_library="libQt5Widgets.so"
11284 dnl Check for qmake5
11285 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
11286 if test "$QMAKE5" = "no"; then
11287 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11289 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11290 if test -z "$qmake5_test_ver"; then
11291 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11293 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11294 qt5_minimal_minor="6"
11295 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11296 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11298 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11302 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11303 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11305 AC_MSG_CHECKING([for Qt5 headers])
11307 for inc_dir in $qt5_incdirs; do
11308 if test -r "$inc_dir/$qt5_test_include"; then
11309 qt5_incdir="$inc_dir"
11313 AC_MSG_RESULT([$qt5_incdir])
11314 if test "x$qt5_incdir" = "xno"; then
11315 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11318 AC_MSG_CHECKING([for Qt5 libraries])
11320 for lib_dir in $qt5_libdirs; do
11321 if test -r "$lib_dir/$qt5_test_library"; then
11322 qt5_libdir="$lib_dir"
11326 AC_MSG_RESULT([$qt5_libdir])
11327 if test "x$qt5_libdir" = "xno"; then
11328 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11331 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
11332 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11333 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11335 if test "$USING_X11" = TRUE; then
11336 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
11337 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS"
11338 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS -lQt5X11Extras"
11340 AC_DEFINE(QT5_USING_X11)
11343 dnl Check for Meta Object Compiler
11345 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH] )
11346 if test "$MOC5" = "no"; then
11347 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11348 the root of your Qt installation by exporting QT5DIR before running "configure".])
11351 if test "$build_gstreamer_1_0" = "yes"; then
11352 PKG_CHECK_MODULES(QT5_GOBJECT,[gobject-2.0], [
11354 AC_DEFINE(QT5_HAVE_GOBJECT)
11356 AC_MSG_WARN([[No GObject found, can't use QWidget GStreamer sink on wayland!]])
11360 AC_SUBST(QT5_CFLAGS)
11363 AC_SUBST(QT5_GOBJECT_CFLAGS)
11364 AC_SUBST(QT5_GOBJECT_LIBS)
11365 AC_SUBST(QT5_HAVE_GOBJECT)
11367 dnl ===================================================================
11368 dnl KF5 Integration
11369 dnl ===================================================================
11373 KF5_CONFIG="kf5-config"
11374 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11375 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11377 if test "$OS" = "HAIKU"; then
11378 haiku_arch="`echo $RTL_ARCH | tr X x`"
11379 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11380 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11383 kf5_incdirs="$KF5INC /usr/include $kf5_haiku_incdirs $x_includes"
11384 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11385 if test -n "$supports_multilib"; then
11386 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11389 kf5_test_include="KF5/kcoreaddons_version.h"
11390 kf5_test_library="libKF5CoreAddons.so"
11391 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11393 dnl kf5 KDE4 support compatibility installed
11394 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11395 if test "$KF5_CONFIG" != "no"; then
11396 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11397 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11400 dnl Check for KF5 headers
11401 AC_MSG_CHECKING([for KF5 headers])
11403 for kf5_check in $kf5_incdirs; do
11404 if test -r "$kf5_check/$kf5_test_include"; then
11405 kf5_incdir="$kf5_check/KF5"
11409 AC_MSG_RESULT([$kf5_incdir])
11410 if test "x$kf5_incdir" = "xno"; then
11411 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11414 dnl Check for KF5 libraries
11415 AC_MSG_CHECKING([for KF5 libraries])
11417 for kf5_check in $kf5_libdirs; do
11418 if test -r "$kf5_check/$kf5_test_library"; then
11419 kf5_libdir="$kf5_check"
11424 AC_MSG_RESULT([$kf5_libdir])
11425 if test "x$kf5_libdir" = "xno"; then
11426 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11429 KF5_CFLAGS="-I$kf5_incdir -I$kf5_incdir/KCoreAddons -I$kf5_incdir/KI18n -I$kf5_incdir/KConfigCore -I$kf5_incdir/KWindowSystem -I$kf5_incdir/KIOCore -I$kf5_incdir/KIOWidgets -I$kf5_incdir/KIOFileWidgets -I$qt5_incdir -I$qt5_incdir/QtCore -I$qt5_incdir/QtGui -I$qt5_incdir/QtWidgets -I$qt5_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
11430 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11431 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11433 if test "$USING_X11" = TRUE; then
11434 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11437 AC_LANG_PUSH([C++])
11438 save_CXXFLAGS=$CXXFLAGS
11439 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11440 AC_MSG_CHECKING([whether KDE is >= 5.0])
11441 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11442 #include <kcoreaddons_version.h>
11444 int main(int argc, char **argv) {
11445 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11448 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11449 CXXFLAGS=$save_CXXFLAGS
11452 AC_SUBST(KF5_CFLAGS)
11455 dnl ===================================================================
11456 dnl Test whether to include Evolution 2 support
11457 dnl ===================================================================
11458 AC_MSG_CHECKING([whether to enable evolution 2 support])
11459 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11460 AC_MSG_RESULT([yes])
11461 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11462 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11463 FilterLibs "${GOBJECT_LIBS}"
11464 GOBJECT_LIBS="${filteredlibs}"
11465 ENABLE_EVOAB2="TRUE"
11468 AC_MSG_RESULT([no])
11470 AC_SUBST(ENABLE_EVOAB2)
11471 AC_SUBST(GOBJECT_CFLAGS)
11472 AC_SUBST(GOBJECT_LIBS)
11474 dnl ===================================================================
11475 dnl Test which themes to include
11476 dnl ===================================================================
11477 AC_MSG_CHECKING([which themes to include])
11478 # if none given use default subset of available themes
11479 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11480 with_theme="breeze breeze_dark breeze_svg colibre colibre_svg elementary elementary_svg karasa_jaga sifr sifr_svg sifr_dark tango"
11484 if test "x$with_theme" != "xno"; then
11485 for theme in $with_theme; do
11487 breeze|breeze_dark|breeze_svg|colibre|colibre_svg|elementary|elementary_svg|karasa_jaga|sifr|sifr_svg|sifr_dark|tango) real_theme="$theme" ;;
11488 default) real_theme=colibre ;;
11489 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11491 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11494 AC_MSG_RESULT([$WITH_THEMES])
11495 AC_SUBST([WITH_THEMES])
11496 # FIXME: remove this, and the convenience default->colibre remapping after a grace period
11497 for theme in $with_theme; do
11499 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11504 dnl ===================================================================
11505 dnl Test whether to integrate helppacks into the product's installer
11506 dnl ===================================================================
11507 AC_MSG_CHECKING([for helppack integration])
11508 if test "$with_helppack_integration" = "no"; then
11509 AC_MSG_RESULT([no integration])
11511 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11512 AC_MSG_RESULT([integration])
11515 ###############################################################################
11516 # Extensions checking
11517 ###############################################################################
11518 AC_MSG_CHECKING([for extensions integration])
11519 if test "x$enable_extension_integration" != "xno"; then
11520 WITH_EXTENSION_INTEGRATION=TRUE
11521 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11522 AC_MSG_RESULT([yes, use integration])
11524 WITH_EXTENSION_INTEGRATION=
11525 AC_MSG_RESULT([no, do not integrate])
11527 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11529 dnl Should any extra extensions be included?
11530 dnl There are standalone tests for each of these below.
11531 WITH_EXTRA_EXTENSIONS=
11532 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11534 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11535 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11536 if test "x$with_java" != "xno"; then
11537 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11538 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11541 AC_MSG_CHECKING([whether to build opens___.ttf])
11542 if test "$enable_build_opensymbol" = "yes"; then
11543 AC_MSG_RESULT([yes])
11544 AC_PATH_PROG(FONTFORGE, fontforge)
11545 if test -z "$FONTFORGE"; then
11546 AC_MSG_ERROR([fontforge not installed])
11549 AC_MSG_RESULT([no])
11550 OPENSYMBOL_TTF=884ed41809687c3e168fc7c19b16585149ff058eca79acbf3ee784f6630704cc-opens___.ttf
11551 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11553 AC_SUBST(OPENSYMBOL_TTF)
11554 AC_SUBST(FONTFORGE)
11556 dnl ===================================================================
11557 dnl Test whether to include fonts
11558 dnl ===================================================================
11559 AC_MSG_CHECKING([whether to include third-party fonts])
11560 if test "$with_fonts" != "no"; then
11561 AC_MSG_RESULT([yes])
11563 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11564 AC_DEFINE(HAVE_MORE_FONTS)
11566 AC_MSG_RESULT([no])
11568 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11570 AC_SUBST(WITH_FONTS)
11573 dnl ===================================================================
11574 dnl Test whether to enable online update service
11575 dnl ===================================================================
11576 AC_MSG_CHECKING([whether to enable online update])
11577 ENABLE_ONLINE_UPDATE=
11578 ENABLE_ONLINE_UPDATE_MAR=
11580 if test "$enable_online_update" = ""; then
11581 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11582 AC_MSG_RESULT([yes])
11583 ENABLE_ONLINE_UPDATE="TRUE"
11585 AC_MSG_RESULT([no])
11588 if test "$enable_online_update" = "mar"; then
11589 AC_MSG_RESULT([yes - MAR-based online update])
11590 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11591 if test "$with_update_config" = ""; then
11592 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11594 UPDATE_CONFIG="$with_update_config"
11595 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11596 elif test "$enable_online_update" = "yes"; then
11597 AC_MSG_RESULT([yes])
11598 ENABLE_ONLINE_UPDATE="TRUE"
11600 AC_MSG_RESULT([no])
11603 AC_SUBST(ENABLE_ONLINE_UPDATE)
11604 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11605 AC_SUBST(UPDATE_CONFIG)
11607 dnl ===================================================================
11608 dnl Test whether we need bzip2
11609 dnl ===================================================================
11611 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11612 AC_MSG_CHECKING([whether to use system bzip2])
11613 if test "$with_system_bzip2" = yes; then
11615 AC_MSG_RESULT([yes])
11616 PKG_CHECK_MODULES(BZIP2, bzip2)
11617 FilterLibs "${BZIP2_LIBS}"
11618 BZIP2_LIBS="${filteredlibs}"
11620 AC_MSG_RESULT([no])
11621 BUILD_TYPE="$BUILD_TYPE BZIP2"
11624 AC_SUBST(SYSTEM_BZIP2)
11625 AC_SUBST(BZIP2_CFLAGS)
11626 AC_SUBST(BZIP2_LIBS)
11628 dnl ===================================================================
11629 dnl Test whether to enable extension update
11630 dnl ===================================================================
11631 AC_MSG_CHECKING([whether to enable extension update])
11632 ENABLE_EXTENSION_UPDATE=
11633 if test "x$enable_extension_update" = "xno"; then
11634 AC_MSG_RESULT([no])
11636 AC_MSG_RESULT([yes])
11637 ENABLE_EXTENSION_UPDATE="TRUE"
11638 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11639 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11641 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11644 dnl ===================================================================
11645 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11646 dnl ===================================================================
11647 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11648 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11649 AC_MSG_RESULT([no])
11652 AC_MSG_RESULT([yes])
11653 ENABLE_SILENT_MSI=TRUE
11654 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11656 AC_SUBST(ENABLE_SILENT_MSI)
11658 AC_MSG_CHECKING([whether and how to use Xinerama])
11659 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11660 if test "$x_libraries" = "default_x_libraries"; then
11661 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11662 if test "x$XINERAMALIB" = x; then
11663 XINERAMALIB="/usr/lib"
11666 XINERAMALIB="$x_libraries"
11668 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11669 # we have both versions, let the user decide but use the dynamic one
11672 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11673 XINERAMA_LINK=dynamic
11675 XINERAMA_LINK=static
11677 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11678 # we have only the dynamic version
11680 XINERAMA_LINK=dynamic
11681 elif test -e "$XINERAMALIB/libXinerama.a"; then
11683 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11685 XINERAMA_LINK=static
11695 if test "$USE_XINERAMA" = "TRUE"; then
11696 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11697 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11698 [AC_MSG_ERROR(Xinerama header not found.)], [])
11699 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11700 if test "x$XEXTLIB" = x; then
11701 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11703 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11704 if test "$_os" = "FreeBSD"; then
11705 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11707 if test "$_os" = "Linux"; then
11708 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11710 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11711 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11713 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11718 AC_MSG_RESULT([no])
11720 AC_SUBST(USE_XINERAMA)
11721 AC_SUBST(XINERAMA_LINK)
11723 dnl ===================================================================
11724 dnl Test whether to build cairo or rely on the system version
11725 dnl ===================================================================
11727 if test "$USING_X11" = TRUE; then
11728 # Used in vcl/Library_vclplug_gen.mk
11732 if test "$test_cairo" = "yes"; then
11733 AC_MSG_CHECKING([whether to use the system cairo])
11735 : ${with_system_cairo:=$with_system_libs}
11736 if test "$with_system_cairo" = "yes"; then
11738 AC_MSG_RESULT([yes])
11740 PKG_CHECK_MODULES( CAIRO, cairo >= 1.8.0 )
11741 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11742 FilterLibs "${CAIRO_LIBS}"
11743 CAIRO_LIBS="${filteredlibs}"
11745 if test "$test_xrender" = "yes"; then
11746 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11748 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11749 #ifdef PictStandardA8
11753 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11759 AC_MSG_RESULT([no])
11761 BUILD_TYPE="$BUILD_TYPE CAIRO"
11765 AC_SUBST(SYSTEM_CAIRO)
11766 AC_SUBST(CAIRO_CFLAGS)
11767 AC_SUBST(CAIRO_LIBS)
11769 dnl ===================================================================
11770 dnl Test whether to use avahi
11771 dnl ===================================================================
11772 if test "$_os" = "WINNT"; then
11773 # Windows uses bundled mDNSResponder
11774 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11775 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11776 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11777 [ENABLE_AVAHI="TRUE"])
11778 AC_DEFINE(HAVE_FEATURE_AVAHI)
11779 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11780 FilterLibs "${AVAHI_LIBS}"
11781 AVAHI_LIBS="${filteredlibs}"
11784 AC_SUBST(ENABLE_AVAHI)
11785 AC_SUBST(AVAHI_CFLAGS)
11786 AC_SUBST(AVAHI_LIBS)
11788 dnl ===================================================================
11789 dnl Test whether to use liblangtag
11790 dnl ===================================================================
11792 AC_MSG_CHECKING([whether to use system liblangtag])
11793 if test "$with_system_liblangtag" = yes; then
11794 SYSTEM_LIBLANGTAG=TRUE
11795 AC_MSG_RESULT([yes])
11796 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11797 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11798 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11799 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11800 FilterLibs "${LIBLANGTAG_LIBS}"
11801 LIBLANGTAG_LIBS="${filteredlibs}"
11804 AC_MSG_RESULT([no])
11805 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11806 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
11807 if test "$COM" = "MSC"; then
11808 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
11810 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
11813 AC_SUBST(SYSTEM_LIBLANGTAG)
11814 AC_SUBST(LIBLANGTAG_CFLAGS)
11815 AC_SUBST(LIBLANGTAG_LIBS)
11817 dnl ===================================================================
11818 dnl Test whether to build libpng or rely on the system version
11819 dnl ===================================================================
11821 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
11823 dnl ===================================================================
11824 dnl Check for runtime JVM search path
11825 dnl ===================================================================
11826 if test "$ENABLE_JAVA" != ""; then
11827 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11828 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11829 AC_MSG_RESULT([yes])
11830 if ! test -d "$with_jvm_path"; then
11831 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11833 if ! test -d "$with_jvm_path"jvm; then
11834 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11836 JVM_ONE_PATH_CHECK="$with_jvm_path"
11837 AC_SUBST(JVM_ONE_PATH_CHECK)
11839 AC_MSG_RESULT([no])
11843 dnl ===================================================================
11844 dnl Test for the presence of Ant and that it works
11845 dnl ===================================================================
11847 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
11848 ANT_HOME=; export ANT_HOME
11849 WITH_ANT_HOME=; export WITH_ANT_HOME
11850 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11851 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11852 if test "$_os" = "WINNT"; then
11853 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11855 with_ant_home="$LODE_HOME/opt/ant"
11857 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11858 with_ant_home="$LODE_HOME/opt/ant"
11861 if test -z "$with_ant_home"; then
11862 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
11864 if test "$_os" = "WINNT"; then
11865 # AC_PATH_PROGS needs unix path
11866 with_ant_home=`cygpath -u "$with_ant_home"`
11868 AbsolutePath "$with_ant_home"
11869 with_ant_home=$absolute_path
11870 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11871 WITH_ANT_HOME=$with_ant_home
11872 ANT_HOME=$with_ant_home
11875 if test -z "$ANT"; then
11876 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11878 # resolve relative or absolute symlink
11879 while test -h "$ANT"; do
11881 a_basename=`basename "$ANT"`
11882 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11883 cd "`dirname "$ANT"`"
11884 cd "`dirname "$a_script"`"
11885 ANT="`pwd`"/"`basename "$a_script"`"
11889 AC_MSG_CHECKING([if $ANT works])
11890 mkdir -p conftest.dir
11893 cat > conftest.java << EOF
11894 public class conftest {
11895 int testmethod(int a, int b) {
11901 cat > conftest.xml << EOF
11902 <project name="conftest" default="conftest">
11903 <target name="conftest">
11904 <javac srcdir="." includes="conftest.java">
11910 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
11911 if test $? = 0 -a -f ./conftest.class; then
11912 AC_MSG_RESULT([Ant works])
11913 if test -z "$WITH_ANT_HOME"; then
11914 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11915 if test -z "$ANT_HOME"; then
11916 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11919 ANT_HOME="$WITH_ANT_HOME"
11922 echo "configure: Ant test failed" >&5
11923 cat conftest.java >&5
11924 cat conftest.xml >&5
11925 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
11928 rm -fr conftest.dir
11930 if test -z "$ANT_HOME"; then
11931 ANT_HOME="NO_ANT_HOME"
11933 PathFormat "$ANT_HOME"
11934 ANT_HOME="$formatted_path"
11936 ANT="$formatted_path"
11941 dnl Checking for ant.jar
11942 if test "$ANT_HOME" != "NO_ANT_HOME"; then
11943 AC_MSG_CHECKING([Ant lib directory])
11944 if test -f $ANT_HOME/lib/ant.jar; then
11945 ANT_LIB="$ANT_HOME/lib"
11947 if test -f $ANT_HOME/ant.jar; then
11948 ANT_LIB="$ANT_HOME"
11950 if test -f /usr/share/java/ant.jar; then
11951 ANT_LIB=/usr/share/java
11953 if test -f /usr/share/ant-core/lib/ant.jar; then
11954 ANT_LIB=/usr/share/ant-core/lib
11956 if test -f $ANT_HOME/lib/ant/ant.jar; then
11957 ANT_LIB="$ANT_HOME/lib/ant"
11959 if test -f /usr/share/lib/ant/ant.jar; then
11960 ANT_LIB=/usr/share/lib/ant
11962 AC_MSG_ERROR([Ant libraries not found!])
11969 PathFormat "$ANT_LIB"
11970 ANT_LIB="$formatted_path"
11971 AC_MSG_RESULT([Ant lib directory found.])
11976 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11978 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11979 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11980 ant_version_major=`echo $ant_version | cut -d. -f1`
11981 ant_version_minor=`echo $ant_version | cut -d. -f2`
11982 echo "configure: ant_version $ant_version " >&5
11983 echo "configure: ant_version_major $ant_version_major " >&5
11984 echo "configure: ant_version_minor $ant_version_minor " >&5
11985 if test "$ant_version_major" -ge "2"; then
11986 AC_MSG_RESULT([yes, $ant_version])
11987 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11988 AC_MSG_RESULT([yes, $ant_version])
11990 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11993 rm -f conftest* core core.* *.core
11997 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11998 AC_MSG_CHECKING([for JUnit 4])
11999 if test "$with_junit" = "yes"; then
12000 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
12001 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
12002 elif test -e /usr/share/java/junit4.jar; then
12003 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
12005 if test -e /usr/share/lib/java/junit.jar; then
12006 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
12008 OOO_JUNIT_JAR=/usr/share/java/junit.jar
12012 OOO_JUNIT_JAR=$with_junit
12014 if test "$_os" = "WINNT"; then
12015 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
12017 printf 'import org.junit.Before;' > conftest.java
12018 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12019 AC_MSG_RESULT([$OOO_JUNIT_JAR])
12022 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
12023 specify its pathname via --with-junit=..., or disable it via --without-junit])
12025 rm -f conftest.class conftest.java
12026 if test $OOO_JUNIT_JAR != ""; then
12027 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
12030 AC_SUBST(OOO_JUNIT_JAR)
12033 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12034 AC_MSG_CHECKING([for included Hamcrest])
12035 printf 'import org.hamcrest.BaseDescription;' > conftest.java
12036 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12037 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
12039 AC_MSG_RESULT([Not included])
12040 AC_MSG_CHECKING([for standalone hamcrest jar.])
12041 if test "$with_hamcrest" = "yes"; then
12042 if test -e /usr/share/lib/java/hamcrest.jar; then
12043 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
12044 elif test -e /usr/share/java/hamcrest/core.jar; then
12045 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
12047 HAMCREST_JAR=/usr/share/java/hamcrest.jar
12050 HAMCREST_JAR=$with_hamcrest
12052 if test "$_os" = "WINNT"; then
12053 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
12055 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
12056 AC_MSG_RESULT([$HAMCREST_JAR])
12058 AC_MSG_ERROR([junit does not contain hamcrest; please use a junit jar that includes hamcrest, install a hamcrest jar in the default location (/usr/share/java),
12059 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
12062 rm -f conftest.class conftest.java
12064 AC_SUBST(HAMCREST_JAR)
12070 # check for wget and curl
12075 if test "$enable_fetch_external" != "no"; then
12077 CURL=`which curl 2>/dev/null`
12079 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12081 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
12082 if test $? -eq 0; then
12088 if test -z "$WGET" -a -z "$CURL"; then
12089 AC_MSG_ERROR([neither wget nor curl found!])
12098 # check for sha256sum
12102 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
12103 eval "$i -a 256 --version" > /dev/null 2>&1
12105 if test $ret -eq 0; then
12106 SHA256SUM="$i -a 256"
12111 if test -z "$SHA256SUM"; then
12112 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
12113 eval "$i --version" > /dev/null 2>&1
12115 if test $ret -eq 0; then
12122 if test -z "$SHA256SUM"; then
12123 AC_MSG_ERROR([no sha256sum found!])
12126 AC_SUBST(SHA256SUM)
12128 dnl ===================================================================
12129 dnl Dealing with l10n options
12130 dnl ===================================================================
12131 AC_MSG_CHECKING([which languages to be built])
12132 # get list of all languages
12133 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12134 # the sed command does the following:
12135 # + if a line ends with a backslash, append the next line to it
12136 # + adds " on the beginning of the value (after =)
12137 # + adds " at the end of the value
12138 # + removes en-US; we want to put it on the beginning
12139 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12140 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' $SRC_ROOT/solenv/inc/langlist.mk)]
12141 ALL_LANGS="en-US $completelangiso"
12142 # check the configured localizations
12143 WITH_LANG="$with_lang"
12145 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
12146 # (Norwegian is "nb" and "nn".)
12147 if test "$WITH_LANG" = "no"; then
12151 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12152 AC_MSG_RESULT([en-US])
12154 AC_MSG_RESULT([$WITH_LANG])
12155 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12156 if test -z "$MSGFMT"; then
12157 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12158 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12159 elif test -x "/opt/lo/bin/msgfmt"; then
12160 MSGFMT="/opt/lo/bin/msgfmt"
12162 AC_CHECK_PROGS(MSGFMT, [msgfmt])
12163 if test -z "$MSGFMT"; then
12164 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12168 if test -z "$MSGUNIQ"; then
12169 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12170 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12171 elif test -x "/opt/lo/bin/msguniq"; then
12172 MSGUNIQ="/opt/lo/bin/msguniq"
12174 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12175 if test -z "$MSGUNIQ"; then
12176 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12183 # check that the list is valid
12184 for lang in $WITH_LANG; do
12185 test "$lang" = "ALL" && continue
12186 # need to check for the exact string, so add space before and after the list of all languages
12187 for vl in $ALL_LANGS; do
12188 if test "$vl" = "$lang"; then
12192 if test "$vl" != "$lang"; then
12193 # if you're reading this - you prolly quoted your languages remove the quotes ...
12194 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12197 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12198 echo $WITH_LANG | grep -q en-US
12199 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12201 # list with substituted ALL
12202 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12203 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12204 test "$WITH_LANG" = "en-US" && WITH_LANG=
12205 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12206 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12207 ALL_LANGS=`echo $ALL_LANGS qtz`
12209 AC_SUBST(ALL_LANGS)
12210 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12211 AC_SUBST(WITH_LANG)
12212 AC_SUBST(WITH_LANG_LIST)
12213 AC_SUBST(GIT_NEEDED_SUBMODULES)
12215 WITH_POOR_HELP_LOCALIZATIONS=
12216 if test -d "$SRC_ROOT/translations/source"; then
12217 for l in `ls -1 $SRC_ROOT/translations/source`; do
12218 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12219 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12223 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12225 if test -n "$with_locales"; then
12226 WITH_LOCALES="$with_locales"
12228 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12229 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12230 # config_host/config_locales.h.in
12231 for locale in $WITH_LOCALES; do
12234 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12238 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12241 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12246 AC_DEFINE(WITH_LOCALE_ALL)
12248 AC_SUBST(WITH_LOCALES)
12250 dnl git submodule update --reference
12251 dnl ===================================================================
12252 if test -n "${GIT_REFERENCE_SRC}"; then
12253 for repo in ${GIT_NEEDED_SUBMODULES}; do
12254 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12255 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12259 AC_SUBST(GIT_REFERENCE_SRC)
12261 dnl git submodules linked dirs
12262 dnl ===================================================================
12263 if test -n "${GIT_LINK_SRC}"; then
12264 for repo in ${GIT_NEEDED_SUBMODULES}; do
12265 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12266 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12270 AC_SUBST(GIT_LINK_SRC)
12273 dnl ===================================================================
12274 AC_MSG_CHECKING([for alternative branding images directory])
12275 # initialize mapped arrays
12276 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12277 brand_files="$BRAND_INTRO_IMAGES about.svg"
12279 if test -z "$with_branding" -o "$with_branding" = "no"; then
12280 AC_MSG_RESULT([none])
12281 DEFAULT_BRAND_IMAGES="$brand_files"
12283 if ! test -d $with_branding ; then
12284 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12286 AC_MSG_RESULT([$with_branding])
12287 CUSTOM_BRAND_DIR="$with_branding"
12288 for lfile in $brand_files
12290 if ! test -f $with_branding/$lfile ; then
12291 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12292 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12294 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12297 check_for_progress="yes"
12300 AC_SUBST([BRAND_INTRO_IMAGES])
12301 AC_SUBST([CUSTOM_BRAND_DIR])
12302 AC_SUBST([CUSTOM_BRAND_IMAGES])
12303 AC_SUBST([DEFAULT_BRAND_IMAGES])
12306 AC_MSG_CHECKING([for 'intro' progress settings])
12310 PROGRESSFRAMECOLOR=
12312 PROGRESSTEXTBASELINE=
12314 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12315 source "$with_branding/progress.conf"
12316 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12318 AC_MSG_RESULT([none])
12321 AC_SUBST(PROGRESSBARCOLOR)
12322 AC_SUBST(PROGRESSSIZE)
12323 AC_SUBST(PROGRESSPOSITION)
12324 AC_SUBST(PROGRESSFRAMECOLOR)
12325 AC_SUBST(PROGRESSTEXTCOLOR)
12326 AC_SUBST(PROGRESSTEXTBASELINE)
12329 AC_MSG_CHECKING([for extra build ID])
12330 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12331 EXTRA_BUILDID="$with_extra_buildid"
12333 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12334 if test -n "$EXTRA_BUILDID" ; then
12335 AC_MSG_RESULT([$EXTRA_BUILDID])
12337 AC_MSG_RESULT([not set])
12339 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12342 AC_MSG_CHECKING([for vendor])
12343 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12344 OOO_VENDOR="$USERNAME"
12346 if test -z "$OOO_VENDOR"; then
12350 if test -z "$OOO_VENDOR"; then
12351 OOO_VENDOR="`id -u -n`"
12354 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12356 OOO_VENDOR="$with_vendor"
12357 AC_MSG_RESULT([$OOO_VENDOR])
12359 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12360 AC_SUBST(OOO_VENDOR)
12362 if test "$_os" = "Android" ; then
12363 ANDROID_PACKAGE_NAME=
12364 AC_MSG_CHECKING([for Android package name])
12365 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12366 if test -n "$ENABLE_DEBUG"; then
12367 # Default to the package name that makes ndk-gdb happy.
12368 ANDROID_PACKAGE_NAME="org.libreoffice"
12370 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12373 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12375 ANDROID_PACKAGE_NAME="$with_android_package_name"
12376 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12378 AC_SUBST(ANDROID_PACKAGE_NAME)
12381 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12382 if test "$with_compat_oowrappers" = "yes"; then
12383 WITH_COMPAT_OOWRAPPERS=TRUE
12386 WITH_COMPAT_OOWRAPPERS=
12389 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12391 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12392 AC_MSG_CHECKING([for install dirname])
12393 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12394 INSTALLDIRNAME="$with_install_dirname"
12396 AC_MSG_RESULT([$INSTALLDIRNAME])
12397 AC_SUBST(INSTALLDIRNAME)
12399 AC_MSG_CHECKING([for prefix])
12400 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12401 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12402 PREFIXDIR="$prefix"
12403 AC_MSG_RESULT([$PREFIXDIR])
12404 AC_SUBST(PREFIXDIR)
12406 LIBDIR=[$(eval echo $(eval echo $libdir))]
12409 DATADIR=[$(eval echo $(eval echo $datadir))]
12412 MANDIR=[$(eval echo $(eval echo $mandir))]
12415 DOCDIR=[$(eval echo $(eval echo $docdir))]
12418 BINDIR=[$(eval echo $(eval echo $bindir))]
12421 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12422 AC_SUBST(INSTALLDIR)
12424 TESTINSTALLDIR="${BUILDDIR}/test-install"
12425 AC_SUBST(TESTINSTALLDIR)
12428 # ===================================================================
12429 # OAuth2 id and secrets
12430 # ===================================================================
12432 AC_MSG_CHECKING([for Google Drive client id and secret])
12433 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12434 AC_MSG_RESULT([not set])
12435 GDRIVE_CLIENT_ID="\"\""
12436 GDRIVE_CLIENT_SECRET="\"\""
12438 AC_MSG_RESULT([set])
12439 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12440 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12442 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12443 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12445 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12446 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12447 AC_MSG_RESULT([not set])
12448 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12449 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12451 AC_MSG_RESULT([set])
12452 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12453 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12455 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12456 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12458 AC_MSG_CHECKING([for OneDrive client id and secret])
12459 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12460 AC_MSG_RESULT([not set])
12461 ONEDRIVE_CLIENT_ID="\"\""
12462 ONEDRIVE_CLIENT_SECRET="\"\""
12464 AC_MSG_RESULT([set])
12465 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12466 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12468 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12469 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12472 dnl ===================================================================
12473 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12474 dnl --enable-dependency-tracking configure option
12475 dnl ===================================================================
12476 AC_MSG_CHECKING([whether to enable dependency tracking])
12477 if test "$enable_dependency_tracking" = "no"; then
12479 AC_MSG_RESULT([no])
12481 AC_MSG_RESULT([yes])
12485 dnl ===================================================================
12486 dnl Number of CPUs to use during the build
12487 dnl ===================================================================
12488 AC_MSG_CHECKING([for number of processors to use])
12489 # plain --with-parallelism is just the default
12490 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12491 if test "$with_parallelism" = "no"; then
12494 PARALLELISM=$with_parallelism
12497 if test "$enable_icecream" = "yes"; then
12502 Darwin|FreeBSD|NetBSD|OpenBSD)
12503 PARALLELISM=`sysctl -n hw.ncpu`
12507 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12509 # what else than above does profit here *and* has /proc?
12511 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12515 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12516 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12520 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12521 if test -z "$with_parallelism"; then
12522 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12523 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12526 add_warning "make 3.81 is prone to crashes with parallelism > 1. Since --with-parallelism was explicitly given, it is honored, but do not complain when make segfaults on you."
12530 if test $PARALLELISM -eq 0; then
12531 AC_MSG_RESULT([explicit make -j option needed])
12533 AC_MSG_RESULT([$PARALLELISM])
12535 AC_SUBST(PARALLELISM)
12537 IWYU_PATH="$with_iwyu"
12538 AC_SUBST(IWYU_PATH)
12539 if test ! -z "$IWYU_PATH"; then
12540 if test ! -f "$IWYU_PATH"; then
12541 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12546 # Set up ILIB for MSVC build
12549 if test "$build_os" = "cygwin"; then
12551 if test -n "$JAVA_HOME"; then
12552 ILIB="$ILIB;$JAVA_HOME/lib"
12555 if test "$BITNESS_OVERRIDE" = 64; then
12556 ILIB="$ILIB;$COMPATH/lib/x64"
12557 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12558 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12559 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12560 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12561 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12562 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12564 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12565 ucrtlibpath_formatted=$formatted_path
12566 ILIB="$ILIB;$ucrtlibpath_formatted"
12567 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12569 ILIB="$ILIB;$COMPATH/lib/x86"
12570 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12571 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12572 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12573 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12574 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12575 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12577 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12578 ucrtlibpath_formatted=$formatted_path
12579 ILIB="$ILIB;$ucrtlibpath_formatted"
12580 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12582 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12583 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12585 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12591 # ===================================================================
12592 # Creating bigger shared library to link against
12593 # ===================================================================
12594 AC_MSG_CHECKING([whether to create huge library])
12597 if test $_os = iOS -o $_os = Android; then
12598 # Never any point in mergelibs for these as we build just static
12599 # libraries anyway...
12600 enable_mergelibs=no
12603 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12604 if test $_os != Linux -a $_os != WINNT; then
12605 add_warning "--enable-mergelibs is not tested for this platform"
12608 AC_MSG_RESULT([yes])
12610 AC_MSG_RESULT([no])
12612 AC_SUBST([MERGELIBS])
12614 dnl ===================================================================
12615 dnl icerun is a wrapper that stops us spawning tens of processes
12616 dnl locally - for tools that can't be executed on the compile cluster
12617 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12618 dnl ===================================================================
12619 AC_MSG_CHECKING([whether to use icerun wrapper])
12621 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12622 ICECREAM_RUN=icerun
12623 AC_MSG_RESULT([yes])
12625 AC_MSG_RESULT([no])
12627 AC_SUBST(ICECREAM_RUN)
12629 dnl ===================================================================
12630 dnl Setup the ICECC_VERSION for the build the same way it was set for
12631 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12632 dnl ===================================================================
12633 x_ICECC_VERSION=[\#]
12634 if test -n "$ICECC_VERSION" ; then
12637 AC_SUBST(x_ICECC_VERSION)
12638 AC_SUBST(ICECC_VERSION)
12640 dnl ===================================================================
12642 AC_MSG_CHECKING([MPL subset])
12645 if test "$enable_mpl_subset" = "yes"; then
12647 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12649 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12652 if test "$warn_report" = "true"; then
12653 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12655 if test "x$enable_postgresql_sdbc" != "xno"; then
12656 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12658 if test "$enable_lotuswordpro" = "yes"; then
12659 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12661 if test "$WITH_WEBDAV" = "neon"; then
12662 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12664 if test -n "$ENABLE_POPPLER"; then
12665 if test "x$SYSTEM_POPPLER" = "x"; then
12666 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12669 # cf. m4/libo_check_extension.m4
12670 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12671 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12673 for theme in $WITH_THEMES; do
12675 breeze|breeze_dark|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg) #blacklist of icon themes under GPL or LGPL
12676 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12681 ENABLE_OPENGL_TRANSITIONS=
12683 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12684 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12688 AC_DEFINE(MPL_HAVE_SUBSET)
12689 AC_MSG_RESULT([only])
12691 AC_MSG_RESULT([no restrictions])
12693 AC_SUBST(MPL_SUBSET)
12695 dnl ===================================================================
12697 AC_MSG_CHECKING([formula logger])
12698 ENABLE_FORMULA_LOGGER=
12700 if test "x$enable_formula_logger" = "xyes"; then
12701 AC_MSG_RESULT([yes])
12702 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12703 ENABLE_FORMULA_LOGGER=TRUE
12704 elif test -n "$ENABLE_DBGUTIL" ; then
12705 AC_MSG_RESULT([yes])
12706 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12707 ENABLE_FORMULA_LOGGER=TRUE
12709 AC_MSG_RESULT([no])
12712 AC_SUBST(ENABLE_FORMULA_LOGGER)
12714 dnl ===================================================================
12715 dnl Setting up the environment.
12716 dnl ===================================================================
12717 AC_MSG_NOTICE([setting up the build environment variables...])
12721 if test "$build_os" = "cygwin"; then
12722 if test -d "$COMPATH/atlmfc/lib/spectre"; then
12723 ATL_LIB="$COMPATH/atlmfc/lib/spectre"
12724 ATL_INCLUDE="$COMPATH/atlmfc/include"
12725 elif test -d "$COMPATH/atlmfc/lib"; then
12726 ATL_LIB="$COMPATH/atlmfc/lib"
12727 ATL_INCLUDE="$COMPATH/atlmfc/include"
12729 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12730 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12732 if test "$BITNESS_OVERRIDE" = 64; then
12733 ATL_LIB="$ATL_LIB/x64"
12735 ATL_LIB="$ATL_LIB/x86"
12737 ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
12738 ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
12740 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12741 PathFormat "/usr/bin/find.exe"
12742 FIND="$formatted_path"
12743 PathFormat "/usr/bin/sort.exe"
12744 SORT="$formatted_path"
12745 PathFormat "/usr/bin/grep.exe"
12746 WIN_GREP="$formatted_path"
12747 PathFormat "/usr/bin/ls.exe"
12748 WIN_LS="$formatted_path"
12749 PathFormat "/usr/bin/touch.exe"
12750 WIN_TOUCH="$formatted_path"
12756 AC_SUBST(ATL_INCLUDE)
12762 AC_SUBST(WIN_TOUCH)
12764 AC_SUBST(BUILD_TYPE)
12769 PERL="$formatted_path"
12772 if test -n "$TMPDIR"; then
12773 TEMP_DIRECTORY="$TMPDIR"
12775 TEMP_DIRECTORY="/tmp"
12777 if test "$build_os" = "cygwin"; then
12778 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12780 AC_SUBST(TEMP_DIRECTORY)
12782 # setup the PATH for the environment
12783 if test -n "$LO_PATH_FOR_BUILD"; then
12784 LO_PATH="$LO_PATH_FOR_BUILD"
12790 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12791 if test "$ENABLE_JAVA" != ""; then
12792 pathmunge "$JAVA_HOME/bin" "after"
12797 # Win32 make needs native paths
12798 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12799 LO_PATH=`cygpath -p -m "$PATH"`
12801 if test "$BITNESS_OVERRIDE" = 64; then
12802 # needed for msi packaging
12803 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12805 # .NET 4.6 and higher don't have bin directory
12806 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
12807 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12809 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12810 pathmunge "$CSC_PATH" "before"
12811 pathmunge "$MIDL_PATH" "before"
12812 pathmunge "$AL_PATH" "before"
12813 pathmunge "$MSPDB_PATH" "before"
12814 if test "$MSPDB_PATH" != "$CL_PATH" ; then
12815 pathmunge "$CL_PATH" "before"
12817 if test -n "$MSBUILD_PATH" ; then
12818 pathmunge "$MSBUILD_PATH" "before"
12820 if test "$BITNESS_OVERRIDE" = 64; then
12821 pathmunge "$COMPATH/bin/amd64" "before"
12822 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
12824 pathmunge "$COMPATH/bin" "before"
12825 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12827 if test "$ENABLE_JAVA" != ""; then
12828 if test -d "$JAVA_HOME/jre/bin/client"; then
12829 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12831 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12832 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12834 pathmunge "$JAVA_HOME/bin" "before"
12839 pathmunge "/usr/css/bin" "before"
12840 if test "$ENABLE_JAVA" != ""; then
12841 pathmunge "$JAVA_HOME/bin" "after"
12851 # Generate a configuration sha256 we can use for deps
12852 if test -f config_host.mk; then
12853 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
12855 if test -f config_host_lang.mk; then
12856 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
12859 CFLAGS=$my_original_CFLAGS
12860 CXXFLAGS=$my_original_CXXFLAGS
12861 CPPFLAGS=$my_original_CPPFLAGS
12863 AC_CONFIG_FILES([config_host.mk
12864 config_host_lang.mk
12866 bin/bffvalidator.sh
12867 bin/odfvalidator.sh
12869 instsetoo_native/util/openoffice.lst
12870 sysui/desktop/macosx/Info.plist])
12871 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12872 AC_CONFIG_HEADERS([config_host/config_clang.h])
12873 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12874 AC_CONFIG_HEADERS([config_host/config_eot.h])
12875 AC_CONFIG_HEADERS([config_host/config_extensions.h])
12876 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12877 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
12878 AC_CONFIG_HEADERS([config_host/config_dbus.h])
12879 AC_CONFIG_HEADERS([config_host/config_features.h])
12880 AC_CONFIG_HEADERS([config_host/config_firebird.h])
12881 AC_CONFIG_HEADERS([config_host/config_folders.h])
12882 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
12883 AC_CONFIG_HEADERS([config_host/config_gio.h])
12884 AC_CONFIG_HEADERS([config_host/config_global.h])
12885 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
12886 AC_CONFIG_HEADERS([config_host/config_java.h])
12887 AC_CONFIG_HEADERS([config_host/config_langs.h])
12888 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12889 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
12890 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
12891 AC_CONFIG_HEADERS([config_host/config_libnumbertext.h])
12892 AC_CONFIG_HEADERS([config_host/config_locales.h])
12893 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12894 AC_CONFIG_HEADERS([config_host/config_oox.h])
12895 AC_CONFIG_HEADERS([config_host/config_options.h])
12896 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
12897 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12898 AC_CONFIG_HEADERS([config_host/config_vendor.h])
12899 AC_CONFIG_HEADERS([config_host/config_vcl.h])
12900 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12901 AC_CONFIG_HEADERS([config_host/config_version.h])
12902 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12903 AC_CONFIG_HEADERS([config_host/config_poppler.h])
12904 AC_CONFIG_HEADERS([config_host/config_python.h])
12905 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
12908 if test "$CROSS_COMPILING" = TRUE; then
12909 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12912 # touch the config timestamp file
12913 if test ! -f config_host.mk.stamp; then
12914 echo > config_host.mk.stamp
12915 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
12916 echo "Host Configuration unchanged - avoiding scp2 stamp update"
12918 echo > config_host.mk.stamp
12921 # touch the config lang timestamp file
12922 if test ! -f config_host_lang.mk.stamp; then
12923 echo > config_host_lang.mk.stamp
12924 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
12925 echo "Language Configuration unchanged - avoiding scp2 stamp update"
12927 echo > config_host_lang.mk.stamp
12931 if test \( "$STALE_MAKE" = "TRUE" -o "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE" \) \
12932 -a "$build_os" = "cygwin"; then
12935 ****************************************************************************
12937 Your make version is known to be horribly slow, and hard to debug
12938 problems with. To get a reasonably functional make please do:
12940 to install a pre-compiled binary make for Win32
12942 mkdir -p /opt/lo/bin
12944 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
12945 cp make-4.2.1-msvc.exe make
12948 to install from source:
12949 place yourself in a working directory of you choice.
12951 git clone git://git.savannah.gnu.org/make.git
12953 [go to Start menu, open "Visual Studio 2017", click "VS2017 x86 Native Tools Command Prompt" or "VS2017 x64 Native Tools Command Prompt"]
12954 set PATH=%PATH%;C:\Cygwin\bin
12955 [or Cygwin64, if that is what you have]
12956 cd path-to-make-repo-you-cloned-above
12957 build_w32.bat --without-guile
12959 should result in a WinRel/gnumake.exe.
12960 Copy it to the Cygwin /opt/lo/bin directory as make.exe
12962 Then re-run autogen.sh
12964 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12965 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12968 if test "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE"; then
12969 AC_MSG_ERROR([no file function found; the build will fail without it; use GNU make 4.0 or later])
12975 ****************************************************************************
12980 To view some help, run:
12985 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
12987 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
12990 if test $_os = Darwin; then
12991 echo open instdir/$PRODUCTNAME.app
12993 echo instdir/program/soffice
12997 If you want to run the smoketest, run:
13003 if test -f warn; then
13008 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: