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([Collabora Office],[6.4.10.11],[],[],[https://collaboraoffice.com/])
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"
188 PRODUCTNAME=AC_PACKAGE_NAME
190 AC_MSG_RESULT([$PRODUCTNAME])
191 AC_SUBST(PRODUCTNAME)
192 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
193 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
195 dnl ===================================================================
196 dnl Our version is defined by the AC_INIT() at the top of this script.
197 dnl ===================================================================
199 AC_MSG_CHECKING([for package version])
200 if test -n "$with_package_version" -a "$with_package_version" != no; then
201 PACKAGE_VERSION="$with_package_version"
203 AC_MSG_RESULT([$PACKAGE_VERSION])
205 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
207 LIBO_VERSION_MAJOR=$1
208 LIBO_VERSION_MINOR=$2
209 LIBO_VERSION_MICRO=$3
210 LIBO_VERSION_PATCH=$4
212 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
213 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
214 # no way to encode that into an integer in general.
215 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
217 LIBO_VERSION_SUFFIX=$5
218 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
219 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
220 # they get undoubled before actually passed to sed.
221 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
222 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
223 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
224 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
226 AC_SUBST(LIBO_VERSION_MAJOR)
227 AC_SUBST(LIBO_VERSION_MINOR)
228 AC_SUBST(LIBO_VERSION_MICRO)
229 AC_SUBST(LIBO_VERSION_PATCH)
230 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
231 AC_SUBST(LIBO_VERSION_SUFFIX)
232 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
234 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
235 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
236 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
237 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
239 LIBO_THIS_YEAR=`date +%Y`
240 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
242 dnl ===================================================================
244 dnl ===================================================================
245 AC_MSG_CHECKING([for product version])
246 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
247 AC_MSG_RESULT([$PRODUCTVERSION])
248 AC_SUBST(PRODUCTVERSION)
251 # AC_PROG_EGREP doesn't set GREP on all systems as well
252 AC_PATH_PROG(GREP, grep)
260 dnl ======================================
261 dnl Required GObject introspection version
262 dnl ======================================
263 INTROSPECTION_REQUIRED_VERSION=1.32.0
265 dnl ===================================================================
266 dnl Search all the common names for GNU Make
267 dnl ===================================================================
268 AC_MSG_CHECKING([for GNU Make])
270 # try to use our own make if it is available and GNUMAKE was not already defined
271 if test -z "$GNUMAKE"; then
272 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
273 GNUMAKE="$LODE_HOME/opt/bin/make"
274 elif test -x "/opt/lo/bin/make"; then
275 GNUMAKE="/opt/lo/bin/make"
280 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
281 if test -n "$a"; then
282 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
283 if test $? -eq 0; then
284 if test "$build_os" = "cygwin"; then
285 if test -n "$($a -v | grep 'Built for Windows')" ; then
286 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
287 GNUMAKE_WIN_NATIVE="TRUE"
298 AC_MSG_RESULT($GNUMAKE)
299 if test -z "$GNUMAKE"; then
300 AC_MSG_ERROR([not found. install GNU Make.])
302 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
303 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
307 win_short_path_for_make()
309 local_short_path="$1"
310 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
311 cygpath -sm "$local_short_path"
313 cygpath -u "$(cygpath -d "$local_short_path")"
318 if test "$build_os" = "cygwin"; then
319 PathFormat "$SRC_ROOT"
320 SRC_ROOT="$formatted_path"
321 PathFormat "$BUILDDIR"
322 BUILDDIR="$formatted_path"
324 AC_MSG_CHECKING(for explicit COMSPEC)
325 if test -z "$COMSPEC"; then
326 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
328 AC_MSG_RESULT([found: $COMSPEC])
335 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
336 AC_DEFINE_UNQUOTED(SRC_ROOT,"$SRC_ROOT")
337 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
339 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
340 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
343 # need sed in os checks...
344 AC_PATH_PROGS(SED, sed)
345 if test -z "$SED"; then
346 AC_MSG_ERROR([install sed to run this script])
349 # Set the ENABLE_LTO variable
350 # ===================================================================
351 AC_MSG_CHECKING([whether to use link-time optimization])
352 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
355 AC_DEFINE(STATIC_LINKING)
362 AC_ARG_ENABLE(fuzz-options,
363 AS_HELP_STRING([--enable-fuzz-options],
364 [Randomly enable or disable each of those configurable options
365 that are supposed to be freely selectable without interdependencies,
366 or where bad interaction from interdependencies is automatically avoided.])
369 dnl ===================================================================
370 dnl When building for Android, --with-android-ndk,
371 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
373 dnl ===================================================================
375 AC_ARG_WITH(android-ndk,
376 AS_HELP_STRING([--with-android-ndk],
377 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
380 AC_ARG_WITH(android-ndk-toolchain-version,
381 AS_HELP_STRING([--with-android-ndk-toolchain-version],
382 [Specify which toolchain version to use, of those present in the
383 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
384 with_android_ndk_toolchain_version=clang5.0)
386 AC_ARG_WITH(android-sdk,
387 AS_HELP_STRING([--with-android-sdk],
388 [Specify location of the Android SDK. Mandatory when building for Android.]),
391 AC_ARG_WITH(android-api-level,
392 AS_HELP_STRING([--with-android-api-level],
393 [Specify the API level when building for Android. Defaults to 16 for ARM and x86 and to 21 for ARM64 and x86-64]),
397 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
398 with_android_ndk="$SRC_ROOT/external/android-ndk"
400 if test -n "$with_android_ndk"; then
401 eval ANDROID_NDK_HOME=$with_android_ndk
403 # Set up a lot of pre-canned defaults
405 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
406 if test ! -f $ANDROID_NDK_HOME/source.properties; then
407 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
409 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
411 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
413 if test -z "$ANDROID_NDK_VERSION"; then
414 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
416 case $ANDROID_NDK_VERSION in
418 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
420 11.1.*|12.1.*|13.1.*|14.1.*)
421 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
423 16.*|17.*|18.*|19.*|20.*)
426 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk.])
427 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk."
432 if test -n "$with_android_api_level" ; then
433 ANDROID_API_LEVEL="$with_android_api_level"
436 android_cpu=$host_cpu
437 if test $host_cpu = arm; then
438 android_platform_prefix=arm-linux-androideabi
439 android_gnu_prefix=$android_platform_prefix
440 LLVM_TRIPLE=armv7a-linux-androideabi
441 ANDROID_APP_ABI=armeabi-v7a
442 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
443 elif test $host_cpu = aarch64; then
444 android_platform_prefix=aarch64-linux-android
445 android_gnu_prefix=$android_platform_prefix
446 LLVM_TRIPLE=$android_platform_prefix
447 # minimum android version that supports aarch64
448 if test "$ANDROID_API_LEVEL" -lt "21" ; then
451 ANDROID_APP_ABI=arm64-v8a
452 elif test $host_cpu = x86_64; then
453 android_platform_prefix=x86_64-linux-android
454 android_gnu_prefix=$android_platform_prefix
455 LLVM_TRIPLE=$android_platform_prefix
456 # minimum android version that supports x86_64
458 ANDROID_APP_ABI=x86_64
460 # host_cpu is something like "i386" or "i686" I guess, NDK uses
461 # "x86" in some contexts
463 android_platform_prefix=$android_cpu
464 android_gnu_prefix=i686-linux-android
465 LLVM_TRIPLE=$android_gnu_prefix
469 case "$with_android_ndk_toolchain_version" in
471 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
474 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
477 AC_MSG_NOTICE([using the Android API level... $ANDROID_API_LEVEL])
479 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
480 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
481 # manage to link the (app-specific) single huge .so that is built for the app in
482 # android/source/ if there is debug information in a significant part of the object files.
483 # (A 64-bit ld.gold grows too much over 10 gigabytes of virtual space when linking such a .so if
484 # all objects have been built with debug information.)
487 android_HOST_TAG=linux-x86_64
490 android_HOST_TAG=darwin-x86_64
493 AC_MSG_ERROR([We only support building for Android from Linux or macOS])
494 # ndk would also support windows and windows-x86_64
497 android_TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$android_HOST_TAG
498 ANDROID_COMPILER_BIN=$android_TOOLCHAIN/bin
499 dnl TODO: NSS build uses it...
500 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG
501 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
503 test -z "$AR" && AR=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ar
504 test -z "$NM" && NM=$ANDROID_COMPILER_BIN/$android_gnu_prefix-nm
505 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-objdump
506 test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ranlib
507 test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-strip
509 ANDROIDCFLAGS="$ANDROIDCFLAGS -target ${LLVM_TRIPLE}${ANDROID_API_LEVEL}"
510 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes -ffunction-sections -fdata-sections -Qunused-arguments"
511 if test "$ENABLE_LTO" = TRUE; then
512 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
513 # $CC and $CXX when building external libraries
514 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
517 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -stdlib=libc++"
519 if test -z "$CC"; then
520 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
523 if test -z "$CXX"; then
524 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
528 # remember to download the ownCloud Android library later
529 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
531 AC_SUBST(ANDROID_NDK_HOME)
532 AC_SUBST(ANDROID_APP_ABI)
533 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
535 dnl ===================================================================
536 dnl --with-android-sdk
537 dnl ===================================================================
539 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
540 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
542 if test -n "$with_android_sdk"; then
543 eval ANDROID_SDK_HOME=$with_android_sdk
544 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
546 AC_SUBST(ANDROID_SDK_HOME)
548 AC_ARG_ENABLE([android-lok],
549 AS_HELP_STRING([--enable-android-lok],
550 [The Android app from the android/ subdir needs several tweaks all
551 over the place that break the LOK when used in the Online-based
552 Android app. This switch indicates that the intent of this build is
553 actually the Online-based, non-modified LOK.])
556 if test -n "$ANDROID_NDK_HOME" ; then
557 if test "$enable_android_lok" = yes; then
558 ENABLE_ANDROID_LOK=TRUE
559 AC_DEFINE(HAVE_FEATURE_ANDROID_LOK)
560 AC_MSG_NOTICE([building the Android version... for the Online-based Android app])
562 AC_MSG_NOTICE([building the Android version... for the app from the android/ subdir])
565 AC_SUBST([ENABLE_ANDROID_LOK])
567 libo_FUZZ_ARG_ENABLE([android-editing],
568 AS_HELP_STRING([--enable-android-editing],
569 [Enable the experimental editing feature on Android.])
571 ENABLE_ANDROID_EDITING=
572 if test "$enable_android_editing" = yes; then
573 ENABLE_ANDROID_EDITING=TRUE
575 AC_SUBST([ENABLE_ANDROID_EDITING])
577 dnl ===================================================================
578 dnl The following is a list of supported systems.
579 dnl Sequential to keep the logic very simple
580 dnl These values may be checked and reset later.
581 dnl ===================================================================
582 #defaults unless the os test overrides this:
592 # Default values, as such probably valid just for Linux, set
593 # differently below just for Mac OSX, but at least better than
594 # hardcoding these as we used to do. Much of this is duplicated also
595 # in solenv for old build system and for gbuild, ideally we should
596 # perhaps define stuff like this only here in configure.ac?
598 LINKFLAGSSHL="-shared"
602 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
605 INSTROOTCONTENTSUFFIX=
611 build_gstreamer_1_0=yes
615 dnl ===========================================================
616 dnl Check whether we're using Solaris 10 - SPARC or Intel.
617 dnl ===========================================================
618 AC_MSG_CHECKING([the Solaris operating system release])
619 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
620 if test "$_os_release" -lt "10"; then
621 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
623 AC_MSG_RESULT([ok ($_os_release)])
626 dnl Check whether we're using a SPARC or i386 processor
627 AC_MSG_CHECKING([the processor type])
628 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
629 AC_MSG_RESULT([ok ($host_cpu)])
631 AC_MSG_ERROR([only SPARC and i386 processors are supported])
635 linux-gnu*|k*bsd*-gnu*)
636 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.
683 darwin*) # macOS or iOS
689 if test -n "$LODE_HOME" ; then
691 AC_MSG_NOTICE([sanitized the PATH to $PATH])
693 if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
697 enable_mpl_subset=yes
698 enable_lotuswordpro=no
701 enable_postgresql_sdbc=no
702 enable_extension_integration=no
703 enable_report_builder=no
705 if test "$enable_ios_simulator" = "yes"; then
706 host=x86_64-apple-darwin
710 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
711 INSTROOTCONTENTSUFFIX=/Contents
712 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
714 # See comment above the case "$host_os"
715 LINKFLAGSSHL="-dynamiclib -single_module"
722 # -undefined error is the default
727 build_gstreamer_1_0=yes
731 AC_MSG_CHECKING([the FreeBSD operating system release])
732 if test -n "$with_os_version"; then
733 OSVERSION="$with_os_version"
735 OSVERSION=`/sbin/sysctl -n kern.osreldate`
737 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
738 AC_MSG_CHECKING([which thread library to use])
739 if test "$OSVERSION" -lt "500016"; then
740 PTHREAD_CFLAGS="-D_THREAD_SAFE"
741 PTHREAD_LIBS="-pthread"
742 elif test "$OSVERSION" -lt "502102"; then
743 PTHREAD_CFLAGS="-D_THREAD_SAFE"
747 PTHREAD_LIBS="-pthread"
749 AC_MSG_RESULT([$PTHREAD_LIBS])
754 build_gstreamer_1_0=yes
758 PTHREAD_LIBS="-pthread -lpthread"
765 PTHREAD_LIBS=-pthread
771 PTHREAD_CFLAGS="-D_THREAD_SAFE"
772 PTHREAD_LIBS="-pthread"
777 build_gstreamer_1_0=yes
781 PTHREAD_LIBS="-pthread"
786 build_gstreamer_1_0=no
787 enable_lotuswordpro=no
788 enable_mpl_subset=yes
791 enable_report_builder=no
793 enable_postgresql_sdbc=no
806 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
807 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
817 enable_gstreamer_1_0=no
822 enable_postgresql_sdbc=no
823 enable_firebird_sdbc=no
828 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
832 if test "$_os" = "Android" ; then
833 # Verify that the NDK and SDK options are proper
834 if test -z "$with_android_ndk"; then
835 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
836 elif test ! -f "$ANDROID_NDK_HOME/meta/abis.json"; then
837 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
840 if test -z "$ANDROID_SDK_HOME"; then
841 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
842 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
843 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
846 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
847 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
848 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
849 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
850 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
851 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
852 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
853 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
855 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
856 AC_MSG_WARN([android support repository not found - install with
857 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
858 to allow the build to download the specified version of the android support libraries])
859 add_warning "android support repository not found - install with"
860 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
861 add_warning "to allow the build to download the specified version of the android support libraries"
865 if test "$_os" = "AIX"; then
866 AC_PATH_PROG(GAWK, gawk)
867 if test -z "$GAWK"; then
868 AC_MSG_ERROR([gawk not found in \$PATH])
874 AC_SUBST(PTHREAD_CFLAGS)
875 AC_SUBST(PTHREAD_LIBS)
877 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
878 # By default use the ones specified by our build system,
879 # but explicit override is possible.
880 AC_MSG_CHECKING(for explicit AFLAGS)
881 if test -n "$AFLAGS"; then
882 AC_MSG_RESULT([$AFLAGS])
888 AC_MSG_CHECKING(for explicit CFLAGS)
889 if test -n "$CFLAGS"; then
890 AC_MSG_RESULT([$CFLAGS])
896 AC_MSG_CHECKING(for explicit CXXFLAGS)
897 if test -n "$CXXFLAGS"; then
898 AC_MSG_RESULT([$CXXFLAGS])
904 AC_MSG_CHECKING(for explicit OBJCFLAGS)
905 if test -n "$OBJCFLAGS"; then
906 AC_MSG_RESULT([$OBJCFLAGS])
912 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
913 if test -n "$OBJCXXFLAGS"; then
914 AC_MSG_RESULT([$OBJCXXFLAGS])
920 AC_MSG_CHECKING(for explicit LDFLAGS)
921 if test -n "$LDFLAGS"; then
922 AC_MSG_RESULT([$LDFLAGS])
932 AC_SUBST(OBJCXXFLAGS)
937 AC_SUBST(x_OBJCFLAGS)
938 AC_SUBST(x_OBJCXXFLAGS)
941 dnl These are potentially set for MSVC, in the code checking for UCRT below:
942 my_original_CFLAGS=$CFLAGS
943 my_original_CXXFLAGS=$CXXFLAGS
944 my_original_CPPFLAGS=$CPPFLAGS
946 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
947 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
948 dnl AC_PROG_CC internally.
949 if test "$_os" != "WINNT"; then
950 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
954 if test -z "$CC_BASE"; then
955 CC_BASE=`first_arg_basename "$CC"`
959 if test "$_os" != "WINNT"; then
960 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
966 if test $_os != "WINNT"; then
968 AC_SEARCH_LIBS([dlsym], [dl],
969 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
970 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
973 AC_SUBST(DLOPEN_LIBS)
975 AC_ARG_ENABLE(ios-simulator,
976 AS_HELP_STRING([--enable-ios-simulator],
977 [build i386 or x86_64 for ios simulator])
980 AC_ARG_ENABLE(ios-libreofficelight-app,
981 AS_HELP_STRING([--enable-ios-libreofficelight-app],
982 [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
983 (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
984 and also that its actual build (in Xcode) requires some obvious modifications to the project.])
987 ENABLE_IOS_LIBREOFFICELIGHT_APP=
988 if test "$enable_ios_libreofficelight_app" = yes; then
989 ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
991 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
993 ###############################################################################
994 # Extensions switches --enable/--disable
995 ###############################################################################
996 # By default these should be enabled unless having extra dependencies.
997 # If there is extra dependency over configure options then the enable should
998 # be automagic based on whether the requiring feature is enabled or not.
999 # All this options change anything only with --enable-extension-integration.
1001 # The name of this option and its help string makes it sound as if
1002 # extensions are built anyway, just not integrated in the installer,
1003 # if you use --disable-extension-integration. Is that really the
1006 libo_FUZZ_ARG_ENABLE(extension-integration,
1007 AS_HELP_STRING([--disable-extension-integration],
1008 [Disable integration of the built extensions in the installer of the
1009 product. Use this switch to disable the integration.])
1012 AC_ARG_ENABLE(avmedia,
1013 AS_HELP_STRING([--disable-avmedia],
1014 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
1017 AC_ARG_ENABLE(database-connectivity,
1018 AS_HELP_STRING([--disable-database-connectivity],
1019 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
1022 # This doesn't mean not building (or "integrating") extensions
1023 # (although it probably should; i.e. it should imply
1024 # --disable-extension-integration I guess), it means not supporting
1025 # any extension mechanism at all
1026 libo_FUZZ_ARG_ENABLE(extensions,
1027 AS_HELP_STRING([--disable-extensions],
1028 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1031 AC_ARG_ENABLE(scripting,
1032 AS_HELP_STRING([--disable-scripting],
1033 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1036 # This is mainly for Android and iOS, but could potentially be used in some
1037 # special case otherwise, too, so factored out as a separate setting
1039 AC_ARG_ENABLE(dynamic-loading,
1040 AS_HELP_STRING([--disable-dynamic-loading],
1041 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1044 libo_FUZZ_ARG_ENABLE(report-builder,
1045 AS_HELP_STRING([--disable-report-builder],
1046 [Disable the Report Builder.])
1049 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1050 AS_HELP_STRING([--enable-ext-wiki-publisher],
1051 [Enable the Wiki Publisher extension.])
1054 libo_FUZZ_ARG_ENABLE(lpsolve,
1055 AS_HELP_STRING([--disable-lpsolve],
1056 [Disable compilation of the lp solve solver ])
1058 libo_FUZZ_ARG_ENABLE(coinmp,
1059 AS_HELP_STRING([--disable-coinmp],
1060 [Disable compilation of the CoinMP solver ])
1063 libo_FUZZ_ARG_ENABLE(pdfimport,
1064 AS_HELP_STRING([--disable-pdfimport],
1065 [Disable building the PDF import feature.])
1068 libo_FUZZ_ARG_ENABLE(pdfium,
1069 AS_HELP_STRING([--disable-pdfium],
1070 [Disable building PDFium.])
1073 ###############################################################################
1075 dnl ---------- *** ----------
1077 libo_FUZZ_ARG_ENABLE(mergelibs,
1078 AS_HELP_STRING([--enable-mergelibs],
1079 [Merge several of the smaller libraries into one big, "merged", one.])
1082 libo_FUZZ_ARG_ENABLE(breakpad,
1083 AS_HELP_STRING([--enable-breakpad],
1084 [Enables breakpad for crash reporting.])
1087 libo_FUZZ_ARG_ENABLE(crashdump,
1088 AS_HELP_STRING([--disable-crashdump],
1089 [Disable dump.ini and dump-file, when --enable-breakpad])
1092 AC_ARG_ENABLE(fetch-external,
1093 AS_HELP_STRING([--disable-fetch-external],
1094 [Disables fetching external tarballs from web sources.])
1097 AC_ARG_ENABLE(fuzzers,
1098 AS_HELP_STRING([--enable-fuzzers],
1099 [Enables building libfuzzer targets for fuzz testing.])
1102 libo_FUZZ_ARG_ENABLE(pch,
1103 AS_HELP_STRING([--enable-pch=<yes/no/system/base/normal/full>],
1104 [Enables precompiled header support for C++. Forced default on Windows/VC build.
1105 Using 'system' will include only external headers, 'base' will add also headers
1106 from base modules, 'normal' will also add all headers except from the module built,
1107 'full' will use all suitable headers even from a module itself.])
1110 libo_FUZZ_ARG_ENABLE(epm,
1111 AS_HELP_STRING([--enable-epm],
1112 [LibreOffice includes self-packaging code, that requires epm, however epm is
1113 useless for large scale package building.])
1116 libo_FUZZ_ARG_ENABLE(odk,
1117 AS_HELP_STRING([--disable-odk],
1118 [LibreOffice includes an ODK, office development kit which some packagers may
1119 wish to build without.])
1122 AC_ARG_ENABLE(mpl-subset,
1123 AS_HELP_STRING([--enable-mpl-subset],
1124 [Don't compile any pieces which are not MPL or more liberally licensed])
1127 libo_FUZZ_ARG_ENABLE(evolution2,
1128 AS_HELP_STRING([--enable-evolution2],
1129 [Allows the built-in evolution 2 addressbook connectivity build to be
1133 AC_ARG_ENABLE(avahi,
1134 AS_HELP_STRING([--enable-avahi],
1135 [Determines whether to use Avahi to advertise Impress to remote controls.])
1138 libo_FUZZ_ARG_ENABLE(werror,
1139 AS_HELP_STRING([--enable-werror],
1140 [Turn warnings to errors. (Has no effect in modules where the treating
1141 of warnings as errors is disabled explicitly.)]),
1144 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1145 AS_HELP_STRING([--enable-assert-always-abort],
1146 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1149 libo_FUZZ_ARG_ENABLE(dbgutil,
1150 AS_HELP_STRING([--enable-dbgutil],
1151 [Provide debugging support from --enable-debug and include additional debugging
1152 utilities such as object counting or more expensive checks.
1153 This is the recommended option for developers.
1154 Note that this makes the build ABI incompatible, it is not possible to mix object
1155 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1157 libo_FUZZ_ARG_ENABLE(debug,
1158 AS_HELP_STRING([--enable-debug],
1159 [Include debugging information, disable compiler optimization and inlining plus
1160 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1162 libo_FUZZ_ARG_ENABLE(split-debug,
1163 AS_HELP_STRING([--disable-split-debug],
1164 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1165 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1167 libo_FUZZ_ARG_ENABLE(gdb-index,
1168 AS_HELP_STRING([--disable-gdb-index],
1169 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1170 The feature requires the gold or lld linker.]))
1172 libo_FUZZ_ARG_ENABLE(sal-log,
1173 AS_HELP_STRING([--enable-sal-log],
1174 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1176 libo_FUZZ_ARG_ENABLE(symbols,
1177 AS_HELP_STRING([--enable-symbols],
1178 [Generate debug information.
1179 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1180 otherwise. It is possible to explicitly specify gbuild build targets
1181 (where 'all' means everything, '-' prepended means to not enable, '/' appended means
1182 everything in the directory; there is no ordering, more specific overrides
1183 more general, and disabling takes precedence).
1184 Example: --enable-symbols="all -sw/ -Library_sc".]))
1186 libo_FUZZ_ARG_ENABLE(optimized,
1187 AS_HELP_STRING([--disable-optimized],
1188 [Whether to compile with optimization flags.
1189 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1192 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1193 AS_HELP_STRING([--disable-runtime-optimizations],
1194 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1195 JVM JIT) that are known to interact badly with certain dynamic analysis
1196 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1197 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1198 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1200 AC_ARG_WITH(valgrind,
1201 AS_HELP_STRING([--with-valgrind],
1202 [Make availability of Valgrind headers a hard requirement.]))
1204 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1205 AS_HELP_STRING([--enable-compiler-plugins],
1206 [Enable compiler plugins that will perform additional checks during
1207 building. Enabled automatically by --enable-dbgutil.
1208 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1209 COMPILER_PLUGINS_DEBUG=
1210 if test "$enable_compiler_plugins" = debug; then
1211 enable_compiler_plugins=yes
1212 COMPILER_PLUGINS_DEBUG=TRUE
1215 libo_FUZZ_ARG_ENABLE(ooenv,
1216 AS_HELP_STRING([--disable-ooenv],
1217 [Disable ooenv for the instdir installation.]))
1219 libo_FUZZ_ARG_ENABLE(libnumbertext,
1220 AS_HELP_STRING([--disable-libnumbertext],
1221 [Disable use of numbertext external library.]))
1224 AS_HELP_STRING([--enable-lto],
1225 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1226 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1227 linker. For MSVC, this option is broken at the moment. This is experimental work
1228 in progress that shouldn't be used unless you are working on it.)]))
1230 AC_ARG_ENABLE(python,
1231 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1232 [Enables or disables Python support at run-time.
1233 Also specifies what Python to use. 'auto' is the default.
1234 'fully-internal' even forces the internal version for uses of Python
1235 during the build.]))
1237 libo_FUZZ_ARG_ENABLE(gtk3,
1238 AS_HELP_STRING([--disable-gtk3],
1239 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1240 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1242 AC_ARG_ENABLE(introspection,
1243 AS_HELP_STRING([--enable-introspection],
1244 [Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
1245 Linux distributions.)]))
1247 AC_ARG_ENABLE(split-app-modules,
1248 AS_HELP_STRING([--enable-split-app-modules],
1249 [Split file lists for app modules, e.g. base, calc.
1250 Has effect only with make distro-pack-install]),
1253 AC_ARG_ENABLE(split-opt-features,
1254 AS_HELP_STRING([--enable-split-opt-features],
1255 [Split file lists for some optional features, e.g. pyuno, testtool.
1256 Has effect only with make distro-pack-install]),
1259 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1260 AS_HELP_STRING([--disable-cairo-canvas],
1261 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1264 libo_FUZZ_ARG_ENABLE(dbus,
1265 AS_HELP_STRING([--disable-dbus],
1266 [Determines whether to enable features that depend on dbus.
1267 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1268 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1270 libo_FUZZ_ARG_ENABLE(sdremote,
1271 AS_HELP_STRING([--disable-sdremote],
1272 [Determines whether to enable Impress remote control (i.e. the server component).]),
1273 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1275 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1276 AS_HELP_STRING([--disable-sdremote-bluetooth],
1277 [Determines whether to build sdremote with bluetooth support.
1278 Requires dbus on Linux.]))
1280 libo_FUZZ_ARG_ENABLE(gio,
1281 AS_HELP_STRING([--disable-gio],
1282 [Determines whether to use the GIO support.]),
1283 ,test "${enable_gio+set}" = set || enable_gio=yes)
1286 AS_HELP_STRING([--enable-qt5],
1287 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1292 AS_HELP_STRING([--enable-kf5],
1293 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1294 KF5 are available.]),
1298 AS_HELP_STRING([--enable-kde5],
1299 [Compatibility switch for the kde5 => kf5 rename. Use --enable-kf5!])
1302 AC_ARG_ENABLE(gtk3_kde5,
1303 AS_HELP_STRING([--enable-gtk3-kde5],
1304 [Determines whether to use Gtk3 vclplug with KF5 file dialogs on
1305 platforms where Gtk3, Qt5 and Plasma is available.]),
1309 AS_HELP_STRING([--disable-gui],
1310 [Disable use of X11 or Wayland to reduce dependencies (e.g. for building LibreOfficeKit).]),
1313 libo_FUZZ_ARG_ENABLE(randr,
1314 AS_HELP_STRING([--disable-randr],
1315 [Disable RandR support in the vcl project.]),
1316 ,test "${enable_randr+set}" = set || enable_randr=yes)
1318 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1319 AS_HELP_STRING([--disable-gstreamer-1-0],
1320 [Disable building with the gstreamer 1.0 avmedia backend.]),
1321 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1323 libo_FUZZ_ARG_ENABLE(vlc,
1324 AS_HELP_STRING([--enable-vlc],
1325 [Enable building with the (experimental) VLC avmedia backend.]),
1326 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1328 libo_FUZZ_ARG_ENABLE(neon,
1329 AS_HELP_STRING([--disable-neon],
1330 [Disable neon and the compilation of webdav binding.]),
1333 libo_FUZZ_ARG_ENABLE([eot],
1334 [AS_HELP_STRING([--enable-eot],
1335 [Enable support for Embedded OpenType fonts.])],
1336 ,test "${enable_eot+set}" = set || enable_eot=no)
1338 libo_FUZZ_ARG_ENABLE(cve-tests,
1339 AS_HELP_STRING([--disable-cve-tests],
1340 [Prevent CVE tests to be executed]),
1343 libo_FUZZ_ARG_ENABLE(chart-tests,
1344 AS_HELP_STRING([--enable-chart-tests],
1345 [Executes chart XShape tests. In a perfect world these tests would be
1346 stable and everyone could run them, in reality it is best to run them
1347 only on a few machines that are known to work and maintained by people
1348 who can judge if a test failure is a regression or not.]),
1351 AC_ARG_ENABLE(build-unowinreg,
1352 AS_HELP_STRING([--enable-build-unowinreg],
1353 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1354 compiler is needed on Linux.]),
1357 AC_ARG_ENABLE(build-opensymbol,
1358 AS_HELP_STRING([--enable-build-opensymbol],
1359 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1360 fontforge installed.]),
1363 AC_ARG_ENABLE(dependency-tracking,
1364 AS_HELP_STRING([--enable-dependency-tracking],
1365 [Do not reject slow dependency extractors.])[
1366 --disable-dependency-tracking
1367 Disables generation of dependency information.
1368 Speed up one-time builds.],
1371 AC_ARG_ENABLE(icecream,
1372 AS_HELP_STRING([--enable-icecream],
1373 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1374 It defaults to /opt/icecream for the location of the icecream gcc/g++
1375 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1379 AS_HELP_STRING([--enable-ld=<linker>],
1380 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1381 By default tries to use the best linker possible, use --disable-ld to use the default linker.]),
1384 libo_FUZZ_ARG_ENABLE(cups,
1385 AS_HELP_STRING([--disable-cups],
1386 [Do not build cups support.])
1389 AC_ARG_ENABLE(ccache,
1390 AS_HELP_STRING([--disable-ccache],
1391 [Do not try to use ccache automatically.
1392 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1393 CC/CXX are not yet set, and --enable-icecream is not given, we
1394 attempt to use ccache. --disable-ccache disables ccache completely.
1395 Additionally ccache's depend mode is enabled if possible,
1396 use --enable-ccache=nodepend to enable ccache without depend mode.
1400 AC_ARG_ENABLE(64-bit,
1401 AS_HELP_STRING([--enable-64-bit],
1402 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1403 At the moment meaningful only for Windows.]), ,)
1405 libo_FUZZ_ARG_ENABLE(online-update,
1406 AS_HELP_STRING([--enable-online-update],
1407 [Enable the online update service that will check for new versions of
1408 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1409 If the value is "mar", the experimental Mozilla-like update will be
1410 enabled instead of the traditional update mechanism.]),
1413 AC_ARG_WITH(update-config,
1414 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1415 [Path to the update config ini file]))
1417 libo_FUZZ_ARG_ENABLE(extension-update,
1418 AS_HELP_STRING([--disable-extension-update],
1419 [Disable possibility to update installed extensions.]),
1422 libo_FUZZ_ARG_ENABLE(release-build,
1423 AS_HELP_STRING([--enable-release-build],
1424 [Enable release build. Note that the "release build" choice is orthogonal to
1425 whether symbols are present, debug info is generated, or optimization
1427 See http://wiki.documentfoundation.org/Development/DevBuild]),
1430 AC_ARG_ENABLE(windows-build-signing,
1431 AS_HELP_STRING([--enable-windows-build-signing],
1432 [Enable signing of windows binaries (*.exe, *.dll)]),
1435 AC_ARG_ENABLE(silent-msi,
1436 AS_HELP_STRING([--enable-silent-msi],
1437 [Enable MSI with LIMITUI=1 (silent install).]),
1440 AC_ARG_ENABLE(macosx-code-signing,
1441 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1442 [Sign executables, dylibs, frameworks and the app bundle. If you
1443 don't provide an identity the first suitable certificate
1444 in your keychain is used.]),
1447 AC_ARG_ENABLE(macosx-package-signing,
1448 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1449 [Create a .pkg suitable for uploading to the Mac App Store and sign
1450 it. If you don't provide an identity the first suitable certificate
1451 in your keychain is used.]),
1454 AC_ARG_ENABLE(macosx-sandbox,
1455 AS_HELP_STRING([--enable-macosx-sandbox],
1456 [Make the app bundle run in a sandbox. Requires code signing.
1457 Is required by apps distributed in the Mac App Store, and implies
1458 adherence to App Store rules.]),
1461 AC_ARG_WITH(macosx-bundle-identifier,
1462 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1463 [Define the macOS bundle identifier. Default is the somewhat weird
1464 org.libreoffice.script ("script", huh?).]),
1465 ,with_macosx_bundle_identifier=org.libreoffice.script)
1467 AC_ARG_WITH(product-name,
1468 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1469 [Define the product name. Default is AC_PACKAGE_NAME.]),
1470 ,with_product_name=$PRODUCTNAME)
1472 AC_ARG_WITH(package-version,
1473 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1474 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1477 libo_FUZZ_ARG_ENABLE(readonly-installset,
1478 AS_HELP_STRING([--enable-readonly-installset],
1479 [Prevents any attempts by LibreOffice to write into its installation. That means
1480 at least that no "system-wide" extensions can be added. Partly experimental work in
1481 progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
1484 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1485 AS_HELP_STRING([--disable-postgresql-sdbc],
1486 [Disable the build of the PostgreSQL-SDBC driver.])
1489 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1490 AS_HELP_STRING([--disable-lotuswordpro],
1491 [Disable the build of the Lotus Word Pro filter.]),
1492 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1494 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1495 AS_HELP_STRING([--disable-firebird-sdbc],
1496 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1497 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1499 AC_ARG_ENABLE(bogus-pkg-config,
1500 AS_HELP_STRING([--enable-bogus-pkg-config],
1501 [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.]),
1504 AC_ARG_ENABLE(openssl,
1505 AS_HELP_STRING([--disable-openssl],
1506 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1507 components will either use GNUTLS or NSS. Work in progress,
1508 use only if you are hacking on it.]),
1509 ,enable_openssl=yes)
1511 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1512 AS_HELP_STRING([--enable-cipher-openssl-backend],
1513 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1514 Requires --enable-openssl.]))
1516 AC_ARG_ENABLE(library-bin-tar,
1517 AS_HELP_STRING([--enable-library-bin-tar],
1518 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1519 Some libraries can save their build result in a tarball
1520 stored in TARFILE_LOCATION. That binary tarball is
1521 uniquely identified by the source tarball,
1522 the content of the config_host.mk file and the content
1523 of the top-level directory in core for that library
1524 If this option is enabled, then if such a tarfile exist, it will be untarred
1525 instead of the source tarfile, and the build step will be skipped for that
1527 If a proper tarfile does not exist, then the normal source-based
1528 build is done for that library and a proper binary tarfile is created
1529 for the next time.]),
1532 AC_ARG_ENABLE(dconf,
1533 AS_HELP_STRING([--disable-dconf],
1534 [Disable the dconf configuration backend (enabled by default where
1537 libo_FUZZ_ARG_ENABLE(formula-logger,
1539 [--enable-formula-logger],
1540 [Enable formula logger for logging formula calculation flow in Calc.]
1545 AS_HELP_STRING([--disable-ldap],
1546 [Disable LDAP support.]),
1549 dnl ===================================================================
1550 dnl Optional Packages (--with/without-)
1551 dnl ===================================================================
1553 AC_ARG_WITH(gcc-home,
1554 AS_HELP_STRING([--with-gcc-home],
1555 [Specify the location of gcc/g++ manually. This can be used in conjunction
1556 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1557 non-default path.]),
1560 AC_ARG_WITH(gnu-patch,
1561 AS_HELP_STRING([--with-gnu-patch],
1562 [Specify location of GNU patch on Solaris or FreeBSD.]),
1565 AC_ARG_WITH(build-platform-configure-options,
1566 AS_HELP_STRING([--with-build-platform-configure-options],
1567 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1571 AS_HELP_STRING([--with-gnu-cp],
1572 [Specify location of GNU cp on Solaris or FreeBSD.]),
1575 AC_ARG_WITH(external-tar,
1576 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1577 [Specify an absolute path of where to find (and store) tarfiles.]),
1578 TARFILE_LOCATION=$withval ,
1581 AC_ARG_WITH(referenced-git,
1582 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1583 [Specify another checkout directory to reference. This makes use of
1584 git submodule update --reference, and saves a lot of diskspace
1585 when having multiple trees side-by-side.]),
1586 GIT_REFERENCE_SRC=$withval ,
1589 AC_ARG_WITH(linked-git,
1590 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1591 [Specify a directory where the repositories of submodules are located.
1592 This uses a method similar to git-new-workdir to get submodules.]),
1593 GIT_LINK_SRC=$withval ,
1596 AC_ARG_WITH(galleries,
1597 AS_HELP_STRING([--with-galleries],
1598 [Specify how galleries should be built. It is possible either to
1599 build these internally from source ("build"),
1600 or to disable them ("no")]),
1604 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1605 [Choose which themes to include. By default those themes with an '*' are included.
1606 Possible choices: *breeze, *breeze_dark, *breeze_dark_svg, *breeze_svg, *colibre, *colibre_svg, *elementary,
1607 *elementary_svg, *karasa_jaga, *karasa_jaga_svg, *sifr, *sifr_dark, *sifr_dark_svg, *sifr_svg, *tango.]),
1610 libo_FUZZ_ARG_WITH(helppack-integration,
1611 AS_HELP_STRING([--without-helppack-integration],
1612 [It will not integrate the helppacks to the installer
1613 of the product. Please use this switch to use the online help
1614 or separate help packages.]),
1617 libo_FUZZ_ARG_WITH(fonts,
1618 AS_HELP_STRING([--without-fonts],
1619 [LibreOffice includes some third-party fonts to provide a reliable basis for
1620 help content, templates, samples, etc. When these fonts are already
1621 known to be available on the system then you should use this option.]),
1624 AC_ARG_ENABLE(noto-font,
1625 AS_HELP_STRING([--enable-noto-font],
1626 [Add more Google Noto fonts.]),
1630 AS_HELP_STRING([--with-epm],
1631 [Decides which epm to use. Default is to use the one from the system if
1632 one is built. When either this is not there or you say =internal epm
1636 AC_ARG_WITH(package-format,
1637 AS_HELP_STRING([--with-package-format],
1638 [Specify package format(s) for LibreOffice installation sets. The
1639 implicit --without-package-format leads to no installation sets being
1640 generated. Possible values: aix, archive, bsd, deb, dmg,
1641 installed, msi, pkg, and rpm.
1642 Example: --with-package-format='deb rpm']),
1646 AS_HELP_STRING([--with-tls],
1647 [Decides which TLS/SSL and cryptographic implementations to use for
1648 LibreOffice's code. Notice that this doesn't apply for depending
1649 libraries like "neon", for example. Default is to use OpenSSL
1650 although NSS is also possible. Notice that selecting NSS restricts
1651 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1652 restrict by now the usage of NSS in LO's code. Possible values:
1653 openssl, nss. Example: --with-tls="nss"]),
1656 AC_ARG_WITH(system-libs,
1657 AS_HELP_STRING([--with-system-libs],
1658 [Use libraries already on system -- enables all --with-system-* flags.]),
1661 AC_ARG_WITH(system-bzip2,
1662 AS_HELP_STRING([--with-system-bzip2],
1663 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1664 [with_system_bzip2="$with_system_libs"])
1666 AC_ARG_WITH(system-headers,
1667 AS_HELP_STRING([--with-system-headers],
1668 [Use headers already on system -- enables all --with-system-* flags for
1669 external packages whose headers are the only entities used i.e.
1670 boost/odbc/sane-header(s).]),,
1671 [with_system_headers="$with_system_libs"])
1673 AC_ARG_WITH(system-jars,
1674 AS_HELP_STRING([--without-system-jars],
1675 [When building with --with-system-libs, also the needed jars are expected
1676 on the system. Use this to disable that]),,
1677 [with_system_jars="$with_system_libs"])
1679 AC_ARG_WITH(system-cairo,
1680 AS_HELP_STRING([--with-system-cairo],
1681 [Use cairo libraries already on system. Happens automatically for
1682 (implicit) --enable-gtk3.]))
1684 AC_ARG_WITH(system-epoxy,
1685 AS_HELP_STRING([--with-system-epoxy],
1686 [Use epoxy libraries already on system. Happens automatically for
1687 (implicit) --enable-gtk3.]),,
1688 [with_system_epoxy="$with_system_libs"])
1690 AC_ARG_WITH(myspell-dicts,
1691 AS_HELP_STRING([--with-myspell-dicts],
1692 [Adds myspell dictionaries to the LibreOffice installation set]),
1695 AC_ARG_WITH(system-dicts,
1696 AS_HELP_STRING([--without-system-dicts],
1697 [Do not use dictionaries from system paths.]),
1700 AC_ARG_WITH(external-dict-dir,
1701 AS_HELP_STRING([--with-external-dict-dir],
1702 [Specify external dictionary dir.]),
1705 AC_ARG_WITH(external-hyph-dir,
1706 AS_HELP_STRING([--with-external-hyph-dir],
1707 [Specify external hyphenation pattern dir.]),
1710 AC_ARG_WITH(external-thes-dir,
1711 AS_HELP_STRING([--with-external-thes-dir],
1712 [Specify external thesaurus dir.]),
1715 AC_ARG_WITH(system-zlib,
1716 AS_HELP_STRING([--with-system-zlib],
1717 [Use zlib already on system.]),,
1718 [with_system_zlib=auto])
1720 AC_ARG_WITH(system-jpeg,
1721 AS_HELP_STRING([--with-system-jpeg],
1722 [Use jpeg already on system.]),,
1723 [with_system_jpeg="$with_system_libs"])
1725 AC_ARG_WITH(system-clucene,
1726 AS_HELP_STRING([--with-system-clucene],
1727 [Use clucene already on system.]),,
1728 [with_system_clucene="$with_system_libs"])
1730 AC_ARG_WITH(system-expat,
1731 AS_HELP_STRING([--with-system-expat],
1732 [Use expat already on system.]),,
1733 [with_system_expat="$with_system_libs"])
1735 AC_ARG_WITH(system-libxml,
1736 AS_HELP_STRING([--with-system-libxml],
1737 [Use libxml/libxslt already on system.]),,
1738 [with_system_libxml=auto])
1740 AC_ARG_WITH(system-icu,
1741 AS_HELP_STRING([--with-system-icu],
1742 [Use icu already on system.]),,
1743 [with_system_icu="$with_system_libs"])
1745 AC_ARG_WITH(system-ucpp,
1746 AS_HELP_STRING([--with-system-ucpp],
1747 [Use ucpp already on system.]),,
1750 AC_ARG_WITH(system-openldap,
1751 AS_HELP_STRING([--with-system-openldap],
1752 [Use the OpenLDAP LDAP SDK already on system.]),,
1753 [with_system_openldap="$with_system_libs"])
1755 libo_FUZZ_ARG_ENABLE(poppler,
1756 AS_HELP_STRING([--disable-poppler],
1757 [Disable building Poppler.])
1760 AC_ARG_WITH(system-poppler,
1761 AS_HELP_STRING([--with-system-poppler],
1762 [Use system poppler (only needed for PDF import).]),,
1763 [with_system_poppler="$with_system_libs"])
1765 AC_ARG_WITH(system-gpgmepp,
1766 AS_HELP_STRING([--with-system-gpgmepp],
1767 [Use gpgmepp already on system]),,
1768 [with_system_gpgmepp="$with_system_libs"])
1770 AC_ARG_WITH(system-apache-commons,
1771 AS_HELP_STRING([--with-system-apache-commons],
1772 [Use Apache commons libraries already on system.]),,
1773 [with_system_apache_commons="$with_system_jars"])
1775 AC_ARG_WITH(system-mariadb,
1776 AS_HELP_STRING([--with-system-mariadb],
1777 [Use MariaDB/MySQL libraries already on system.]),,
1778 [with_system_mariadb="$with_system_libs"])
1780 AC_ARG_ENABLE(bundle-mariadb,
1781 AS_HELP_STRING([--enable-bundle-mariadb],
1782 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
1785 AC_ARG_WITH(system-postgresql,
1786 AS_HELP_STRING([--with-system-postgresql],
1787 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1788 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1789 [with_system_postgresql="$with_system_libs"])
1791 AC_ARG_WITH(libpq-path,
1792 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1793 [Use this PostgreSQL C interface (libpq) installation for building
1794 the PostgreSQL-SDBC extension.]),
1797 AC_ARG_WITH(system-firebird,
1798 AS_HELP_STRING([--with-system-firebird],
1799 [Use Firebird libraries already on system, for building the Firebird-SDBC
1800 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1801 [with_system_firebird="$with_system_libs"])
1803 AC_ARG_WITH(system-libtommath,
1804 AS_HELP_STRING([--with-system-libtommath],
1805 [Use libtommath already on system]),,
1806 [with_system_libtommath="$with_system_libs"])
1808 AC_ARG_WITH(system-hsqldb,
1809 AS_HELP_STRING([--with-system-hsqldb],
1810 [Use hsqldb already on system.]))
1812 AC_ARG_WITH(hsqldb-jar,
1813 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1814 [Specify path to jarfile manually.]),
1815 HSQLDB_JAR=$withval)
1817 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1818 AS_HELP_STRING([--disable-scripting-beanshell],
1819 [Disable support for scripts in BeanShell.]),
1823 AC_ARG_WITH(system-beanshell,
1824 AS_HELP_STRING([--with-system-beanshell],
1825 [Use beanshell already on system.]),,
1826 [with_system_beanshell="$with_system_jars"])
1828 AC_ARG_WITH(beanshell-jar,
1829 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1830 [Specify path to jarfile manually.]),
1833 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1834 AS_HELP_STRING([--disable-scripting-javascript],
1835 [Disable support for scripts in JavaScript.]),
1839 AC_ARG_WITH(system-rhino,
1840 AS_HELP_STRING([--with-system-rhino],
1841 [Use rhino already on system.]),,)
1842 # [with_system_rhino="$with_system_jars"])
1843 # Above is not used as we have different debug interface
1844 # patched into internal rhino. This code needs to be fixed
1845 # before we can enable it by default.
1847 AC_ARG_WITH(rhino-jar,
1848 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1849 [Specify path to jarfile manually.]),
1852 AC_ARG_WITH(commons-logging-jar,
1853 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1854 [Specify path to jarfile manually.]),
1855 COMMONS_LOGGING_JAR=$withval)
1857 AC_ARG_WITH(system-jfreereport,
1858 AS_HELP_STRING([--with-system-jfreereport],
1859 [Use JFreeReport already on system.]),,
1860 [with_system_jfreereport="$with_system_jars"])
1862 AC_ARG_WITH(sac-jar,
1863 AS_HELP_STRING([--with-sac-jar=JARFILE],
1864 [Specify path to jarfile manually.]),
1867 AC_ARG_WITH(libxml-jar,
1868 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1869 [Specify path to jarfile manually.]),
1870 LIBXML_JAR=$withval)
1872 AC_ARG_WITH(flute-jar,
1873 AS_HELP_STRING([--with-flute-jar=JARFILE],
1874 [Specify path to jarfile manually.]),
1877 AC_ARG_WITH(jfreereport-jar,
1878 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1879 [Specify path to jarfile manually.]),
1880 JFREEREPORT_JAR=$withval)
1882 AC_ARG_WITH(liblayout-jar,
1883 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1884 [Specify path to jarfile manually.]),
1885 LIBLAYOUT_JAR=$withval)
1887 AC_ARG_WITH(libloader-jar,
1888 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1889 [Specify path to jarfile manually.]),
1890 LIBLOADER_JAR=$withval)
1892 AC_ARG_WITH(libformula-jar,
1893 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1894 [Specify path to jarfile manually.]),
1895 LIBFORMULA_JAR=$withval)
1897 AC_ARG_WITH(librepository-jar,
1898 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1899 [Specify path to jarfile manually.]),
1900 LIBREPOSITORY_JAR=$withval)
1902 AC_ARG_WITH(libfonts-jar,
1903 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1904 [Specify path to jarfile manually.]),
1905 LIBFONTS_JAR=$withval)
1907 AC_ARG_WITH(libserializer-jar,
1908 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1909 [Specify path to jarfile manually.]),
1910 LIBSERIALIZER_JAR=$withval)
1912 AC_ARG_WITH(libbase-jar,
1913 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1914 [Specify path to jarfile manually.]),
1915 LIBBASE_JAR=$withval)
1917 AC_ARG_WITH(system-odbc,
1918 AS_HELP_STRING([--with-system-odbc],
1919 [Use the odbc headers already on system.]),,
1920 [with_system_odbc="auto"])
1922 AC_ARG_WITH(system-sane,
1923 AS_HELP_STRING([--with-system-sane],
1924 [Use sane.h already on system.]),,
1925 [with_system_sane="$with_system_headers"])
1927 AC_ARG_WITH(system-bluez,
1928 AS_HELP_STRING([--with-system-bluez],
1929 [Use bluetooth.h already on system.]),,
1930 [with_system_bluez="$with_system_headers"])
1932 AC_ARG_WITH(system-curl,
1933 AS_HELP_STRING([--with-system-curl],
1934 [Use curl already on system.]),,
1935 [with_system_curl=auto])
1937 AC_ARG_WITH(system-boost,
1938 AS_HELP_STRING([--with-system-boost],
1939 [Use boost already on system.]),,
1940 [with_system_boost="$with_system_headers"])
1942 AC_ARG_WITH(system-glm,
1943 AS_HELP_STRING([--with-system-glm],
1944 [Use glm already on system.]),,
1945 [with_system_glm="$with_system_headers"])
1947 AC_ARG_WITH(system-hunspell,
1948 AS_HELP_STRING([--with-system-hunspell],
1949 [Use libhunspell already on system.]),,
1950 [with_system_hunspell="$with_system_libs"])
1952 libo_FUZZ_ARG_ENABLE(qrcodegen,
1953 AS_HELP_STRING([--disable-qrcodegen],
1954 [Disable use of qrcodegen external library.]))
1956 AC_ARG_WITH(system-qrcodegen,
1957 AS_HELP_STRING([--with-system-qrcodegen],
1958 [Use libqrcodegen already on system.]),,
1959 [with_system_qrcodegen="$with_system_libs"])
1961 AC_ARG_WITH(system-mythes,
1962 AS_HELP_STRING([--with-system-mythes],
1963 [Use mythes already on system.]),,
1964 [with_system_mythes="$with_system_libs"])
1966 AC_ARG_WITH(system-altlinuxhyph,
1967 AS_HELP_STRING([--with-system-altlinuxhyph],
1968 [Use ALTLinuxhyph already on system.]),,
1969 [with_system_altlinuxhyph="$with_system_libs"])
1971 AC_ARG_WITH(system-lpsolve,
1972 AS_HELP_STRING([--with-system-lpsolve],
1973 [Use lpsolve already on system.]),,
1974 [with_system_lpsolve="$with_system_libs"])
1976 AC_ARG_WITH(system-coinmp,
1977 AS_HELP_STRING([--with-system-coinmp],
1978 [Use CoinMP already on system.]),,
1979 [with_system_coinmp="$with_system_libs"])
1981 AC_ARG_WITH(system-liblangtag,
1982 AS_HELP_STRING([--with-system-liblangtag],
1983 [Use liblangtag library already on system.]),,
1984 [with_system_liblangtag="$with_system_libs"])
1987 AS_HELP_STRING([--with-webdav],
1988 [Specify which library to use for webdav implementation.
1989 Possible values: "neon", "serf", "no". The default value is "neon".
1990 Example: --with-webdav="serf"]),
1991 WITH_WEBDAV=$withval,
1994 AC_ARG_WITH(linker-hash-style,
1995 AS_HELP_STRING([--with-linker-hash-style],
1996 [Use linker with --hash-style=<style> when linking shared objects.
1997 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1998 if supported on the build system, and "sysv" otherwise.]))
2000 AC_ARG_WITH(jdk-home,
2001 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
2002 [If you have installed JDK 8 or later on your system please supply the
2003 path here. Note that this is not the location of the java command but the
2004 location of the entire distribution.]),
2008 AS_HELP_STRING([--with-help],
2009 [Enable the build of help. There is a special parameter "common" that
2010 can be used to bundle only the common part, .e.g help-specific icons.
2011 This is useful when you build the helpcontent separately.])
2013 Usage: --with-help build the old local help
2014 --without-help no local help (default)
2015 --with-help=html build the new HTML local help
2016 --with-help=online build the new HTML online help
2020 AC_ARG_WITH(omindex,
2021 AS_HELP_STRING([--with-omindex],
2022 [Enable the support of xapian-omega index for online help.])
2024 Usage: --with-omindex=server prepare the pages for omindex
2025 but let xapian-omega be built in server.
2026 --with-omindex=noxap do not prepare online pages
2031 libo_FUZZ_ARG_WITH(java,
2032 AS_HELP_STRING([--with-java=<java command>],
2033 [Specify the name of the Java interpreter command. Typically "java"
2034 which is the default.
2036 To build without support for Java components, applets, accessibility
2037 or the XML filters written in Java, use --without-java or --with-java=no.]),
2038 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2039 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
2042 AC_ARG_WITH(jvm-path,
2043 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
2044 [Use a specific JVM search path at runtime.
2045 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2048 AC_ARG_WITH(ant-home,
2049 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2050 [If you have installed Apache Ant on your system, please supply the path here.
2051 Note that this is not the location of the Ant binary but the location
2052 of the entire distribution.]),
2055 AC_ARG_WITH(symbol-config,
2056 AS_HELP_STRING([--with-symbol-config],
2057 [Configuration for the crashreport symbol upload]),
2059 [with_symbol_config=no])
2061 AC_ARG_WITH(export-validation,
2062 AS_HELP_STRING([--without-export-validation],
2063 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2064 ,with_export_validation=auto)
2066 AC_ARG_WITH(bffvalidator,
2067 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2068 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2069 Requires installed Microsoft Office Binary File Format Validator.
2070 Note: export-validation (--with-export-validation) is required to be turned on.
2071 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2072 ,with_bffvalidator=no)
2074 libo_FUZZ_ARG_WITH(junit,
2075 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2076 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2077 --without-junit disables those tests. Not relevant in the --without-java case.]),
2080 AC_ARG_WITH(hamcrest,
2081 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2082 [Specifies the hamcrest 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(perl-home,
2087 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2088 [If you have installed Perl 5 Distribution, on your system, please
2089 supply the path here. Note that this is not the location of the Perl
2090 binary but the location of the entire distribution.]),
2093 libo_FUZZ_ARG_WITH(doxygen,
2095 [--with-doxygen=<absolute path to doxygen executable>],
2096 [Specifies the doxygen executable to use when generating ODK C/C++
2097 documentation. --without-doxygen disables generation of ODK C/C++
2098 documentation. Not relevant in the --disable-odk case.]),
2101 AC_ARG_WITH(visual-studio,
2102 AS_HELP_STRING([--with-visual-studio=<2017>],
2103 [Specify which Visual Studio version to use in case several are
2104 installed. Currently only 2017 is supported.]),
2107 AC_ARG_WITH(windows-sdk,
2108 AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10>],
2109 [Specify which Windows SDK, or "Windows Kit", version to use
2110 in case the one that came with the selected Visual Studio
2111 is not what you want for some reason. Note that not all compiler/SDK
2112 combinations are supported. The intent is that this option should not
2117 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2118 [Use this option to build LibreOffice with additional UI language support.
2119 English (US) is always included by default.
2120 Separate multiple languages with space.
2121 For all languages, use --with-lang=ALL.]),
2124 AC_ARG_WITH(locales,
2125 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2126 [Use this option to limit the locale information built in.
2127 Separate multiple locales with space.
2128 Very experimental and might well break stuff.
2129 Just a desperate measure to shrink code and data size.
2130 By default all the locales available is included.
2131 This option is completely unrelated to --with-lang.])
2133 Affects also our character encoding conversion
2134 tables for encodings mainly targeted for a
2135 particular locale, like EUC-CN and EUC-TW for
2136 zh, ISO-2022-JP for ja.
2138 Affects also our add-on break iterator data for
2141 For the default, all locales, don't use this switch at all.
2142 Specifying just the language part of a locale means all matching
2143 locales will be included.
2147 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2148 libo_FUZZ_ARG_WITH(krb5,
2149 AS_HELP_STRING([--with-krb5],
2150 [Enable MIT Kerberos 5 support in modules that support it.
2151 By default automatically enabled on platforms
2152 where a good system Kerberos 5 is available.]),
2155 libo_FUZZ_ARG_WITH(gssapi,
2156 AS_HELP_STRING([--with-gssapi],
2157 [Enable GSSAPI support in modules that support it.
2158 By default automatically enabled on platforms
2159 where a good system GSSAPI is available.]),
2163 AS_HELP_STRING([--with-iwyu],
2164 [Use given IWYU binary path to check unneeded includes instead of building.
2165 Use only if you are hacking on it.]),
2168 libo_FUZZ_ARG_WITH(lxml,
2169 AS_HELP_STRING([--without-lxml],
2170 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2171 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2172 report widget classes and ids.]),
2175 libo_FUZZ_ARG_WITH(latest-c++,
2176 AS_HELP_STRING([--with-latest-c++],
2177 [Try to enable the latest features of the C++ compiler, even if they are not yet part of a
2178 published standard.]),,
2179 [with_latest_c__=no])
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 disable extensions unless specifically overridden with --enable-extensions.
2575 if test $_os != iOS; 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 HAVE_MACOS_LD_PLATFORMVERSION=
2801 if test $_os = Darwin; then
2803 # If no --with-macosx-sdk option is given, look for one
2805 # The intent is that for "most" Mac-based developers, a suitable
2806 # SDK will be found automatically without any configure options.
2808 # For developers with a current Xcode, the lowest-numbered SDK
2809 # higher than or equal to the minimum required should be found.
2811 AC_MSG_CHECKING([what macOS SDK to use])
2812 for _macosx_sdk in ${with_macosx_sdk-10.15 10.14 10.13 10.12}; do
2813 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2814 if test -d "$MACOSX_SDK_PATH"; then
2815 with_macosx_sdk="${_macosx_sdk}"
2818 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2819 if test -d "$MACOSX_SDK_PATH"; then
2820 with_macosx_sdk="${_macosx_sdk}"
2825 if test ! -d "$MACOSX_SDK_PATH"; then
2826 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
2829 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2831 case $with_macosx_sdk in
2833 MACOSX_SDK_VERSION=101200
2836 MACOSX_SDK_VERSION=101300
2839 MACOSX_SDK_VERSION=101400
2842 MACOSX_SDK_VERSION=101500
2845 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--15])
2849 if test "$with_macosx_version_min_required" = "" ; then
2850 with_macosx_version_min_required="10.10";
2853 if test "$with_macosx_version_max_allowed" = "" ; then
2854 with_macosx_version_max_allowed="$with_macosx_sdk"
2857 # export this so that "xcrun" invocations later return matching values
2858 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2859 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2860 export DEVELOPER_DIR
2861 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2862 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2864 AC_MSG_CHECKING([whether Xcode is new enough])
2865 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
2866 my_xcode_ver2=${my_xcode_ver1#Xcode }
2867 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
2868 if test "$my_xcode_ver3" -ge 903; then
2869 AC_MSG_RESULT([yes ($my_xcode_ver2)])
2871 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 9.3])
2874 case "$with_macosx_version_min_required" in
2876 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2879 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2882 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2885 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2888 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
2891 MAC_OS_X_VERSION_MIN_REQUIRED="101500"
2894 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--15])
2897 MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
2899 LIBTOOL=/usr/bin/libtool
2900 INSTALL_NAME_TOOL=install_name_tool
2901 if test -z "$save_CC"; then
2902 stdlib=-stdlib=libc++
2903 if test "$ENABLE_LTO" = TRUE; then
2907 AC_MSG_CHECKING([what C compiler to use])
2908 CC="`xcrun -find clang`"
2909 CC_BASE=`first_arg_basename "$CC"`
2910 CC+=" -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2911 AC_MSG_RESULT([$CC])
2913 AC_MSG_CHECKING([what C++ compiler to use])
2914 CXX="`xcrun -find clang++`"
2915 CXX_BASE=`first_arg_basename "$CXX"`
2916 CXX+=" -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2917 AC_MSG_RESULT([$CXX])
2919 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2922 STRIP=`xcrun -find strip`
2923 LIBTOOL=`xcrun -find libtool`
2924 RANLIB=`xcrun -find ranlib`
2927 case "$with_macosx_version_max_allowed" in
2929 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2932 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2935 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2938 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2941 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
2944 MAC_OS_X_VERSION_MAX_ALLOWED="101500"
2947 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--15])
2951 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2952 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2953 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])
2958 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2959 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2960 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2964 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2965 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2967 AC_MSG_CHECKING([whether to do code signing])
2969 if test "$enable_macosx_code_signing" = yes; then
2970 # By default use the first suitable certificate (?).
2972 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2973 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2974 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2975 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2976 # "Developer ID Application" one.
2978 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2979 if test -n "$identity"; then
2980 MACOSX_CODESIGNING_IDENTITY=$identity
2981 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2982 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2984 AC_MSG_ERROR([cannot determine identity to use])
2986 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2987 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2988 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2989 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2994 AC_MSG_CHECKING([whether to create a Mac App Store package])
2996 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2997 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2998 elif test "$enable_macosx_package_signing" = yes; then
2999 # By default use the first suitable certificate.
3000 # It should be a "3rd Party Mac Developer Installer" one
3002 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
3003 if test -n "$identity"; then
3004 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
3005 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3006 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3008 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
3010 elif test -n "$enable_macosx_package_signing"; then
3011 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
3012 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3013 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3018 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
3019 AC_MSG_ERROR([You should not use the same identity for code and package signing])
3022 AC_MSG_CHECKING([whether to sandbox the application])
3024 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3025 AC_MSG_ERROR([macOS sandboxing requires code signing])
3026 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3027 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
3028 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3029 ENABLE_MACOSX_SANDBOX=TRUE
3030 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3031 AC_MSG_RESULT([yes])
3036 AC_MSG_CHECKING([what macOS app bundle identifier to use])
3037 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3038 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3040 AC_MSG_CHECKING([whether the linker supports -platform_version])
3041 save_LDFLAGS=$LDFLAGS
3042 LDFLAGS="$LDFLAGS -Xlinker -platform_version -Xlinker macos \
3043 -Xlinker $MAC_OS_X_VERSION_MIN_REQUIRED_DOTS -Xlinker 0.0.0"
3044 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
3045 [AC_MSG_RESULT([yes])
3046 HAVE_MACOS_LD_PLATFORMVERSION=TRUE],
3047 [AC_MSG_RESULT([no])])
3048 LDFLAGS=$save_LDFLAGS
3050 AC_SUBST(MACOSX_SDK_PATH)
3051 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3052 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3053 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
3054 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
3055 AC_SUBST(INSTALL_NAME_TOOL)
3056 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
3057 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3058 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3059 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3060 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3061 AC_SUBST(HAVE_MACOS_LD_PLATFORMVERSION)
3063 dnl ===================================================================
3064 dnl Check iOS SDK and compiler
3065 dnl ===================================================================
3067 if test $_os = iOS; then
3068 AC_MSG_CHECKING([what iOS SDK to use])
3069 current_sdk_ver=14.1
3070 older_sdk_vers="14.0 13.7 13.6 13.5 13.4 13.2 13.1 13.0 12.4 12.2"
3071 if test "$enable_ios_simulator" = "yes"; then
3072 platform=iPhoneSimulator
3073 versionmin=-mios-simulator-version-min=12.2
3076 versionmin=-miphoneos-version-min=12.2
3078 xcode_developer=`xcode-select -print-path`
3080 for sdkver in $current_sdk_ver $older_sdk_vers; do
3081 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3088 if test -z "$sysroot"; then
3089 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
3092 AC_MSG_RESULT($sysroot)
3094 # LTO is not really recommended for iOS builds,
3095 # the link time will be astronomical
3096 if test "$ENABLE_LTO" = TRUE; then
3100 stdlib="-stdlib=libc++"
3102 AC_MSG_CHECKING([what C compiler to use])
3103 CC="`xcrun -find clang`"
3104 CC_BASE=`first_arg_basename "$CC"`
3105 CC+=" -arch $host_cpu -isysroot $sysroot $lto $versionmin"
3106 AC_MSG_RESULT([$CC])
3108 AC_MSG_CHECKING([what C++ compiler to use])
3109 CXX="`xcrun -find clang++`"
3110 CXX_BASE=`first_arg_basename "$CXX"`
3111 CXX+=" -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
3112 AC_MSG_RESULT([$CXX])
3114 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3117 STRIP=`xcrun -find strip`
3118 LIBTOOL=`xcrun -find libtool`
3119 RANLIB=`xcrun -find ranlib`
3122 AC_MSG_CHECKING([whether to treat the installation as read-only])
3124 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3125 "$enable_extensions" != yes; then
3126 enable_readonly_installset=yes
3128 if test "$enable_readonly_installset" = yes; then
3129 AC_MSG_RESULT([yes])
3130 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3135 dnl ===================================================================
3136 dnl Structure of install set
3137 dnl ===================================================================
3139 if test $_os = Darwin; then
3140 LIBO_BIN_FOLDER=MacOS
3141 LIBO_ETC_FOLDER=Resources
3142 LIBO_LIBEXEC_FOLDER=MacOS
3143 LIBO_LIB_FOLDER=Frameworks
3144 LIBO_LIB_PYUNO_FOLDER=Resources
3145 LIBO_SHARE_FOLDER=Resources
3146 LIBO_SHARE_HELP_FOLDER=Resources/help
3147 LIBO_SHARE_JAVA_FOLDER=Resources/java
3148 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3149 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3150 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3151 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3152 LIBO_URE_BIN_FOLDER=MacOS
3153 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3154 LIBO_URE_LIB_FOLDER=Frameworks
3155 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3156 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3157 elif test $_os = WINNT; then
3158 LIBO_BIN_FOLDER=program
3159 LIBO_ETC_FOLDER=program
3160 LIBO_LIBEXEC_FOLDER=program
3161 LIBO_LIB_FOLDER=program
3162 LIBO_LIB_PYUNO_FOLDER=program
3163 LIBO_SHARE_FOLDER=share
3164 LIBO_SHARE_HELP_FOLDER=help
3165 LIBO_SHARE_JAVA_FOLDER=program/classes
3166 LIBO_SHARE_PRESETS_FOLDER=presets
3167 LIBO_SHARE_READMES_FOLDER=readmes
3168 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3169 LIBO_SHARE_SHELL_FOLDER=program/shell
3170 LIBO_URE_BIN_FOLDER=program
3171 LIBO_URE_ETC_FOLDER=program
3172 LIBO_URE_LIB_FOLDER=program
3173 LIBO_URE_MISC_FOLDER=program
3174 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3176 LIBO_BIN_FOLDER=program
3177 LIBO_ETC_FOLDER=program
3178 LIBO_LIBEXEC_FOLDER=program
3179 LIBO_LIB_FOLDER=program
3180 LIBO_LIB_PYUNO_FOLDER=program
3181 LIBO_SHARE_FOLDER=share
3182 LIBO_SHARE_HELP_FOLDER=help
3183 LIBO_SHARE_JAVA_FOLDER=program/classes
3184 LIBO_SHARE_PRESETS_FOLDER=presets
3185 LIBO_SHARE_READMES_FOLDER=readmes
3186 if test "$enable_fuzzers" != yes; then
3187 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3189 LIBO_SHARE_RESOURCE_FOLDER=resource
3191 LIBO_SHARE_SHELL_FOLDER=program/shell
3192 LIBO_URE_BIN_FOLDER=program
3193 LIBO_URE_ETC_FOLDER=program
3194 LIBO_URE_LIB_FOLDER=program
3195 LIBO_URE_MISC_FOLDER=program
3196 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3198 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3199 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3200 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3201 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3202 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3203 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3204 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3205 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3206 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3207 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3208 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3209 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3210 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3211 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3212 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3213 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3215 # Not all of them needed in config_host.mk, add more if need arises
3216 AC_SUBST(LIBO_BIN_FOLDER)
3217 AC_SUBST(LIBO_ETC_FOLDER)
3218 AC_SUBST(LIBO_LIB_FOLDER)
3219 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3220 AC_SUBST(LIBO_SHARE_FOLDER)
3221 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3222 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3223 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3224 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3225 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3226 AC_SUBST(LIBO_URE_BIN_FOLDER)
3227 AC_SUBST(LIBO_URE_ETC_FOLDER)
3228 AC_SUBST(LIBO_URE_LIB_FOLDER)
3229 AC_SUBST(LIBO_URE_MISC_FOLDER)
3230 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3232 dnl ===================================================================
3233 dnl Windows specific tests and stuff
3234 dnl ===================================================================
3238 # Return value: $regvalue
3241 local _regentry="/proc/registry${1}/${2}"
3242 if test -f "$_regentry"; then
3243 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3244 # Registry keys read via /proc/registry* are always \0 terminated!
3245 local _regvalue=$(tr -d '\0' < "$_regentry")
3246 if test $? -eq 0; then
3252 # Get a value from the 32-bit side of the Registry
3255 reg_get_value "32" "$1"
3258 # Get a value from the 64-bit side of the Registry
3261 reg_get_value "64" "$1"
3264 if test "$_os" = "WINNT"; then
3265 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3266 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3268 WINDOWS_SDK_ARCH="x86"
3270 AC_MSG_RESULT([yes])
3271 WINDOWS_SDK_ARCH="x64"
3275 AC_SUBST(WINDOWS_SDK_ARCH)
3276 if test "$_os" = "iOS"; then
3277 cross_compiling="yes"
3280 if test "$cross_compiling" = "yes"; then
3281 export CROSS_COMPILING=TRUE
3284 BUILD_TYPE="$BUILD_TYPE NATIVE"
3286 AC_SUBST(CROSS_COMPILING)
3288 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3289 # NOTE: must _not_ be used for bundled external libraries!
3291 if test "$GCC" = "yes"; then
3292 AC_MSG_CHECKING( for -isystem )
3294 CFLAGS="$CFLAGS -Werror"
3295 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3297 if test -n "$ISYSTEM"; then
3303 if test -z "$ISYSTEM"; then
3304 # fall back to using -I
3309 dnl ===================================================================
3310 dnl Check which Visual Studio compiler is used
3311 dnl ===================================================================
3313 map_vs_year_to_version()
3315 # Return value: $vsversion
3325 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3329 vs_versions_to_check()
3331 # Args: $1 (optional) : versions to check, in the order of preference
3332 # Return value: $vsversions
3336 if test -n "$1"; then
3337 map_vs_year_to_version "$1"
3338 vsversions=$vsversion
3340 # We accept only 2017
3345 win_get_env_from_vsvars32bat()
3347 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3348 # Also seems to be located in another directory under the same name: vsvars32.bat
3349 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3350 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3351 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3352 chmod +x $WRAPPERBATCHFILEPATH
3353 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3354 rm -f $WRAPPERBATCHFILEPATH
3355 printf '%s' "$_win_get_env_from_vsvars32bat"
3360 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3361 if test -n "$regvalue"; then
3362 PathFormat "$regvalue"
3363 UCRTSDKDIR=$formatted_path
3364 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3365 UCRTVERSION=$regvalue
3367 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3371 if test -z "$UCRTSDKDIR"; then
3372 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3373 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3374 if test -f "$ide_env_file"; then
3375 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3376 UCRTSDKDIR=$formatted_path
3377 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3378 dnl Hack needed at least by tml:
3379 if test "$UCRTVERSION" = 10.0.15063.0 \
3380 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3381 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3383 UCRTVERSION=10.0.14393.0
3386 AC_MSG_ERROR([No UCRT found])
3393 # Find Visual C++ 2017/2019
3394 # Args: $1 (optional) : The VS version year
3395 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3397 unset vctest vcnum vcnumwithdot vcbuildnumber
3399 vs_versions_to_check "$1"
3400 vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
3401 vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
3402 PathFormat "$vswhere"
3403 vswhere=$formatted_path
3404 for ver in $vsversions; do
3405 vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
3406 if test -n "$vswhereoutput"; then
3407 PathFormat "$vswhereoutput"
3408 vctest=$formatted_path
3413 # This fallback is needed on *some* (but not all) VS 2017 installations, where vswhere turns up
3414 # with the empty list for unclear reason. The below hack does not work for VS 2019 anyway, so
3415 # should be removed when upgrading baseline.
3416 if ! test -n "$vctest"; then
3417 for ver in $vsversions; do
3418 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver.0/Setup/VC/ProductDir
3419 if test -n "$regvalue"; then
3423 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver.0
3424 if test -n "$regvalue"; then
3425 AC_MSG_RESULT([found: $regvalue])
3426 PathFormat "$regvalue"
3427 vctest=$formatted_path
3433 if test -n "$vctest"; then
3434 vcnumwithdot="$ver.0"
3435 case "$vcnumwithdot" in
3445 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3453 if test "$_os" = "WINNT"; then
3454 AC_MSG_CHECKING([Visual C++])
3455 find_msvc "$with_visual_studio"
3456 if test -z "$vctest"; then
3457 if test -n "$with_visual_studio"; then
3458 AC_MSG_ERROR([no Visual Studio $with_visual_studio installation found])
3460 AC_MSG_ERROR([no Visual Studio 2017 installation found])
3464 if test "$BITNESS_OVERRIDE" = ""; then
3465 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3466 VC_PRODUCT_DIR=$vctest/VC
3468 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86])
3471 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3472 VC_PRODUCT_DIR=$vctest/VC
3474 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64])
3477 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3479 AC_MSG_CHECKING([for short pathname of VC product directory])
3480 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3481 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3486 AC_MSG_CHECKING([for UCRT location])
3488 # find_ucrt errors out if it doesn't find it
3489 AC_MSG_RESULT([found])
3490 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3491 ucrtincpath_formatted=$formatted_path
3492 # SOLARINC is used for external modules and must be set too.
3493 # And no, it's not sufficient to set SOLARINC only, as configure
3494 # itself doesn't honour it.
3495 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3496 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3497 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3498 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3500 AC_SUBST(UCRTSDKDIR)
3501 AC_SUBST(UCRTVERSION)
3503 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3504 # Find the proper version of MSBuild.exe to use based on the VS version
3505 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3506 if test -n "$regvalue" ; then
3507 AC_MSG_RESULT([found: $regvalue])
3508 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3510 if test "$vcnumwithdot" = "16.0"; then
3511 if test "$BITNESS_OVERRIDE" = ""; then
3512 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
3514 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
3517 if test "$BITNESS_OVERRIDE" = ""; then
3518 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3520 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3523 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3524 AC_MSG_RESULT([$regvalue])
3527 # Find the version of devenv.exe
3528 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3529 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3530 if test ! -e "$DEVENV"; then
3531 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3534 dnl ===========================================================
3535 dnl Check for the corresponding mspdb*.dll
3536 dnl ===========================================================
3542 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3543 VC_HOST_DIR="HostX64"
3544 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3546 VC_HOST_DIR="HostX86"
3547 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3550 if test "$BITNESS_OVERRIDE" = ""; then
3551 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3553 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3556 # MSVC 15.0 has libraries from 14.0?
3559 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3560 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3563 dnl The path needs to be added before cl is called
3564 TEMP_PATH=`cygpath -d "$MSPDB_PATH"`
3565 PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
3567 AC_MSG_CHECKING([cl.exe])
3569 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3570 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3571 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3574 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3575 dnl needed when building CLR code:
3576 if test -z "$MSVC_CXX"; then
3577 if test -f "$CL_PATH/cl.exe"; then
3578 MSVC_CXX="$CL_PATH/cl.exe"
3581 # This gives us a posix path with 8.3 filename restrictions
3582 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3585 if test -z "$CC"; then
3587 CC_BASE=`first_arg_basename "$CC"`
3589 if test "$BITNESS_OVERRIDE" = ""; then
3590 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3591 MSVC_CXX="$MSVC_CXX -arch:SSE"
3593 if test -z "$CXX"; then
3595 CXX_BASE=`first_arg_basename "$CXX"`
3598 if test -n "$CC"; then
3599 # Remove /cl.exe from CC case insensitive
3600 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3601 if test "$BITNESS_OVERRIDE" = ""; then
3602 COMPATH="$VC_PRODUCT_DIR"
3604 if test -n "$VC_PRODUCT_DIR"; then
3605 COMPATH=$VC_PRODUCT_DIR
3608 if test "$BITNESS_OVERRIDE" = ""; then
3609 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3613 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3615 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3617 PathFormat "$COMPATH"
3618 COMPATH=`win_short_path_for_make "$formatted_path"`
3623 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3624 # are always "better", we list them in reverse chronological order.
3628 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
3632 # The expectation is that --with-windows-sdk should not need to be used
3633 if test -n "$with_windows_sdk"; then
3634 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3635 *" "$with_windows_sdk" "*)
3636 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3639 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3644 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3649 AC_MSG_ERROR([Visual C++ not found after all, huh])
3652 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2017 version 15.7])
3653 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3654 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
3655 // between Visual Studio versions and _MSC_VER:
3659 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
3661 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3662 # version of the Explorer extension (and maybe other small
3663 # bits, too) needed when installing a 32-bit LibreOffice on a
3664 # 64-bit OS. The 64-bit Explorer extension is a feature that
3665 # has been present since long in OOo. Don't confuse it with
3666 # building LibreOffice itself as 64-bit code.
3671 if test "$BITNESS_OVERRIDE" = ""; then
3672 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3673 if test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib" || \
3674 test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/spectre/x64/atls.lib"; then
3675 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3677 CXX_X64_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe"`
3680 if test "$BUILD_X64" = TRUE; then
3681 AC_MSG_RESULT([found])
3683 AC_MSG_RESULT([not found])
3684 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3691 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3692 AC_SUBST(CXX_X64_BINARY)
3694 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
3695 # needed to support TWAIN scan on both 32- and 64-bit systems
3699 if test "$BITNESS_OVERRIDE" = "64"; then
3700 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
3701 if test -n "$CXX_X86_BINARY"; then
3703 AC_MSG_RESULT([preset])
3704 elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then
3706 CXX_X86_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe"`
3707 CXX_X86_BINARY+=" /arch:SSE"
3708 AC_MSG_RESULT([found])
3711 AC_MSG_RESULT([not found])
3712 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
3716 CXX_X86_BINARY=$MSVC_CXX
3719 AC_SUBST(CXX_X86_BINARY)
3728 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3729 AC_SUBST(UNOWINREG_DLL)
3732 AC_MSG_CHECKING([whether the compiler is actually Clang])
3733 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3739 [AC_MSG_RESULT([yes])
3741 [AC_MSG_RESULT([no])])
3742 AC_SUBST(COM_IS_CLANG)
3746 if test "$COM_IS_CLANG" = TRUE; then
3747 AC_MSG_CHECKING([whether Clang is new enough])
3748 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3749 #if !defined __apple_build_version__
3753 [my_apple_clang=yes],[my_apple_clang=])
3754 if test "$my_apple_clang" = yes; then
3755 AC_MSG_RESULT([assumed yes (Apple Clang)])
3757 if test "$_os" = WINNT; then
3758 dnl In which case, assume clang-cl:
3760 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3768 CC_PLAIN="$CC_PLAIN $i"
3775 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args - | sed 's/ //g'`
3776 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3777 CLANGVER=`echo $clang_version \
3778 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3779 if test "$CLANGVER" -ge 50002; then
3780 AC_MSG_RESULT([yes ($clang_version)])
3782 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
3784 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3785 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3789 SHOWINCLUDES_PREFIX=
3790 if test "$_os" = WINNT; then
3791 dnl We need to guess the prefix of the -showIncludes output, it can be
3793 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3794 echo "#include <stdlib.h>" > conftest.c
3795 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3796 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3797 rm -f conftest.c conftest.obj
3798 if test -z "$SHOWINCLUDES_PREFIX"; then
3799 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3801 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3804 AC_SUBST(SHOWINCLUDES_PREFIX)
3807 # prefix C with ccache if needed
3809 if test "$CCACHE" != ""; then
3810 AC_MSG_CHECKING([whether $CC_BASE is already ccached])
3814 CFLAGS="$CFLAGS --ccache-skip -O2"
3815 dnl an empty program will do, we're checking the compiler flags
3816 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3817 [use_ccache=yes], [use_ccache=no])
3818 if test $use_ccache = yes; then
3819 AC_MSG_RESULT([yes])
3822 CC_BASE="ccache $CC_BASE"
3829 # ===================================================================
3830 # check various GCC options that Clang does not support now but maybe
3831 # will somewhen in the future, check them even for GCC, so that the
3833 # ===================================================================
3836 if test "$GCC" = "yes"; then
3837 AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
3839 CFLAGS="$CFLAGS -Werror -ggdb2"
3840 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3842 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3843 AC_MSG_RESULT([yes])
3848 if test "$host_cpu" = "m68k"; then
3849 AC_MSG_CHECKING([whether $CC_BASE supports -mlong-jump-table-offsets])
3851 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3852 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3854 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3855 AC_MSG_RESULT([yes])
3861 AC_SUBST(HAVE_GCC_GGDB2)
3863 dnl ===================================================================
3864 dnl Test the gcc version
3865 dnl ===================================================================
3866 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3867 AC_MSG_CHECKING([the GCC version])
3868 _gcc_version=`$CC -dumpversion`
3869 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3870 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3871 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3873 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3875 if test "$gcc_full_version" -lt 70000; then
3876 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 7.0.0])
3879 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3880 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3881 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3882 # (which reports itself as GCC 4.2.1).
3885 AC_SUBST(GCC_VERSION)
3887 dnl Set the ENABLE_DBGUTIL variable
3888 dnl ===================================================================
3889 AC_MSG_CHECKING([whether to build with additional debug utilities])
3890 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3891 ENABLE_DBGUTIL="TRUE"
3892 # this is an extra var so it can have different default on different MSVC
3893 # versions (in case there are version specific problems with it)
3894 MSVC_USE_DEBUG_RUNTIME="TRUE"
3896 AC_MSG_RESULT([yes])
3897 # cppunit and graphite expose STL in public headers
3898 if test "$with_system_cppunit" = "yes"; then
3899 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3901 with_system_cppunit=no
3903 if test "$with_system_graphite" = "yes"; then
3904 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3906 with_system_graphite=no
3908 if test "$with_system_orcus" = "yes"; then
3909 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3911 with_system_orcus=no
3913 if test "$with_system_libcmis" = "yes"; then
3914 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3916 with_system_libcmis=no
3918 if test "$with_system_hunspell" = "yes"; then
3919 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3921 with_system_hunspell=no
3923 if test "$with_system_gpgmepp" = "yes"; then
3924 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3926 with_system_gpgmepp=no
3928 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
3929 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
3930 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
3931 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
3932 # of those two is using the system variant:
3933 if test "$with_system_libnumbertext" = "yes"; then
3934 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
3936 with_system_libnumbertext=no
3938 if test "$with_system_libwps" = "yes"; then
3939 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
3941 with_system_libwps=no
3945 MSVC_USE_DEBUG_RUNTIME=""
3948 AC_SUBST(ENABLE_DBGUTIL)
3949 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3951 dnl Set the ENABLE_DEBUG variable.
3952 dnl ===================================================================
3953 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3954 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
3956 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3957 if test -z "$libo_fuzzed_enable_debug"; then
3958 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3960 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3965 AC_MSG_CHECKING([whether to do a debug build])
3966 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3968 if test -n "$ENABLE_DBGUTIL" ; then
3969 AC_MSG_RESULT([yes (dbgutil)])
3971 AC_MSG_RESULT([yes])
3977 AC_SUBST(ENABLE_DEBUG)
3979 dnl ===================================================================
3980 dnl Select the linker to use (gold/lld/ld.bfd).
3981 dnl This is done only after compiler checks (need to know if Clang is
3982 dnl used, for different defaults) and after checking if a debug build
3983 dnl is wanted (non-debug builds get the default linker if not explicitly
3984 dnl specified otherwise).
3985 dnl All checks for linker features/options should come after this.
3986 dnl ===================================================================
3990 use_ld_fail_if_error=$2
3992 AC_MSG_CHECKING([for -fuse-ld=$use_ld linker support])
3993 use_ld_ldflags_save="$LDFLAGS"
3994 LDFLAGS="$LDFLAGS -fuse-ld=$use_ld"
3995 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3998 printf ("hello world\n");
3999 ])], USE_LD=$use_ld, [])
4000 if test -n "$USE_LD"; then
4001 AC_MSG_RESULT( yes )
4004 if test -n "$use_ld_fail_if_error"; then
4010 if test -n "$use_ld_ok"; then
4011 dnl keep the value of LDFLAGS
4014 LDFLAGS="$use_ld_ldflags_save"
4018 if test "$enable_ld" != "no"; then
4019 if test "$GCC" = "yes"; then
4020 if test -n "$enable_ld"; then
4021 check_use_ld "$enable_ld" fail_if_error
4022 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4023 dnl non-debug builds default to the default linker
4025 elif test -n "$COM_IS_CLANG"; then
4027 if test $? -ne 0; then
4031 # For gcc first try gold, new versions also support lld.
4033 if test $? -ne 0; then
4037 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
4039 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD)')
4040 if test -z "$ld_used"; then
4043 AC_MSG_CHECKING([for linker that is used])
4044 AC_MSG_RESULT([$ld_used])
4045 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4046 if echo "$ld_used" | grep -q "^GNU ld"; then
4047 AC_MSG_WARN([The default GNU linker is slow, consider using the LLD or the GNU gold linker.])
4048 add_warning "The default GNU linker is slow, consider using the LLD or the GNU gold linker."
4052 if test "$enable_ld" = "yes"; then
4053 AC_MSG_ERROR([--enable-ld not supported])
4059 HAVE_LD_BSYMBOLIC_FUNCTIONS=
4060 if test "$GCC" = "yes"; then
4061 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
4062 bsymbolic_functions_ldflags_save=$LDFLAGS
4063 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
4064 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4067 printf ("hello world\n");
4068 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
4069 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
4070 AC_MSG_RESULT( found )
4072 AC_MSG_RESULT( not found )
4074 LDFLAGS=$bsymbolic_functions_ldflags_save
4076 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
4080 if test "$enable_split_debug" != no; then
4081 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
4082 if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4083 AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
4085 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
4086 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
4088 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
4089 AC_MSG_RESULT([yes])
4091 if test "$enable_split_debug" = yes; then
4098 if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4099 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
4100 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
4103 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
4106 if test "$enable_gdb_index" != "no"; then
4107 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
4108 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -o -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4109 AC_MSG_CHECKING([whether $CC_BASE supports -ggnu-pubnames])
4111 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
4113 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
4114 if test "$have_ggnu_pubnames" != "TRUE"; then
4115 if test "$enable_gdb_index" = "yes"; then
4116 AC_MSG_ERROR( no, --enable-gdb-index not supported )
4121 AC_MSG_RESULT( yes )
4122 AC_MSG_CHECKING([whether $CC_BASE supports -Wl,--gdb-index])
4123 ldflags_save=$LDFLAGS
4124 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
4125 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4128 printf ("hello world\n");
4129 ])], ENABLE_GDB_INDEX=TRUE, [])
4130 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
4131 AC_MSG_RESULT( yes )
4133 if test "$enable_gdb_index" = "yes"; then
4139 LDFLAGS=$ldflags_save
4143 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4144 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
4145 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
4148 AC_SUBST(ENABLE_GDB_INDEX)
4150 if test "$enable_sal_log" = yes; then
4153 AC_SUBST(ENABLE_SAL_LOG)
4155 dnl Check for enable symbols option
4156 dnl ===================================================================
4157 AC_MSG_CHECKING([whether to generate debug information])
4158 if test -z "$enable_symbols"; then
4159 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4165 if test "$enable_symbols" = yes; then
4166 ENABLE_SYMBOLS_FOR=all
4167 AC_MSG_RESULT([yes])
4168 elif test "$enable_symbols" = no; then
4172 # Selective debuginfo.
4173 ENABLE_SYMBOLS_FOR="$enable_symbols"
4174 AC_MSG_RESULT([for "$enable_symbols"])
4176 AC_SUBST(ENABLE_SYMBOLS_FOR)
4178 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
4179 # Building on Android with full symbols: without enough memory the linker never finishes currently.
4180 AC_MSG_CHECKING([whether enough memory is available for linking])
4181 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
4182 # Check for 15GB, as Linux reports a bit less than the physical memory size.
4183 if test -n "$mem_size" -a $mem_size -lt 15728640; then
4184 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
4186 AC_MSG_RESULT([yes])
4190 AC_MSG_CHECKING([whether to compile with optimization flags])
4191 if test -z "$enable_optimized"; then
4192 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4195 enable_optimized=yes
4198 if test "$enable_optimized" != no; then
4199 ENABLE_OPTIMIZED=TRUE
4200 AC_MSG_RESULT([yes])
4205 AC_SUBST(ENABLE_OPTIMIZED)
4208 # determine CPUNAME, OS, ...
4209 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
4220 PLATFORMID=aix_powerpc
4229 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4236 if test "$BITNESS_OVERRIDE" = 64; then
4239 PLATFORMID=windows_x86_64
4241 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4245 PLATFORMID=windows_x86
4249 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4252 SCPDEFS="$SCPDEFS -D_MSC_VER"
4264 AC_MSG_ERROR([Can't build 32-bit code for iOS])
4269 if test "$enable_ios_simulator" = "yes"; then
4270 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
4274 PLATFORMID=ios_arm64
4278 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4281 if test "$enable_ios_simulator" = "yes"; then
4286 PLATFORMID=macosx_x86_64
4289 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4305 PLATFORMID=dragonfly_x86
4310 PLATFORMID=dragonfly_x86_64
4313 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4329 PLATFORMID=freebsd_x86
4334 PLATFORMID=freebsd_x86_64
4337 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4354 PLATFORMID=haiku_x86
4359 PLATFORMID=haiku_x86_64
4362 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4379 PLATFORMID=kfreebsd_x86
4384 PLATFORMID=kfreebsd_x86_64
4387 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4403 PLATFORMID=linux_aarch64
4409 PLATFORMID=linux_alpha
4415 PLATFORMID=linux_arm_eabi
4419 PLATFORMID=linux_arm_oabi
4427 PLATFORMID=linux_hppa
4432 PLATFORMID=linux_x86
4437 PLATFORMID=linux_ia64
4443 PLATFORMID=linux_mips_eb
4448 EPM_FLAGS="-a mips64"
4449 PLATFORMID=linux_mips64_eb
4454 EPM_FLAGS="-a mips64el"
4455 PLATFORMID=linux_mips64_el
4460 EPM_FLAGS="-a mipsel"
4461 PLATFORMID=linux_mips_el
4466 PLATFORMID=linux_m68k
4471 PLATFORMID=linux_powerpc
4476 PLATFORMID=linux_powerpc64
4480 RTL_ARCH=PowerPC_64_LE
4481 PLATFORMID=linux_powerpc64_le
4486 PLATFORMID=linux_sparc
4491 PLATFORMID=linux_sparc64
4496 PLATFORMID=linux_s390
4501 PLATFORMID=linux_s390x
4506 PLATFORMID=linux_x86_64
4509 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4526 PLATFORMID=android_arm_eabi
4531 PLATFORMID=android_aarch64
4536 PLATFORMID=android_x86
4541 PLATFORMID=android_x86_64
4544 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4560 PLATFORMID=netbsd_x86
4565 PLATFORMID=netbsd_powerpc
4570 PLATFORMID=netbsd_sparc
4575 PLATFORMID=netbsd_x86_64
4578 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4594 PLATFORMID=openbsd_x86
4599 PLATFORMID=openbsd_x86_64
4602 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4605 SOLARINC="$SOLARINC -I/usr/local/include"
4619 PLATFORMID=solaris_x86
4624 PLATFORMID=solaris_sparc
4629 PLATFORMID=solaris_sparc64
4632 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4635 SOLARINC="$SOLARINC -I/usr/local/include"
4639 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4643 if test "$with_x" = "no"; then
4644 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4648 if test "$enable_gui" = "no"; then
4649 if test "$USING_X11" != TRUE; then
4650 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4654 AC_DEFINE(HAVE_FEATURE_UI,0)
4657 AC_SUBST(DISABLE_GUI)
4659 WORKDIR="${BUILDDIR}/workdir"
4660 INSTDIR="${BUILDDIR}/instdir"
4661 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4662 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4663 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4671 AC_SUBST([INSTROOT])
4672 AC_SUBST([INSTROOTBASE])
4676 AC_SUBST(PLATFORMID)
4677 AC_SUBST(WINDOWS_X64)
4678 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4680 dnl ===================================================================
4681 dnl Test which package format to use
4682 dnl ===================================================================
4683 AC_MSG_CHECKING([which package format to use])
4684 if test -n "$with_package_format" -a "$with_package_format" != no; then
4685 for i in $with_package_format; do
4687 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4690 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4691 aix - AIX software distribution
4692 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4693 deb - Debian software distribution
4694 pkg - Solaris software distribution
4695 rpm - RedHat software distribution
4697 LibreOffice additionally supports:
4698 archive - .tar.gz or .zip
4700 installed - installation tree
4706 # fakeroot is needed to ensure correct file ownerships/permissions
4707 # inside deb packages and tar archives created on Linux and Solaris.
4708 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4709 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4710 if test "$FAKEROOT" = "no"; then
4712 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4715 PKGFORMAT="$with_package_format"
4716 AC_MSG_RESULT([$PKGFORMAT])
4719 AC_MSG_RESULT([none])
4723 dnl ===================================================================
4724 dnl Set up a different compiler to produce tools to run on the build
4725 dnl machine when doing cross-compilation
4726 dnl ===================================================================
4728 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4729 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4730 if test "$cross_compiling" = "yes"; then
4731 AC_MSG_CHECKING([for BUILD platform configuration])
4733 rm -rf CONF-FOR-BUILD config_build.mk
4734 mkdir CONF-FOR-BUILD
4735 # Here must be listed all files needed when running the configure script. In particular, also
4736 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4737 # keep them in the same order as there.
4738 (cd $SRC_ROOT && tar cf - \
4740 bin/get_config_variables \
4741 solenv/bin/getcompver.awk \
4742 solenv/inc/langlist.mk \
4745 config_host_lang.mk.in \
4747 bin/bffvalidator.sh.in \
4748 bin/odfvalidator.sh.in \
4749 bin/officeotron.sh.in \
4750 instsetoo_native/util/openoffice.lst.in \
4751 setup_native/source/packinfo/finals_instsetoo.txt.in \
4753 sysui/desktop/macosx/Info.plist.in) \
4754 | (cd CONF-FOR-BUILD && tar xf -)
4755 cp configure CONF-FOR-BUILD
4756 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4758 unset COM USING_X11 OS CPUNAME
4759 unset CC CXX SYSBASE CFLAGS
4760 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4761 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4762 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4763 if test -n "$CC_FOR_BUILD"; then
4764 export CC="$CC_FOR_BUILD"
4765 CC_BASE=`first_arg_basename "$CC"`
4767 if test -n "$CXX_FOR_BUILD"; then
4768 export CXX="$CXX_FOR_BUILD"
4769 CXX_BASE=`first_arg_basename "$CXX"`
4771 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4774 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4775 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4776 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4777 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4778 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4779 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4780 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4781 # Don't bother having configure look for stuff not needed for the build platform anyway
4784 --disable-gstreamer-1-0 \
4786 --disable-pdfimport \
4787 --disable-postgresql-sdbc \
4788 --enable-icecream="$enable_icecream" \
4789 --with-parallelism="$with_parallelism" \
4794 2>&1 | sed -e 's/^/ /'
4795 test -f ./config_host.mk 2>/dev/null || exit
4796 cp config_host.mk ../config_build.mk
4797 cp config_host_lang.mk ../config_build_lang.mk
4798 mv config.log ../config.Build.log
4799 mkdir -p ../config_build
4800 mv config_host/*.h ../config_build
4801 . ./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
4803 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
4805 VV=`eval "echo $VV"`
4806 if test -n "$VV"; then
4807 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4808 echo "$line" >>build-config
4812 for V in INSTDIR INSTROOT WORKDIR; do
4814 VV=`eval "echo $VV"`
4815 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4816 if test -n "$VV"; then
4817 line="${V}_FOR_BUILD='$VV'"
4818 echo "$line" >>build-config
4822 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4823 echo "$line" >>build-config
4826 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4827 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])
4828 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4829 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4831 eval `cat CONF-FOR-BUILD/build-config`
4833 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4835 rm -rf CONF-FOR-BUILD
4839 CXX_FOR_BUILD="$CXX"
4840 INSTDIR_FOR_BUILD="$INSTDIR"
4841 INSTROOT_FOR_BUILD="$INSTROOT"
4842 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4843 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4844 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4845 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4846 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4847 WORKDIR_FOR_BUILD="$WORKDIR"
4849 AC_SUBST(OS_FOR_BUILD)
4850 AC_SUBST(INSTDIR_FOR_BUILD)
4851 AC_SUBST(INSTROOT_FOR_BUILD)
4852 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4853 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4854 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4855 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4856 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4857 AC_SUBST(WORKDIR_FOR_BUILD)
4859 dnl ===================================================================
4860 dnl Check for syslog header
4861 dnl ===================================================================
4862 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4864 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4865 dnl ===================================================================
4866 AC_MSG_CHECKING([whether to turn warnings to errors])
4867 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4868 ENABLE_WERROR="TRUE"
4869 AC_MSG_RESULT([yes])
4871 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4872 ENABLE_WERROR="TRUE"
4873 AC_MSG_RESULT([yes])
4878 AC_SUBST(ENABLE_WERROR)
4880 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4881 dnl ===================================================================
4882 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4883 if test -z "$enable_assert_always_abort"; then
4884 if test "$ENABLE_DEBUG" = TRUE; then
4885 enable_assert_always_abort=yes
4887 enable_assert_always_abort=no
4890 if test "$enable_assert_always_abort" = "yes"; then
4891 ASSERT_ALWAYS_ABORT="TRUE"
4892 AC_MSG_RESULT([yes])
4894 ASSERT_ALWAYS_ABORT="FALSE"
4897 AC_SUBST(ASSERT_ALWAYS_ABORT)
4899 # Determine whether to use ooenv for the instdir installation
4900 # ===================================================================
4901 if test $_os != "WINNT" -a $_os != "Darwin"; then
4902 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4903 if test "$enable_ooenv" = "no"; then
4907 AC_MSG_RESULT([yes])
4910 AC_SUBST(ENABLE_OOENV)
4912 if test "$USING_X11" != TRUE; then
4913 # be sure to do not mess with unneeded stuff
4918 build_gstreamer_1_0=no
4922 enable_cairo_canvas=no
4925 if test "$OS" = "HAIKU"; then
4926 enable_cairo_canvas=yes
4930 if test "$test_kf5" = "yes" -a "$enable_kde5" = "yes"; then
4931 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!])
4932 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!"
4936 if test "$test_kf5" = "yes"; then
4940 if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; then
4941 if test "$enable_qt5" = "no"; then
4942 AC_MSG_ERROR([KF5 support depends on QT5, so it conflicts with --disable-qt5])
4948 dnl ===================================================================
4949 dnl check for cups support
4950 dnl ===================================================================
4953 if test "$enable_cups" = "no"; then
4957 AC_MSG_CHECKING([whether to enable CUPS support])
4958 if test "$test_cups" = "yes"; then
4960 AC_MSG_RESULT([yes])
4962 AC_MSG_CHECKING([whether cups support is present])
4963 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4964 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4965 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4966 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4973 AC_SUBST(ENABLE_CUPS)
4976 if test "$test_fontconfig" = "yes"; then
4977 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4978 SYSTEM_FONTCONFIG=TRUE
4979 FilterLibs "${FONTCONFIG_LIBS}"
4980 FONTCONFIG_LIBS="${filteredlibs}"
4982 AC_SUBST(FONTCONFIG_CFLAGS)
4983 AC_SUBST(FONTCONFIG_LIBS)
4984 AC_SUBST([SYSTEM_FONTCONFIG])
4986 dnl whether to find & fetch external tarballs?
4987 dnl ===================================================================
4988 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4989 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4990 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4992 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4995 if test -z "$TARFILE_LOCATION"; then
4996 if test -d "$SRC_ROOT/src" ; then
4997 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4998 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
5000 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
5002 AbsolutePath "$TARFILE_LOCATION"
5003 PathFormat "${absolute_path}"
5004 TARFILE_LOCATION="${formatted_path}"
5006 AC_SUBST(TARFILE_LOCATION)
5008 AC_MSG_CHECKING([whether we want to fetch tarballs])
5009 if test "$enable_fetch_external" != "no"; then
5010 if test "$with_all_tarballs" = "yes"; then
5011 AC_MSG_RESULT([yes, all of them])
5012 DO_FETCH_TARBALLS="ALL"
5014 AC_MSG_RESULT([yes, if we use them])
5015 DO_FETCH_TARBALLS="TRUE"
5021 AC_SUBST(DO_FETCH_TARBALLS)
5023 AC_MSG_CHECKING([whether to build help])
5024 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
5025 BUILD_TYPE="$BUILD_TYPE HELP"
5026 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5027 case "$with_help" in
5029 ENABLE_HTMLHELP=TRUE
5030 SCPDEFS="$SCPDEFS -DWITH_HELP"
5031 AC_MSG_RESULT([HTML])
5034 ENABLE_HTMLHELP=TRUE
5036 AC_MSG_RESULT([HTML])
5039 SCPDEFS="$SCPDEFS -DWITH_HELP"
5040 AC_MSG_RESULT([yes])
5043 AC_MSG_ERROR([Unknown --with-help=$with_help])
5049 AC_SUBST([ENABLE_HTMLHELP])
5050 AC_SUBST([HELP_ONLINE])
5052 AC_MSG_CHECKING([whether to enable xapian-omega support for help])
5053 if test -n "$with_omindex" -a "$with_omindex" != "no" -a $_os != iOS -a $_os != Android; then
5054 BUILD_TYPE="$BUILD_TYPE HELP"
5055 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5056 case "$with_omindex" in
5058 ENABLE_HTMLHELP=TRUE
5060 HELP_OMINDEX_PAGE=TRUE
5061 AC_MSG_RESULT([SERVER])
5064 ENABLE_HTMLHELP=TRUE
5066 HELP_OMINDEX_PAGE=FALSE
5067 AC_MSG_RESULT([NOXAP])
5070 AC_MSG_ERROR([Unknown --with-omindex=$with_omindex])
5074 HELP_OMINDEX_PAGE=FALSE
5077 AC_SUBST([ENABLE_HTMLHELP])
5078 AC_SUBST([HELP_OMINDEX_PAGE])
5079 AC_SUBST([HELP_ONLINE])
5082 dnl Test whether to include MySpell dictionaries
5083 dnl ===================================================================
5084 AC_MSG_CHECKING([whether to include MySpell dictionaries])
5085 if test "$with_myspell_dicts" = "yes"; then
5086 AC_MSG_RESULT([yes])
5087 WITH_MYSPELL_DICTS=TRUE
5088 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
5089 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
5094 AC_SUBST(WITH_MYSPELL_DICTS)
5096 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
5097 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
5098 if test "$with_system_dicts" = yes; then
5099 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
5101 with_system_dicts=no
5104 AC_MSG_CHECKING([whether to use dicts from external paths])
5105 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
5106 AC_MSG_RESULT([yes])
5108 AC_MSG_CHECKING([for spelling dictionary directory])
5109 if test -n "$with_external_dict_dir"; then
5110 DICT_SYSTEM_DIR=file://$with_external_dict_dir
5112 DICT_SYSTEM_DIR=file:///usr/share/hunspell
5113 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
5114 DICT_SYSTEM_DIR=file:///usr/share/myspell
5117 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
5118 AC_MSG_CHECKING([for hyphenation patterns directory])
5119 if test -n "$with_external_hyph_dir"; then
5120 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
5122 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
5124 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
5125 AC_MSG_CHECKING([for thesaurus directory])
5126 if test -n "$with_external_thes_dir"; then
5127 THES_SYSTEM_DIR=file://$with_external_thes_dir
5129 THES_SYSTEM_DIR=file:///usr/share/mythes
5131 AC_MSG_RESULT([$THES_SYSTEM_DIR])
5136 AC_SUBST(SYSTEM_DICTS)
5137 AC_SUBST(DICT_SYSTEM_DIR)
5138 AC_SUBST(HYPH_SYSTEM_DIR)
5139 AC_SUBST(THES_SYSTEM_DIR)
5141 dnl ===================================================================
5142 dnl Precompiled headers.
5144 AC_MSG_CHECKING([whether to enable pch feature])
5145 if test -z "$enable_pch"; then
5146 if test "$_os" = "WINNT"; then
5147 # Enabled by default on Windows.
5153 if test "$enable_pch" != "no" -a "$_os" != "WINNT" -a "$GCC" != "yes" ; then
5154 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
5156 if test "$enable_pch" = "system"; then
5158 AC_MSG_RESULT([yes (system headers)])
5159 elif test "$enable_pch" = "base"; then
5161 AC_MSG_RESULT([yes (system and base headers)])
5162 elif test "$enable_pch" = "normal"; then
5164 AC_MSG_RESULT([yes (normal)])
5165 elif test "$enable_pch" = "full"; then
5167 AC_MSG_RESULT([yes (full)])
5168 elif test "$enable_pch" = "yes"; then
5169 # Pick a suitable default.
5170 if test "$GCC" = "yes"; then
5171 # With Clang and GCC higher levels do not seem to make a noticeable improvement,
5172 # while making the PCHs larger and rebuilds more likely.
5174 AC_MSG_RESULT([yes (system and base headers)])
5176 # With MSVC the highest level makes a significant difference,
5177 # and it was the default when there used to be no PCH levels.
5179 AC_MSG_RESULT([yes (full)])
5181 elif test "$enable_pch" = "no"; then
5184 AC_MSG_ERROR([Unknown value for --enable-pch])
5186 AC_SUBST(ENABLE_PCH)
5187 # ccache 3.7.1 and older do not properly detect/handle -include .gch in CCACHE_DEPEND mode
5188 if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_IS_CLANG" != "TRUE"; then
5189 AC_PATH_PROG([CCACHE_BIN],[ccache],[not found])
5190 if test "$CCACHE_BIN" != "not found"; then
5191 AC_MSG_CHECKING([ccache version])
5192 CCACHE_VERSION=`"$CCACHE_BIN" -V | "$AWK" '/^ccache version/{print $3}'`
5193 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5194 AC_MSG_RESULT([$CCACHE_VERSION])
5195 AC_MSG_CHECKING([whether ccache depend mode works properly with GCC PCH])
5196 if test "$CCACHE_NUMVER" -gt "030701"; then
5197 AC_MSG_RESULT([yes])
5199 AC_MSG_RESULT([no (not newer than 3.7.1)])
5207 AC_MSG_CHECKING([the GNU Make version])
5208 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5209 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5210 if test "$_make_longver" -ge "038200"; then
5211 AC_MSG_RESULT([$GNUMAKE $_make_version])
5213 elif test "$_make_longver" -ge "038100"; then
5214 if test "$build_os" = "cygwin"; then
5215 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
5217 AC_MSG_RESULT([$GNUMAKE $_make_version])
5219 dnl ===================================================================
5220 dnl Search all the common names for sha1sum
5221 dnl ===================================================================
5222 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
5223 if test -z "$SHA1SUM"; then
5224 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
5225 elif test "$SHA1SUM" = "openssl"; then
5226 SHA1SUM="openssl sha1"
5228 AC_MSG_CHECKING([for GNU Make bug 20033])
5229 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
5230 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
5231 A := \$(wildcard *.a)
5235 <TAB>@echo survived bug20033.
5239 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5252 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5253 <TAB>\$(call d1,\$(CHECKSUM)),\
5254 <TAB>\$(call d2,\$(CHECKSUM)))
5256 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5257 no_parallelism_make="YES"
5258 AC_MSG_RESULT([yes, disable parallelism])
5260 AC_MSG_RESULT([no, keep parallelism enabled])
5262 rm -rf $TESTGMAKEBUG20033
5264 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5267 # find if gnumake support file function
5268 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5269 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5270 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5271 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5273 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5274 \$(file >test.txt,Success )
5281 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5282 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5283 HAVE_GNUMAKE_FILE_FUNC=TRUE
5284 AC_MSG_RESULT([yes])
5288 rm -rf $TESTGMAKEFILEFUNC
5289 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5290 AC_SUBST(GNUMAKE_WIN_NATIVE)
5292 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5294 if test "$_make_ver_check" = ""; then
5298 HAVE_LD_HASH_STYLE=FALSE
5299 WITH_LINKER_HASH_STYLE=
5300 AC_MSG_CHECKING([for --hash-style gcc linker support])
5301 if test "$GCC" = "yes"; then
5302 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5303 hash_styles="gnu sysv"
5304 elif test "$with_linker_hash_style" = "no"; then
5307 hash_styles="$with_linker_hash_style"
5310 for hash_style in $hash_styles; do
5311 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5312 hash_style_ldflags_save=$LDFLAGS
5313 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5315 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5322 HAVE_LD_HASH_STYLE=TRUE
5323 WITH_LINKER_HASH_STYLE=$hash_style
5325 [HAVE_LD_HASH_STYLE=FALSE],
5326 [HAVE_LD_HASH_STYLE=FALSE])
5327 LDFLAGS=$hash_style_ldflags_save
5330 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5331 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5335 LDFLAGS=$hash_style_ldflags_save
5339 AC_SUBST(HAVE_LD_HASH_STYLE)
5340 AC_SUBST(WITH_LINKER_HASH_STYLE)
5342 dnl ===================================================================
5343 dnl Check whether there's a Perl version available.
5344 dnl ===================================================================
5345 if test -z "$with_perl_home"; then
5346 AC_PATH_PROG(PERL, perl)
5348 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5349 _perl_path="$with_perl_home/bin/perl"
5350 if test -x "$_perl_path"; then
5353 AC_MSG_ERROR([$_perl_path not found])
5357 dnl ===================================================================
5358 dnl Testing for Perl version 5 or greater.
5359 dnl $] is the Perl version variable, it is returned as an integer
5360 dnl ===================================================================
5361 if test "$PERL"; then
5362 AC_MSG_CHECKING([the Perl version])
5363 ${PERL} -e "exit($]);"
5365 if test "$_perl_version" -lt 5; then
5366 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
5368 AC_MSG_RESULT([Perl $_perl_version])
5370 AC_MSG_ERROR([Perl not found, install Perl 5])
5373 dnl ===================================================================
5374 dnl Testing for required Perl modules
5375 dnl ===================================================================
5377 AC_MSG_CHECKING([for required Perl modules])
5378 perl_use_string="use Cwd ; use Digest::MD5"
5379 if test "$_os" = "WINNT"; then
5380 if test -n "$PKGFORMAT"; then
5381 for i in $PKGFORMAT; do
5384 # for getting fonts versions to use in MSI
5385 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5391 if test "$with_system_hsqldb" = "yes"; then
5392 perl_use_string="$perl_use_string ; use Archive::Zip"
5394 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
5395 AC_MSG_RESULT([all modules found])
5397 AC_MSG_RESULT([failed to find some modules])
5398 # Find out which modules are missing.
5399 for i in $perl_use_string; do
5400 if test "$i" != "use" -a "$i" != ";"; then
5401 if ! $PERL -e "use $i;">/dev/null 2>&1; then
5402 missing_perl_modules="$missing_perl_modules $i"
5407 The missing Perl modules are: $missing_perl_modules
5408 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5411 dnl ===================================================================
5412 dnl Check for pkg-config
5413 dnl ===================================================================
5414 if test "$_os" != "WINNT"; then
5418 if test "$_os" != "WINNT"; then
5420 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5421 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5422 # explicitly. Or put /path/to/compiler in PATH yourself.
5424 # Use wrappers for LTO
5425 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5426 AC_CHECK_TOOL(AR,gcc-ar)
5427 AC_CHECK_TOOL(NM,gcc-nm)
5428 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5430 AC_CHECK_TOOL(AR,ar)
5431 AC_CHECK_TOOL(NM,nm)
5432 AC_CHECK_TOOL(RANLIB,ranlib)
5434 AC_CHECK_TOOL(OBJDUMP,objdump)
5435 AC_CHECK_TOOL(READELF,readelf)
5436 AC_CHECK_TOOL(STRIP,strip)
5437 if test "$_os" = "WINNT"; then
5438 AC_CHECK_TOOL(DLLTOOL,dlltool)
5439 AC_CHECK_TOOL(WINDRES,windres)
5446 AC_SUBST(PKG_CONFIG)
5452 dnl ===================================================================
5453 dnl pkg-config checks on macOS
5454 dnl ===================================================================
5456 if test $_os = Darwin; then
5457 AC_MSG_CHECKING([for bogus pkg-config])
5458 if test -n "$PKG_CONFIG"; then
5459 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5460 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5462 if test "$enable_bogus_pkg_config" = "yes"; then
5463 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5465 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.])
5469 AC_MSG_RESULT([no, good])
5475 # Return value: $csctest
5479 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5480 if test -n "$regvalue"; then
5488 # Return value: $altest
5492 # We need this check to detect 4.6.1 or above.
5493 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
5494 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5495 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5501 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5502 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5503 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5516 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
5517 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5518 if test -n "$regvalue"; then
5525 find_winsdk_version()
5527 # Args: $1 : SDK version as in "8.0", "8.1A" etc
5528 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5530 unset winsdktest winsdkbinsubdir winsdklibsubdir
5534 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5535 if test -n "$regvalue"; then
5536 winsdktest=$regvalue
5537 winsdklibsubdir=win8
5542 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5543 if test -n "$regvalue"; then
5544 winsdktest=$regvalue
5545 winsdklibsubdir=winv6.3
5550 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5551 if test -n "$regvalue"; then
5552 winsdktest=$regvalue
5553 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5554 if test -n "$regvalue"; then
5555 winsdkbinsubdir="$regvalue".0
5556 winsdklibsubdir=$winsdkbinsubdir
5557 tmppath="$winsdktest\\Include\\$winsdklibsubdir"
5558 # test exist the SDK path
5559 if test -d "$tmppath"; then
5560 # when path is convertible to a short path then path is okay
5561 cygpath -d "$tmppath" >/dev/null 2>&1
5562 if test $? -ne 0; then
5563 AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
5566 AC_MSG_ERROR([The Windows SDK not found, check the installation])
5577 # Return value: From find_winsdk_version
5581 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5582 find_winsdk_version $ver
5583 if test -n "$winsdktest"; then
5591 AC_MSG_CHECKING([for MSVC merge modules directory])
5592 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5595 my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm ${my_msm_files}"
5598 for f in $my_msm_files; do
5599 echo "$as_me:$LINENO: searching for $f" >&5
5603 for ver in 14.0 15.0; do
5604 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5605 if test -n "$regvalue"; then
5606 for f in ${my_msm_files}; do
5607 if test -e "$regvalue/${f}"; then
5614 dnl Is the following fallback really necessary, or was it added in response
5615 dnl to never having started Visual Studio on a given machine, so the
5616 dnl registry keys checked above had presumably not yet been created?
5617 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5618 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5619 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5620 dnl expanding to "C:\Program Files\Common Files"), which would need
5621 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5622 dnl obtain its value from cygwin:
5623 if test -z "$msmdir"; then
5624 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5625 for f in ${my_msm_files}; do
5626 if test -e "$my_msm_dir/${f}"; then
5632 dnl Starting from MSVC 15.0, merge modules are located in different directory
5635 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5636 echo "$as_me:$LINENO: looking in $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])" >&5
5637 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5638 for f in ${my_msm_files}; do
5639 if test -e "$my_msm_dir/${f}"; then
5648 if test -n "$msmdir"; then
5649 msmdir=`cygpath -m "$msmdir"`
5650 AC_MSG_RESULT([$msmdir])
5652 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5653 AC_MSG_FAILURE([not found])
5655 AC_MSG_WARN([not found (check config.log)])
5656 add_warning "MSM none of ${my_msm_files} found"
5661 find_msvc_x64_dlls()
5663 AC_MSG_CHECKING([for MSVC x64 DLL path])
5664 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5667 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5668 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT" >&5
5669 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5670 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5673 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT" >&5
5674 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"; then
5675 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"
5678 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC150.CRT" >&5
5679 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
5680 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
5686 AC_MSG_RESULT([$msvcdllpath])
5687 AC_MSG_CHECKING([for MSVC x64 DLLs])
5688 msvcdlls="msvcp140.dll vcruntime140.dll"
5689 for dll in $msvcdlls; do
5690 if ! test -f "$msvcdllpath/$dll"; then
5691 AC_MSG_FAILURE([missing $dll])
5694 AC_MSG_RESULT([found all ($msvcdlls)])
5697 dnl =========================================
5698 dnl Check for the Windows SDK.
5699 dnl =========================================
5700 if test "$_os" = "WINNT"; then
5701 AC_MSG_CHECKING([for Windows SDK])
5702 if test "$build_os" = "cygwin"; then
5704 WINDOWS_SDK_HOME=$winsdktest
5706 # normalize if found
5707 if test -n "$WINDOWS_SDK_HOME"; then
5708 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5709 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5712 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5715 if test -n "$WINDOWS_SDK_HOME"; then
5716 # Remove a possible trailing backslash
5717 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5719 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5720 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5721 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5722 have_windows_sdk_headers=yes
5723 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5724 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5725 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5726 have_windows_sdk_headers=yes
5727 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5728 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5729 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5730 have_windows_sdk_headers=yes
5732 have_windows_sdk_headers=no
5735 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5736 have_windows_sdk_libs=yes
5737 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5738 have_windows_sdk_libs=yes
5740 have_windows_sdk_libs=no
5743 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5744 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5745 the Windows SDK are installed.])
5749 if test -z "$WINDOWS_SDK_HOME"; then
5750 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5751 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5752 WINDOWS_SDK_VERSION=80
5753 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5754 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5755 WINDOWS_SDK_VERSION=81
5756 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5757 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5758 WINDOWS_SDK_VERSION=10
5759 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5761 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5763 PathFormat "$WINDOWS_SDK_HOME"
5764 WINDOWS_SDK_HOME="$formatted_path"
5765 if test "$build_os" = "cygwin"; then
5766 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5767 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5768 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5769 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5770 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5774 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5775 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5776 dnl but not in v8.0), so allow this to be overridden with a
5777 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5778 dnl and configuration error if no WiLangId.vbs is found would arguably be
5779 dnl better, but I do not know under which conditions exactly it is needed by
5781 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5782 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5783 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5784 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5786 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5787 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5789 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5790 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5793 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5794 if test -n "$with_package_format" -a "$with_package_format" != no; then
5795 for i in "$with_package_format"; do
5796 if test "$i" = "msi"; then
5797 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5798 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5805 AC_SUBST(WINDOWS_SDK_HOME)
5806 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5807 AC_SUBST(WINDOWS_SDK_VERSION)
5808 AC_SUBST(WINDOWS_SDK_WILANGID)
5810 if test "$build_os" = "cygwin"; then
5811 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5812 dnl dir, it also determines that dir's path w/o an arch segment if any,
5813 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5814 AC_MSG_CHECKING([for midl.exe])
5817 if test -n "$winsdkbinsubdir" \
5818 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5820 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5821 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5822 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5823 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5824 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5825 elif test -f "$winsdktest/Bin/midl.exe"; then
5826 MIDL_PATH=$winsdktest/Bin
5827 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5829 if test ! -f "$MIDL_PATH/midl.exe"; then
5830 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5832 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5835 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5836 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5838 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5839 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5840 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5841 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5842 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5843 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5844 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5845 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5846 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5847 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5848 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5849 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5851 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5855 AC_MSG_CHECKING([for csc.exe])
5857 if test -f "$csctest/csc.exe"; then
5860 if test ! -f "$CSC_PATH/csc.exe"; then
5861 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5863 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5866 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5869 AC_MSG_CHECKING([for al.exe])
5871 if test -n "$winsdkbinsubdir" \
5872 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5874 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5875 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5876 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5877 elif test -f "$winsdktest/Bin/al.exe"; then
5878 AL_PATH="$winsdktest/Bin"
5881 if test -z "$AL_PATH"; then
5883 if test -f "$altest/bin/al.exe"; then
5884 AL_PATH="$altest/bin"
5885 elif test -f "$altest/al.exe"; then
5889 if test ! -f "$AL_PATH/al.exe"; then
5890 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5892 AC_MSG_RESULT([$AL_PATH/al.exe])
5895 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5897 dnl Check mscoree.lib / .NET Framework dir
5898 AC_MSG_CHECKING(.NET Framework)
5900 PathFormat "$frametest"
5901 frametest="$formatted_path"
5902 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5903 DOTNET_FRAMEWORK_HOME="$frametest"
5906 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5907 DOTNET_FRAMEWORK_HOME="$winsdktest"
5910 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
5911 AC_MSG_ERROR([mscoree.lib not found])
5913 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5915 PathFormat "$MIDL_PATH"
5916 MIDL_PATH="$formatted_path"
5918 PathFormat "$AL_PATH"
5919 AL_PATH="$formatted_path"
5921 PathFormat "$DOTNET_FRAMEWORK_HOME"
5922 DOTNET_FRAMEWORK_HOME="$formatted_path"
5924 PathFormat "$CSC_PATH"
5925 CSC_PATH="$formatted_path"
5928 dnl ===================================================================
5929 dnl Check if stdc headers are available excluding MSVC.
5930 dnl ===================================================================
5931 if test "$_os" != "WINNT"; then
5935 dnl ===================================================================
5936 dnl Testing for C++ compiler and version...
5937 dnl ===================================================================
5939 if test "$_os" != "WINNT"; then
5940 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5941 save_CXXFLAGS=$CXXFLAGS
5943 CXXFLAGS=$save_CXXFLAGS
5944 if test -z "$CXX_BASE"; then
5945 CXX_BASE=`first_arg_basename "$CXX"`
5949 dnl check for GNU C++ compiler version
5950 if test "$GXX" = "yes" -a -z "$COM_IS_CLANG"; then
5951 AC_MSG_CHECKING([the GNU C++ compiler version])
5953 _gpp_version=`$CXX -dumpversion`
5954 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5956 if test "$_gpp_majmin" -lt "700"; then
5957 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 7.0 to build LibreOffice, you have $_gpp_version.])
5959 AC_MSG_RESULT([ok (g++ $_gpp_version)])
5962 dnl see https://code.google.com/p/android/issues/detail?id=41770
5966 AC_MSG_CHECKING([whether $CXX_BASE is broken with boost.thread])
5967 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5968 #include <bits/c++config.h>]],[[
5969 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5970 && !defined(_GLIBCXX__PTHREADS) \
5971 && !defined(_GLIBCXX_HAS_GTHREADS)
5974 ]])],[AC_MSG_RESULT([yes])
5975 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5977 if test $glibcxx_threads = yes; then
5978 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5981 AC_SUBST(BOOST_CXXFLAGS)
5984 # prefx CXX with ccache if needed
5986 if test "$CCACHE" != ""; then
5987 AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
5989 save_CXXFLAGS=$CXXFLAGS
5990 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5991 dnl an empty program will do, we're checking the compiler flags
5992 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5993 [use_ccache=yes], [use_ccache=no])
5994 if test $use_ccache = yes; then
5995 AC_MSG_RESULT([yes])
5998 CXX_BASE="ccache $CXX_BASE"
6001 CXXFLAGS=$save_CXXFLAGS
6005 dnl ===================================================================
6006 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
6007 dnl ===================================================================
6009 if test "$_os" != "WINNT"; then
6012 dnl Check whether there's a C pre-processor.
6017 dnl ===================================================================
6018 dnl Find integral type sizes and alignments
6019 dnl ===================================================================
6021 if test "$_os" != "WINNT"; then
6023 if test "$_os" = "iOS"; then
6024 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
6026 ac_cv_sizeof_short=2
6028 ac_cv_sizeof_long_long=8
6029 ac_cv_sizeof_double=8
6030 ac_cv_sizeof_voidp=8
6032 AC_CHECK_SIZEOF(long)
6033 AC_CHECK_SIZEOF(short)
6034 AC_CHECK_SIZEOF(int)
6035 AC_CHECK_SIZEOF(long long)
6036 AC_CHECK_SIZEOF(double)
6037 AC_CHECK_SIZEOF(void*)
6040 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
6041 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
6042 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
6043 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
6044 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
6046 dnl Allow build without AC_CHECK_ALIGNOF, grrr
6047 m4_pattern_allow([AC_CHECK_ALIGNOF])
6048 m4_ifdef([AC_CHECK_ALIGNOF],
6050 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
6051 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
6052 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
6053 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
6056 case "$_os-$host_cpu" in
6058 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6059 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6060 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
6061 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
6064 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6065 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6066 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
6067 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
6070 if test -z "$ac_cv_alignof_short" -o \
6071 -z "$ac_cv_alignof_int" -o \
6072 -z "$ac_cv_alignof_long" -o \
6073 -z "$ac_cv_alignof_double"; then
6074 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.])
6080 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
6081 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
6082 if test $ac_cv_sizeof_long -eq 8; then
6083 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
6084 elif test $ac_cv_sizeof_double -eq 8; then
6085 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
6087 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
6090 dnl Check for large file support
6092 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
6093 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
6095 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
6096 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
6100 SAL_TYPES_SIZEOFSHORT=2
6101 SAL_TYPES_SIZEOFINT=4
6102 SAL_TYPES_SIZEOFLONG=4
6103 SAL_TYPES_SIZEOFLONGLONG=8
6104 if test "$BITNESS_OVERRIDE" = ""; then
6105 SAL_TYPES_SIZEOFPOINTER=4
6107 SAL_TYPES_SIZEOFPOINTER=8
6109 SAL_TYPES_ALIGNMENT2=2
6110 SAL_TYPES_ALIGNMENT4=4
6111 SAL_TYPES_ALIGNMENT8=8
6114 AC_SUBST(LFS_CFLAGS)
6116 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
6117 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
6118 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
6119 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
6120 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
6121 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
6122 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
6123 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
6125 dnl ===================================================================
6126 dnl Check whether to enable runtime optimizations
6127 dnl ===================================================================
6128 ENABLE_RUNTIME_OPTIMIZATIONS=
6129 AC_MSG_CHECKING([whether to enable runtime optimizations])
6130 if test -z "$enable_runtime_optimizations"; then
6134 enable_runtime_optimizations=no
6140 if test "$enable_runtime_optimizations" != no; then
6141 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
6142 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
6143 AC_MSG_RESULT([yes])
6147 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
6149 dnl ===================================================================
6150 dnl Check if valgrind headers are available
6151 dnl ===================================================================
6153 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
6154 prev_cppflags=$CPPFLAGS
6155 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
6156 # or where does it come from?
6157 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
6158 AC_CHECK_HEADER([valgrind/valgrind.h],
6159 [ENABLE_VALGRIND=TRUE])
6160 CPPFLAGS=$prev_cppflags
6162 AC_SUBST([ENABLE_VALGRIND])
6163 if test -z "$ENABLE_VALGRIND"; then
6164 if test "$with_valgrind" = yes; then
6165 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
6169 AC_SUBST([VALGRIND_CFLAGS])
6172 dnl ===================================================================
6173 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
6174 dnl ===================================================================
6176 # We need at least the sys/sdt.h include header.
6177 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
6178 if test "$SDT_H_FOUND" = "TRUE"; then
6179 # Found sys/sdt.h header, now make sure the c++ compiler works.
6180 # Old g++ versions had problems with probes in constructors/destructors.
6181 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
6183 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6184 #include <sys/sdt.h>
6192 ProbeClass(int& v, const char *n) : ref(v), name(n)
6194 DTRACE_PROBE2(_test_, cons, name, ref);
6197 void method(int min)
6199 DTRACE_PROBE3(_test_, meth, name, ref, min);
6205 DTRACE_PROBE2(_test_, dest, name, ref);
6210 DTRACE_PROBE1(_test_, call, i);
6211 ProbeClass inst = ProbeClass(i, "call");
6213 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
6214 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
6217 AC_CONFIG_HEADERS([config_host/config_probes.h])
6219 dnl ===================================================================
6221 dnl ===================================================================
6222 HAVE_GCC_STACK_CLASH_PROTECTION=
6223 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6224 AC_MSG_CHECKING([whether $CC_BASE supports -fstack-clash-protection])
6226 CFLAGS="$CFLAGS -fstack-clash-protection"
6228 [AC_LANG_PROGRAM(, [[return 0;]])],
6229 [AC_MSG_RESULT([yes]); HAVE_GCC_STACK_CLASH_PROTECTION=TRUE],
6230 [AC_MSG_RESULT([no])])
6233 AC_MSG_CHECKING([whether $CC_BASE supports -mno-avx])
6235 CFLAGS="$CFLAGS -Werror -mno-avx"
6236 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
6238 if test "$HAVE_GCC_AVX" = "TRUE"; then
6239 AC_MSG_RESULT([yes])
6244 AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
6245 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6247 if (__sync_add_and_fetch(&v, 1) != 1 ||
6248 __sync_sub_and_fetch(&v, 1) != 0)
6250 __sync_synchronize();
6251 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6255 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6256 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6257 AC_MSG_RESULT([yes])
6258 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6263 AC_MSG_CHECKING([whether $CC_BASE supports __builtin_ffs])
6264 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
6265 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
6266 AC_MSG_RESULT([yes])
6267 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
6272 AC_MSG_CHECKING([whether $CC_BASE supports __attribute__((deprecated(message)))])
6274 CFLAGS="$CFLAGS -Werror"
6275 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6276 __attribute__((deprecated("test"))) void f();
6278 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6279 AC_MSG_RESULT([yes])
6280 ], [AC_MSG_RESULT([no])])
6283 AC_MSG_CHECKING([whether $CXX_BASE defines __base_class_type_info in cxxabi.h])
6285 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6288 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
6290 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
6291 AC_MSG_RESULT([yes])
6292 ], [AC_MSG_RESULT([no])])
6295 AC_MSG_CHECKING([whether $CXX_BASE defines __class_type_info in cxxabi.h])
6297 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6300 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
6302 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
6303 AC_MSG_RESULT([yes])
6304 ], [AC_MSG_RESULT([no])])
6307 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_allocate_exception in cxxabi.h])
6309 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6311 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6313 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6314 AC_MSG_RESULT([yes])
6315 ], [AC_MSG_RESULT([no])])
6318 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_eh_globals in cxxabi.h])
6320 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6323 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6325 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6326 AC_MSG_RESULT([yes])
6327 ], [AC_MSG_RESULT([no])])
6330 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exceptions in cxxabi.h])
6332 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6335 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6337 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6338 AC_MSG_RESULT([yes])
6339 ], [AC_MSG_RESULT([no])])
6342 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_get_globals in cxxabi.h])
6344 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6346 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6348 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6349 AC_MSG_RESULT([yes])
6350 ], [AC_MSG_RESULT([no])])
6353 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_current_exception_type in cxxabi.h])
6355 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6357 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6359 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6360 AC_MSG_RESULT([yes])
6361 ], [AC_MSG_RESULT([no])])
6364 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_throw in cxxabi.h])
6366 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6368 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6370 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6371 AC_MSG_RESULT([yes])
6372 ], [AC_MSG_RESULT([no])])
6375 AC_MSG_CHECKING([whether $CXX_BASE defines __si_class_type_info in cxxabi.h])
6377 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6380 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6382 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6383 AC_MSG_RESULT([yes])
6384 ], [AC_MSG_RESULT([no])])
6387 AC_MSG_CHECKING([whether $CXX_BASE defines __vmi_class_type_info in cxxabi.h])
6389 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6392 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6394 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6395 AC_MSG_RESULT([yes])
6396 ], [AC_MSG_RESULT([no])])
6399 dnl Available in GCC 4.9 and at least since Clang 3.4:
6400 AC_MSG_CHECKING([whether $CXX_BASE supports __attribute__((warn_unused))])
6402 save_CXXFLAGS=$CXXFLAGS
6403 CXXFLAGS="$CXXFLAGS -Werror"
6404 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6405 struct __attribute__((warn_unused)) dummy {};
6407 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6408 AC_MSG_RESULT([yes])
6409 ], [AC_MSG_RESULT([no])])
6410 CXXFLAGS=$save_CXXFLAGS
6414 AC_SUBST(HAVE_GCC_AVX)
6415 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6416 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6417 AC_SUBST(HAVE_GCC_STACK_CLASH_PROTECTION)
6419 dnl ===================================================================
6420 dnl Identify the C++ library
6421 dnl ===================================================================
6423 AC_MSG_CHECKING([what the C++ library is])
6425 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6431 [CPP_LIBRARY=GLIBCXX
6432 cpp_library_name="GNU libstdc++"
6434 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6436 #ifndef _LIBCPP_VERSION
6441 cpp_library_name="LLVM libc++"
6442 AC_DEFINE([HAVE_LIBCXX])
6444 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6451 cpp_library_name="Microsoft"
6453 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6454 AC_MSG_RESULT([$cpp_library_name])
6457 dnl ===================================================================
6459 dnl ===================================================================
6460 AC_PATH_PROG(GPERF, gperf)
6461 if test -z "$GPERF"; then
6462 AC_MSG_ERROR([gperf not found but needed. Install it.])
6464 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6465 GPERF=`cygpath -m $GPERF`
6467 AC_MSG_CHECKING([whether gperf is new enough])
6468 my_gperf_ver1=$($GPERF --version | head -n 1)
6469 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
6470 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
6471 if test "$my_gperf_ver3" -ge 301; then
6472 AC_MSG_RESULT([yes ($my_gperf_ver2)])
6474 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
6478 dnl ===================================================================
6479 dnl Check for system libcmis
6480 dnl ===================================================================
6481 # libcmis requires curl and we can't build curl for iOS
6482 if test $_os != iOS; then
6483 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2])
6488 AC_SUBST(ENABLE_LIBCMIS)
6490 dnl ===================================================================
6492 dnl ===================================================================
6494 AC_MSG_CHECKING([whether $CXX_BASE supports C++17])
6496 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6497 if test "$with_latest_c__" = yes; then
6498 CXXFLAGS_CXX11=-std:c++latest
6500 CXXFLAGS_CXX11=-std:c++17
6502 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -Zc:__cplusplus"
6503 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6504 my_flags='-std=c++17 -std=c++1z'
6505 if test "$with_latest_c__" = yes; then
6506 my_flags="-std=gnu++2a -std=c++2a $my_flags"
6508 for flag in $my_flags; do
6509 if test "$COM" = MSC; then
6510 flag="-Xclang $flag"
6512 save_CXXFLAGS=$CXXFLAGS
6513 CXXFLAGS="$CXXFLAGS $flag -Werror"
6514 if test "$SYSTEM_LIBCMIS" = TRUE; then
6515 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6518 dnl Clang 3.9 supports __float128 since
6519 dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
6520 dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
6521 dnl hacky workaround to be able to include <vector> (as is done in the main check whether
6522 dnl $flag is supported below, so check this first):
6524 my_float128hack_impl=-D__float128=void
6525 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6527 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6531 dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
6532 dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
6533 dnl is available during its build, but it's usually built using GCC, and so c++config.h
6534 dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
6535 dnl place where __float128 is used is in a template specialization, -D__float128=void
6536 dnl will avoid the problem there while still causing a problem if somebody actually uses
6537 dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
6538 dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
6539 dnl "fixed" with this hack):
6540 CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
6541 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6543 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6546 ],[my_float128hack=$my_float128hack_impl])
6548 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6549 #include <algorithm>
6550 #include <functional>
6553 #if defined SYSTEM_LIBCMIS
6554 // See ucb/source/ucp/cmis/auth_provider.hxx:
6555 #if !defined __clang__
6556 #pragma GCC diagnostic push
6557 #pragma GCC diagnostic ignored "-Wdeprecated"
6558 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6560 #include <libcmis/libcmis.hxx>
6561 #if !defined __clang__
6562 #pragma GCC diagnostic pop
6566 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6567 std::sort(v.begin(), v.end(), fn);
6569 ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
6571 CXXFLAGS=$save_CXXFLAGS
6572 if test -n "$CXXFLAGS_CXX11"; then
6577 if test -n "$CXXFLAGS_CXX11"; then
6578 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6582 AC_SUBST(CXXFLAGS_CXX11)
6584 if test "$GCC" = "yes"; then
6585 save_CXXFLAGS=$CXXFLAGS
6586 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6588 CXXFLAGS=$save_CXXFLAGS
6589 AC_SUBST(ATOMIC_LIB)
6592 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6593 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6594 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6595 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6596 dnl again towards 4.7.2:
6597 if test $CPP_LIBRARY = GLIBCXX; then
6598 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6600 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6602 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6603 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6604 // GCC 4.7.0: 20120322
6605 // GCC 4.7.1: 20120614
6606 // and using a range check is not possible as the mapping between
6607 // __GLIBCXX__ values and GCC versions is not monotonic
6612 ]])], [AC_MSG_RESULT(no, ok)],
6613 [AC_MSG_ERROR(yes)])
6617 AC_MSG_CHECKING([whether $CXX_BASE supports C++11 without Language Defect 757])
6618 save_CXXFLAGS=$CXXFLAGS
6619 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6622 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6625 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6641 a thinga[]={{0,0}, {1,1}};
6642 b thingb[]={{0,0}, {1,1}};
6643 size_t i = sizeof(sal_n_array_size(thinga));
6644 size_t j = sizeof(sal_n_array_size(thingb));
6645 return !(i != 0 && j != 0);
6647 ], [ AC_MSG_RESULT(yes) ],
6648 [ AC_MSG_ERROR(no)])
6650 CXXFLAGS=$save_CXXFLAGS
6652 dnl _Pragma support (may require C++11)
6653 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6654 AC_MSG_CHECKING([whether $CXX_BASE supports _Pragma operator])
6656 save_CXXFLAGS=$CXXFLAGS
6657 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6658 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6659 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6661 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6662 AC_MSG_RESULT([yes])
6663 ], [AC_MSG_RESULT([no])])
6665 CXXFLAGS=$save_CXXFLAGS
6668 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6669 if test "$GCC" = yes; then
6670 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
6672 save_CXXFLAGS=$CXXFLAGS
6673 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6674 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6675 CXXFLAGS=$save_CXXFLAGS
6677 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6678 AC_MSG_RESULT([yes])
6683 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6685 AC_MSG_CHECKING([whether $CXX_BASE supports guaranteed copy elision])
6687 save_CXXFLAGS=$CXXFLAGS
6688 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6689 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6690 // At least VS 2017 15.8.1 defines __cpp_guaranteed_copy_elision as 201606L without actually
6692 #if !defined __cpp_guaranteed_copy_elision || (defined _MSC_VER && !defined __clang__)
6701 void f() { S c(copy()); }
6704 AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
6705 AC_MSG_RESULT([yes])
6706 ], [AC_MSG_RESULT([no])])
6707 CXXFLAGS=$save_CXXFLAGS
6710 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a constinit sorted vectors])
6712 save_CXXFLAGS=$CXXFLAGS
6713 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6714 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6715 #include <algorithm>
6716 #include <initializer_list>
6718 template<typename T> class S {
6722 constexpr S(std::initializer_list<T> i): v_(i) { std::sort(v_.begin(), v_.end()); }
6724 constinit S<int> s{3, 2, 1};
6726 AC_DEFINE([HAVE_CPP_CONSTINIT_SORTED_VECTOR],[1])
6727 AC_MSG_RESULT([yes])
6728 ], [AC_MSG_RESULT([no])])
6729 CXXFLAGS=$save_CXXFLAGS
6732 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a <span> with unsigned size_type])
6734 save_CXXFLAGS=$CXXFLAGS
6735 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6736 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6738 #include <type_traits>
6739 // Don't check size_type directly, as it was called index_type before P1872R0:
6740 void f(std::span<int> s) { static_assert(std::is_unsigned_v<decltype(s.size())>); };
6742 AC_DEFINE([HAVE_CPP_SPAN],[1])
6743 AC_MSG_RESULT([yes])
6744 ], [AC_MSG_RESULT([no])])
6745 CXXFLAGS=$save_CXXFLAGS
6748 AC_MSG_CHECKING([whether $CXX_BASE has GCC bug 87150])
6750 save_CXXFLAGS=$CXXFLAGS
6751 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6752 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6753 struct S1 { S1(S1 &&); };
6755 S1 f(S2 s) { return s; }
6757 AC_DEFINE([HAVE_GCC_BUG_87150],[1])
6758 AC_MSG_RESULT([yes])
6759 ], [AC_MSG_RESULT([no])])
6760 CXXFLAGS=$save_CXXFLAGS
6763 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
6764 dnl uninitialized warning for code like
6767 dnl boost::optional<OString> * g(bool b) {
6768 dnl boost::optional<OString> o;
6770 dnl return new boost::optional<OString>(o);
6773 dnl (as is e.g. present, in a slightly more elaborate form, in
6774 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
6775 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
6776 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
6777 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
6778 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=maybe-uninitialized])
6780 save_CXXFLAGS=$CXXFLAGS
6781 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
6782 if test "$ENABLE_OPTIMIZED" = TRUE; then
6783 CXXFLAGS="$CXXFLAGS -O2"
6785 CXXFLAGS="$CXXFLAGS -O0"
6787 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6796 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
6797 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
6803 char stg[sizeof (S1)];
6811 ]])], [AC_MSG_RESULT([no])], [
6812 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
6813 AC_MSG_RESULT([yes])
6815 CXXFLAGS=$save_CXXFLAGS
6818 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
6820 dnl ===================================================================
6821 dnl CPU Intrinsics support - SSE, AVX
6822 dnl ===================================================================
6824 INTRINSICS_CXXFLAGS=""
6826 if test "$GCC" = "yes"; then
6827 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
6829 save_CXXFLAGS=$CXXFLAGS
6830 CXXFLAGS="$CXXFLAGS -msse2"
6831 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6832 #include <emmintrin.h>
6834 volatile __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6835 c = _mm_xor_si128 (a, b);
6839 [can_compile_sse2=yes],
6840 [can_compile_sse2=no])
6842 CXXFLAGS=$save_CXXFLAGS
6843 AC_MSG_RESULT([${can_compile_sse2}])
6844 if test "${can_compile_sse2}" = "yes" ; then
6845 INTRINSICS_CXXFLAGS="-msse2"
6847 AC_MSG_WARN([cannot compile SSE2 intrinsics])
6850 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
6852 save_CXXFLAGS=$CXXFLAGS
6853 CXXFLAGS="$CXXFLAGS -mssse3"
6854 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6855 #include <tmmintrin.h>
6857 volatile __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6858 c = _mm_maddubs_epi16 (a, b);
6862 [can_compile_ssse3=yes],
6863 [can_compile_ssse3=no])
6865 CXXFLAGS=$save_CXXFLAGS
6866 AC_MSG_RESULT([${can_compile_ssse3}])
6867 if test "${can_compile_ssse3}" = "yes" ; then
6868 INTRINSICS_CXXFLAGS="-mssse3"
6870 AC_MSG_WARN([cannot compile SSSE3 intrinsics])
6873 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
6875 save_CXXFLAGS=$CXXFLAGS
6876 CXXFLAGS="$CXXFLAGS -mavx"
6877 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6878 #include <immintrin.h>
6880 volatile __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
6881 c = _mm256_xor_ps(a, b);
6885 [can_compile_avx=yes],
6886 [can_compile_avx=no])
6888 CXXFLAGS=$save_CXXFLAGS
6889 AC_MSG_RESULT([${can_compile_avx}])
6890 if test "${can_compile_avx}" = "yes" ; then
6891 INTRINSICS_CXXFLAGS="-mavx"
6893 AC_MSG_WARN([cannot compile AVX intrinsics])
6896 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
6898 save_CXXFLAGS=$CXXFLAGS
6899 CXXFLAGS="$CXXFLAGS -mavx2"
6900 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6901 #include <immintrin.h>
6903 volatile __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
6904 c = _mm256_maddubs_epi16(a, b);
6908 [can_compile_avx2=yes],
6909 [can_compile_avx2=no])
6911 CXXFLAGS=$save_CXXFLAGS
6912 AC_MSG_RESULT([${can_compile_avx2}])
6913 if test "${can_compile_avx2}" = "yes" ; then
6914 INTRINSICS_CXXFLAGS="-mavx2"
6916 AC_MSG_WARN([cannot compile AVX2 intrinsics])
6920 AC_SUBST([INTRINSICS_CXXFLAGS])
6922 dnl ===================================================================
6923 dnl system stl sanity tests
6924 dnl ===================================================================
6925 if test "$_os" != "WINNT"; then
6929 save_CPPFLAGS="$CPPFLAGS"
6930 if test -n "$MACOSX_SDK_PATH"; then
6931 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6934 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6936 if test "$CPP_LIBRARY" = GLIBCXX; then
6937 dnl gcc#19664, gcc#22482, rhbz#162935
6938 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6939 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6940 AC_MSG_RESULT([$stlvisok])
6941 if test "$stlvisok" = "no"; then
6942 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
6946 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6947 # when we don't make any dynamic libraries?
6948 if test "$DISABLE_DYNLOADING" = ""; then
6949 AC_MSG_CHECKING([if $CXX_BASE is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6950 cat > conftestlib1.cc <<_ACEOF
6951 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6952 struct S2: S1<int> { virtual ~S2(); };
6955 cat > conftestlib2.cc <<_ACEOF
6956 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6957 struct S2: S1<int> { virtual ~S2(); };
6958 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6960 gccvisinlineshiddenok=yes
6961 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6962 gccvisinlineshiddenok=no
6964 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6965 dnl known to not work with -z defs (unsetting which makes the test
6967 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6968 if test "$COM_IS_CLANG" = TRUE; then
6969 for i in $CXX $CXXFLAGS; do
6972 my_linkflagsnoundefs=
6978 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6979 gccvisinlineshiddenok=no
6984 AC_MSG_RESULT([$gccvisinlineshiddenok])
6985 if test "$gccvisinlineshiddenok" = "no"; then
6986 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6990 AC_MSG_CHECKING([if $CXX_BASE has a visibility bug with class-level attributes (GCC bug 26905)])
6991 cat >visibility.cxx <<_ACEOF
6992 #pragma GCC visibility push(hidden)
6993 struct __attribute__ ((visibility ("default"))) TestStruct {
6996 __attribute__ ((visibility ("default"))) void TestFunc() {
7000 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
7005 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
7008 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
7020 rm -f visibility.s visibility.cxx
7022 AC_MSG_RESULT([$gccvisbroken])
7023 if test "$gccvisbroken" = "yes"; then
7024 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
7027 CPPFLAGS="$save_CPPFLAGS"
7032 dnl ===================================================================
7034 dnl ===================================================================
7036 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
7037 if test "$GCC" = "yes"; then
7038 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-enforce-eh-specs])
7040 save_CXXFLAGS=$CXXFLAGS
7041 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
7042 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
7043 CXXFLAGS=$save_CXXFLAGS
7045 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
7046 AC_MSG_RESULT([yes])
7051 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
7053 dnl ===================================================================
7054 dnl Compiler plugins
7055 dnl ===================================================================
7058 # currently only Clang
7060 if test "$COM_IS_CLANG" != "TRUE"; then
7061 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
7062 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
7063 enable_compiler_plugins=no
7067 if test "$COM_IS_CLANG" = "TRUE"; then
7068 if test -n "$enable_compiler_plugins"; then
7069 compiler_plugins="$enable_compiler_plugins"
7070 elif test -n "$ENABLE_DBGUTIL"; then
7071 compiler_plugins=test
7075 if test "$compiler_plugins" != no -a "$my_apple_clang" != yes; then
7076 if test "$CLANGVER" -lt 50002; then
7077 if test "$compiler_plugins" = yes; then
7078 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 5.0.2.])
7084 if test "$compiler_plugins" != "no"; then
7085 dnl The prefix where Clang resides, override to where Clang resides if
7086 dnl using a source build:
7087 if test -z "$CLANGDIR"; then
7088 CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $CXX))))
7090 # Assume Clang is self-built, but allow overriding COMPILER_PLUGINS_CXX to the compiler Clang was built with.
7091 if test -z "$COMPILER_PLUGINS_CXX"; then
7092 COMPILER_PLUGINS_CXX=[$(echo $CXX | sed -e 's/-fsanitize=[^ ]*//g')]
7094 clangbindir=$CLANGDIR/bin
7095 if test "$build_os" = "cygwin"; then
7096 clangbindir=$(cygpath -u "$clangbindir")
7098 AC_PATH_PROG(LLVM_CONFIG, llvm-config,[],"$clangbindir" $PATH)
7099 if test -n "$LLVM_CONFIG"; then
7100 COMPILER_PLUGINS_CXXFLAGS=$($LLVM_CONFIG --cxxflags)
7101 COMPILER_PLUGINS_LINKFLAGS=$($LLVM_CONFIG --ldflags --libs --system-libs | tr '\n' ' ')
7102 if test -z "$CLANGLIBDIR"; then
7103 CLANGLIBDIR=$($LLVM_CONFIG --libdir)
7105 # Try if clang is built from source (in which case its includes are not together with llvm includes).
7106 # src-root is [llvm-toplevel-src-dir]/llvm, clang is [llvm-toplevel-src-dir]/clang
7107 clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
7108 if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d "$clangsrcdir/clang/include"; then
7109 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangsrcdir/clang/include"
7111 # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
7112 clangobjdir=$($LLVM_CONFIG --obj-root)
7113 if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
7114 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
7117 AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
7121 save_CPPFLAGS=$CPPFLAGS
7122 save_CXXFLAGS=$CXXFLAGS
7123 save_LDFLAGS=$LDFLAGS
7125 CXX=$COMPILER_PLUGINS_CXX
7126 CXXCPP="$COMPILER_PLUGINS_CXX -E"
7127 CPPFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7128 CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7129 AC_CHECK_HEADER(clang/Basic/SourceLocation.h,
7130 [COMPILER_PLUGINS=TRUE],
7132 if test "$compiler_plugins" = "yes"; then
7133 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
7135 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
7136 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
7139 dnl TODO: Windows doesn't use LO_CLANG_SHARED_PLUGINS for now, see corresponding TODO
7140 dnl comment in compilerplugins/Makefile-clang.mk:
7141 if test -n "$COMPILER_PLUGINS" && test "$_os" != "WINNT"; then
7143 AC_MSG_CHECKING([for clang libraries to use])
7144 if test -z "$CLANGTOOLLIBS"; then
7145 LIBS="-lclangTooling -lclangDriver -lclangFrontend -lclangParse -lclangSema -lclangEdit \
7146 -lclangAnalysis -lclangAST -lclangLex -lclangSerialization -lclangBasic $COMPILER_PLUGINS_LINKFLAGS"
7148 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7149 [[ clang::FullSourceLoc().dump(); ]])
7150 ],[CLANGTOOLLIBS="$LIBS"],[])
7152 if test -z "$CLANGTOOLLIBS"; then
7153 LIBS="-lclang-cpp $COMPILER_PLUGINS_LINKFLAGS"
7155 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7156 [[ clang::FullSourceLoc().dump(); ]])
7157 ],[CLANGTOOLLIBS="$LIBS"],[])
7159 AC_MSG_RESULT([$CLANGTOOLLIBS])
7160 if test -z "$CLANGTOOLLIBS"; then
7161 if test "$compiler_plugins" = "yes"; then
7162 AC_MSG_ERROR([Cannot find Clang libraries to build compiler plugins.])
7164 AC_MSG_WARN([Cannot find Clang libraries to build compiler plugins, plugins disabled])
7165 add_warning "Cannot find Clang libraries to build compiler plugins, plugins disabled."
7169 if test -n "$COMPILER_PLUGINS"; then
7170 if test -z "$CLANGSYSINCLUDE"; then
7171 if test -n "$LLVM_CONFIG"; then
7172 # Path to the clang system headers (no idea if there's a better way to get it).
7173 CLANGSYSINCLUDE=$($LLVM_CONFIG --libdir)/clang/$($LLVM_CONFIG --version | sed 's/svn//')/include
7180 CPPFLAGS=$save_CPPFLAGS
7181 CXXFLAGS=$save_CXXFLAGS
7182 LDFLAGS=$save_LDFLAGS
7187 if test "$enable_compiler_plugins" = "yes"; then
7188 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
7191 AC_SUBST(COMPILER_PLUGINS)
7192 AC_SUBST(COMPILER_PLUGINS_CXX)
7193 AC_SUBST(COMPILER_PLUGINS_CXXFLAGS)
7194 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
7195 AC_SUBST(COMPILER_PLUGINS_DEBUG)
7196 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
7198 AC_SUBST(CLANGLIBDIR)
7199 AC_SUBST(CLANGTOOLLIBS)
7200 AC_SUBST(CLANGSYSINCLUDE)
7202 # Plugin to help linker.
7203 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
7204 # This makes --enable-lto build with clang work.
7207 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
7208 AC_SUBST(HAVE_POSIX_FALLOCATE)
7210 dnl ===================================================================
7211 dnl Custom build version
7212 dnl ===================================================================
7214 AC_MSG_CHECKING([whether to add custom build version])
7215 if test "$with_build_version" != ""; then
7216 BUILD_VER_STRING=$with_build_version
7217 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
7222 AC_SUBST(BUILD_VER_STRING)
7224 JITC_PROCESSOR_TYPE=""
7225 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
7226 # IBMs JDK needs this...
7227 JITC_PROCESSOR_TYPE=6
7228 export JITC_PROCESSOR_TYPE
7230 AC_SUBST([JITC_PROCESSOR_TYPE])
7232 # Misc Windows Stuff
7233 AC_ARG_WITH(ucrt-dir,
7234 AS_HELP_STRING([--with-ucrt-dir],
7235 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
7236 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
7237 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
7238 Windows6.1-KB2999226-x64.msu
7239 Windows6.1-KB2999226-x86.msu
7240 Windows8.1-KB2999226-x64.msu
7241 Windows8.1-KB2999226-x86.msu
7242 Windows8-RT-KB2999226-x64.msu
7243 Windows8-RT-KB2999226-x86.msu
7244 A zip archive including those files is available from Microsoft site:
7245 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
7247 UCRT_REDISTDIR="$with_ucrt_dir"
7248 if test $_os = "WINNT"; then
7251 MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
7252 MSVC_DLLS="$msvcdlls"
7253 MSM_PATH=`win_short_path_for_make "$msmdir"`
7254 # MSVC 15.3 changed it to VC141
7255 if echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
7256 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
7258 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
7261 if test "$UCRT_REDISTDIR" = "no"; then
7262 dnl explicitly disabled
7265 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
7266 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
7267 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
7268 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
7269 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
7270 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
7272 if test -n "$PKGFORMAT"; then
7273 for i in $PKGFORMAT; do
7276 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
7277 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
7286 AC_SUBST(UCRT_REDISTDIR)
7287 AC_SUBST(MSVC_DLL_PATH)
7291 dnl ===================================================================
7293 dnl ===================================================================
7294 if test "$ENABLE_JAVA" != ""; then
7296 # Windows-specific tests
7297 if test "$build_os" = "cygwin"; then
7298 if test "$BITNESS_OVERRIDE" = 64; then
7304 if test -z "$with_jdk_home"; then
7305 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
7306 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
7307 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
7308 if test -n "$regvalue"; then
7310 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
7313 if test -z "$with_jdk_home"; then
7315 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
7316 if test -n "$regvalue"; then
7322 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
7323 with_jdk_home="$_jdk_home"
7324 howfound="found automatically"
7326 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
7329 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
7330 howfound="you passed"
7334 # 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.
7335 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
7336 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
7337 with_jdk_home=`/usr/libexec/java_home`
7340 JAVA_HOME=; export JAVA_HOME
7341 if test -z "$with_jdk_home"; then
7342 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
7344 _java_path="$with_jdk_home/bin/$with_java"
7345 dnl Check if there is a Java interpreter at all.
7346 if test -x "$_java_path"; then
7347 JAVAINTERPRETER=$_java_path
7349 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
7353 dnl Check that the JDK found is correct architecture (at least 2 reasons to
7354 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
7355 dnl loaded by java to run JunitTests:
7356 if test "$build_os" = "cygwin"; then
7357 shortjdkhome=`cygpath -d "$with_jdk_home"`
7358 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
7359 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
7360 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7361 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
7362 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7363 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7366 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
7367 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
7369 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
7370 elif test "$cross_compiling" != "yes"; then
7372 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
7373 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
7374 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
7375 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7378 *) # assumption: everything else 32-bit
7379 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
7380 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7381 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7388 dnl ===================================================================
7390 dnl ===================================================================
7392 # Note that JAVA_HOME as for now always means the *build* platform's
7393 # JAVA_HOME. Whether all the complexity here actually is needed any
7394 # more or not, no idea.
7396 if test "$ENABLE_JAVA" != ""; then
7398 AC_MSG_CHECKING([the installed JDK])
7399 if test -n "$JAVAINTERPRETER"; then
7400 dnl java -version sends output to stderr!
7401 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
7402 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7403 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
7404 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7405 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
7406 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7407 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
7410 dnl IBM JDK specific tests
7411 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
7412 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7414 if test "$_jdk_ver" -lt 10800; then
7415 AC_MSG_ERROR([IBM JDK is too old, you need at least 8])
7418 AC_MSG_RESULT([found (IBM JDK $_jdk)])
7420 if test "$with_jdk_home" = ""; then
7421 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
7422 you must use the "--with-jdk-home" configure option explicitly])
7425 JAVA_HOME=$with_jdk_home
7429 dnl Sun JDK specific tests
7430 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
7431 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7433 if test "$_jdk_ver" -lt 10800; then
7434 AC_MSG_ERROR([JDK is too old, you need at least 8])
7436 if test "$_jdk_ver" -gt 10800; then
7437 JAVA_CLASSPATH_NOT_SET=TRUE
7440 AC_MSG_RESULT([found (JDK $_jdk)])
7441 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
7442 if test "$_os" = "WINNT"; then
7443 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
7446 # set to limit VM usage for JunitTests
7448 # set to limit VM usage for javac
7449 JAVAFLAGS=-J-Xmx128M
7452 AC_MSG_ERROR([Java not found. You need at least JDK 8])
7460 dnl ===================================================================
7461 dnl Checks for javac
7462 dnl ===================================================================
7463 if test "$ENABLE_JAVA" != ""; then
7464 javacompiler="javac"
7465 : ${JAVA_SOURCE_VER=8}
7466 : ${JAVA_TARGET_VER=8}
7467 if test -z "$with_jdk_home"; then
7468 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
7470 _javac_path="$with_jdk_home/bin/$javacompiler"
7471 dnl Check if there is a Java compiler at all.
7472 if test -x "$_javac_path"; then
7473 JAVACOMPILER=$_javac_path
7476 if test -z "$JAVACOMPILER"; then
7477 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7479 if test "$build_os" = "cygwin"; then
7480 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7481 JAVACOMPILER="${JAVACOMPILER}.exe"
7483 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7487 dnl ===================================================================
7488 dnl Checks for javadoc
7489 dnl ===================================================================
7490 if test "$ENABLE_JAVA" != ""; then
7491 if test -z "$with_jdk_home"; then
7492 AC_PATH_PROG(JAVADOC, javadoc)
7494 _javadoc_path="$with_jdk_home/bin/javadoc"
7495 dnl Check if there is a javadoc at all.
7496 if test -x "$_javadoc_path"; then
7497 JAVADOC=$_javadoc_path
7499 AC_PATH_PROG(JAVADOC, javadoc)
7502 if test -z "$JAVADOC"; then
7503 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7505 if test "$build_os" = "cygwin"; then
7506 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7507 JAVADOC="${JAVADOC}.exe"
7509 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7512 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7513 JAVADOCISGJDOC="yes"
7516 AC_SUBST(JAVADOCISGJDOC)
7518 if test "$ENABLE_JAVA" != ""; then
7519 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7520 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7521 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7522 # try to recover first by looking whether we have an alternative
7523 # system as in Debian or newer SuSEs where following /usr/bin/javac
7524 # over /etc/alternatives/javac leads to the right bindir where we
7525 # just need to strip a bit away to get a valid JAVA_HOME
7526 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7527 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7528 # maybe only one level of symlink (e.g. on Mac)
7529 JAVA_HOME=$(readlink $JAVACOMPILER)
7530 if test "$(dirname $JAVA_HOME)" = "."; then
7531 # we've got no path to trim back
7536 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7537 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7538 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7539 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7541 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it...
7542 if test "$JAVA_HOME" != "/usr"; then
7543 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7544 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7545 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7546 dnl Tiger already returns a JDK path...
7547 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7549 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7550 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7551 dnl that checks which version to run
7552 if test -f "$JAVA_HOME"; then
7553 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7558 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7560 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7561 if test -z "$JAVA_HOME"; then
7562 if test "x$with_jdk_home" = "x"; then
7563 cat > findhome.java <<_ACEOF
7564 [import java.io.File;
7568 public static void main(String args[])
7570 String jrelocation = System.getProperty("java.home");
7571 File jre = new File(jrelocation);
7572 System.out.println(jre.getParent());
7576 AC_MSG_CHECKING([if javac works])
7577 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7578 AC_TRY_EVAL(javac_cmd)
7579 if test $? = 0 -a -f ./findhome.class; then
7580 AC_MSG_RESULT([javac works])
7582 echo "configure: javac test failed" >&5
7583 cat findhome.java >&5
7584 AC_MSG_ERROR([javac does not work - java projects will not build!])
7586 AC_MSG_CHECKING([if gij knows its java.home])
7587 JAVA_HOME=`$JAVAINTERPRETER findhome`
7588 if test $? = 0 -a "$JAVA_HOME" != ""; then
7589 AC_MSG_RESULT([$JAVA_HOME])
7591 echo "configure: java test failed" >&5
7592 cat findhome.java >&5
7593 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7595 # clean-up after ourselves
7596 rm -f ./findhome.java ./findhome.class
7598 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7602 # now check if $JAVA_HOME is really valid
7603 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7604 case "${JAVA_HOME}" in
7605 /Library/Java/JavaVirtualMachines/*)
7608 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7611 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7614 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7617 if test "$JAVA_HOME_OK" = "NO"; then
7618 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7619 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7620 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
7621 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7622 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7623 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
7625 PathFormat "$JAVA_HOME"
7626 JAVA_HOME="$formatted_path"
7629 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7632 AC_MSG_CHECKING([for JAWT lib])
7633 if test "$_os" = WINNT; then
7634 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7639 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7640 JAVA_ARCH=$my_java_arch
7655 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7656 JAVA_ARCH=$my_java_arch
7659 my_java_arch=sparcv9
7665 my_java_arch=$host_cpu
7668 # This is where JDK9 puts the library
7669 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7670 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7672 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7674 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7676 AC_MSG_RESULT([$JAWTLIB])
7680 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7684 JAVAINC="-I$JAVA_HOME/include"
7685 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7686 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7690 JAVAINC="-I$JAVA_HOME/include/win32"
7691 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7695 if test -d "$JAVA_HOME/include/darwin"; then
7696 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7698 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7703 JAVAINC="-I$JAVA_HOME/include"
7704 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7708 JAVAINC="-I$JAVA_HOME/include"
7709 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7710 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7711 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7712 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7716 JAVAINC="-I$JAVA_HOME/include"
7717 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7718 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7722 JAVAINC="-I$JAVA_HOME/include"
7723 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7724 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7728 JAVAINC="-I$JAVA_HOME/include"
7729 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7730 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7734 JAVAINC="-I$JAVA_HOME/include"
7735 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7736 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7740 JAVAINC="-I$JAVA_HOME/include"
7741 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7742 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7746 SOLARINC="$SOLARINC $JAVAINC"
7748 AC_SUBST(JAVACOMPILER)
7750 AC_SUBST(JAVAINTERPRETER)
7751 AC_SUBST(JAVAIFLAGS)
7753 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7755 AC_SUBST(JAVA_SOURCE_VER)
7756 AC_SUBST(JAVA_TARGET_VER)
7760 dnl ===================================================================
7761 dnl Export file validation
7762 dnl ===================================================================
7763 AC_MSG_CHECKING([whether to enable export file validation])
7764 if test "$with_export_validation" != "no"; then
7765 if test -z "$ENABLE_JAVA"; then
7766 if test "$with_export_validation" = "yes"; then
7767 AC_MSG_ERROR([requested, but Java is disabled])
7769 AC_MSG_RESULT([no, as Java is disabled])
7771 elif ! test -d "${SRC_ROOT}/schema"; then
7772 if test "$with_export_validation" = "yes"; then
7773 AC_MSG_ERROR([requested, but schema directory is missing (it is excluded from tarballs)])
7775 AC_MSG_RESULT([no, schema directory is missing (it is excluded from tarballs)])
7778 AC_MSG_RESULT([yes])
7779 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7781 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7782 if test -z "$ODFVALIDATOR"; then
7783 # remember to download the ODF toolkit with validator later
7784 AC_MSG_NOTICE([no odfvalidator found, will download it])
7785 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7786 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7788 # and fetch name of odfvalidator jar name from download.lst
7789 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7790 AC_SUBST(ODFVALIDATOR_JAR)
7792 if test -z "$ODFVALIDATOR_JAR"; then
7793 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7796 if test "$build_os" = "cygwin"; then
7797 # In case of Cygwin it will be executed from Windows,
7798 # so we need to run bash and absolute path to validator
7799 # so instead of "odfvalidator" it will be
7800 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7801 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7803 ODFVALIDATOR="sh $ODFVALIDATOR"
7805 AC_SUBST(ODFVALIDATOR)
7808 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7809 if test -z "$OFFICEOTRON"; then
7810 # remember to download the officeotron with validator later
7811 AC_MSG_NOTICE([no officeotron found, will download it])
7812 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7813 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7815 # and fetch name of officeotron jar name from download.lst
7816 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7817 AC_SUBST(OFFICEOTRON_JAR)
7819 if test -z "$OFFICEOTRON_JAR"; then
7820 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7823 # check version of existing officeotron
7824 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7825 if test 0"$OFFICEOTRON_VER" -lt 704; then
7826 AC_MSG_ERROR([officeotron too old])
7829 if test "$build_os" = "cygwin"; then
7830 # In case of Cygwin it will be executed from Windows,
7831 # so we need to run bash and absolute path to validator
7832 # so instead of "odfvalidator" it will be
7833 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7834 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7836 OFFICEOTRON="sh $OFFICEOTRON"
7839 AC_SUBST(OFFICEOTRON)
7844 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7845 if test "$with_bffvalidator" != "no"; then
7846 AC_DEFINE(HAVE_BFFVALIDATOR)
7848 if test "$with_export_validation" = "no"; then
7849 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7852 if test "$with_bffvalidator" = "yes"; then
7853 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7855 BFFVALIDATOR="$with_bffvalidator"
7858 if test "$build_os" = "cygwin"; then
7859 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7860 AC_MSG_RESULT($BFFVALIDATOR)
7862 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7864 elif test -n "$BFFVALIDATOR"; then
7865 # We are not in Cygwin but need to run Windows binary with wine
7866 AC_PATH_PROGS(WINE, wine)
7868 # so swap in a shell wrapper that converts paths transparently
7869 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7870 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7871 AC_SUBST(BFFVALIDATOR_EXE)
7872 AC_MSG_RESULT($BFFVALIDATOR)
7874 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7876 AC_SUBST(BFFVALIDATOR)
7881 dnl ===================================================================
7882 dnl Check for C preprocessor to use
7883 dnl ===================================================================
7884 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7885 if test -n "$with_idlc_cpp"; then
7886 AC_MSG_RESULT([$with_idlc_cpp])
7887 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7889 AC_MSG_RESULT([ucpp])
7890 AC_MSG_CHECKING([which ucpp tp use])
7891 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7892 AC_MSG_RESULT([external])
7893 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7895 AC_MSG_RESULT([internal])
7896 BUILD_TYPE="$BUILD_TYPE UCPP"
7899 AC_SUBST(SYSTEM_UCPP)
7901 dnl ===================================================================
7902 dnl Check for epm (not needed for Windows)
7903 dnl ===================================================================
7904 AC_MSG_CHECKING([whether to enable EPM for packing])
7905 if test "$enable_epm" = "yes"; then
7906 AC_MSG_RESULT([yes])
7907 if test "$_os" != "WINNT"; then
7908 if test $_os = Darwin; then
7910 elif test -n "$with_epm"; then
7913 AC_PATH_PROG(EPM, epm, no)
7915 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7916 AC_MSG_NOTICE([EPM will be built.])
7917 BUILD_TYPE="$BUILD_TYPE EPM"
7918 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7920 # Gentoo has some epm which is something different...
7921 AC_MSG_CHECKING([whether the found epm is the right epm])
7922 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7923 AC_MSG_RESULT([yes])
7925 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7927 AC_MSG_CHECKING([epm version])
7928 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7929 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7930 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7931 AC_MSG_RESULT([OK, >= 3.7])
7933 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7934 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7939 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7940 AC_MSG_CHECKING([for rpm])
7941 for a in "$RPM" rpmbuild rpm; do
7942 $a --usage >/dev/null 2> /dev/null
7943 if test $? -eq 0; then
7947 $a --version >/dev/null 2> /dev/null
7948 if test $? -eq 0; then
7954 if test -z "$RPM"; then
7955 AC_MSG_ERROR([not found])
7956 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7957 RPM_PATH=`which $RPM`
7958 AC_MSG_RESULT([$RPM_PATH])
7959 SCPDEFS="$SCPDEFS -DWITH_RPM"
7961 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7964 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7965 AC_PATH_PROG(DPKG, dpkg, no)
7966 if test "$DPKG" = "no"; then
7967 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7970 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7971 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7972 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7973 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7974 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7975 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
7976 AC_MSG_RESULT([yes])
7979 if echo "$PKGFORMAT" | $GREP -q rpm; then
7981 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7982 add_warning "the rpms will need to be installed with --nodeps"
7986 AC_MSG_WARN([the ${_pt}s will not be relocatable])
7987 add_warning "the ${_pt}s will not be relocatable"
7988 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7989 relocation will work, you need to patch your epm with the
7990 patch in epm/epm-3.7.patch or build with
7991 --with-epm=internal which will build a suitable epm])
7996 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7997 AC_PATH_PROG(PKGMK, pkgmk, no)
7998 if test "$PKGMK" = "no"; then
7999 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
8006 for i in $PKGFORMAT; do
8008 aix | bsd | deb | pkg | rpm | native | portable)
8010 [--with-package-format='$PKGFORMAT' requires --enable-epm])
8020 if test "$enable_lotuswordpro" = "yes"; then
8023 AC_SUBST(ENABLE_LWP)
8025 dnl ===================================================================
8026 dnl Check for building ODK
8027 dnl ===================================================================
8028 if test "$enable_odk" = no; then
8031 if test "$with_doxygen" = no; then
8032 AC_MSG_CHECKING([for doxygen])
8036 if test "$with_doxygen" = yes; then
8037 AC_PATH_PROG([DOXYGEN], [doxygen])
8038 if test -z "$DOXYGEN"; then
8039 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
8041 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
8042 if ! dot -V 2>/dev/null; then
8043 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
8047 AC_MSG_CHECKING([for doxygen])
8048 DOXYGEN=$with_doxygen
8049 AC_MSG_RESULT([$DOXYGEN])
8051 if test -n "$DOXYGEN"; then
8052 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
8053 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
8054 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
8055 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
8062 AC_MSG_CHECKING([whether to build the ODK])
8063 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
8064 AC_MSG_RESULT([yes])
8066 if test "$with_java" != "no"; then
8067 AC_MSG_CHECKING([whether to build unowinreg.dll])
8068 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
8069 # build on Win by default
8070 enable_build_unowinreg=yes
8072 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
8076 AC_MSG_RESULT([yes])
8077 BUILD_UNOWINREG=TRUE
8079 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
8080 if test -z "$with_mingw_cross_compiler"; then
8082 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
8083 elif test -x "$with_mingw_cross_compiler"; then
8084 MINGWCXX="$with_mingw_cross_compiler"
8086 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
8089 if test "$MINGWCXX" = "false"; then
8090 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
8093 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
8094 if test -x "$mingwstrip_test"; then
8095 MINGWSTRIP="$mingwstrip_test"
8097 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
8100 if test "$MINGWSTRIP" = "false"; then
8101 AC_MSG_ERROR(MinGW32 binutils not found.)
8105 BUILD_TYPE="$BUILD_TYPE ODK"
8110 AC_SUBST(BUILD_UNOWINREG)
8112 AC_SUBST(MINGWSTRIP)
8114 dnl ===================================================================
8115 dnl Check for system zlib
8116 dnl ===================================================================
8117 if test "$with_system_zlib" = "auto"; then
8120 with_system_zlib="$with_system_libs"
8123 if test "$enable_fuzzers" != "yes"; then
8124 with_system_zlib=yes
8132 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
8133 dnl and has no pkg-config for it at least on some tinderboxes,
8134 dnl so leaving that out for now
8135 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
8136 AC_MSG_CHECKING([which zlib to use])
8137 if test "$with_system_zlib" = "yes"; then
8138 AC_MSG_RESULT([external])
8140 AC_CHECK_HEADER(zlib.h, [],
8141 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
8142 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
8143 [AC_MSG_ERROR(zlib not found or functional)], [])
8145 AC_MSG_RESULT([internal])
8147 BUILD_TYPE="$BUILD_TYPE ZLIB"
8148 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
8149 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
8151 AC_SUBST(ZLIB_CFLAGS)
8153 AC_SUBST(SYSTEM_ZLIB)
8155 dnl ===================================================================
8156 dnl Check for system jpeg
8157 dnl ===================================================================
8158 AC_MSG_CHECKING([which libjpeg to use])
8159 if test "$with_system_jpeg" = "yes"; then
8160 AC_MSG_RESULT([external])
8162 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
8163 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
8164 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
8165 [AC_MSG_ERROR(jpeg library not found or functional)], [])
8168 AC_MSG_RESULT([internal, libjpeg-turbo])
8169 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
8170 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
8171 if test "$COM" = "MSC"; then
8172 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
8174 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
8178 x86_64 | amd64 | i*86 | x86 | ia32)
8179 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
8180 if test -z "$NASM" -a "$build_os" = "cygwin"; then
8181 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
8182 NASM="$LODE_HOME/opt/bin/nasm"
8183 elif test -x "/opt/lo/bin/nasm"; then
8184 NASM="/opt/lo/bin/nasm"
8188 if test -n "$NASM"; then
8189 AC_MSG_CHECKING([for object file format of host system])
8191 cygwin* | mingw* | pw32* | interix*)
8201 msdosdjgpp* | go32*)
8204 os2-emx*) # not tested
8205 objfmt='MSOMF' # obj
8207 linux*coff* | linux*oldld*)
8223 kfreebsd* | freebsd* | netbsd* | openbsd*)
8224 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8237 solaris* | sunos* | sysv* | sco*)
8247 darwin* | rhapsody* | nextstep* | openstep* | macos*)
8262 AC_MSG_RESULT([$objfmt])
8263 if test "$objfmt" = 'ELF ?'; then
8265 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
8268 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
8270 MSOMF) NAFLAGS='-fobj -DOBJ32';;
8271 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
8272 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
8273 COFF) NAFLAGS='-fcoff -DCOFF';;
8274 a.out) NAFLAGS='-faout -DAOUT';;
8275 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
8276 ELF) NAFLAGS='-felf -DELF';;
8277 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
8278 RDF) NAFLAGS='-frdf -DRDF';;
8279 Mach-O) NAFLAGS='-fmacho -DMACHO';;
8280 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
8282 AC_MSG_RESULT([$NAFLAGS])
8284 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
8285 cat > conftest.asm << EOF
8286 [%line __oline__ "configure"
8294 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
8295 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
8298 echo "configure: failed program was:" >&AC_FD_CC
8299 cat conftest.asm >&AC_FD_CC
8302 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
8308 if test -z "$NASM"; then
8310 ****************************************************************************
8311 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
8315 if test "$build_os" = "cygwin"; then
8317 install a pre-compiled binary for Win32
8319 mkdir -p /opt/lo/bin
8321 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
8324 or get and install one from http://www.nasm.us/
8326 Then re-run autogen.sh
8328 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
8329 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
8334 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
8338 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
8339 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
8346 AC_SUBST(LIBJPEG_CFLAGS)
8347 AC_SUBST(LIBJPEG_LIBS)
8348 AC_SUBST(SYSTEM_LIBJPEG)
8350 dnl ===================================================================
8351 dnl Check for system clucene
8352 dnl ===================================================================
8353 dnl we should rather be using
8354 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
8355 dnl but the contribs-lib check seems tricky
8356 AC_MSG_CHECKING([which clucene to use])
8357 if test "$with_system_clucene" = "yes"; then
8358 AC_MSG_RESULT([external])
8360 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
8361 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
8362 FilterLibs "${CLUCENE_LIBS}"
8363 CLUCENE_LIBS="${filteredlibs}"
8365 save_CXXFLAGS=$CXXFLAGS
8366 save_CPPFLAGS=$CPPFLAGS
8367 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
8368 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
8369 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
8370 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
8371 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
8372 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
8373 CXXFLAGS=$save_CXXFLAGS
8374 CPPFLAGS=$save_CPPFLAGS
8377 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
8379 AC_MSG_RESULT([internal])
8381 BUILD_TYPE="$BUILD_TYPE CLUCENE"
8383 AC_SUBST(SYSTEM_CLUCENE)
8384 AC_SUBST(CLUCENE_CFLAGS)
8385 AC_SUBST(CLUCENE_LIBS)
8387 dnl ===================================================================
8388 dnl Check for system expat
8389 dnl ===================================================================
8390 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
8392 dnl ===================================================================
8393 dnl Check for system xmlsec
8394 dnl ===================================================================
8395 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.28])
8397 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
8398 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
8400 AC_DEFINE([ENABLE_EOT])
8401 AC_MSG_RESULT([yes])
8403 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
8408 AC_SUBST([ENABLE_EOT])
8410 dnl ===================================================================
8411 dnl Check for DLP libs
8412 dnl ===================================================================
8413 AS_IF([test "$COM" = "MSC"],
8414 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
8415 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
8417 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
8419 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
8421 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
8423 AS_IF([test "$COM" = "MSC"],
8424 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
8425 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
8427 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
8429 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
8431 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
8432 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
8434 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
8436 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
8438 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
8440 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
8441 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.15])
8443 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
8444 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
8446 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
8448 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
8449 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
8451 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
8453 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
8455 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
8457 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
8459 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
8460 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
8462 dnl ===================================================================
8463 dnl Check for system lcms2
8464 dnl ===================================================================
8465 if test "$with_system_lcms2" != "yes"; then
8468 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
8469 if test "$GCC" = "yes"; then
8470 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
8472 if test "$COM" = "MSC"; then # override the above
8473 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
8476 dnl ===================================================================
8477 dnl Check for system cppunit
8478 dnl ===================================================================
8479 if test "$_os" != "Android" ; then
8480 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
8483 dnl ===================================================================
8484 dnl Check whether freetype is available
8485 dnl ===================================================================
8486 if test "$test_freetype" = "yes"; then
8487 AC_MSG_CHECKING([whether freetype is available])
8488 # FreeType has 3 different kinds of versions
8489 # * release, like 2.4.10
8490 # * libtool, like 13.0.7 (this what pkg-config returns)
8492 # FreeType's docs/VERSION.DLL provides a table mapping between the three
8495 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
8496 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8497 FilterLibs "${FREETYPE_LIBS}"
8498 FREETYPE_LIBS="${filteredlibs}"
8499 SYSTEM_FREETYPE=TRUE
8501 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
8502 if test "x$ac_config_site_64bit_host" = xYES; then
8503 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
8505 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
8508 AC_SUBST(FREETYPE_CFLAGS)
8509 AC_SUBST(FREETYPE_LIBS)
8510 AC_SUBST([SYSTEM_FREETYPE])
8512 # ===================================================================
8513 # Check for system libxslt
8514 # to prevent incompatibilities between internal libxml2 and external libxslt,
8515 # or vice versa, use with_system_libxml here
8516 # ===================================================================
8517 if test "$with_system_libxml" = "auto"; then
8520 with_system_libxml="$with_system_libs"
8523 if test "$enable_fuzzers" != "yes"; then
8524 with_system_libxml=yes
8526 with_system_libxml=no
8532 AC_MSG_CHECKING([which libxslt to use])
8533 if test "$with_system_libxml" = "yes"; then
8534 AC_MSG_RESULT([external])
8536 if test "$_os" = "Darwin"; then
8537 dnl make sure to use SDK path
8538 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8539 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8541 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8542 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8544 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8545 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8546 FilterLibs "${LIBXSLT_LIBS}"
8547 LIBXSLT_LIBS="${filteredlibs}"
8548 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8549 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8550 FilterLibs "${LIBEXSLT_LIBS}"
8551 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8554 dnl Check for xsltproc
8555 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8556 if test "$XSLTPROC" = "no"; then
8557 AC_MSG_ERROR([xsltproc is required])
8560 AC_MSG_RESULT([internal])
8562 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8564 if test "$cross_compiling" = "yes"; then
8565 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8566 if test "$XSLTPROC" = "no"; then
8567 AC_MSG_ERROR([xsltproc is required])
8571 AC_SUBST(SYSTEM_LIBXSLT)
8572 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8573 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8575 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8577 AC_SUBST(LIBEXSLT_CFLAGS)
8578 AC_SUBST(LIBEXSLT_LIBS)
8579 AC_SUBST(LIBXSLT_CFLAGS)
8580 AC_SUBST(LIBXSLT_LIBS)
8583 # ===================================================================
8584 # Check for system libxml
8585 # ===================================================================
8586 AC_MSG_CHECKING([which libxml to use])
8587 if test "$with_system_libxml" = "yes"; then
8588 AC_MSG_RESULT([external])
8590 if test "$_os" = "Darwin"; then
8591 dnl make sure to use SDK path
8592 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8594 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8595 elif test $_os = iOS; then
8596 dnl make sure to use SDK path
8597 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8598 LIBXML_CFLAGS="-I$usr/include/libxml2"
8599 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8601 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8602 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8603 FilterLibs "${LIBXML_LIBS}"
8604 LIBXML_LIBS="${filteredlibs}"
8607 dnl Check for xmllint
8608 AC_PATH_PROG(XMLLINT, xmllint, no)
8609 if test "$XMLLINT" = "no"; then
8610 AC_MSG_ERROR([xmllint is required])
8613 AC_MSG_RESULT([internal])
8615 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8616 if test "$COM" = "MSC"; then
8617 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8619 if test "$COM" = "MSC"; then
8620 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8622 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8624 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8626 AC_SUBST(SYSTEM_LIBXML)
8627 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8628 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8630 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8631 AC_SUBST(LIBXML_CFLAGS)
8632 AC_SUBST(LIBXML_LIBS)
8635 # =====================================================================
8636 # Checking for a Python interpreter with version >= 2.7.
8637 # Build and runtime requires Python 3 compatible version (>= 2.7).
8638 # Optionally user can pass an option to configure, i. e.
8639 # ./configure PYTHON=/usr/bin/python
8640 # =====================================================================
8641 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8642 if test -n "$PYTHON"; then
8643 PYTHON_FOR_BUILD=$PYTHON
8645 # This allows a lack of system python with no error, we use internal one in that case.
8646 AM_PATH_PYTHON([2.7],, [:])
8647 # Clean PYTHON_VERSION checked below if cross-compiling
8649 if test "$PYTHON" != ":"; then
8650 PYTHON_FOR_BUILD=$PYTHON
8654 AC_SUBST(PYTHON_FOR_BUILD)
8656 # Checks for Python to use for Pyuno
8657 AC_MSG_CHECKING([which Python to use for Pyuno])
8658 case "$enable_python" in
8660 if test -z $PYTHON_FOR_BUILD; then
8661 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8662 # requirement from the choice whether to include Python stuff in the installer, but why
8664 AC_MSG_ERROR([Python is required at build time.])
8667 AC_MSG_RESULT([none])
8670 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8671 AC_MSG_RESULT([no, overridden by --disable-scripting])
8673 elif test $build_os = cygwin; then
8674 dnl When building on Windows we don't attempt to use any installed
8675 dnl "system" Python.
8676 AC_MSG_RESULT([fully internal])
8677 enable_python=internal
8678 elif test "$cross_compiling" = yes; then
8679 AC_MSG_RESULT([system])
8680 enable_python=system
8682 # Unset variables set by the above AM_PATH_PYTHON so that
8683 # we actually do check anew.
8685 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
8686 AM_PATH_PYTHON([3.3],, [:])
8687 AC_MSG_CHECKING([which Python to use for Pyuno])
8688 if test "$PYTHON" = ":"; then
8689 if test -z "$PYTHON_FOR_BUILD"; then
8690 AC_MSG_RESULT([fully internal])
8692 AC_MSG_RESULT([internal])
8694 enable_python=internal
8696 AC_MSG_RESULT([system])
8697 enable_python=system
8702 AC_MSG_RESULT([internal])
8705 AC_MSG_RESULT([fully internal])
8706 enable_python=internal
8709 AC_MSG_RESULT([system])
8710 if test "$_os" = Darwin; then
8711 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])
8715 AC_MSG_ERROR([Incorrect --enable-python option])
8719 if test $enable_python != no; then
8720 BUILD_TYPE="$BUILD_TYPE PYUNO"
8723 if test $enable_python = system; then
8724 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8725 # Fallback: Accept these in the environment, or as set above
8728 elif test "$cross_compiling" != yes; then
8729 # Unset variables set by the above AM_PATH_PYTHON so that
8730 # we actually do check anew.
8731 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
8732 # This causes an error if no python command is found
8733 AM_PATH_PYTHON([3.3])
8734 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8735 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8736 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8737 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8738 if test -z "$PKG_CONFIG"; then
8739 PYTHON_CFLAGS="-I$python_include"
8740 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8741 elif $PKG_CONFIG --exists python-$python_version-embed; then
8742 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
8743 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
8744 elif $PKG_CONFIG --exists python-$python_version; then
8745 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8746 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8748 PYTHON_CFLAGS="-I$python_include"
8749 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8751 FilterLibs "${PYTHON_LIBS}"
8752 PYTHON_LIBS="${filteredlibs}"
8754 dnl How to find out the cross-compilation Python installation path?
8755 AC_MSG_CHECKING([for python version])
8756 AS_IF([test -n "$PYTHON_VERSION"],
8757 [AC_MSG_RESULT([$PYTHON_VERSION])],
8758 [AC_MSG_RESULT([not found])
8759 AC_MSG_ERROR([no usable python found])])
8760 test -n "$PYTHON_CFLAGS" && break
8763 dnl Check if the headers really work
8764 save_CPPFLAGS="$CPPFLAGS"
8765 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8766 AC_CHECK_HEADER(Python.h)
8767 CPPFLAGS="$save_CPPFLAGS"
8769 # let the PYTHON_FOR_BUILD match the same python installation that
8770 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8771 # better for PythonTests.
8772 PYTHON_FOR_BUILD=$PYTHON
8775 if test "$with_lxml" != no; then
8776 if test -z "$PYTHON_FOR_BUILD"; then
8779 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8782 if test "$cross_compiling" != yes ; then
8783 BUILD_TYPE="$BUILD_TYPE LXML"
8788 AC_MSG_CHECKING([for python lxml])
8789 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8790 AC_MSG_RESULT([yes])
8794 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8797 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8798 if test -n ${SYSTEM_LIBXSLT} -o -n ${SYSTEM_LIBXML}; then
8799 AC_MSG_RESULT([no, and no system libxml/libxslt, gla11y will only report widget classes and ids])
8801 BUILD_TYPE="$BUILD_TYPE LXML"
8802 AC_MSG_RESULT([no, using internal lxml])
8805 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8813 dnl By now enable_python should be "system", "internal" or "no"
8814 case $enable_python in
8818 if test "x$ac_cv_header_Python_h" != "xyes"; then
8819 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8823 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8824 AC_MSG_CHECKING([for correct python library version])
8825 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8828 int main(int argc, char **argv) {
8829 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
8830 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8833 ]])],[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])])
8837 dnl FIXME Check if the Python library can be linked with, too?
8842 PYTHON_VERSION_MAJOR=3
8843 PYTHON_VERSION_MINOR=7
8844 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.7
8845 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
8846 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
8848 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8849 BUILD_TYPE="$BUILD_TYPE PYTHON"
8850 if test "$OS" = LINUX; then
8851 BUILD_TYPE="$BUILD_TYPE LIBFFI"
8853 # Embedded Python dies without Home set
8854 if test "$HOME" = ""; then
8863 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8867 AC_SUBST(DISABLE_PYTHON)
8868 AC_SUBST(SYSTEM_PYTHON)
8869 AC_SUBST(PYTHON_CFLAGS)
8870 AC_SUBST(PYTHON_LIBS)
8871 AC_SUBST(PYTHON_VERSION)
8872 AC_SUBST(PYTHON_VERSION_MAJOR)
8873 AC_SUBST(PYTHON_VERSION_MINOR)
8875 ENABLE_MARIADBC=TRUE
8876 if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then
8882 if test "$ENABLE_MARIADBC" = "TRUE"; then
8883 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8886 AC_SUBST(ENABLE_MARIADBC)
8887 AC_SUBST(MARIADBC_MAJOR)
8888 AC_SUBST(MARIADBC_MINOR)
8889 AC_SUBST(MARIADBC_MICRO)
8891 if test "$ENABLE_MARIADBC" = "TRUE"; then
8892 dnl ===================================================================
8893 dnl Check for system MariaDB
8894 dnl ===================================================================
8895 AC_MSG_CHECKING([which MariaDB to use])
8896 if test "$with_system_mariadb" = "yes"; then
8897 AC_MSG_RESULT([external])
8898 SYSTEM_MARIADB_CONNECTOR_C=TRUE
8899 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8900 if test -z "$MARIADBCONFIG"; then
8901 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8902 if test -z "$MARIADBCONFIG"; then
8903 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8904 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8907 AC_MSG_CHECKING([MariaDB version])
8908 MARIADB_VERSION=`$MARIADBCONFIG --version`
8909 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8910 if test "$MARIADB_MAJOR" -ge "5"; then
8913 AC_MSG_ERROR([too old, use 5.0.x or later])
8915 AC_MSG_CHECKING([for MariaDB Client library])
8916 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8917 if test "$COM_IS_CLANG" = TRUE; then
8918 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8920 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8921 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8922 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8924 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8925 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8926 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8927 | sed -e 's|/lib64/|/lib/|')
8929 FilterLibs "${MARIADB_LIBS}"
8930 MARIADB_LIBS="${filteredlibs}"
8931 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8932 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8933 if test "$enable_bundle_mariadb" = "yes"; then
8934 AC_MSG_RESULT([yes])
8935 BUNDLE_MARIADB_CONNECTOR_C=TRUE
8936 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8938 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8940 /g' | grep -E '(mysqlclient|mariadb)')
8941 if test "$_os" = "Darwin"; then
8942 LIBMARIADB=${LIBMARIADB}.dylib
8943 elif test "$_os" = "WINNT"; then
8944 LIBMARIADB=${LIBMARIADB}.dll
8946 LIBMARIADB=${LIBMARIADB}.so
8948 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8949 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8950 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8951 AC_MSG_RESULT([found.])
8952 PathFormat "$LIBMARIADB_PATH"
8953 LIBMARIADB_PATH="$formatted_path"
8955 AC_MSG_ERROR([not found.])
8959 BUNDLE_MARIADB_CONNECTOR_C=
8962 AC_MSG_RESULT([internal])
8963 SYSTEM_MARIADB_CONNECTOR_C=
8964 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
8965 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
8966 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
8969 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
8970 AC_SUBST(MARIADB_CFLAGS)
8971 AC_SUBST(MARIADB_LIBS)
8972 AC_SUBST(LIBMARIADB)
8973 AC_SUBST(LIBMARIADB_PATH)
8974 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
8977 dnl ===================================================================
8978 dnl Check for system hsqldb
8979 dnl ===================================================================
8980 if test "$with_java" != "no"; then
8981 HSQLDB_USE_JDBC_4_1=
8982 AC_MSG_CHECKING([which hsqldb to use])
8983 if test "$with_system_hsqldb" = "yes"; then
8984 AC_MSG_RESULT([external])
8986 if test -z $HSQLDB_JAR; then
8987 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8989 if ! test -f $HSQLDB_JAR; then
8990 AC_MSG_ERROR(hsqldb.jar not found.)
8992 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8996 my $file = "$ENV{'HSQLDB_JAR'}";
8997 my $zip = Archive::Zip->new( $file );
8998 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8999 if ( $mf =~ m/Specification-Version: 1.8.*/ )
9001 push @l, split(/\n/, $mf);
9002 foreach my $line (@l)
9004 if ($line =~ m/Specification-Version:/)
9006 ($t, $version) = split (/:/,$line);
9007 $version =~ s/^\s//;
9008 ($a, $b, $c, $d) = split (/\./,$version);
9009 if ($c == "0" && $d > "8")
9024 AC_MSG_RESULT([yes])
9026 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
9029 AC_MSG_RESULT([internal])
9031 BUILD_TYPE="$BUILD_TYPE HSQLDB"
9033 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
9034 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
9035 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
9036 AC_MSG_RESULT([yes])
9037 HSQLDB_USE_JDBC_4_1=TRUE
9042 AC_SUBST(SYSTEM_HSQLDB)
9043 AC_SUBST(HSQLDB_JAR)
9044 AC_SUBST([HSQLDB_USE_JDBC_4_1])
9047 dnl ===================================================================
9048 dnl Check for PostgreSQL stuff
9049 dnl ===================================================================
9050 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
9051 if test "x$enable_postgresql_sdbc" != "xno"; then
9052 AC_MSG_RESULT([yes])
9053 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
9055 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
9056 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
9058 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
9059 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
9062 postgres_interface=""
9063 if test "$with_system_postgresql" = "yes"; then
9064 postgres_interface="external PostgreSQL"
9065 SYSTEM_POSTGRESQL=TRUE
9066 if test "$_os" = Darwin; then
9068 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
9069 pg_supp_path="$P_SEP$d$pg_supp_path"
9072 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
9073 if test -n "$PGCONFIG"; then
9074 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
9075 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
9077 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
9078 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
9079 POSTGRESQL_LIB=$POSTGRESQL_LIBS
9081 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
9084 FilterLibs "${POSTGRESQL_LIB}"
9085 POSTGRESQL_LIB="${filteredlibs}"
9087 # if/when anything else than PostgreSQL uses Kerberos,
9088 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
9093 # macOS has system MIT Kerberos 5 since 10.4
9094 if test "$with_krb5" != "no"; then
9097 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
9098 # that the libraries where these functions are located on macOS will change, is it?
9099 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9100 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9103 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9104 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9105 KRB5_LIBS="$KRB5_LIBS $LIBS"
9108 if test "$with_gssapi" != "no"; then
9111 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9112 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9118 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
9119 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
9122 Linux|GNU|*BSD|DragonFly)
9123 if test "$with_krb5" != "no"; then
9126 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9127 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9130 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9131 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9132 KRB5_LIBS="$KRB5_LIBS $LIBS"
9135 if test "$with_gssapi" != "no"; then
9138 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9139 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9145 if test "$with_krb5" = "yes"; then
9148 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9149 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9152 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9153 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9154 KRB5_LIBS="$KRB5_LIBS $LIBS"
9157 if test "$with_gssapi" = "yes"; then
9160 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9161 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9167 if test -n "$with_libpq_path"; then
9168 SYSTEM_POSTGRESQL=TRUE
9169 postgres_interface="external libpq"
9170 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
9171 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
9174 postgres_interface="internal"
9176 POSTGRESQL_INC="%OVERRIDE_ME%"
9177 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
9181 AC_MSG_CHECKING([PostgreSQL C interface])
9182 AC_MSG_RESULT([$postgres_interface])
9184 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
9185 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
9187 save_CPPFLAGS=$CPPFLAGS
9189 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
9190 LIBS="${LIBS} ${POSTGRESQL_LIB}"
9191 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
9192 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
9193 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
9195 CPPFLAGS=$save_CPPFLAGS
9198 BUILD_POSTGRESQL_SDBC=TRUE
9203 AC_SUBST(WITH_GSSAPI)
9204 AC_SUBST(GSSAPI_LIBS)
9206 AC_SUBST(BUILD_POSTGRESQL_SDBC)
9207 AC_SUBST(SYSTEM_POSTGRESQL)
9208 AC_SUBST(POSTGRESQL_INC)
9209 AC_SUBST(POSTGRESQL_LIB)
9211 dnl ===================================================================
9212 dnl Check for Firebird stuff
9213 dnl ===================================================================
9214 ENABLE_FIREBIRD_SDBC=
9215 if test "$enable_firebird_sdbc" = "yes" ; then
9216 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
9218 dnl ===================================================================
9219 dnl Check for system Firebird
9220 dnl ===================================================================
9221 AC_MSG_CHECKING([which Firebird to use])
9222 if test "$with_system_firebird" = "yes"; then
9223 AC_MSG_RESULT([external])
9224 SYSTEM_FIREBIRD=TRUE
9225 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
9226 if test -z "$FIREBIRDCONFIG"; then
9227 AC_MSG_NOTICE([No fb_config -- using pkg-config])
9228 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
9229 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
9231 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
9233 AC_MSG_NOTICE([fb_config found])
9234 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
9235 AC_MSG_CHECKING([for Firebird Client library])
9236 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
9237 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
9238 FilterLibs "${FIREBIRD_LIBS}"
9239 FIREBIRD_LIBS="${filteredlibs}"
9241 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
9242 AC_MSG_CHECKING([Firebird version])
9243 if test -n "${FIREBIRD_VERSION}"; then
9244 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
9245 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
9246 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
9249 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
9252 __save_CFLAGS="${CFLAGS}"
9253 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
9254 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
9255 #if defined(FB_API_VER) && FB_API_VER == 30
9256 int fb_api_is_30(void) { return 0; }
9258 #error "Wrong Firebird API version"
9259 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
9260 CFLAGS="${__save_CFLAGS}"
9262 ENABLE_FIREBIRD_SDBC=TRUE
9263 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9264 elif test "$enable_database_connectivity" != yes; then
9265 AC_MSG_RESULT([none])
9266 elif test "$cross_compiling" = "yes"; then
9267 AC_MSG_RESULT([none])
9269 dnl Embedded Firebird has version 3.0
9270 AC_DEFINE(HAVE_FIREBIRD_30, 1)
9271 dnl We need libatomic_ops for any non X86/X64 system
9272 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
9273 dnl ===================================================================
9274 dnl Check for system libatomic_ops
9275 dnl ===================================================================
9276 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
9277 if test "$with_system_libatomic_ops" = "yes"; then
9278 SYSTEM_LIBATOMIC_OPS=TRUE
9279 AC_CHECK_HEADERS(atomic_ops.h, [],
9280 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
9282 SYSTEM_LIBATOMIC_OPS=
9283 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
9284 LIBATOMIC_OPS_LIBS="-latomic_ops"
9285 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
9289 AC_MSG_RESULT([internal])
9291 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
9292 FIREBIRD_LIBS="-lfbclient"
9294 if test "$with_system_libtommath" = "yes"; then
9295 SYSTEM_LIBTOMMATH=TRUE
9296 dnl check for tommath presence
9298 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
9299 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
9303 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
9304 LIBTOMMATH_LIBS="-ltommath"
9305 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
9308 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
9309 ENABLE_FIREBIRD_SDBC=TRUE
9310 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9313 AC_SUBST(ENABLE_FIREBIRD_SDBC)
9314 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
9315 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
9316 AC_SUBST(LIBATOMIC_OPS_LIBS)
9317 AC_SUBST(SYSTEM_FIREBIRD)
9318 AC_SUBST(FIREBIRD_CFLAGS)
9319 AC_SUBST(FIREBIRD_LIBS)
9320 AC_SUBST([TOMMATH_CFLAGS])
9321 AC_SUBST([TOMMATH_LIBS])
9323 dnl ===================================================================
9324 dnl Check for system curl
9325 dnl ===================================================================
9326 AC_MSG_CHECKING([which libcurl to use])
9327 if test "$with_system_curl" = "auto"; then
9328 with_system_curl="$with_system_libs"
9331 if test "$with_system_curl" = "yes"; then
9332 AC_MSG_RESULT([external])
9335 # First try PKGCONFIG and then fall back
9336 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
9338 if test -n "$CURL_PKG_ERRORS"; then
9339 AC_PATH_PROG(CURLCONFIG, curl-config)
9340 if test -z "$CURLCONFIG"; then
9341 AC_MSG_ERROR([curl development files not found])
9343 CURL_LIBS=`$CURLCONFIG --libs`
9344 FilterLibs "${CURL_LIBS}"
9345 CURL_LIBS="${filteredlibs}"
9346 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
9347 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
9349 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
9350 case $curl_version in
9351 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
9352 dnl so they need to be doubled to end up in the configure script
9353 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
9354 AC_MSG_RESULT([yes])
9357 AC_MSG_ERROR([no, you have $curl_version])
9364 AC_MSG_RESULT([internal])
9366 BUILD_TYPE="$BUILD_TYPE CURL"
9369 AC_SUBST(SYSTEM_CURL)
9370 AC_SUBST(CURL_CFLAGS)
9372 AC_SUBST(ENABLE_CURL)
9374 dnl ===================================================================
9375 dnl Check for system boost
9376 dnl ===================================================================
9377 AC_MSG_CHECKING([which boost to use])
9378 if test "$with_system_boost" = "yes"; then
9379 AC_MSG_RESULT([external])
9387 save_CXXFLAGS=$CXXFLAGS
9388 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
9389 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
9390 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
9391 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
9392 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
9393 CXXFLAGS=$save_CXXFLAGS
9395 # this is in m4/ax_boost_base.m4
9396 FilterLibs "${BOOST_LDFLAGS}"
9397 BOOST_LDFLAGS="${filteredlibs}"
9399 AC_MSG_RESULT([internal])
9400 BUILD_TYPE="$BUILD_TYPE BOOST"
9402 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
9403 # use warning-suppressing wrapper headers
9404 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
9406 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
9409 AC_SUBST(SYSTEM_BOOST)
9411 dnl ===================================================================
9412 dnl Check for system mdds
9413 dnl ===================================================================
9414 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.5 >= 1.5.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
9416 dnl ===================================================================
9417 dnl Check for system glm
9418 dnl ===================================================================
9419 AC_MSG_CHECKING([which glm to use])
9420 if test "$with_system_glm" = "yes"; then
9421 AC_MSG_RESULT([external])
9424 AC_CHECK_HEADER([glm/glm.hpp], [],
9425 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
9428 AC_MSG_RESULT([internal])
9429 BUILD_TYPE="$BUILD_TYPE GLM"
9431 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
9433 AC_SUBST([GLM_CFLAGS])
9434 AC_SUBST([SYSTEM_GLM])
9436 dnl ===================================================================
9437 dnl Check for system odbc
9438 dnl ===================================================================
9439 AC_MSG_CHECKING([which odbc headers to use])
9440 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
9441 AC_MSG_RESULT([external])
9442 SYSTEM_ODBC_HEADERS=TRUE
9444 if test "$build_os" = "cygwin"; then
9445 save_CPPFLAGS=$CPPFLAGS
9447 PathFormat "$winsdktest"
9448 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"
9449 AC_CHECK_HEADER(sqlext.h, [],
9450 [AC_MSG_ERROR(odbc not found. install odbc)],
9451 [#include <windows.h>])
9452 CPPFLAGS=$save_CPPFLAGS
9454 AC_CHECK_HEADER(sqlext.h, [],
9455 [AC_MSG_ERROR(odbc not found. install odbc)],[])
9457 elif test "$enable_database_connectivity" != yes; then
9458 AC_MSG_RESULT([none])
9460 AC_MSG_RESULT([internal])
9461 SYSTEM_ODBC_HEADERS=
9463 AC_SUBST(SYSTEM_ODBC_HEADERS)
9465 dnl ===================================================================
9466 dnl Enable LDAP support
9467 dnl ===================================================================
9469 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
9470 AC_MSG_CHECKING([whether to enable LDAP support])
9471 if test "$enable_ldap" != "yes"; then
9476 AC_MSG_RESULT([yes])
9478 AC_DEFINE(HAVE_FEATURE_LDAP)
9481 AC_SUBST(ENABLE_LDAP)
9483 dnl ===================================================================
9484 dnl Check for system openldap
9485 dnl ===================================================================
9487 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android" -a "$ENABLE_LDAP" != ""; then
9488 AC_MSG_CHECKING([which openldap library to use])
9489 if test "$with_system_openldap" = "yes"; then
9490 AC_MSG_RESULT([external])
9491 SYSTEM_OPENLDAP=TRUE
9492 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
9493 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9494 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9496 AC_MSG_RESULT([internal])
9498 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
9501 AC_SUBST(SYSTEM_OPENLDAP)
9503 dnl ===================================================================
9504 dnl Check for system NSS
9505 dnl ===================================================================
9506 if test "$enable_fuzzers" != "yes"; then
9507 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
9508 AC_DEFINE(HAVE_FEATURE_NSS)
9510 AC_DEFINE(ENABLE_NSS)
9511 elif test $_os != iOS ; then
9514 AC_SUBST(ENABLE_NSS)
9516 dnl ===================================================================
9517 dnl Check for TLS/SSL and cryptographic implementation to use
9518 dnl ===================================================================
9519 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
9520 if test -n "$with_tls"; then
9523 AC_DEFINE(USE_TLS_OPENSSL)
9526 if test "$enable_openssl" != "yes"; then
9527 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9530 # warn that OpenSSL has been selected but not all TLS code has this option
9531 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
9532 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
9535 AC_DEFINE(USE_TLS_NSS)
9539 AC_MSG_WARN([Skipping TLS/SSL])
9542 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9544 nss - Mozilla's Network Security Services (NSS)
9549 # default to using NSS, it results in smaller oox lib
9550 AC_DEFINE(USE_TLS_NSS)
9553 AC_MSG_RESULT([$TLS])
9556 dnl ===================================================================
9557 dnl Check for system sane
9558 dnl ===================================================================
9559 AC_MSG_CHECKING([which sane header to use])
9560 if test "$with_system_sane" = "yes"; then
9561 AC_MSG_RESULT([external])
9562 AC_CHECK_HEADER(sane/sane.h, [],
9563 [AC_MSG_ERROR(sane not found. install sane)], [])
9565 AC_MSG_RESULT([internal])
9566 BUILD_TYPE="$BUILD_TYPE SANE"
9569 dnl ===================================================================
9570 dnl Check for system icu
9571 dnl ===================================================================
9578 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9579 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9580 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9581 AC_MSG_CHECKING([which icu to use])
9582 if test "$with_system_icu" = "yes"; then
9583 AC_MSG_RESULT([external])
9586 AC_MSG_CHECKING([for unicode/rbbi.h])
9587 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([icu headers not found])])
9590 if test "$cross_compiling" != "yes"; then
9591 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9592 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9593 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9594 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9597 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9598 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9599 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9600 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9601 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9602 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9603 AC_MSG_RESULT([yes])
9606 if test "$with_system_icu_for_build" != "force"; then
9607 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9608 You can use --with-system-icu-for-build=force to use it anyway.])
9613 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9614 # using the system icu tools can lead to version confusion, use the
9615 # ones from the build environment when cross-compiling
9616 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9617 if test -z "$SYSTEM_GENBRK"; then
9618 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9620 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9621 if test -z "$SYSTEM_GENCCODE"; then
9622 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9624 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9625 if test -z "$SYSTEM_GENCMN"; then
9626 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9628 if test "$ICU_MAJOR" -ge "49"; then
9629 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9630 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9631 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9633 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9634 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9635 ICU_RECLASSIFIED_HEBREW_LETTER=
9639 if test "$cross_compiling" = "yes"; then
9640 if test "$ICU_MAJOR" -ge "50"; then
9641 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9646 AC_MSG_RESULT([internal])
9648 BUILD_TYPE="$BUILD_TYPE ICU"
9649 # surprisingly set these only for "internal" (to be used by various other
9650 # external libs): the system icu-config is quite unhelpful and spits out
9651 # dozens of weird flags and also default path -I/usr/include
9652 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9653 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9655 if test "$ICU_MAJOR" -ge "59"; then
9656 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9657 # with -std=c++11 but not all external libraries can be built with that,
9658 # for those use a bit-compatible typedef uint16_t UChar; see
9659 # icu/source/common/unicode/umachine.h
9660 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9664 AC_SUBST(SYSTEM_ICU)
9665 AC_SUBST(SYSTEM_GENBRK)
9666 AC_SUBST(SYSTEM_GENCCODE)
9667 AC_SUBST(SYSTEM_GENCMN)
9670 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9671 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9672 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9673 AC_SUBST(ICU_CFLAGS)
9675 AC_SUBST(ICU_UCHAR_TYPE)
9677 dnl ==================================================================
9679 dnl ==================================================================
9680 DEFAULT_CRASHDUMP_VALUE="true"
9681 AC_MSG_CHECKING([whether to enable breakpad])
9682 if test "$enable_breakpad" != yes; then
9685 AC_MSG_RESULT([yes])
9686 ENABLE_BREAKPAD="TRUE"
9687 AC_DEFINE(ENABLE_BREAKPAD)
9688 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9689 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9691 AC_MSG_CHECKING([for disable crash dump])
9692 if test "$enable_crashdump" = no; then
9693 DEFAULT_CRASHDUMP_VALUE="false"
9694 AC_MSG_RESULT([yes])
9699 AC_MSG_CHECKING([for crashreport config])
9700 if test "$with_symbol_config" = "no"; then
9701 BREAKPAD_SYMBOL_CONFIG="invalid"
9704 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9705 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9706 AC_MSG_RESULT([yes])
9708 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9710 AC_SUBST(ENABLE_BREAKPAD)
9711 AC_SUBST(DEFAULT_CRASHDUMP_VALUE)
9713 dnl ==================================================================
9715 dnl ==================================================================
9716 AC_MSG_CHECKING([whether to enable fuzzers])
9717 if test "$enable_fuzzers" != yes; then
9720 AC_MSG_RESULT([yes])
9721 ENABLE_FUZZERS="TRUE"
9722 AC_DEFINE([ENABLE_FUZZERS],1)
9723 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9725 AC_SUBST(ENABLE_FUZZERS)
9727 dnl ===================================================================
9729 dnl ===================================================================
9730 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.15 >= 0.15.0])
9731 if test "$with_system_orcus" != "yes"; then
9732 if test "$SYSTEM_BOOST" = "TRUE"; then
9733 # ===========================================================
9734 # Determine if we are going to need to link with Boost.System
9735 # ===========================================================
9736 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9737 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9738 dnl in documentation has no effect.
9739 AC_MSG_CHECKING([if we need to link with Boost.System])
9741 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9742 @%:@include <boost/version.hpp>
9744 #if BOOST_VERSION >= 105000
9745 # error yes, we need to link with Boost.System
9750 AC_MSG_RESULT([yes])
9756 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9757 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9758 AC_SUBST([BOOST_SYSTEM_LIB])
9759 AC_SUBST(SYSTEM_LIBORCUS)
9761 dnl ===================================================================
9763 dnl ===================================================================
9764 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9765 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9766 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9768 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9769 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9770 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9772 if test "$COM" = "MSC"; then # override the above
9773 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9774 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9777 if test "$with_system_harfbuzz" = "yes"; then
9778 if test "$with_system_graphite" = "no"; then
9779 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9781 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9783 _save_cflags="$CFLAGS"
9784 LIBS="$LIBS $HARFBUZZ_LIBS"
9785 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9786 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9788 CFLAGS="$_save_cflags"
9790 if test "$with_system_graphite" = "yes"; then
9791 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9795 AC_MSG_CHECKING([whether to use X11])
9796 dnl ***************************************
9797 dnl testing for X libraries and includes...
9798 dnl ***************************************
9799 if test "$USING_X11" = TRUE; then
9800 AC_DEFINE(HAVE_FEATURE_X11)
9802 AC_MSG_RESULT([$USING_X11])
9804 if test "$USING_X11" = TRUE; then
9807 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9809 if test -z "$x_includes"; then
9810 x_includes="default_x_includes"
9812 if test -z "$x_libraries"; then
9813 x_libraries="default_x_libraries"
9815 CFLAGS="$CFLAGS $X_CFLAGS"
9816 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9817 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9819 x_includes="no_x_includes"
9820 x_libraries="no_x_libraries"
9823 if test "$USING_X11" = TRUE; then
9824 dnl ===================================================================
9825 dnl Check for extension headers
9826 dnl ===================================================================
9827 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9828 [#include <X11/extensions/shape.h>])
9830 # vcl needs ICE and SM
9831 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9832 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9833 [AC_MSG_ERROR(ICE library not found)])
9834 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9835 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9836 [AC_MSG_ERROR(SM library not found)])
9839 dnl ===================================================================
9840 dnl Check for system Xrender
9841 dnl ===================================================================
9842 AC_MSG_CHECKING([whether to use Xrender])
9843 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9844 AC_MSG_RESULT([yes])
9845 PKG_CHECK_MODULES(XRENDER, xrender)
9846 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9847 FilterLibs "${XRENDER_LIBS}"
9848 XRENDER_LIBS="${filteredlibs}"
9849 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9850 [AC_MSG_ERROR(libXrender not found or functional)], [])
9851 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9852 [AC_MSG_ERROR(Xrender not found. install X)], [])
9856 AC_SUBST(XRENDER_CFLAGS)
9857 AC_SUBST(XRENDER_LIBS)
9859 dnl ===================================================================
9860 dnl Check for XRandr
9861 dnl ===================================================================
9862 AC_MSG_CHECKING([whether to enable RandR support])
9863 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9864 AC_MSG_RESULT([yes])
9865 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9866 if test "$ENABLE_RANDR" != "TRUE"; then
9867 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9868 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9870 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9871 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9872 XRANDR_LIBS="-lXrandr "
9875 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9876 FilterLibs "${XRANDR_LIBS}"
9877 XRANDR_LIBS="${filteredlibs}"
9882 AC_SUBST(XRANDR_CFLAGS)
9883 AC_SUBST(XRANDR_LIBS)
9884 AC_SUBST(ENABLE_RANDR)
9886 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9889 if test $_os = iOS -o $_os = Android; then
9892 AC_MSG_CHECKING([for webdav library])
9893 case "$WITH_WEBDAV" in
9895 AC_MSG_RESULT([serf])
9896 # Check for system apr-util
9897 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9898 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9899 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9900 if test "$COM" = "MSC"; then
9902 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9903 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9906 # Check for system serf
9907 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9908 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9909 if test "$COM" = "MSC"; then
9910 SERF_LIB_DIR="Release"
9911 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9912 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9916 AC_MSG_RESULT([neon])
9917 # Check for system neon
9918 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9919 if test "$with_system_neon" = "yes"; then
9920 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9924 AC_SUBST(NEON_VERSION)
9927 AC_MSG_RESULT([none, disabled])
9931 AC_SUBST(WITH_WEBDAV)
9933 dnl ===================================================================
9934 dnl Check for disabling cve_tests
9935 dnl ===================================================================
9936 AC_MSG_CHECKING([whether to execute CVE tests])
9937 # If not explicitly enabled or disabled, default
9938 if test -z "$enable_cve_tests"; then
9941 # Default cves off for Windows with its wild and wonderful
9942 # variety of AV software kicking in and panicking
9947 enable_cve_tests=yes
9951 if test "$enable_cve_tests" = "no"; then
9953 DISABLE_CVE_TESTS=TRUE
9954 AC_SUBST(DISABLE_CVE_TESTS)
9956 AC_MSG_RESULT([yes])
9959 dnl ===================================================================
9960 dnl Check for enabling chart XShape tests
9961 dnl ===================================================================
9962 AC_MSG_CHECKING([whether to execute chart XShape tests])
9963 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
9964 AC_MSG_RESULT([yes])
9965 ENABLE_CHART_TESTS=TRUE
9966 AC_SUBST(ENABLE_CHART_TESTS)
9971 dnl ===================================================================
9972 dnl Check for system openssl
9973 dnl ===================================================================
9975 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9976 if test "$enable_openssl" = "yes"; then
9978 if test "$_os" = Darwin ; then
9979 # OpenSSL is deprecated when building for 10.7 or later.
9981 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9982 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9984 with_system_openssl=no
9985 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9986 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9987 && test "$with_system_openssl" != "no"; then
9988 with_system_openssl=yes
9991 OPENSSL_LIBS="-lssl -lcrypto"
9993 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9995 if test "$with_system_openssl" = "yes"; then
9996 AC_MSG_CHECKING([whether openssl supports SHA512])
9998 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
10000 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
10004 AC_MSG_RESULT([yes])
10005 DISABLE_OPENSSL=TRUE
10007 # warn that although OpenSSL is disabled, system libraries may depend on it
10008 AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
10009 add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
10012 AC_SUBST([DISABLE_OPENSSL])
10014 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
10015 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
10016 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
10017 enable_cipher_openssl_backend=no
10019 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
10022 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
10023 ENABLE_CIPHER_OPENSSL_BACKEND=
10024 if test "$enable_cipher_openssl_backend" = yes; then
10025 AC_MSG_RESULT([yes])
10026 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
10028 AC_MSG_RESULT([no])
10030 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
10032 dnl ===================================================================
10033 dnl Check for building gnutls
10034 dnl ===================================================================
10035 AC_MSG_CHECKING([whether to use gnutls])
10036 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
10037 AC_MSG_RESULT([yes])
10038 AM_PATH_LIBGCRYPT()
10039 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
10040 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
10041 available in the system to use as replacement.]]))
10042 FilterLibs "${LIBGCRYPT_LIBS}"
10043 LIBGCRYPT_LIBS="${filteredlibs}"
10045 AC_MSG_RESULT([no])
10048 AC_SUBST([LIBGCRYPT_CFLAGS])
10049 AC_SUBST([LIBGCRYPT_LIBS])
10051 dnl ===================================================================
10052 dnl Check for system redland
10053 dnl ===================================================================
10054 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
10055 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
10056 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
10057 if test "$with_system_redland" = "yes"; then
10058 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
10059 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
10065 AC_SUBST(RAPTOR_MAJOR)
10066 AC_SUBST(RASQAL_MAJOR)
10067 AC_SUBST(REDLAND_MAJOR)
10069 dnl ===================================================================
10070 dnl Check for system hunspell
10071 dnl ===================================================================
10072 AC_MSG_CHECKING([which libhunspell to use])
10073 if test "$_os" = iOS; then
10074 AC_MSG_RESULT([none])
10075 elif test "$with_system_hunspell" = "yes"; then
10076 AC_MSG_RESULT([external])
10077 SYSTEM_HUNSPELL=TRUE
10078 AC_LANG_PUSH([C++])
10079 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
10080 if test "$HUNSPELL_PC" != "TRUE"; then
10081 AC_CHECK_HEADER(hunspell.hxx, [],
10083 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
10084 [AC_MSG_ERROR(hunspell headers not found.)], [])
10086 AC_CHECK_LIB([hunspell], [main], [:],
10087 [ AC_MSG_ERROR(hunspell library not found.) ], [])
10088 HUNSPELL_LIBS=-lhunspell
10091 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10092 FilterLibs "${HUNSPELL_LIBS}"
10093 HUNSPELL_LIBS="${filteredlibs}"
10095 AC_MSG_RESULT([internal])
10097 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
10098 if test "$COM" = "MSC"; then
10099 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
10101 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
10103 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
10105 AC_SUBST(SYSTEM_HUNSPELL)
10106 AC_SUBST(HUNSPELL_CFLAGS)
10107 AC_SUBST(HUNSPELL_LIBS)
10109 dnl ===================================================================
10110 dnl Check for system qrcodegen
10111 dnl ===================================================================
10112 AC_MSG_CHECKING([whether to use libqrcodegen])
10113 if test "$enable_qrcodegen" = "no"; then
10114 AC_MSG_RESULT([no])
10118 AC_MSG_RESULT([yes])
10119 ENABLE_QRCODEGEN=TRUE
10120 AC_MSG_CHECKING([which libqrcodegen to use])
10121 if test "$with_system_qrcodegen" = "yes"; then
10122 AC_MSG_RESULT([external])
10123 SYSTEM_QRCODEGEN=TRUE
10124 AC_LANG_PUSH([C++])
10125 AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
10126 [AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
10127 AC_CHECK_LIB([qrcodegencpp], [main], [:],
10128 [ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
10129 QRCODEGEN_LIBS=-lqrcodegencpp
10131 QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10132 FilterLibs "${QRCODEGEN_LIBS}"
10133 QRCODEGEN_LIBS="${filteredlibs}"
10135 AC_MSG_RESULT([internal])
10137 BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
10139 if test "$ENABLE_QRCODEGEN" = TRUE; then
10140 AC_DEFINE(ENABLE_QRCODEGEN)
10143 AC_SUBST(SYSTEM_QRCODEGEN)
10144 AC_SUBST(ENABLE_QRCODEGEN)
10145 AC_SUBST(QRCODEGEN_CFLAGS)
10146 AC_SUBST(QRCODEGEN_LIBS)
10148 dnl ===================================================================
10149 dnl Checking for altlinuxhyph
10150 dnl ===================================================================
10151 AC_MSG_CHECKING([which altlinuxhyph to use])
10152 if test "$with_system_altlinuxhyph" = "yes"; then
10153 AC_MSG_RESULT([external])
10155 AC_CHECK_HEADER(hyphen.h, [],
10156 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
10157 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
10158 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
10159 [#include <hyphen.h>])
10160 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
10161 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10162 if test -z "$HYPHEN_LIB"; then
10163 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
10164 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10166 if test -z "$HYPHEN_LIB"; then
10167 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
10168 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10171 AC_MSG_RESULT([internal])
10173 BUILD_TYPE="$BUILD_TYPE HYPHEN"
10174 if test "$COM" = "MSC"; then
10175 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
10177 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
10180 AC_SUBST(SYSTEM_HYPH)
10181 AC_SUBST(HYPHEN_LIB)
10183 dnl ===================================================================
10184 dnl Checking for mythes
10185 dnl ===================================================================
10186 AC_MSG_CHECKING([which mythes to use])
10187 if test "$_os" = iOS; then
10188 AC_MSG_RESULT([none])
10189 elif test "$with_system_mythes" = "yes"; then
10190 AC_MSG_RESULT([external])
10192 AC_LANG_PUSH([C++])
10193 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
10194 if test "$MYTHES_PKGCONFIG" = "no"; then
10195 AC_CHECK_HEADER(mythes.hxx, [],
10196 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
10197 AC_CHECK_LIB([mythes-1.2], [main], [:],
10198 [ MYTHES_FOUND=no], [])
10199 if test "$MYTHES_FOUND" = "no"; then
10200 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
10201 [ MYTHES_FOUND=no], [])
10203 if test "$MYTHES_FOUND" = "no"; then
10204 AC_MSG_ERROR([mythes library not found!.])
10208 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10209 FilterLibs "${MYTHES_LIBS}"
10210 MYTHES_LIBS="${filteredlibs}"
10212 AC_MSG_RESULT([internal])
10214 BUILD_TYPE="$BUILD_TYPE MYTHES"
10215 if test "$COM" = "MSC"; then
10216 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
10218 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
10221 AC_SUBST(SYSTEM_MYTHES)
10222 AC_SUBST(MYTHES_CFLAGS)
10223 AC_SUBST(MYTHES_LIBS)
10225 dnl ===================================================================
10226 dnl How should we build the linear programming solver ?
10227 dnl ===================================================================
10230 AC_MSG_CHECKING([whether to build with CoinMP])
10231 if test "$enable_coinmp" != "no"; then
10233 AC_MSG_RESULT([yes])
10234 if test "$with_system_coinmp" = "yes"; then
10236 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
10237 FilterLibs "${COINMP_LIBS}"
10238 COINMP_LIBS="${filteredlibs}"
10240 BUILD_TYPE="$BUILD_TYPE COINMP"
10243 AC_MSG_RESULT([no])
10245 AC_SUBST(ENABLE_COINMP)
10246 AC_SUBST(SYSTEM_COINMP)
10247 AC_SUBST(COINMP_CFLAGS)
10248 AC_SUBST(COINMP_LIBS)
10251 AC_MSG_CHECKING([whether to build with lpsolve])
10252 if test "$enable_lpsolve" != "no"; then
10253 ENABLE_LPSOLVE=TRUE
10254 AC_MSG_RESULT([yes])
10256 AC_MSG_RESULT([no])
10258 AC_SUBST(ENABLE_LPSOLVE)
10260 if test "$ENABLE_LPSOLVE" = TRUE; then
10261 AC_MSG_CHECKING([which lpsolve to use])
10262 if test "$with_system_lpsolve" = "yes"; then
10263 AC_MSG_RESULT([external])
10264 SYSTEM_LPSOLVE=TRUE
10265 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
10266 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
10268 # some systems need this. Like Ubuntu...
10269 AC_CHECK_LIB(m, floor)
10270 AC_CHECK_LIB(dl, dlopen)
10271 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
10272 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
10275 AC_MSG_RESULT([internal])
10277 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
10280 AC_SUBST(SYSTEM_LPSOLVE)
10282 dnl ===================================================================
10283 dnl Checking for libexttextcat
10284 dnl ===================================================================
10285 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
10286 if test "$with_system_libexttextcat" = "yes"; then
10287 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
10289 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
10291 dnl ===================================================================
10292 dnl Checking for libnumbertext
10293 dnl ===================================================================
10294 AC_MSG_CHECKING([whether to use libnumbertext])
10295 if test "$enable_libnumbertext" = "no"; then
10296 AC_MSG_RESULT([no])
10297 ENABLE_LIBNUMBERTEXT=
10298 SYSTEM_LIBNUMBERTEXT=
10300 AC_MSG_RESULT([yes])
10301 ENABLE_LIBNUMBERTEXT=TRUE
10302 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
10303 if test "$with_system_libnumbertext" = "yes"; then
10304 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
10305 SYSTEM_LIBNUMBERTEXT=YES
10307 SYSTEM_LIBNUMBERTEXT=
10308 AC_LANG_PUSH([C++])
10309 save_CPPFLAGS=$CPPFLAGS
10310 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
10311 AC_CHECK_HEADERS([codecvt regex])
10312 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
10313 [ ENABLE_LIBNUMBERTEXT=''
10314 LIBNUMBERTEXT_CFLAGS=''
10315 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
10316 Enable libnumbertext fallback (missing number to number name conversion).])
10318 CPPFLAGS=$save_CPPFLAGS
10321 if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
10322 AC_DEFINE(ENABLE_LIBNUMBERTEXT)
10325 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
10326 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
10327 AC_SUBST(ENABLE_LIBNUMBERTEXT)
10328 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
10330 dnl ***************************************
10331 dnl testing libc version for Linux...
10332 dnl ***************************************
10333 if test "$_os" = "Linux"; then
10334 AC_MSG_CHECKING([whether libc is >= 2.1.1])
10335 exec 6>/dev/null # no output
10336 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
10337 exec 6>&1 # output on again
10338 if test "$HAVE_LIBC"; then
10339 AC_MSG_RESULT([yes])
10341 AC_MSG_ERROR([no, upgrade libc])
10345 dnl =========================================
10346 dnl Check for uuidgen
10347 dnl =========================================
10348 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
10349 # presence is already tested above in the WINDOWS_SDK_HOME check
10350 UUIDGEN=uuidgen.exe
10353 AC_PATH_PROG([UUIDGEN], [uuidgen])
10354 if test -z "$UUIDGEN"; then
10355 AC_MSG_WARN([uuid is needed for building installation sets])
10359 dnl ***************************************
10360 dnl Checking for bison and flex
10361 dnl ***************************************
10362 AC_PATH_PROG(BISON, bison)
10363 if test -z "$BISON"; then
10364 AC_MSG_ERROR([no bison found in \$PATH, install it])
10366 AC_MSG_CHECKING([the bison version])
10367 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
10368 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
10369 # Accept newer than 2.0
10370 if test "$_bison_longver" -lt 2000; then
10371 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
10375 AC_PATH_PROG(FLEX, flex)
10376 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10377 FLEX=`cygpath -m $FLEX`
10379 if test -z "$FLEX"; then
10380 AC_MSG_ERROR([no flex found in \$PATH, install it])
10382 AC_MSG_CHECKING([the flex version])
10383 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
10384 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
10385 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
10389 dnl ***************************************
10390 dnl Checking for patch
10391 dnl ***************************************
10392 AC_PATH_PROG(PATCH, patch)
10393 if test -z "$PATCH"; then
10394 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
10397 dnl On Solaris, FreeBSD or macOS, check if --with-gnu-patch was used
10398 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
10399 if test -z "$with_gnu_patch"; then
10402 if test -x "$with_gnu_patch"; then
10403 GNUPATCH=$with_gnu_patch
10405 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
10409 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
10410 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
10411 AC_MSG_RESULT([yes])
10413 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
10419 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10420 GNUPATCH=`cygpath -m $GNUPATCH`
10423 dnl We also need to check for --with-gnu-cp
10425 if test -z "$with_gnu_cp"; then
10426 # check the place where the good stuff is hidden on Solaris...
10427 if test -x /usr/gnu/bin/cp; then
10428 GNUCP=/usr/gnu/bin/cp
10430 AC_PATH_PROGS(GNUCP, gnucp cp)
10432 if test -z $GNUCP; then
10433 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
10436 if test -x "$with_gnu_cp"; then
10439 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
10443 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10444 GNUCP=`cygpath -m $GNUCP`
10447 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
10448 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
10449 AC_MSG_RESULT([yes])
10450 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
10451 AC_MSG_RESULT([yes])
10453 case "$build_os" in
10454 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
10457 AC_MSG_RESULT([no gnucp found - using the system's cp command])
10460 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
10469 dnl ***************************************
10470 dnl testing assembler path
10471 dnl ***************************************
10473 if test "$_os" = "WINNT"; then
10474 if test "$BITNESS_OVERRIDE" = ""; then
10480 AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
10481 if test -f "$CL_PATH/$assembler"; then
10482 ML_EXE=`win_short_path_for_make "$CL_PATH/$assembler"`
10483 AC_MSG_RESULT([$ML_EXE])
10485 AC_MSG_ERROR([not found])
10491 dnl ===================================================================
10492 dnl We need zip and unzip
10493 dnl ===================================================================
10494 AC_PATH_PROG(ZIP, zip)
10495 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10496 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10497 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],,)
10500 AC_PATH_PROG(UNZIP, unzip)
10501 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10503 dnl ===================================================================
10504 dnl Zip must be a specific type for different build types.
10505 dnl ===================================================================
10506 if test $build_os = cygwin; then
10507 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10508 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10512 dnl ===================================================================
10513 dnl We need touch with -h option support.
10514 dnl ===================================================================
10515 AC_PATH_PROG(TOUCH, touch)
10516 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10518 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10519 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],,)
10522 dnl ===================================================================
10523 dnl Check for system epoxy
10524 dnl ===================================================================
10525 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
10527 dnl ===================================================================
10528 dnl Set vcl option: coordinate device in double or sal_Int32
10529 dnl ===================================================================
10531 dnl disabled for now, we don't want subtle differences between OSs
10532 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10533 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
10534 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10535 dnl AC_MSG_RESULT([double])
10537 dnl AC_MSG_RESULT([sal_Int32])
10540 dnl ===================================================================
10541 dnl Test which vclplugs have to be built.
10542 dnl ===================================================================
10544 if test "$USING_X11" != TRUE; then
10550 if test "x$enable_gtk3" = "xyes"; then
10551 if test "$with_system_cairo" = no; then
10552 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10554 : ${with_system_cairo:=yes}
10555 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="")
10556 if test "x$ENABLE_GTK3" = "xTRUE"; then
10557 AC_DEFINE(ENABLE_GTK3)
10560 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10562 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10563 FilterLibs "${GTK3_LIBS}"
10564 GTK3_LIBS="${filteredlibs}"
10566 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10567 if test "$with_system_epoxy" != "yes"; then
10568 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10569 AC_CHECK_HEADER(EGL/eglplatform.h, [],
10570 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10573 AC_SUBST(GTK3_LIBS)
10574 AC_SUBST(GTK3_CFLAGS)
10575 AC_SUBST(ENABLE_GTK3)
10577 if test "$enable_introspection" = yes; then
10578 if test "$ENABLE_GTK3" = TRUE; then
10579 GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
10581 AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
10586 if test "x$enable_qt5" = "xyes"; then
10588 AC_DEFINE(ENABLE_QT5)
10591 AC_SUBST(ENABLE_QT5)
10594 if test "x$enable_kf5" = "xyes"; then
10596 AC_DEFINE(ENABLE_KF5)
10599 AC_SUBST(ENABLE_KF5)
10601 ENABLE_GTK3_KDE5=""
10602 if test "x$enable_gtk3_kde5" = "xyes"; then
10603 ENABLE_GTK3_KDE5="TRUE"
10604 AC_DEFINE(ENABLE_GTK3_KDE5)
10607 AC_SUBST(ENABLE_GTK3_KDE5)
10609 if test "$_os" = "WINNT"; then
10611 elif test "$_os" = "Darwin"; then
10613 elif test "$_os" = "iOS"; then
10617 build_vcl_plugins="$R"
10618 if test -z "$build_vcl_plugins"; then
10619 build_vcl_plugins="none"
10621 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10623 dnl ===================================================================
10624 dnl check for dbus support
10625 dnl ===================================================================
10629 DBUS_GLIB_CFLAGS=""
10633 if test "$enable_dbus" = "no"; then
10637 AC_MSG_CHECKING([whether to enable DBUS support])
10638 if test "$test_dbus" = "yes"; then
10640 AC_MSG_RESULT([yes])
10641 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10642 AC_DEFINE(ENABLE_DBUS)
10643 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10644 FilterLibs "${DBUS_LIBS}"
10645 DBUS_LIBS="${filteredlibs}"
10647 # Glib is needed for BluetoothServer
10648 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10649 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10651 DBUS_HAVE_GLIB="TRUE"
10652 AC_DEFINE(DBUS_HAVE_GLIB,1)
10654 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10657 AC_MSG_RESULT([no])
10660 AC_SUBST(ENABLE_DBUS)
10661 AC_SUBST(DBUS_CFLAGS)
10662 AC_SUBST(DBUS_LIBS)
10663 AC_SUBST(DBUS_GLIB_CFLAGS)
10664 AC_SUBST(DBUS_GLIB_LIBS)
10665 AC_SUBST(DBUS_HAVE_GLIB)
10667 AC_MSG_CHECKING([whether to enable Impress remote control])
10668 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10669 AC_MSG_RESULT([yes])
10670 ENABLE_SDREMOTE=TRUE
10671 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10673 if test $OS = MACOSX && test "$MAC_OS_X_VERSION_MAX_ALLOWED" -ge 101500; then
10674 # The Bluetooth code doesn't compile with macOS SDK 10.15
10675 enable_sdremote_bluetooth=no
10677 # If not explicitly enabled or disabled, default
10678 if test -z "$enable_sdremote_bluetooth"; then
10681 # Default to yes for these
10682 enable_sdremote_bluetooth=yes
10686 enable_sdremote_bluetooth=no
10690 # $enable_sdremote_bluetooth is guaranteed non-empty now
10692 if test "$enable_sdremote_bluetooth" != "no"; then
10693 if test "$OS" = "LINUX"; then
10694 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10695 AC_MSG_RESULT([yes])
10696 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10697 dnl ===================================================================
10698 dnl Check for system bluez
10699 dnl ===================================================================
10700 AC_MSG_CHECKING([which Bluetooth header to use])
10701 if test "$with_system_bluez" = "yes"; then
10702 AC_MSG_RESULT([external])
10703 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10704 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10707 AC_MSG_RESULT([internal])
10711 AC_MSG_RESULT([no, dbus disabled])
10712 ENABLE_SDREMOTE_BLUETOOTH=
10716 AC_MSG_RESULT([yes])
10717 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10721 AC_MSG_RESULT([no])
10722 ENABLE_SDREMOTE_BLUETOOTH=
10728 AC_MSG_RESULT([no])
10730 AC_SUBST(ENABLE_SDREMOTE)
10731 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10732 AC_SUBST(SYSTEM_BLUEZ)
10734 dnl ===================================================================
10735 dnl Check whether to enable GIO support
10736 dnl ===================================================================
10737 if test "$ENABLE_GTK3" = "TRUE"; then
10738 AC_MSG_CHECKING([whether to enable GIO support])
10739 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10740 dnl Need at least 2.26 for the dbus support.
10741 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10742 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10743 if test "$ENABLE_GIO" = "TRUE"; then
10744 AC_DEFINE(ENABLE_GIO)
10745 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10746 FilterLibs "${GIO_LIBS}"
10747 GIO_LIBS="${filteredlibs}"
10750 AC_MSG_RESULT([no])
10753 AC_SUBST(ENABLE_GIO)
10754 AC_SUBST(GIO_CFLAGS)
10758 dnl ===================================================================
10760 SPLIT_APP_MODULES=""
10761 if test "$enable_split_app_modules" = "yes"; then
10762 SPLIT_APP_MODULES="TRUE"
10764 AC_SUBST(SPLIT_APP_MODULES)
10766 SPLIT_OPT_FEATURES=""
10767 if test "$enable_split_opt_features" = "yes"; then
10768 SPLIT_OPT_FEATURES="TRUE"
10770 AC_SUBST(SPLIT_OPT_FEATURES)
10772 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10773 if test "$enable_cairo_canvas" = yes; then
10774 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10776 enable_cairo_canvas=no
10777 elif test -z "$enable_cairo_canvas"; then
10778 enable_cairo_canvas=yes
10781 ENABLE_CAIRO_CANVAS=""
10782 if test "$enable_cairo_canvas" = "yes"; then
10784 ENABLE_CAIRO_CANVAS="TRUE"
10785 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10787 AC_SUBST(ENABLE_CAIRO_CANVAS)
10789 dnl ===================================================================
10790 dnl Check whether the GStreamer libraries are available.
10791 dnl ===================================================================
10793 ENABLE_GSTREAMER_1_0=""
10795 if test "$build_gstreamer_1_0" = "yes"; then
10797 AC_MSG_CHECKING([whether to enable the GStreamer 1.0 avmedia backend])
10798 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10799 ENABLE_GSTREAMER_1_0="TRUE"
10800 AC_MSG_RESULT([yes])
10801 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10802 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10803 FilterLibs "${GSTREAMER_1_0_LIBS}"
10804 GSTREAMER_1_0_LIBS="${filteredlibs}"
10805 AC_DEFINE(ENABLE_GSTREAMER_1_0)
10807 AC_MSG_RESULT([no])
10810 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10811 AC_SUBST(GSTREAMER_1_0_LIBS)
10812 AC_SUBST(ENABLE_GSTREAMER_1_0)
10814 dnl ===================================================================
10815 dnl Check whether to build the VLC avmedia backend
10816 dnl ===================================================================
10820 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10821 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10823 AC_MSG_RESULT([yes])
10825 AC_MSG_RESULT([no])
10827 AC_SUBST(ENABLE_VLC)
10829 ENABLE_OPENGL_TRANSITIONS=
10830 ENABLE_OPENGL_CANVAS=
10831 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10833 elif test "$_os" = "Darwin"; then
10834 # We use frameworks on macOS, no need for detail checks
10835 ENABLE_OPENGL_TRANSITIONS=TRUE
10836 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10837 ENABLE_OPENGL_CANVAS=TRUE
10838 elif test $_os = WINNT; then
10839 ENABLE_OPENGL_TRANSITIONS=TRUE
10840 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10841 ENABLE_OPENGL_CANVAS=TRUE
10843 if test "$USING_X11" = TRUE; then
10844 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10845 ENABLE_OPENGL_TRANSITIONS=TRUE
10846 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10847 ENABLE_OPENGL_CANVAS=TRUE
10851 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10852 AC_SUBST(ENABLE_OPENGL_CANVAS)
10854 dnl =================================================
10855 dnl Check whether to build with OpenCL support.
10856 dnl =================================================
10858 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10859 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10860 # platform (optional at run-time, used through clew).
10861 BUILD_TYPE="$BUILD_TYPE OPENCL"
10862 AC_DEFINE(HAVE_FEATURE_OPENCL)
10865 dnl =================================================
10866 dnl Check whether to build with dconf support.
10867 dnl =================================================
10869 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
10870 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10871 if test "$enable_dconf" = yes; then
10872 AC_MSG_ERROR([dconf not found])
10877 AC_MSG_CHECKING([whether to enable dconf])
10878 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
10882 AC_MSG_RESULT([no])
10885 AC_DEFINE(ENABLE_DCONF)
10886 AC_MSG_RESULT([yes])
10888 AC_SUBST([DCONF_CFLAGS])
10889 AC_SUBST([DCONF_LIBS])
10890 AC_SUBST([ENABLE_DCONF])
10893 AC_MSG_CHECKING([whether to build the PDF import feature])
10895 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10896 AC_MSG_RESULT([yes])
10897 ENABLE_PDFIMPORT=TRUE
10898 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10900 AC_MSG_RESULT([no])
10904 AC_MSG_CHECKING([whether to build PDFium])
10906 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_pdfium" = yes; then
10907 AC_MSG_RESULT([yes])
10909 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10910 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10912 AC_MSG_RESULT([no])
10914 AC_SUBST(ENABLE_PDFIUM)
10916 dnl ===================================================================
10917 dnl Check for poppler
10918 dnl ===================================================================
10920 AC_MSG_CHECKING([whether to build Poppler])
10921 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_poppler" = yes; then
10922 AC_MSG_RESULT([yes])
10923 ENABLE_POPPLER=TRUE
10924 AC_DEFINE(HAVE_FEATURE_POPPLER)
10926 AC_MSG_RESULT([no])
10928 AC_SUBST(ENABLE_POPPLER)
10930 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
10931 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
10934 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" = "TRUE" -o "$ENABLE_PDFIUM" = "TRUE" \); then
10935 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
10938 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
10939 dnl ===================================================================
10940 dnl Check for system poppler
10941 dnl ===================================================================
10942 AC_MSG_CHECKING([which PDF import poppler to use])
10943 if test "$with_system_poppler" = "yes"; then
10944 AC_MSG_RESULT([external])
10945 SYSTEM_POPPLER=TRUE
10946 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10947 AC_LANG_PUSH([C++])
10948 save_CXXFLAGS=$CXXFLAGS
10949 save_CPPFLAGS=$CPPFLAGS
10950 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10951 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10952 AC_CHECK_HEADER([cpp/poppler-version.h],
10953 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10955 CXXFLAGS=$save_CXXFLAGS
10956 CPPFLAGS=$save_CPPFLAGS
10958 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10960 FilterLibs "${POPPLER_LIBS}"
10961 POPPLER_LIBS="${filteredlibs}"
10963 AC_MSG_RESULT([internal])
10965 BUILD_TYPE="$BUILD_TYPE POPPLER"
10966 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10968 AC_DEFINE([ENABLE_PDFIMPORT],1)
10970 AC_SUBST(ENABLE_PDFIMPORT)
10971 AC_SUBST(SYSTEM_POPPLER)
10972 AC_SUBST(POPPLER_CFLAGS)
10973 AC_SUBST(POPPLER_LIBS)
10977 if test "$build_for_ios" = "YES"; then
10978 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
10979 AC_MSG_RESULT([yes])
10980 elif test "$enable_mpl_subset" = "yes"; then
10981 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
10982 AC_MSG_RESULT([yes])
10983 elif test "$enable_fuzzers" = "yes"; then
10984 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
10985 AC_MSG_RESULT([yes])
10986 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
10987 dnl ===================================================================
10988 dnl Check for system gpgme
10989 dnl ===================================================================
10990 AC_MSG_CHECKING([which gpgmepp to use])
10991 if test "$with_system_gpgmepp" = "yes"; then
10992 AC_MSG_RESULT([external])
10993 SYSTEM_GPGMEPP=TRUE
10995 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
10996 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
10997 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
10998 # progress_callback is the only func with plain C linkage
10999 # checking for it also filters out older, KDE-dependent libgpgmepp versions
11000 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
11001 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
11002 AC_CHECK_HEADER(gpgme.h, [],
11003 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
11005 AC_MSG_RESULT([internal])
11006 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
11007 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
11009 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
11010 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
11011 if test "$_os" != "WINNT"; then
11012 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
11013 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
11014 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
11015 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
11018 ENABLE_GPGMEPP=TRUE
11019 AC_DEFINE([HAVE_FEATURE_GPGME])
11020 AC_PATH_PROG(GPG, gpg)
11021 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
11022 # so let's exclude that manually for the moment
11023 if test -n "$GPG" -a "$_os" != "WINNT"; then
11024 # make sure we not only have a working gpgme, but a full working
11025 # gpg installation to run OpenPGP signature verification
11026 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
11028 if test "$_os" = "Linux"; then
11030 AC_MSG_CHECKING([for /run/user/$uid])
11031 if test -d /run/user/$uid; then
11032 AC_MSG_RESULT([yes])
11033 AC_PATH_PROG(GPGCONF, gpgconf)
11035 # Older versions of gpgconf are not working as expected, since
11036 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
11037 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
11038 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
11039 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
11040 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
11041 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
11042 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
11043 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
11044 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
11045 if $GPGCONF --dump-options > /dev/null ; then
11046 if $GPGCONF --dump-options | grep -q create-socketdir ; then
11047 AC_MSG_RESULT([yes])
11048 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
11049 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
11051 AC_MSG_RESULT([no])
11054 AC_MSG_RESULT([no. missing or broken gpgconf?])
11057 AC_MSG_RESULT([no, $GPGCONF_VERSION])
11060 AC_MSG_RESULT([no])
11064 AC_SUBST(ENABLE_GPGMEPP)
11065 AC_SUBST(SYSTEM_GPGMEPP)
11066 AC_SUBST(GPG_ERROR_CFLAGS)
11067 AC_SUBST(GPG_ERROR_LIBS)
11068 AC_SUBST(LIBASSUAN_CFLAGS)
11069 AC_SUBST(LIBASSUAN_LIBS)
11070 AC_SUBST(GPGMEPP_CFLAGS)
11071 AC_SUBST(GPGMEPP_LIBS)
11073 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
11074 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
11075 AC_MSG_RESULT([yes])
11076 ENABLE_MEDIAWIKI=TRUE
11077 BUILD_TYPE="$BUILD_TYPE XSLTML"
11078 if test "x$with_java" = "xno"; then
11079 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
11082 AC_MSG_RESULT([no])
11084 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
11086 AC_SUBST(ENABLE_MEDIAWIKI)
11088 AC_MSG_CHECKING([whether to build the Report Builder])
11089 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
11090 AC_MSG_RESULT([yes])
11091 ENABLE_REPORTBUILDER=TRUE
11092 AC_MSG_CHECKING([which jfreereport libs to use])
11093 if test "$with_system_jfreereport" = "yes"; then
11094 SYSTEM_JFREEREPORT=TRUE
11095 AC_MSG_RESULT([external])
11096 if test -z $SAC_JAR; then
11097 SAC_JAR=/usr/share/java/sac.jar
11099 if ! test -f $SAC_JAR; then
11100 AC_MSG_ERROR(sac.jar not found.)
11103 if test -z $LIBXML_JAR; then
11104 if test -f /usr/share/java/libxml-1.0.0.jar; then
11105 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
11106 elif test -f /usr/share/java/libxml.jar; then
11107 LIBXML_JAR=/usr/share/java/libxml.jar
11109 AC_MSG_ERROR(libxml.jar replacement not found.)
11111 elif ! test -f $LIBXML_JAR; then
11112 AC_MSG_ERROR(libxml.jar not found.)
11115 if test -z $FLUTE_JAR; then
11116 if test -f/usr/share/java/flute-1.3.0.jar; then
11117 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
11118 elif test -f /usr/share/java/flute.jar; then
11119 FLUTE_JAR=/usr/share/java/flute.jar
11121 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
11123 elif ! test -f $FLUTE_JAR; then
11124 AC_MSG_ERROR(flute-1.3.0.jar not found.)
11127 if test -z $JFREEREPORT_JAR; then
11128 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
11129 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
11130 elif test -f /usr/share/java/flow-engine.jar; then
11131 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
11133 AC_MSG_ERROR(jfreereport.jar replacement not found.)
11135 elif ! test -f $JFREEREPORT_JAR; then
11136 AC_MSG_ERROR(jfreereport.jar not found.)
11139 if test -z $LIBLAYOUT_JAR; then
11140 if test -f /usr/share/java/liblayout-0.2.9.jar; then
11141 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
11142 elif test -f /usr/share/java/liblayout.jar; then
11143 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
11145 AC_MSG_ERROR(liblayout.jar replacement not found.)
11147 elif ! test -f $LIBLAYOUT_JAR; then
11148 AC_MSG_ERROR(liblayout.jar not found.)
11151 if test -z $LIBLOADER_JAR; then
11152 if test -f /usr/share/java/libloader-1.0.0.jar; then
11153 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
11154 elif test -f /usr/share/java/libloader.jar; then
11155 LIBLOADER_JAR=/usr/share/java/libloader.jar
11157 AC_MSG_ERROR(libloader.jar replacement not found.)
11159 elif ! test -f $LIBLOADER_JAR; then
11160 AC_MSG_ERROR(libloader.jar not found.)
11163 if test -z $LIBFORMULA_JAR; then
11164 if test -f /usr/share/java/libformula-0.2.0.jar; then
11165 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
11166 elif test -f /usr/share/java/libformula.jar; then
11167 LIBFORMULA_JAR=/usr/share/java/libformula.jar
11169 AC_MSG_ERROR(libformula.jar replacement not found.)
11171 elif ! test -f $LIBFORMULA_JAR; then
11172 AC_MSG_ERROR(libformula.jar not found.)
11175 if test -z $LIBREPOSITORY_JAR; then
11176 if test -f /usr/share/java/librepository-1.0.0.jar; then
11177 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
11178 elif test -f /usr/share/java/librepository.jar; then
11179 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
11181 AC_MSG_ERROR(librepository.jar replacement not found.)
11183 elif ! test -f $LIBREPOSITORY_JAR; then
11184 AC_MSG_ERROR(librepository.jar not found.)
11187 if test -z $LIBFONTS_JAR; then
11188 if test -f /usr/share/java/libfonts-1.0.0.jar; then
11189 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
11190 elif test -f /usr/share/java/libfonts.jar; then
11191 LIBFONTS_JAR=/usr/share/java/libfonts.jar
11193 AC_MSG_ERROR(libfonts.jar replacement not found.)
11195 elif ! test -f $LIBFONTS_JAR; then
11196 AC_MSG_ERROR(libfonts.jar not found.)
11199 if test -z $LIBSERIALIZER_JAR; then
11200 if test -f /usr/share/java/libserializer-1.0.0.jar; then
11201 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
11202 elif test -f /usr/share/java/libserializer.jar; then
11203 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
11205 AC_MSG_ERROR(libserializer.jar replacement not found.)
11207 elif ! test -f $LIBSERIALIZER_JAR; then
11208 AC_MSG_ERROR(libserializer.jar not found.)
11211 if test -z $LIBBASE_JAR; then
11212 if test -f /usr/share/java/libbase-1.0.0.jar; then
11213 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
11214 elif test -f /usr/share/java/libbase.jar; then
11215 LIBBASE_JAR=/usr/share/java/libbase.jar
11217 AC_MSG_ERROR(libbase.jar replacement not found.)
11219 elif ! test -f $LIBBASE_JAR; then
11220 AC_MSG_ERROR(libbase.jar not found.)
11224 AC_MSG_RESULT([internal])
11225 SYSTEM_JFREEREPORT=
11226 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
11230 AC_MSG_RESULT([no])
11231 ENABLE_REPORTBUILDER=
11232 SYSTEM_JFREEREPORT=
11234 AC_SUBST(ENABLE_REPORTBUILDER)
11235 AC_SUBST(SYSTEM_JFREEREPORT)
11237 AC_SUBST(LIBXML_JAR)
11238 AC_SUBST(FLUTE_JAR)
11239 AC_SUBST(JFREEREPORT_JAR)
11240 AC_SUBST(LIBBASE_JAR)
11241 AC_SUBST(LIBLAYOUT_JAR)
11242 AC_SUBST(LIBLOADER_JAR)
11243 AC_SUBST(LIBFORMULA_JAR)
11244 AC_SUBST(LIBREPOSITORY_JAR)
11245 AC_SUBST(LIBFONTS_JAR)
11246 AC_SUBST(LIBSERIALIZER_JAR)
11248 # this has to be here because both the Wiki Publisher and the SRB use
11250 COMMONS_LOGGING_VERSION=1.2
11251 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
11252 AC_MSG_CHECKING([which Apache commons-* libs to use])
11253 if test "$with_system_apache_commons" = "yes"; then
11254 SYSTEM_APACHE_COMMONS=TRUE
11255 AC_MSG_RESULT([external])
11256 if test -z $COMMONS_LOGGING_JAR; then
11257 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
11258 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
11259 elif test -f /usr/share/java/commons-logging.jar; then
11260 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
11262 AC_MSG_ERROR(commons-logging.jar replacement not found.)
11264 elif ! test -f $COMMONS_LOGGING_JAR; then
11265 AC_MSG_ERROR(commons-logging.jar not found.)
11268 AC_MSG_RESULT([internal])
11269 SYSTEM_APACHE_COMMONS=
11270 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
11274 AC_SUBST(SYSTEM_APACHE_COMMONS)
11275 AC_SUBST(COMMONS_LOGGING_JAR)
11276 AC_SUBST(COMMONS_LOGGING_VERSION)
11278 # scripting provider for BeanShell?
11279 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
11280 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
11281 AC_MSG_RESULT([yes])
11282 ENABLE_SCRIPTING_BEANSHELL=TRUE
11284 dnl ===================================================================
11285 dnl Check for system beanshell
11286 dnl ===================================================================
11287 AC_MSG_CHECKING([which beanshell to use])
11288 if test "$with_system_beanshell" = "yes"; then
11289 AC_MSG_RESULT([external])
11291 if test -z $BSH_JAR; then
11292 BSH_JAR=/usr/share/java/bsh.jar
11294 if ! test -f $BSH_JAR; then
11295 AC_MSG_ERROR(bsh.jar not found.)
11298 AC_MSG_RESULT([internal])
11300 BUILD_TYPE="$BUILD_TYPE BSH"
11303 AC_MSG_RESULT([no])
11304 ENABLE_SCRIPTING_BEANSHELL=
11305 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
11307 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
11308 AC_SUBST(SYSTEM_BSH)
11311 # scripting provider for JavaScript?
11312 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
11313 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
11314 AC_MSG_RESULT([yes])
11315 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
11317 dnl ===================================================================
11318 dnl Check for system rhino
11319 dnl ===================================================================
11320 AC_MSG_CHECKING([which rhino to use])
11321 if test "$with_system_rhino" = "yes"; then
11322 AC_MSG_RESULT([external])
11324 if test -z $RHINO_JAR; then
11325 RHINO_JAR=/usr/share/java/js.jar
11327 if ! test -f $RHINO_JAR; then
11328 AC_MSG_ERROR(js.jar not found.)
11331 AC_MSG_RESULT([internal])
11333 BUILD_TYPE="$BUILD_TYPE RHINO"
11337 AC_MSG_RESULT([no])
11338 ENABLE_SCRIPTING_JAVASCRIPT=
11339 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
11341 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
11342 AC_SUBST(SYSTEM_RHINO)
11343 AC_SUBST(RHINO_JAR)
11345 # This is only used in Qt5/KF5 checks to determine if /usr/lib64
11346 # paths should be added to library search path. So lets put all 64-bit
11349 case "$host_cpu" in
11350 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
11351 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
11352 supports_multilib="yes"
11359 dnl ===================================================================
11360 dnl QT5 Integration
11361 dnl ===================================================================
11367 QT5_GOBJECT_CFLAGS=""
11368 QT5_GOBJECT_LIBS=""
11369 QT5_HAVE_GOBJECT=""
11370 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11371 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11372 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11374 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11375 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11377 if test -n "$supports_multilib"; then
11378 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11381 qt5_test_include="QtWidgets/qapplication.h"
11382 qt5_test_library="libQt5Widgets.so"
11384 dnl Check for qmake5
11385 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH])
11386 if test "$QMAKE5" = "no"; then
11387 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11389 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11390 if test -z "$qmake5_test_ver"; then
11391 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11393 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11394 qt5_minimal_minor="6"
11395 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11396 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11398 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11402 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11403 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11405 AC_MSG_CHECKING([for Qt5 headers])
11407 for inc_dir in $qt5_incdirs; do
11408 if test -r "$inc_dir/$qt5_test_include"; then
11409 qt5_incdir="$inc_dir"
11413 AC_MSG_RESULT([$qt5_incdir])
11414 if test "x$qt5_incdir" = "xno"; then
11415 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11418 AC_MSG_CHECKING([for Qt5 libraries])
11420 for lib_dir in $qt5_libdirs; do
11421 if test -r "$lib_dir/$qt5_test_library"; then
11422 qt5_libdir="$lib_dir"
11426 AC_MSG_RESULT([$qt5_libdir])
11427 if test "x$qt5_libdir" = "xno"; then
11428 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11431 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
11432 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11433 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11435 if test "$USING_X11" = TRUE; then
11436 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
11437 PKG_CHECK_MODULES(QT5_XCB_ICCCM,[xcb-icccm],[
11438 QT5_HAVE_XCB_ICCCM=1
11439 AC_DEFINE(QT5_HAVE_XCB_ICCCM)
11441 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)])
11442 add_warning "XCB ICCCM not found, which is needed for Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)"
11444 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
11445 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
11447 AC_DEFINE(QT5_USING_X11)
11450 dnl Check for Meta Object Compiler
11452 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH])
11453 if test "$MOC5" = "no"; then
11454 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11455 the root of your Qt installation by exporting QT5DIR before running "configure".])
11458 if test "$build_gstreamer_1_0" = "yes"; then
11459 PKG_CHECK_MODULES(QT5_GOBJECT,[gobject-2.0], [
11461 AC_DEFINE(QT5_HAVE_GOBJECT)
11463 AC_MSG_WARN([[No GObject found, can't use QWidget GStreamer sink on wayland!]])
11467 AC_SUBST(QT5_CFLAGS)
11470 AC_SUBST(QT5_GOBJECT_CFLAGS)
11471 AC_SUBST(QT5_GOBJECT_LIBS)
11472 AC_SUBST(QT5_HAVE_GOBJECT)
11474 dnl ===================================================================
11475 dnl KF5 Integration
11476 dnl ===================================================================
11480 KF5_CONFIG="kf5-config"
11481 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11482 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11484 if test "$OS" = "HAIKU"; then
11485 haiku_arch="`echo $RTL_ARCH | tr X x`"
11486 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11487 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11490 kf5_incdirs="$KF5INC /usr/include $kf5_haiku_incdirs $x_includes"
11491 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11492 if test -n "$supports_multilib"; then
11493 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11496 kf5_test_include="KF5/kcoreaddons_version.h"
11497 kf5_test_library="libKF5CoreAddons.so"
11498 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11500 dnl kf5 KDE4 support compatibility installed
11501 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11502 if test "$KF5_CONFIG" != "no"; then
11503 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11504 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11507 dnl Check for KF5 headers
11508 AC_MSG_CHECKING([for KF5 headers])
11510 for kf5_check in $kf5_incdirs; do
11511 if test -r "$kf5_check/$kf5_test_include"; then
11512 kf5_incdir="$kf5_check/KF5"
11516 AC_MSG_RESULT([$kf5_incdir])
11517 if test "x$kf5_incdir" = "xno"; then
11518 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11521 dnl Check for KF5 libraries
11522 AC_MSG_CHECKING([for KF5 libraries])
11524 for kf5_check in $kf5_libdirs; do
11525 if test -r "$kf5_check/$kf5_test_library"; then
11526 kf5_libdir="$kf5_check"
11531 AC_MSG_RESULT([$kf5_libdir])
11532 if test "x$kf5_libdir" = "xno"; then
11533 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11536 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"
11537 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11538 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11540 if test "$USING_X11" = TRUE; then
11541 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11544 AC_LANG_PUSH([C++])
11545 save_CXXFLAGS=$CXXFLAGS
11546 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11547 AC_MSG_CHECKING([whether KDE is >= 5.0])
11548 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11549 #include <kcoreaddons_version.h>
11551 int main(int argc, char **argv) {
11552 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11555 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11556 CXXFLAGS=$save_CXXFLAGS
11559 AC_SUBST(KF5_CFLAGS)
11562 dnl ===================================================================
11563 dnl Test whether to include Evolution 2 support
11564 dnl ===================================================================
11565 AC_MSG_CHECKING([whether to enable evolution 2 support])
11566 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11567 AC_MSG_RESULT([yes])
11568 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11569 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11570 FilterLibs "${GOBJECT_LIBS}"
11571 GOBJECT_LIBS="${filteredlibs}"
11572 ENABLE_EVOAB2="TRUE"
11575 AC_MSG_RESULT([no])
11577 AC_SUBST(ENABLE_EVOAB2)
11578 AC_SUBST(GOBJECT_CFLAGS)
11579 AC_SUBST(GOBJECT_LIBS)
11581 dnl ===================================================================
11582 dnl Test which themes to include
11583 dnl ===================================================================
11584 AC_MSG_CHECKING([which themes to include])
11585 # if none given use default subset of available themes
11586 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11587 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 tango"
11591 if test "x$with_theme" != "xno"; then
11592 for theme in $with_theme; do
11594 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|tango) real_theme="$theme" ;;
11595 default) real_theme=colibre ;;
11596 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11598 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11601 AC_MSG_RESULT([$WITH_THEMES])
11602 AC_SUBST([WITH_THEMES])
11603 # FIXME: remove this, and the convenience default->colibre remapping after a grace period
11604 for theme in $with_theme; do
11606 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11611 dnl ===================================================================
11612 dnl Test whether to integrate helppacks into the product's installer
11613 dnl ===================================================================
11614 AC_MSG_CHECKING([for helppack integration])
11615 if test "$with_helppack_integration" = "no"; then
11616 AC_MSG_RESULT([no integration])
11618 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11619 AC_MSG_RESULT([integration])
11622 ###############################################################################
11623 # Extensions checking
11624 ###############################################################################
11625 AC_MSG_CHECKING([for extensions integration])
11626 if test "x$enable_extension_integration" != "xno"; then
11627 WITH_EXTENSION_INTEGRATION=TRUE
11628 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11629 AC_MSG_RESULT([yes, use integration])
11631 WITH_EXTENSION_INTEGRATION=
11632 AC_MSG_RESULT([no, do not integrate])
11634 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11636 dnl Should any extra extensions be included?
11637 dnl There are standalone tests for each of these below.
11638 WITH_EXTRA_EXTENSIONS=
11639 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11641 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11642 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11643 if test "x$with_java" != "xno"; then
11644 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11645 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11648 AC_MSG_CHECKING([whether to build opens___.ttf])
11649 if test "$enable_build_opensymbol" = "yes"; then
11650 AC_MSG_RESULT([yes])
11651 AC_PATH_PROG(FONTFORGE, fontforge)
11652 if test -z "$FONTFORGE"; then
11653 AC_MSG_ERROR([fontforge not installed])
11656 AC_MSG_RESULT([no])
11657 OPENSYMBOL_TTF=884ed41809687c3e168fc7c19b16585149ff058eca79acbf3ee784f6630704cc-opens___.ttf
11658 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11660 AC_SUBST(OPENSYMBOL_TTF)
11661 AC_SUBST(FONTFORGE)
11663 dnl ===================================================================
11664 dnl Test whether to include fonts
11665 dnl ===================================================================
11666 AC_MSG_CHECKING([whether to include third-party fonts])
11667 if test "$with_fonts" != "no"; then
11668 AC_MSG_RESULT([yes])
11670 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11671 AC_DEFINE(HAVE_MORE_FONTS)
11673 AC_MSG_RESULT([no])
11675 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11677 AC_SUBST(WITH_FONTS)
11679 dnl Test whether to include more Google Noto fonts
11680 dnl ===================================================================
11681 AC_MSG_CHECKING([whether to include more Google Noto fonts])
11682 if test "$enable_noto_font" = "" -o "$enable_noto_font" = "no" -o "$with_fonts" = "no"; then
11683 AC_MSG_RESULT([no])
11686 AC_MSG_RESULT([yes])
11687 WITH_NOTO_FONT=TRUE
11688 BUILD_TYPE="$BUILD_TYPE NOTO_FONT"
11689 SCPDEFS="$SCPDEFS -DWITH_NOTO_FONT"
11691 AC_SUBST(WITH_NOTO_FONT)
11693 dnl ===================================================================
11694 dnl Test whether to enable online update service
11695 dnl ===================================================================
11696 AC_MSG_CHECKING([whether to enable online update])
11697 ENABLE_ONLINE_UPDATE=
11698 ENABLE_ONLINE_UPDATE_MAR=
11700 if test "$enable_online_update" = ""; then
11701 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11702 AC_MSG_RESULT([yes])
11703 ENABLE_ONLINE_UPDATE="TRUE"
11705 AC_MSG_RESULT([no])
11708 if test "$enable_online_update" = "mar"; then
11709 AC_MSG_RESULT([yes - MAR-based online update])
11710 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11711 if test "$with_update_config" = ""; then
11712 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11714 UPDATE_CONFIG="$with_update_config"
11715 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11716 elif test "$enable_online_update" = "yes"; then
11717 AC_MSG_RESULT([yes])
11718 ENABLE_ONLINE_UPDATE="TRUE"
11720 AC_MSG_RESULT([no])
11723 AC_SUBST(ENABLE_ONLINE_UPDATE)
11724 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11725 AC_SUBST(UPDATE_CONFIG)
11727 dnl ===================================================================
11728 dnl Test whether we need bzip2
11729 dnl ===================================================================
11731 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11732 AC_MSG_CHECKING([whether to use system bzip2])
11733 if test "$with_system_bzip2" = yes; then
11735 AC_MSG_RESULT([yes])
11736 PKG_CHECK_MODULES(BZIP2, bzip2)
11737 FilterLibs "${BZIP2_LIBS}"
11738 BZIP2_LIBS="${filteredlibs}"
11740 AC_MSG_RESULT([no])
11741 BUILD_TYPE="$BUILD_TYPE BZIP2"
11744 AC_SUBST(SYSTEM_BZIP2)
11745 AC_SUBST(BZIP2_CFLAGS)
11746 AC_SUBST(BZIP2_LIBS)
11748 dnl ===================================================================
11749 dnl Test whether to enable extension update
11750 dnl ===================================================================
11751 AC_MSG_CHECKING([whether to enable extension update])
11752 ENABLE_EXTENSION_UPDATE=
11753 if test "x$enable_extension_update" = "xno"; then
11754 AC_MSG_RESULT([no])
11756 AC_MSG_RESULT([yes])
11757 ENABLE_EXTENSION_UPDATE="TRUE"
11758 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11759 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11761 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11764 dnl ===================================================================
11765 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11766 dnl ===================================================================
11767 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11768 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11769 AC_MSG_RESULT([no])
11772 AC_MSG_RESULT([yes])
11773 ENABLE_SILENT_MSI=TRUE
11774 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11776 AC_SUBST(ENABLE_SILENT_MSI)
11778 AC_MSG_CHECKING([whether and how to use Xinerama])
11779 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11780 if test "$x_libraries" = "default_x_libraries"; then
11781 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11782 if test "x$XINERAMALIB" = x; then
11783 XINERAMALIB="/usr/lib"
11786 XINERAMALIB="$x_libraries"
11788 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11789 # we have both versions, let the user decide but use the dynamic one
11792 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11793 XINERAMA_LINK=dynamic
11795 XINERAMA_LINK=static
11797 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11798 # we have only the dynamic version
11800 XINERAMA_LINK=dynamic
11801 elif test -e "$XINERAMALIB/libXinerama.a"; then
11803 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11805 XINERAMA_LINK=static
11815 if test "$USE_XINERAMA" = "TRUE"; then
11816 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11817 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11818 [AC_MSG_ERROR(Xinerama header not found.)], [])
11819 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11820 if test "x$XEXTLIB" = x; then
11821 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11823 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11824 if test "$_os" = "FreeBSD"; then
11825 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11827 if test "$_os" = "Linux"; then
11828 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11830 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11831 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11833 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11838 AC_MSG_RESULT([no])
11840 AC_SUBST(USE_XINERAMA)
11841 AC_SUBST(XINERAMA_LINK)
11843 dnl ===================================================================
11844 dnl Test whether to build cairo or rely on the system version
11845 dnl ===================================================================
11847 if test "$USING_X11" = TRUE; then
11848 # Used in vcl/Library_vclplug_gen.mk
11852 if test "$test_cairo" = "yes"; then
11853 AC_MSG_CHECKING([whether to use the system cairo])
11855 : ${with_system_cairo:=$with_system_libs}
11856 if test "$with_system_cairo" = "yes"; then
11858 AC_MSG_RESULT([yes])
11860 PKG_CHECK_MODULES( CAIRO, cairo >= 1.8.0 )
11861 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11862 FilterLibs "${CAIRO_LIBS}"
11863 CAIRO_LIBS="${filteredlibs}"
11865 if test "$test_xrender" = "yes"; then
11866 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11868 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11869 #ifdef PictStandardA8
11873 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11879 AC_MSG_RESULT([no])
11881 BUILD_TYPE="$BUILD_TYPE CAIRO"
11885 AC_SUBST(SYSTEM_CAIRO)
11886 AC_SUBST(CAIRO_CFLAGS)
11887 AC_SUBST(CAIRO_LIBS)
11889 dnl ===================================================================
11890 dnl Test whether to use avahi
11891 dnl ===================================================================
11892 if test "$_os" = "WINNT"; then
11893 # Windows uses bundled mDNSResponder
11894 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11895 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11896 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11897 [ENABLE_AVAHI="TRUE"])
11898 AC_DEFINE(HAVE_FEATURE_AVAHI)
11899 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11900 FilterLibs "${AVAHI_LIBS}"
11901 AVAHI_LIBS="${filteredlibs}"
11904 AC_SUBST(ENABLE_AVAHI)
11905 AC_SUBST(AVAHI_CFLAGS)
11906 AC_SUBST(AVAHI_LIBS)
11908 dnl ===================================================================
11909 dnl Test whether to use liblangtag
11910 dnl ===================================================================
11912 AC_MSG_CHECKING([whether to use system liblangtag])
11913 if test "$with_system_liblangtag" = yes; then
11914 SYSTEM_LIBLANGTAG=TRUE
11915 AC_MSG_RESULT([yes])
11916 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11917 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11918 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11919 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11920 FilterLibs "${LIBLANGTAG_LIBS}"
11921 LIBLANGTAG_LIBS="${filteredlibs}"
11924 AC_MSG_RESULT([no])
11925 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11926 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
11927 if test "$COM" = "MSC"; then
11928 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
11930 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
11933 AC_SUBST(SYSTEM_LIBLANGTAG)
11934 AC_SUBST(LIBLANGTAG_CFLAGS)
11935 AC_SUBST(LIBLANGTAG_LIBS)
11937 dnl ===================================================================
11938 dnl Test whether to build libpng or rely on the system version
11939 dnl ===================================================================
11941 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
11943 dnl ===================================================================
11944 dnl Check for runtime JVM search path
11945 dnl ===================================================================
11946 if test "$ENABLE_JAVA" != ""; then
11947 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11948 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11949 AC_MSG_RESULT([yes])
11950 if ! test -d "$with_jvm_path"; then
11951 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11953 if ! test -d "$with_jvm_path"jvm; then
11954 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11956 JVM_ONE_PATH_CHECK="$with_jvm_path"
11957 AC_SUBST(JVM_ONE_PATH_CHECK)
11959 AC_MSG_RESULT([no])
11963 dnl ===================================================================
11964 dnl Test for the presence of Ant and that it works
11965 dnl ===================================================================
11967 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
11968 ANT_HOME=; export ANT_HOME
11969 WITH_ANT_HOME=; export WITH_ANT_HOME
11970 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11971 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11972 if test "$_os" = "WINNT"; then
11973 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11975 with_ant_home="$LODE_HOME/opt/ant"
11977 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11978 with_ant_home="$LODE_HOME/opt/ant"
11981 if test -z "$with_ant_home"; then
11982 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
11984 if test "$_os" = "WINNT"; then
11985 # AC_PATH_PROGS needs unix path
11986 with_ant_home=`cygpath -u "$with_ant_home"`
11988 AbsolutePath "$with_ant_home"
11989 with_ant_home=$absolute_path
11990 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11991 WITH_ANT_HOME=$with_ant_home
11992 ANT_HOME=$with_ant_home
11995 if test -z "$ANT"; then
11996 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11998 # resolve relative or absolute symlink
11999 while test -h "$ANT"; do
12001 a_basename=`basename "$ANT"`
12002 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
12003 cd "`dirname "$ANT"`"
12004 cd "`dirname "$a_script"`"
12005 ANT="`pwd`"/"`basename "$a_script"`"
12009 AC_MSG_CHECKING([if $ANT works])
12010 mkdir -p conftest.dir
12013 cat > conftest.java << EOF
12014 public class conftest {
12015 int testmethod(int a, int b) {
12021 cat > conftest.xml << EOF
12022 <project name="conftest" default="conftest">
12023 <target name="conftest">
12024 <javac srcdir="." includes="conftest.java">
12030 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
12031 if test $? = 0 -a -f ./conftest.class; then
12032 AC_MSG_RESULT([Ant works])
12033 if test -z "$WITH_ANT_HOME"; then
12034 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
12035 if test -z "$ANT_HOME"; then
12036 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
12039 ANT_HOME="$WITH_ANT_HOME"
12042 echo "configure: Ant test failed" >&5
12043 cat conftest.java >&5
12044 cat conftest.xml >&5
12045 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
12048 rm -fr conftest.dir
12050 if test -z "$ANT_HOME"; then
12051 ANT_HOME="NO_ANT_HOME"
12053 PathFormat "$ANT_HOME"
12054 ANT_HOME="$formatted_path"
12056 ANT="$formatted_path"
12061 dnl Checking for ant.jar
12062 if test "$ANT_HOME" != "NO_ANT_HOME"; then
12063 AC_MSG_CHECKING([Ant lib directory])
12064 if test -f $ANT_HOME/lib/ant.jar; then
12065 ANT_LIB="$ANT_HOME/lib"
12067 if test -f $ANT_HOME/ant.jar; then
12068 ANT_LIB="$ANT_HOME"
12070 if test -f /usr/share/java/ant.jar; then
12071 ANT_LIB=/usr/share/java
12073 if test -f /usr/share/ant-core/lib/ant.jar; then
12074 ANT_LIB=/usr/share/ant-core/lib
12076 if test -f $ANT_HOME/lib/ant/ant.jar; then
12077 ANT_LIB="$ANT_HOME/lib/ant"
12079 if test -f /usr/share/lib/ant/ant.jar; then
12080 ANT_LIB=/usr/share/lib/ant
12082 AC_MSG_ERROR([Ant libraries not found!])
12089 PathFormat "$ANT_LIB"
12090 ANT_LIB="$formatted_path"
12091 AC_MSG_RESULT([Ant lib directory found.])
12096 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
12098 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
12099 ant_version=`"$ANT" -version | $AWK '$3 == "version" { print $4; }'`
12100 ant_version_major=`echo $ant_version | cut -d. -f1`
12101 ant_version_minor=`echo $ant_version | cut -d. -f2`
12102 echo "configure: ant_version $ant_version " >&5
12103 echo "configure: ant_version_major $ant_version_major " >&5
12104 echo "configure: ant_version_minor $ant_version_minor " >&5
12105 if test "$ant_version_major" -ge "2"; then
12106 AC_MSG_RESULT([yes, $ant_version])
12107 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
12108 AC_MSG_RESULT([yes, $ant_version])
12110 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
12113 rm -f conftest* core core.* *.core
12117 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12118 AC_MSG_CHECKING([for JUnit 4])
12119 if test "$with_junit" = "yes"; then
12120 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
12121 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
12122 elif test -e /usr/share/java/junit4.jar; then
12123 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
12125 if test -e /usr/share/lib/java/junit.jar; then
12126 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
12128 OOO_JUNIT_JAR=/usr/share/java/junit.jar
12132 OOO_JUNIT_JAR=$with_junit
12134 if test "$_os" = "WINNT"; then
12135 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
12137 printf 'import org.junit.Before;' > conftest.java
12138 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12139 AC_MSG_RESULT([$OOO_JUNIT_JAR])
12142 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
12143 specify its pathname via --with-junit=..., or disable it via --without-junit])
12145 rm -f conftest.class conftest.java
12146 if test $OOO_JUNIT_JAR != ""; then
12147 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
12150 AC_SUBST(OOO_JUNIT_JAR)
12153 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12154 AC_MSG_CHECKING([for included Hamcrest])
12155 printf 'import org.hamcrest.BaseDescription;' > conftest.java
12156 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12157 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
12159 AC_MSG_RESULT([Not included])
12160 AC_MSG_CHECKING([for standalone hamcrest jar.])
12161 if test "$with_hamcrest" = "yes"; then
12162 if test -e /usr/share/lib/java/hamcrest.jar; then
12163 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
12164 elif test -e /usr/share/java/hamcrest/core.jar; then
12165 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
12167 HAMCREST_JAR=/usr/share/java/hamcrest.jar
12170 HAMCREST_JAR=$with_hamcrest
12172 if test "$_os" = "WINNT"; then
12173 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
12175 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
12176 AC_MSG_RESULT([$HAMCREST_JAR])
12178 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),
12179 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
12182 rm -f conftest.class conftest.java
12184 AC_SUBST(HAMCREST_JAR)
12190 # check for wget and curl
12195 if test "$enable_fetch_external" != "no"; then
12197 CURL=`which curl 2>/dev/null`
12199 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12201 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
12202 if test $? -eq 0; then
12208 if test -z "$WGET" -a -z "$CURL"; then
12209 AC_MSG_ERROR([neither wget nor curl found!])
12218 # check for sha256sum
12222 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
12223 eval "$i -a 256 --version" > /dev/null 2>&1
12225 if test $ret -eq 0; then
12226 SHA256SUM="$i -a 256"
12231 if test -z "$SHA256SUM"; then
12232 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
12233 eval "$i --version" > /dev/null 2>&1
12235 if test $ret -eq 0; then
12242 if test -z "$SHA256SUM"; then
12243 AC_MSG_ERROR([no sha256sum found!])
12246 AC_SUBST(SHA256SUM)
12248 dnl ===================================================================
12249 dnl Dealing with l10n options
12250 dnl ===================================================================
12251 AC_MSG_CHECKING([which languages to be built])
12252 # get list of all languages
12253 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12254 # the sed command does the following:
12255 # + if a line ends with a backslash, append the next line to it
12256 # + adds " on the beginning of the value (after =)
12257 # + adds " at the end of the value
12258 # + removes en-US; we want to put it on the beginning
12259 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12260 [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)]
12261 ALL_LANGS="en-US $completelangiso"
12262 # check the configured localizations
12263 WITH_LANG="$with_lang"
12265 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
12266 # (Norwegian is "nb" and "nn".)
12267 if test "$WITH_LANG" = "no"; then
12271 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12272 AC_MSG_RESULT([en-US])
12274 AC_MSG_RESULT([$WITH_LANG])
12275 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12276 if test -z "$MSGFMT"; then
12277 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12278 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12279 elif test -x "/opt/lo/bin/msgfmt"; then
12280 MSGFMT="/opt/lo/bin/msgfmt"
12282 AC_CHECK_PROGS(MSGFMT, [msgfmt])
12283 if test -z "$MSGFMT"; then
12284 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12288 if test -z "$MSGUNIQ"; then
12289 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12290 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12291 elif test -x "/opt/lo/bin/msguniq"; then
12292 MSGUNIQ="/opt/lo/bin/msguniq"
12294 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12295 if test -z "$MSGUNIQ"; then
12296 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12303 # check that the list is valid
12304 for lang in $WITH_LANG; do
12305 test "$lang" = "ALL" && continue
12306 # need to check for the exact string, so add space before and after the list of all languages
12307 for vl in $ALL_LANGS; do
12308 if test "$vl" = "$lang"; then
12312 if test "$vl" != "$lang"; then
12313 # if you're reading this - you prolly quoted your languages remove the quotes ...
12314 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12317 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12318 echo $WITH_LANG | grep -q en-US
12319 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12321 # list with substituted ALL
12322 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12323 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12324 test "$WITH_LANG" = "en-US" && WITH_LANG=
12325 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12326 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12327 ALL_LANGS=`echo $ALL_LANGS qtz`
12329 AC_SUBST(ALL_LANGS)
12330 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12331 AC_SUBST(WITH_LANG)
12332 AC_SUBST(WITH_LANG_LIST)
12333 AC_SUBST(GIT_NEEDED_SUBMODULES)
12335 WITH_POOR_HELP_LOCALIZATIONS=
12336 if test -d "$SRC_ROOT/translations/source"; then
12337 for l in `ls -1 $SRC_ROOT/translations/source`; do
12338 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12339 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12343 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12345 if test -n "$with_locales"; then
12346 WITH_LOCALES="$with_locales"
12348 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12349 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12350 # config_host/config_locales.h.in
12351 for locale in $WITH_LOCALES; do
12354 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12358 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12361 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12366 AC_DEFINE(WITH_LOCALE_ALL)
12368 AC_SUBST(WITH_LOCALES)
12370 dnl git submodule update --reference
12371 dnl ===================================================================
12372 if test -n "${GIT_REFERENCE_SRC}"; then
12373 for repo in ${GIT_NEEDED_SUBMODULES}; do
12374 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12375 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12379 AC_SUBST(GIT_REFERENCE_SRC)
12381 dnl git submodules linked dirs
12382 dnl ===================================================================
12383 if test -n "${GIT_LINK_SRC}"; then
12384 for repo in ${GIT_NEEDED_SUBMODULES}; do
12385 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12386 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12390 AC_SUBST(GIT_LINK_SRC)
12393 dnl ===================================================================
12394 AC_MSG_CHECKING([for alternative branding images directory])
12395 # initialize mapped arrays
12396 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12397 brand_files="$BRAND_INTRO_IMAGES about.svg"
12399 if test -z "$with_branding" -o "$with_branding" = "no"; then
12400 AC_MSG_RESULT([none])
12401 DEFAULT_BRAND_IMAGES="$brand_files"
12403 if ! test -d $with_branding ; then
12404 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12406 AC_MSG_RESULT([$with_branding])
12407 CUSTOM_BRAND_DIR="$with_branding"
12408 for lfile in $brand_files
12410 if ! test -f $with_branding/$lfile ; then
12411 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12412 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12414 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12417 check_for_progress="yes"
12420 AC_SUBST([BRAND_INTRO_IMAGES])
12421 AC_SUBST([CUSTOM_BRAND_DIR])
12422 AC_SUBST([CUSTOM_BRAND_IMAGES])
12423 AC_SUBST([DEFAULT_BRAND_IMAGES])
12426 AC_MSG_CHECKING([for 'intro' progress settings])
12430 PROGRESSFRAMECOLOR=
12432 PROGRESSTEXTBASELINE=
12434 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12435 source "$with_branding/progress.conf"
12436 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12438 AC_MSG_RESULT([none])
12441 AC_SUBST(PROGRESSBARCOLOR)
12442 AC_SUBST(PROGRESSSIZE)
12443 AC_SUBST(PROGRESSPOSITION)
12444 AC_SUBST(PROGRESSFRAMECOLOR)
12445 AC_SUBST(PROGRESSTEXTCOLOR)
12446 AC_SUBST(PROGRESSTEXTBASELINE)
12449 AC_MSG_CHECKING([for extra build ID])
12450 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12451 EXTRA_BUILDID="$with_extra_buildid"
12453 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12454 if test -n "$EXTRA_BUILDID" ; then
12455 AC_MSG_RESULT([$EXTRA_BUILDID])
12457 AC_MSG_RESULT([not set])
12459 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12462 AC_MSG_CHECKING([for vendor])
12463 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12464 OOO_VENDOR="$USERNAME"
12466 if test -z "$OOO_VENDOR"; then
12470 if test -z "$OOO_VENDOR"; then
12471 OOO_VENDOR="`id -u -n`"
12474 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12476 OOO_VENDOR="$with_vendor"
12477 AC_MSG_RESULT([$OOO_VENDOR])
12479 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12480 AC_SUBST(OOO_VENDOR)
12482 if test "$_os" = "Android" ; then
12483 ANDROID_PACKAGE_NAME=
12484 AC_MSG_CHECKING([for Android package name])
12485 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12486 if test -n "$ENABLE_DEBUG"; then
12487 # Default to the package name that makes ndk-gdb happy.
12488 ANDROID_PACKAGE_NAME="org.libreoffice"
12490 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12493 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12495 ANDROID_PACKAGE_NAME="$with_android_package_name"
12496 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12498 AC_SUBST(ANDROID_PACKAGE_NAME)
12501 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12502 if test "$with_compat_oowrappers" = "yes"; then
12503 WITH_COMPAT_OOWRAPPERS=TRUE
12506 WITH_COMPAT_OOWRAPPERS=
12509 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12511 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{gsub(" ", "", $0);print tolower($0)}'`
12512 AC_MSG_CHECKING([for install dirname])
12513 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12514 INSTALLDIRNAME="$with_install_dirname"
12516 AC_MSG_RESULT([$INSTALLDIRNAME])
12517 AC_SUBST(INSTALLDIRNAME)
12519 AC_MSG_CHECKING([for prefix])
12520 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12521 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12522 PREFIXDIR="$prefix"
12523 AC_MSG_RESULT([$PREFIXDIR])
12524 AC_SUBST(PREFIXDIR)
12526 LIBDIR=[$(eval echo $(eval echo $libdir))]
12529 DATADIR=[$(eval echo $(eval echo $datadir))]
12532 MANDIR=[$(eval echo $(eval echo $mandir))]
12535 DOCDIR=[$(eval echo $(eval echo $docdir))]
12538 BINDIR=[$(eval echo $(eval echo $bindir))]
12541 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12542 AC_SUBST(INSTALLDIR)
12544 TESTINSTALLDIR="${BUILDDIR}/test-install"
12545 AC_SUBST(TESTINSTALLDIR)
12548 # ===================================================================
12549 # OAuth2 id and secrets
12550 # ===================================================================
12552 AC_MSG_CHECKING([for Google Drive client id and secret])
12553 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12554 AC_MSG_RESULT([not set])
12555 GDRIVE_CLIENT_ID="\"\""
12556 GDRIVE_CLIENT_SECRET="\"\""
12558 AC_MSG_RESULT([set])
12559 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12560 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12562 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12563 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12565 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12566 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12567 AC_MSG_RESULT([not set])
12568 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12569 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12571 AC_MSG_RESULT([set])
12572 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12573 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12575 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12576 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12578 AC_MSG_CHECKING([for OneDrive client id and secret])
12579 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12580 AC_MSG_RESULT([not set])
12581 ONEDRIVE_CLIENT_ID="\"\""
12582 ONEDRIVE_CLIENT_SECRET="\"\""
12584 AC_MSG_RESULT([set])
12585 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12586 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12588 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12589 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12592 dnl ===================================================================
12593 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12594 dnl --enable-dependency-tracking configure option
12595 dnl ===================================================================
12596 AC_MSG_CHECKING([whether to enable dependency tracking])
12597 if test "$enable_dependency_tracking" = "no"; then
12599 AC_MSG_RESULT([no])
12601 AC_MSG_RESULT([yes])
12605 dnl ===================================================================
12606 dnl Number of CPUs to use during the build
12607 dnl ===================================================================
12608 AC_MSG_CHECKING([for number of processors to use])
12609 # plain --with-parallelism is just the default
12610 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12611 if test "$with_parallelism" = "no"; then
12614 PARALLELISM=$with_parallelism
12617 if test "$enable_icecream" = "yes"; then
12622 Darwin|FreeBSD|NetBSD|OpenBSD)
12623 PARALLELISM=`sysctl -n hw.ncpu`
12627 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12629 # what else than above does profit here *and* has /proc?
12631 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12635 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12636 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12640 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12641 if test -z "$with_parallelism"; then
12642 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12643 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12646 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."
12650 if test $PARALLELISM -eq 0; then
12651 AC_MSG_RESULT([explicit make -j option needed])
12653 AC_MSG_RESULT([$PARALLELISM])
12655 AC_SUBST(PARALLELISM)
12657 IWYU_PATH="$with_iwyu"
12658 AC_SUBST(IWYU_PATH)
12659 if test ! -z "$IWYU_PATH"; then
12660 if test ! -f "$IWYU_PATH"; then
12661 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12666 # Set up ILIB for MSVC build
12669 if test "$build_os" = "cygwin"; then
12671 if test -n "$JAVA_HOME"; then
12672 ILIB="$ILIB;$JAVA_HOME/lib"
12675 if test "$BITNESS_OVERRIDE" = 64; then
12676 ILIB="$ILIB;$COMPATH/lib/x64"
12677 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12678 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12679 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12680 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12681 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12682 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12684 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12685 ucrtlibpath_formatted=$formatted_path
12686 ILIB="$ILIB;$ucrtlibpath_formatted"
12687 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12689 ILIB="$ILIB;$COMPATH/lib/x86"
12690 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12691 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12692 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12693 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12694 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12695 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12697 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12698 ucrtlibpath_formatted=$formatted_path
12699 ILIB="$ILIB;$ucrtlibpath_formatted"
12700 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12702 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12703 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12705 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12711 # ===================================================================
12712 # Creating bigger shared library to link against
12713 # ===================================================================
12714 AC_MSG_CHECKING([whether to create huge library])
12717 if test $_os = iOS -o $_os = Android; then
12718 # Never any point in mergelibs for these as we build just static
12719 # libraries anyway...
12720 enable_mergelibs=no
12723 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12724 if test $_os != Linux -a $_os != WINNT; then
12725 add_warning "--enable-mergelibs is not tested for this platform"
12728 AC_MSG_RESULT([yes])
12730 AC_MSG_RESULT([no])
12732 AC_SUBST([MERGELIBS])
12734 dnl ===================================================================
12735 dnl icerun is a wrapper that stops us spawning tens of processes
12736 dnl locally - for tools that can't be executed on the compile cluster
12737 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12738 dnl ===================================================================
12739 AC_MSG_CHECKING([whether to use icerun wrapper])
12741 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12742 ICECREAM_RUN=icerun
12743 AC_MSG_RESULT([yes])
12745 AC_MSG_RESULT([no])
12747 AC_SUBST(ICECREAM_RUN)
12749 dnl ===================================================================
12750 dnl Setup the ICECC_VERSION for the build the same way it was set for
12751 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12752 dnl ===================================================================
12753 x_ICECC_VERSION=[\#]
12754 if test -n "$ICECC_VERSION" ; then
12757 AC_SUBST(x_ICECC_VERSION)
12758 AC_SUBST(ICECC_VERSION)
12760 dnl ===================================================================
12762 AC_MSG_CHECKING([MPL subset])
12765 if test "$enable_mpl_subset" = "yes"; then
12767 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12769 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12772 if test "$warn_report" = "true"; then
12773 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12775 if test "x$enable_postgresql_sdbc" != "xno"; then
12776 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12778 if test "$enable_lotuswordpro" = "yes"; then
12779 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12781 if test "$WITH_WEBDAV" = "neon"; then
12782 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12784 if test -n "$ENABLE_POPPLER"; then
12785 if test "x$SYSTEM_POPPLER" = "x"; then
12786 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12789 # cf. m4/libo_check_extension.m4
12790 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12791 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12793 for theme in $WITH_THEMES; do
12795 breeze|breeze_dark|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg) #blacklist of icon themes under GPL or LGPL
12796 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12801 ENABLE_OPENGL_TRANSITIONS=
12803 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12804 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12808 AC_DEFINE(MPL_HAVE_SUBSET)
12809 AC_MSG_RESULT([only])
12811 AC_MSG_RESULT([no restrictions])
12813 AC_SUBST(MPL_SUBSET)
12815 dnl ===================================================================
12817 AC_MSG_CHECKING([formula logger])
12818 ENABLE_FORMULA_LOGGER=
12820 if test "x$enable_formula_logger" = "xyes"; then
12821 AC_MSG_RESULT([yes])
12822 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12823 ENABLE_FORMULA_LOGGER=TRUE
12824 elif test -n "$ENABLE_DBGUTIL" ; then
12825 AC_MSG_RESULT([yes])
12826 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12827 ENABLE_FORMULA_LOGGER=TRUE
12829 AC_MSG_RESULT([no])
12832 AC_SUBST(ENABLE_FORMULA_LOGGER)
12834 dnl ===================================================================
12835 dnl Setting up the environment.
12836 dnl ===================================================================
12837 AC_MSG_NOTICE([setting up the build environment variables...])
12841 if test "$build_os" = "cygwin"; then
12842 if test -d "$COMPATH/atlmfc/lib/spectre"; then
12843 ATL_LIB="$COMPATH/atlmfc/lib/spectre"
12844 ATL_INCLUDE="$COMPATH/atlmfc/include"
12845 elif test -d "$COMPATH/atlmfc/lib"; then
12846 ATL_LIB="$COMPATH/atlmfc/lib"
12847 ATL_INCLUDE="$COMPATH/atlmfc/include"
12849 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12850 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12852 if test "$BITNESS_OVERRIDE" = 64; then
12853 ATL_LIB="$ATL_LIB/x64"
12855 ATL_LIB="$ATL_LIB/x86"
12857 ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
12858 ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
12860 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12861 PathFormat "/usr/bin/find.exe"
12862 FIND="$formatted_path"
12863 PathFormat "/usr/bin/sort.exe"
12864 SORT="$formatted_path"
12865 PathFormat "/usr/bin/grep.exe"
12866 WIN_GREP="$formatted_path"
12867 PathFormat "/usr/bin/ls.exe"
12868 WIN_LS="$formatted_path"
12869 PathFormat "/usr/bin/touch.exe"
12870 WIN_TOUCH="$formatted_path"
12876 AC_SUBST(ATL_INCLUDE)
12882 AC_SUBST(WIN_TOUCH)
12884 AC_SUBST(BUILD_TYPE)
12889 PERL="$formatted_path"
12892 if test -n "$TMPDIR"; then
12893 TEMP_DIRECTORY="$TMPDIR"
12895 TEMP_DIRECTORY="/tmp"
12897 if test "$build_os" = "cygwin"; then
12898 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12900 AC_SUBST(TEMP_DIRECTORY)
12902 # setup the PATH for the environment
12903 if test -n "$LO_PATH_FOR_BUILD"; then
12904 LO_PATH="$LO_PATH_FOR_BUILD"
12910 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12911 if test "$ENABLE_JAVA" != ""; then
12912 pathmunge "$JAVA_HOME/bin" "after"
12917 # Win32 make needs native paths
12918 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12919 LO_PATH=`cygpath -p -m "$PATH"`
12921 if test "$BITNESS_OVERRIDE" = 64; then
12922 # needed for msi packaging
12923 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12925 # .NET 4.6 and higher don't have bin directory
12926 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
12927 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12929 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12930 pathmunge "$CSC_PATH" "before"
12931 pathmunge "$MIDL_PATH" "before"
12932 pathmunge "$AL_PATH" "before"
12933 pathmunge "$MSPDB_PATH" "before"
12934 if test "$MSPDB_PATH" != "$CL_PATH" ; then
12935 pathmunge "$CL_PATH" "before"
12937 if test -n "$MSBUILD_PATH" ; then
12938 pathmunge "$MSBUILD_PATH" "before"
12940 if test "$BITNESS_OVERRIDE" = 64; then
12941 pathmunge "$COMPATH/bin/amd64" "before"
12942 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
12944 pathmunge "$COMPATH/bin" "before"
12945 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12947 if test "$ENABLE_JAVA" != ""; then
12948 if test -d "$JAVA_HOME/jre/bin/client"; then
12949 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12951 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12952 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12954 pathmunge "$JAVA_HOME/bin" "before"
12959 pathmunge "/usr/css/bin" "before"
12960 if test "$ENABLE_JAVA" != ""; then
12961 pathmunge "$JAVA_HOME/bin" "after"
12971 # Generate a configuration sha256 we can use for deps
12972 if test -f config_host.mk; then
12973 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
12975 if test -f config_host_lang.mk; then
12976 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
12979 CFLAGS=$my_original_CFLAGS
12980 CXXFLAGS=$my_original_CXXFLAGS
12981 CPPFLAGS=$my_original_CPPFLAGS
12983 AC_LINK_FILES([include], [include])
12984 AC_CONFIG_FILES([config_host.mk
12985 config_host_lang.mk
12987 bin/bffvalidator.sh
12988 bin/odfvalidator.sh
12990 instsetoo_native/util/openoffice.lst
12991 setup_native/source/packinfo/finals_instsetoo.txt
12992 sysui/desktop/macosx/Info.plist])
12993 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12994 AC_CONFIG_HEADERS([config_host/config_clang.h])
12995 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12996 AC_CONFIG_HEADERS([config_host/config_eot.h])
12997 AC_CONFIG_HEADERS([config_host/config_extensions.h])
12998 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12999 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
13000 AC_CONFIG_HEADERS([config_host/config_dbus.h])
13001 AC_CONFIG_HEADERS([config_host/config_features.h])
13002 AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
13003 AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
13004 AC_CONFIG_HEADERS([config_host/config_firebird.h])
13005 AC_CONFIG_HEADERS([config_host/config_folders.h])
13006 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
13007 AC_CONFIG_HEADERS([config_host/config_gio.h])
13008 AC_CONFIG_HEADERS([config_host/config_global.h])
13009 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
13010 AC_CONFIG_HEADERS([config_host/config_java.h])
13011 AC_CONFIG_HEADERS([config_host/config_langs.h])
13012 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
13013 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
13014 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
13015 AC_CONFIG_HEADERS([config_host/config_libnumbertext.h])
13016 AC_CONFIG_HEADERS([config_host/config_locales.h])
13017 AC_CONFIG_HEADERS([config_host/config_mpl.h])
13018 AC_CONFIG_HEADERS([config_host/config_oox.h])
13019 AC_CONFIG_HEADERS([config_host/config_options.h])
13020 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
13021 AC_CONFIG_HEADERS([config_host/config_qrcodegen.h])
13022 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
13023 AC_CONFIG_HEADERS([config_host/config_vendor.h])
13024 AC_CONFIG_HEADERS([config_host/config_vcl.h])
13025 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
13026 AC_CONFIG_HEADERS([config_host/config_version.h])
13027 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
13028 AC_CONFIG_HEADERS([config_host/config_poppler.h])
13029 AC_CONFIG_HEADERS([config_host/config_python.h])
13030 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
13033 if test "$CROSS_COMPILING" = TRUE; then
13034 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
13037 # touch the config timestamp file
13038 if test ! -f config_host.mk.stamp; then
13039 echo > config_host.mk.stamp
13040 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
13041 echo "Host Configuration unchanged - avoiding scp2 stamp update"
13043 echo > config_host.mk.stamp
13046 # touch the config lang timestamp file
13047 if test ! -f config_host_lang.mk.stamp; then
13048 echo > config_host_lang.mk.stamp
13049 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
13050 echo "Language Configuration unchanged - avoiding scp2 stamp update"
13052 echo > config_host_lang.mk.stamp
13056 if test \( "$STALE_MAKE" = "TRUE" -o "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE" \) \
13057 -a "$build_os" = "cygwin"; then
13060 ****************************************************************************
13062 Your make version is known to be horribly slow, and hard to debug
13063 problems with. To get a reasonably functional make please do:
13065 to install a pre-compiled binary make for Win32
13067 mkdir -p /opt/lo/bin
13069 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
13070 cp make-4.2.1-msvc.exe make
13073 to install from source:
13074 place yourself in a working directory of you choice.
13076 git clone git://git.savannah.gnu.org/make.git
13078 [go to Start menu, open "Visual Studio 2017", click "VS2017 x86 Native Tools Command Prompt" or "VS2017 x64 Native Tools Command Prompt"]
13079 set PATH=%PATH%;C:\Cygwin\bin
13080 [or Cygwin64, if that is what you have]
13081 cd path-to-make-repo-you-cloned-above
13082 build_w32.bat --without-guile
13084 should result in a WinRel/gnumake.exe.
13085 Copy it to the Cygwin /opt/lo/bin directory as make.exe
13087 Then re-run autogen.sh
13089 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
13090 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
13093 if test "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE"; then
13094 AC_MSG_ERROR([no file function found; the build will fail without it; use GNU make 4.0 or later])
13100 ****************************************************************************
13105 To view some help, run:
13110 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
13112 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
13115 if test $_os = Darwin; then
13116 echo open instdir/$PRODUCTNAME.app
13118 echo instdir/program/soffice
13122 If you want to run the smoketest, run:
13128 if test -f warn; then
13133 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: