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],[7.0.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(SRC_ROOT,"$SRC_ROOT")
336 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
338 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
339 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
342 # need sed in os checks...
343 AC_PATH_PROGS(SED, sed)
344 if test -z "$SED"; then
345 AC_MSG_ERROR([install sed to run this script])
348 # Set the ENABLE_LTO variable
349 # ===================================================================
350 AC_MSG_CHECKING([whether to use link-time optimization])
351 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
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.]),
389 AC_ARG_WITH(android-api-level,
390 AS_HELP_STRING([--with-android-api-level],
391 [Specify the API level when building for Android. Defaults to 16 for ARM and x86 and to 21 for ARM64 and x86-64]),
395 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
396 with_android_ndk="$SRC_ROOT/external/android-ndk"
398 if test -n "$with_android_ndk"; then
399 eval ANDROID_NDK_HOME=$with_android_ndk
401 # Set up a lot of pre-canned defaults
403 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
404 if test ! -f $ANDROID_NDK_HOME/source.properties; then
405 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
407 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
409 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
411 if test -z "$ANDROID_NDK_VERSION"; then
412 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
414 case $ANDROID_NDK_VERSION in
416 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
418 11.1.*|12.1.*|13.1.*|14.1.*)
419 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
421 16.*|17.*|18.*|19.*|20.*)
424 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk.])
425 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk."
430 if test -n "$with_android_api_level" ; then
431 ANDROID_API_LEVEL="$with_android_api_level"
434 android_cpu=$host_cpu
435 if test $host_cpu = arm; then
436 android_platform_prefix=arm-linux-androideabi
437 android_gnu_prefix=$android_platform_prefix
438 LLVM_TRIPLE=armv7a-linux-androideabi
439 ANDROID_APP_ABI=armeabi-v7a
440 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
441 elif test $host_cpu = aarch64; then
442 android_platform_prefix=aarch64-linux-android
443 android_gnu_prefix=$android_platform_prefix
444 LLVM_TRIPLE=$android_platform_prefix
445 # minimum android version that supports aarch64
446 if test "$ANDROID_API_LEVEL" -lt "21" ; then
449 ANDROID_APP_ABI=arm64-v8a
450 elif test $host_cpu = x86_64; then
451 android_platform_prefix=x86_64-linux-android
452 android_gnu_prefix=$android_platform_prefix
453 LLVM_TRIPLE=$android_platform_prefix
454 # minimum android version that supports x86_64
456 ANDROID_APP_ABI=x86_64
458 # host_cpu is something like "i386" or "i686" I guess, NDK uses
459 # "x86" in some contexts
461 android_platform_prefix=$android_cpu
462 android_gnu_prefix=i686-linux-android
463 LLVM_TRIPLE=$android_gnu_prefix
467 case "$with_android_ndk_toolchain_version" in
469 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
472 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
475 AC_MSG_NOTICE([using the Android API level... $ANDROID_API_LEVEL])
477 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
478 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
479 # manage to link the (app-specific) single huge .so that is built for the app in
480 # android/source/ if there is debug information in a significant part of the object files.
481 # (A 64-bit ld.gold grows too much over 10 gigabytes of virtual space when linking such a .so if
482 # all objects have been built with debug information.)
485 android_HOST_TAG=linux-x86_64
488 android_HOST_TAG=darwin-x86_64
491 AC_MSG_ERROR([We only support building for Android from Linux or macOS])
492 # ndk would also support windows and windows-x86_64
495 android_TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$android_HOST_TAG
496 ANDROID_COMPILER_BIN=$android_TOOLCHAIN/bin
497 dnl TODO: NSS build uses it...
498 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG
499 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
501 test -z "$AR" && AR=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ar
502 test -z "$NM" && NM=$ANDROID_COMPILER_BIN/$android_gnu_prefix-nm
503 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-objdump
504 test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ranlib
505 test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-strip
507 ANDROIDCFLAGS="$ANDROIDCFLAGS -target ${LLVM_TRIPLE}${ANDROID_API_LEVEL}"
508 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes -ffunction-sections -fdata-sections -Qunused-arguments"
509 if test "$ENABLE_LTO" = TRUE; then
510 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
511 # $CC and $CXX when building external libraries
512 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
515 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -stdlib=libc++"
517 if test -z "$CC"; then
518 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
521 if test -z "$CXX"; then
522 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
526 # remember to download the ownCloud Android library later
527 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
529 AC_SUBST(ANDROID_NDK_HOME)
530 AC_SUBST(ANDROID_APP_ABI)
531 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
533 dnl ===================================================================
534 dnl --with-android-sdk
535 dnl ===================================================================
537 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
538 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
540 if test -n "$with_android_sdk"; then
541 eval ANDROID_SDK_HOME=$with_android_sdk
542 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
544 AC_SUBST(ANDROID_SDK_HOME)
546 AC_ARG_ENABLE([android-lok],
547 AS_HELP_STRING([--enable-android-lok],
548 [The Android app from the android/ subdir needs several tweaks all
549 over the place that break the LOK when used in the Online-based
550 Android app. This switch indicates that the intent of this build is
551 actually the Online-based, non-modified LOK.])
554 if test -n "$ANDROID_NDK_HOME" ; then
555 if test "$enable_android_lok" = yes; then
556 ENABLE_ANDROID_LOK=TRUE
557 AC_DEFINE(HAVE_FEATURE_ANDROID_LOK)
558 AC_MSG_NOTICE([building the Android version... for the Online-based Android app])
560 AC_MSG_NOTICE([building the Android version... for the app from the android/ subdir])
563 AC_SUBST([ENABLE_ANDROID_LOK])
565 libo_FUZZ_ARG_ENABLE([android-editing],
566 AS_HELP_STRING([--enable-android-editing],
567 [Enable the experimental editing feature on Android.])
569 ENABLE_ANDROID_EDITING=
570 if test "$enable_android_editing" = yes; then
571 ENABLE_ANDROID_EDITING=TRUE
573 AC_SUBST([ENABLE_ANDROID_EDITING])
575 dnl ===================================================================
576 dnl The following is a list of supported systems.
577 dnl Sequential to keep the logic very simple
578 dnl These values may be checked and reset later.
579 dnl ===================================================================
580 #defaults unless the os test overrides this:
590 # Default values, as such probably valid just for Linux, set
591 # differently below just for Mac OSX, but at least better than
592 # hardcoding these as we used to do. Much of this is duplicated also
593 # in solenv for old build system and for gbuild, ideally we should
594 # perhaps define stuff like this only here in configure.ac?
596 LINKFLAGSSHL="-shared"
600 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
603 INSTROOTCONTENTSUFFIX=
609 build_gstreamer_1_0=yes
614 dnl ===========================================================
615 dnl Check whether we're using Solaris 10 - SPARC or Intel.
616 dnl ===========================================================
617 AC_MSG_CHECKING([the Solaris operating system release])
618 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
619 if test "$_os_release" -lt "10"; then
620 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
622 AC_MSG_RESULT([ok ($_os_release)])
625 dnl Check whether we're using a SPARC or i386 processor
626 AC_MSG_CHECKING([the processor type])
627 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
628 AC_MSG_RESULT([ok ($host_cpu)])
630 AC_MSG_ERROR([only SPARC and i386 processors are supported])
634 linux-gnu*|k*bsd*-gnu*)
635 build_gstreamer_1_0=yes
641 if test "$enable_fuzzers" != yes; then
647 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
660 # When building on Windows normally with MSVC under Cygwin,
661 # configure thinks that the host platform (the platform the
662 # built code will run on) is Cygwin, even if it obviously is
663 # Windows, which in Autoconf terminology is called
664 # "mingw32". (Which is misleading as MinGW is the name of the
665 # tool-chain, not an operating system.)
667 # Somewhat confusing, yes. But this configure script doesn't
668 # look at $host etc that much, it mostly uses its own $_os
669 # variable, set here in this case statement.
684 darwin*) # macOS or iOS
690 if test -n "$LODE_HOME" ; then
692 AC_MSG_NOTICE([sanitized the PATH to $PATH])
694 if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
698 enable_mpl_subset=yes
699 enable_lotuswordpro=no
702 enable_postgresql_sdbc=no
703 enable_extension_integration=no
704 enable_report_builder=no
706 if test "$enable_ios_simulator" = "yes"; then
707 host=x86_64-apple-darwin
711 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
712 INSTROOTCONTENTSUFFIX=/Contents
713 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
715 # See comment above the case "$host_os"
716 LINKFLAGSSHL="-dynamiclib -single_module"
723 # -undefined error is the default
728 build_gstreamer_1_0=yes
733 AC_MSG_CHECKING([the FreeBSD operating system release])
734 if test -n "$with_os_version"; then
735 OSVERSION="$with_os_version"
737 OSVERSION=`/sbin/sysctl -n kern.osreldate`
739 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
740 AC_MSG_CHECKING([which thread library to use])
741 if test "$OSVERSION" -lt "500016"; then
742 PTHREAD_CFLAGS="-D_THREAD_SAFE"
743 PTHREAD_LIBS="-pthread"
744 elif test "$OSVERSION" -lt "502102"; then
745 PTHREAD_CFLAGS="-D_THREAD_SAFE"
749 PTHREAD_LIBS="-pthread"
751 AC_MSG_RESULT([$PTHREAD_LIBS])
756 build_gstreamer_1_0=yes
761 PTHREAD_LIBS="-pthread -lpthread"
768 PTHREAD_LIBS=-pthread
774 PTHREAD_CFLAGS="-D_THREAD_SAFE"
775 PTHREAD_LIBS="-pthread"
780 build_gstreamer_1_0=yes
785 PTHREAD_LIBS="-pthread"
790 build_gstreamer_1_0=no
791 enable_lotuswordpro=no
792 enable_mpl_subset=yes
795 enable_report_builder=no
797 enable_postgresql_sdbc=no
810 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
811 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
821 enable_gstreamer_1_0=no
826 enable_postgresql_sdbc=no
827 enable_firebird_sdbc=no
832 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
836 if test "$_os" = "Android" ; then
837 # Verify that the NDK and SDK options are proper
838 if test -z "$with_android_ndk"; then
839 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
840 elif test ! -f "$ANDROID_NDK_HOME/meta/abis.json"; then
841 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
844 if test -z "$ANDROID_SDK_HOME"; then
845 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
846 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
847 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
850 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
851 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
852 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
853 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
854 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
855 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
856 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
857 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
859 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
860 AC_MSG_WARN([android support repository not found - install with
861 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
862 to allow the build to download the specified version of the android support libraries])
863 add_warning "android support repository not found - install with"
864 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
865 add_warning "to allow the build to download the specified version of the android support libraries"
869 if test "$_os" = "AIX"; then
870 AC_PATH_PROG(GAWK, gawk)
871 if test -z "$GAWK"; then
872 AC_MSG_ERROR([gawk not found in \$PATH])
878 AC_SUBST(PTHREAD_CFLAGS)
879 AC_SUBST(PTHREAD_LIBS)
881 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
882 # By default use the ones specified by our build system,
883 # but explicit override is possible.
884 AC_MSG_CHECKING(for explicit AFLAGS)
885 if test -n "$AFLAGS"; then
886 AC_MSG_RESULT([$AFLAGS])
892 AC_MSG_CHECKING(for explicit CFLAGS)
893 if test -n "$CFLAGS"; then
894 AC_MSG_RESULT([$CFLAGS])
900 AC_MSG_CHECKING(for explicit CXXFLAGS)
901 if test -n "$CXXFLAGS"; then
902 AC_MSG_RESULT([$CXXFLAGS])
908 AC_MSG_CHECKING(for explicit OBJCFLAGS)
909 if test -n "$OBJCFLAGS"; then
910 AC_MSG_RESULT([$OBJCFLAGS])
916 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
917 if test -n "$OBJCXXFLAGS"; then
918 AC_MSG_RESULT([$OBJCXXFLAGS])
924 AC_MSG_CHECKING(for explicit LDFLAGS)
925 if test -n "$LDFLAGS"; then
926 AC_MSG_RESULT([$LDFLAGS])
936 AC_SUBST(OBJCXXFLAGS)
941 AC_SUBST(x_OBJCFLAGS)
942 AC_SUBST(x_OBJCXXFLAGS)
945 dnl These are potentially set for MSVC, in the code checking for UCRT below:
946 my_original_CFLAGS=$CFLAGS
947 my_original_CXXFLAGS=$CXXFLAGS
948 my_original_CPPFLAGS=$CPPFLAGS
950 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
951 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
952 dnl AC_PROG_CC internally.
953 if test "$_os" != "WINNT"; then
954 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
958 if test -z "$CC_BASE"; then
959 CC_BASE=`first_arg_basename "$CC"`
963 if test "$_os" != "WINNT"; then
964 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
970 if test $_os != "WINNT"; then
972 AC_SEARCH_LIBS([dlsym], [dl],
973 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
974 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
977 AC_SUBST(DLOPEN_LIBS)
979 AC_ARG_ENABLE(ios-simulator,
980 AS_HELP_STRING([--enable-ios-simulator],
981 [build i386 or x86_64 for ios simulator])
984 AC_ARG_ENABLE(ios-libreofficelight-app,
985 AS_HELP_STRING([--enable-ios-libreofficelight-app],
986 [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
987 (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
988 and also that its actual build (in Xcode) requires some obvious modifications to the project.])
991 ENABLE_IOS_LIBREOFFICELIGHT_APP=
992 if test "$enable_ios_libreofficelight_app" = yes; then
993 ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
995 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
997 ###############################################################################
998 # Extensions switches --enable/--disable
999 ###############################################################################
1000 # By default these should be enabled unless having extra dependencies.
1001 # If there is extra dependency over configure options then the enable should
1002 # be automagic based on whether the requiring feature is enabled or not.
1003 # All this options change anything only with --enable-extension-integration.
1005 # The name of this option and its help string makes it sound as if
1006 # extensions are built anyway, just not integrated in the installer,
1007 # if you use --disable-extension-integration. Is that really the
1010 libo_FUZZ_ARG_ENABLE(extension-integration,
1011 AS_HELP_STRING([--disable-extension-integration],
1012 [Disable integration of the built extensions in the installer of the
1013 product. Use this switch to disable the integration.])
1016 AC_ARG_ENABLE(avmedia,
1017 AS_HELP_STRING([--disable-avmedia],
1018 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
1021 AC_ARG_ENABLE(database-connectivity,
1022 AS_HELP_STRING([--disable-database-connectivity],
1023 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
1026 # This doesn't mean not building (or "integrating") extensions
1027 # (although it probably should; i.e. it should imply
1028 # --disable-extension-integration I guess), it means not supporting
1029 # any extension mechanism at all
1030 libo_FUZZ_ARG_ENABLE(extensions,
1031 AS_HELP_STRING([--disable-extensions],
1032 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1035 AC_ARG_ENABLE(scripting,
1036 AS_HELP_STRING([--disable-scripting],
1037 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1040 # This is mainly for Android and iOS, but could potentially be used in some
1041 # special case otherwise, too, so factored out as a separate setting
1043 AC_ARG_ENABLE(dynamic-loading,
1044 AS_HELP_STRING([--disable-dynamic-loading],
1045 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1048 libo_FUZZ_ARG_ENABLE(report-builder,
1049 AS_HELP_STRING([--disable-report-builder],
1050 [Disable the Report Builder.])
1053 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1054 AS_HELP_STRING([--enable-ext-wiki-publisher],
1055 [Enable the Wiki Publisher extension.])
1058 libo_FUZZ_ARG_ENABLE(lpsolve,
1059 AS_HELP_STRING([--disable-lpsolve],
1060 [Disable compilation of the lp solve solver ])
1062 libo_FUZZ_ARG_ENABLE(coinmp,
1063 AS_HELP_STRING([--disable-coinmp],
1064 [Disable compilation of the CoinMP solver ])
1067 libo_FUZZ_ARG_ENABLE(pdfimport,
1068 AS_HELP_STRING([--disable-pdfimport],
1069 [Disable building the PDF import feature.])
1072 libo_FUZZ_ARG_ENABLE(pdfium,
1073 AS_HELP_STRING([--disable-pdfium],
1074 [Disable building PDFium.])
1077 libo_FUZZ_ARG_ENABLE(skia,
1078 AS_HELP_STRING([--disable-skia],
1079 [Disable building Skia.])
1082 ###############################################################################
1084 dnl ---------- *** ----------
1086 libo_FUZZ_ARG_ENABLE(mergelibs,
1087 AS_HELP_STRING([--enable-mergelibs],
1088 [Merge several of the smaller libraries into one big, "merged", one.])
1091 libo_FUZZ_ARG_ENABLE(breakpad,
1092 AS_HELP_STRING([--enable-breakpad],
1093 [Enables breakpad for crash reporting.])
1096 libo_FUZZ_ARG_ENABLE(crashdump,
1097 AS_HELP_STRING([--disable-crashdump],
1098 [Disable dump.ini and dump-file, when --enable-breakpad])
1101 AC_ARG_ENABLE(fetch-external,
1102 AS_HELP_STRING([--disable-fetch-external],
1103 [Disables fetching external tarballs from web sources.])
1106 AC_ARG_ENABLE(fuzzers,
1107 AS_HELP_STRING([--enable-fuzzers],
1108 [Enables building libfuzzer targets for fuzz testing.])
1111 libo_FUZZ_ARG_ENABLE(pch,
1112 AS_HELP_STRING([--enable-pch=<yes/no/system/base/normal/full>],
1113 [Enables precompiled header support for C++. Forced default on Windows/VC build.
1114 Using 'system' will include only external headers, 'base' will add also headers
1115 from base modules, 'normal' will also add all headers except from the module built,
1116 'full' will use all suitable headers even from a module itself.])
1119 libo_FUZZ_ARG_ENABLE(epm,
1120 AS_HELP_STRING([--enable-epm],
1121 [LibreOffice includes self-packaging code, that requires epm, however epm is
1122 useless for large scale package building.])
1125 libo_FUZZ_ARG_ENABLE(odk,
1126 AS_HELP_STRING([--disable-odk],
1127 [LibreOffice includes an ODK, office development kit which some packagers may
1128 wish to build without.])
1131 AC_ARG_ENABLE(mpl-subset,
1132 AS_HELP_STRING([--enable-mpl-subset],
1133 [Don't compile any pieces which are not MPL or more liberally licensed])
1136 libo_FUZZ_ARG_ENABLE(evolution2,
1137 AS_HELP_STRING([--enable-evolution2],
1138 [Allows the built-in evolution 2 addressbook connectivity build to be
1142 AC_ARG_ENABLE(avahi,
1143 AS_HELP_STRING([--enable-avahi],
1144 [Determines whether to use Avahi to advertise Impress to remote controls.])
1147 libo_FUZZ_ARG_ENABLE(werror,
1148 AS_HELP_STRING([--enable-werror],
1149 [Turn warnings to errors. (Has no effect in modules where the treating
1150 of warnings as errors is disabled explicitly.)]),
1153 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1154 AS_HELP_STRING([--enable-assert-always-abort],
1155 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1158 libo_FUZZ_ARG_ENABLE(dbgutil,
1159 AS_HELP_STRING([--enable-dbgutil],
1160 [Provide debugging support from --enable-debug and include additional debugging
1161 utilities such as object counting or more expensive checks.
1162 This is the recommended option for developers.
1163 Note that this makes the build ABI incompatible, it is not possible to mix object
1164 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1166 libo_FUZZ_ARG_ENABLE(debug,
1167 AS_HELP_STRING([--enable-debug],
1168 [Include debugging information, disable compiler optimization and inlining plus
1169 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1171 libo_FUZZ_ARG_ENABLE(split-debug,
1172 AS_HELP_STRING([--disable-split-debug],
1173 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1174 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1176 libo_FUZZ_ARG_ENABLE(gdb-index,
1177 AS_HELP_STRING([--disable-gdb-index],
1178 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1179 The feature requires the gold or lld linker.]))
1181 libo_FUZZ_ARG_ENABLE(sal-log,
1182 AS_HELP_STRING([--enable-sal-log],
1183 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1185 libo_FUZZ_ARG_ENABLE(symbols,
1186 AS_HELP_STRING([--enable-symbols],
1187 [Generate debug information.
1188 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1189 otherwise. It is possible to explicitly specify gbuild build targets
1190 (where 'all' means everything, '-' prepended means to not enable, '/' appended means
1191 everything in the directory; there is no ordering, more specific overrides
1192 more general, and disabling takes precedence).
1193 Example: --enable-symbols="all -sw/ -Library_sc".]))
1195 libo_FUZZ_ARG_ENABLE(optimized,
1196 AS_HELP_STRING([--enable-optimized=<yes/no/debug>],
1197 [Whether to compile with optimization flags.
1198 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1199 otherwise. Using 'debug' will try to use only optimizations that should
1200 not interfere with debugging.]))
1202 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1203 AS_HELP_STRING([--disable-runtime-optimizations],
1204 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1205 JVM JIT) that are known to interact badly with certain dynamic analysis
1206 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1207 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1208 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1210 AC_ARG_WITH(valgrind,
1211 AS_HELP_STRING([--with-valgrind],
1212 [Make availability of Valgrind headers a hard requirement.]))
1214 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1215 AS_HELP_STRING([--enable-compiler-plugins],
1216 [Enable compiler plugins that will perform additional checks during
1217 building. Enabled automatically by --enable-dbgutil.
1218 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1219 COMPILER_PLUGINS_DEBUG=
1220 if test "$enable_compiler_plugins" = debug; then
1221 enable_compiler_plugins=yes
1222 COMPILER_PLUGINS_DEBUG=TRUE
1225 libo_FUZZ_ARG_ENABLE(compiler-plugins-analyzer-pch,
1226 AS_HELP_STRING([--disable-compiler-plugins-analyzer-pch],
1227 [Disable use of precompiled headers when running the Clang compiler plugin analyzer. Not
1228 relevant in the --disable-compiler-plugins case.]))
1230 libo_FUZZ_ARG_ENABLE(ooenv,
1231 AS_HELP_STRING([--disable-ooenv],
1232 [Disable ooenv for the instdir installation.]))
1234 libo_FUZZ_ARG_ENABLE(libnumbertext,
1235 AS_HELP_STRING([--disable-libnumbertext],
1236 [Disable use of numbertext external library.]))
1239 AS_HELP_STRING([--enable-lto],
1240 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1241 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1242 linker. For MSVC, this option is broken at the moment. This is experimental work
1243 in progress that shouldn't be used unless you are working on it.)]))
1245 AC_ARG_ENABLE(python,
1246 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1247 [Enables or disables Python support at run-time.
1248 Also specifies what Python to use. 'auto' is the default.
1249 'fully-internal' even forces the internal version for uses of Python
1250 during the build.]))
1252 libo_FUZZ_ARG_ENABLE(gtk3,
1253 AS_HELP_STRING([--disable-gtk3],
1254 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1255 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1257 AC_ARG_ENABLE(introspection,
1258 AS_HELP_STRING([--enable-introspection],
1259 [Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
1260 Linux distributions.)]))
1262 AC_ARG_ENABLE(split-app-modules,
1263 AS_HELP_STRING([--enable-split-app-modules],
1264 [Split file lists for app modules, e.g. base, calc.
1265 Has effect only with make distro-pack-install]),
1268 AC_ARG_ENABLE(split-opt-features,
1269 AS_HELP_STRING([--enable-split-opt-features],
1270 [Split file lists for some optional features, e.g. pyuno, testtool.
1271 Has effect only with make distro-pack-install]),
1274 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1275 AS_HELP_STRING([--disable-cairo-canvas],
1276 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1279 libo_FUZZ_ARG_ENABLE(dbus,
1280 AS_HELP_STRING([--disable-dbus],
1281 [Determines whether to enable features that depend on dbus.
1282 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1283 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1285 libo_FUZZ_ARG_ENABLE(sdremote,
1286 AS_HELP_STRING([--disable-sdremote],
1287 [Determines whether to enable Impress remote control (i.e. the server component).]),
1288 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1290 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1291 AS_HELP_STRING([--disable-sdremote-bluetooth],
1292 [Determines whether to build sdremote with bluetooth support.
1293 Requires dbus on Linux.]))
1295 libo_FUZZ_ARG_ENABLE(gio,
1296 AS_HELP_STRING([--disable-gio],
1297 [Determines whether to use the GIO support.]),
1298 ,test "${enable_gio+set}" = set || enable_gio=yes)
1301 AS_HELP_STRING([--enable-qt5],
1302 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1307 AS_HELP_STRING([--enable-kf5],
1308 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1309 KF5 are available.]),
1313 AS_HELP_STRING([--enable-kde5],
1314 [Compatibility switch for the kde5 => kf5 rename. Use --enable-kf5!])
1317 AC_ARG_ENABLE(gtk3_kde5,
1318 AS_HELP_STRING([--enable-gtk3-kde5],
1319 [Determines whether to use Gtk3 vclplug with KF5 file dialogs on
1320 platforms where Gtk3, Qt5 and Plasma is available.]),
1324 AS_HELP_STRING([--disable-gui],
1325 [Disable use of X11 or Wayland to reduce dependencies (e.g. for building LibreOfficeKit).]),
1328 libo_FUZZ_ARG_ENABLE(randr,
1329 AS_HELP_STRING([--disable-randr],
1330 [Disable RandR support in the vcl project.]),
1331 ,test "${enable_randr+set}" = set || enable_randr=yes)
1333 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1334 AS_HELP_STRING([--disable-gstreamer-1-0],
1335 [Disable building with the gstreamer 1.0 avmedia backend.]),
1336 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1338 libo_FUZZ_ARG_ENABLE(vlc,
1339 AS_HELP_STRING([--enable-vlc],
1340 [Enable building with the (experimental) VLC avmedia backend.]),
1341 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1343 libo_FUZZ_ARG_ENABLE(neon,
1344 AS_HELP_STRING([--disable-neon],
1345 [Disable neon and the compilation of webdav binding.]),
1348 libo_FUZZ_ARG_ENABLE([eot],
1349 [AS_HELP_STRING([--enable-eot],
1350 [Enable support for Embedded OpenType fonts.])],
1351 ,test "${enable_eot+set}" = set || enable_eot=no)
1353 libo_FUZZ_ARG_ENABLE(cve-tests,
1354 AS_HELP_STRING([--disable-cve-tests],
1355 [Prevent CVE tests to be executed]),
1358 libo_FUZZ_ARG_ENABLE(chart-tests,
1359 AS_HELP_STRING([--enable-chart-tests],
1360 [Executes chart XShape tests. In a perfect world these tests would be
1361 stable and everyone could run them, in reality it is best to run them
1362 only on a few machines that are known to work and maintained by people
1363 who can judge if a test failure is a regression or not.]),
1366 AC_ARG_ENABLE(build-unowinreg,
1367 AS_HELP_STRING([--enable-build-unowinreg],
1368 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1369 compiler is needed on Linux.]),
1372 AC_ARG_ENABLE(build-opensymbol,
1373 AS_HELP_STRING([--enable-build-opensymbol],
1374 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1375 fontforge installed.]),
1378 AC_ARG_ENABLE(dependency-tracking,
1379 AS_HELP_STRING([--enable-dependency-tracking],
1380 [Do not reject slow dependency extractors.])[
1381 --disable-dependency-tracking
1382 Disables generation of dependency information.
1383 Speed up one-time builds.],
1386 AC_ARG_ENABLE(icecream,
1387 AS_HELP_STRING([--enable-icecream],
1388 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1389 It defaults to /opt/icecream for the location of the icecream gcc/g++
1390 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1394 AS_HELP_STRING([--enable-ld=<linker>],
1395 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1396 By default tries to use the best linker possible, use --disable-ld to use the default linker.]),
1399 libo_FUZZ_ARG_ENABLE(cups,
1400 AS_HELP_STRING([--disable-cups],
1401 [Do not build cups support.])
1404 AC_ARG_ENABLE(ccache,
1405 AS_HELP_STRING([--disable-ccache],
1406 [Do not try to use ccache automatically.
1407 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1408 CC/CXX are not yet set, and --enable-icecream is not given, we
1409 attempt to use ccache. --disable-ccache disables ccache completely.
1410 Additionally ccache's depend mode is enabled if possible,
1411 use --enable-ccache=nodepend to enable ccache without depend mode.
1415 AC_ARG_ENABLE(64-bit,
1416 AS_HELP_STRING([--enable-64-bit],
1417 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1418 At the moment meaningful only for Windows.]), ,)
1420 libo_FUZZ_ARG_ENABLE(online-update,
1421 AS_HELP_STRING([--enable-online-update],
1422 [Enable the online update service that will check for new versions of
1423 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1424 If the value is "mar", the experimental Mozilla-like update will be
1425 enabled instead of the traditional update mechanism.]),
1428 AC_ARG_WITH(update-config,
1429 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1430 [Path to the update config ini file]))
1432 libo_FUZZ_ARG_ENABLE(extension-update,
1433 AS_HELP_STRING([--disable-extension-update],
1434 [Disable possibility to update installed extensions.]),
1437 libo_FUZZ_ARG_ENABLE(release-build,
1438 AS_HELP_STRING([--enable-release-build],
1439 [Enable release build. Note that the "release build" choice is orthogonal to
1440 whether symbols are present, debug info is generated, or optimization
1442 See http://wiki.documentfoundation.org/Development/DevBuild]),
1445 AC_ARG_ENABLE(windows-build-signing,
1446 AS_HELP_STRING([--enable-windows-build-signing],
1447 [Enable signing of windows binaries (*.exe, *.dll)]),
1450 AC_ARG_ENABLE(silent-msi,
1451 AS_HELP_STRING([--enable-silent-msi],
1452 [Enable MSI with LIMITUI=1 (silent install).]),
1455 AC_ARG_ENABLE(macosx-code-signing,
1456 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1457 [Sign executables, dylibs, frameworks and the app bundle. If you
1458 don't provide an identity the first suitable certificate
1459 in your keychain is used.]),
1462 AC_ARG_ENABLE(macosx-package-signing,
1463 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1464 [Create a .pkg suitable for uploading to the Mac App Store and sign
1465 it. If you don't provide an identity the first suitable certificate
1466 in your keychain is used.]),
1469 AC_ARG_ENABLE(macosx-sandbox,
1470 AS_HELP_STRING([--enable-macosx-sandbox],
1471 [Make the app bundle run in a sandbox. Requires code signing.
1472 Is required by apps distributed in the Mac App Store, and implies
1473 adherence to App Store rules.]),
1476 AC_ARG_WITH(macosx-bundle-identifier,
1477 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1478 [Define the macOS bundle identifier. Default is the somewhat weird
1479 org.libreoffice.script ("script", huh?).]),
1480 ,with_macosx_bundle_identifier=org.libreoffice.script)
1482 AC_ARG_WITH(product-name,
1483 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1484 [Define the product name. Default is AC_PACKAGE_NAME.]),
1485 ,with_product_name=$PRODUCTNAME)
1487 AC_ARG_WITH(package-version,
1488 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1489 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1492 libo_FUZZ_ARG_ENABLE(readonly-installset,
1493 AS_HELP_STRING([--enable-readonly-installset],
1494 [Prevents any attempts by LibreOffice to write into its installation. That means
1495 at least that no "system-wide" extensions can be added. Partly experimental work in
1496 progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
1499 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1500 AS_HELP_STRING([--disable-postgresql-sdbc],
1501 [Disable the build of the PostgreSQL-SDBC driver.])
1504 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1505 AS_HELP_STRING([--disable-lotuswordpro],
1506 [Disable the build of the Lotus Word Pro filter.]),
1507 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1509 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1510 AS_HELP_STRING([--disable-firebird-sdbc],
1511 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1512 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1514 AC_ARG_ENABLE(bogus-pkg-config,
1515 AS_HELP_STRING([--enable-bogus-pkg-config],
1516 [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.]),
1519 AC_ARG_ENABLE(openssl,
1520 AS_HELP_STRING([--disable-openssl],
1521 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1522 components will either use GNUTLS or NSS. Work in progress,
1523 use only if you are hacking on it.]),
1524 ,enable_openssl=yes)
1526 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1527 AS_HELP_STRING([--enable-cipher-openssl-backend],
1528 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1529 Requires --enable-openssl.]))
1531 AC_ARG_ENABLE(library-bin-tar,
1532 AS_HELP_STRING([--enable-library-bin-tar],
1533 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1534 Some libraries can save their build result in a tarball
1535 stored in TARFILE_LOCATION. That binary tarball is
1536 uniquely identified by the source tarball,
1537 the content of the config_host.mk file and the content
1538 of the top-level directory in core for that library
1539 If this option is enabled, then if such a tarfile exist, it will be untarred
1540 instead of the source tarfile, and the build step will be skipped for that
1542 If a proper tarfile does not exist, then the normal source-based
1543 build is done for that library and a proper binary tarfile is created
1544 for the next time.]),
1547 AC_ARG_ENABLE(dconf,
1548 AS_HELP_STRING([--disable-dconf],
1549 [Disable the dconf configuration backend (enabled by default where
1552 libo_FUZZ_ARG_ENABLE(formula-logger,
1554 [--enable-formula-logger],
1555 [Enable formula logger for logging formula calculation flow in Calc.]
1560 AS_HELP_STRING([--disable-ldap],
1561 [Disable LDAP support.]),
1564 dnl ===================================================================
1565 dnl Optional Packages (--with/without-)
1566 dnl ===================================================================
1568 AC_ARG_WITH(gcc-home,
1569 AS_HELP_STRING([--with-gcc-home],
1570 [Specify the location of gcc/g++ manually. This can be used in conjunction
1571 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1572 non-default path.]),
1575 AC_ARG_WITH(gnu-patch,
1576 AS_HELP_STRING([--with-gnu-patch],
1577 [Specify location of GNU patch on Solaris or FreeBSD.]),
1580 AC_ARG_WITH(build-platform-configure-options,
1581 AS_HELP_STRING([--with-build-platform-configure-options],
1582 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1586 AS_HELP_STRING([--with-gnu-cp],
1587 [Specify location of GNU cp on Solaris or FreeBSD.]),
1590 AC_ARG_WITH(external-tar,
1591 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1592 [Specify an absolute path of where to find (and store) tarfiles.]),
1593 TARFILE_LOCATION=$withval ,
1596 AC_ARG_WITH(referenced-git,
1597 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1598 [Specify another checkout directory to reference. This makes use of
1599 git submodule update --reference, and saves a lot of diskspace
1600 when having multiple trees side-by-side.]),
1601 GIT_REFERENCE_SRC=$withval ,
1604 AC_ARG_WITH(linked-git,
1605 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1606 [Specify a directory where the repositories of submodules are located.
1607 This uses a method similar to git-new-workdir to get submodules.]),
1608 GIT_LINK_SRC=$withval ,
1611 AC_ARG_WITH(galleries,
1612 AS_HELP_STRING([--with-galleries],
1613 [Specify how galleries should be built. It is possible either to
1614 build these internally from source ("build"),
1615 or to disable them ("no")]),
1619 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1620 [Choose which themes to include. By default those themes with an '*' are included.
1621 Possible choices: *breeze, *breeze_dark, *breeze_dark_svg, *breeze_svg, *colibre, *colibre_svg, *elementary,
1622 *elementary_svg, *karasa_jaga, *karasa_jaga_svg, *sifr, *sifr_dark, *sifr_dark_svg, *sifr_svg, *sukapura, *sukapura_svg, *tango.]),
1625 libo_FUZZ_ARG_WITH(helppack-integration,
1626 AS_HELP_STRING([--without-helppack-integration],
1627 [It will not integrate the helppacks to the installer
1628 of the product. Please use this switch to use the online help
1629 or separate help packages.]),
1632 libo_FUZZ_ARG_WITH(fonts,
1633 AS_HELP_STRING([--without-fonts],
1634 [LibreOffice includes some third-party fonts to provide a reliable basis for
1635 help content, templates, samples, etc. When these fonts are already
1636 known to be available on the system then you should use this option.]),
1640 AS_HELP_STRING([--with-epm],
1641 [Decides which epm to use. Default is to use the one from the system if
1642 one is built. When either this is not there or you say =internal epm
1646 AC_ARG_WITH(package-format,
1647 AS_HELP_STRING([--with-package-format],
1648 [Specify package format(s) for LibreOffice installation sets. The
1649 implicit --without-package-format leads to no installation sets being
1650 generated. Possible values: aix, archive, bsd, deb, dmg,
1651 installed, msi, pkg, and rpm.
1652 Example: --with-package-format='deb rpm']),
1656 AS_HELP_STRING([--with-tls],
1657 [Decides which TLS/SSL and cryptographic implementations to use for
1658 LibreOffice's code. Notice that this doesn't apply for depending
1659 libraries like "neon", for example. Default is to use NSS
1660 although OpenSSL is also possible. Notice that selecting NSS restricts
1661 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1662 restrict by now the usage of NSS in LO's code. Possible values:
1663 openssl, nss. Example: --with-tls="nss"]),
1666 AC_ARG_WITH(system-libs,
1667 AS_HELP_STRING([--with-system-libs],
1668 [Use libraries already on system -- enables all --with-system-* flags.]),
1671 AC_ARG_WITH(system-bzip2,
1672 AS_HELP_STRING([--with-system-bzip2],
1673 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1674 [with_system_bzip2="$with_system_libs"])
1676 AC_ARG_WITH(system-headers,
1677 AS_HELP_STRING([--with-system-headers],
1678 [Use headers already on system -- enables all --with-system-* flags for
1679 external packages whose headers are the only entities used i.e.
1680 boost/odbc/sane-header(s).]),,
1681 [with_system_headers="$with_system_libs"])
1683 AC_ARG_WITH(system-jars,
1684 AS_HELP_STRING([--without-system-jars],
1685 [When building with --with-system-libs, also the needed jars are expected
1686 on the system. Use this to disable that]),,
1687 [with_system_jars="$with_system_libs"])
1689 AC_ARG_WITH(system-cairo,
1690 AS_HELP_STRING([--with-system-cairo],
1691 [Use cairo libraries already on system. Happens automatically for
1692 (implicit) --enable-gtk3.]))
1694 AC_ARG_WITH(system-epoxy,
1695 AS_HELP_STRING([--with-system-epoxy],
1696 [Use epoxy libraries already on system. Happens automatically for
1697 (implicit) --enable-gtk3.]),,
1698 [with_system_epoxy="$with_system_libs"])
1700 AC_ARG_WITH(myspell-dicts,
1701 AS_HELP_STRING([--with-myspell-dicts],
1702 [Adds myspell dictionaries to the LibreOffice installation set]),
1705 AC_ARG_WITH(system-dicts,
1706 AS_HELP_STRING([--without-system-dicts],
1707 [Do not use dictionaries from system paths.]),
1710 AC_ARG_WITH(external-dict-dir,
1711 AS_HELP_STRING([--with-external-dict-dir],
1712 [Specify external dictionary dir.]),
1715 AC_ARG_WITH(external-hyph-dir,
1716 AS_HELP_STRING([--with-external-hyph-dir],
1717 [Specify external hyphenation pattern dir.]),
1720 AC_ARG_WITH(external-thes-dir,
1721 AS_HELP_STRING([--with-external-thes-dir],
1722 [Specify external thesaurus dir.]),
1725 AC_ARG_WITH(system-zlib,
1726 AS_HELP_STRING([--with-system-zlib],
1727 [Use zlib already on system.]),,
1728 [with_system_zlib=auto])
1730 AC_ARG_WITH(system-jpeg,
1731 AS_HELP_STRING([--with-system-jpeg],
1732 [Use jpeg already on system.]),,
1733 [with_system_jpeg="$with_system_libs"])
1735 AC_ARG_WITH(system-clucene,
1736 AS_HELP_STRING([--with-system-clucene],
1737 [Use clucene already on system.]),,
1738 [with_system_clucene="$with_system_libs"])
1740 AC_ARG_WITH(system-expat,
1741 AS_HELP_STRING([--with-system-expat],
1742 [Use expat already on system.]),,
1743 [with_system_expat="$with_system_libs"])
1745 AC_ARG_WITH(system-libxml,
1746 AS_HELP_STRING([--with-system-libxml],
1747 [Use libxml/libxslt already on system.]),,
1748 [with_system_libxml=auto])
1750 AC_ARG_WITH(system-icu,
1751 AS_HELP_STRING([--with-system-icu],
1752 [Use icu already on system.]),,
1753 [with_system_icu="$with_system_libs"])
1755 AC_ARG_WITH(system-ucpp,
1756 AS_HELP_STRING([--with-system-ucpp],
1757 [Use ucpp already on system.]),,
1760 AC_ARG_WITH(system-openldap,
1761 AS_HELP_STRING([--with-system-openldap],
1762 [Use the OpenLDAP LDAP SDK already on system.]),,
1763 [with_system_openldap="$with_system_libs"])
1765 libo_FUZZ_ARG_ENABLE(poppler,
1766 AS_HELP_STRING([--disable-poppler],
1767 [Disable building Poppler.])
1770 AC_ARG_WITH(system-poppler,
1771 AS_HELP_STRING([--with-system-poppler],
1772 [Use system poppler (only needed for PDF import).]),,
1773 [with_system_poppler="$with_system_libs"])
1775 AC_ARG_WITH(system-gpgmepp,
1776 AS_HELP_STRING([--with-system-gpgmepp],
1777 [Use gpgmepp already on system]),,
1778 [with_system_gpgmepp="$with_system_libs"])
1780 AC_ARG_WITH(system-apache-commons,
1781 AS_HELP_STRING([--with-system-apache-commons],
1782 [Use Apache commons libraries already on system.]),,
1783 [with_system_apache_commons="$with_system_jars"])
1785 AC_ARG_WITH(system-mariadb,
1786 AS_HELP_STRING([--with-system-mariadb],
1787 [Use MariaDB/MySQL libraries already on system.]),,
1788 [with_system_mariadb="$with_system_libs"])
1790 AC_ARG_ENABLE(bundle-mariadb,
1791 AS_HELP_STRING([--enable-bundle-mariadb],
1792 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
1795 AC_ARG_WITH(system-postgresql,
1796 AS_HELP_STRING([--with-system-postgresql],
1797 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1798 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1799 [with_system_postgresql="$with_system_libs"])
1801 AC_ARG_WITH(libpq-path,
1802 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1803 [Use this PostgreSQL C interface (libpq) installation for building
1804 the PostgreSQL-SDBC extension.]),
1807 AC_ARG_WITH(system-firebird,
1808 AS_HELP_STRING([--with-system-firebird],
1809 [Use Firebird libraries already on system, for building the Firebird-SDBC
1810 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1811 [with_system_firebird="$with_system_libs"])
1813 AC_ARG_WITH(system-libtommath,
1814 AS_HELP_STRING([--with-system-libtommath],
1815 [Use libtommath already on system]),,
1816 [with_system_libtommath="$with_system_libs"])
1818 AC_ARG_WITH(system-hsqldb,
1819 AS_HELP_STRING([--with-system-hsqldb],
1820 [Use hsqldb already on system.]))
1822 AC_ARG_WITH(hsqldb-jar,
1823 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1824 [Specify path to jarfile manually.]),
1825 HSQLDB_JAR=$withval)
1827 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1828 AS_HELP_STRING([--disable-scripting-beanshell],
1829 [Disable support for scripts in BeanShell.]),
1833 AC_ARG_WITH(system-beanshell,
1834 AS_HELP_STRING([--with-system-beanshell],
1835 [Use beanshell already on system.]),,
1836 [with_system_beanshell="$with_system_jars"])
1838 AC_ARG_WITH(beanshell-jar,
1839 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1840 [Specify path to jarfile manually.]),
1843 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1844 AS_HELP_STRING([--disable-scripting-javascript],
1845 [Disable support for scripts in JavaScript.]),
1849 AC_ARG_WITH(system-rhino,
1850 AS_HELP_STRING([--with-system-rhino],
1851 [Use rhino already on system.]),,)
1852 # [with_system_rhino="$with_system_jars"])
1853 # Above is not used as we have different debug interface
1854 # patched into internal rhino. This code needs to be fixed
1855 # before we can enable it by default.
1857 AC_ARG_WITH(rhino-jar,
1858 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1859 [Specify path to jarfile manually.]),
1862 AC_ARG_WITH(commons-logging-jar,
1863 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1864 [Specify path to jarfile manually.]),
1865 COMMONS_LOGGING_JAR=$withval)
1867 AC_ARG_WITH(system-jfreereport,
1868 AS_HELP_STRING([--with-system-jfreereport],
1869 [Use JFreeReport already on system.]),,
1870 [with_system_jfreereport="$with_system_jars"])
1872 AC_ARG_WITH(sac-jar,
1873 AS_HELP_STRING([--with-sac-jar=JARFILE],
1874 [Specify path to jarfile manually.]),
1877 AC_ARG_WITH(libxml-jar,
1878 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1879 [Specify path to jarfile manually.]),
1880 LIBXML_JAR=$withval)
1882 AC_ARG_WITH(flute-jar,
1883 AS_HELP_STRING([--with-flute-jar=JARFILE],
1884 [Specify path to jarfile manually.]),
1887 AC_ARG_WITH(jfreereport-jar,
1888 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1889 [Specify path to jarfile manually.]),
1890 JFREEREPORT_JAR=$withval)
1892 AC_ARG_WITH(liblayout-jar,
1893 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1894 [Specify path to jarfile manually.]),
1895 LIBLAYOUT_JAR=$withval)
1897 AC_ARG_WITH(libloader-jar,
1898 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1899 [Specify path to jarfile manually.]),
1900 LIBLOADER_JAR=$withval)
1902 AC_ARG_WITH(libformula-jar,
1903 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1904 [Specify path to jarfile manually.]),
1905 LIBFORMULA_JAR=$withval)
1907 AC_ARG_WITH(librepository-jar,
1908 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1909 [Specify path to jarfile manually.]),
1910 LIBREPOSITORY_JAR=$withval)
1912 AC_ARG_WITH(libfonts-jar,
1913 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1914 [Specify path to jarfile manually.]),
1915 LIBFONTS_JAR=$withval)
1917 AC_ARG_WITH(libserializer-jar,
1918 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1919 [Specify path to jarfile manually.]),
1920 LIBSERIALIZER_JAR=$withval)
1922 AC_ARG_WITH(libbase-jar,
1923 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1924 [Specify path to jarfile manually.]),
1925 LIBBASE_JAR=$withval)
1927 AC_ARG_WITH(system-odbc,
1928 AS_HELP_STRING([--with-system-odbc],
1929 [Use the odbc headers already on system.]),,
1930 [with_system_odbc="auto"])
1932 AC_ARG_WITH(system-sane,
1933 AS_HELP_STRING([--with-system-sane],
1934 [Use sane.h already on system.]),,
1935 [with_system_sane="$with_system_headers"])
1937 AC_ARG_WITH(system-bluez,
1938 AS_HELP_STRING([--with-system-bluez],
1939 [Use bluetooth.h already on system.]),,
1940 [with_system_bluez="$with_system_headers"])
1942 AC_ARG_WITH(system-curl,
1943 AS_HELP_STRING([--with-system-curl],
1944 [Use curl already on system.]),,
1945 [with_system_curl=auto])
1947 AC_ARG_WITH(system-boost,
1948 AS_HELP_STRING([--with-system-boost],
1949 [Use boost already on system.]),,
1950 [with_system_boost="$with_system_headers"])
1952 AC_ARG_WITH(system-glm,
1953 AS_HELP_STRING([--with-system-glm],
1954 [Use glm already on system.]),,
1955 [with_system_glm="$with_system_headers"])
1957 AC_ARG_WITH(system-hunspell,
1958 AS_HELP_STRING([--with-system-hunspell],
1959 [Use libhunspell already on system.]),,
1960 [with_system_hunspell="$with_system_libs"])
1962 AC_ARG_WITH(system-qrcodegen,
1963 AS_HELP_STRING([--with-system-qrcodegen],
1964 [Use libqrcodegen already on system.]),,
1965 [with_system_qrcodegen="$with_system_libs"])
1967 AC_ARG_WITH(system-mythes,
1968 AS_HELP_STRING([--with-system-mythes],
1969 [Use mythes already on system.]),,
1970 [with_system_mythes="$with_system_libs"])
1972 AC_ARG_WITH(system-altlinuxhyph,
1973 AS_HELP_STRING([--with-system-altlinuxhyph],
1974 [Use ALTLinuxhyph already on system.]),,
1975 [with_system_altlinuxhyph="$with_system_libs"])
1977 AC_ARG_WITH(system-lpsolve,
1978 AS_HELP_STRING([--with-system-lpsolve],
1979 [Use lpsolve already on system.]),,
1980 [with_system_lpsolve="$with_system_libs"])
1982 AC_ARG_WITH(system-coinmp,
1983 AS_HELP_STRING([--with-system-coinmp],
1984 [Use CoinMP already on system.]),,
1985 [with_system_coinmp="$with_system_libs"])
1987 AC_ARG_WITH(system-liblangtag,
1988 AS_HELP_STRING([--with-system-liblangtag],
1989 [Use liblangtag library already on system.]),,
1990 [with_system_liblangtag="$with_system_libs"])
1993 AS_HELP_STRING([--with-webdav],
1994 [Specify which library to use for webdav implementation.
1995 Possible values: "neon", "serf", "no". The default value is "neon".
1996 Example: --with-webdav="serf"]),
1997 WITH_WEBDAV=$withval,
2000 AC_ARG_WITH(linker-hash-style,
2001 AS_HELP_STRING([--with-linker-hash-style],
2002 [Use linker with --hash-style=<style> when linking shared objects.
2003 Possible values: "sysv", "gnu", "both". The default value is "gnu"
2004 if supported on the build system, and "sysv" otherwise.]))
2006 AC_ARG_WITH(jdk-home,
2007 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
2008 [If you have installed JDK 8 or later on your system please supply the
2009 path here. Note that this is not the location of the java command but the
2010 location of the entire distribution.]),
2014 AS_HELP_STRING([--with-help],
2015 [Enable the build of help. There is a special parameter "common" that
2016 can be used to bundle only the common part, .e.g help-specific icons.
2017 This is useful when you build the helpcontent separately.])
2019 Usage: --with-help build the old local help
2020 --without-help no local help (default)
2021 --with-help=html build the new HTML local help
2022 --with-help=online build the new HTML online help
2026 AC_ARG_WITH(omindex,
2027 AS_HELP_STRING([--with-omindex],
2028 [Enable the support of xapian-omega index for online help.])
2030 Usage: --with-omindex=server prepare the pages for omindex
2031 but let xapian-omega be built in server.
2032 --with-omindex=noxap do not prepare online pages
2037 libo_FUZZ_ARG_WITH(java,
2038 AS_HELP_STRING([--with-java=<java command>],
2039 [Specify the name of the Java interpreter command. Typically "java"
2040 which is the default.
2042 To build without support for Java components, applets, accessibility
2043 or the XML filters written in Java, use --without-java or --with-java=no.]),
2044 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2045 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
2048 AC_ARG_WITH(jvm-path,
2049 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
2050 [Use a specific JVM search path at runtime.
2051 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2054 AC_ARG_WITH(ant-home,
2055 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2056 [If you have installed Apache Ant on your system, please supply the path here.
2057 Note that this is not the location of the Ant binary but the location
2058 of the entire distribution.]),
2061 AC_ARG_WITH(symbol-config,
2062 AS_HELP_STRING([--with-symbol-config],
2063 [Configuration for the crashreport symbol upload]),
2065 [with_symbol_config=no])
2067 AC_ARG_WITH(export-validation,
2068 AS_HELP_STRING([--without-export-validation],
2069 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2070 ,with_export_validation=auto)
2072 AC_ARG_WITH(bffvalidator,
2073 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2074 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2075 Requires installed Microsoft Office Binary File Format Validator.
2076 Note: export-validation (--with-export-validation) is required to be turned on.
2077 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2078 ,with_bffvalidator=no)
2080 libo_FUZZ_ARG_WITH(junit,
2081 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2082 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2083 --without-junit disables those tests. Not relevant in the --without-java case.]),
2086 AC_ARG_WITH(hamcrest,
2087 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2088 [Specifies the hamcrest jar file to use for JUnit-based tests.
2089 --without-junit disables those tests. Not relevant in the --without-java case.]),
2092 AC_ARG_WITH(perl-home,
2093 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2094 [If you have installed Perl 5 Distribution, on your system, please
2095 supply the path here. Note that this is not the location of the Perl
2096 binary but the location of the entire distribution.]),
2099 libo_FUZZ_ARG_WITH(doxygen,
2101 [--with-doxygen=<absolute path to doxygen executable>],
2102 [Specifies the doxygen executable to use when generating ODK C/C++
2103 documentation. --without-doxygen disables generation of ODK C/C++
2104 documentation. Not relevant in the --disable-odk case.]),
2107 AC_ARG_WITH(visual-studio,
2108 AS_HELP_STRING([--with-visual-studio=<2019>],
2109 [Specify which Visual Studio version to use in case several are
2110 installed. Currently only 2019 (default) is supported.]),
2113 AC_ARG_WITH(windows-sdk,
2114 AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10.0>],
2115 [Specify which Windows SDK, or "Windows Kit", version to use
2116 in case the one that came with the selected Visual Studio
2117 is not what you want for some reason. Note that not all compiler/SDK
2118 combinations are supported. The intent is that this option should not
2123 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2124 [Use this option to build LibreOffice with additional UI language support.
2125 English (US) is always included by default.
2126 Separate multiple languages with space.
2127 For all languages, use --with-lang=ALL.]),
2130 AC_ARG_WITH(locales,
2131 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2132 [Use this option to limit the locale information built in.
2133 Separate multiple locales with space.
2134 Very experimental and might well break stuff.
2135 Just a desperate measure to shrink code and data size.
2136 By default all the locales available is included.
2137 This option is completely unrelated to --with-lang.])
2139 Affects also our character encoding conversion
2140 tables for encodings mainly targeted for a
2141 particular locale, like EUC-CN and EUC-TW for
2142 zh, ISO-2022-JP for ja.
2144 Affects also our add-on break iterator data for
2147 For the default, all locales, don't use this switch at all.
2148 Specifying just the language part of a locale means all matching
2149 locales will be included.
2153 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2154 libo_FUZZ_ARG_WITH(krb5,
2155 AS_HELP_STRING([--with-krb5],
2156 [Enable MIT Kerberos 5 support in modules that support it.
2157 By default automatically enabled on platforms
2158 where a good system Kerberos 5 is available.]),
2161 libo_FUZZ_ARG_WITH(gssapi,
2162 AS_HELP_STRING([--with-gssapi],
2163 [Enable GSSAPI support in modules that support it.
2164 By default automatically enabled on platforms
2165 where a good system GSSAPI is available.]),
2169 AS_HELP_STRING([--with-iwyu],
2170 [Use given IWYU binary path to check unneeded includes instead of building.
2171 Use only if you are hacking on it.]),
2174 libo_FUZZ_ARG_WITH(lxml,
2175 AS_HELP_STRING([--without-lxml],
2176 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2177 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2178 report widget classes and ids.]),
2181 dnl ===================================================================
2183 dnl ===================================================================
2185 AC_ARG_WITH(branding,
2186 AS_HELP_STRING([--with-branding=/path/to/images],
2187 [Use given path to retrieve branding images set.])
2189 Search for intro.png about.svg and flat_logo.svg.
2190 If any is missing, default ones will be used instead.
2192 Search also progress.conf for progress
2193 settings on intro screen :
2195 PROGRESSBARCOLOR="255,255,255" Set color of
2196 progress bar. Comma separated RGB decimal values.
2197 PROGRESSSIZE="407,6" Set size of progress bar.
2198 Comma separated decimal values (width, height).
2199 PROGRESSPOSITION="61,317" Set position of progress
2200 bar from left,top. Comma separated decimal values.
2201 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2202 bar frame. Comma separated RGB decimal values.
2203 PROGRESSTEXTCOLOR="0,0,0" Set color of progress
2204 bar text. Comma separated RGB decimal values.
2205 PROGRESSTEXTBASELINE="287" Set vertical position of
2206 progress bar text from top. Decimal value.
2208 Default values will be used if not found.
2213 AC_ARG_WITH(extra-buildid,
2214 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2215 [Show addition build identification in about dialog.]),
2220 AS_HELP_STRING([--with-vendor="John the Builder"],
2221 [Set vendor of the build.]),
2224 AC_ARG_WITH(android-package-name,
2225 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2226 [Set Android package name of the build.]),
2229 AC_ARG_WITH(compat-oowrappers,
2230 AS_HELP_STRING([--with-compat-oowrappers],
2231 [Install oo* wrappers in parallel with
2232 lo* ones to keep backward compatibility.
2233 Has effect only with make distro-pack-install]),
2236 AC_ARG_WITH(os-version,
2237 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2238 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2241 AC_ARG_WITH(mingw-cross-compiler,
2242 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2243 [Specify the MinGW cross-compiler to use.
2244 When building on the ODK on Unix and building unowinreg.dll,
2245 specify the MinGW C++ cross-compiler.]),
2248 AC_ARG_WITH(idlc-cpp,
2249 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2250 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2253 AC_ARG_WITH(build-version,
2254 AS_HELP_STRING([--with-build-version="Built by Jim"],
2255 [Allows the builder to add a custom version tag that will appear in the
2256 Help/About box for QA purposes.]),
2257 with_build_version=$withval,
2260 AC_ARG_WITH(parallelism,
2261 AS_HELP_STRING([--with-parallelism],
2262 [Number of jobs to run simultaneously during build. Parallel builds can
2263 save a lot of time on multi-cpu machines. Defaults to the number of
2264 CPUs on the machine, unless you configure --enable-icecream - then to
2268 AC_ARG_WITH(all-tarballs,
2269 AS_HELP_STRING([--with-all-tarballs],
2270 [Download all external tarballs unconditionally]))
2272 AC_ARG_WITH(gdrive-client-id,
2273 AS_HELP_STRING([--with-gdrive-client-id],
2274 [Provides the client id of the application for OAuth2 authentication
2275 on Google Drive. If either this or --with-gdrive-client-secret is
2276 empty, the feature will be disabled]),
2279 AC_ARG_WITH(gdrive-client-secret,
2280 AS_HELP_STRING([--with-gdrive-client-secret],
2281 [Provides the client secret of the application for OAuth2
2282 authentication on Google Drive. If either this or
2283 --with-gdrive-client-id is empty, the feature will be disabled]),
2286 AC_ARG_WITH(alfresco-cloud-client-id,
2287 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2288 [Provides the client id of the application for OAuth2 authentication
2289 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2290 empty, the feature will be disabled]),
2293 AC_ARG_WITH(alfresco-cloud-client-secret,
2294 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2295 [Provides the client secret of the application for OAuth2
2296 authentication on Alfresco Cloud. If either this or
2297 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2300 AC_ARG_WITH(onedrive-client-id,
2301 AS_HELP_STRING([--with-onedrive-client-id],
2302 [Provides the client id of the application for OAuth2 authentication
2303 on OneDrive. If either this or --with-onedrive-client-secret is
2304 empty, the feature will be disabled]),
2307 AC_ARG_WITH(onedrive-client-secret,
2308 AS_HELP_STRING([--with-onedrive-client-secret],
2309 [Provides the client secret of the application for OAuth2
2310 authentication on OneDrive. If either this or
2311 --with-onedrive-client-id is empty, the feature will be disabled]),
2313 dnl ===================================================================
2314 dnl Do we want to use pre-build binary tarball for recompile
2315 dnl ===================================================================
2317 if test "$enable_library_bin_tar" = "yes" ; then
2318 USE_LIBRARY_BIN_TAR=TRUE
2320 USE_LIBRARY_BIN_TAR=
2322 AC_SUBST(USE_LIBRARY_BIN_TAR)
2324 dnl ===================================================================
2325 dnl Test whether build target is Release Build
2326 dnl ===================================================================
2327 AC_MSG_CHECKING([whether build target is Release Build])
2328 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2330 ENABLE_RELEASE_BUILD=
2332 AC_MSG_RESULT([yes])
2333 ENABLE_RELEASE_BUILD=TRUE
2335 AC_SUBST(ENABLE_RELEASE_BUILD)
2337 dnl ===================================================================
2338 dnl Test whether to sign Windows Build
2339 dnl ===================================================================
2340 AC_MSG_CHECKING([whether to sign windows build])
2341 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2342 AC_MSG_RESULT([yes])
2343 WINDOWS_BUILD_SIGNING="TRUE"
2346 WINDOWS_BUILD_SIGNING="FALSE"
2348 AC_SUBST(WINDOWS_BUILD_SIGNING)
2350 dnl ===================================================================
2351 dnl MacOSX build and runtime environment options
2352 dnl ===================================================================
2354 AC_ARG_WITH(macosx-sdk,
2355 AS_HELP_STRING([--with-macosx-sdk=<version>],
2356 [Prefer a specific SDK for building.])
2358 If the requested SDK is not available, a search for the oldest one will be done.
2359 With current Xcode versions, only the latest SDK is included, so this option is
2360 not terribly useful. It works fine to build with a new SDK and run the result
2363 e. g.: --with-macosx-sdk=10.10
2365 there are 3 options to control the MacOSX build:
2366 --with-macosx-sdk (referred as 'sdk' below)
2367 --with-macosx-version-min-required (referred as 'min' below)
2368 --with-macosx-version-max-allowed (referred as 'max' below)
2370 the connection between these value and the default they take is as follow:
2371 ( ? means not specified on the command line, s means the SDK version found,
2372 constraint: 8 <= x <= y <= z)
2374 ==========================================
2375 command line || config result
2376 ==========================================
2377 min | max | sdk || min | max | sdk |
2378 ? | ? | ? || 10.10 | 10.s | 10.s |
2379 ? | ? | 10.x || 10.10 | 10.x | 10.x |
2380 ? | 10.x | ? || 10.10 | 10.s | 10.s |
2381 ? | 10.x | 10.y || 10.10 | 10.x | 10.y |
2382 10.x | ? | ? || 10.x | 10.s | 10.s |
2383 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2384 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2385 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2388 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2389 for a detailed technical explanation of these variables
2391 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2395 AC_ARG_WITH(macosx-version-min-required,
2396 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2397 [set the minimum OS version needed to run the built LibreOffice])
2399 e. g.: --with-macos-version-min-required=10.10
2400 see --with-macosx-sdk for more info
2404 AC_ARG_WITH(macosx-version-max-allowed,
2405 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2406 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2408 e. g.: --with-macos-version-max-allowed=10.10
2409 see --with-macosx-sdk for more info
2414 dnl ===================================================================
2415 dnl options for stuff used during cross-compilation build
2416 dnl Not quite superseded by --with-build-platform-configure-options.
2417 dnl TODO: check, if the "force" option is still needed anywhere.
2418 dnl ===================================================================
2420 AC_ARG_WITH(system-icu-for-build,
2421 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2422 [Use icu already on system for build tools (cross-compilation only).]))
2425 dnl ===================================================================
2426 dnl Check for incompatible options set by fuzzing, and reset those
2427 dnl automatically to working combinations
2428 dnl ===================================================================
2430 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2431 "$enable_dbus" != "$enable_avahi"; then
2432 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2433 enable_avahi=$enable_dbus
2438 if ! echo "$LO_PATH" | $EGREP -q "(^|${P_SEP})$1($|${P_SEP})"; then
2439 LO_PATH="${LO_PATH:+$LO_PATH$P_SEP}$1"
2443 add_lopath_before ()
2448 for dir in $LO_PATH ; do
2449 if test "$dir" != "$1" ; then
2450 path_cleanup=${path_cleanup:+$path_cleanup$P_SEP}$dir
2453 LO_PATH="$1${path_cleanup:+$P_SEP$path_cleanup}"
2456 dnl ===================================================================
2457 dnl check for required programs (grep, awk, sed, bash)
2458 dnl ===================================================================
2462 if test -n "$1"; then
2463 if test "$build_os" = "cygwin"; then
2464 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2466 new_path=`cygpath -sm "$formatted_path"`
2469 new_path=`cygpath -u "$formatted_path"`
2474 if test "$2" = "after"; then
2475 add_lopath_after "$new_path"
2477 add_lopath_before "$new_path"
2484 AC_PATH_PROG( AWK, $AWK)
2485 if test -z "$AWK"; then
2486 AC_MSG_ERROR([install awk to run this script])
2489 AC_PATH_PROG(BASH, bash)
2490 if test -z "$BASH"; then
2491 AC_MSG_ERROR([bash not found in \$PATH])
2495 AC_MSG_CHECKING([for GNU or BSD tar])
2496 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2497 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2498 if test $? -eq 0; then
2503 AC_MSG_RESULT($GNUTAR)
2504 if test -z "$GNUTAR"; then
2505 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2509 AC_MSG_CHECKING([for tar's option to strip components])
2510 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2511 if test $? -eq 0; then
2512 STRIP_COMPONENTS="--strip-components"
2514 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2515 if test $? -eq 0; then
2516 STRIP_COMPONENTS="--strip-path"
2518 STRIP_COMPONENTS="unsupported"
2521 AC_MSG_RESULT($STRIP_COMPONENTS)
2522 if test x$STRIP_COMPONENTS = xunsupported; then
2523 AC_MSG_ERROR([you need a tar that is able to strip components.])
2525 AC_SUBST(STRIP_COMPONENTS)
2527 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2528 dnl desktop OSes from "mobile" ones.
2530 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2531 dnl In other words, that when building for an OS that is not a
2532 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2534 dnl Note the direction of the implication; there is no assumption that
2535 dnl cross-compiling would imply a non-desktop OS.
2537 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2538 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2539 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2540 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2543 # Whether to build "avmedia" functionality or not.
2545 if test -z "$enable_avmedia"; then
2549 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2550 if test "$enable_avmedia" = yes; then
2551 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2553 USE_AVMEDIA_DUMMY='TRUE'
2555 AC_SUBST(USE_AVMEDIA_DUMMY)
2557 # Decide whether to build database connectivity stuff (including
2558 # Base) or not. We probably don't want to on non-desktop OSes.
2559 if test -z "$enable_database_connectivity"; then
2560 # --disable-database-connectivity is unfinished work in progress
2561 # and the iOS test app doesn't link if we actually try to use it.
2562 # if test $_os != iOS -a $_os != Android; then
2563 if test $_os != iOS; then
2564 enable_database_connectivity=yes
2568 if test "$enable_database_connectivity" = yes; then
2569 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2570 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2573 if test -z "$enable_extensions"; then
2574 # For iOS and Android Viewer, disable extensions unless specifically overridden with --enable-extensions.
2575 if test $_os != iOS && test $_os != Android -o "$ENABLE_ANDROID_LOK" = TRUE ; then
2576 enable_extensions=yes
2580 if test "$enable_extensions" = yes; then
2581 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2582 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2585 if test -z "$enable_scripting"; then
2586 # Disable scripting for iOS unless specifically overridden
2587 # with --enable-scripting.
2588 if test $_os != iOS; then
2589 enable_scripting=yes
2593 DISABLE_SCRIPTING=''
2594 if test "$enable_scripting" = yes; then
2595 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2596 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2598 DISABLE_SCRIPTING='TRUE'
2599 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2602 if test $_os = iOS -o $_os = Android; then
2603 # Disable dynamic_loading always for iOS and Android
2604 enable_dynamic_loading=no
2605 elif test -z "$enable_dynamic_loading"; then
2606 # Otherwise enable it unless specifically disabled
2607 enable_dynamic_loading=yes
2610 DISABLE_DYNLOADING=''
2611 if test "$enable_dynamic_loading" = yes; then
2612 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2614 DISABLE_DYNLOADING='TRUE'
2616 AC_SUBST(DISABLE_DYNLOADING)
2618 # remember SYSBASE value
2621 dnl ===================================================================
2622 dnl Sort out various gallery compilation options
2623 dnl ===================================================================
2624 AC_MSG_CHECKING([how to build and package galleries])
2625 if test -n "${with_galleries}"; then
2626 if test "$with_galleries" = "build"; then
2627 WITH_GALLERY_BUILD=TRUE
2628 AC_MSG_RESULT([build from source images internally])
2629 elif test "$with_galleries" = "no"; then
2631 AC_MSG_RESULT([disable non-internal gallery build])
2633 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2636 if test $_os != iOS -a $_os != Android; then
2637 WITH_GALLERY_BUILD=TRUE
2638 AC_MSG_RESULT([internal src images for desktop])
2641 AC_MSG_RESULT([disable src image build])
2644 AC_SUBST(WITH_GALLERY_BUILD)
2646 dnl ===================================================================
2647 dnl Checks if ccache is available
2648 dnl ===================================================================
2650 if test "$_os" = "WINNT"; then
2651 # on windows/VC build do not use ccache
2653 elif test "$enable_ccache" = "no"; then
2655 elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2656 case "%$CC%$CXX%" in
2657 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2658 # assume that's good then
2659 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2660 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2661 CCACHE_DEPEND_MODE=1
2664 AC_PATH_PROG([CCACHE],[ccache],[not found])
2665 if test "$CCACHE" = "not found"; then
2668 CCACHE_DEPEND_MODE=1
2669 # Need to check for ccache version: otherwise prevents
2670 # caching of the results (like "-x objective-c++" for Mac)
2671 if test $_os = Darwin -o $_os = iOS; then
2672 # Check ccache version
2673 AC_MSG_CHECKING([whether version of ccache is suitable])
2674 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2675 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2676 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2677 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2679 AC_MSG_RESULT([no, $CCACHE_VERSION])
2690 if test "$enable_ccache" = "nodepend"; then
2691 CCACHE_DEPEND_MODE=""
2693 AC_SUBST(CCACHE_DEPEND_MODE)
2695 if test "$CCACHE" != ""; then
2696 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2697 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2698 if test "$ccache_size" = ""; then
2699 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2700 if test "$ccache_size" = ""; then
2703 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2704 if test $ccache_size -lt 1024; then
2706 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2707 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2709 # warn that ccache may be too small for debug build
2710 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2711 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2714 if test $ccache_size -lt 5; then
2715 #warn that ccache may be too small for debug build
2716 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2717 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2722 dnl ===================================================================
2723 dnl Checks for C compiler,
2724 dnl The check for the C++ compiler is later on.
2725 dnl ===================================================================
2726 if test "$_os" != "WINNT"; then
2728 AC_MSG_CHECKING([gcc home])
2729 if test -z "$with_gcc_home"; then
2730 if test "$enable_icecream" = "yes"; then
2731 if test -d "/usr/lib/icecc/bin"; then
2732 GCC_HOME="/usr/lib/icecc/"
2733 elif test -d "/usr/libexec/icecc/bin"; then
2734 GCC_HOME="/usr/libexec/icecc/"
2735 elif test -d "/opt/icecream/bin"; then
2736 GCC_HOME="/opt/icecream/"
2738 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
2742 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2743 GCC_HOME_SET="false"
2746 GCC_HOME="$with_gcc_home"
2748 AC_MSG_RESULT($GCC_HOME)
2751 if test "$GCC_HOME_SET" = "true"; then
2752 if test -z "$CC"; then
2753 CC="$GCC_HOME/bin/gcc"
2756 if test -z "$CXX"; then
2757 CXX="$GCC_HOME/bin/g++"
2763 COMPATH=`dirname "$CC"`
2764 if test "$COMPATH" = "."; then
2765 AC_PATH_PROGS(COMPATH, $CC)
2766 dnl double square bracket to get single because of M4 quote...
2767 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2769 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2771 dnl ===================================================================
2773 dnl ===================================================================
2774 AC_MSG_CHECKING([whether to build with Java support])
2775 if test "$with_java" != "no"; then
2776 if test "$DISABLE_SCRIPTING" = TRUE; then
2777 AC_MSG_RESULT([no, overridden by --disable-scripting])
2781 AC_MSG_RESULT([yes])
2783 AC_DEFINE(HAVE_FEATURE_JAVA)
2790 AC_SUBST(ENABLE_JAVA)
2792 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2794 dnl ENABLE_JAVA="" indicate no Java support at all
2796 dnl ===================================================================
2797 dnl Check macOS SDK and compiler
2798 dnl ===================================================================
2800 if test $_os = Darwin; then
2802 # If no --with-macosx-sdk option is given, look for one
2804 # The intent is that for "most" Mac-based developers, a suitable
2805 # SDK will be found automatically without any configure options.
2807 # For developers with a current Xcode, the lowest-numbered SDK
2808 # higher than or equal to the minimum required should be found.
2810 AC_MSG_CHECKING([what macOS SDK to use])
2811 for _macosx_sdk in ${with_macosx_sdk-10.15 10.14 10.13}; do
2812 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2813 if test -d "$MACOSX_SDK_PATH"; then
2814 with_macosx_sdk="${_macosx_sdk}"
2817 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2818 if test -d "$MACOSX_SDK_PATH"; then
2819 with_macosx_sdk="${_macosx_sdk}"
2824 if test ! -d "$MACOSX_SDK_PATH"; then
2825 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
2828 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2830 case $with_macosx_sdk in
2832 MACOSX_SDK_VERSION=101300
2835 MACOSX_SDK_VERSION=101400
2838 MACOSX_SDK_VERSION=101500
2841 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.13--15])
2845 if test "$with_macosx_version_min_required" = "" ; then
2846 with_macosx_version_min_required="10.10";
2849 if test "$with_macosx_version_max_allowed" = "" ; then
2850 with_macosx_version_max_allowed="$with_macosx_sdk"
2853 # export this so that "xcrun" invocations later return matching values
2854 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2855 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2856 export DEVELOPER_DIR
2857 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2858 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2860 AC_MSG_CHECKING([whether Xcode is new enough])
2861 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
2862 my_xcode_ver2=${my_xcode_ver1#Xcode }
2863 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
2864 if test "$my_xcode_ver3" -ge 1103; then
2865 AC_MSG_RESULT([yes ($my_xcode_ver2)])
2867 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 11.3])
2870 case "$with_macosx_version_min_required" in
2872 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2875 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2878 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2881 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2884 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
2887 MAC_OS_X_VERSION_MIN_REQUIRED="101500"
2890 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--15])
2894 LIBTOOL=/usr/bin/libtool
2895 INSTALL_NAME_TOOL=install_name_tool
2896 if test -z "$save_CC"; then
2897 stdlib=-stdlib=libc++
2898 if test "$ENABLE_LTO" = TRUE; then
2902 AC_MSG_CHECKING([what C compiler to use])
2903 CC="`xcrun -find clang`"
2904 CC_BASE=`first_arg_basename "$CC"`
2905 CC+=" -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2906 AC_MSG_RESULT([$CC])
2908 AC_MSG_CHECKING([what C++ compiler to use])
2909 CXX="`xcrun -find clang++`"
2910 CXX_BASE=`first_arg_basename "$CXX"`
2911 CXX+=" -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2912 AC_MSG_RESULT([$CXX])
2914 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2917 STRIP=`xcrun -find strip`
2918 LIBTOOL=`xcrun -find libtool`
2919 RANLIB=`xcrun -find ranlib`
2922 case "$with_macosx_version_max_allowed" in
2924 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2927 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2930 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2933 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2936 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
2939 MAC_OS_X_VERSION_MAX_ALLOWED="101500"
2942 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--15])
2946 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2947 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2948 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])
2953 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2954 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2955 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2959 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2960 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2962 AC_MSG_CHECKING([whether to do code signing])
2964 if test "$enable_macosx_code_signing" = yes; then
2965 # By default use the first suitable certificate (?).
2967 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2968 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2969 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2970 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2971 # "Developer ID Application" one.
2973 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2974 if test -n "$identity"; then
2975 MACOSX_CODESIGNING_IDENTITY=$identity
2976 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2977 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2979 AC_MSG_ERROR([cannot determine identity to use])
2981 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2982 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2983 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2984 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2989 AC_MSG_CHECKING([whether to create a Mac App Store package])
2991 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2992 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2993 elif test "$enable_macosx_package_signing" = yes; then
2994 # By default use the first suitable certificate.
2995 # It should be a "3rd Party Mac Developer Installer" one
2997 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2998 if test -n "$identity"; then
2999 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
3000 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3001 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3003 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
3005 elif test -n "$enable_macosx_package_signing"; then
3006 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
3007 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3008 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3013 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
3014 AC_MSG_ERROR([You should not use the same identity for code and package signing])
3017 AC_MSG_CHECKING([whether to sandbox the application])
3019 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3020 AC_MSG_ERROR([macOS sandboxing requires code signing])
3021 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3022 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
3023 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3024 ENABLE_MACOSX_SANDBOX=TRUE
3025 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3026 AC_MSG_RESULT([yes])
3031 AC_MSG_CHECKING([what macOS app bundle identifier to use])
3032 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3033 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3035 AC_SUBST(MACOSX_SDK_PATH)
3036 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3037 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3038 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
3039 AC_SUBST(INSTALL_NAME_TOOL)
3040 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
3041 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3042 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3043 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3044 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3046 dnl ===================================================================
3047 dnl Check iOS SDK and compiler
3048 dnl ===================================================================
3050 if test $_os = iOS; then
3051 AC_MSG_CHECKING([what iOS SDK to use])
3052 current_sdk_ver=13.4
3053 older_sdk_vers="13.2 13.1 13.0 12.4 12.2"
3054 if test "$enable_ios_simulator" = "yes"; then
3055 platform=iPhoneSimulator
3056 versionmin=-mios-simulator-version-min=12.2
3059 versionmin=-miphoneos-version-min=12.2
3061 xcode_developer=`xcode-select -print-path`
3063 for sdkver in $current_sdk_ver $older_sdk_vers; do
3064 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3071 if test -z "$sysroot"; then
3072 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
3075 AC_MSG_RESULT($sysroot)
3077 # LTO is not really recommended for iOS builds,
3078 # the link time will be astronomical
3079 if test "$ENABLE_LTO" = TRUE; then
3083 stdlib="-stdlib=libc++"
3085 AC_MSG_CHECKING([what C compiler to use])
3086 CC="`xcrun -find clang`"
3087 CC_BASE=`first_arg_basename "$CC"`
3088 CC+=" -arch $host_cpu -isysroot $sysroot $lto $versionmin"
3089 AC_MSG_RESULT([$CC])
3091 AC_MSG_CHECKING([what C++ compiler to use])
3092 CXX="`xcrun -find clang++`"
3093 CXX_BASE=`first_arg_basename "$CXX"`
3094 CXX+=" -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
3095 AC_MSG_RESULT([$CXX])
3097 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3100 STRIP=`xcrun -find strip`
3101 LIBTOOL=`xcrun -find libtool`
3102 RANLIB=`xcrun -find ranlib`
3105 AC_MSG_CHECKING([whether to treat the installation as read-only])
3107 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3108 "$enable_extensions" != yes; then
3109 enable_readonly_installset=yes
3111 if test "$enable_readonly_installset" = yes; then
3112 AC_MSG_RESULT([yes])
3113 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3118 dnl ===================================================================
3119 dnl Structure of install set
3120 dnl ===================================================================
3122 if test $_os = Darwin; then
3123 LIBO_BIN_FOLDER=MacOS
3124 LIBO_ETC_FOLDER=Resources
3125 LIBO_LIBEXEC_FOLDER=MacOS
3126 LIBO_LIB_FOLDER=Frameworks
3127 LIBO_LIB_PYUNO_FOLDER=Resources
3128 LIBO_SHARE_FOLDER=Resources
3129 LIBO_SHARE_HELP_FOLDER=Resources/help
3130 LIBO_SHARE_JAVA_FOLDER=Resources/java
3131 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3132 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3133 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3134 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3135 LIBO_URE_BIN_FOLDER=MacOS
3136 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3137 LIBO_URE_LIB_FOLDER=Frameworks
3138 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3139 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3140 elif test $_os = WINNT; then
3141 LIBO_BIN_FOLDER=program
3142 LIBO_ETC_FOLDER=program
3143 LIBO_LIBEXEC_FOLDER=program
3144 LIBO_LIB_FOLDER=program
3145 LIBO_LIB_PYUNO_FOLDER=program
3146 LIBO_SHARE_FOLDER=share
3147 LIBO_SHARE_HELP_FOLDER=help
3148 LIBO_SHARE_JAVA_FOLDER=program/classes
3149 LIBO_SHARE_PRESETS_FOLDER=presets
3150 LIBO_SHARE_READMES_FOLDER=readmes
3151 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3152 LIBO_SHARE_SHELL_FOLDER=program/shell
3153 LIBO_URE_BIN_FOLDER=program
3154 LIBO_URE_ETC_FOLDER=program
3155 LIBO_URE_LIB_FOLDER=program
3156 LIBO_URE_MISC_FOLDER=program
3157 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3159 LIBO_BIN_FOLDER=program
3160 LIBO_ETC_FOLDER=program
3161 LIBO_LIBEXEC_FOLDER=program
3162 LIBO_LIB_FOLDER=program
3163 LIBO_LIB_PYUNO_FOLDER=program
3164 LIBO_SHARE_FOLDER=share
3165 LIBO_SHARE_HELP_FOLDER=help
3166 LIBO_SHARE_JAVA_FOLDER=program/classes
3167 LIBO_SHARE_PRESETS_FOLDER=presets
3168 LIBO_SHARE_READMES_FOLDER=readmes
3169 if test "$enable_fuzzers" != yes; then
3170 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3172 LIBO_SHARE_RESOURCE_FOLDER=resource
3174 LIBO_SHARE_SHELL_FOLDER=program/shell
3175 LIBO_URE_BIN_FOLDER=program
3176 LIBO_URE_ETC_FOLDER=program
3177 LIBO_URE_LIB_FOLDER=program
3178 LIBO_URE_MISC_FOLDER=program
3179 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3181 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3182 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3183 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3184 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3185 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3186 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3187 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3188 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3189 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3190 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3191 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3192 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3193 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3194 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3195 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3196 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3198 # Not all of them needed in config_host.mk, add more if need arises
3199 AC_SUBST(LIBO_BIN_FOLDER)
3200 AC_SUBST(LIBO_ETC_FOLDER)
3201 AC_SUBST(LIBO_LIB_FOLDER)
3202 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3203 AC_SUBST(LIBO_SHARE_FOLDER)
3204 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3205 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3206 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3207 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3208 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3209 AC_SUBST(LIBO_URE_BIN_FOLDER)
3210 AC_SUBST(LIBO_URE_ETC_FOLDER)
3211 AC_SUBST(LIBO_URE_LIB_FOLDER)
3212 AC_SUBST(LIBO_URE_MISC_FOLDER)
3213 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3215 dnl ===================================================================
3216 dnl Windows specific tests and stuff
3217 dnl ===================================================================
3221 # Return value: $regvalue
3224 local _regentry="/proc/registry${1}/${2}"
3225 if test -f "$_regentry"; then
3226 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3227 # Registry keys read via /proc/registry* are always \0 terminated!
3228 local _regvalue=$(tr -d '\0' < "$_regentry")
3229 if test $? -eq 0; then
3235 # Get a value from the 32-bit side of the Registry
3238 reg_get_value "32" "$1"
3241 # Get a value from the 64-bit side of the Registry
3244 reg_get_value "64" "$1"
3247 if test "$_os" = "WINNT"; then
3248 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3249 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3251 WINDOWS_SDK_ARCH="x86"
3253 AC_MSG_RESULT([yes])
3254 WINDOWS_SDK_ARCH="x64"
3258 if test "$_os" = "iOS"; then
3259 cross_compiling="yes"
3262 if test "$cross_compiling" = "yes"; then
3263 export CROSS_COMPILING=TRUE
3266 BUILD_TYPE="$BUILD_TYPE NATIVE"
3268 AC_SUBST(CROSS_COMPILING)
3270 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3271 # NOTE: must _not_ be used for bundled external libraries!
3273 if test "$GCC" = "yes"; then
3274 AC_MSG_CHECKING( for -isystem )
3276 CFLAGS="$CFLAGS -Werror"
3277 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3279 if test -n "$ISYSTEM"; then
3285 if test -z "$ISYSTEM"; then
3286 # fall back to using -I
3291 dnl ===================================================================
3292 dnl Check which Visual Studio compiler is used
3293 dnl ===================================================================
3295 map_vs_year_to_version()
3297 # Return value: $vsversion
3305 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3309 vs_versions_to_check()
3311 # Args: $1 (optional) : versions to check, in the order of preference
3312 # Return value: $vsversions
3316 if test -n "$1"; then
3317 map_vs_year_to_version "$1"
3318 vsversions=$vsversion
3320 # We accept only 2019
3325 win_get_env_from_vsvars32bat()
3327 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3328 # Also seems to be located in another directory under the same name: vsvars32.bat
3329 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3330 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3331 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3332 chmod +x $WRAPPERBATCHFILEPATH
3333 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3334 rm -f $WRAPPERBATCHFILEPATH
3335 printf '%s' "$_win_get_env_from_vsvars32bat"
3340 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3341 if test -n "$regvalue"; then
3342 PathFormat "$regvalue"
3343 UCRTSDKDIR=$formatted_path
3344 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3345 UCRTVERSION=$regvalue
3347 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3351 if test -z "$UCRTSDKDIR"; then
3352 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3353 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3354 if test -f "$ide_env_file"; then
3355 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3356 UCRTSDKDIR=$formatted_path
3357 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3358 dnl Hack needed at least by tml:
3359 if test "$UCRTVERSION" = 10.0.15063.0 \
3360 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3361 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3363 UCRTVERSION=10.0.14393.0
3366 AC_MSG_ERROR([No UCRT found])
3373 # Find Visual C++ 2019
3374 # Args: $1 (optional) : The VS version year
3375 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3377 unset vctest vcnum vcnumwithdot vcbuildnumber
3379 vs_versions_to_check "$1"
3380 vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
3381 vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
3382 PathFormat "$vswhere"
3383 vswhere=$formatted_path
3384 for ver in $vsversions; do
3385 vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
3386 # Fall back to all MS products (this includes VC++ Build Tools)
3387 if ! test -n "$vswhereoutput"; then
3388 AC_MSG_CHECKING([VC++ Build Tools and similar])
3389 vswhereoutput=`$vswhere -products \* -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
3391 if test -n "$vswhereoutput"; then
3392 PathFormat "$vswhereoutput"
3393 vctest=$formatted_path
3398 if test -n "$vctest"; then
3399 vcnumwithdot="$ver.0"
3400 case "$vcnumwithdot" in
3406 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3414 if test "$_os" = "WINNT"; then
3415 AC_MSG_CHECKING([Visual C++])
3416 find_msvc "$with_visual_studio"
3417 if test -z "$vctest"; then
3418 if test -n "$with_visual_studio"; then
3419 AC_MSG_ERROR([no Visual Studio $with_visual_studio installation found])
3421 AC_MSG_ERROR([no Visual Studio 2019 installation found])
3425 if test "$BITNESS_OVERRIDE" = ""; then
3426 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3427 VC_PRODUCT_DIR=$vctest/VC
3429 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86])
3432 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3433 VC_PRODUCT_DIR=$vctest/VC
3435 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64])
3438 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3440 AC_MSG_CHECKING([for short pathname of VC product directory])
3441 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3442 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3447 AC_MSG_CHECKING([for UCRT location])
3449 # find_ucrt errors out if it doesn't find it
3450 AC_MSG_RESULT([found])
3451 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3452 ucrtincpath_formatted=$formatted_path
3453 # SOLARINC is used for external modules and must be set too.
3454 # And no, it's not sufficient to set SOLARINC only, as configure
3455 # itself doesn't honour it.
3456 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3457 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3458 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3459 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3461 AC_SUBST(UCRTSDKDIR)
3462 AC_SUBST(UCRTVERSION)
3464 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3465 # Find the proper version of MSBuild.exe to use based on the VS version
3466 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3467 if test -n "$regvalue" ; then
3468 AC_MSG_RESULT([found: $regvalue])
3469 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3471 if test "$vcnumwithdot" = "16.0"; then
3472 if test "$BITNESS_OVERRIDE" = ""; then
3473 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
3475 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
3478 if test "$BITNESS_OVERRIDE" = ""; then
3479 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3481 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3484 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3485 AC_MSG_RESULT([$regvalue])
3488 # Find the version of devenv.exe
3489 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3490 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3491 if test ! -e "$DEVENV"; then
3492 AC_MSG_WARN([No devenv.exe found - this is expected for VC++ Build Tools])
3495 dnl ===========================================================
3496 dnl Check for the corresponding mspdb*.dll
3497 dnl ===========================================================
3503 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3504 VC_HOST_DIR="HostX64"
3505 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3507 VC_HOST_DIR="HostX86"
3508 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3511 if test "$BITNESS_OVERRIDE" = ""; then
3512 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3514 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3517 # MSVC 15.0 has libraries from 14.0?
3520 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3521 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3524 dnl The path needs to be added before cl is called
3525 TEMP_PATH=`cygpath -d "$MSPDB_PATH"`
3526 PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
3528 AC_MSG_CHECKING([cl.exe])
3530 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3531 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3532 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3535 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3536 dnl needed when building CLR code:
3537 if test -z "$MSVC_CXX"; then
3538 if test -f "$CL_PATH/cl.exe"; then
3539 MSVC_CXX="$CL_PATH/cl.exe"
3542 # This gives us a posix path with 8.3 filename restrictions
3543 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3546 if test -z "$CC"; then
3548 CC_BASE=`first_arg_basename "$CC"`
3550 if test "$BITNESS_OVERRIDE" = ""; then
3551 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3552 MSVC_CXX="$MSVC_CXX -arch:SSE"
3554 if test -z "$CXX"; then
3556 CXX_BASE=`first_arg_basename "$CXX"`
3559 if test -n "$CC"; then
3560 # Remove /cl.exe from CC case insensitive
3561 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3562 if test "$BITNESS_OVERRIDE" = ""; then
3563 COMPATH="$VC_PRODUCT_DIR"
3565 if test -n "$VC_PRODUCT_DIR"; then
3566 COMPATH=$VC_PRODUCT_DIR
3569 if test "$BITNESS_OVERRIDE" = ""; then
3570 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3574 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3576 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3578 PathFormat "$COMPATH"
3579 COMPATH=`win_short_path_for_make "$formatted_path"`
3583 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3584 # are always "better", we list them in reverse chronological order.
3588 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
3592 # The expectation is that --with-windows-sdk should not need to be used
3593 if test -n "$with_windows_sdk"; then
3594 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3595 *" "$with_windows_sdk" "*)
3596 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3599 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $vcyear])
3604 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3609 AC_MSG_ERROR([Visual C++ not found after all, huh])
3612 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.4])
3613 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3614 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
3615 // between Visual Studio versions and _MSC_VER:
3619 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
3621 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3622 # version of the Explorer extension (and maybe other small
3623 # bits, too) needed when installing a 32-bit LibreOffice on a
3624 # 64-bit OS. The 64-bit Explorer extension is a feature that
3625 # has been present since long in OOo. Don't confuse it with
3626 # building LibreOffice itself as 64-bit code.
3631 if test "$BITNESS_OVERRIDE" = ""; then
3632 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3633 if test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib" || \
3634 test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/spectre/x64/atls.lib"; then
3635 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3637 CXX_X64_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe"`
3640 if test "$BUILD_X64" = TRUE; then
3641 AC_MSG_RESULT([found])
3643 AC_MSG_RESULT([not found])
3644 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3651 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3652 AC_SUBST(CXX_X64_BINARY)
3654 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
3655 # needed to support TWAIN scan on both 32- and 64-bit systems
3659 if test "$BITNESS_OVERRIDE" = "64"; then
3660 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
3661 if test -n "$CXX_X86_BINARY"; then
3663 AC_MSG_RESULT([preset])
3664 elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then
3666 CXX_X86_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe"`
3667 CXX_X86_BINARY+=" /arch:SSE"
3668 AC_MSG_RESULT([found])
3671 AC_MSG_RESULT([not found])
3672 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
3676 CXX_X86_BINARY=$MSVC_CXX
3679 AC_SUBST(CXX_X86_BINARY)
3688 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3689 AC_SUBST(UNOWINREG_DLL)
3692 AC_MSG_CHECKING([whether the compiler is actually Clang])
3693 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3699 [AC_MSG_RESULT([yes])
3701 [AC_MSG_RESULT([no])])
3702 AC_SUBST(COM_IS_CLANG)
3706 if test "$COM_IS_CLANG" = TRUE; then
3707 AC_MSG_CHECKING([whether Clang is new enough])
3708 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3709 #if !defined __apple_build_version__
3713 [my_apple_clang=yes],[my_apple_clang=])
3714 if test "$my_apple_clang" = yes; then
3715 AC_MSG_RESULT([assumed yes (Apple Clang)])
3717 if test "$_os" = WINNT; then
3718 dnl In which case, assume clang-cl:
3720 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3728 CC_PLAIN="$CC_PLAIN $i"
3735 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args - | sed 's/ //g'`
3736 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3737 CLANGVER=`echo $clang_version \
3738 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3739 if test "$CLANGVER" -ge 50002; then
3740 AC_MSG_RESULT([yes ($clang_version)])
3742 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
3744 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3745 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3749 SHOWINCLUDES_PREFIX=
3750 if test "$_os" = WINNT; then
3751 dnl We need to guess the prefix of the -showIncludes output, it can be
3753 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3754 echo "#include <stdlib.h>" > conftest.c
3755 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3756 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3757 rm -f conftest.c conftest.obj
3758 if test -z "$SHOWINCLUDES_PREFIX"; then
3759 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3761 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3764 AC_SUBST(SHOWINCLUDES_PREFIX)
3767 # prefix C with ccache if needed
3769 if test "$CCACHE" != ""; then
3770 AC_MSG_CHECKING([whether $CC_BASE is already ccached])
3774 CFLAGS="$CFLAGS --ccache-skip -O2"
3775 dnl an empty program will do, we're checking the compiler flags
3776 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3777 [use_ccache=yes], [use_ccache=no])
3778 if test $use_ccache = yes; then
3779 AC_MSG_RESULT([yes])
3782 CC_BASE="ccache $CC_BASE"
3789 # ===================================================================
3790 # check various GCC options that Clang does not support now but maybe
3791 # will somewhen in the future, check them even for GCC, so that the
3793 # ===================================================================
3796 if test "$GCC" = "yes"; then
3797 AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
3799 CFLAGS="$CFLAGS -Werror -ggdb2"
3800 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3802 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3803 AC_MSG_RESULT([yes])
3808 if test "$host_cpu" = "m68k"; then
3809 AC_MSG_CHECKING([whether $CC_BASE supports -mlong-jump-table-offsets])
3811 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3812 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3814 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3815 AC_MSG_RESULT([yes])
3821 AC_SUBST(HAVE_GCC_GGDB2)
3823 dnl ===================================================================
3824 dnl Test the gcc version
3825 dnl ===================================================================
3826 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3827 AC_MSG_CHECKING([the GCC version])
3828 _gcc_version=`$CC -dumpversion`
3829 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3830 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3831 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3833 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3835 if test "$gcc_full_version" -lt 70000; then
3836 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 7.0.0])
3839 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3840 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3841 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3842 # (which reports itself as GCC 4.2.1).
3845 AC_SUBST(GCC_VERSION)
3847 dnl Set the ENABLE_DBGUTIL variable
3848 dnl ===================================================================
3849 AC_MSG_CHECKING([whether to build with additional debug utilities])
3850 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3851 ENABLE_DBGUTIL="TRUE"
3852 # this is an extra var so it can have different default on different MSVC
3853 # versions (in case there are version specific problems with it)
3854 MSVC_USE_DEBUG_RUNTIME="TRUE"
3856 AC_MSG_RESULT([yes])
3857 # cppunit and graphite expose STL in public headers
3858 if test "$with_system_cppunit" = "yes"; then
3859 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3861 with_system_cppunit=no
3863 if test "$with_system_graphite" = "yes"; then
3864 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3866 with_system_graphite=no
3868 if test "$with_system_orcus" = "yes"; then
3869 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3871 with_system_orcus=no
3873 if test "$with_system_libcmis" = "yes"; then
3874 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3876 with_system_libcmis=no
3878 if test "$with_system_hunspell" = "yes"; then
3879 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3881 with_system_hunspell=no
3883 if test "$with_system_gpgmepp" = "yes"; then
3884 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3886 with_system_gpgmepp=no
3888 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
3889 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
3890 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
3891 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
3892 # of those two is using the system variant:
3893 if test "$with_system_libnumbertext" = "yes"; then
3894 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
3896 with_system_libnumbertext=no
3898 if test "$with_system_libwps" = "yes"; then
3899 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
3901 with_system_libwps=no
3905 MSVC_USE_DEBUG_RUNTIME=""
3908 AC_SUBST(ENABLE_DBGUTIL)
3909 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3911 dnl Set the ENABLE_DEBUG variable.
3912 dnl ===================================================================
3913 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3914 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
3916 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3917 if test -z "$libo_fuzzed_enable_debug"; then
3918 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3920 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3925 AC_MSG_CHECKING([whether to do a debug build])
3926 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3928 if test -n "$ENABLE_DBGUTIL" ; then
3929 AC_MSG_RESULT([yes (dbgutil)])
3931 AC_MSG_RESULT([yes])
3937 AC_SUBST(ENABLE_DEBUG)
3939 dnl ===================================================================
3940 dnl Select the linker to use (gold/lld/ld.bfd).
3941 dnl This is done only after compiler checks (need to know if Clang is
3942 dnl used, for different defaults) and after checking if a debug build
3943 dnl is wanted (non-debug builds get the default linker if not explicitly
3944 dnl specified otherwise).
3945 dnl All checks for linker features/options should come after this.
3946 dnl ===================================================================
3950 use_ld_fail_if_error=$2
3952 AC_MSG_CHECKING([for -fuse-ld=$use_ld linker support])
3953 use_ld_ldflags_save="$LDFLAGS"
3954 LDFLAGS="$LDFLAGS -fuse-ld=$use_ld"
3955 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3958 printf ("hello world\n");
3959 ])], USE_LD=$use_ld, [])
3960 if test -n "$USE_LD"; then
3961 AC_MSG_RESULT( yes )
3964 if test -n "$use_ld_fail_if_error"; then
3970 if test -n "$use_ld_ok"; then
3971 dnl keep the value of LDFLAGS
3974 LDFLAGS="$use_ld_ldflags_save"
3978 if test "$enable_ld" != "no"; then
3979 if test "$GCC" = "yes"; then
3980 if test -n "$enable_ld"; then
3981 check_use_ld "$enable_ld" fail_if_error
3982 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3983 dnl non-debug builds default to the default linker
3985 elif test -n "$COM_IS_CLANG"; then
3987 if test $? -ne 0; then
3991 # For gcc first try gold, new versions also support lld.
3993 if test $? -ne 0; then
3997 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
3999 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD)')
4000 if test -z "$ld_used"; then
4003 AC_MSG_CHECKING([for linker that is used])
4004 AC_MSG_RESULT([$ld_used])
4005 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4006 if echo "$ld_used" | grep -q "^GNU ld"; then
4007 AC_MSG_WARN([The default GNU linker is slow, consider using the LLD or the GNU gold linker.])
4008 add_warning "The default GNU linker is slow, consider using the LLD or the GNU gold linker."
4012 if test "$enable_ld" = "yes"; then
4013 AC_MSG_ERROR([--enable-ld not supported])
4019 HAVE_LD_BSYMBOLIC_FUNCTIONS=
4020 if test "$GCC" = "yes"; then
4021 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
4022 bsymbolic_functions_ldflags_save=$LDFLAGS
4023 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
4024 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4027 printf ("hello world\n");
4028 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
4029 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
4030 AC_MSG_RESULT( found )
4032 AC_MSG_RESULT( not found )
4034 LDFLAGS=$bsymbolic_functions_ldflags_save
4036 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
4039 if test "$GCC" = "yes"; then
4040 for flag in "--gc-sections" "-dead_strip"; do
4041 AC_MSG_CHECKING([for $flag linker support])
4042 ldflags_save=$LDFLAGS
4043 LDFLAGS="$LDFLAGS -Wl,$flag"
4044 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4047 printf ("hello world\n");
4049 LD_GC_SECTIONS="-Wl,$flag"
4050 AC_MSG_RESULT( found )
4052 AC_MSG_RESULT( not found )
4054 LDFLAGS=$ldflags_save
4055 if test -n "$LD_GC_SECTIONS"; then
4060 AC_SUBST(LD_GC_SECTIONS)
4063 if test "$enable_split_debug" != no; then
4064 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
4065 if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4066 AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
4068 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
4069 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
4071 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
4072 AC_MSG_RESULT([yes])
4074 if test "$enable_split_debug" = yes; then
4081 if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4082 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
4083 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
4086 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
4089 if test "$enable_gdb_index" != "no"; then
4090 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
4091 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -o -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4092 AC_MSG_CHECKING([whether $CC_BASE supports -ggnu-pubnames])
4094 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
4096 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
4097 if test "$have_ggnu_pubnames" != "TRUE"; then
4098 if test "$enable_gdb_index" = "yes"; then
4099 AC_MSG_ERROR( no, --enable-gdb-index not supported )
4104 AC_MSG_RESULT( yes )
4105 AC_MSG_CHECKING([whether $CC_BASE supports -Wl,--gdb-index])
4106 ldflags_save=$LDFLAGS
4107 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
4108 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4111 printf ("hello world\n");
4112 ])], ENABLE_GDB_INDEX=TRUE, [])
4113 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
4114 AC_MSG_RESULT( yes )
4116 if test "$enable_gdb_index" = "yes"; then
4122 LDFLAGS=$ldflags_save
4126 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4127 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
4128 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
4131 AC_SUBST(ENABLE_GDB_INDEX)
4133 if test "$enable_sal_log" = yes; then
4136 AC_SUBST(ENABLE_SAL_LOG)
4138 dnl Check for enable symbols option
4139 dnl ===================================================================
4140 AC_MSG_CHECKING([whether to generate debug information])
4141 if test -z "$enable_symbols"; then
4142 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4148 if test "$enable_symbols" = yes; then
4149 ENABLE_SYMBOLS_FOR=all
4150 AC_MSG_RESULT([yes])
4151 elif test "$enable_symbols" = no; then
4155 # Selective debuginfo.
4156 ENABLE_SYMBOLS_FOR="$enable_symbols"
4157 AC_MSG_RESULT([for "$enable_symbols"])
4159 AC_SUBST(ENABLE_SYMBOLS_FOR)
4161 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
4162 # Building on Android with full symbols: without enough memory the linker never finishes currently.
4163 AC_MSG_CHECKING([whether enough memory is available for linking])
4164 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
4165 # Check for 15GB, as Linux reports a bit less than the physical memory size.
4166 if test -n "$mem_size" -a $mem_size -lt 15728640; then
4167 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
4169 AC_MSG_RESULT([yes])
4174 ENABLE_OPTIMIZED_DEBUG=
4175 AC_MSG_CHECKING([whether to compile with optimization flags])
4176 if test -z "$enable_optimized"; then
4177 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4180 enable_optimized=yes
4183 if test "$enable_optimized" = yes; then
4184 ENABLE_OPTIMIZED=TRUE
4185 AC_MSG_RESULT([yes])
4186 elif test "$enable_optimized" = debug; then
4187 ENABLE_OPTIMIZED_DEBUG=TRUE
4188 AC_MSG_RESULT([yes (debug)])
4190 if test "$GCC" = "yes"; then
4191 AC_MSG_CHECKING([whether $CC_BASE supports -Og])
4193 CFLAGS="$CFLAGS -Werror -Og"
4194 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_OG=TRUE ],[])
4196 if test "$HAVE_GCC_OG" = "TRUE"; then
4197 AC_MSG_RESULT([yes])
4202 if test -z "$HAVE_GCC_OG"; then
4203 AC_MSG_ERROR([The compiler does not support optimizations suitable for debugging.])
4208 AC_SUBST(ENABLE_OPTIMIZED)
4209 AC_SUBST(ENABLE_OPTIMIZED_DEBUG)
4212 # determine CPUNAME, OS, ...
4213 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
4224 PLATFORMID=aix_powerpc
4233 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4240 if test "$BITNESS_OVERRIDE" = 64; then
4243 PLATFORMID=windows_x86_64
4245 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4249 PLATFORMID=windows_x86
4253 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4256 SCPDEFS="$SCPDEFS -D_MSC_VER"
4268 AC_MSG_ERROR([Can't build 32-bit code for iOS])
4273 if test "$enable_ios_simulator" = "yes"; then
4274 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
4278 PLATFORMID=ios_arm64
4282 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4285 if test "$enable_ios_simulator" = "yes"; then
4290 PLATFORMID=macosx_x86_64
4293 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4309 PLATFORMID=dragonfly_x86
4314 PLATFORMID=dragonfly_x86_64
4317 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4333 PLATFORMID=freebsd_x86
4338 PLATFORMID=freebsd_x86_64
4341 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4358 PLATFORMID=haiku_x86
4363 PLATFORMID=haiku_x86_64
4366 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4383 PLATFORMID=kfreebsd_x86
4388 PLATFORMID=kfreebsd_x86_64
4391 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4407 PLATFORMID=linux_aarch64
4413 PLATFORMID=linux_alpha
4419 PLATFORMID=linux_arm_eabi
4423 PLATFORMID=linux_arm_oabi
4431 PLATFORMID=linux_hppa
4436 PLATFORMID=linux_x86
4441 PLATFORMID=linux_ia64
4447 PLATFORMID=linux_mips_eb
4452 EPM_FLAGS="-a mips64"
4453 PLATFORMID=linux_mips64_eb
4458 EPM_FLAGS="-a mips64el"
4459 PLATFORMID=linux_mips64_el
4464 EPM_FLAGS="-a mipsel"
4465 PLATFORMID=linux_mips_el
4470 PLATFORMID=linux_m68k
4475 PLATFORMID=linux_powerpc
4480 PLATFORMID=linux_powerpc64
4484 RTL_ARCH=PowerPC_64_LE
4485 PLATFORMID=linux_powerpc64_le
4490 PLATFORMID=linux_sparc
4495 PLATFORMID=linux_sparc64
4500 PLATFORMID=linux_s390
4505 PLATFORMID=linux_s390x
4510 PLATFORMID=linux_x86_64
4513 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4530 PLATFORMID=android_arm_eabi
4535 PLATFORMID=android_aarch64
4540 PLATFORMID=android_x86
4545 PLATFORMID=android_x86_64
4548 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4564 PLATFORMID=netbsd_x86
4569 PLATFORMID=netbsd_powerpc
4574 PLATFORMID=netbsd_sparc
4579 PLATFORMID=netbsd_x86_64
4582 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4598 PLATFORMID=openbsd_x86
4603 PLATFORMID=openbsd_x86_64
4606 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4609 SOLARINC="$SOLARINC -I/usr/local/include"
4623 PLATFORMID=solaris_x86
4628 PLATFORMID=solaris_sparc
4633 PLATFORMID=solaris_sparc64
4636 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4639 SOLARINC="$SOLARINC -I/usr/local/include"
4643 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4647 if test "$with_x" = "no"; then
4648 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4652 if test "$enable_gui" = "no"; then
4653 if test "$USING_X11" != TRUE; then
4654 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4658 AC_DEFINE(HAVE_FEATURE_UI,0)
4661 AC_SUBST(DISABLE_GUI)
4663 WORKDIR="${BUILDDIR}/workdir"
4664 INSTDIR="${BUILDDIR}/instdir"
4665 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4666 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4667 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4675 AC_SUBST([INSTROOT])
4676 AC_SUBST([INSTROOTBASE])
4680 AC_SUBST(PLATFORMID)
4681 AC_SUBST(WINDOWS_X64)
4682 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4684 dnl ===================================================================
4685 dnl Test which package format to use
4686 dnl ===================================================================
4687 AC_MSG_CHECKING([which package format to use])
4688 if test -n "$with_package_format" -a "$with_package_format" != no; then
4689 for i in $with_package_format; do
4691 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4694 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4695 aix - AIX software distribution
4696 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4697 deb - Debian software distribution
4698 pkg - Solaris software distribution
4699 rpm - RedHat software distribution
4701 LibreOffice additionally supports:
4702 archive - .tar.gz or .zip
4704 installed - installation tree
4710 # fakeroot is needed to ensure correct file ownerships/permissions
4711 # inside deb packages and tar archives created on Linux and Solaris.
4712 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4713 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4714 if test "$FAKEROOT" = "no"; then
4716 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4719 PKGFORMAT="$with_package_format"
4720 AC_MSG_RESULT([$PKGFORMAT])
4723 AC_MSG_RESULT([none])
4727 dnl ===================================================================
4728 dnl Set up a different compiler to produce tools to run on the build
4729 dnl machine when doing cross-compilation
4730 dnl ===================================================================
4732 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4733 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4734 if test "$cross_compiling" = "yes"; then
4735 AC_MSG_CHECKING([for BUILD platform configuration])
4737 rm -rf CONF-FOR-BUILD config_build.mk
4738 mkdir CONF-FOR-BUILD
4739 # Here must be listed all files needed when running the configure script. In particular, also
4740 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4741 # keep them in the same order as there.
4742 (cd $SRC_ROOT && tar cf - \
4744 bin/get_config_variables \
4745 solenv/bin/getcompver.awk \
4746 solenv/inc/langlist.mk \
4749 config_host_lang.mk.in \
4751 bin/bffvalidator.sh.in \
4752 bin/odfvalidator.sh.in \
4753 bin/officeotron.sh.in \
4754 instsetoo_native/util/openoffice.lst.in \
4756 sysui/desktop/macosx/Info.plist.in) \
4757 | (cd CONF-FOR-BUILD && tar xf -)
4758 cp configure CONF-FOR-BUILD
4759 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4761 unset COM USING_X11 OS CPUNAME
4762 unset CC CXX SYSBASE CFLAGS
4763 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4764 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4765 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4766 if test -n "$CC_FOR_BUILD"; then
4767 export CC="$CC_FOR_BUILD"
4768 CC_BASE=`first_arg_basename "$CC"`
4770 if test -n "$CXX_FOR_BUILD"; then
4771 export CXX="$CXX_FOR_BUILD"
4772 CXX_BASE=`first_arg_basename "$CXX"`
4774 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4777 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4778 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4779 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4780 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4781 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4782 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4783 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4784 # Don't bother having configure look for stuff not needed for the build platform anyway
4787 --disable-gstreamer-1-0 \
4789 --disable-pdfimport \
4790 --disable-postgresql-sdbc \
4791 --enable-icecream="$enable_icecream" \
4792 --with-parallelism="$with_parallelism" \
4797 2>&1 | sed -e 's/^/ /'
4798 test -f ./config_host.mk 2>/dev/null || exit
4799 cp config_host.mk ../config_build.mk
4800 cp config_host_lang.mk ../config_build_lang.mk
4801 mv config.log ../config.Build.log
4802 mkdir -p ../config_build
4803 mv config_host/*.h ../config_build
4804 . ./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
4806 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
4808 VV=`eval "echo $VV"`
4809 if test -n "$VV"; then
4810 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4811 echo "$line" >>build-config
4815 for V in INSTDIR INSTROOT WORKDIR; do
4817 VV=`eval "echo $VV"`
4818 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4819 if test -n "$VV"; then
4820 line="${V}_FOR_BUILD='$VV'"
4821 echo "$line" >>build-config
4825 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4826 echo "$line" >>build-config
4829 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4830 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])
4831 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4832 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4834 eval `cat CONF-FOR-BUILD/build-config`
4836 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4838 rm -rf CONF-FOR-BUILD
4842 CXX_FOR_BUILD="$CXX"
4843 INSTDIR_FOR_BUILD="$INSTDIR"
4844 INSTROOT_FOR_BUILD="$INSTROOT"
4845 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4846 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4847 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4848 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4849 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4850 WORKDIR_FOR_BUILD="$WORKDIR"
4852 AC_SUBST(OS_FOR_BUILD)
4853 AC_SUBST(INSTDIR_FOR_BUILD)
4854 AC_SUBST(INSTROOT_FOR_BUILD)
4855 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4856 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4857 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4858 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4859 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4860 AC_SUBST(WORKDIR_FOR_BUILD)
4862 dnl ===================================================================
4863 dnl Check for syslog header
4864 dnl ===================================================================
4865 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4867 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4868 dnl ===================================================================
4869 AC_MSG_CHECKING([whether to turn warnings to errors])
4870 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4871 ENABLE_WERROR="TRUE"
4872 AC_MSG_RESULT([yes])
4874 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4875 ENABLE_WERROR="TRUE"
4876 AC_MSG_RESULT([yes])
4881 AC_SUBST(ENABLE_WERROR)
4883 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4884 dnl ===================================================================
4885 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4886 if test -z "$enable_assert_always_abort"; then
4887 if test "$ENABLE_DEBUG" = TRUE; then
4888 enable_assert_always_abort=yes
4890 enable_assert_always_abort=no
4893 if test "$enable_assert_always_abort" = "yes"; then
4894 ASSERT_ALWAYS_ABORT="TRUE"
4895 AC_MSG_RESULT([yes])
4897 ASSERT_ALWAYS_ABORT="FALSE"
4900 AC_SUBST(ASSERT_ALWAYS_ABORT)
4902 # Determine whether to use ooenv for the instdir installation
4903 # ===================================================================
4904 if test $_os != "WINNT" -a $_os != "Darwin"; then
4905 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4906 if test "$enable_ooenv" = "no"; then
4910 AC_MSG_RESULT([yes])
4913 AC_SUBST(ENABLE_OOENV)
4915 if test "$USING_X11" != TRUE; then
4916 # be sure to do not mess with unneeded stuff
4921 build_gstreamer_1_0=no
4925 enable_cairo_canvas=no
4928 if test "$OS" = "HAIKU"; then
4929 enable_cairo_canvas=yes
4933 if test "$test_kf5" = "yes" -a "$enable_kde5" = "yes"; then
4934 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!])
4935 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!"
4939 if test "$test_kf5" = "yes"; then
4943 if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; then
4944 if test "$enable_qt5" = "no"; then
4945 AC_MSG_ERROR([KF5 support depends on QT5, so it conflicts with --disable-qt5])
4951 dnl ===================================================================
4952 dnl check for cups support
4953 dnl ===================================================================
4956 if test "$enable_cups" = "no"; then
4960 AC_MSG_CHECKING([whether to enable CUPS support])
4961 if test "$test_cups" = "yes"; then
4963 AC_MSG_RESULT([yes])
4965 AC_MSG_CHECKING([whether cups support is present])
4966 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4967 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4968 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4969 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4976 AC_SUBST(ENABLE_CUPS)
4979 if test "$test_fontconfig" = "yes"; then
4980 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4981 SYSTEM_FONTCONFIG=TRUE
4982 FilterLibs "${FONTCONFIG_LIBS}"
4983 FONTCONFIG_LIBS="${filteredlibs}"
4985 AC_SUBST(FONTCONFIG_CFLAGS)
4986 AC_SUBST(FONTCONFIG_LIBS)
4987 AC_SUBST([SYSTEM_FONTCONFIG])
4989 dnl whether to find & fetch external tarballs?
4990 dnl ===================================================================
4991 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4992 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4993 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4995 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4998 if test -z "$TARFILE_LOCATION"; then
4999 if test -d "$SRC_ROOT/src" ; then
5000 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
5001 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
5003 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
5005 AbsolutePath "$TARFILE_LOCATION"
5006 PathFormat "${absolute_path}"
5007 TARFILE_LOCATION="${formatted_path}"
5009 AC_SUBST(TARFILE_LOCATION)
5011 AC_MSG_CHECKING([whether we want to fetch tarballs])
5012 if test "$enable_fetch_external" != "no"; then
5013 if test "$with_all_tarballs" = "yes"; then
5014 AC_MSG_RESULT([yes, all of them])
5015 DO_FETCH_TARBALLS="ALL"
5017 AC_MSG_RESULT([yes, if we use them])
5018 DO_FETCH_TARBALLS="TRUE"
5024 AC_SUBST(DO_FETCH_TARBALLS)
5026 AC_MSG_CHECKING([whether to build help])
5027 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
5028 BUILD_TYPE="$BUILD_TYPE HELP"
5029 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5030 case "$with_help" in
5032 ENABLE_HTMLHELP=TRUE
5033 SCPDEFS="$SCPDEFS -DWITH_HELP"
5034 AC_MSG_RESULT([HTML])
5037 ENABLE_HTMLHELP=TRUE
5039 AC_MSG_RESULT([HTML])
5042 SCPDEFS="$SCPDEFS -DWITH_HELP"
5043 AC_MSG_RESULT([yes])
5046 AC_MSG_ERROR([Unknown --with-help=$with_help])
5052 AC_SUBST([ENABLE_HTMLHELP])
5053 AC_SUBST([HELP_ONLINE])
5055 AC_MSG_CHECKING([whether to enable xapian-omega support for help])
5056 if test -n "$with_omindex" -a "$with_omindex" != "no" -a $_os != iOS -a $_os != Android; then
5057 BUILD_TYPE="$BUILD_TYPE HELP"
5058 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5059 case "$with_omindex" in
5061 ENABLE_HTMLHELP=TRUE
5063 HELP_OMINDEX_PAGE=TRUE
5064 AC_MSG_RESULT([SERVER])
5067 ENABLE_HTMLHELP=TRUE
5069 HELP_OMINDEX_PAGE=FALSE
5070 AC_MSG_RESULT([NOXAP])
5073 AC_MSG_ERROR([Unknown --with-omindex=$with_omindex])
5077 HELP_OMINDEX_PAGE=FALSE
5080 AC_SUBST([ENABLE_HTMLHELP])
5081 AC_SUBST([HELP_OMINDEX_PAGE])
5082 AC_SUBST([HELP_ONLINE])
5085 dnl Test whether to include MySpell dictionaries
5086 dnl ===================================================================
5087 AC_MSG_CHECKING([whether to include MySpell dictionaries])
5088 if test "$with_myspell_dicts" = "yes"; then
5089 AC_MSG_RESULT([yes])
5090 WITH_MYSPELL_DICTS=TRUE
5091 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
5092 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
5097 AC_SUBST(WITH_MYSPELL_DICTS)
5099 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
5100 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
5101 if test "$with_system_dicts" = yes; then
5102 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
5104 with_system_dicts=no
5107 AC_MSG_CHECKING([whether to use dicts from external paths])
5108 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
5109 AC_MSG_RESULT([yes])
5111 AC_MSG_CHECKING([for spelling dictionary directory])
5112 if test -n "$with_external_dict_dir"; then
5113 DICT_SYSTEM_DIR=file://$with_external_dict_dir
5115 DICT_SYSTEM_DIR=file:///usr/share/hunspell
5116 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
5117 DICT_SYSTEM_DIR=file:///usr/share/myspell
5120 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
5121 AC_MSG_CHECKING([for hyphenation patterns directory])
5122 if test -n "$with_external_hyph_dir"; then
5123 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
5125 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
5127 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
5128 AC_MSG_CHECKING([for thesaurus directory])
5129 if test -n "$with_external_thes_dir"; then
5130 THES_SYSTEM_DIR=file://$with_external_thes_dir
5132 THES_SYSTEM_DIR=file:///usr/share/mythes
5134 AC_MSG_RESULT([$THES_SYSTEM_DIR])
5139 AC_SUBST(SYSTEM_DICTS)
5140 AC_SUBST(DICT_SYSTEM_DIR)
5141 AC_SUBST(HYPH_SYSTEM_DIR)
5142 AC_SUBST(THES_SYSTEM_DIR)
5144 dnl ===================================================================
5145 dnl Precompiled headers.
5147 AC_MSG_CHECKING([whether to enable pch feature])
5148 if test -z "$enable_pch"; then
5149 if test "$_os" = "WINNT"; then
5150 # Enabled by default on Windows.
5156 if test "$enable_pch" != "no" -a "$_os" != "WINNT" -a "$GCC" != "yes" ; then
5157 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
5159 if test "$enable_pch" = "system"; then
5161 AC_MSG_RESULT([yes (system headers)])
5162 elif test "$enable_pch" = "base"; then
5164 AC_MSG_RESULT([yes (system and base headers)])
5165 elif test "$enable_pch" = "normal"; then
5167 AC_MSG_RESULT([yes (normal)])
5168 elif test "$enable_pch" = "full"; then
5170 AC_MSG_RESULT([yes (full)])
5171 elif test "$enable_pch" = "yes"; then
5172 # Pick a suitable default.
5173 if test "$GCC" = "yes"; then
5174 # With Clang and GCC higher levels do not seem to make a noticeable improvement,
5175 # while making the PCHs larger and rebuilds more likely.
5177 AC_MSG_RESULT([yes (system and base headers)])
5179 # With MSVC the highest level makes a significant difference,
5180 # and it was the default when there used to be no PCH levels.
5182 AC_MSG_RESULT([yes (full)])
5184 elif test "$enable_pch" = "no"; then
5187 AC_MSG_ERROR([Unknown value for --enable-pch])
5189 AC_SUBST(ENABLE_PCH)
5190 # ccache 3.7.1 and older do not properly detect/handle -include .gch in CCACHE_DEPEND mode
5191 if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_IS_CLANG" != "TRUE"; then
5192 AC_PATH_PROG([CCACHE_BIN],[ccache],[not found])
5193 if test "$CCACHE_BIN" != "not found"; then
5194 AC_MSG_CHECKING([ccache version])
5195 CCACHE_VERSION=`"$CCACHE_BIN" -V | "$AWK" '/^ccache version/{print $3}'`
5196 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5197 AC_MSG_RESULT([$CCACHE_VERSION])
5198 AC_MSG_CHECKING([whether ccache depend mode works properly with GCC PCH])
5199 if test "$CCACHE_NUMVER" -gt "030701"; then
5200 AC_MSG_RESULT([yes])
5202 AC_MSG_RESULT([no (not newer than 3.7.1)])
5208 BUILDING_PCH_WITH_OBJ=
5209 if test -n "$ENABLE_PCH"; then
5210 AC_MSG_CHECKING([whether $CC supports -Xclang -building-pch-with-obj])
5212 CFLAGS="$CFLAGS -Werror -Xclang -building-pch-with-obj"
5213 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ BUILDING_PCH_WITH_OBJ="-Xclang -building-pch-with-obj" ],[])
5215 if test -n "$BUILDING_PCH_WITH_OBJ"; then
5221 AC_SUBST(BUILDING_PCH_WITH_OBJ)
5223 PCH_MODULES_CODEGEN=
5224 if test -n "$BUILDING_PCH_WITH_OBJ"; then
5225 AC_MSG_CHECKING([whether $CC supports -Xclang -fmodules-codegen])
5227 CFLAGS="$CFLAGS -Werror -Xclang -fmodules-codegen"
5228 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_MODULES_CODEGEN="-Xclang -fmodules-codegen" ],[])
5230 if test -n "$PCH_MODULES_CODEGEN"; then
5237 AC_SUBST(PCH_MODULES_CODEGEN)
5238 PCH_MODULES_DEBUGINFO=
5239 if test -n "$BUILDING_PCH_WITH_OBJ"; then
5240 AC_MSG_CHECKING([whether $CC supports -Xclang -fmodules-debuginfo])
5242 CFLAGS="$CFLAGS -Werror -Xclang -fmodules-debuginfo"
5243 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_MODULES_DEBUGINFO="-Xclang -fmodules-debuginfo" ],[])
5245 if test -n "$PCH_MODULES_DEBUGINFO"; then
5252 AC_SUBST(PCH_MODULES_DEBUGINFO)
5256 AC_MSG_CHECKING([the GNU Make version])
5257 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5258 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5259 if test "$_make_longver" -ge "038200"; then
5260 AC_MSG_RESULT([$GNUMAKE $_make_version])
5262 elif test "$_make_longver" -ge "038100"; then
5263 if test "$build_os" = "cygwin"; then
5264 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
5266 AC_MSG_RESULT([$GNUMAKE $_make_version])
5268 dnl ===================================================================
5269 dnl Search all the common names for sha1sum
5270 dnl ===================================================================
5271 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
5272 if test -z "$SHA1SUM"; then
5273 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
5274 elif test "$SHA1SUM" = "openssl"; then
5275 SHA1SUM="openssl sha1"
5277 AC_MSG_CHECKING([for GNU Make bug 20033])
5278 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
5279 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
5280 A := \$(wildcard *.a)
5284 <TAB>@echo survived bug20033.
5288 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5301 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5302 <TAB>\$(call d1,\$(CHECKSUM)),\
5303 <TAB>\$(call d2,\$(CHECKSUM)))
5305 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5306 no_parallelism_make="YES"
5307 AC_MSG_RESULT([yes, disable parallelism])
5309 AC_MSG_RESULT([no, keep parallelism enabled])
5311 rm -rf $TESTGMAKEBUG20033
5313 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5316 # find if gnumake support file function
5317 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5318 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5319 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5320 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5322 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5323 \$(file >test.txt,Success )
5330 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5331 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5332 HAVE_GNUMAKE_FILE_FUNC=TRUE
5333 AC_MSG_RESULT([yes])
5337 rm -rf $TESTGMAKEFILEFUNC
5338 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5339 AC_SUBST(GNUMAKE_WIN_NATIVE)
5341 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5343 if test "$_make_ver_check" = ""; then
5347 HAVE_LD_HASH_STYLE=FALSE
5348 WITH_LINKER_HASH_STYLE=
5349 AC_MSG_CHECKING([for --hash-style gcc linker support])
5350 if test "$GCC" = "yes"; then
5351 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5352 hash_styles="gnu sysv"
5353 elif test "$with_linker_hash_style" = "no"; then
5356 hash_styles="$with_linker_hash_style"
5359 for hash_style in $hash_styles; do
5360 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5361 hash_style_ldflags_save=$LDFLAGS
5362 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5364 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5371 HAVE_LD_HASH_STYLE=TRUE
5372 WITH_LINKER_HASH_STYLE=$hash_style
5374 [HAVE_LD_HASH_STYLE=FALSE],
5375 [HAVE_LD_HASH_STYLE=FALSE])
5376 LDFLAGS=$hash_style_ldflags_save
5379 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5380 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5384 LDFLAGS=$hash_style_ldflags_save
5388 AC_SUBST(HAVE_LD_HASH_STYLE)
5389 AC_SUBST(WITH_LINKER_HASH_STYLE)
5391 dnl ===================================================================
5392 dnl Check whether there's a Perl version available.
5393 dnl ===================================================================
5394 if test -z "$with_perl_home"; then
5395 AC_PATH_PROG(PERL, perl)
5397 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5398 _perl_path="$with_perl_home/bin/perl"
5399 if test -x "$_perl_path"; then
5402 AC_MSG_ERROR([$_perl_path not found])
5406 dnl ===================================================================
5407 dnl Testing for Perl version 5 or greater.
5408 dnl $] is the Perl version variable, it is returned as an integer
5409 dnl ===================================================================
5410 if test "$PERL"; then
5411 AC_MSG_CHECKING([the Perl version])
5412 ${PERL} -e "exit($]);"
5414 if test "$_perl_version" -lt 5; then
5415 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
5417 AC_MSG_RESULT([Perl $_perl_version])
5419 AC_MSG_ERROR([Perl not found, install Perl 5])
5422 dnl ===================================================================
5423 dnl Testing for required Perl modules
5424 dnl ===================================================================
5426 AC_MSG_CHECKING([for required Perl modules])
5427 perl_use_string="use Cwd ; use Digest::MD5"
5428 if test "$_os" = "WINNT"; then
5429 if test -n "$PKGFORMAT"; then
5430 for i in $PKGFORMAT; do
5433 # for getting fonts versions to use in MSI
5434 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5440 if test "$with_system_hsqldb" = "yes"; then
5441 perl_use_string="$perl_use_string ; use Archive::Zip"
5443 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
5444 AC_MSG_RESULT([all modules found])
5446 AC_MSG_RESULT([failed to find some modules])
5447 # Find out which modules are missing.
5448 for i in $perl_use_string; do
5449 if test "$i" != "use" -a "$i" != ";"; then
5450 if ! $PERL -e "use $i;">/dev/null 2>&1; then
5451 missing_perl_modules="$missing_perl_modules $i"
5456 The missing Perl modules are: $missing_perl_modules
5457 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5460 dnl ===================================================================
5461 dnl Check for pkg-config
5462 dnl ===================================================================
5463 if test "$_os" != "WINNT"; then
5467 if test "$_os" != "WINNT"; then
5469 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5470 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5471 # explicitly. Or put /path/to/compiler in PATH yourself.
5473 # Use wrappers for LTO
5474 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5475 AC_CHECK_TOOL(AR,gcc-ar)
5476 AC_CHECK_TOOL(NM,gcc-nm)
5477 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5479 AC_CHECK_TOOL(AR,ar)
5480 AC_CHECK_TOOL(NM,nm)
5481 AC_CHECK_TOOL(RANLIB,ranlib)
5483 AC_CHECK_TOOL(OBJDUMP,objdump)
5484 AC_CHECK_TOOL(READELF,readelf)
5485 AC_CHECK_TOOL(STRIP,strip)
5486 if test "$_os" = "WINNT"; then
5487 AC_CHECK_TOOL(DLLTOOL,dlltool)
5488 AC_CHECK_TOOL(WINDRES,windres)
5495 AC_SUBST(PKG_CONFIG)
5501 dnl ===================================================================
5502 dnl pkg-config checks on macOS
5503 dnl ===================================================================
5505 if test $_os = Darwin; then
5506 AC_MSG_CHECKING([for bogus pkg-config])
5507 if test -n "$PKG_CONFIG"; then
5508 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5509 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5511 if test "$enable_bogus_pkg_config" = "yes"; then
5512 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5514 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.])
5518 AC_MSG_RESULT([no, good])
5524 # Return value: $csctest
5528 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5529 if test -n "$regvalue"; then
5537 # Return value: $altest
5541 # We need this check to detect 4.6.1 or above.
5542 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
5543 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5544 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5550 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5551 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5552 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5565 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
5566 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5567 if test -n "$regvalue"; then
5574 find_winsdk_version()
5576 # Args: $1 : SDK version as in "8.0", "8.1A" etc
5577 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5579 unset winsdktest winsdkbinsubdir winsdklibsubdir
5583 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5584 if test -n "$regvalue"; then
5585 winsdktest=$regvalue
5586 winsdklibsubdir=win8
5591 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5592 if test -n "$regvalue"; then
5593 winsdktest=$regvalue
5594 winsdklibsubdir=winv6.3
5599 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5600 if test -n "$regvalue"; then
5601 winsdktest=$regvalue
5602 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5603 if test -n "$regvalue"; then
5604 winsdkbinsubdir="$regvalue".0
5605 winsdklibsubdir=$winsdkbinsubdir
5606 tmppath="$winsdktest\\Include\\$winsdklibsubdir"
5607 # test exist the SDK path
5608 if test -d "$tmppath"; then
5609 # when path is convertible to a short path then path is okay
5610 cygpath -d "$tmppath" >/dev/null 2>&1
5611 if test $? -ne 0; then
5612 AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
5615 AC_MSG_ERROR([The Windows SDK not found, check the installation])
5626 # Return value: From find_winsdk_version
5630 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5631 find_winsdk_version $ver
5632 if test -n "$winsdktest"; then
5640 AC_MSG_CHECKING([for MSVC merge modules directory])
5641 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5644 my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm ${my_msm_files}"
5647 for f in $my_msm_files; do
5648 echo "$as_me:$LINENO: searching for $f" >&5
5652 for ver in 14.0 15.0; do
5653 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5654 if test -n "$regvalue"; then
5655 for f in ${my_msm_files}; do
5656 if test -e "$regvalue/${f}"; then
5663 dnl Is the following fallback really necessary, or was it added in response
5664 dnl to never having started Visual Studio on a given machine, so the
5665 dnl registry keys checked above had presumably not yet been created?
5666 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5667 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5668 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5669 dnl expanding to "C:\Program Files\Common Files"), which would need
5670 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5671 dnl obtain its value from cygwin:
5672 if test -z "$msmdir"; then
5673 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5674 for f in ${my_msm_files}; do
5675 if test -e "$my_msm_dir/${f}"; then
5681 dnl Starting from MSVC 15.0, merge modules are located in different directory
5684 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5685 echo "$as_me:$LINENO: looking in $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])" >&5
5686 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5687 for f in ${my_msm_files}; do
5688 if test -e "$my_msm_dir/${f}"; then
5697 if test -n "$msmdir"; then
5698 msmdir=`cygpath -m "$msmdir"`
5699 AC_MSG_RESULT([$msmdir])
5701 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5702 AC_MSG_FAILURE([not found])
5704 AC_MSG_WARN([not found (check config.log)])
5705 add_warning "MSM none of ${my_msm_files} found"
5710 find_msvc_x64_dlls()
5712 AC_MSG_CHECKING([for MSVC x64 DLL path])
5713 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5716 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5717 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT" >&5
5718 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5719 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5722 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT" >&5
5723 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"; then
5724 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"
5730 AC_MSG_RESULT([$msvcdllpath])
5731 AC_MSG_CHECKING([for MSVC x64 DLLs])
5732 msvcdlls="msvcp140.dll vcruntime140.dll"
5733 for dll in $msvcdlls; do
5734 if ! test -f "$msvcdllpath/$dll"; then
5735 AC_MSG_FAILURE([missing $dll])
5738 AC_MSG_RESULT([found all ($msvcdlls)])
5741 dnl =========================================
5742 dnl Check for the Windows SDK.
5743 dnl =========================================
5744 if test "$_os" = "WINNT"; then
5745 AC_MSG_CHECKING([for Windows SDK])
5746 if test "$build_os" = "cygwin"; then
5748 WINDOWS_SDK_HOME=$winsdktest
5750 # normalize if found
5751 if test -n "$WINDOWS_SDK_HOME"; then
5752 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5753 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5756 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5759 if test -n "$WINDOWS_SDK_HOME"; then
5760 # Remove a possible trailing backslash
5761 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5763 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5764 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5765 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5766 have_windows_sdk_headers=yes
5767 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5768 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5769 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5770 have_windows_sdk_headers=yes
5771 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5772 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5773 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5774 have_windows_sdk_headers=yes
5776 have_windows_sdk_headers=no
5779 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5780 have_windows_sdk_libs=yes
5781 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5782 have_windows_sdk_libs=yes
5784 have_windows_sdk_libs=no
5787 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5788 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5789 the Windows SDK are installed.])
5793 if test -z "$WINDOWS_SDK_HOME"; then
5794 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5795 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5796 WINDOWS_SDK_VERSION=80
5797 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5798 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5799 WINDOWS_SDK_VERSION=81
5800 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5801 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5802 WINDOWS_SDK_VERSION=10
5803 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5805 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5807 PathFormat "$WINDOWS_SDK_HOME"
5808 WINDOWS_SDK_HOME="$formatted_path"
5809 if test "$build_os" = "cygwin"; then
5810 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5811 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5812 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5813 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5814 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5818 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5819 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5820 dnl but not in v8.0), so allow this to be overridden with a
5821 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5822 dnl and configuration error if no WiLangId.vbs is found would arguably be
5823 dnl better, but I do not know under which conditions exactly it is needed by
5825 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5826 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5827 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5828 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5830 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5831 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5833 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5834 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5837 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5838 if test -n "$with_package_format" -a "$with_package_format" != no; then
5839 for i in "$with_package_format"; do
5840 if test "$i" = "msi"; then
5841 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5842 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5849 AC_SUBST(WINDOWS_SDK_HOME)
5850 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5851 AC_SUBST(WINDOWS_SDK_VERSION)
5852 AC_SUBST(WINDOWS_SDK_WILANGID)
5854 if test "$build_os" = "cygwin"; then
5855 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5856 dnl dir, it also determines that dir's path w/o an arch segment if any,
5857 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5858 AC_MSG_CHECKING([for midl.exe])
5861 if test -n "$winsdkbinsubdir" \
5862 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5864 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5865 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5866 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5867 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5868 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5869 elif test -f "$winsdktest/Bin/midl.exe"; then
5870 MIDL_PATH=$winsdktest/Bin
5871 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5873 if test ! -f "$MIDL_PATH/midl.exe"; then
5874 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5876 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5879 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5880 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5882 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5883 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5884 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5885 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5886 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5887 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5888 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5889 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5890 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5891 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5892 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5893 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5895 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5899 AC_MSG_CHECKING([for csc.exe])
5901 if test -f "$csctest/csc.exe"; then
5904 if test ! -f "$CSC_PATH/csc.exe"; then
5905 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5907 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5910 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5913 AC_MSG_CHECKING([for al.exe])
5915 if test -n "$winsdkbinsubdir" \
5916 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5918 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5919 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5920 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5921 elif test -f "$winsdktest/Bin/al.exe"; then
5922 AL_PATH="$winsdktest/Bin"
5925 if test -z "$AL_PATH"; then
5927 if test -f "$altest/bin/al.exe"; then
5928 AL_PATH="$altest/bin"
5929 elif test -f "$altest/al.exe"; then
5933 if test ! -f "$AL_PATH/al.exe"; then
5934 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5936 AC_MSG_RESULT([$AL_PATH/al.exe])
5939 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5941 dnl Check mscoree.lib / .NET Framework dir
5942 AC_MSG_CHECKING(.NET Framework)
5944 PathFormat "$frametest"
5945 frametest="$formatted_path"
5946 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5947 DOTNET_FRAMEWORK_HOME="$frametest"
5950 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5951 DOTNET_FRAMEWORK_HOME="$winsdktest"
5954 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
5955 AC_MSG_ERROR([mscoree.lib not found])
5957 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5959 PathFormat "$MIDL_PATH"
5960 MIDL_PATH="$formatted_path"
5962 PathFormat "$AL_PATH"
5963 AL_PATH="$formatted_path"
5965 PathFormat "$DOTNET_FRAMEWORK_HOME"
5966 DOTNET_FRAMEWORK_HOME="$formatted_path"
5968 PathFormat "$CSC_PATH"
5969 CSC_PATH="$formatted_path"
5972 dnl ===================================================================
5973 dnl Check if stdc headers are available excluding MSVC.
5974 dnl ===================================================================
5975 if test "$_os" != "WINNT"; then
5979 dnl ===================================================================
5980 dnl Testing for C++ compiler and version...
5981 dnl ===================================================================
5983 if test "$_os" != "WINNT"; then
5984 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5985 save_CXXFLAGS=$CXXFLAGS
5987 CXXFLAGS=$save_CXXFLAGS
5988 if test -z "$CXX_BASE"; then
5989 CXX_BASE=`first_arg_basename "$CXX"`
5993 dnl check for GNU C++ compiler version
5994 if test "$GXX" = "yes" -a -z "$COM_IS_CLANG"; then
5995 AC_MSG_CHECKING([the GNU C++ compiler version])
5997 _gpp_version=`$CXX -dumpversion`
5998 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
6000 if test "$_gpp_majmin" -lt "700"; then
6001 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 7.0 to build LibreOffice, you have $_gpp_version.])
6003 AC_MSG_RESULT([ok (g++ $_gpp_version)])
6006 dnl see https://code.google.com/p/android/issues/detail?id=41770
6010 AC_MSG_CHECKING([whether $CXX_BASE is broken with boost.thread])
6011 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
6012 #include <bits/c++config.h>]],[[
6013 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
6014 && !defined(_GLIBCXX__PTHREADS) \
6015 && !defined(_GLIBCXX_HAS_GTHREADS)
6018 ]])],[AC_MSG_RESULT([yes])
6019 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
6021 if test $glibcxx_threads = yes; then
6022 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
6025 AC_SUBST(BOOST_CXXFLAGS)
6028 # prefx CXX with ccache if needed
6030 if test "$CCACHE" != ""; then
6031 AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
6033 save_CXXFLAGS=$CXXFLAGS
6034 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
6035 dnl an empty program will do, we're checking the compiler flags
6036 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
6037 [use_ccache=yes], [use_ccache=no])
6038 if test $use_ccache = yes; then
6039 AC_MSG_RESULT([yes])
6042 CXX_BASE="ccache $CXX_BASE"
6045 CXXFLAGS=$save_CXXFLAGS
6049 dnl ===================================================================
6050 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
6051 dnl ===================================================================
6053 if test "$_os" != "WINNT"; then
6056 dnl Check whether there's a C pre-processor.
6061 dnl ===================================================================
6062 dnl Find integral type sizes and alignments
6063 dnl ===================================================================
6065 if test "$_os" != "WINNT"; then
6067 if test "$_os" = "iOS"; then
6068 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
6070 ac_cv_sizeof_short=2
6072 ac_cv_sizeof_long_long=8
6073 ac_cv_sizeof_double=8
6074 ac_cv_sizeof_voidp=8
6076 AC_CHECK_SIZEOF(long)
6077 AC_CHECK_SIZEOF(short)
6078 AC_CHECK_SIZEOF(int)
6079 AC_CHECK_SIZEOF(long long)
6080 AC_CHECK_SIZEOF(double)
6081 AC_CHECK_SIZEOF(void*)
6084 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
6085 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
6086 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
6087 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
6088 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
6090 dnl Allow build without AC_CHECK_ALIGNOF, grrr
6091 m4_pattern_allow([AC_CHECK_ALIGNOF])
6092 m4_ifdef([AC_CHECK_ALIGNOF],
6094 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
6095 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
6096 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
6097 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
6100 case "$_os-$host_cpu" in
6102 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6103 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6104 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
6105 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
6108 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6109 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6110 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
6111 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
6114 if test -z "$ac_cv_alignof_short" -o \
6115 -z "$ac_cv_alignof_int" -o \
6116 -z "$ac_cv_alignof_long" -o \
6117 -z "$ac_cv_alignof_double"; then
6118 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.])
6124 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
6125 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
6126 if test $ac_cv_sizeof_long -eq 8; then
6127 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
6128 elif test $ac_cv_sizeof_double -eq 8; then
6129 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
6131 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
6134 dnl Check for large file support
6136 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
6137 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
6139 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
6140 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
6144 SAL_TYPES_SIZEOFSHORT=2
6145 SAL_TYPES_SIZEOFINT=4
6146 SAL_TYPES_SIZEOFLONG=4
6147 SAL_TYPES_SIZEOFLONGLONG=8
6148 if test "$BITNESS_OVERRIDE" = ""; then
6149 SAL_TYPES_SIZEOFPOINTER=4
6151 SAL_TYPES_SIZEOFPOINTER=8
6153 SAL_TYPES_ALIGNMENT2=2
6154 SAL_TYPES_ALIGNMENT4=4
6155 SAL_TYPES_ALIGNMENT8=8
6158 AC_SUBST(LFS_CFLAGS)
6160 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
6161 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
6162 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
6163 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
6164 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
6165 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
6166 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
6167 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
6169 dnl ===================================================================
6170 dnl Check whether to enable runtime optimizations
6171 dnl ===================================================================
6172 ENABLE_RUNTIME_OPTIMIZATIONS=
6173 AC_MSG_CHECKING([whether to enable runtime optimizations])
6174 if test -z "$enable_runtime_optimizations"; then
6178 enable_runtime_optimizations=no
6184 if test "$enable_runtime_optimizations" != no; then
6185 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
6186 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
6187 AC_MSG_RESULT([yes])
6191 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
6193 dnl ===================================================================
6194 dnl Check if valgrind headers are available
6195 dnl ===================================================================
6197 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
6198 prev_cppflags=$CPPFLAGS
6199 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
6200 # or where does it come from?
6201 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
6202 AC_CHECK_HEADER([valgrind/valgrind.h],
6203 [ENABLE_VALGRIND=TRUE])
6204 CPPFLAGS=$prev_cppflags
6206 AC_SUBST([ENABLE_VALGRIND])
6207 if test -z "$ENABLE_VALGRIND"; then
6208 if test "$with_valgrind" = yes; then
6209 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
6213 AC_SUBST([VALGRIND_CFLAGS])
6216 dnl ===================================================================
6217 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
6218 dnl ===================================================================
6220 # We need at least the sys/sdt.h include header.
6221 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
6222 if test "$SDT_H_FOUND" = "TRUE"; then
6223 # Found sys/sdt.h header, now make sure the c++ compiler works.
6224 # Old g++ versions had problems with probes in constructors/destructors.
6225 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
6227 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6228 #include <sys/sdt.h>
6236 ProbeClass(int& v, const char *n) : ref(v), name(n)
6238 DTRACE_PROBE2(_test_, cons, name, ref);
6241 void method(int min)
6243 DTRACE_PROBE3(_test_, meth, name, ref, min);
6249 DTRACE_PROBE2(_test_, dest, name, ref);
6254 DTRACE_PROBE1(_test_, call, i);
6255 ProbeClass inst = ProbeClass(i, "call");
6257 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
6258 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
6261 AC_CONFIG_HEADERS([config_host/config_probes.h])
6263 dnl ===================================================================
6265 dnl ===================================================================
6266 HAVE_GCC_STACK_CLASH_PROTECTION=
6267 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6268 AC_MSG_CHECKING([whether $CC_BASE supports -fstack-clash-protection])
6270 CFLAGS="$CFLAGS -fstack-clash-protection"
6272 [AC_LANG_PROGRAM(, [[return 0;]])],
6273 [AC_MSG_RESULT([yes]); HAVE_GCC_STACK_CLASH_PROTECTION=TRUE],
6274 [AC_MSG_RESULT([no])])
6277 AC_MSG_CHECKING([whether $CC_BASE supports -mno-avx])
6279 CFLAGS="$CFLAGS -Werror -mno-avx"
6280 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
6282 if test "$HAVE_GCC_AVX" = "TRUE"; then
6283 AC_MSG_RESULT([yes])
6288 AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
6289 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6291 if (__sync_add_and_fetch(&v, 1) != 1 ||
6292 __sync_sub_and_fetch(&v, 1) != 0)
6294 __sync_synchronize();
6295 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6299 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6300 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6301 AC_MSG_RESULT([yes])
6302 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6307 AC_MSG_CHECKING([whether $CC_BASE supports __builtin_ffs])
6308 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
6309 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
6310 AC_MSG_RESULT([yes])
6311 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
6316 AC_MSG_CHECKING([whether $CC_BASE supports __attribute__((deprecated(message)))])
6318 CFLAGS="$CFLAGS -Werror"
6319 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6320 __attribute__((deprecated("test"))) void f();
6322 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6323 AC_MSG_RESULT([yes])
6324 ], [AC_MSG_RESULT([no])])
6327 AC_MSG_CHECKING([whether $CXX_BASE defines __base_class_type_info in cxxabi.h])
6329 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6332 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
6334 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
6335 AC_MSG_RESULT([yes])
6336 ], [AC_MSG_RESULT([no])])
6339 AC_MSG_CHECKING([whether $CXX_BASE defines __class_type_info in cxxabi.h])
6341 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6344 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
6346 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
6347 AC_MSG_RESULT([yes])
6348 ], [AC_MSG_RESULT([no])])
6351 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_allocate_exception in cxxabi.h])
6353 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6355 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6357 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6358 AC_MSG_RESULT([yes])
6359 ], [AC_MSG_RESULT([no])])
6362 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_eh_globals in cxxabi.h])
6364 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6367 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6369 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6370 AC_MSG_RESULT([yes])
6371 ], [AC_MSG_RESULT([no])])
6374 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exception in cxxabi.h])
6376 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6379 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exception); }
6381 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTION],[1])
6382 AC_MSG_RESULT([yes])
6383 ], [AC_MSG_RESULT([no])])
6386 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_get_globals in cxxabi.h])
6388 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6390 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6392 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6393 AC_MSG_RESULT([yes])
6394 ], [AC_MSG_RESULT([no])])
6397 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_current_exception_type in cxxabi.h])
6399 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6401 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6403 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6404 AC_MSG_RESULT([yes])
6405 ], [AC_MSG_RESULT([no])])
6408 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_throw in cxxabi.h])
6410 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6412 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6414 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6415 AC_MSG_RESULT([yes])
6416 ], [AC_MSG_RESULT([no])])
6419 AC_MSG_CHECKING([whether $CXX_BASE defines __si_class_type_info in cxxabi.h])
6421 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6424 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6426 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6427 AC_MSG_RESULT([yes])
6428 ], [AC_MSG_RESULT([no])])
6431 AC_MSG_CHECKING([whether $CXX_BASE defines __vmi_class_type_info in cxxabi.h])
6433 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6436 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6438 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6439 AC_MSG_RESULT([yes])
6440 ], [AC_MSG_RESULT([no])])
6443 dnl Available in GCC 4.9 and at least since Clang 3.4; this check can eventually be removed
6444 dnl completely (e.g., after libreoffice-6-5 branch off):
6445 AC_MSG_CHECKING([that $CXX_BASE supports __attribute__((warn_unused))])
6447 save_CXXFLAGS=$CXXFLAGS
6448 CXXFLAGS="$CXXFLAGS -Werror"
6449 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6450 struct __attribute__((warn_unused)) dummy {};
6452 AC_MSG_RESULT([yes])
6453 ], [AC_MSG_ERROR([no])])
6454 CXXFLAGS=$save_CXXFLAGS
6458 AC_SUBST(HAVE_GCC_AVX)
6459 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6460 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6461 AC_SUBST(HAVE_GCC_STACK_CLASH_PROTECTION)
6463 dnl ===================================================================
6464 dnl Identify the C++ library
6465 dnl ===================================================================
6467 AC_MSG_CHECKING([what the C++ library is])
6469 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6475 [CPP_LIBRARY=GLIBCXX
6476 cpp_library_name="GNU libstdc++"
6478 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6480 #ifndef _LIBCPP_VERSION
6485 cpp_library_name="LLVM libc++"
6486 AC_DEFINE([HAVE_LIBCXX])
6488 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6495 cpp_library_name="Microsoft"
6497 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6498 AC_MSG_RESULT([$cpp_library_name])
6501 dnl ===================================================================
6503 dnl ===================================================================
6504 AC_PATH_PROG(GPERF, gperf)
6505 if test -z "$GPERF"; then
6506 AC_MSG_ERROR([gperf not found but needed. Install it.])
6508 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6509 GPERF=`cygpath -m $GPERF`
6511 AC_MSG_CHECKING([whether gperf is new enough])
6512 my_gperf_ver1=$($GPERF --version | head -n 1)
6513 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
6514 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
6515 if test "$my_gperf_ver3" -ge 301; then
6516 AC_MSG_RESULT([yes ($my_gperf_ver2)])
6518 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
6522 dnl ===================================================================
6523 dnl Check for system libcmis
6524 dnl ===================================================================
6525 # libcmis requires curl and we can't build curl for iOS
6526 if test $_os != iOS; then
6527 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2])
6532 AC_SUBST(ENABLE_LIBCMIS)
6534 dnl ===================================================================
6536 dnl ===================================================================
6538 AC_MSG_CHECKING([whether $CXX_BASE supports C++17])
6540 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6541 CXXFLAGS_CXX11='-std:c++17 -Zc:__cplusplus'
6542 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6543 my_flags='-std=c++20 -std=c++2a -std=c++17 -std=c++1z'
6544 for flag in $my_flags; do
6545 if test "$COM" = MSC; then
6546 flag="-Xclang $flag"
6548 save_CXXFLAGS=$CXXFLAGS
6549 CXXFLAGS="$CXXFLAGS $flag -Werror"
6550 if test "$SYSTEM_LIBCMIS" = TRUE; then
6551 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6554 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6555 #include <algorithm>
6556 #include <functional>
6559 #if defined SYSTEM_LIBCMIS
6560 // See ucb/source/ucp/cmis/auth_provider.hxx:
6561 #if !defined __clang__
6562 #pragma GCC diagnostic push
6563 #pragma GCC diagnostic ignored "-Wdeprecated"
6564 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6566 #include <libcmis/libcmis.hxx>
6567 #if !defined __clang__
6568 #pragma GCC diagnostic pop
6572 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6573 std::sort(v.begin(), v.end(), fn);
6575 ]])],[CXXFLAGS_CXX11=$flag])
6577 CXXFLAGS=$save_CXXFLAGS
6578 if test -n "$CXXFLAGS_CXX11"; then
6583 if test -n "$CXXFLAGS_CXX11"; then
6584 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6588 AC_SUBST(CXXFLAGS_CXX11)
6590 if test "$GCC" = "yes"; then
6591 save_CXXFLAGS=$CXXFLAGS
6592 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6594 CXXFLAGS=$save_CXXFLAGS
6595 AC_SUBST(ATOMIC_LIB)
6598 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6599 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6600 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6601 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6602 dnl again towards 4.7.2:
6603 if test $CPP_LIBRARY = GLIBCXX; then
6604 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6606 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6608 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6609 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6610 // GCC 4.7.0: 20120322
6611 // GCC 4.7.1: 20120614
6612 // and using a range check is not possible as the mapping between
6613 // __GLIBCXX__ values and GCC versions is not monotonic
6618 ]])], [AC_MSG_RESULT(no, ok)],
6619 [AC_MSG_ERROR(yes)])
6623 AC_MSG_CHECKING([whether $CXX_BASE supports C++11 without Language Defect 757])
6624 save_CXXFLAGS=$CXXFLAGS
6625 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6628 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6631 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6647 a thinga[]={{0,0}, {1,1}};
6648 b thingb[]={{0,0}, {1,1}};
6649 size_t i = sizeof(sal_n_array_size(thinga));
6650 size_t j = sizeof(sal_n_array_size(thingb));
6651 return !(i != 0 && j != 0);
6653 ], [ AC_MSG_RESULT(yes) ],
6654 [ AC_MSG_ERROR(no)])
6656 CXXFLAGS=$save_CXXFLAGS
6658 dnl _Pragma support (may require C++11)
6659 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6660 AC_MSG_CHECKING([whether $CXX_BASE supports _Pragma operator])
6662 save_CXXFLAGS=$CXXFLAGS
6663 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6664 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6665 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6667 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6668 AC_MSG_RESULT([yes])
6669 ], [AC_MSG_RESULT([no])])
6671 CXXFLAGS=$save_CXXFLAGS
6674 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6675 if test "$GCC" = yes; then
6676 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
6678 save_CXXFLAGS=$CXXFLAGS
6679 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6680 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6681 CXXFLAGS=$save_CXXFLAGS
6683 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6684 AC_MSG_RESULT([yes])
6689 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6691 AC_MSG_CHECKING([whether $CXX_BASE supports guaranteed copy elision])
6693 save_CXXFLAGS=$CXXFLAGS
6694 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6695 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6696 // At least VS 2017 15.8.1 defines __cpp_guaranteed_copy_elision as 201606L without actually
6698 #if !defined __cpp_guaranteed_copy_elision || (defined _MSC_VER && !defined __clang__)
6707 void f() { S c(copy()); }
6710 AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
6711 AC_MSG_RESULT([yes])
6712 ], [AC_MSG_RESULT([no])])
6713 CXXFLAGS=$save_CXXFLAGS
6716 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a constinit sorted vectors])
6718 save_CXXFLAGS=$CXXFLAGS
6719 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6720 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6721 #include <algorithm>
6722 #include <initializer_list>
6724 template<typename T> class S {
6728 constexpr S(std::initializer_list<T> i): v_(i) { std::sort(v_.begin(), v_.end()); }
6730 constinit S<int> s{3, 2, 1};
6732 AC_DEFINE([HAVE_CPP_CONSTINIT_SORTED_VECTOR],[1])
6733 AC_MSG_RESULT([yes])
6734 ], [AC_MSG_RESULT([no])])
6735 CXXFLAGS=$save_CXXFLAGS
6738 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a <span> with unsigned size_type])
6740 save_CXXFLAGS=$CXXFLAGS
6741 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6742 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6744 #include <type_traits>
6745 // Don't check size_type directly, as it was called index_type before P1872R0:
6746 void f(std::span<int> s) { static_assert(std::is_unsigned_v<decltype(s.size())>); };
6748 AC_DEFINE([HAVE_CPP_SPAN],[1])
6749 AC_MSG_RESULT([yes])
6750 ], [AC_MSG_RESULT([no])])
6751 CXXFLAGS=$save_CXXFLAGS
6754 AC_MSG_CHECKING([whether $CXX_BASE implements C++ DR P1155R3])
6756 save_CXXFLAGS=$CXXFLAGS
6757 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6758 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6759 struct S1 { S1(S1 &&); };
6761 S1 f(S2 s) { return s; }
6763 AC_DEFINE([HAVE_P1155R3],[1])
6764 AC_MSG_RESULT([yes])
6765 ], [AC_MSG_RESULT([no])])
6766 CXXFLAGS=$save_CXXFLAGS
6769 dnl Supported since GCC 9 and Clang 10 (which each also started to support -Wdeprecated-copy, but
6770 dnl which is included in -Wextra anyway):
6771 HAVE_WDEPRECATED_COPY_DTOR=
6772 if test "$GCC" = yes; then
6773 AC_MSG_CHECKING([whether $CXX_BASE supports -Wdeprecated-copy-dtor])
6775 save_CXXFLAGS=$CXXFLAGS
6776 CXXFLAGS="$CXXFLAGS -Werror -Wdeprecated-copy-dtor"
6777 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
6778 HAVE_WDEPRECATED_COPY_DTOR=TRUE
6779 AC_MSG_RESULT([yes])
6780 ], [AC_MSG_RESULT([no])])
6781 CXXFLAGS=$save_CXXFLAGS
6784 AC_SUBST([HAVE_WDEPRECATED_COPY_DTOR])
6786 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
6787 dnl uninitialized warning for code like
6790 dnl boost::optional<OString> * g(bool b) {
6791 dnl boost::optional<OString> o;
6793 dnl return new boost::optional<OString>(o);
6796 dnl (as is e.g. present, in a slightly more elaborate form, in
6797 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
6798 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
6799 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
6800 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
6801 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=maybe-uninitialized])
6803 save_CXXFLAGS=$CXXFLAGS
6804 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
6805 if test "$ENABLE_OPTIMIZED" = TRUE; then
6806 CXXFLAGS="$CXXFLAGS -O2"
6808 CXXFLAGS="$CXXFLAGS -O0"
6810 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6819 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
6820 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
6826 char stg[sizeof (S1)];
6834 ]])], [AC_MSG_RESULT([no])], [
6835 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
6836 AC_MSG_RESULT([yes])
6838 CXXFLAGS=$save_CXXFLAGS
6841 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
6843 dnl ===================================================================
6844 dnl CPU Intrinsics support - SSE, AVX
6845 dnl ===================================================================
6847 CXXFLAGS_INTRINSICS_SSE2=
6848 CXXFLAGS_INTRINSICS_SSSE3=
6849 CXXFLAGS_INTRINSICS_SSE41=
6850 CXXFLAGS_INTRINSICS_SSE42=
6851 CXXFLAGS_INTRINSICS_AVX=
6852 CXXFLAGS_INTRINSICS_AVX2=
6853 CXXFLAGS_INTRINSICS_F16C=
6854 CXXFLAGS_INTRINSICS_FMA=
6856 if test "$GCC" = "yes"; then
6866 # https://docs.microsoft.com/en-us/cpp/build/reference/arch-x86
6867 # MSVC seems to differentiate only between SSE and SSE2, where in fact
6868 # SSE2 seems to be SSE2+.
6869 # Even if -arch:SSE2 is the default, set it explicitly, so that the variable
6870 # is not empty (and can be tested in gbuild), moreover we now default to SSE
6872 flag_sse2=-arch:SSE2
6873 flag_ssse3=-arch:SSE2
6874 flag_sse41=-arch:SSE2
6875 flag_sse42=-arch:SSE2
6877 flag_avx2=-arch:AVX2
6878 # These are part of -arch:AVX2
6879 flag_f16c=-arch:AVX2
6883 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
6885 save_CXXFLAGS=$CXXFLAGS
6886 CXXFLAGS="$CXXFLAGS $flag_sse2"
6887 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6888 #include <emmintrin.h>
6890 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6891 c = _mm_xor_si128 (a, b);
6895 [can_compile_sse2=yes],
6896 [can_compile_sse2=no])
6898 CXXFLAGS=$save_CXXFLAGS
6899 AC_MSG_RESULT([${can_compile_sse2}])
6900 if test "${can_compile_sse2}" = "yes" ; then
6901 CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
6904 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
6906 save_CXXFLAGS=$CXXFLAGS
6907 CXXFLAGS="$CXXFLAGS $flag_ssse3"
6908 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6909 #include <tmmintrin.h>
6911 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6912 c = _mm_maddubs_epi16 (a, b);
6916 [can_compile_ssse3=yes],
6917 [can_compile_ssse3=no])
6919 CXXFLAGS=$save_CXXFLAGS
6920 AC_MSG_RESULT([${can_compile_ssse3}])
6921 if test "${can_compile_ssse3}" = "yes" ; then
6922 CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
6925 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
6927 save_CXXFLAGS=$CXXFLAGS
6928 CXXFLAGS="$CXXFLAGS $flag_sse41"
6929 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6930 #include <smmintrin.h>
6932 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6933 c = _mm_cmpeq_epi64 (a, b);
6937 [can_compile_sse41=yes],
6938 [can_compile_sse41=no])
6940 CXXFLAGS=$save_CXXFLAGS
6941 AC_MSG_RESULT([${can_compile_sse41}])
6942 if test "${can_compile_sse41}" = "yes" ; then
6943 CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
6946 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
6948 save_CXXFLAGS=$CXXFLAGS
6949 CXXFLAGS="$CXXFLAGS $flag_sse42"
6950 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6951 #include <nmmintrin.h>
6953 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6954 c = _mm_cmpgt_epi64 (a, b);
6958 [can_compile_sse42=yes],
6959 [can_compile_sse42=no])
6961 CXXFLAGS=$save_CXXFLAGS
6962 AC_MSG_RESULT([${can_compile_sse42}])
6963 if test "${can_compile_sse42}" = "yes" ; then
6964 CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
6967 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
6969 save_CXXFLAGS=$CXXFLAGS
6970 CXXFLAGS="$CXXFLAGS $flag_avx"
6971 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6972 #include <immintrin.h>
6974 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
6975 c = _mm256_xor_ps(a, b);
6979 [can_compile_avx=yes],
6980 [can_compile_avx=no])
6982 CXXFLAGS=$save_CXXFLAGS
6983 AC_MSG_RESULT([${can_compile_avx}])
6984 if test "${can_compile_avx}" = "yes" ; then
6985 CXXFLAGS_INTRINSICS_AVX="$flag_avx"
6988 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
6990 save_CXXFLAGS=$CXXFLAGS
6991 CXXFLAGS="$CXXFLAGS $flag_avx2"
6992 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6993 #include <immintrin.h>
6995 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
6996 c = _mm256_maddubs_epi16(a, b);
7000 [can_compile_avx2=yes],
7001 [can_compile_avx2=no])
7003 CXXFLAGS=$save_CXXFLAGS
7004 AC_MSG_RESULT([${can_compile_avx2}])
7005 if test "${can_compile_avx2}" = "yes" ; then
7006 CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
7009 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
7011 save_CXXFLAGS=$CXXFLAGS
7012 CXXFLAGS="$CXXFLAGS $flag_f16c"
7013 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7014 #include <immintrin.h>
7016 __m128i a = _mm_set1_epi32 (0);
7018 c = _mm_cvtph_ps(a);
7022 [can_compile_f16c=yes],
7023 [can_compile_f16c=no])
7025 CXXFLAGS=$save_CXXFLAGS
7026 AC_MSG_RESULT([${can_compile_f16c}])
7027 if test "${can_compile_f16c}" = "yes" ; then
7028 CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
7031 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
7033 save_CXXFLAGS=$CXXFLAGS
7034 CXXFLAGS="$CXXFLAGS $flag_fma"
7035 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7036 #include <immintrin.h>
7038 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
7039 d = _mm256_fmadd_ps(a, b, c);
7043 [can_compile_fma=yes],
7044 [can_compile_fma=no])
7046 CXXFLAGS=$save_CXXFLAGS
7047 AC_MSG_RESULT([${can_compile_fma}])
7048 if test "${can_compile_fma}" = "yes" ; then
7049 CXXFLAGS_INTRINSICS_FMA="$flag_fma"
7052 AC_SUBST([CXXFLAGS_INTRINSICS_SSE2])
7053 AC_SUBST([CXXFLAGS_INTRINSICS_SSSE3])
7054 AC_SUBST([CXXFLAGS_INTRINSICS_SSE41])
7055 AC_SUBST([CXXFLAGS_INTRINSICS_SSE42])
7056 AC_SUBST([CXXFLAGS_INTRINSICS_AVX])
7057 AC_SUBST([CXXFLAGS_INTRINSICS_AVX2])
7058 AC_SUBST([CXXFLAGS_INTRINSICS_F16C])
7059 AC_SUBST([CXXFLAGS_INTRINSICS_FMA])
7061 dnl ===================================================================
7062 dnl system stl sanity tests
7063 dnl ===================================================================
7064 if test "$_os" != "WINNT"; then
7068 save_CPPFLAGS="$CPPFLAGS"
7069 if test -n "$MACOSX_SDK_PATH"; then
7070 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
7073 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
7075 if test "$CPP_LIBRARY" = GLIBCXX; then
7076 dnl gcc#19664, gcc#22482, rhbz#162935
7077 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
7078 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
7079 AC_MSG_RESULT([$stlvisok])
7080 if test "$stlvisok" = "no"; then
7081 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
7085 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
7086 # when we don't make any dynamic libraries?
7087 if test "$DISABLE_DYNLOADING" = ""; then
7088 AC_MSG_CHECKING([if $CXX_BASE is -fvisibility-inlines-hidden safe (Clang bug 11250)])
7089 cat > conftestlib1.cc <<_ACEOF
7090 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
7091 struct S2: S1<int> { virtual ~S2(); };
7094 cat > conftestlib2.cc <<_ACEOF
7095 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
7096 struct S2: S1<int> { virtual ~S2(); };
7097 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
7099 gccvisinlineshiddenok=yes
7100 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
7101 gccvisinlineshiddenok=no
7103 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
7104 dnl known to not work with -z defs (unsetting which makes the test
7106 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
7107 if test "$COM_IS_CLANG" = TRUE; then
7108 for i in $CXX $CXXFLAGS; do
7111 my_linkflagsnoundefs=
7117 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
7118 gccvisinlineshiddenok=no
7123 AC_MSG_RESULT([$gccvisinlineshiddenok])
7124 if test "$gccvisinlineshiddenok" = "no"; then
7125 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
7129 AC_MSG_CHECKING([if $CXX_BASE has a visibility bug with class-level attributes (GCC bug 26905)])
7130 cat >visibility.cxx <<_ACEOF
7131 #pragma GCC visibility push(hidden)
7132 struct __attribute__ ((visibility ("default"))) TestStruct {
7135 __attribute__ ((visibility ("default"))) void TestFunc() {
7139 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
7144 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
7147 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
7159 rm -f visibility.s visibility.cxx
7161 AC_MSG_RESULT([$gccvisbroken])
7162 if test "$gccvisbroken" = "yes"; then
7163 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
7166 CPPFLAGS="$save_CPPFLAGS"
7171 dnl ===================================================================
7173 dnl ===================================================================
7175 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
7176 if test "$GCC" = "yes"; then
7177 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-enforce-eh-specs])
7179 save_CXXFLAGS=$CXXFLAGS
7180 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
7181 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
7182 CXXFLAGS=$save_CXXFLAGS
7184 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
7185 AC_MSG_RESULT([yes])
7190 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
7192 dnl ===================================================================
7193 dnl Compiler plugins
7194 dnl ===================================================================
7197 # currently only Clang
7199 if test "$COM_IS_CLANG" != "TRUE"; then
7200 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
7201 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
7202 enable_compiler_plugins=no
7206 COMPILER_PLUGINS_COM_IS_CLANG=
7207 if test "$COM_IS_CLANG" = "TRUE"; then
7208 if test -n "$enable_compiler_plugins"; then
7209 compiler_plugins="$enable_compiler_plugins"
7210 elif test -n "$ENABLE_DBGUTIL"; then
7211 compiler_plugins=test
7215 if test "$compiler_plugins" != no -a "$my_apple_clang" != yes; then
7216 if test "$CLANGVER" -lt 50002; then
7217 if test "$compiler_plugins" = yes; then
7218 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 5.0.2.])
7224 if test "$compiler_plugins" != "no"; then
7225 dnl The prefix where Clang resides, override to where Clang resides if
7226 dnl using a source build:
7227 if test -z "$CLANGDIR"; then
7228 CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $CXX))))
7230 # Assume Clang is self-built, but allow overriding COMPILER_PLUGINS_CXX to the compiler Clang was built with.
7231 if test -z "$COMPILER_PLUGINS_CXX"; then
7232 COMPILER_PLUGINS_CXX=[$(echo $CXX | sed -e 's/-fsanitize=[^ ]*//g')]
7234 clangbindir=$CLANGDIR/bin
7235 if test "$build_os" = "cygwin"; then
7236 clangbindir=$(cygpath -u "$clangbindir")
7238 AC_PATH_PROG(LLVM_CONFIG, llvm-config,[],"$clangbindir" $PATH)
7239 if test -n "$LLVM_CONFIG"; then
7240 COMPILER_PLUGINS_CXXFLAGS=$($LLVM_CONFIG --cxxflags)
7241 COMPILER_PLUGINS_LINKFLAGS=$($LLVM_CONFIG --ldflags --libs --system-libs | tr '\n' ' ')
7242 if test -z "$CLANGLIBDIR"; then
7243 CLANGLIBDIR=$($LLVM_CONFIG --libdir)
7245 # Try if clang is built from source (in which case its includes are not together with llvm includes).
7246 # src-root is [llvm-toplevel-src-dir]/llvm, clang is [llvm-toplevel-src-dir]/clang
7247 clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
7248 if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d "$clangsrcdir/clang/include"; then
7249 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangsrcdir/clang/include"
7251 # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
7252 clangobjdir=$($LLVM_CONFIG --obj-root)
7253 if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
7254 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
7257 AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
7261 save_CPPFLAGS=$CPPFLAGS
7262 save_CXXFLAGS=$CXXFLAGS
7263 save_LDFLAGS=$LDFLAGS
7265 CXX=$COMPILER_PLUGINS_CXX
7266 CXXCPP="$COMPILER_PLUGINS_CXX -E"
7267 CPPFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7268 CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7269 AC_CHECK_HEADER(clang/Basic/SourceLocation.h,
7270 [COMPILER_PLUGINS=TRUE],
7272 if test "$compiler_plugins" = "yes"; then
7273 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
7275 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
7276 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
7279 dnl TODO: Windows doesn't use LO_CLANG_SHARED_PLUGINS for now, see corresponding TODO
7280 dnl comment in compilerplugins/Makefile-clang.mk:
7281 if test -n "$COMPILER_PLUGINS" && test "$_os" != "WINNT"; then
7283 AC_MSG_CHECKING([for clang libraries to use])
7284 if test -z "$CLANGTOOLLIBS"; then
7285 LIBS="-lclangTooling -lclangFrontend -lclangDriver -lclangParse -lclangSema -lclangEdit \
7286 -lclangAnalysis -lclangAST -lclangLex -lclangSerialization -lclangBasic $COMPILER_PLUGINS_LINKFLAGS"
7288 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7289 [[ clang::FullSourceLoc().dump(); ]])
7290 ],[CLANGTOOLLIBS="$LIBS"],[])
7292 if test -z "$CLANGTOOLLIBS"; then
7293 LIBS="-lclang-cpp $COMPILER_PLUGINS_LINKFLAGS"
7295 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7296 [[ clang::FullSourceLoc().dump(); ]])
7297 ],[CLANGTOOLLIBS="$LIBS"],[])
7299 AC_MSG_RESULT([$CLANGTOOLLIBS])
7300 if test -z "$CLANGTOOLLIBS"; then
7301 if test "$compiler_plugins" = "yes"; then
7302 AC_MSG_ERROR([Cannot find Clang libraries to build compiler plugins.])
7304 AC_MSG_WARN([Cannot find Clang libraries to build compiler plugins, plugins disabled])
7305 add_warning "Cannot find Clang libraries to build compiler plugins, plugins disabled."
7309 if test -n "$COMPILER_PLUGINS"; then
7310 if test -z "$CLANGSYSINCLUDE"; then
7311 if test -n "$LLVM_CONFIG"; then
7312 # Path to the clang system headers (no idea if there's a better way to get it).
7313 CLANGSYSINCLUDE=$($LLVM_CONFIG --libdir)/clang/$($LLVM_CONFIG --version | sed 's/git\|svn//')/include
7320 CPPFLAGS=$save_CPPFLAGS
7321 CXXFLAGS=$save_CXXFLAGS
7322 LDFLAGS=$save_LDFLAGS
7326 AC_MSG_CHECKING([whether the compiler for building compilerplugins is actually Clang])
7327 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
7333 [AC_MSG_RESULT([yes])
7334 COMPILER_PLUGINS_COM_IS_CLANG=TRUE],
7335 [AC_MSG_RESULT([no])])
7336 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
7339 if test "$enable_compiler_plugins" = "yes"; then
7340 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
7343 COMPILER_PLUGINS_ANALYZER_PCH=
7344 if test "$enable_compiler_plugins_analyzer_pch" != no; then
7345 COMPILER_PLUGINS_ANALYZER_PCH=TRUE
7347 AC_SUBST(COMPILER_PLUGINS)
7348 AC_SUBST(COMPILER_PLUGINS_ANALYZER_PCH)
7349 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
7350 AC_SUBST(COMPILER_PLUGINS_CXX)
7351 AC_SUBST(COMPILER_PLUGINS_CXXFLAGS)
7352 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
7353 AC_SUBST(COMPILER_PLUGINS_DEBUG)
7354 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
7356 AC_SUBST(CLANGLIBDIR)
7357 AC_SUBST(CLANGTOOLLIBS)
7358 AC_SUBST(CLANGSYSINCLUDE)
7360 # Plugin to help linker.
7361 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
7362 # This makes --enable-lto build with clang work.
7365 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
7366 AC_SUBST(HAVE_POSIX_FALLOCATE)
7368 dnl ===================================================================
7369 dnl Custom build version
7370 dnl ===================================================================
7372 AC_MSG_CHECKING([whether to add custom build version])
7373 if test "$with_build_version" != ""; then
7374 BUILD_VER_STRING=$with_build_version
7375 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
7380 AC_SUBST(BUILD_VER_STRING)
7382 JITC_PROCESSOR_TYPE=""
7383 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
7384 # IBMs JDK needs this...
7385 JITC_PROCESSOR_TYPE=6
7386 export JITC_PROCESSOR_TYPE
7388 AC_SUBST([JITC_PROCESSOR_TYPE])
7390 # Misc Windows Stuff
7391 AC_ARG_WITH(ucrt-dir,
7392 AS_HELP_STRING([--with-ucrt-dir],
7393 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
7394 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
7395 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
7396 Windows6.1-KB2999226-x64.msu
7397 Windows6.1-KB2999226-x86.msu
7398 Windows8.1-KB2999226-x64.msu
7399 Windows8.1-KB2999226-x86.msu
7400 Windows8-RT-KB2999226-x64.msu
7401 Windows8-RT-KB2999226-x86.msu
7402 A zip archive including those files is available from Microsoft site:
7403 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
7405 UCRT_REDISTDIR="$with_ucrt_dir"
7406 if test $_os = "WINNT"; then
7409 MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
7410 MSVC_DLLS="$msvcdlls"
7411 MSM_PATH=`win_short_path_for_make "$msmdir"`
7412 # MSVC 15.3 changed it to VC141
7413 if echo "$msvcdllpath" | grep -q "VC142.CRT$"; then
7414 SCPDEFS="$SCPDEFS -DWITH_VC142_REDIST"
7415 elif echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
7416 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
7418 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
7421 if test "$UCRT_REDISTDIR" = "no"; then
7422 dnl explicitly disabled
7425 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
7426 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
7427 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
7428 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
7429 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
7430 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
7432 if test -n "$PKGFORMAT"; then
7433 for i in $PKGFORMAT; do
7436 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
7437 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
7446 AC_SUBST(UCRT_REDISTDIR)
7447 AC_SUBST(MSVC_DLL_PATH)
7451 dnl ===================================================================
7453 dnl ===================================================================
7454 if test "$ENABLE_JAVA" != ""; then
7456 # Windows-specific tests
7457 if test "$build_os" = "cygwin"; then
7458 if test "$BITNESS_OVERRIDE" = 64; then
7464 if test -z "$with_jdk_home"; then
7465 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
7466 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
7467 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
7468 if test -n "$regvalue"; then
7470 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
7473 if test -z "$with_jdk_home"; then
7475 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
7476 if test -n "$regvalue"; then
7482 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
7483 with_jdk_home="$_jdk_home"
7484 howfound="found automatically"
7486 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
7489 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
7490 howfound="you passed"
7494 # 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.
7495 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
7496 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
7497 with_jdk_home=`/usr/libexec/java_home`
7500 JAVA_HOME=; export JAVA_HOME
7501 if test -z "$with_jdk_home"; then
7502 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
7504 _java_path="$with_jdk_home/bin/$with_java"
7505 dnl Check if there is a Java interpreter at all.
7506 if test -x "$_java_path"; then
7507 JAVAINTERPRETER=$_java_path
7509 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
7513 dnl Check that the JDK found is correct architecture (at least 2 reasons to
7514 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
7515 dnl loaded by java to run JunitTests:
7516 if test "$build_os" = "cygwin"; then
7517 shortjdkhome=`cygpath -d "$with_jdk_home"`
7518 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
7519 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
7520 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7521 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
7522 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7523 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7526 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
7527 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
7529 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
7530 elif test "$cross_compiling" != "yes"; then
7532 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
7533 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
7534 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
7535 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7538 *) # assumption: everything else 32-bit
7539 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
7540 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7541 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7548 dnl ===================================================================
7550 dnl ===================================================================
7552 # Note that JAVA_HOME as for now always means the *build* platform's
7553 # JAVA_HOME. Whether all the complexity here actually is needed any
7554 # more or not, no idea.
7556 if test "$ENABLE_JAVA" != ""; then
7558 AC_MSG_CHECKING([the installed JDK])
7559 if test -n "$JAVAINTERPRETER"; then
7560 dnl java -version sends output to stderr!
7561 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
7562 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7563 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
7564 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7565 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
7566 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7567 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
7570 dnl IBM JDK specific tests
7571 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
7572 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7574 if test "$_jdk_ver" -lt 10800; then
7575 AC_MSG_ERROR([IBM JDK is too old, you need at least 8])
7578 AC_MSG_RESULT([found (IBM JDK $_jdk)])
7580 if test "$with_jdk_home" = ""; then
7581 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
7582 you must use the "--with-jdk-home" configure option explicitly])
7585 JAVA_HOME=$with_jdk_home
7589 dnl Sun JDK specific tests
7590 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
7591 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7593 if test "$_jdk_ver" -lt 10800; then
7594 AC_MSG_ERROR([JDK is too old, you need at least 8])
7596 if test "$_jdk_ver" -gt 10800; then
7597 JAVA_CLASSPATH_NOT_SET=TRUE
7600 AC_MSG_RESULT([found (JDK $_jdk)])
7601 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
7602 if test "$_os" = "WINNT"; then
7603 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
7606 # set to limit VM usage for JunitTests
7608 # set to limit VM usage for javac
7609 JAVAFLAGS=-J-Xmx128M
7612 AC_MSG_ERROR([Java not found. You need at least JDK 8])
7620 dnl ===================================================================
7621 dnl Checks for javac
7622 dnl ===================================================================
7623 if test "$ENABLE_JAVA" != ""; then
7624 javacompiler="javac"
7625 : ${JAVA_SOURCE_VER=8}
7626 : ${JAVA_TARGET_VER=8}
7627 if test -z "$with_jdk_home"; then
7628 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
7630 _javac_path="$with_jdk_home/bin/$javacompiler"
7631 dnl Check if there is a Java compiler at all.
7632 if test -x "$_javac_path"; then
7633 JAVACOMPILER=$_javac_path
7636 if test -z "$JAVACOMPILER"; then
7637 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7639 if test "$build_os" = "cygwin"; then
7640 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7641 JAVACOMPILER="${JAVACOMPILER}.exe"
7643 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7647 dnl ===================================================================
7648 dnl Checks for javadoc
7649 dnl ===================================================================
7650 if test "$ENABLE_JAVA" != ""; then
7651 if test -z "$with_jdk_home"; then
7652 AC_PATH_PROG(JAVADOC, javadoc)
7654 _javadoc_path="$with_jdk_home/bin/javadoc"
7655 dnl Check if there is a javadoc at all.
7656 if test -x "$_javadoc_path"; then
7657 JAVADOC=$_javadoc_path
7659 AC_PATH_PROG(JAVADOC, javadoc)
7662 if test -z "$JAVADOC"; then
7663 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7665 if test "$build_os" = "cygwin"; then
7666 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7667 JAVADOC="${JAVADOC}.exe"
7669 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7672 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7673 JAVADOCISGJDOC="yes"
7676 AC_SUBST(JAVADOCISGJDOC)
7678 if test "$ENABLE_JAVA" != ""; then
7679 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7680 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7681 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7682 # try to recover first by looking whether we have an alternative
7683 # system as in Debian or newer SuSEs where following /usr/bin/javac
7684 # over /etc/alternatives/javac leads to the right bindir where we
7685 # just need to strip a bit away to get a valid JAVA_HOME
7686 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7687 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7688 # maybe only one level of symlink (e.g. on Mac)
7689 JAVA_HOME=$(readlink $JAVACOMPILER)
7690 if test "$(dirname $JAVA_HOME)" = "."; then
7691 # we've got no path to trim back
7696 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7697 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7698 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7699 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7701 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it...
7702 if test "$JAVA_HOME" != "/usr"; then
7703 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7704 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7705 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7706 dnl Tiger already returns a JDK path...
7707 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7709 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7710 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7711 dnl that checks which version to run
7712 if test -f "$JAVA_HOME"; then
7713 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7718 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7720 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7721 if test -z "$JAVA_HOME"; then
7722 if test "x$with_jdk_home" = "x"; then
7723 cat > findhome.java <<_ACEOF
7724 [import java.io.File;
7728 public static void main(String args[])
7730 String jrelocation = System.getProperty("java.home");
7731 File jre = new File(jrelocation);
7732 System.out.println(jre.getParent());
7736 AC_MSG_CHECKING([if javac works])
7737 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7738 AC_TRY_EVAL(javac_cmd)
7739 if test $? = 0 -a -f ./findhome.class; then
7740 AC_MSG_RESULT([javac works])
7742 echo "configure: javac test failed" >&5
7743 cat findhome.java >&5
7744 AC_MSG_ERROR([javac does not work - java projects will not build!])
7746 AC_MSG_CHECKING([if gij knows its java.home])
7747 JAVA_HOME=`$JAVAINTERPRETER findhome`
7748 if test $? = 0 -a "$JAVA_HOME" != ""; then
7749 AC_MSG_RESULT([$JAVA_HOME])
7751 echo "configure: java test failed" >&5
7752 cat findhome.java >&5
7753 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7755 # clean-up after ourselves
7756 rm -f ./findhome.java ./findhome.class
7758 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7762 # now check if $JAVA_HOME is really valid
7763 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7764 case "${JAVA_HOME}" in
7765 /Library/Java/JavaVirtualMachines/*)
7768 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7771 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7772 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7773 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7774 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
7775 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7776 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7777 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
7780 PathFormat "$JAVA_HOME"
7781 JAVA_HOME="$formatted_path"
7784 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7787 AC_MSG_CHECKING([for JAWT lib])
7788 if test "$_os" = WINNT; then
7789 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7794 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7795 JAVA_ARCH=$my_java_arch
7810 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7811 JAVA_ARCH=$my_java_arch
7814 my_java_arch=sparcv9
7820 my_java_arch=$host_cpu
7823 # This is where JDK9 puts the library
7824 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7825 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7827 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7829 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7831 AC_MSG_RESULT([$JAWTLIB])
7835 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7839 JAVAINC="-I$JAVA_HOME/include"
7840 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7841 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7845 JAVAINC="-I$JAVA_HOME/include/win32"
7846 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7850 if test -d "$JAVA_HOME/include/darwin"; then
7851 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7853 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7858 JAVAINC="-I$JAVA_HOME/include"
7859 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7863 JAVAINC="-I$JAVA_HOME/include"
7864 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7865 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7866 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7867 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7871 JAVAINC="-I$JAVA_HOME/include"
7872 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7873 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7877 JAVAINC="-I$JAVA_HOME/include"
7878 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7879 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7883 JAVAINC="-I$JAVA_HOME/include"
7884 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7885 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7889 JAVAINC="-I$JAVA_HOME/include"
7890 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7891 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7895 JAVAINC="-I$JAVA_HOME/include"
7896 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7897 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7901 SOLARINC="$SOLARINC $JAVAINC"
7903 AC_SUBST(JAVACOMPILER)
7905 AC_SUBST(JAVAINTERPRETER)
7906 AC_SUBST(JAVAIFLAGS)
7908 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7910 AC_SUBST(JAVA_SOURCE_VER)
7911 AC_SUBST(JAVA_TARGET_VER)
7915 dnl ===================================================================
7916 dnl Export file validation
7917 dnl ===================================================================
7918 AC_MSG_CHECKING([whether to enable export file validation])
7919 if test "$with_export_validation" != "no"; then
7920 if test -z "$ENABLE_JAVA"; then
7921 if test "$with_export_validation" = "yes"; then
7922 AC_MSG_ERROR([requested, but Java is disabled])
7924 AC_MSG_RESULT([no, as Java is disabled])
7926 elif ! test -d "${SRC_ROOT}/schema"; then
7927 if test "$with_export_validation" = "yes"; then
7928 AC_MSG_ERROR([requested, but schema directory is missing (it is excluded from tarballs)])
7930 AC_MSG_RESULT([no, schema directory is missing (it is excluded from tarballs)])
7933 AC_MSG_RESULT([yes])
7934 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7936 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7937 if test -z "$ODFVALIDATOR"; then
7938 # remember to download the ODF toolkit with validator later
7939 AC_MSG_NOTICE([no odfvalidator found, will download it])
7940 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7941 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7943 # and fetch name of odfvalidator jar name from download.lst
7944 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7945 AC_SUBST(ODFVALIDATOR_JAR)
7947 if test -z "$ODFVALIDATOR_JAR"; then
7948 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7951 if test "$build_os" = "cygwin"; then
7952 # In case of Cygwin it will be executed from Windows,
7953 # so we need to run bash and absolute path to validator
7954 # so instead of "odfvalidator" it will be
7955 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7956 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7958 ODFVALIDATOR="sh $ODFVALIDATOR"
7960 AC_SUBST(ODFVALIDATOR)
7963 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7964 if test -z "$OFFICEOTRON"; then
7965 # remember to download the officeotron with validator later
7966 AC_MSG_NOTICE([no officeotron found, will download it])
7967 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7968 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7970 # and fetch name of officeotron jar name from download.lst
7971 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7972 AC_SUBST(OFFICEOTRON_JAR)
7974 if test -z "$OFFICEOTRON_JAR"; then
7975 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7978 # check version of existing officeotron
7979 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7980 if test 0"$OFFICEOTRON_VER" -lt 704; then
7981 AC_MSG_ERROR([officeotron too old])
7984 if test "$build_os" = "cygwin"; then
7985 # In case of Cygwin it will be executed from Windows,
7986 # so we need to run bash and absolute path to validator
7987 # so instead of "odfvalidator" it will be
7988 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7989 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7991 OFFICEOTRON="sh $OFFICEOTRON"
7994 AC_SUBST(OFFICEOTRON)
7999 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
8000 if test "$with_bffvalidator" != "no"; then
8001 AC_DEFINE(HAVE_BFFVALIDATOR)
8003 if test "$with_export_validation" = "no"; then
8004 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
8007 if test "$with_bffvalidator" = "yes"; then
8008 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
8010 BFFVALIDATOR="$with_bffvalidator"
8013 if test "$build_os" = "cygwin"; then
8014 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
8015 AC_MSG_RESULT($BFFVALIDATOR)
8017 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
8019 elif test -n "$BFFVALIDATOR"; then
8020 # We are not in Cygwin but need to run Windows binary with wine
8021 AC_PATH_PROGS(WINE, wine)
8023 # so swap in a shell wrapper that converts paths transparently
8024 BFFVALIDATOR_EXE="$BFFVALIDATOR"
8025 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
8026 AC_SUBST(BFFVALIDATOR_EXE)
8027 AC_MSG_RESULT($BFFVALIDATOR)
8029 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
8031 AC_SUBST(BFFVALIDATOR)
8036 dnl ===================================================================
8037 dnl Check for C preprocessor to use
8038 dnl ===================================================================
8039 AC_MSG_CHECKING([which C preprocessor to use in idlc])
8040 if test -n "$with_idlc_cpp"; then
8041 AC_MSG_RESULT([$with_idlc_cpp])
8042 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
8044 AC_MSG_RESULT([ucpp])
8045 AC_MSG_CHECKING([which ucpp tp use])
8046 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
8047 AC_MSG_RESULT([external])
8048 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
8050 AC_MSG_RESULT([internal])
8051 BUILD_TYPE="$BUILD_TYPE UCPP"
8054 AC_SUBST(SYSTEM_UCPP)
8056 dnl ===================================================================
8057 dnl Check for epm (not needed for Windows)
8058 dnl ===================================================================
8059 AC_MSG_CHECKING([whether to enable EPM for packing])
8060 if test "$enable_epm" = "yes"; then
8061 AC_MSG_RESULT([yes])
8062 if test "$_os" != "WINNT"; then
8063 if test $_os = Darwin; then
8065 elif test -n "$with_epm"; then
8068 AC_PATH_PROG(EPM, epm, no)
8070 if test "$EPM" = "no" -o "$EPM" = "internal"; then
8071 AC_MSG_NOTICE([EPM will be built.])
8072 BUILD_TYPE="$BUILD_TYPE EPM"
8073 EPM=${WORKDIR}/UnpackedTarball/epm/epm
8075 # Gentoo has some epm which is something different...
8076 AC_MSG_CHECKING([whether the found epm is the right epm])
8077 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
8078 AC_MSG_RESULT([yes])
8080 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
8082 AC_MSG_CHECKING([epm version])
8083 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
8084 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
8085 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
8086 AC_MSG_RESULT([OK, >= 3.7])
8088 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
8089 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
8094 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
8095 AC_MSG_CHECKING([for rpm])
8096 for a in "$RPM" rpmbuild rpm; do
8097 $a --usage >/dev/null 2> /dev/null
8098 if test $? -eq 0; then
8102 $a --version >/dev/null 2> /dev/null
8103 if test $? -eq 0; then
8109 if test -z "$RPM"; then
8110 AC_MSG_ERROR([not found])
8111 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
8112 RPM_PATH=`which $RPM`
8113 AC_MSG_RESULT([$RPM_PATH])
8114 SCPDEFS="$SCPDEFS -DWITH_RPM"
8116 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
8119 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
8120 AC_PATH_PROG(DPKG, dpkg, no)
8121 if test "$DPKG" = "no"; then
8122 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
8125 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
8126 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
8127 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
8128 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
8129 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
8130 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
8131 AC_MSG_RESULT([yes])
8134 if echo "$PKGFORMAT" | $GREP -q rpm; then
8136 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
8137 add_warning "the rpms will need to be installed with --nodeps"
8141 AC_MSG_WARN([the ${_pt}s will not be relocatable])
8142 add_warning "the ${_pt}s will not be relocatable"
8143 AC_MSG_WARN([if you want to make sure installation without --nodeps and
8144 relocation will work, you need to patch your epm with the
8145 patch in epm/epm-3.7.patch or build with
8146 --with-epm=internal which will build a suitable epm])
8151 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
8152 AC_PATH_PROG(PKGMK, pkgmk, no)
8153 if test "$PKGMK" = "no"; then
8154 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
8161 for i in $PKGFORMAT; do
8163 aix | bsd | deb | pkg | rpm | native | portable)
8165 [--with-package-format='$PKGFORMAT' requires --enable-epm])
8175 if test "$enable_lotuswordpro" = "yes"; then
8178 AC_SUBST(ENABLE_LWP)
8180 dnl ===================================================================
8181 dnl Check for building ODK
8182 dnl ===================================================================
8183 if test "$enable_odk" = no; then
8186 if test "$with_doxygen" = no; then
8187 AC_MSG_CHECKING([for doxygen])
8191 if test "$with_doxygen" = yes; then
8192 AC_PATH_PROG([DOXYGEN], [doxygen])
8193 if test -z "$DOXYGEN"; then
8194 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
8196 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
8197 if ! dot -V 2>/dev/null; then
8198 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
8202 AC_MSG_CHECKING([for doxygen])
8203 DOXYGEN=$with_doxygen
8204 AC_MSG_RESULT([$DOXYGEN])
8206 if test -n "$DOXYGEN"; then
8207 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
8208 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
8209 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
8210 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
8217 AC_MSG_CHECKING([whether to build the ODK])
8218 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
8219 AC_MSG_RESULT([yes])
8221 if test "$with_java" != "no"; then
8222 AC_MSG_CHECKING([whether to build unowinreg.dll])
8223 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
8224 # build on Win by default
8225 enable_build_unowinreg=yes
8227 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
8231 AC_MSG_RESULT([yes])
8232 BUILD_UNOWINREG=TRUE
8234 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
8235 if test -z "$with_mingw_cross_compiler"; then
8237 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
8238 elif test -x "$with_mingw_cross_compiler"; then
8239 MINGWCXX="$with_mingw_cross_compiler"
8241 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
8244 if test "$MINGWCXX" = "false"; then
8245 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
8248 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
8249 if test -x "$mingwstrip_test"; then
8250 MINGWSTRIP="$mingwstrip_test"
8252 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
8255 if test "$MINGWSTRIP" = "false"; then
8256 AC_MSG_ERROR(MinGW32 binutils not found.)
8260 BUILD_TYPE="$BUILD_TYPE ODK"
8265 AC_SUBST(BUILD_UNOWINREG)
8267 AC_SUBST(MINGWSTRIP)
8269 dnl ===================================================================
8270 dnl Check for system zlib
8271 dnl ===================================================================
8272 if test "$with_system_zlib" = "auto"; then
8275 with_system_zlib="$with_system_libs"
8278 if test "$enable_fuzzers" != "yes"; then
8279 with_system_zlib=yes
8287 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
8288 dnl and has no pkg-config for it at least on some tinderboxes,
8289 dnl so leaving that out for now
8290 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
8291 AC_MSG_CHECKING([which zlib to use])
8292 if test "$with_system_zlib" = "yes"; then
8293 AC_MSG_RESULT([external])
8295 AC_CHECK_HEADER(zlib.h, [],
8296 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
8297 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
8298 [AC_MSG_ERROR(zlib not found or functional)], [])
8300 AC_MSG_RESULT([internal])
8302 BUILD_TYPE="$BUILD_TYPE ZLIB"
8303 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
8304 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
8306 AC_SUBST(ZLIB_CFLAGS)
8308 AC_SUBST(SYSTEM_ZLIB)
8310 dnl ===================================================================
8311 dnl Check for system jpeg
8312 dnl ===================================================================
8313 AC_MSG_CHECKING([which libjpeg to use])
8314 if test "$with_system_jpeg" = "yes"; then
8315 AC_MSG_RESULT([external])
8317 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
8318 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
8319 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
8320 [AC_MSG_ERROR(jpeg library not found or functional)], [])
8323 AC_MSG_RESULT([internal, libjpeg-turbo])
8324 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
8325 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
8326 if test "$COM" = "MSC"; then
8327 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
8329 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
8333 x86_64 | amd64 | i*86 | x86 | ia32)
8334 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
8335 if test -z "$NASM" -a "$build_os" = "cygwin"; then
8336 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
8337 NASM="$LODE_HOME/opt/bin/nasm"
8338 elif test -x "/opt/lo/bin/nasm"; then
8339 NASM="/opt/lo/bin/nasm"
8343 if test -n "$NASM"; then
8344 AC_MSG_CHECKING([for object file format of host system])
8346 cygwin* | mingw* | pw32* | interix*)
8356 msdosdjgpp* | go32*)
8359 os2-emx*) # not tested
8360 objfmt='MSOMF' # obj
8362 linux*coff* | linux*oldld*)
8378 kfreebsd* | freebsd* | netbsd* | openbsd*)
8379 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8392 solaris* | sunos* | sysv* | sco*)
8402 darwin* | rhapsody* | nextstep* | openstep* | macos*)
8417 AC_MSG_RESULT([$objfmt])
8418 if test "$objfmt" = 'ELF ?'; then
8420 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
8423 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
8425 MSOMF) NAFLAGS='-fobj -DOBJ32';;
8426 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
8427 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
8428 COFF) NAFLAGS='-fcoff -DCOFF';;
8429 a.out) NAFLAGS='-faout -DAOUT';;
8430 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
8431 ELF) NAFLAGS='-felf -DELF';;
8432 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
8433 RDF) NAFLAGS='-frdf -DRDF';;
8434 Mach-O) NAFLAGS='-fmacho -DMACHO';;
8435 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
8437 AC_MSG_RESULT([$NAFLAGS])
8439 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
8440 cat > conftest.asm << EOF
8441 [%line __oline__ "configure"
8449 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
8450 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
8453 echo "configure: failed program was:" >&AC_FD_CC
8454 cat conftest.asm >&AC_FD_CC
8457 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
8463 if test -z "$NASM"; then
8465 ****************************************************************************
8466 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
8470 if test "$build_os" = "cygwin"; then
8472 install a pre-compiled binary for Win32
8474 mkdir -p /opt/lo/bin
8476 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
8479 or get and install one from http://www.nasm.us/
8481 Then re-run autogen.sh
8483 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
8484 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
8489 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
8493 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
8494 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
8501 AC_SUBST(LIBJPEG_CFLAGS)
8502 AC_SUBST(LIBJPEG_LIBS)
8503 AC_SUBST(SYSTEM_LIBJPEG)
8505 dnl ===================================================================
8506 dnl Check for system clucene
8507 dnl ===================================================================
8508 dnl we should rather be using
8509 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
8510 dnl but the contribs-lib check seems tricky
8511 AC_MSG_CHECKING([which clucene to use])
8512 if test "$with_system_clucene" = "yes"; then
8513 AC_MSG_RESULT([external])
8515 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
8516 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
8517 FilterLibs "${CLUCENE_LIBS}"
8518 CLUCENE_LIBS="${filteredlibs}"
8520 save_CXXFLAGS=$CXXFLAGS
8521 save_CPPFLAGS=$CPPFLAGS
8522 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
8523 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
8524 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
8525 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
8526 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
8527 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
8528 CXXFLAGS=$save_CXXFLAGS
8529 CPPFLAGS=$save_CPPFLAGS
8532 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
8534 AC_MSG_RESULT([internal])
8536 BUILD_TYPE="$BUILD_TYPE CLUCENE"
8538 AC_SUBST(SYSTEM_CLUCENE)
8539 AC_SUBST(CLUCENE_CFLAGS)
8540 AC_SUBST(CLUCENE_LIBS)
8542 dnl ===================================================================
8543 dnl Check for system expat
8544 dnl ===================================================================
8545 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
8547 dnl ===================================================================
8548 dnl Check for system xmlsec
8549 dnl ===================================================================
8550 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.28])
8552 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
8553 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
8555 AC_DEFINE([ENABLE_EOT])
8556 AC_MSG_RESULT([yes])
8558 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
8563 AC_SUBST([ENABLE_EOT])
8565 dnl ===================================================================
8566 dnl Check for DLP libs
8567 dnl ===================================================================
8568 AS_IF([test "$COM" = "MSC"],
8569 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
8570 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
8572 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
8574 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
8576 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
8578 AS_IF([test "$COM" = "MSC"],
8579 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
8580 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
8582 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
8584 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
8586 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
8587 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
8589 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
8591 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
8593 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
8595 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
8596 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.15])
8598 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
8599 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
8601 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
8603 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
8604 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
8606 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
8608 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
8610 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
8612 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
8614 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
8615 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
8617 dnl ===================================================================
8618 dnl Check for system lcms2
8619 dnl ===================================================================
8620 if test "$with_system_lcms2" != "yes"; then
8623 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
8624 if test "$GCC" = "yes"; then
8625 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
8627 if test "$COM" = "MSC"; then # override the above
8628 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
8631 dnl ===================================================================
8632 dnl Check for system cppunit
8633 dnl ===================================================================
8634 if test "$_os" != "Android" ; then
8635 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
8638 dnl ===================================================================
8639 dnl Check whether freetype is available
8640 dnl ===================================================================
8641 if test "$test_freetype" = "yes"; then
8642 AC_MSG_CHECKING([whether freetype is available])
8643 # FreeType has 3 different kinds of versions
8644 # * release, like 2.4.10
8645 # * libtool, like 13.0.7 (this what pkg-config returns)
8647 # FreeType's docs/VERSION.DLL provides a table mapping between the three
8650 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
8651 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8652 FilterLibs "${FREETYPE_LIBS}"
8653 FREETYPE_LIBS="${filteredlibs}"
8654 SYSTEM_FREETYPE=TRUE
8656 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
8657 if test "x$ac_config_site_64bit_host" = xYES; then
8658 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
8660 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
8663 AC_SUBST(FREETYPE_CFLAGS)
8664 AC_SUBST(FREETYPE_LIBS)
8665 AC_SUBST([SYSTEM_FREETYPE])
8667 # ===================================================================
8668 # Check for system libxslt
8669 # to prevent incompatibilities between internal libxml2 and external libxslt,
8670 # or vice versa, use with_system_libxml here
8671 # ===================================================================
8672 if test "$with_system_libxml" = "auto"; then
8675 with_system_libxml="$with_system_libs"
8678 if test "$enable_fuzzers" != "yes"; then
8679 with_system_libxml=yes
8681 with_system_libxml=no
8687 AC_MSG_CHECKING([which libxslt to use])
8688 if test "$with_system_libxml" = "yes"; then
8689 AC_MSG_RESULT([external])
8691 if test "$_os" = "Darwin"; then
8692 dnl make sure to use SDK path
8693 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8694 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8696 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8697 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8699 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8700 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8701 FilterLibs "${LIBXSLT_LIBS}"
8702 LIBXSLT_LIBS="${filteredlibs}"
8703 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8704 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8705 FilterLibs "${LIBEXSLT_LIBS}"
8706 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8709 dnl Check for xsltproc
8710 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8711 if test "$XSLTPROC" = "no"; then
8712 AC_MSG_ERROR([xsltproc is required])
8715 AC_MSG_RESULT([internal])
8717 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8719 if test "$cross_compiling" = "yes"; then
8720 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8721 if test "$XSLTPROC" = "no"; then
8722 AC_MSG_ERROR([xsltproc is required])
8726 AC_SUBST(SYSTEM_LIBXSLT)
8727 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8728 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8730 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8732 AC_SUBST(LIBEXSLT_CFLAGS)
8733 AC_SUBST(LIBEXSLT_LIBS)
8734 AC_SUBST(LIBXSLT_CFLAGS)
8735 AC_SUBST(LIBXSLT_LIBS)
8738 # ===================================================================
8739 # Check for system libxml
8740 # ===================================================================
8741 AC_MSG_CHECKING([which libxml to use])
8742 if test "$with_system_libxml" = "yes"; then
8743 AC_MSG_RESULT([external])
8745 if test "$_os" = "Darwin"; then
8746 dnl make sure to use SDK path
8747 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8749 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8750 elif test $_os = iOS; then
8751 dnl make sure to use SDK path
8752 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8753 LIBXML_CFLAGS="-I$usr/include/libxml2"
8754 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8756 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8757 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8758 FilterLibs "${LIBXML_LIBS}"
8759 LIBXML_LIBS="${filteredlibs}"
8762 dnl Check for xmllint
8763 AC_PATH_PROG(XMLLINT, xmllint, no)
8764 if test "$XMLLINT" = "no"; then
8765 AC_MSG_ERROR([xmllint is required])
8768 AC_MSG_RESULT([internal])
8770 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8771 if test "$COM" = "MSC"; then
8772 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8774 if test "$COM" = "MSC"; then
8775 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8777 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8779 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8781 AC_SUBST(SYSTEM_LIBXML)
8782 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8783 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8785 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8786 AC_SUBST(LIBXML_CFLAGS)
8787 AC_SUBST(LIBXML_LIBS)
8790 # =====================================================================
8791 # Checking for a Python interpreter with version >= 2.7.
8792 # Build and runtime requires Python 3 compatible version (>= 2.7).
8793 # Optionally user can pass an option to configure, i. e.
8794 # ./configure PYTHON=/usr/bin/python
8795 # =====================================================================
8796 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8797 if test -n "$PYTHON"; then
8798 PYTHON_FOR_BUILD=$PYTHON
8800 # This allows a lack of system python with no error, we use internal one in that case.
8801 AM_PATH_PYTHON([2.7],, [:])
8802 # Clean PYTHON_VERSION checked below if cross-compiling
8804 if test "$PYTHON" != ":"; then
8805 PYTHON_FOR_BUILD=$PYTHON
8809 AC_SUBST(PYTHON_FOR_BUILD)
8811 # Checks for Python to use for Pyuno
8812 AC_MSG_CHECKING([which Python to use for Pyuno])
8813 case "$enable_python" in
8815 if test -z $PYTHON_FOR_BUILD; then
8816 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8817 # requirement from the choice whether to include Python stuff in the installer, but why
8819 AC_MSG_ERROR([Python is required at build time.])
8822 AC_MSG_RESULT([none])
8825 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8826 AC_MSG_RESULT([no, overridden by --disable-scripting])
8828 elif test $build_os = cygwin; then
8829 dnl When building on Windows we don't attempt to use any installed
8830 dnl "system" Python.
8831 AC_MSG_RESULT([fully internal])
8832 enable_python=internal
8833 elif test "$cross_compiling" = yes; then
8834 AC_MSG_RESULT([system])
8835 enable_python=system
8837 # Unset variables set by the above AM_PATH_PYTHON so that
8838 # we actually do check anew.
8840 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
8841 AM_PATH_PYTHON([3.3],, [:])
8842 AC_MSG_CHECKING([which Python to use for Pyuno])
8843 if test "$PYTHON" = ":"; then
8844 if test -z "$PYTHON_FOR_BUILD"; then
8845 AC_MSG_RESULT([fully internal])
8847 AC_MSG_RESULT([internal])
8849 enable_python=internal
8851 AC_MSG_RESULT([system])
8852 enable_python=system
8857 AC_MSG_RESULT([internal])
8860 AC_MSG_RESULT([fully internal])
8861 enable_python=internal
8864 AC_MSG_RESULT([system])
8865 if test "$_os" = Darwin; then
8866 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])
8870 AC_MSG_ERROR([Incorrect --enable-python option])
8874 if test $enable_python != no; then
8875 BUILD_TYPE="$BUILD_TYPE PYUNO"
8878 if test $enable_python = system; then
8879 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8880 # Fallback: Accept these in the environment, or as set above
8883 elif test "$cross_compiling" != yes; then
8884 # Unset variables set by the above AM_PATH_PYTHON so that
8885 # we actually do check anew.
8886 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
8887 # This causes an error if no python command is found
8888 AM_PATH_PYTHON([3.3])
8889 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8890 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8891 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8892 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8893 if test -z "$PKG_CONFIG"; then
8894 PYTHON_CFLAGS="-I$python_include"
8895 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8896 elif $PKG_CONFIG --exists python-$python_version-embed; then
8897 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
8898 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
8899 elif $PKG_CONFIG --exists python-$python_version; then
8900 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8901 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8903 PYTHON_CFLAGS="-I$python_include"
8904 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8906 FilterLibs "${PYTHON_LIBS}"
8907 PYTHON_LIBS="${filteredlibs}"
8909 dnl How to find out the cross-compilation Python installation path?
8910 AC_MSG_CHECKING([for python version])
8911 AS_IF([test -n "$PYTHON_VERSION"],
8912 [AC_MSG_RESULT([$PYTHON_VERSION])],
8913 [AC_MSG_RESULT([not found])
8914 AC_MSG_ERROR([no usable python found])])
8915 test -n "$PYTHON_CFLAGS" && break
8918 dnl Check if the headers really work
8919 save_CPPFLAGS="$CPPFLAGS"
8920 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8921 AC_CHECK_HEADER(Python.h)
8922 CPPFLAGS="$save_CPPFLAGS"
8924 # let the PYTHON_FOR_BUILD match the same python installation that
8925 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8926 # better for PythonTests.
8927 PYTHON_FOR_BUILD=$PYTHON
8930 if test "$with_lxml" != no; then
8931 if test -z "$PYTHON_FOR_BUILD"; then
8934 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8937 if test "$cross_compiling" != yes ; then
8938 BUILD_TYPE="$BUILD_TYPE LXML"
8943 AC_MSG_CHECKING([for python lxml])
8944 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8945 AC_MSG_RESULT([yes])
8949 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8952 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8953 if test -n ${SYSTEM_LIBXSLT} -o -n ${SYSTEM_LIBXML}; then
8954 AC_MSG_RESULT([no, and no system libxml/libxslt, gla11y will only report widget classes and ids])
8956 BUILD_TYPE="$BUILD_TYPE LXML"
8957 AC_MSG_RESULT([no, using internal lxml])
8960 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8968 dnl By now enable_python should be "system", "internal" or "no"
8969 case $enable_python in
8973 if test "x$ac_cv_header_Python_h" != "xyes"; then
8974 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8978 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8979 AC_MSG_CHECKING([for correct python library version])
8980 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8983 int main(int argc, char **argv) {
8984 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
8985 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8988 ]])],[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])])
8992 dnl FIXME Check if the Python library can be linked with, too?
8997 PYTHON_VERSION_MAJOR=3
8998 PYTHON_VERSION_MINOR=7
8999 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.7
9000 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
9001 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
9003 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
9004 BUILD_TYPE="$BUILD_TYPE PYTHON"
9005 if test "$OS" = LINUX; then
9006 BUILD_TYPE="$BUILD_TYPE LIBFFI"
9008 # Embedded Python dies without Home set
9009 if test "$HOME" = ""; then
9018 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
9022 AC_SUBST(DISABLE_PYTHON)
9023 AC_SUBST(SYSTEM_PYTHON)
9024 AC_SUBST(PYTHON_CFLAGS)
9025 AC_SUBST(PYTHON_LIBS)
9026 AC_SUBST(PYTHON_VERSION)
9027 AC_SUBST(PYTHON_VERSION_MAJOR)
9028 AC_SUBST(PYTHON_VERSION_MINOR)
9030 ENABLE_MARIADBC=TRUE
9031 if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then
9037 if test "$ENABLE_MARIADBC" = "TRUE"; then
9038 BUILD_TYPE="$BUILD_TYPE MARIADBC"
9041 AC_SUBST(ENABLE_MARIADBC)
9042 AC_SUBST(MARIADBC_MAJOR)
9043 AC_SUBST(MARIADBC_MINOR)
9044 AC_SUBST(MARIADBC_MICRO)
9046 if test "$ENABLE_MARIADBC" = "TRUE"; then
9047 dnl ===================================================================
9048 dnl Check for system MariaDB
9049 dnl ===================================================================
9050 AC_MSG_CHECKING([which MariaDB to use])
9051 if test "$with_system_mariadb" = "yes"; then
9052 AC_MSG_RESULT([external])
9053 SYSTEM_MARIADB_CONNECTOR_C=TRUE
9054 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
9055 if test -z "$MARIADBCONFIG"; then
9056 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
9057 if test -z "$MARIADBCONFIG"; then
9058 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
9059 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
9062 AC_MSG_CHECKING([MariaDB version])
9063 MARIADB_VERSION=`$MARIADBCONFIG --version`
9064 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
9065 if test "$MARIADB_MAJOR" -ge "5"; then
9068 AC_MSG_ERROR([too old, use 5.0.x or later])
9070 AC_MSG_CHECKING([for MariaDB Client library])
9071 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
9072 if test "$COM_IS_CLANG" = TRUE; then
9073 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
9075 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
9076 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
9077 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
9079 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
9080 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
9081 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
9082 | sed -e 's|/lib64/|/lib/|')
9084 FilterLibs "${MARIADB_LIBS}"
9085 MARIADB_LIBS="${filteredlibs}"
9086 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
9087 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
9088 if test "$enable_bundle_mariadb" = "yes"; then
9089 AC_MSG_RESULT([yes])
9090 BUNDLE_MARIADB_CONNECTOR_C=TRUE
9091 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
9093 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
9095 /g' | grep -E '(mysqlclient|mariadb)')
9096 if test "$_os" = "Darwin"; then
9097 LIBMARIADB=${LIBMARIADB}.dylib
9098 elif test "$_os" = "WINNT"; then
9099 LIBMARIADB=${LIBMARIADB}.dll
9101 LIBMARIADB=${LIBMARIADB}.so
9103 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
9104 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
9105 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
9106 AC_MSG_RESULT([found.])
9107 PathFormat "$LIBMARIADB_PATH"
9108 LIBMARIADB_PATH="$formatted_path"
9110 AC_MSG_ERROR([not found.])
9114 BUNDLE_MARIADB_CONNECTOR_C=
9117 AC_MSG_RESULT([internal])
9118 SYSTEM_MARIADB_CONNECTOR_C=
9119 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
9120 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
9121 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
9124 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
9125 AC_SUBST(MARIADB_CFLAGS)
9126 AC_SUBST(MARIADB_LIBS)
9127 AC_SUBST(LIBMARIADB)
9128 AC_SUBST(LIBMARIADB_PATH)
9129 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
9132 dnl ===================================================================
9133 dnl Check for system hsqldb
9134 dnl ===================================================================
9135 if test "$with_java" != "no"; then
9136 HSQLDB_USE_JDBC_4_1=
9137 AC_MSG_CHECKING([which hsqldb to use])
9138 if test "$with_system_hsqldb" = "yes"; then
9139 AC_MSG_RESULT([external])
9141 if test -z $HSQLDB_JAR; then
9142 HSQLDB_JAR=/usr/share/java/hsqldb.jar
9144 if ! test -f $HSQLDB_JAR; then
9145 AC_MSG_ERROR(hsqldb.jar not found.)
9147 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
9151 my $file = "$ENV{'HSQLDB_JAR'}";
9152 my $zip = Archive::Zip->new( $file );
9153 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
9154 if ( $mf =~ m/Specification-Version: 1.8.*/ )
9156 push @l, split(/\n/, $mf);
9157 foreach my $line (@l)
9159 if ($line =~ m/Specification-Version:/)
9161 ($t, $version) = split (/:/,$line);
9162 $version =~ s/^\s//;
9163 ($a, $b, $c, $d) = split (/\./,$version);
9164 if ($c == "0" && $d > "8")
9179 AC_MSG_RESULT([yes])
9181 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
9184 AC_MSG_RESULT([internal])
9186 BUILD_TYPE="$BUILD_TYPE HSQLDB"
9188 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
9189 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
9190 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
9191 AC_MSG_RESULT([yes])
9192 HSQLDB_USE_JDBC_4_1=TRUE
9197 AC_SUBST(SYSTEM_HSQLDB)
9198 AC_SUBST(HSQLDB_JAR)
9199 AC_SUBST([HSQLDB_USE_JDBC_4_1])
9202 dnl ===================================================================
9203 dnl Check for PostgreSQL stuff
9204 dnl ===================================================================
9205 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
9206 if test "x$enable_postgresql_sdbc" != "xno"; then
9207 AC_MSG_RESULT([yes])
9208 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
9210 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
9211 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
9213 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
9214 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
9217 postgres_interface=""
9218 if test "$with_system_postgresql" = "yes"; then
9219 postgres_interface="external PostgreSQL"
9220 SYSTEM_POSTGRESQL=TRUE
9221 if test "$_os" = Darwin; then
9223 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
9224 pg_supp_path="$P_SEP$d$pg_supp_path"
9227 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
9228 if test -n "$PGCONFIG"; then
9229 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
9230 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
9232 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
9233 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
9234 POSTGRESQL_LIB=$POSTGRESQL_LIBS
9236 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
9239 FilterLibs "${POSTGRESQL_LIB}"
9240 POSTGRESQL_LIB="${filteredlibs}"
9242 # if/when anything else than PostgreSQL uses Kerberos,
9243 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
9248 # macOS has system MIT Kerberos 5 since 10.4
9249 if test "$with_krb5" != "no"; then
9252 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
9253 # that the libraries where these functions are located on macOS will change, is it?
9254 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9255 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9258 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9259 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9260 KRB5_LIBS="$KRB5_LIBS $LIBS"
9263 if test "$with_gssapi" != "no"; then
9266 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9267 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9273 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
9274 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
9277 Linux|GNU|*BSD|DragonFly)
9278 if test "$with_krb5" != "no"; then
9281 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9282 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9285 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9286 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9287 KRB5_LIBS="$KRB5_LIBS $LIBS"
9290 if test "$with_gssapi" != "no"; then
9293 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9294 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9300 if test "$with_krb5" = "yes"; then
9303 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9304 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9307 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9308 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9309 KRB5_LIBS="$KRB5_LIBS $LIBS"
9312 if test "$with_gssapi" = "yes"; then
9315 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9316 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9322 if test -n "$with_libpq_path"; then
9323 SYSTEM_POSTGRESQL=TRUE
9324 postgres_interface="external libpq"
9325 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
9326 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
9329 postgres_interface="internal"
9331 POSTGRESQL_INC="%OVERRIDE_ME%"
9332 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
9336 AC_MSG_CHECKING([PostgreSQL C interface])
9337 AC_MSG_RESULT([$postgres_interface])
9339 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
9340 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
9342 save_CPPFLAGS=$CPPFLAGS
9344 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
9345 LIBS="${LIBS} ${POSTGRESQL_LIB}"
9346 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
9347 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
9348 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
9350 CPPFLAGS=$save_CPPFLAGS
9353 BUILD_POSTGRESQL_SDBC=TRUE
9358 AC_SUBST(WITH_GSSAPI)
9359 AC_SUBST(GSSAPI_LIBS)
9361 AC_SUBST(BUILD_POSTGRESQL_SDBC)
9362 AC_SUBST(SYSTEM_POSTGRESQL)
9363 AC_SUBST(POSTGRESQL_INC)
9364 AC_SUBST(POSTGRESQL_LIB)
9366 dnl ===================================================================
9367 dnl Check for Firebird stuff
9368 dnl ===================================================================
9369 ENABLE_FIREBIRD_SDBC=
9370 if test "$enable_firebird_sdbc" = "yes" ; then
9371 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
9373 dnl ===================================================================
9374 dnl Check for system Firebird
9375 dnl ===================================================================
9376 AC_MSG_CHECKING([which Firebird to use])
9377 if test "$with_system_firebird" = "yes"; then
9378 AC_MSG_RESULT([external])
9379 SYSTEM_FIREBIRD=TRUE
9380 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
9381 if test -z "$FIREBIRDCONFIG"; then
9382 AC_MSG_NOTICE([No fb_config -- using pkg-config])
9383 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
9384 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
9386 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
9388 AC_MSG_NOTICE([fb_config found])
9389 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
9390 AC_MSG_CHECKING([for Firebird Client library])
9391 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
9392 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
9393 FilterLibs "${FIREBIRD_LIBS}"
9394 FIREBIRD_LIBS="${filteredlibs}"
9396 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
9397 AC_MSG_CHECKING([Firebird version])
9398 if test -n "${FIREBIRD_VERSION}"; then
9399 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
9400 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
9401 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
9404 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
9407 __save_CFLAGS="${CFLAGS}"
9408 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
9409 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
9410 #if defined(FB_API_VER) && FB_API_VER == 30
9411 int fb_api_is_30(void) { return 0; }
9413 #error "Wrong Firebird API version"
9414 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
9415 CFLAGS="${__save_CFLAGS}"
9417 ENABLE_FIREBIRD_SDBC=TRUE
9418 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9419 elif test "$enable_database_connectivity" != yes; then
9420 AC_MSG_RESULT([none])
9421 elif test "$cross_compiling" = "yes"; then
9422 AC_MSG_RESULT([none])
9424 dnl Embedded Firebird has version 3.0
9425 AC_DEFINE(HAVE_FIREBIRD_30, 1)
9426 dnl We need libatomic_ops for any non X86/X64 system
9427 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
9428 dnl ===================================================================
9429 dnl Check for system libatomic_ops
9430 dnl ===================================================================
9431 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
9432 if test "$with_system_libatomic_ops" = "yes"; then
9433 SYSTEM_LIBATOMIC_OPS=TRUE
9434 AC_CHECK_HEADERS(atomic_ops.h, [],
9435 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
9437 SYSTEM_LIBATOMIC_OPS=
9438 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
9439 LIBATOMIC_OPS_LIBS="-latomic_ops"
9440 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
9444 AC_MSG_RESULT([internal])
9446 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
9447 FIREBIRD_LIBS="-lfbclient"
9449 if test "$with_system_libtommath" = "yes"; then
9450 SYSTEM_LIBTOMMATH=TRUE
9451 dnl check for tommath presence
9453 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
9454 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
9458 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
9459 LIBTOMMATH_LIBS="-ltommath"
9460 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
9463 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
9464 ENABLE_FIREBIRD_SDBC=TRUE
9465 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9468 AC_SUBST(ENABLE_FIREBIRD_SDBC)
9469 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
9470 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
9471 AC_SUBST(LIBATOMIC_OPS_LIBS)
9472 AC_SUBST(SYSTEM_FIREBIRD)
9473 AC_SUBST(FIREBIRD_CFLAGS)
9474 AC_SUBST(FIREBIRD_LIBS)
9475 AC_SUBST([TOMMATH_CFLAGS])
9476 AC_SUBST([TOMMATH_LIBS])
9478 dnl ===================================================================
9479 dnl Check for system curl
9480 dnl ===================================================================
9481 AC_MSG_CHECKING([which libcurl to use])
9482 if test "$with_system_curl" = "auto"; then
9483 with_system_curl="$with_system_libs"
9486 if test "$with_system_curl" = "yes"; then
9487 AC_MSG_RESULT([external])
9490 # First try PKGCONFIG and then fall back
9491 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
9493 if test -n "$CURL_PKG_ERRORS"; then
9494 AC_PATH_PROG(CURLCONFIG, curl-config)
9495 if test -z "$CURLCONFIG"; then
9496 AC_MSG_ERROR([curl development files not found])
9498 CURL_LIBS=`$CURLCONFIG --libs`
9499 FilterLibs "${CURL_LIBS}"
9500 CURL_LIBS="${filteredlibs}"
9501 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
9502 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
9504 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
9505 case $curl_version in
9506 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
9507 dnl so they need to be doubled to end up in the configure script
9508 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
9509 AC_MSG_RESULT([yes])
9512 AC_MSG_ERROR([no, you have $curl_version])
9518 elif test $_os = iOS; then
9519 # Let's see if we need curl, I think not?
9520 AC_MSG_RESULT([none])
9523 AC_MSG_RESULT([internal])
9525 BUILD_TYPE="$BUILD_TYPE CURL"
9528 AC_SUBST(SYSTEM_CURL)
9529 AC_SUBST(CURL_CFLAGS)
9531 AC_SUBST(ENABLE_CURL)
9533 dnl ===================================================================
9534 dnl Check for system boost
9535 dnl ===================================================================
9536 AC_MSG_CHECKING([which boost to use])
9537 if test "$with_system_boost" = "yes"; then
9538 AC_MSG_RESULT([external])
9540 AX_BOOST_BASE([1.66],,[AC_MSG_ERROR([no suitable Boost found])])
9546 save_CXXFLAGS=$CXXFLAGS
9547 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
9548 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
9549 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
9550 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
9551 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
9552 CXXFLAGS=$save_CXXFLAGS
9554 # this is in m4/ax_boost_base.m4
9555 FilterLibs "${BOOST_LDFLAGS}"
9556 BOOST_LDFLAGS="${filteredlibs}"
9558 AC_MSG_RESULT([internal])
9559 BUILD_TYPE="$BUILD_TYPE BOOST"
9561 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
9562 # use warning-suppressing wrapper headers
9563 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
9565 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
9568 AC_SUBST(SYSTEM_BOOST)
9570 dnl ===================================================================
9571 dnl Check for system mdds
9572 dnl ===================================================================
9573 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.5 >= 1.5.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
9575 dnl ===================================================================
9576 dnl Check for system glm
9577 dnl ===================================================================
9578 AC_MSG_CHECKING([which glm to use])
9579 if test "$with_system_glm" = "yes"; then
9580 AC_MSG_RESULT([external])
9583 AC_CHECK_HEADER([glm/glm.hpp], [],
9584 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
9587 AC_MSG_RESULT([internal])
9588 BUILD_TYPE="$BUILD_TYPE GLM"
9590 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
9592 AC_SUBST([GLM_CFLAGS])
9593 AC_SUBST([SYSTEM_GLM])
9595 dnl ===================================================================
9596 dnl Check for system odbc
9597 dnl ===================================================================
9598 AC_MSG_CHECKING([which odbc headers to use])
9599 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
9600 AC_MSG_RESULT([external])
9601 SYSTEM_ODBC_HEADERS=TRUE
9603 if test "$build_os" = "cygwin"; then
9604 save_CPPFLAGS=$CPPFLAGS
9606 PathFormat "$winsdktest"
9607 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"
9608 AC_CHECK_HEADER(sqlext.h, [],
9609 [AC_MSG_ERROR(odbc not found. install odbc)],
9610 [#include <windows.h>])
9611 CPPFLAGS=$save_CPPFLAGS
9613 AC_CHECK_HEADER(sqlext.h, [],
9614 [AC_MSG_ERROR(odbc not found. install odbc)],[])
9616 elif test "$enable_database_connectivity" != yes; then
9617 AC_MSG_RESULT([none])
9619 AC_MSG_RESULT([internal])
9620 SYSTEM_ODBC_HEADERS=
9622 AC_SUBST(SYSTEM_ODBC_HEADERS)
9624 dnl ===================================================================
9625 dnl Enable LDAP support
9626 dnl ===================================================================
9628 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
9629 AC_MSG_CHECKING([whether to enable LDAP support])
9630 if test "$enable_ldap" != "yes"; then
9635 AC_MSG_RESULT([yes])
9639 AC_SUBST(ENABLE_LDAP)
9641 dnl ===================================================================
9642 dnl Check for system openldap
9643 dnl ===================================================================
9645 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android" -a "$ENABLE_LDAP" != ""; then
9646 AC_MSG_CHECKING([which openldap library to use])
9647 if test "$with_system_openldap" = "yes"; then
9648 AC_MSG_RESULT([external])
9649 SYSTEM_OPENLDAP=TRUE
9650 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
9651 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9652 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9654 AC_MSG_RESULT([internal])
9656 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
9659 AC_SUBST(SYSTEM_OPENLDAP)
9661 dnl ===================================================================
9662 dnl Check for system NSS
9663 dnl ===================================================================
9664 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
9665 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
9666 AC_DEFINE(HAVE_FEATURE_NSS)
9668 AC_DEFINE(ENABLE_NSS)
9669 elif test $_os != iOS ; then
9672 AC_SUBST(ENABLE_NSS)
9674 dnl ===================================================================
9675 dnl Check for TLS/SSL and cryptographic implementation to use
9676 dnl ===================================================================
9677 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
9678 if test -n "$with_tls"; then
9681 AC_DEFINE(USE_TLS_OPENSSL)
9684 if test "$enable_openssl" != "yes"; then
9685 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9688 # warn that OpenSSL has been selected but not all TLS code has this option
9689 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
9690 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
9693 AC_DEFINE(USE_TLS_NSS)
9697 AC_MSG_WARN([Skipping TLS/SSL])
9700 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9702 nss - Mozilla's Network Security Services (NSS)
9707 # default to using NSS, it results in smaller oox lib
9708 AC_DEFINE(USE_TLS_NSS)
9711 AC_MSG_RESULT([$TLS])
9714 dnl ===================================================================
9715 dnl Check for system sane
9716 dnl ===================================================================
9717 AC_MSG_CHECKING([which sane header to use])
9718 if test "$with_system_sane" = "yes"; then
9719 AC_MSG_RESULT([external])
9720 AC_CHECK_HEADER(sane/sane.h, [],
9721 [AC_MSG_ERROR(sane not found. install sane)], [])
9723 AC_MSG_RESULT([internal])
9724 BUILD_TYPE="$BUILD_TYPE SANE"
9727 dnl ===================================================================
9728 dnl Check for system icu
9729 dnl ===================================================================
9736 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9737 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9738 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9739 AC_MSG_CHECKING([which icu to use])
9740 if test "$with_system_icu" = "yes"; then
9741 AC_MSG_RESULT([external])
9744 AC_MSG_CHECKING([for unicode/rbbi.h])
9745 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([icu headers not found])])
9748 if test "$cross_compiling" != "yes"; then
9749 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9750 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9751 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9752 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9755 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9756 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9757 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9758 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9759 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9760 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9761 AC_MSG_RESULT([yes])
9764 if test "$with_system_icu_for_build" != "force"; then
9765 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9766 You can use --with-system-icu-for-build=force to use it anyway.])
9771 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9772 # using the system icu tools can lead to version confusion, use the
9773 # ones from the build environment when cross-compiling
9774 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9775 if test -z "$SYSTEM_GENBRK"; then
9776 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9778 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9779 if test -z "$SYSTEM_GENCCODE"; then
9780 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9782 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9783 if test -z "$SYSTEM_GENCMN"; then
9784 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9786 if test "$ICU_MAJOR" -ge "49"; then
9787 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9788 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9789 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9791 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9792 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9793 ICU_RECLASSIFIED_HEBREW_LETTER=
9797 if test "$cross_compiling" = "yes"; then
9798 if test "$ICU_MAJOR" -ge "50"; then
9799 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9804 AC_MSG_RESULT([internal])
9806 BUILD_TYPE="$BUILD_TYPE ICU"
9807 # surprisingly set these only for "internal" (to be used by various other
9808 # external libs): the system icu-config is quite unhelpful and spits out
9809 # dozens of weird flags and also default path -I/usr/include
9810 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9811 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9813 if test "$ICU_MAJOR" -ge "59"; then
9814 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9815 # with -std=c++11 but not all external libraries can be built with that,
9816 # for those use a bit-compatible typedef uint16_t UChar; see
9817 # icu/source/common/unicode/umachine.h
9818 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9822 AC_SUBST(SYSTEM_ICU)
9823 AC_SUBST(SYSTEM_GENBRK)
9824 AC_SUBST(SYSTEM_GENCCODE)
9825 AC_SUBST(SYSTEM_GENCMN)
9828 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9829 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9830 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9831 AC_SUBST(ICU_CFLAGS)
9833 AC_SUBST(ICU_UCHAR_TYPE)
9835 dnl ==================================================================
9837 dnl ==================================================================
9838 DEFAULT_CRASHDUMP_VALUE="true"
9839 AC_MSG_CHECKING([whether to enable breakpad])
9840 if test "$enable_breakpad" != yes; then
9843 AC_MSG_RESULT([yes])
9844 ENABLE_BREAKPAD="TRUE"
9845 AC_DEFINE(ENABLE_BREAKPAD)
9846 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9847 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9849 AC_MSG_CHECKING([for disable crash dump])
9850 if test "$enable_crashdump" = no; then
9851 DEFAULT_CRASHDUMP_VALUE="false"
9852 AC_MSG_RESULT([yes])
9857 AC_MSG_CHECKING([for crashreport config])
9858 if test "$with_symbol_config" = "no"; then
9859 BREAKPAD_SYMBOL_CONFIG="invalid"
9862 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9863 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9864 AC_MSG_RESULT([yes])
9866 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9868 AC_SUBST(ENABLE_BREAKPAD)
9869 AC_SUBST(DEFAULT_CRASHDUMP_VALUE)
9871 dnl ==================================================================
9873 dnl ==================================================================
9874 AC_MSG_CHECKING([whether to enable fuzzers])
9875 if test "$enable_fuzzers" != yes; then
9878 AC_MSG_RESULT([yes])
9879 ENABLE_FUZZERS="TRUE"
9880 AC_DEFINE([ENABLE_FUZZERS],1)
9881 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9883 AC_SUBST(ENABLE_FUZZERS)
9885 dnl ===================================================================
9887 dnl ===================================================================
9888 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.15 >= 0.15.0])
9889 if test "$with_system_orcus" != "yes"; then
9890 if test "$SYSTEM_BOOST" = "TRUE"; then
9891 # ===========================================================
9892 # Determine if we are going to need to link with Boost.System
9893 # ===========================================================
9894 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9895 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9896 dnl in documentation has no effect.
9897 AC_MSG_CHECKING([if we need to link with Boost.System])
9899 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9900 @%:@include <boost/version.hpp>
9902 #if BOOST_VERSION >= 105000
9903 # error yes, we need to link with Boost.System
9908 AC_MSG_RESULT([yes])
9914 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9915 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9916 AC_SUBST([BOOST_SYSTEM_LIB])
9917 AC_SUBST(SYSTEM_LIBORCUS)
9919 dnl ===================================================================
9921 dnl ===================================================================
9922 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9923 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9924 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9926 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9927 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9928 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9930 if test "$COM" = "MSC"; then # override the above
9931 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9932 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9935 if test "$with_system_harfbuzz" = "yes"; then
9936 if test "$with_system_graphite" = "no"; then
9937 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9939 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9941 _save_cflags="$CFLAGS"
9942 LIBS="$LIBS $HARFBUZZ_LIBS"
9943 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9944 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9946 CFLAGS="$_save_cflags"
9948 if test "$with_system_graphite" = "yes"; then
9949 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9953 AC_MSG_CHECKING([whether to use X11])
9954 dnl ***************************************
9955 dnl testing for X libraries and includes...
9956 dnl ***************************************
9957 if test "$USING_X11" = TRUE; then
9958 AC_DEFINE(HAVE_FEATURE_X11)
9960 AC_MSG_RESULT([$USING_X11])
9962 if test "$USING_X11" = TRUE; then
9965 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9967 if test -z "$x_includes"; then
9968 x_includes="default_x_includes"
9970 if test -z "$x_libraries"; then
9971 x_libraries="default_x_libraries"
9973 CFLAGS="$CFLAGS $X_CFLAGS"
9974 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9975 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9977 x_includes="no_x_includes"
9978 x_libraries="no_x_libraries"
9981 if test "$USING_X11" = TRUE; then
9982 dnl ===================================================================
9983 dnl Check for extension headers
9984 dnl ===================================================================
9985 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9986 [#include <X11/extensions/shape.h>])
9988 # vcl needs ICE and SM
9989 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9990 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9991 [AC_MSG_ERROR(ICE library not found)])
9992 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9993 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9994 [AC_MSG_ERROR(SM library not found)])
9997 dnl ===================================================================
9998 dnl Check for system Xrender
9999 dnl ===================================================================
10000 AC_MSG_CHECKING([whether to use Xrender])
10001 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
10002 AC_MSG_RESULT([yes])
10003 PKG_CHECK_MODULES(XRENDER, xrender)
10004 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10005 FilterLibs "${XRENDER_LIBS}"
10006 XRENDER_LIBS="${filteredlibs}"
10007 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
10008 [AC_MSG_ERROR(libXrender not found or functional)], [])
10009 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
10010 [AC_MSG_ERROR(Xrender not found. install X)], [])
10012 AC_MSG_RESULT([no])
10014 AC_SUBST(XRENDER_CFLAGS)
10015 AC_SUBST(XRENDER_LIBS)
10017 dnl ===================================================================
10018 dnl Check for XRandr
10019 dnl ===================================================================
10020 AC_MSG_CHECKING([whether to enable RandR support])
10021 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
10022 AC_MSG_RESULT([yes])
10023 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
10024 if test "$ENABLE_RANDR" != "TRUE"; then
10025 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
10026 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
10028 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
10029 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
10030 XRANDR_LIBS="-lXrandr "
10031 ENABLE_RANDR="TRUE"
10033 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10034 FilterLibs "${XRANDR_LIBS}"
10035 XRANDR_LIBS="${filteredlibs}"
10038 AC_MSG_RESULT([no])
10040 AC_SUBST(XRANDR_CFLAGS)
10041 AC_SUBST(XRANDR_LIBS)
10042 AC_SUBST(ENABLE_RANDR)
10044 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
10047 if test $_os = iOS -o $_os = Android; then
10050 AC_MSG_CHECKING([for webdav library])
10051 case "$WITH_WEBDAV" in
10053 AC_MSG_RESULT([serf])
10054 # Check for system apr-util
10055 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
10056 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
10057 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
10058 if test "$COM" = "MSC"; then
10060 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
10061 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
10064 # Check for system serf
10065 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
10066 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
10067 if test "$COM" = "MSC"; then
10068 SERF_LIB_DIR="Release"
10069 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
10070 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
10074 AC_MSG_RESULT([neon])
10075 # Check for system neon
10076 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
10077 if test "$with_system_neon" = "yes"; then
10078 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
10082 AC_SUBST(NEON_VERSION)
10085 AC_MSG_RESULT([none, disabled])
10089 AC_SUBST(WITH_WEBDAV)
10091 dnl ===================================================================
10092 dnl Check for disabling cve_tests
10093 dnl ===================================================================
10094 AC_MSG_CHECKING([whether to execute CVE tests])
10095 # If not explicitly enabled or disabled, default
10096 if test -z "$enable_cve_tests"; then
10099 # Default cves off for Windows with its wild and wonderful
10100 # variety of AV software kicking in and panicking
10101 enable_cve_tests=no
10105 enable_cve_tests=yes
10109 if test "$enable_cve_tests" = "no"; then
10110 AC_MSG_RESULT([no])
10111 DISABLE_CVE_TESTS=TRUE
10112 AC_SUBST(DISABLE_CVE_TESTS)
10114 AC_MSG_RESULT([yes])
10117 dnl ===================================================================
10118 dnl Check for enabling chart XShape tests
10119 dnl ===================================================================
10120 AC_MSG_CHECKING([whether to execute chart XShape tests])
10121 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
10122 AC_MSG_RESULT([yes])
10123 ENABLE_CHART_TESTS=TRUE
10124 AC_SUBST(ENABLE_CHART_TESTS)
10126 AC_MSG_RESULT([no])
10129 dnl ===================================================================
10130 dnl Check for system openssl
10131 dnl ===================================================================
10133 AC_MSG_CHECKING([whether to disable OpenSSL usage])
10134 if test "$enable_openssl" = "yes"; then
10135 AC_MSG_RESULT([no])
10136 if test "$_os" = Darwin ; then
10137 # OpenSSL is deprecated when building for 10.7 or later.
10139 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
10140 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
10142 with_system_openssl=no
10143 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
10144 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
10145 && test "$with_system_openssl" != "no"; then
10146 with_system_openssl=yes
10147 SYSTEM_OPENSSL=TRUE
10149 OPENSSL_LIBS="-lssl -lcrypto"
10151 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
10153 if test "$with_system_openssl" = "yes"; then
10154 AC_MSG_CHECKING([whether openssl supports SHA512])
10156 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
10157 SHA512_CTX context;
10158 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
10162 AC_MSG_RESULT([yes])
10163 DISABLE_OPENSSL=TRUE
10165 # warn that although OpenSSL is disabled, system libraries may depend on it
10166 AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
10167 add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
10170 AC_SUBST([DISABLE_OPENSSL])
10172 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
10173 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
10174 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
10175 enable_cipher_openssl_backend=no
10177 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
10180 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
10181 ENABLE_CIPHER_OPENSSL_BACKEND=
10182 if test "$enable_cipher_openssl_backend" = yes; then
10183 AC_MSG_RESULT([yes])
10184 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
10186 AC_MSG_RESULT([no])
10188 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
10190 dnl ===================================================================
10191 dnl Check for building gnutls
10192 dnl ===================================================================
10193 AC_MSG_CHECKING([whether to use gnutls])
10194 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
10195 AC_MSG_RESULT([yes])
10196 AM_PATH_LIBGCRYPT()
10197 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
10198 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
10199 available in the system to use as replacement.]]))
10200 FilterLibs "${LIBGCRYPT_LIBS}"
10201 LIBGCRYPT_LIBS="${filteredlibs}"
10203 AC_MSG_RESULT([no])
10206 AC_SUBST([LIBGCRYPT_CFLAGS])
10207 AC_SUBST([LIBGCRYPT_LIBS])
10209 dnl ===================================================================
10210 dnl Check for system redland
10211 dnl ===================================================================
10212 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
10213 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
10214 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
10215 if test "$with_system_redland" = "yes"; then
10216 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
10217 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
10223 AC_SUBST(RAPTOR_MAJOR)
10224 AC_SUBST(RASQAL_MAJOR)
10225 AC_SUBST(REDLAND_MAJOR)
10227 dnl ===================================================================
10228 dnl Check for system hunspell
10229 dnl ===================================================================
10230 AC_MSG_CHECKING([which libhunspell to use])
10231 if test "$_os" = iOS; then
10232 AC_MSG_RESULT([none])
10233 elif test "$with_system_hunspell" = "yes"; then
10234 AC_MSG_RESULT([external])
10235 SYSTEM_HUNSPELL=TRUE
10236 AC_LANG_PUSH([C++])
10237 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
10238 if test "$HUNSPELL_PC" != "TRUE"; then
10239 AC_CHECK_HEADER(hunspell.hxx, [],
10241 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
10242 [AC_MSG_ERROR(hunspell headers not found.)], [])
10244 AC_CHECK_LIB([hunspell], [main], [:],
10245 [ AC_MSG_ERROR(hunspell library not found.) ], [])
10246 HUNSPELL_LIBS=-lhunspell
10249 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10250 FilterLibs "${HUNSPELL_LIBS}"
10251 HUNSPELL_LIBS="${filteredlibs}"
10253 AC_MSG_RESULT([internal])
10255 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
10256 if test "$COM" = "MSC"; then
10257 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
10259 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
10261 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
10263 AC_SUBST(SYSTEM_HUNSPELL)
10264 AC_SUBST(HUNSPELL_CFLAGS)
10265 AC_SUBST(HUNSPELL_LIBS)
10267 dnl ===================================================================
10268 dnl Check for system qrcodegen
10269 dnl ===================================================================
10270 AC_MSG_CHECKING([which libqrcodegen to use])
10271 if test "$with_system_qrcodegen" = "yes"; then
10272 AC_MSG_RESULT([external])
10273 SYSTEM_QRCODEGEN=TRUE
10274 AC_LANG_PUSH([C++])
10275 AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
10276 [AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
10277 AC_CHECK_LIB([qrcodegencpp], [main], [:],
10278 [ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
10279 QRCODEGEN_LIBS=-lqrcodegencpp
10281 QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10282 FilterLibs "${QRCODEGEN_LIBS}"
10283 QRCODEGEN_LIBS="${filteredlibs}"
10285 AC_MSG_RESULT([internal])
10287 BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
10289 AC_SUBST(SYSTEM_QRCODEGEN)
10290 AC_SUBST(QRCODEGEN_CFLAGS)
10291 AC_SUBST(QRCODEGEN_LIBS)
10293 dnl ===================================================================
10294 dnl Checking for altlinuxhyph
10295 dnl ===================================================================
10296 AC_MSG_CHECKING([which altlinuxhyph to use])
10297 if test "$with_system_altlinuxhyph" = "yes"; then
10298 AC_MSG_RESULT([external])
10300 AC_CHECK_HEADER(hyphen.h, [],
10301 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
10302 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
10303 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
10304 [#include <hyphen.h>])
10305 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
10306 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10307 if test -z "$HYPHEN_LIB"; then
10308 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
10309 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10311 if test -z "$HYPHEN_LIB"; then
10312 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
10313 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10316 AC_MSG_RESULT([internal])
10318 BUILD_TYPE="$BUILD_TYPE HYPHEN"
10319 if test "$COM" = "MSC"; then
10320 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
10322 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
10325 AC_SUBST(SYSTEM_HYPH)
10326 AC_SUBST(HYPHEN_LIB)
10328 dnl ===================================================================
10329 dnl Checking for mythes
10330 dnl ===================================================================
10331 AC_MSG_CHECKING([which mythes to use])
10332 if test "$_os" = iOS; then
10333 AC_MSG_RESULT([none])
10334 elif test "$with_system_mythes" = "yes"; then
10335 AC_MSG_RESULT([external])
10337 AC_LANG_PUSH([C++])
10338 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
10339 if test "$MYTHES_PKGCONFIG" = "no"; then
10340 AC_CHECK_HEADER(mythes.hxx, [],
10341 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
10342 AC_CHECK_LIB([mythes-1.2], [main], [:],
10343 [ MYTHES_FOUND=no], [])
10344 if test "$MYTHES_FOUND" = "no"; then
10345 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
10346 [ MYTHES_FOUND=no], [])
10348 if test "$MYTHES_FOUND" = "no"; then
10349 AC_MSG_ERROR([mythes library not found!.])
10353 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10354 FilterLibs "${MYTHES_LIBS}"
10355 MYTHES_LIBS="${filteredlibs}"
10357 AC_MSG_RESULT([internal])
10359 BUILD_TYPE="$BUILD_TYPE MYTHES"
10360 if test "$COM" = "MSC"; then
10361 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
10363 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
10366 AC_SUBST(SYSTEM_MYTHES)
10367 AC_SUBST(MYTHES_CFLAGS)
10368 AC_SUBST(MYTHES_LIBS)
10370 dnl ===================================================================
10371 dnl How should we build the linear programming solver ?
10372 dnl ===================================================================
10375 AC_MSG_CHECKING([whether to build with CoinMP])
10376 if test "$enable_coinmp" != "no"; then
10378 AC_MSG_RESULT([yes])
10379 if test "$with_system_coinmp" = "yes"; then
10381 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
10382 FilterLibs "${COINMP_LIBS}"
10383 COINMP_LIBS="${filteredlibs}"
10385 BUILD_TYPE="$BUILD_TYPE COINMP"
10388 AC_MSG_RESULT([no])
10390 AC_SUBST(ENABLE_COINMP)
10391 AC_SUBST(SYSTEM_COINMP)
10392 AC_SUBST(COINMP_CFLAGS)
10393 AC_SUBST(COINMP_LIBS)
10396 AC_MSG_CHECKING([whether to build with lpsolve])
10397 if test "$enable_lpsolve" != "no"; then
10398 ENABLE_LPSOLVE=TRUE
10399 AC_MSG_RESULT([yes])
10401 AC_MSG_RESULT([no])
10403 AC_SUBST(ENABLE_LPSOLVE)
10405 if test "$ENABLE_LPSOLVE" = TRUE; then
10406 AC_MSG_CHECKING([which lpsolve to use])
10407 if test "$with_system_lpsolve" = "yes"; then
10408 AC_MSG_RESULT([external])
10409 SYSTEM_LPSOLVE=TRUE
10410 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
10411 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
10413 # some systems need this. Like Ubuntu...
10414 AC_CHECK_LIB(m, floor)
10415 AC_CHECK_LIB(dl, dlopen)
10416 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
10417 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
10420 AC_MSG_RESULT([internal])
10422 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
10425 AC_SUBST(SYSTEM_LPSOLVE)
10427 dnl ===================================================================
10428 dnl Checking for libexttextcat
10429 dnl ===================================================================
10430 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
10431 if test "$with_system_libexttextcat" = "yes"; then
10432 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
10434 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
10436 dnl ===================================================================
10437 dnl Checking for libnumbertext
10438 dnl ===================================================================
10439 AC_MSG_CHECKING([whether to use libnumbertext])
10440 if test "$enable_libnumbertext" = "no"; then
10441 AC_MSG_RESULT([no])
10442 ENABLE_LIBNUMBERTEXT=
10443 SYSTEM_LIBNUMBERTEXT=
10445 AC_MSG_RESULT([yes])
10446 ENABLE_LIBNUMBERTEXT=TRUE
10447 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
10448 if test "$with_system_libnumbertext" = "yes"; then
10449 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
10450 SYSTEM_LIBNUMBERTEXT=YES
10452 SYSTEM_LIBNUMBERTEXT=
10453 AC_LANG_PUSH([C++])
10454 save_CPPFLAGS=$CPPFLAGS
10455 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
10456 AC_CHECK_HEADERS([codecvt regex])
10457 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
10458 [ ENABLE_LIBNUMBERTEXT=''
10459 LIBNUMBERTEXT_CFLAGS=''
10460 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
10461 Enable libnumbertext fallback (missing number to number name conversion).])
10463 CPPFLAGS=$save_CPPFLAGS
10466 if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
10467 AC_DEFINE(ENABLE_LIBNUMBERTEXT)
10470 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
10471 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
10472 AC_SUBST(ENABLE_LIBNUMBERTEXT)
10473 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
10475 dnl ***************************************
10476 dnl testing libc version for Linux...
10477 dnl ***************************************
10478 if test "$_os" = "Linux"; then
10479 AC_MSG_CHECKING([whether libc is >= 2.1.1])
10480 exec 6>/dev/null # no output
10481 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
10482 exec 6>&1 # output on again
10483 if test "$HAVE_LIBC"; then
10484 AC_MSG_RESULT([yes])
10486 AC_MSG_ERROR([no, upgrade libc])
10490 dnl =========================================
10491 dnl Check for uuidgen
10492 dnl =========================================
10493 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
10494 # presence is already tested above in the WINDOWS_SDK_HOME check
10495 UUIDGEN=uuidgen.exe
10498 AC_PATH_PROG([UUIDGEN], [uuidgen])
10499 if test -z "$UUIDGEN"; then
10500 AC_MSG_WARN([uuid is needed for building installation sets])
10504 dnl ***************************************
10505 dnl Checking for bison and flex
10506 dnl ***************************************
10507 AC_PATH_PROG(BISON, bison)
10508 if test -z "$BISON"; then
10509 AC_MSG_ERROR([no bison found in \$PATH, install it])
10511 AC_MSG_CHECKING([the bison version])
10512 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
10513 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
10514 dnl Accept newer than 2.0; for --enable-compiler-plugins at least 2.3 is known to be bad and
10517 dnl idlc/source/parser.y:222:15: error: externally available entity 'YYSTYPE' is not previously declared in an included file (if it is only used in this translation unit, put it in an unnamed namespace; otherwise, provide a declaration of it in an included file) [loplugin:external]
10518 dnl typedef union YYSTYPE
10521 dnl while at least 3.4.1 is know to be good:
10522 if test "$COMPILER_PLUGINS" = TRUE; then
10523 if test "$_bison_longver" -lt 2004; then
10524 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.4+ for --enable-compiler-plugins)])
10527 if test "$_bison_longver" -lt 2000; then
10528 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
10534 AC_PATH_PROG(FLEX, flex)
10535 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10536 FLEX=`cygpath -m $FLEX`
10538 if test -z "$FLEX"; then
10539 AC_MSG_ERROR([no flex found in \$PATH, install it])
10541 AC_MSG_CHECKING([the flex version])
10542 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
10543 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
10544 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
10548 dnl ***************************************
10549 dnl Checking for patch
10550 dnl ***************************************
10551 AC_PATH_PROG(PATCH, patch)
10552 if test -z "$PATCH"; then
10553 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
10556 dnl On Solaris, FreeBSD or macOS, check if --with-gnu-patch was used
10557 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
10558 if test -z "$with_gnu_patch"; then
10561 if test -x "$with_gnu_patch"; then
10562 GNUPATCH=$with_gnu_patch
10564 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
10568 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
10569 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
10570 AC_MSG_RESULT([yes])
10572 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
10578 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10579 GNUPATCH=`cygpath -m $GNUPATCH`
10582 dnl We also need to check for --with-gnu-cp
10584 if test -z "$with_gnu_cp"; then
10585 # check the place where the good stuff is hidden on Solaris...
10586 if test -x /usr/gnu/bin/cp; then
10587 GNUCP=/usr/gnu/bin/cp
10589 AC_PATH_PROGS(GNUCP, gnucp cp)
10591 if test -z $GNUCP; then
10592 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
10595 if test -x "$with_gnu_cp"; then
10598 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
10602 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10603 GNUCP=`cygpath -m $GNUCP`
10606 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
10607 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
10608 AC_MSG_RESULT([yes])
10609 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
10610 AC_MSG_RESULT([yes])
10612 case "$build_os" in
10613 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
10616 AC_MSG_RESULT([no gnucp found - using the system's cp command])
10619 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
10628 dnl ***************************************
10629 dnl testing assembler path
10630 dnl ***************************************
10632 if test "$_os" = "WINNT"; then
10633 if test "$BITNESS_OVERRIDE" = ""; then
10639 AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
10640 if test -f "$CL_PATH/$assembler"; then
10641 ML_EXE=`win_short_path_for_make "$CL_PATH/$assembler"`
10642 AC_MSG_RESULT([$ML_EXE])
10644 AC_MSG_ERROR([not found])
10650 dnl ===================================================================
10651 dnl We need zip and unzip
10652 dnl ===================================================================
10653 AC_PATH_PROG(ZIP, zip)
10654 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10655 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10656 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],,)
10659 AC_PATH_PROG(UNZIP, unzip)
10660 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10662 dnl ===================================================================
10663 dnl Zip must be a specific type for different build types.
10664 dnl ===================================================================
10665 if test $build_os = cygwin; then
10666 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10667 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10671 dnl ===================================================================
10672 dnl We need touch with -h option support.
10673 dnl ===================================================================
10674 AC_PATH_PROG(TOUCH, touch)
10675 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10677 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10678 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],,)
10681 dnl ===================================================================
10682 dnl Check for system epoxy
10683 dnl ===================================================================
10684 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
10686 dnl ===================================================================
10687 dnl Set vcl option: coordinate device in double or sal_Int32
10688 dnl ===================================================================
10690 dnl disabled for now, we don't want subtle differences between OSs
10691 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10692 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
10693 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10694 dnl AC_MSG_RESULT([double])
10696 dnl AC_MSG_RESULT([sal_Int32])
10699 dnl ===================================================================
10700 dnl Test which vclplugs have to be built.
10701 dnl ===================================================================
10703 if test "$USING_X11" != TRUE; then
10709 if test "x$enable_gtk3" = "xyes"; then
10710 if test "$with_system_cairo" = no; then
10711 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10713 : ${with_system_cairo:=yes}
10714 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="")
10715 if test "x$ENABLE_GTK3" = "xTRUE"; then
10716 AC_DEFINE(ENABLE_GTK3)
10719 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10721 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10722 FilterLibs "${GTK3_LIBS}"
10723 GTK3_LIBS="${filteredlibs}"
10725 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10726 if test "$with_system_epoxy" != "yes"; then
10727 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10728 AC_CHECK_HEADER(EGL/eglplatform.h, [],
10729 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10732 AC_SUBST(GTK3_LIBS)
10733 AC_SUBST(GTK3_CFLAGS)
10734 AC_SUBST(ENABLE_GTK3)
10736 if test "$enable_introspection" = yes; then
10737 if test "$ENABLE_GTK3" = TRUE; then
10738 GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
10740 AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
10745 if test "x$enable_qt5" = "xyes"; then
10747 AC_DEFINE(ENABLE_QT5)
10750 AC_SUBST(ENABLE_QT5)
10753 if test "x$enable_kf5" = "xyes"; then
10755 AC_DEFINE(ENABLE_KF5)
10758 AC_SUBST(ENABLE_KF5)
10760 ENABLE_GTK3_KDE5=""
10761 if test "x$enable_gtk3_kde5" = "xyes"; then
10762 ENABLE_GTK3_KDE5="TRUE"
10763 AC_DEFINE(ENABLE_GTK3_KDE5)
10766 AC_SUBST(ENABLE_GTK3_KDE5)
10768 if test "$_os" = "WINNT"; then
10770 elif test "$_os" = "Darwin"; then
10772 elif test "$_os" = "iOS"; then
10776 build_vcl_plugins="$R"
10777 if test -z "$build_vcl_plugins"; then
10778 build_vcl_plugins="none"
10780 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10782 dnl ===================================================================
10783 dnl check for dbus support
10784 dnl ===================================================================
10788 DBUS_GLIB_CFLAGS=""
10792 if test "$enable_dbus" = "no"; then
10796 AC_MSG_CHECKING([whether to enable DBUS support])
10797 if test "$test_dbus" = "yes"; then
10799 AC_MSG_RESULT([yes])
10800 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10801 AC_DEFINE(ENABLE_DBUS)
10802 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10803 FilterLibs "${DBUS_LIBS}"
10804 DBUS_LIBS="${filteredlibs}"
10806 # Glib is needed for BluetoothServer
10807 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10808 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10810 DBUS_HAVE_GLIB="TRUE"
10811 AC_DEFINE(DBUS_HAVE_GLIB,1)
10813 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10816 AC_MSG_RESULT([no])
10819 AC_SUBST(ENABLE_DBUS)
10820 AC_SUBST(DBUS_CFLAGS)
10821 AC_SUBST(DBUS_LIBS)
10822 AC_SUBST(DBUS_GLIB_CFLAGS)
10823 AC_SUBST(DBUS_GLIB_LIBS)
10824 AC_SUBST(DBUS_HAVE_GLIB)
10826 AC_MSG_CHECKING([whether to enable Impress remote control])
10827 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10828 AC_MSG_RESULT([yes])
10829 ENABLE_SDREMOTE=TRUE
10830 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10832 if test $OS = MACOSX && test "$MACOSX_SDK_VERSION" -ge 101500; then
10833 # The Bluetooth code doesn't compile with macOS SDK 10.15
10834 if test "$enable_sdremote_bluetooth" = yes; then
10835 AC_MSG_ERROR([macOS SDK $with_macosx_sdk does not currently support --enable-sdremote-bluetooth])
10837 enable_sdremote_bluetooth=no
10839 # If not explicitly enabled or disabled, default
10840 if test -z "$enable_sdremote_bluetooth"; then
10843 # Default to yes for these
10844 enable_sdremote_bluetooth=yes
10848 enable_sdremote_bluetooth=no
10852 # $enable_sdremote_bluetooth is guaranteed non-empty now
10854 if test "$enable_sdremote_bluetooth" != "no"; then
10855 if test "$OS" = "LINUX"; then
10856 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10857 AC_MSG_RESULT([yes])
10858 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10859 dnl ===================================================================
10860 dnl Check for system bluez
10861 dnl ===================================================================
10862 AC_MSG_CHECKING([which Bluetooth header to use])
10863 if test "$with_system_bluez" = "yes"; then
10864 AC_MSG_RESULT([external])
10865 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10866 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10869 AC_MSG_RESULT([internal])
10873 AC_MSG_RESULT([no, dbus disabled])
10874 ENABLE_SDREMOTE_BLUETOOTH=
10878 AC_MSG_RESULT([yes])
10879 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10883 AC_MSG_RESULT([no])
10884 ENABLE_SDREMOTE_BLUETOOTH=
10890 AC_MSG_RESULT([no])
10892 AC_SUBST(ENABLE_SDREMOTE)
10893 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10894 AC_SUBST(SYSTEM_BLUEZ)
10896 dnl ===================================================================
10897 dnl Check whether to enable GIO support
10898 dnl ===================================================================
10899 if test "$ENABLE_GTK3" = "TRUE"; then
10900 AC_MSG_CHECKING([whether to enable GIO support])
10901 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10902 dnl Need at least 2.26 for the dbus support.
10903 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10904 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10905 if test "$ENABLE_GIO" = "TRUE"; then
10906 AC_DEFINE(ENABLE_GIO)
10907 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10908 FilterLibs "${GIO_LIBS}"
10909 GIO_LIBS="${filteredlibs}"
10912 AC_MSG_RESULT([no])
10915 AC_SUBST(ENABLE_GIO)
10916 AC_SUBST(GIO_CFLAGS)
10920 dnl ===================================================================
10922 SPLIT_APP_MODULES=""
10923 if test "$enable_split_app_modules" = "yes"; then
10924 SPLIT_APP_MODULES="TRUE"
10926 AC_SUBST(SPLIT_APP_MODULES)
10928 SPLIT_OPT_FEATURES=""
10929 if test "$enable_split_opt_features" = "yes"; then
10930 SPLIT_OPT_FEATURES="TRUE"
10932 AC_SUBST(SPLIT_OPT_FEATURES)
10934 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10935 if test "$enable_cairo_canvas" = yes; then
10936 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10938 enable_cairo_canvas=no
10939 elif test -z "$enable_cairo_canvas"; then
10940 enable_cairo_canvas=yes
10943 ENABLE_CAIRO_CANVAS=""
10944 if test "$enable_cairo_canvas" = "yes"; then
10946 ENABLE_CAIRO_CANVAS="TRUE"
10947 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10949 AC_SUBST(ENABLE_CAIRO_CANVAS)
10951 dnl ===================================================================
10952 dnl Check whether the GStreamer libraries are available.
10953 dnl ===================================================================
10955 ENABLE_GSTREAMER_1_0=""
10957 if test "$build_gstreamer_1_0" = "yes"; then
10959 AC_MSG_CHECKING([whether to enable the GStreamer 1.0 avmedia backend])
10960 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10961 ENABLE_GSTREAMER_1_0="TRUE"
10962 AC_MSG_RESULT([yes])
10963 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10964 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10965 FilterLibs "${GSTREAMER_1_0_LIBS}"
10966 GSTREAMER_1_0_LIBS="${filteredlibs}"
10967 AC_DEFINE(ENABLE_GSTREAMER_1_0)
10969 AC_MSG_RESULT([no])
10972 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10973 AC_SUBST(GSTREAMER_1_0_LIBS)
10974 AC_SUBST(ENABLE_GSTREAMER_1_0)
10976 dnl ===================================================================
10977 dnl Check whether to build the VLC avmedia backend
10978 dnl ===================================================================
10982 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10983 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10985 AC_MSG_RESULT([yes])
10987 AC_MSG_RESULT([no])
10989 AC_SUBST(ENABLE_VLC)
10991 ENABLE_OPENGL_TRANSITIONS=
10992 ENABLE_OPENGL_CANVAS=
10993 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10995 elif test "$_os" = "Darwin"; then
10996 # We use frameworks on macOS, no need for detail checks
10997 ENABLE_OPENGL_TRANSITIONS=TRUE
10998 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10999 ENABLE_OPENGL_CANVAS=TRUE
11000 elif test $_os = WINNT; then
11001 ENABLE_OPENGL_TRANSITIONS=TRUE
11002 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
11003 ENABLE_OPENGL_CANVAS=TRUE
11005 if test "$USING_X11" = TRUE; then
11006 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
11007 ENABLE_OPENGL_TRANSITIONS=TRUE
11008 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
11009 ENABLE_OPENGL_CANVAS=TRUE
11013 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
11014 AC_SUBST(ENABLE_OPENGL_CANVAS)
11016 dnl =================================================
11017 dnl Check whether to build with OpenCL support.
11018 dnl =================================================
11020 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
11021 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
11022 # platform (optional at run-time, used through clew).
11023 BUILD_TYPE="$BUILD_TYPE OPENCL"
11024 AC_DEFINE(HAVE_FEATURE_OPENCL)
11027 dnl =================================================
11028 dnl Check whether to build with dconf support.
11029 dnl =================================================
11031 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
11032 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
11033 if test "$enable_dconf" = yes; then
11034 AC_MSG_ERROR([dconf not found])
11039 AC_MSG_CHECKING([whether to enable dconf])
11040 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
11044 AC_MSG_RESULT([no])
11047 AC_DEFINE(ENABLE_DCONF)
11048 AC_MSG_RESULT([yes])
11050 AC_SUBST([DCONF_CFLAGS])
11051 AC_SUBST([DCONF_LIBS])
11052 AC_SUBST([ENABLE_DCONF])
11055 AC_MSG_CHECKING([whether to build the PDF import feature])
11057 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
11058 AC_MSG_RESULT([yes])
11059 ENABLE_PDFIMPORT=TRUE
11060 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
11062 AC_MSG_RESULT([no])
11066 AC_MSG_CHECKING([whether to build PDFium])
11068 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_pdfium" = yes; then
11069 AC_MSG_RESULT([yes])
11071 AC_DEFINE(HAVE_FEATURE_PDFIUM)
11072 BUILD_TYPE="$BUILD_TYPE PDFIUM"
11074 AC_MSG_RESULT([no])
11076 AC_SUBST(ENABLE_PDFIUM)
11078 dnl ===================================================================
11079 dnl Check for poppler
11080 dnl ===================================================================
11082 AC_MSG_CHECKING([whether to build Poppler])
11083 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_poppler" = yes; then
11084 AC_MSG_RESULT([yes])
11085 ENABLE_POPPLER=TRUE
11086 AC_DEFINE(HAVE_FEATURE_POPPLER)
11088 AC_MSG_RESULT([no])
11090 AC_SUBST(ENABLE_POPPLER)
11092 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
11093 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
11096 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" = "TRUE" -o "$ENABLE_PDFIUM" = "TRUE" \); then
11097 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
11100 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
11101 dnl ===================================================================
11102 dnl Check for system poppler
11103 dnl ===================================================================
11104 AC_MSG_CHECKING([which PDF import poppler to use])
11105 if test "$with_system_poppler" = "yes"; then
11106 AC_MSG_RESULT([external])
11107 SYSTEM_POPPLER=TRUE
11108 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
11109 AC_LANG_PUSH([C++])
11110 save_CXXFLAGS=$CXXFLAGS
11111 save_CPPFLAGS=$CPPFLAGS
11112 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
11113 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
11114 AC_CHECK_HEADER([cpp/poppler-version.h],
11115 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
11117 CXXFLAGS=$save_CXXFLAGS
11118 CPPFLAGS=$save_CPPFLAGS
11120 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11122 FilterLibs "${POPPLER_LIBS}"
11123 POPPLER_LIBS="${filteredlibs}"
11125 AC_MSG_RESULT([internal])
11127 BUILD_TYPE="$BUILD_TYPE POPPLER"
11128 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
11130 AC_DEFINE([ENABLE_PDFIMPORT],1)
11132 AC_SUBST(ENABLE_PDFIMPORT)
11133 AC_SUBST(SYSTEM_POPPLER)
11134 AC_SUBST(POPPLER_CFLAGS)
11135 AC_SUBST(POPPLER_LIBS)
11138 AC_MSG_CHECKING([whether to build Skia])
11140 if test "$enable_skia" != "no" -a "$build_skia" = "yes"; then
11141 AC_MSG_RESULT([yes])
11143 AC_DEFINE(HAVE_FEATURE_SKIA)
11144 BUILD_TYPE="$BUILD_TYPE SKIA"
11146 AC_MSG_RESULT([no])
11148 AC_SUBST(ENABLE_SKIA)
11152 if test "$build_for_ios" = "YES"; then
11153 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
11154 AC_MSG_RESULT([yes])
11155 elif test "$enable_mpl_subset" = "yes"; then
11156 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
11157 AC_MSG_RESULT([yes])
11158 elif test "$enable_fuzzers" = "yes"; then
11159 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
11160 AC_MSG_RESULT([yes])
11161 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
11162 dnl ===================================================================
11163 dnl Check for system gpgme
11164 dnl ===================================================================
11165 AC_MSG_CHECKING([which gpgmepp to use])
11166 if test "$with_system_gpgmepp" = "yes"; then
11167 AC_MSG_RESULT([external])
11168 SYSTEM_GPGMEPP=TRUE
11170 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
11171 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
11172 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
11173 # progress_callback is the only func with plain C linkage
11174 # checking for it also filters out older, KDE-dependent libgpgmepp versions
11175 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
11176 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
11177 AC_CHECK_HEADER(gpgme.h, [],
11178 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
11180 AC_MSG_RESULT([internal])
11181 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
11182 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
11184 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
11185 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
11186 if test "$_os" != "WINNT"; then
11187 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
11188 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
11189 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
11190 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
11193 ENABLE_GPGMEPP=TRUE
11194 AC_DEFINE([HAVE_FEATURE_GPGME])
11195 AC_PATH_PROG(GPG, gpg)
11196 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
11197 # so let's exclude that manually for the moment
11198 if test -n "$GPG" -a "$_os" != "WINNT"; then
11199 # make sure we not only have a working gpgme, but a full working
11200 # gpg installation to run OpenPGP signature verification
11201 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
11203 if test "$_os" = "Linux"; then
11205 AC_MSG_CHECKING([for /run/user/$uid])
11206 if test -d /run/user/$uid; then
11207 AC_MSG_RESULT([yes])
11208 AC_PATH_PROG(GPGCONF, gpgconf)
11210 # Older versions of gpgconf are not working as expected, since
11211 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
11212 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
11213 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
11214 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
11215 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
11216 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
11217 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
11218 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
11219 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
11220 if $GPGCONF --dump-options > /dev/null ; then
11221 if $GPGCONF --dump-options | grep -q create-socketdir ; then
11222 AC_MSG_RESULT([yes])
11223 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
11224 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
11226 AC_MSG_RESULT([no])
11229 AC_MSG_RESULT([no. missing or broken gpgconf?])
11232 AC_MSG_RESULT([no, $GPGCONF_VERSION])
11235 AC_MSG_RESULT([no])
11239 AC_SUBST(ENABLE_GPGMEPP)
11240 AC_SUBST(SYSTEM_GPGMEPP)
11241 AC_SUBST(GPG_ERROR_CFLAGS)
11242 AC_SUBST(GPG_ERROR_LIBS)
11243 AC_SUBST(LIBASSUAN_CFLAGS)
11244 AC_SUBST(LIBASSUAN_LIBS)
11245 AC_SUBST(GPGMEPP_CFLAGS)
11246 AC_SUBST(GPGMEPP_LIBS)
11248 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
11249 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
11250 AC_MSG_RESULT([yes])
11251 ENABLE_MEDIAWIKI=TRUE
11252 BUILD_TYPE="$BUILD_TYPE XSLTML"
11253 if test "x$with_java" = "xno"; then
11254 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
11257 AC_MSG_RESULT([no])
11259 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
11261 AC_SUBST(ENABLE_MEDIAWIKI)
11263 AC_MSG_CHECKING([whether to build the Report Builder])
11264 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
11265 AC_MSG_RESULT([yes])
11266 ENABLE_REPORTBUILDER=TRUE
11267 AC_MSG_CHECKING([which jfreereport libs to use])
11268 if test "$with_system_jfreereport" = "yes"; then
11269 SYSTEM_JFREEREPORT=TRUE
11270 AC_MSG_RESULT([external])
11271 if test -z $SAC_JAR; then
11272 SAC_JAR=/usr/share/java/sac.jar
11274 if ! test -f $SAC_JAR; then
11275 AC_MSG_ERROR(sac.jar not found.)
11278 if test -z $LIBXML_JAR; then
11279 if test -f /usr/share/java/libxml-1.0.0.jar; then
11280 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
11281 elif test -f /usr/share/java/libxml.jar; then
11282 LIBXML_JAR=/usr/share/java/libxml.jar
11284 AC_MSG_ERROR(libxml.jar replacement not found.)
11286 elif ! test -f $LIBXML_JAR; then
11287 AC_MSG_ERROR(libxml.jar not found.)
11290 if test -z $FLUTE_JAR; then
11291 if test -f /usr/share/java/flute-1.3.0.jar; then
11292 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
11293 elif test -f /usr/share/java/flute.jar; then
11294 FLUTE_JAR=/usr/share/java/flute.jar
11296 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
11298 elif ! test -f $FLUTE_JAR; then
11299 AC_MSG_ERROR(flute-1.3.0.jar not found.)
11302 if test -z $JFREEREPORT_JAR; then
11303 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
11304 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
11305 elif test -f /usr/share/java/flow-engine.jar; then
11306 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
11308 AC_MSG_ERROR(jfreereport.jar replacement not found.)
11310 elif ! test -f $JFREEREPORT_JAR; then
11311 AC_MSG_ERROR(jfreereport.jar not found.)
11314 if test -z $LIBLAYOUT_JAR; then
11315 if test -f /usr/share/java/liblayout-0.2.9.jar; then
11316 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
11317 elif test -f /usr/share/java/liblayout.jar; then
11318 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
11320 AC_MSG_ERROR(liblayout.jar replacement not found.)
11322 elif ! test -f $LIBLAYOUT_JAR; then
11323 AC_MSG_ERROR(liblayout.jar not found.)
11326 if test -z $LIBLOADER_JAR; then
11327 if test -f /usr/share/java/libloader-1.0.0.jar; then
11328 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
11329 elif test -f /usr/share/java/libloader.jar; then
11330 LIBLOADER_JAR=/usr/share/java/libloader.jar
11332 AC_MSG_ERROR(libloader.jar replacement not found.)
11334 elif ! test -f $LIBLOADER_JAR; then
11335 AC_MSG_ERROR(libloader.jar not found.)
11338 if test -z $LIBFORMULA_JAR; then
11339 if test -f /usr/share/java/libformula-0.2.0.jar; then
11340 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
11341 elif test -f /usr/share/java/libformula.jar; then
11342 LIBFORMULA_JAR=/usr/share/java/libformula.jar
11344 AC_MSG_ERROR(libformula.jar replacement not found.)
11346 elif ! test -f $LIBFORMULA_JAR; then
11347 AC_MSG_ERROR(libformula.jar not found.)
11350 if test -z $LIBREPOSITORY_JAR; then
11351 if test -f /usr/share/java/librepository-1.0.0.jar; then
11352 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
11353 elif test -f /usr/share/java/librepository.jar; then
11354 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
11356 AC_MSG_ERROR(librepository.jar replacement not found.)
11358 elif ! test -f $LIBREPOSITORY_JAR; then
11359 AC_MSG_ERROR(librepository.jar not found.)
11362 if test -z $LIBFONTS_JAR; then
11363 if test -f /usr/share/java/libfonts-1.0.0.jar; then
11364 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
11365 elif test -f /usr/share/java/libfonts.jar; then
11366 LIBFONTS_JAR=/usr/share/java/libfonts.jar
11368 AC_MSG_ERROR(libfonts.jar replacement not found.)
11370 elif ! test -f $LIBFONTS_JAR; then
11371 AC_MSG_ERROR(libfonts.jar not found.)
11374 if test -z $LIBSERIALIZER_JAR; then
11375 if test -f /usr/share/java/libserializer-1.0.0.jar; then
11376 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
11377 elif test -f /usr/share/java/libserializer.jar; then
11378 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
11380 AC_MSG_ERROR(libserializer.jar replacement not found.)
11382 elif ! test -f $LIBSERIALIZER_JAR; then
11383 AC_MSG_ERROR(libserializer.jar not found.)
11386 if test -z $LIBBASE_JAR; then
11387 if test -f /usr/share/java/libbase-1.0.0.jar; then
11388 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
11389 elif test -f /usr/share/java/libbase.jar; then
11390 LIBBASE_JAR=/usr/share/java/libbase.jar
11392 AC_MSG_ERROR(libbase.jar replacement not found.)
11394 elif ! test -f $LIBBASE_JAR; then
11395 AC_MSG_ERROR(libbase.jar not found.)
11399 AC_MSG_RESULT([internal])
11400 SYSTEM_JFREEREPORT=
11401 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
11405 AC_MSG_RESULT([no])
11406 ENABLE_REPORTBUILDER=
11407 SYSTEM_JFREEREPORT=
11409 AC_SUBST(ENABLE_REPORTBUILDER)
11410 AC_SUBST(SYSTEM_JFREEREPORT)
11412 AC_SUBST(LIBXML_JAR)
11413 AC_SUBST(FLUTE_JAR)
11414 AC_SUBST(JFREEREPORT_JAR)
11415 AC_SUBST(LIBBASE_JAR)
11416 AC_SUBST(LIBLAYOUT_JAR)
11417 AC_SUBST(LIBLOADER_JAR)
11418 AC_SUBST(LIBFORMULA_JAR)
11419 AC_SUBST(LIBREPOSITORY_JAR)
11420 AC_SUBST(LIBFONTS_JAR)
11421 AC_SUBST(LIBSERIALIZER_JAR)
11423 # this has to be here because both the Wiki Publisher and the SRB use
11425 COMMONS_LOGGING_VERSION=1.2
11426 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
11427 AC_MSG_CHECKING([which Apache commons-* libs to use])
11428 if test "$with_system_apache_commons" = "yes"; then
11429 SYSTEM_APACHE_COMMONS=TRUE
11430 AC_MSG_RESULT([external])
11431 if test -z $COMMONS_LOGGING_JAR; then
11432 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
11433 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
11434 elif test -f /usr/share/java/commons-logging.jar; then
11435 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
11437 AC_MSG_ERROR(commons-logging.jar replacement not found.)
11439 elif ! test -f $COMMONS_LOGGING_JAR; then
11440 AC_MSG_ERROR(commons-logging.jar not found.)
11443 AC_MSG_RESULT([internal])
11444 SYSTEM_APACHE_COMMONS=
11445 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
11449 AC_SUBST(SYSTEM_APACHE_COMMONS)
11450 AC_SUBST(COMMONS_LOGGING_JAR)
11451 AC_SUBST(COMMONS_LOGGING_VERSION)
11453 # scripting provider for BeanShell?
11454 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
11455 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
11456 AC_MSG_RESULT([yes])
11457 ENABLE_SCRIPTING_BEANSHELL=TRUE
11459 dnl ===================================================================
11460 dnl Check for system beanshell
11461 dnl ===================================================================
11462 AC_MSG_CHECKING([which beanshell to use])
11463 if test "$with_system_beanshell" = "yes"; then
11464 AC_MSG_RESULT([external])
11466 if test -z $BSH_JAR; then
11467 BSH_JAR=/usr/share/java/bsh.jar
11469 if ! test -f $BSH_JAR; then
11470 AC_MSG_ERROR(bsh.jar not found.)
11473 AC_MSG_RESULT([internal])
11475 BUILD_TYPE="$BUILD_TYPE BSH"
11478 AC_MSG_RESULT([no])
11479 ENABLE_SCRIPTING_BEANSHELL=
11480 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
11482 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
11483 AC_SUBST(SYSTEM_BSH)
11486 # scripting provider for JavaScript?
11487 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
11488 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
11489 AC_MSG_RESULT([yes])
11490 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
11492 dnl ===================================================================
11493 dnl Check for system rhino
11494 dnl ===================================================================
11495 AC_MSG_CHECKING([which rhino to use])
11496 if test "$with_system_rhino" = "yes"; then
11497 AC_MSG_RESULT([external])
11499 if test -z $RHINO_JAR; then
11500 RHINO_JAR=/usr/share/java/js.jar
11502 if ! test -f $RHINO_JAR; then
11503 AC_MSG_ERROR(js.jar not found.)
11506 AC_MSG_RESULT([internal])
11508 BUILD_TYPE="$BUILD_TYPE RHINO"
11512 AC_MSG_RESULT([no])
11513 ENABLE_SCRIPTING_JAVASCRIPT=
11514 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
11516 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
11517 AC_SUBST(SYSTEM_RHINO)
11518 AC_SUBST(RHINO_JAR)
11520 # This is only used in Qt5/KF5 checks to determine if /usr/lib64
11521 # paths should be added to library search path. So lets put all 64-bit
11524 case "$host_cpu" in
11525 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
11526 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
11527 supports_multilib="yes"
11534 dnl ===================================================================
11535 dnl QT5 Integration
11536 dnl ===================================================================
11542 QT5_GOBJECT_CFLAGS=""
11543 QT5_GOBJECT_LIBS=""
11544 QT5_HAVE_GOBJECT=""
11545 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11546 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11547 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11549 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11550 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11552 if test -n "$supports_multilib"; then
11553 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11556 qt5_test_include="QtWidgets/qapplication.h"
11557 qt5_test_library="libQt5Widgets.so"
11559 dnl Check for qmake5
11560 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH])
11561 if test "$QMAKE5" = "no"; then
11562 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11564 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11565 if test -z "$qmake5_test_ver"; then
11566 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11568 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11569 qt5_minimal_minor="6"
11570 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11571 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11573 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11577 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11578 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11580 AC_MSG_CHECKING([for Qt5 headers])
11582 for inc_dir in $qt5_incdirs; do
11583 if test -r "$inc_dir/$qt5_test_include"; then
11584 qt5_incdir="$inc_dir"
11588 AC_MSG_RESULT([$qt5_incdir])
11589 if test "x$qt5_incdir" = "xno"; then
11590 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11593 AC_MSG_CHECKING([for Qt5 libraries])
11595 for lib_dir in $qt5_libdirs; do
11596 if test -r "$lib_dir/$qt5_test_library"; then
11597 qt5_libdir="$lib_dir"
11601 AC_MSG_RESULT([$qt5_libdir])
11602 if test "x$qt5_libdir" = "xno"; then
11603 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11606 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
11607 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11608 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11610 if test "$USING_X11" = TRUE; then
11611 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
11612 PKG_CHECK_MODULES(QT5_XCB_ICCCM,[xcb-icccm],[
11613 QT5_HAVE_XCB_ICCCM=1
11614 AC_DEFINE(QT5_HAVE_XCB_ICCCM)
11616 AC_MSG_WARN([XCB ICCCM not found, which is needed for old Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)])
11617 add_warning "XCB ICCCM not found, which is needed for Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)"
11619 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
11620 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
11622 AC_DEFINE(QT5_USING_X11)
11625 dnl Check for Meta Object Compiler
11627 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH])
11628 if test "$MOC5" = "no"; then
11629 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11630 the root of your Qt installation by exporting QT5DIR before running "configure".])
11633 if test "$build_gstreamer_1_0" = "yes"; then
11634 PKG_CHECK_MODULES(QT5_GOBJECT,[gobject-2.0], [
11636 AC_DEFINE(QT5_HAVE_GOBJECT)
11638 AC_MSG_WARN([[No GObject found, can't use QWidget GStreamer sink on wayland!]])
11642 AC_SUBST(QT5_CFLAGS)
11645 AC_SUBST(QT5_GOBJECT_CFLAGS)
11646 AC_SUBST(QT5_GOBJECT_LIBS)
11647 AC_SUBST(QT5_HAVE_GOBJECT)
11649 dnl ===================================================================
11650 dnl KF5 Integration
11651 dnl ===================================================================
11655 KF5_CONFIG="kf5-config"
11656 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11657 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11659 if test "$OS" = "HAIKU"; then
11660 haiku_arch="`echo $RTL_ARCH | tr X x`"
11661 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11662 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11665 kf5_incdirs="$KF5INC /usr/include $kf5_haiku_incdirs $x_includes"
11666 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11667 if test -n "$supports_multilib"; then
11668 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11671 kf5_test_include="KF5/kcoreaddons_version.h"
11672 kf5_test_library="libKF5CoreAddons.so"
11673 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11675 dnl kf5 KDE4 support compatibility installed
11676 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11677 if test "$KF5_CONFIG" != "no"; then
11678 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11679 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11682 dnl Check for KF5 headers
11683 AC_MSG_CHECKING([for KF5 headers])
11685 for kf5_check in $kf5_incdirs; do
11686 if test -r "$kf5_check/$kf5_test_include"; then
11687 kf5_incdir="$kf5_check/KF5"
11691 AC_MSG_RESULT([$kf5_incdir])
11692 if test "x$kf5_incdir" = "xno"; then
11693 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11696 dnl Check for KF5 libraries
11697 AC_MSG_CHECKING([for KF5 libraries])
11699 for kf5_check in $kf5_libdirs; do
11700 if test -r "$kf5_check/$kf5_test_library"; then
11701 kf5_libdir="$kf5_check"
11706 AC_MSG_RESULT([$kf5_libdir])
11707 if test "x$kf5_libdir" = "xno"; then
11708 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11711 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"
11712 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11713 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11715 if test "$USING_X11" = TRUE; then
11716 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11719 AC_LANG_PUSH([C++])
11720 save_CXXFLAGS=$CXXFLAGS
11721 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11722 AC_MSG_CHECKING([whether KDE is >= 5.0])
11723 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11724 #include <kcoreaddons_version.h>
11726 int main(int argc, char **argv) {
11727 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11730 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11731 CXXFLAGS=$save_CXXFLAGS
11734 AC_SUBST(KF5_CFLAGS)
11737 dnl ===================================================================
11738 dnl Test whether to include Evolution 2 support
11739 dnl ===================================================================
11740 AC_MSG_CHECKING([whether to enable evolution 2 support])
11741 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11742 AC_MSG_RESULT([yes])
11743 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11744 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11745 FilterLibs "${GOBJECT_LIBS}"
11746 GOBJECT_LIBS="${filteredlibs}"
11747 ENABLE_EVOAB2="TRUE"
11750 AC_MSG_RESULT([no])
11752 AC_SUBST(ENABLE_EVOAB2)
11753 AC_SUBST(GOBJECT_CFLAGS)
11754 AC_SUBST(GOBJECT_LIBS)
11756 dnl ===================================================================
11757 dnl Test which themes to include
11758 dnl ===================================================================
11759 AC_MSG_CHECKING([which themes to include])
11760 # if none given use default subset of available themes
11761 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11762 with_theme="breeze breeze_dark breeze_dark_svg breeze_svg colibre colibre_svg elementary elementary_svg karasa_jaga karasa_jaga_svg sifr sifr_svg sifr_dark sifr_dark_svg sukapura sukapura_svg tango"
11766 if test "x$with_theme" != "xno"; then
11767 for theme in $with_theme; do
11769 breeze|breeze_dark|breeze_dark_svg|breeze_svg|colibre|colibre_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg|sifr|sifr_svg|sifr_dark|sifr_dark_svg|sukapura|sukapura_svg|tango) real_theme="$theme" ;;
11770 default) real_theme=colibre ;;
11771 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11773 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11776 AC_MSG_RESULT([$WITH_THEMES])
11777 AC_SUBST([WITH_THEMES])
11778 # FIXME: remove this, and the convenience default->colibre remapping after a grace period
11779 for theme in $with_theme; do
11781 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11786 dnl ===================================================================
11787 dnl Test whether to integrate helppacks into the product's installer
11788 dnl ===================================================================
11789 AC_MSG_CHECKING([for helppack integration])
11790 if test "$with_helppack_integration" = "no"; then
11791 AC_MSG_RESULT([no integration])
11793 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11794 AC_MSG_RESULT([integration])
11797 ###############################################################################
11798 # Extensions checking
11799 ###############################################################################
11800 AC_MSG_CHECKING([for extensions integration])
11801 if test "x$enable_extension_integration" != "xno"; then
11802 WITH_EXTENSION_INTEGRATION=TRUE
11803 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11804 AC_MSG_RESULT([yes, use integration])
11806 WITH_EXTENSION_INTEGRATION=
11807 AC_MSG_RESULT([no, do not integrate])
11809 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11811 dnl Should any extra extensions be included?
11812 dnl There are standalone tests for each of these below.
11813 WITH_EXTRA_EXTENSIONS=
11814 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11816 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11817 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11818 if test "x$with_java" != "xno"; then
11819 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11820 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11823 AC_MSG_CHECKING([whether to build opens___.ttf])
11824 if test "$enable_build_opensymbol" = "yes"; then
11825 AC_MSG_RESULT([yes])
11826 AC_PATH_PROG(FONTFORGE, fontforge)
11827 if test -z "$FONTFORGE"; then
11828 AC_MSG_ERROR([fontforge not installed])
11831 AC_MSG_RESULT([no])
11832 OPENSYMBOL_TTF=884ed41809687c3e168fc7c19b16585149ff058eca79acbf3ee784f6630704cc-opens___.ttf
11833 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11835 AC_SUBST(OPENSYMBOL_TTF)
11836 AC_SUBST(FONTFORGE)
11838 dnl ===================================================================
11839 dnl Test whether to include fonts
11840 dnl ===================================================================
11841 AC_MSG_CHECKING([whether to include third-party fonts])
11842 if test "$with_fonts" != "no"; then
11843 AC_MSG_RESULT([yes])
11845 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11846 AC_DEFINE(HAVE_MORE_FONTS)
11848 AC_MSG_RESULT([no])
11850 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11852 AC_SUBST(WITH_FONTS)
11855 dnl ===================================================================
11856 dnl Test whether to enable online update service
11857 dnl ===================================================================
11858 AC_MSG_CHECKING([whether to enable online update])
11859 ENABLE_ONLINE_UPDATE=
11860 ENABLE_ONLINE_UPDATE_MAR=
11862 if test "$enable_online_update" = ""; then
11863 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11864 AC_MSG_RESULT([yes])
11865 ENABLE_ONLINE_UPDATE="TRUE"
11867 AC_MSG_RESULT([no])
11870 if test "$enable_online_update" = "mar"; then
11871 AC_MSG_RESULT([yes - MAR-based online update])
11872 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11873 if test "$with_update_config" = ""; then
11874 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11876 UPDATE_CONFIG="$with_update_config"
11877 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11878 elif test "$enable_online_update" = "yes"; then
11879 AC_MSG_RESULT([yes])
11880 ENABLE_ONLINE_UPDATE="TRUE"
11882 AC_MSG_RESULT([no])
11885 AC_SUBST(ENABLE_ONLINE_UPDATE)
11886 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11887 AC_SUBST(UPDATE_CONFIG)
11889 dnl ===================================================================
11890 dnl Test whether we need bzip2
11891 dnl ===================================================================
11893 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11894 AC_MSG_CHECKING([whether to use system bzip2])
11895 if test "$with_system_bzip2" = yes; then
11897 AC_MSG_RESULT([yes])
11898 PKG_CHECK_MODULES(BZIP2, bzip2)
11899 FilterLibs "${BZIP2_LIBS}"
11900 BZIP2_LIBS="${filteredlibs}"
11902 AC_MSG_RESULT([no])
11903 BUILD_TYPE="$BUILD_TYPE BZIP2"
11906 AC_SUBST(SYSTEM_BZIP2)
11907 AC_SUBST(BZIP2_CFLAGS)
11908 AC_SUBST(BZIP2_LIBS)
11910 dnl ===================================================================
11911 dnl Test whether to enable extension update
11912 dnl ===================================================================
11913 AC_MSG_CHECKING([whether to enable extension update])
11914 ENABLE_EXTENSION_UPDATE=
11915 if test "x$enable_extension_update" = "xno"; then
11916 AC_MSG_RESULT([no])
11918 AC_MSG_RESULT([yes])
11919 ENABLE_EXTENSION_UPDATE="TRUE"
11920 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11921 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11923 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11926 dnl ===================================================================
11927 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11928 dnl ===================================================================
11929 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11930 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11931 AC_MSG_RESULT([no])
11934 AC_MSG_RESULT([yes])
11935 ENABLE_SILENT_MSI=TRUE
11936 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11938 AC_SUBST(ENABLE_SILENT_MSI)
11940 AC_MSG_CHECKING([whether and how to use Xinerama])
11941 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11942 if test "$x_libraries" = "default_x_libraries"; then
11943 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11944 if test "x$XINERAMALIB" = x; then
11945 XINERAMALIB="/usr/lib"
11948 XINERAMALIB="$x_libraries"
11950 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11951 # we have both versions, let the user decide but use the dynamic one
11954 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11955 XINERAMA_LINK=dynamic
11957 XINERAMA_LINK=static
11959 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11960 # we have only the dynamic version
11962 XINERAMA_LINK=dynamic
11963 elif test -e "$XINERAMALIB/libXinerama.a"; then
11965 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11967 XINERAMA_LINK=static
11977 if test "$USE_XINERAMA" = "TRUE"; then
11978 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11979 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11980 [AC_MSG_ERROR(Xinerama header not found.)], [])
11981 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11982 if test "x$XEXTLIB" = x; then
11983 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11985 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11986 if test "$_os" = "FreeBSD"; then
11987 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11989 if test "$_os" = "Linux"; then
11990 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11992 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11993 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11995 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
12000 AC_MSG_RESULT([no])
12002 AC_SUBST(USE_XINERAMA)
12003 AC_SUBST(XINERAMA_LINK)
12005 dnl ===================================================================
12006 dnl Test whether to build cairo or rely on the system version
12007 dnl ===================================================================
12009 if test "$USING_X11" = TRUE; then
12010 # Used in vcl/Library_vclplug_gen.mk
12014 if test "$test_cairo" = "yes"; then
12015 AC_MSG_CHECKING([whether to use the system cairo])
12017 : ${with_system_cairo:=$with_system_libs}
12018 if test "$with_system_cairo" = "yes"; then
12020 AC_MSG_RESULT([yes])
12022 PKG_CHECK_MODULES( CAIRO, cairo >= 1.8.0 )
12023 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12024 FilterLibs "${CAIRO_LIBS}"
12025 CAIRO_LIBS="${filteredlibs}"
12027 if test "$test_xrender" = "yes"; then
12028 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
12030 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
12031 #ifdef PictStandardA8
12035 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
12041 AC_MSG_RESULT([no])
12043 BUILD_TYPE="$BUILD_TYPE CAIRO"
12047 AC_SUBST(SYSTEM_CAIRO)
12048 AC_SUBST(CAIRO_CFLAGS)
12049 AC_SUBST(CAIRO_LIBS)
12051 dnl ===================================================================
12052 dnl Test whether to use avahi
12053 dnl ===================================================================
12054 if test "$_os" = "WINNT"; then
12055 # Windows uses bundled mDNSResponder
12056 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
12057 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
12058 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
12059 [ENABLE_AVAHI="TRUE"])
12060 AC_DEFINE(HAVE_FEATURE_AVAHI)
12061 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12062 FilterLibs "${AVAHI_LIBS}"
12063 AVAHI_LIBS="${filteredlibs}"
12066 AC_SUBST(ENABLE_AVAHI)
12067 AC_SUBST(AVAHI_CFLAGS)
12068 AC_SUBST(AVAHI_LIBS)
12070 dnl ===================================================================
12071 dnl Test whether to use liblangtag
12072 dnl ===================================================================
12074 AC_MSG_CHECKING([whether to use system liblangtag])
12075 if test "$with_system_liblangtag" = yes; then
12076 SYSTEM_LIBLANGTAG=TRUE
12077 AC_MSG_RESULT([yes])
12078 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
12079 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
12080 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
12081 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12082 FilterLibs "${LIBLANGTAG_LIBS}"
12083 LIBLANGTAG_LIBS="${filteredlibs}"
12086 AC_MSG_RESULT([no])
12087 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
12088 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
12089 if test "$COM" = "MSC"; then
12090 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
12092 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
12095 AC_SUBST(SYSTEM_LIBLANGTAG)
12096 AC_SUBST(LIBLANGTAG_CFLAGS)
12097 AC_SUBST(LIBLANGTAG_LIBS)
12099 dnl ===================================================================
12100 dnl Test whether to build libpng or rely on the system version
12101 dnl ===================================================================
12103 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
12105 dnl ===================================================================
12106 dnl Check for runtime JVM search path
12107 dnl ===================================================================
12108 if test "$ENABLE_JAVA" != ""; then
12109 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
12110 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
12111 AC_MSG_RESULT([yes])
12112 if ! test -d "$with_jvm_path"; then
12113 AC_MSG_ERROR(["$with_jvm_path" not a directory])
12115 if ! test -d "$with_jvm_path"jvm; then
12116 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
12118 JVM_ONE_PATH_CHECK="$with_jvm_path"
12119 AC_SUBST(JVM_ONE_PATH_CHECK)
12121 AC_MSG_RESULT([no])
12125 dnl ===================================================================
12126 dnl Test for the presence of Ant and that it works
12127 dnl ===================================================================
12129 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
12130 ANT_HOME=; export ANT_HOME
12131 WITH_ANT_HOME=; export WITH_ANT_HOME
12132 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
12133 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
12134 if test "$_os" = "WINNT"; then
12135 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
12137 with_ant_home="$LODE_HOME/opt/ant"
12139 elif test -x "$LODE_HOME/opt/bin/ant" ; then
12140 with_ant_home="$LODE_HOME/opt/ant"
12143 if test -z "$with_ant_home"; then
12144 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
12146 if test "$_os" = "WINNT"; then
12147 # AC_PATH_PROGS needs unix path
12148 with_ant_home=`cygpath -u "$with_ant_home"`
12150 AbsolutePath "$with_ant_home"
12151 with_ant_home=$absolute_path
12152 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
12153 WITH_ANT_HOME=$with_ant_home
12154 ANT_HOME=$with_ant_home
12157 if test -z "$ANT"; then
12158 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
12160 # resolve relative or absolute symlink
12161 while test -h "$ANT"; do
12163 a_basename=`basename "$ANT"`
12164 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
12165 cd "`dirname "$ANT"`"
12166 cd "`dirname "$a_script"`"
12167 ANT="`pwd`"/"`basename "$a_script"`"
12171 AC_MSG_CHECKING([if $ANT works])
12172 mkdir -p conftest.dir
12175 cat > conftest.java << EOF
12176 public class conftest {
12177 int testmethod(int a, int b) {
12183 cat > conftest.xml << EOF
12184 <project name="conftest" default="conftest">
12185 <target name="conftest">
12186 <javac srcdir="." includes="conftest.java">
12192 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
12193 if test $? = 0 -a -f ./conftest.class; then
12194 AC_MSG_RESULT([Ant works])
12195 if test -z "$WITH_ANT_HOME"; then
12196 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
12197 if test -z "$ANT_HOME"; then
12198 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
12201 ANT_HOME="$WITH_ANT_HOME"
12204 echo "configure: Ant test failed" >&5
12205 cat conftest.java >&5
12206 cat conftest.xml >&5
12207 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
12210 rm -fr conftest.dir
12212 if test -z "$ANT_HOME"; then
12213 ANT_HOME="NO_ANT_HOME"
12215 PathFormat "$ANT_HOME"
12216 ANT_HOME="$formatted_path"
12218 ANT="$formatted_path"
12223 dnl Checking for ant.jar
12224 if test "$ANT_HOME" != "NO_ANT_HOME"; then
12225 AC_MSG_CHECKING([Ant lib directory])
12226 if test -f $ANT_HOME/lib/ant.jar; then
12227 ANT_LIB="$ANT_HOME/lib"
12229 if test -f $ANT_HOME/ant.jar; then
12230 ANT_LIB="$ANT_HOME"
12232 if test -f /usr/share/java/ant.jar; then
12233 ANT_LIB=/usr/share/java
12235 if test -f /usr/share/ant-core/lib/ant.jar; then
12236 ANT_LIB=/usr/share/ant-core/lib
12238 if test -f $ANT_HOME/lib/ant/ant.jar; then
12239 ANT_LIB="$ANT_HOME/lib/ant"
12241 if test -f /usr/share/lib/ant/ant.jar; then
12242 ANT_LIB=/usr/share/lib/ant
12244 AC_MSG_ERROR([Ant libraries not found!])
12251 PathFormat "$ANT_LIB"
12252 ANT_LIB="$formatted_path"
12253 AC_MSG_RESULT([Ant lib directory found.])
12258 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
12260 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
12261 ant_version=`"$ANT" -version | $AWK '$3 == "version" { print $4; }'`
12262 ant_version_major=`echo $ant_version | cut -d. -f1`
12263 ant_version_minor=`echo $ant_version | cut -d. -f2`
12264 echo "configure: ant_version $ant_version " >&5
12265 echo "configure: ant_version_major $ant_version_major " >&5
12266 echo "configure: ant_version_minor $ant_version_minor " >&5
12267 if test "$ant_version_major" -ge "2"; then
12268 AC_MSG_RESULT([yes, $ant_version])
12269 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
12270 AC_MSG_RESULT([yes, $ant_version])
12272 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
12275 rm -f conftest* core core.* *.core
12279 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12280 AC_MSG_CHECKING([for JUnit 4])
12281 if test "$with_junit" = "yes"; then
12282 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
12283 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
12284 elif test -e /usr/share/java/junit4.jar; then
12285 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
12287 if test -e /usr/share/lib/java/junit.jar; then
12288 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
12290 OOO_JUNIT_JAR=/usr/share/java/junit.jar
12294 OOO_JUNIT_JAR=$with_junit
12296 if test "$_os" = "WINNT"; then
12297 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
12299 printf 'import org.junit.Before;' > conftest.java
12300 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12301 AC_MSG_RESULT([$OOO_JUNIT_JAR])
12304 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
12305 specify its pathname via --with-junit=..., or disable it via --without-junit])
12307 rm -f conftest.class conftest.java
12308 if test $OOO_JUNIT_JAR != ""; then
12309 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
12312 AC_SUBST(OOO_JUNIT_JAR)
12315 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12316 AC_MSG_CHECKING([for included Hamcrest])
12317 printf 'import org.hamcrest.BaseDescription;' > conftest.java
12318 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12319 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
12321 AC_MSG_RESULT([Not included])
12322 AC_MSG_CHECKING([for standalone hamcrest jar.])
12323 if test "$with_hamcrest" = "yes"; then
12324 if test -e /usr/share/lib/java/hamcrest.jar; then
12325 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
12326 elif test -e /usr/share/java/hamcrest/core.jar; then
12327 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
12329 HAMCREST_JAR=/usr/share/java/hamcrest.jar
12332 HAMCREST_JAR=$with_hamcrest
12334 if test "$_os" = "WINNT"; then
12335 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
12337 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
12338 AC_MSG_RESULT([$HAMCREST_JAR])
12340 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),
12341 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
12344 rm -f conftest.class conftest.java
12346 AC_SUBST(HAMCREST_JAR)
12352 # check for wget and curl
12357 if test "$enable_fetch_external" != "no"; then
12359 CURL=`which curl 2>/dev/null`
12361 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12363 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
12364 if test $? -eq 0; then
12370 if test -z "$WGET" -a -z "$CURL"; then
12371 AC_MSG_ERROR([neither wget nor curl found!])
12380 # check for sha256sum
12384 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
12385 eval "$i -a 256 --version" > /dev/null 2>&1
12387 if test $ret -eq 0; then
12388 SHA256SUM="$i -a 256"
12393 if test -z "$SHA256SUM"; then
12394 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
12395 eval "$i --version" > /dev/null 2>&1
12397 if test $ret -eq 0; then
12404 if test -z "$SHA256SUM"; then
12405 AC_MSG_ERROR([no sha256sum found!])
12408 AC_SUBST(SHA256SUM)
12410 dnl ===================================================================
12411 dnl Dealing with l10n options
12412 dnl ===================================================================
12413 AC_MSG_CHECKING([which languages to be built])
12414 # get list of all languages
12415 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12416 # the sed command does the following:
12417 # + if a line ends with a backslash, append the next line to it
12418 # + adds " on the beginning of the value (after =)
12419 # + adds " at the end of the value
12420 # + removes en-US; we want to put it on the beginning
12421 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12422 [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)]
12423 ALL_LANGS="en-US $completelangiso"
12424 # check the configured localizations
12425 WITH_LANG="$with_lang"
12427 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
12428 # (Norwegian is "nb" and "nn".)
12429 if test "$WITH_LANG" = "no"; then
12433 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12434 AC_MSG_RESULT([en-US])
12436 AC_MSG_RESULT([$WITH_LANG])
12437 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12438 if test -z "$MSGFMT"; then
12439 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12440 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12441 elif test -x "/opt/lo/bin/msgfmt"; then
12442 MSGFMT="/opt/lo/bin/msgfmt"
12444 AC_CHECK_PROGS(MSGFMT, [msgfmt])
12445 if test -z "$MSGFMT"; then
12446 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12450 if test -z "$MSGUNIQ"; then
12451 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12452 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12453 elif test -x "/opt/lo/bin/msguniq"; then
12454 MSGUNIQ="/opt/lo/bin/msguniq"
12456 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12457 if test -z "$MSGUNIQ"; then
12458 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12465 # check that the list is valid
12466 for lang in $WITH_LANG; do
12467 test "$lang" = "ALL" && continue
12468 # need to check for the exact string, so add space before and after the list of all languages
12469 for vl in $ALL_LANGS; do
12470 if test "$vl" = "$lang"; then
12474 if test "$vl" != "$lang"; then
12475 # if you're reading this - you prolly quoted your languages remove the quotes ...
12476 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12479 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12480 echo $WITH_LANG | grep -q en-US
12481 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12483 # list with substituted ALL
12484 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12485 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12486 test "$WITH_LANG" = "en-US" && WITH_LANG=
12487 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12488 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12489 ALL_LANGS=`echo $ALL_LANGS qtz`
12491 AC_SUBST(ALL_LANGS)
12492 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12493 AC_SUBST(WITH_LANG)
12494 AC_SUBST(WITH_LANG_LIST)
12495 AC_SUBST(GIT_NEEDED_SUBMODULES)
12497 WITH_POOR_HELP_LOCALIZATIONS=
12498 if test -d "$SRC_ROOT/translations/source"; then
12499 for l in `ls -1 $SRC_ROOT/translations/source`; do
12500 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12501 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12505 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12507 if test -n "$with_locales"; then
12508 WITH_LOCALES="$with_locales"
12510 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12511 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12512 # config_host/config_locales.h.in
12513 for locale in $WITH_LOCALES; do
12516 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12520 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12523 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12528 AC_DEFINE(WITH_LOCALE_ALL)
12530 AC_SUBST(WITH_LOCALES)
12532 dnl git submodule update --reference
12533 dnl ===================================================================
12534 if test -n "${GIT_REFERENCE_SRC}"; then
12535 for repo in ${GIT_NEEDED_SUBMODULES}; do
12536 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12537 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12541 AC_SUBST(GIT_REFERENCE_SRC)
12543 dnl git submodules linked dirs
12544 dnl ===================================================================
12545 if test -n "${GIT_LINK_SRC}"; then
12546 for repo in ${GIT_NEEDED_SUBMODULES}; do
12547 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12548 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12552 AC_SUBST(GIT_LINK_SRC)
12555 dnl ===================================================================
12556 AC_MSG_CHECKING([for alternative branding images directory])
12557 # initialize mapped arrays
12558 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12559 brand_files="$BRAND_INTRO_IMAGES about.svg"
12561 if test -z "$with_branding" -o "$with_branding" = "no"; then
12562 AC_MSG_RESULT([none])
12563 DEFAULT_BRAND_IMAGES="$brand_files"
12565 if ! test -d $with_branding ; then
12566 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12568 AC_MSG_RESULT([$with_branding])
12569 CUSTOM_BRAND_DIR="$with_branding"
12570 for lfile in $brand_files
12572 if ! test -f $with_branding/$lfile ; then
12573 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12574 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12576 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12579 check_for_progress="yes"
12582 AC_SUBST([BRAND_INTRO_IMAGES])
12583 AC_SUBST([CUSTOM_BRAND_DIR])
12584 AC_SUBST([CUSTOM_BRAND_IMAGES])
12585 AC_SUBST([DEFAULT_BRAND_IMAGES])
12588 AC_MSG_CHECKING([for 'intro' progress settings])
12592 PROGRESSFRAMECOLOR=
12594 PROGRESSTEXTBASELINE=
12596 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12597 source "$with_branding/progress.conf"
12598 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12600 AC_MSG_RESULT([none])
12603 AC_SUBST(PROGRESSBARCOLOR)
12604 AC_SUBST(PROGRESSSIZE)
12605 AC_SUBST(PROGRESSPOSITION)
12606 AC_SUBST(PROGRESSFRAMECOLOR)
12607 AC_SUBST(PROGRESSTEXTCOLOR)
12608 AC_SUBST(PROGRESSTEXTBASELINE)
12611 AC_MSG_CHECKING([for extra build ID])
12612 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12613 EXTRA_BUILDID="$with_extra_buildid"
12615 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12616 if test -n "$EXTRA_BUILDID" ; then
12617 AC_MSG_RESULT([$EXTRA_BUILDID])
12619 AC_MSG_RESULT([not set])
12621 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12624 AC_MSG_CHECKING([for vendor])
12625 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12626 OOO_VENDOR="$USERNAME"
12628 if test -z "$OOO_VENDOR"; then
12632 if test -z "$OOO_VENDOR"; then
12633 OOO_VENDOR="`id -u -n`"
12636 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12638 OOO_VENDOR="$with_vendor"
12639 AC_MSG_RESULT([$OOO_VENDOR])
12641 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12642 AC_SUBST(OOO_VENDOR)
12644 if test "$_os" = "Android" ; then
12645 ANDROID_PACKAGE_NAME=
12646 AC_MSG_CHECKING([for Android package name])
12647 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12648 if test -n "$ENABLE_DEBUG"; then
12649 # Default to the package name that makes ndk-gdb happy.
12650 ANDROID_PACKAGE_NAME="org.libreoffice"
12652 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12655 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12657 ANDROID_PACKAGE_NAME="$with_android_package_name"
12658 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12660 AC_SUBST(ANDROID_PACKAGE_NAME)
12663 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12664 if test "$with_compat_oowrappers" = "yes"; then
12665 WITH_COMPAT_OOWRAPPERS=TRUE
12668 WITH_COMPAT_OOWRAPPERS=
12671 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12673 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12674 AC_MSG_CHECKING([for install dirname])
12675 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12676 INSTALLDIRNAME="$with_install_dirname"
12678 AC_MSG_RESULT([$INSTALLDIRNAME])
12679 AC_SUBST(INSTALLDIRNAME)
12681 AC_MSG_CHECKING([for prefix])
12682 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12683 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12684 PREFIXDIR="$prefix"
12685 AC_MSG_RESULT([$PREFIXDIR])
12686 AC_SUBST(PREFIXDIR)
12688 LIBDIR=[$(eval echo $(eval echo $libdir))]
12691 DATADIR=[$(eval echo $(eval echo $datadir))]
12694 MANDIR=[$(eval echo $(eval echo $mandir))]
12697 DOCDIR=[$(eval echo $(eval echo $docdir))]
12700 BINDIR=[$(eval echo $(eval echo $bindir))]
12703 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12704 AC_SUBST(INSTALLDIR)
12706 TESTINSTALLDIR="${BUILDDIR}/test-install"
12707 AC_SUBST(TESTINSTALLDIR)
12710 # ===================================================================
12711 # OAuth2 id and secrets
12712 # ===================================================================
12714 AC_MSG_CHECKING([for Google Drive client id and secret])
12715 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12716 AC_MSG_RESULT([not set])
12717 GDRIVE_CLIENT_ID="\"\""
12718 GDRIVE_CLIENT_SECRET="\"\""
12720 AC_MSG_RESULT([set])
12721 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12722 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12724 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12725 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12727 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12728 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12729 AC_MSG_RESULT([not set])
12730 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12731 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12733 AC_MSG_RESULT([set])
12734 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12735 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12737 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12738 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12740 AC_MSG_CHECKING([for OneDrive client id and secret])
12741 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12742 AC_MSG_RESULT([not set])
12743 ONEDRIVE_CLIENT_ID="\"\""
12744 ONEDRIVE_CLIENT_SECRET="\"\""
12746 AC_MSG_RESULT([set])
12747 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12748 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12750 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12751 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12754 dnl ===================================================================
12755 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12756 dnl --enable-dependency-tracking configure option
12757 dnl ===================================================================
12758 AC_MSG_CHECKING([whether to enable dependency tracking])
12759 if test "$enable_dependency_tracking" = "no"; then
12761 AC_MSG_RESULT([no])
12763 AC_MSG_RESULT([yes])
12767 dnl ===================================================================
12768 dnl Number of CPUs to use during the build
12769 dnl ===================================================================
12770 AC_MSG_CHECKING([for number of processors to use])
12771 # plain --with-parallelism is just the default
12772 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12773 if test "$with_parallelism" = "no"; then
12776 PARALLELISM=$with_parallelism
12779 if test "$enable_icecream" = "yes"; then
12784 Darwin|FreeBSD|NetBSD|OpenBSD)
12785 PARALLELISM=`sysctl -n hw.ncpu`
12789 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12791 # what else than above does profit here *and* has /proc?
12793 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12797 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12798 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12802 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12803 if test -z "$with_parallelism"; then
12804 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12805 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12808 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."
12812 if test $PARALLELISM -eq 0; then
12813 AC_MSG_RESULT([explicit make -j option needed])
12815 AC_MSG_RESULT([$PARALLELISM])
12817 AC_SUBST(PARALLELISM)
12819 IWYU_PATH="$with_iwyu"
12820 AC_SUBST(IWYU_PATH)
12821 if test ! -z "$IWYU_PATH"; then
12822 if test ! -f "$IWYU_PATH"; then
12823 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12828 # Set up ILIB for MSVC build
12831 if test "$build_os" = "cygwin"; then
12833 if test -n "$JAVA_HOME"; then
12834 ILIB="$ILIB;$JAVA_HOME/lib"
12837 if test "$BITNESS_OVERRIDE" = 64; then
12838 ILIB="$ILIB;$COMPATH/lib/x64"
12839 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12840 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12841 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12842 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12843 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12844 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12846 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12847 ucrtlibpath_formatted=$formatted_path
12848 ILIB="$ILIB;$ucrtlibpath_formatted"
12849 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12851 ILIB="$ILIB;$COMPATH/lib/x86"
12852 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12853 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12854 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12855 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12856 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12857 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12859 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12860 ucrtlibpath_formatted=$formatted_path
12861 ILIB="$ILIB;$ucrtlibpath_formatted"
12862 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12864 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12865 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12867 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12873 # ===================================================================
12874 # Creating bigger shared library to link against
12875 # ===================================================================
12876 AC_MSG_CHECKING([whether to create huge library])
12879 if test $_os = iOS -o $_os = Android; then
12880 # Never any point in mergelibs for these as we build just static
12881 # libraries anyway...
12882 enable_mergelibs=no
12885 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12886 if test $_os != Linux -a $_os != WINNT; then
12887 add_warning "--enable-mergelibs is not tested for this platform"
12890 AC_MSG_RESULT([yes])
12891 AC_DEFINE(ENABLE_MERGELIBS)
12893 AC_MSG_RESULT([no])
12895 AC_SUBST([MERGELIBS])
12897 dnl ===================================================================
12898 dnl icerun is a wrapper that stops us spawning tens of processes
12899 dnl locally - for tools that can't be executed on the compile cluster
12900 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12901 dnl ===================================================================
12902 AC_MSG_CHECKING([whether to use icerun wrapper])
12904 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12905 ICECREAM_RUN=icerun
12906 AC_MSG_RESULT([yes])
12908 AC_MSG_RESULT([no])
12910 AC_SUBST(ICECREAM_RUN)
12912 dnl ===================================================================
12913 dnl Setup the ICECC_VERSION for the build the same way it was set for
12914 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12915 dnl ===================================================================
12916 x_ICECC_VERSION=[\#]
12917 if test -n "$ICECC_VERSION" ; then
12920 AC_SUBST(x_ICECC_VERSION)
12921 AC_SUBST(ICECC_VERSION)
12923 dnl ===================================================================
12925 AC_MSG_CHECKING([MPL subset])
12928 if test "$enable_mpl_subset" = "yes"; then
12930 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12932 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12935 if test "$warn_report" = "true"; then
12936 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12938 if test "x$enable_postgresql_sdbc" != "xno"; then
12939 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12941 if test "$enable_lotuswordpro" = "yes"; then
12942 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12944 if test "$WITH_WEBDAV" = "neon"; then
12945 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12947 if test -n "$ENABLE_POPPLER"; then
12948 if test "x$SYSTEM_POPPLER" = "x"; then
12949 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12952 # cf. m4/libo_check_extension.m4
12953 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12954 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12956 for theme in $WITH_THEMES; do
12958 breeze|breeze_dark|breeze_dark_svg|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg|sukapura|sukapura_svg) #blacklist of icon themes under GPL or LGPL
12959 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12964 ENABLE_OPENGL_TRANSITIONS=
12966 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12967 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12971 AC_DEFINE(MPL_HAVE_SUBSET)
12972 AC_MSG_RESULT([only])
12974 AC_MSG_RESULT([no restrictions])
12976 AC_SUBST(MPL_SUBSET)
12978 dnl ===================================================================
12980 AC_MSG_CHECKING([formula logger])
12981 ENABLE_FORMULA_LOGGER=
12983 if test "x$enable_formula_logger" = "xyes"; then
12984 AC_MSG_RESULT([yes])
12985 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12986 ENABLE_FORMULA_LOGGER=TRUE
12987 elif test -n "$ENABLE_DBGUTIL" ; then
12988 AC_MSG_RESULT([yes])
12989 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12990 ENABLE_FORMULA_LOGGER=TRUE
12992 AC_MSG_RESULT([no])
12995 AC_SUBST(ENABLE_FORMULA_LOGGER)
12997 dnl ===================================================================
12998 dnl Checking for active Antivirus software.
12999 dnl ===================================================================
13001 if test $_os = WINNT ; then
13002 AC_MSG_CHECKING([for active Antivirus software])
13003 ANTIVIRUS_LIST=`cscript.exe //Nologo $SRC_ROOT/antivirusDetection.vbs`
13004 if [ [ "$ANTIVIRUS_LIST" != "NULL" ] ]; then
13005 if [ [ "$ANTIVIRUS_LIST" != "NOT_FOUND" ] ]; then
13006 AC_MSG_RESULT([found])
13007 EICAR_STRING='X5O!P%@AP@<:@4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
13008 echo $EICAR_STRING > $SRC_ROOT/eicar
13009 EICAR_TEMP_FILE_CONTENTS=`cat $SRC_ROOT/eicar`
13011 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
13012 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
13014 echo $EICAR_STRING > $BUILDDIR/eicar
13015 EICAR_TEMP_FILE_CONTENTS=`cat $BUILDDIR/eicar`
13017 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
13018 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
13020 add_warning "To speed up builds and avoid failures in unit tests, it is highly recommended that you exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST"
13022 AC_MSG_RESULT([not found])
13025 AC_MSG_RESULT([n/a])
13029 dnl ===================================================================
13030 dnl Setting up the environment.
13031 dnl ===================================================================
13032 AC_MSG_NOTICE([setting up the build environment variables...])
13036 if test "$build_os" = "cygwin"; then
13037 if test -d "$COMPATH/atlmfc/lib/spectre"; then
13038 ATL_LIB="$COMPATH/atlmfc/lib/spectre"
13039 ATL_INCLUDE="$COMPATH/atlmfc/include"
13040 elif test -d "$COMPATH/atlmfc/lib"; then
13041 ATL_LIB="$COMPATH/atlmfc/lib"
13042 ATL_INCLUDE="$COMPATH/atlmfc/include"
13044 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
13045 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
13047 if test "$BITNESS_OVERRIDE" = 64; then
13048 ATL_LIB="$ATL_LIB/x64"
13050 ATL_LIB="$ATL_LIB/x86"
13052 ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
13053 ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
13055 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
13056 PathFormat "/usr/bin/find.exe"
13057 FIND="$formatted_path"
13058 PathFormat "/usr/bin/sort.exe"
13059 SORT="$formatted_path"
13060 PathFormat "/usr/bin/grep.exe"
13061 WIN_GREP="$formatted_path"
13062 PathFormat "/usr/bin/ls.exe"
13063 WIN_LS="$formatted_path"
13064 PathFormat "/usr/bin/touch.exe"
13065 WIN_TOUCH="$formatted_path"
13071 AC_SUBST(ATL_INCLUDE)
13077 AC_SUBST(WIN_TOUCH)
13079 AC_SUBST(BUILD_TYPE)
13084 PERL="$formatted_path"
13087 if test -n "$TMPDIR"; then
13088 TEMP_DIRECTORY="$TMPDIR"
13090 TEMP_DIRECTORY="/tmp"
13092 if test "$build_os" = "cygwin"; then
13093 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
13095 AC_SUBST(TEMP_DIRECTORY)
13097 # setup the PATH for the environment
13098 if test -n "$LO_PATH_FOR_BUILD"; then
13099 LO_PATH="$LO_PATH_FOR_BUILD"
13105 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
13106 if test "$ENABLE_JAVA" != ""; then
13107 pathmunge "$JAVA_HOME/bin" "after"
13112 # Win32 make needs native paths
13113 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
13114 LO_PATH=`cygpath -p -m "$PATH"`
13116 if test "$BITNESS_OVERRIDE" = 64; then
13117 # needed for msi packaging
13118 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
13120 # .NET 4.6 and higher don't have bin directory
13121 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
13122 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
13124 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
13125 pathmunge "$CSC_PATH" "before"
13126 pathmunge "$MIDL_PATH" "before"
13127 pathmunge "$AL_PATH" "before"
13128 pathmunge "$MSPDB_PATH" "before"
13129 if test "$MSPDB_PATH" != "$CL_PATH" ; then
13130 pathmunge "$CL_PATH" "before"
13132 if test -n "$MSBUILD_PATH" ; then
13133 pathmunge "$MSBUILD_PATH" "before"
13135 if test "$BITNESS_OVERRIDE" = 64; then
13136 pathmunge "$COMPATH/bin/amd64" "before"
13137 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
13139 pathmunge "$COMPATH/bin" "before"
13140 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
13142 if test "$ENABLE_JAVA" != ""; then
13143 if test -d "$JAVA_HOME/jre/bin/client"; then
13144 pathmunge "$JAVA_HOME/jre/bin/client" "before"
13146 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
13147 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
13149 pathmunge "$JAVA_HOME/bin" "before"
13154 pathmunge "/usr/css/bin" "before"
13155 if test "$ENABLE_JAVA" != ""; then
13156 pathmunge "$JAVA_HOME/bin" "after"
13166 # Generate a configuration sha256 we can use for deps
13167 if test -f config_host.mk; then
13168 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
13170 if test -f config_host_lang.mk; then
13171 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
13174 CFLAGS=$my_original_CFLAGS
13175 CXXFLAGS=$my_original_CXXFLAGS
13176 CPPFLAGS=$my_original_CPPFLAGS
13178 AC_CONFIG_FILES([config_host.mk
13179 config_host_lang.mk
13181 bin/bffvalidator.sh
13182 bin/odfvalidator.sh
13184 instsetoo_native/util/openoffice.lst
13185 sysui/desktop/macosx/Info.plist])
13186 AC_CONFIG_HEADERS([config_host/config_buildid.h])
13187 AC_CONFIG_HEADERS([config_host/config_clang.h])
13188 AC_CONFIG_HEADERS([config_host/config_dconf.h])
13189 AC_CONFIG_HEADERS([config_host/config_eot.h])
13190 AC_CONFIG_HEADERS([config_host/config_extensions.h])
13191 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
13192 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
13193 AC_CONFIG_HEADERS([config_host/config_dbus.h])
13194 AC_CONFIG_HEADERS([config_host/config_features.h])
13195 AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
13196 AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
13197 AC_CONFIG_HEADERS([config_host/config_firebird.h])
13198 AC_CONFIG_HEADERS([config_host/config_folders.h])
13199 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
13200 AC_CONFIG_HEADERS([config_host/config_gio.h])
13201 AC_CONFIG_HEADERS([config_host/config_global.h])
13202 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
13203 AC_CONFIG_HEADERS([config_host/config_java.h])
13204 AC_CONFIG_HEADERS([config_host/config_langs.h])
13205 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
13206 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
13207 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
13208 AC_CONFIG_HEADERS([config_host/config_libnumbertext.h])
13209 AC_CONFIG_HEADERS([config_host/config_locales.h])
13210 AC_CONFIG_HEADERS([config_host/config_mpl.h])
13211 AC_CONFIG_HEADERS([config_host/config_oox.h])
13212 AC_CONFIG_HEADERS([config_host/config_options.h])
13213 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
13214 AC_CONFIG_HEADERS([config_host/config_skia.h])
13215 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
13216 AC_CONFIG_HEADERS([config_host/config_vendor.h])
13217 AC_CONFIG_HEADERS([config_host/config_vcl.h])
13218 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
13219 AC_CONFIG_HEADERS([config_host/config_version.h])
13220 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
13221 AC_CONFIG_HEADERS([config_host/config_poppler.h])
13222 AC_CONFIG_HEADERS([config_host/config_python.h])
13223 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
13226 if test "$CROSS_COMPILING" = TRUE; then
13227 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
13230 # touch the config timestamp file
13231 if test ! -f config_host.mk.stamp; then
13232 echo > config_host.mk.stamp
13233 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
13234 echo "Host Configuration unchanged - avoiding scp2 stamp update"
13236 echo > config_host.mk.stamp
13239 # touch the config lang timestamp file
13240 if test ! -f config_host_lang.mk.stamp; then
13241 echo > config_host_lang.mk.stamp
13242 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
13243 echo "Language Configuration unchanged - avoiding scp2 stamp update"
13245 echo > config_host_lang.mk.stamp
13249 if test \( "$STALE_MAKE" = "TRUE" -o "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE" \) \
13250 -a "$build_os" = "cygwin"; then
13253 ****************************************************************************
13255 Your make version is known to be horribly slow, and hard to debug
13256 problems with. To get a reasonably functional make please do:
13258 to install a pre-compiled binary make for Win32
13260 mkdir -p /opt/lo/bin
13262 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
13263 cp make-4.2.1-msvc.exe make
13266 to install from source:
13267 place yourself in a working directory of you choice.
13269 git clone git://git.savannah.gnu.org/make.git
13271 [go to Start menu, open "Visual Studio 2019", click "x86 Native Tools Command Prompt" or "x64 Native Tools Command Prompt"]
13272 set PATH=%PATH%;C:\Cygwin\bin
13273 [or Cygwin64, if that is what you have]
13274 cd path-to-make-repo-you-cloned-above
13275 build_w32.bat --without-guile
13277 should result in a WinRel/gnumake.exe.
13278 Copy it to the Cygwin /opt/lo/bin directory as make.exe
13280 Then re-run autogen.sh
13282 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
13283 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
13286 if test "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE"; then
13287 AC_MSG_ERROR([no file function found; the build will fail without it; use GNU make 4.0 or later])
13293 ****************************************************************************
13298 To view some help, run:
13303 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
13305 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
13308 if test $_os = Darwin; then
13309 echo open instdir/$PRODUCTNAME.app
13311 echo instdir/program/soffice
13315 If you want to run the smoketest, run:
13321 if test -f warn; then
13326 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: