1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 100 -*-
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],[21.06.12.1],[],[],[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
46 # Return value: $filteredlibs
51 # let's start with Fedora's paths for now
52 -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
53 # ignore it: on UNIXoids it is searched by default anyway
54 # but if it's given explicitly then it may override other paths
55 # (on macOS it would be an error to use it instead of SDK)
58 filteredlibs="$filteredlibs $f"
66 # Args: $1: A pathname. On Cygwin and WSL, in either the Unix or the Windows format. Note that this
67 # function is called also on Unix.
69 # Return value: $formatted_path and $formatted_path_unix.
71 # $formatted_path is the argument in Windows format, but using forward slashes instead of
72 # backslashes, using 8.3 pathname components if necessary (if it otherwise would contains spaces
73 # or shell metacharacters).
75 # $formatted_path_unix is the argument in a form usable in Cygwin or WSL, using 8.3 components if
76 # necessary. On Cygwin, it is the same as $formatted_path, but on WSL it is $formatted_path as a
79 # Errors out if 8.3 names are needed but aren't present for some of the path components.
83 # /home/tml/lo/master-optimised => C:/cygwin64/home/tml/lo/master-optimised
85 # C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe => C:/PROGRA~2/MICROS~3/INSTAL~1/vswhere.exe
87 # C:\Program Files (x86)\Microsoft Visual Studio\2019\Community => C:/PROGRA~2/MICROS~3/2019/COMMUN~1
89 # C:/PROGRA~2/WI3CF2~1/10/Include/10.0.18362.0/ucrt => C:/PROGRA~2/WI3CF2~1/10/Include/10.0.18362.0/ucrt
91 # /cygdrive/c/PROGRA~2/WI3CF2~1/10 => C:/PROGRA~2/WI3CF2~1/10
93 # C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\ => C:/PROGRA~2/WI3CF2~1/NETFXSDK/4.8/
95 # /usr/bin/find.exe => C:/cygwin64/bin/find.exe
97 if test -n "$UNITTEST_WSL_PATHFORMAT"; then
98 printf "PathFormat $1 ==> "
102 if test "$build_os" = "cygwin" -o "$build_os" = "wsl"; then
103 if test "$build_os" = "wsl"; then
104 formatted_path=$(echo "$formatted_path" | tr -d '\r')
108 # spaces,parentheses,brackets,braces are problematic in pathname
110 case "$formatted_path" in
111 *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
115 if test "$pf_conv_to_dos" = "yes"; then
116 if test "$build_os" = "wsl"; then
117 case "$formatted_path" in
119 formatted_path=$(wslpath -w "$formatted_path")
122 formatted_path=$($BUILDDIR/solenv/wsl/wsl-lo-helper.exe --8.3 "$formatted_path")
123 elif test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
124 formatted_path=`cygpath -sm "$formatted_path"`
126 formatted_path=`cygpath -d "$formatted_path"`
128 if test $? -ne 0; then
129 AC_MSG_ERROR([path conversion failed for "$1".])
132 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
133 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
134 if test "$fp_count_slash$fp_count_colon" != "00"; then
135 if test "$fp_count_colon" = "0"; then
136 new_formatted_path=`realpath "$formatted_path"`
137 if test $? -ne 0; then
138 AC_MSG_WARN([realpath failed for "$formatted_path", not necessarily a problem.])
140 formatted_path="$new_formatted_path"
143 if test "$build_os" = "wsl"; then
144 if test "$fp_count_colon" != "0"; then
145 formatted_path=$(wslpath "$formatted_path")
147 case "$formatted_path" in
152 formatted_path=$(wslpath -m $formatted_path)
153 case "$formatted_path" in
157 formatted_path="$formatted_path"$final_slash
161 formatted_path=$(wslpath -m "$formatted_path")
164 formatted_path=`cygpath -m "$formatted_path"`
166 if test $? -ne 0; then
167 AC_MSG_ERROR([path conversion failed for "$1".])
170 fp_count_space=`echo "$formatted_path" | $GREP -c "[ ]"`
171 if test "$fp_count_space" != "0"; then
172 AC_MSG_ERROR([converted path "$formatted_path" still contains spaces. Short filenames (8.3 filenames) support was disabled on this system?])
175 if test "$build_os" = "wsl"; then
176 # WSL can't run Windows binaries from Windows pathnames so we need a separate return value in Unix format
177 formatted_path_unix=$(wslpath "$formatted_path")
180 formatted_path_unix="$formatted_path"
186 # There appears to be no simple and portable method to get an absolute and
187 # canonical path, so we try creating the directory if does not exist and
188 # utilizing the shell and pwd.
190 # Args: $1: A possibly relative pathname
191 # Return value: $absolute_path
195 test ! -e "$rel" && mkdir -p "$rel"
196 if test -d "$rel" ; then
197 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
198 absolute_path="$(pwd)"
201 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
209 if test "$have_WARNINGS" = "no"; then
210 echo "*************************************" > warn
212 if which tput >/dev/null && test "`tput colors 2>/dev/null || echo 0`" -ge 8; then
213 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
214 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
216 COLORWARN="* WARNING :"
219 echo "$COLORWARN $@" >> warn
222 dnl Some Mac User have the bad habit of letting a lot of crap
223 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
224 dnl that confuse the build.
225 dnl For the ones that use LODE, let's be nice and protect them
230 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
231 dnl a common but nevertheless necessary thing that may be in a fancy
232 dnl path location is git, so make sure we have it
233 mac_git_path=`which git 2>/dev/null`
234 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
235 mac_path="$mac_path:`dirname $mac_git_path`"
237 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
238 dnl path location is gpg, so make sure we find it
239 mac_gpg_path=`which gpg 2>/dev/null`
240 if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
241 mac_path="$mac_path:`dirname $mac_gpg_path`"
249 echo "********************************************************************"
251 echo "* Running ${PACKAGE_NAME} build configuration."
253 echo "********************************************************************"
256 dnl ===================================================================
257 dnl checks build and host OSes
258 dnl do this before argument processing to allow for platform dependent defaults
259 dnl ===================================================================
261 # Check for WSL (version 2, at least). But if --host is explicitly specified (to really do build for
262 # Linux on WSL) trust that.
263 if test -z "$host" -a -z "$build" -a "`wslsys -v 2>/dev/null`" != ""; then
264 ac_cv_host="x86_64-pc-wsl"
265 ac_cv_host_cpu="x86_64"
267 ac_cv_build="$ac_cv_host"
268 ac_cv_build_cpu="$ac_cv_host_cpu"
269 ac_cv_build_os="$ac_cv_host_os"
271 # Emulation of Cygwin's cygpath command for WSL.
274 if test -n "$UNITTEST_WSL_CYGPATH"; then
275 echo -n cygpath "$@" "==> "
278 # Cygwin's real cygpath has a plethora of options but we use only a few here.
281 local opt_d opt_m opt_u opt_w opt_l opt_s opt_p
284 while getopts dmuwlsp opt; do
287 AC_MSG_ERROR([Unimplemented cygpath emulation option in invocation: cygpath $args])
297 if test $# -ne 1; then
298 AC_MSG_ERROR([Invalid cygpath emulation invocation: Pathname missing]);
305 if test -n "$opt_d" -o -n "$opt_m" -o -n "$opt_w"; then
306 # Print Windows path, possibly in 8.3 form (-d) or with forward slashes (-m)
308 if test -n "$opt_u"; then
309 AC_MSG_ERROR([Invalid cygpath invocation: Both Windows and Unix path output requested])
314 # A Windows file in WSL format
315 input=$(wslpath -w "$input")
317 [[a-zA-Z]]:\\* | \\* | [[a-zA-Z]]:/* | /*)
318 # Already in Windows format
321 input=$(wslpath -w "$input")
324 AC_MSG_ERROR([Invalid cygpath invocation: Path '$input' is not absolute])
327 if test -n "$opt_d" -o -n "$opt_s"; then
328 input=$($BUILDDIR/solenv/wsl/wsl-lo-helper.exe --8.3 "$input")
330 if test -n "$opt_m"; then
331 input="${input//\\//}"
338 [[a-zA-Z]]:\\* | \\* | [[a-zA-Z]]:/* | /*)
345 AC_MSG_ERROR([Invalid cygpath invocation: Path '$input' is not absolute])
351 if test -n "$UNITTEST_WSL_CYGPATH"; then
354 # Nothing special with these file names, just arbitrary ones picked to test with
355 cygpath -d /usr/lib64/ld-linux-x86-64.so.2
356 cygpath -w /usr/lib64/ld-linux-x86-64.so.2
357 cygpath -m /usr/lib64/ld-linux-x86-64.so.2
358 cygpath -m -s /usr/lib64/ld-linux-x86-64.so.2
359 # At least on my machine for instance this file does have an 8.3 name
360 cygpath -d /mnt/c/windows/WindowsUpdate.log
361 # But for instance this one doesn't
362 cygpath -w /mnt/c/windows/system32/AboutSettingsHandlers.dll
363 cygpath -ws /mnt/c/windows/WindowsUpdate.log
364 cygpath -m /mnt/c/windows/system32/AboutSettingsHandlers.dll
365 cygpath -ms /mnt/c/windows/WindowsUpdate.log
367 cygpath -u 'c:\windows\system32\AboutSettingsHandlers.dll'
368 cygpath -u 'c:/windows/system32/AboutSettingsHandlers.dll'
377 if test -n "$UNITTEST_WSL_PATHFORMAT"; then
381 # Use of PathFormat must be after AC_CANONICAL_BUILD above
383 printf "$formatted_path , $formatted_path_unix\n"
386 printf "$formatted_path , $formatted_path_unix\n"
388 PathFormat "$PROGRAMFILESX86"
389 printf "$formatted_path , $formatted_path_unix\n"
394 AC_MSG_CHECKING([for product name])
395 PRODUCTNAME="AC_PACKAGE_NAME"
396 if test -n "$with_product_name" -a "$with_product_name" != no; then
397 PRODUCTNAME="$with_product_name"
399 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
400 PRODUCTNAME="${PRODUCTNAME}Dev"
401 PRODUCTNAME=AC_PACKAGE_NAME
403 AC_MSG_RESULT([$PRODUCTNAME])
404 AC_SUBST(PRODUCTNAME)
405 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
406 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
408 dnl ===================================================================
409 dnl Our version is defined by the AC_INIT() at the top of this script.
410 dnl ===================================================================
412 AC_MSG_CHECKING([for package version])
413 if test -n "$with_package_version" -a "$with_package_version" != no; then
414 PACKAGE_VERSION="$with_package_version"
416 AC_MSG_RESULT([$PACKAGE_VERSION])
418 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
420 LIBO_VERSION_MAJOR=$1
421 LIBO_VERSION_MINOR=$2
422 LIBO_VERSION_MICRO=$3
423 LIBO_VERSION_PATCH=$4
425 LIBO_VERSION_SUFFIX=$5
427 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
428 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
429 # they get undoubled before actually passed to sed.
430 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
431 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
432 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
433 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
435 # The value for key CFBundleVersion in the Info.plist file must be a period-separated list of at most
436 # three non-negative integers. Please find more information about CFBundleVersion at
437 # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion
439 # The value for key CFBundleShortVersionString in the Info.plist file must be a period-separated list
440 # of at most three non-negative integers. Please find more information about
441 # CFBundleShortVersionString at
442 # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring
444 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
445 MACOSX_BUNDLE_VERSION=$MACOSX_BUNDLE_SHORTVERSION
447 AC_SUBST(LIBO_VERSION_MAJOR)
448 AC_SUBST(LIBO_VERSION_MINOR)
449 AC_SUBST(LIBO_VERSION_MICRO)
450 AC_SUBST(LIBO_VERSION_PATCH)
451 AC_SUBST(LIBO_VERSION_SUFFIX)
452 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
453 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
454 AC_SUBST(MACOSX_BUNDLE_VERSION)
456 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
457 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
458 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
459 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
461 LIBO_THIS_YEAR=`date +%Y`
462 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
464 dnl ===================================================================
466 dnl ===================================================================
467 AC_MSG_CHECKING([for product version])
468 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
469 AC_MSG_RESULT([$PRODUCTVERSION])
470 AC_SUBST(PRODUCTVERSION)
473 # AC_PROG_EGREP doesn't set GREP on all systems as well
474 AC_PATH_PROG(GREP, grep)
482 dnl ======================================
483 dnl Required GObject introspection version
484 dnl ======================================
485 INTROSPECTION_REQUIRED_VERSION=1.32.0
487 dnl ===================================================================
488 dnl Search all the common names for GNU Make
489 dnl ===================================================================
490 AC_MSG_CHECKING([for GNU Make])
492 # try to use our own make if it is available and GNUMAKE was not already defined
493 if test -z "$GNUMAKE"; then
494 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
495 GNUMAKE="$LODE_HOME/opt/bin/make"
496 elif test -x "/opt/lo/bin/make"; then
497 GNUMAKE="/opt/lo/bin/make"
502 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
503 if test -n "$a"; then
504 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
505 if test $? -eq 0; then
506 if test "$build_os" = "cygwin"; then
507 if test -n "$($a -v | grep 'Built for Windows')" ; then
508 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
509 GNUMAKE_WIN_NATIVE="TRUE"
520 AC_MSG_RESULT($GNUMAKE)
521 if test -z "$GNUMAKE"; then
522 AC_MSG_ERROR([not found. install GNU Make.])
524 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
525 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
529 win_short_path_for_make()
531 local short_path="$1"
532 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
533 cygpath -sm "$short_path"
535 cygpath -u "$(cygpath -d "$short_path")"
540 if test "$build_os" = "cygwin"; then
541 PathFormat "$SRC_ROOT"
542 SRC_ROOT="$formatted_path"
543 PathFormat "$BUILDDIR"
544 BUILDDIR="$formatted_path"
546 AC_MSG_CHECKING(for explicit COMSPEC)
547 if test -z "$COMSPEC"; then
548 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
550 AC_MSG_RESULT([found: $COMSPEC])
557 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
558 AC_DEFINE_UNQUOTED(SRC_ROOT,"$SRC_ROOT")
559 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
561 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
562 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
565 # need sed in os checks...
566 AC_PATH_PROGS(SED, sed)
567 if test -z "$SED"; then
568 AC_MSG_ERROR([install sed to run this script])
571 # Set the ENABLE_LTO variable
572 # ===================================================================
573 AC_MSG_CHECKING([whether to use link-time optimization])
574 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
583 AC_ARG_ENABLE(fuzz-options,
584 AS_HELP_STRING([--enable-fuzz-options],
585 [Randomly enable or disable each of those configurable options
586 that are supposed to be freely selectable without interdependencies,
587 or where bad interaction from interdependencies is automatically avoided.])
590 dnl ===================================================================
591 dnl When building for Android, --with-android-ndk,
592 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
594 dnl ===================================================================
596 AC_ARG_WITH(android-ndk,
597 AS_HELP_STRING([--with-android-ndk],
598 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
601 AC_ARG_WITH(android-ndk-toolchain-version,
602 AS_HELP_STRING([--with-android-ndk-toolchain-version],
603 [Specify which toolchain version to use, of those present in the
604 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
605 with_android_ndk_toolchain_version=clang5.0)
607 AC_ARG_WITH(android-sdk,
608 AS_HELP_STRING([--with-android-sdk],
609 [Specify location of the Android SDK. Mandatory when building for Android.]),
612 AC_ARG_WITH(android-api-level,
613 AS_HELP_STRING([--with-android-api-level],
614 [Specify the API level when building for Android. Defaults to 16 for ARM and x86 and to 21 for ARM64 and x86-64]),
618 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
619 with_android_ndk="$SRC_ROOT/external/android-ndk"
621 if test -n "$with_android_ndk"; then
622 eval ANDROID_NDK_HOME=$with_android_ndk
624 # Set up a lot of pre-canned defaults
626 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
627 if test ! -f $ANDROID_NDK_HOME/source.properties; then
628 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
630 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
632 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
634 if test -z "$ANDROID_NDK_VERSION"; then
635 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
637 case $ANDROID_NDK_VERSION in
639 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
641 11.1.*|12.1.*|13.1.*|14.1.*)
642 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
644 16.*|17.*|18.*|19.*|20.*)
647 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk.])
648 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk."
653 if test -n "$with_android_api_level" ; then
654 ANDROID_API_LEVEL="$with_android_api_level"
657 android_cpu=$host_cpu
658 if test $host_cpu = arm; then
659 android_platform_prefix=arm-linux-androideabi
660 android_gnu_prefix=$android_platform_prefix
661 LLVM_TRIPLE=armv7a-linux-androideabi
662 ANDROID_APP_ABI=armeabi-v7a
663 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
664 elif test $host_cpu = aarch64; then
665 android_platform_prefix=aarch64-linux-android
666 android_gnu_prefix=$android_platform_prefix
667 LLVM_TRIPLE=$android_platform_prefix
668 # minimum android version that supports aarch64
669 if test "$ANDROID_API_LEVEL" -lt "21" ; then
672 ANDROID_APP_ABI=arm64-v8a
673 elif test $host_cpu = x86_64; then
674 android_platform_prefix=x86_64-linux-android
675 android_gnu_prefix=$android_platform_prefix
676 LLVM_TRIPLE=$android_platform_prefix
677 # minimum android version that supports x86_64
679 ANDROID_APP_ABI=x86_64
681 # host_cpu is something like "i386" or "i686" I guess, NDK uses
682 # "x86" in some contexts
684 android_platform_prefix=$android_cpu
685 android_gnu_prefix=i686-linux-android
686 LLVM_TRIPLE=$android_gnu_prefix
690 case "$with_android_ndk_toolchain_version" in
692 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
695 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
698 AC_MSG_NOTICE([using the Android API level... $ANDROID_API_LEVEL])
700 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
701 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
702 # manage to link the (app-specific) single huge .so that is built for the app in
703 # android/source/ if there is debug information in a significant part of the object files.
704 # (A 64-bit ld.gold grows too much over 10 gigabytes of virtual space when linking such a .so if
705 # all objects have been built with debug information.)
708 android_HOST_TAG=linux-x86_64
711 android_HOST_TAG=darwin-x86_64
714 AC_MSG_ERROR([We only support building for Android from Linux or macOS])
715 # ndk would also support windows and windows-x86_64
718 android_TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$android_HOST_TAG
719 ANDROID_COMPILER_BIN=$android_TOOLCHAIN/bin
720 dnl TODO: NSS build uses it...
721 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG
722 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
724 test -z "$AR" && AR=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ar
725 test -z "$NM" && NM=$ANDROID_COMPILER_BIN/$android_gnu_prefix-nm
726 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-objdump
727 test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ranlib
728 test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-strip
730 ANDROIDCFLAGS="$ANDROIDCFLAGS -target ${LLVM_TRIPLE}${ANDROID_API_LEVEL}"
731 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes -ffunction-sections -fdata-sections -Qunused-arguments"
732 if test "$ENABLE_LTO" = TRUE; then
733 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
734 # $CC and $CXX when building external libraries
735 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
738 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -stdlib=libc++"
740 if test -z "$CC"; then
741 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
744 if test -z "$CXX"; then
745 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
749 # remember to download the ownCloud Android library later
750 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
752 AC_SUBST(ANDROID_NDK_HOME)
753 AC_SUBST(ANDROID_APP_ABI)
754 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
756 dnl ===================================================================
757 dnl --with-android-sdk
758 dnl ===================================================================
760 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
761 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
763 if test -n "$with_android_sdk"; then
764 eval ANDROID_SDK_HOME=$with_android_sdk
765 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
767 AC_SUBST(ANDROID_SDK_HOME)
769 AC_ARG_ENABLE([android-lok],
770 AS_HELP_STRING([--enable-android-lok],
771 [The Android app from the android/ subdir needs several tweaks all
772 over the place that break the LOK when used in the Online-based
773 Android app. This switch indicates that the intent of this build is
774 actually the Online-based, non-modified LOK.])
777 if test -n "$ANDROID_NDK_HOME" ; then
778 if test "$enable_android_lok" = yes; then
779 ENABLE_ANDROID_LOK=TRUE
780 AC_DEFINE(HAVE_FEATURE_ANDROID_LOK)
781 AC_MSG_NOTICE([building the Android version... for the Online-based Android app])
783 AC_MSG_NOTICE([building the Android version... for the app from the android/ subdir])
786 AC_SUBST([ENABLE_ANDROID_LOK])
788 libo_FUZZ_ARG_ENABLE([android-editing],
789 AS_HELP_STRING([--enable-android-editing],
790 [Enable the experimental editing feature on Android.])
792 ENABLE_ANDROID_EDITING=
793 if test "$enable_android_editing" = yes; then
794 ENABLE_ANDROID_EDITING=TRUE
796 AC_SUBST([ENABLE_ANDROID_EDITING])
798 dnl ===================================================================
799 dnl The following is a list of supported systems.
800 dnl Sequential to keep the logic very simple
801 dnl These values may be checked and reset later.
802 dnl ===================================================================
803 #defaults unless the os test overrides this:
813 # Default values, as such probably valid just for Linux, set
814 # differently below just for Mac OSX, but at least better than
815 # hardcoding these as we used to do. Much of this is duplicated also
816 # in solenv for old build system and for gbuild, ideally we should
817 # perhaps define stuff like this only here in configure.ac?
819 LINKFLAGSSHL="-shared"
823 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
826 INSTROOTCONTENTSUFFIX=
829 HOST_PLATFORM="$host"
831 host_cpu_for_clang="$host_cpu"
836 build_gstreamer_1_0=yes
841 dnl ===========================================================
842 dnl Check whether we're using Solaris 10 - SPARC or Intel.
843 dnl ===========================================================
844 AC_MSG_CHECKING([the Solaris operating system release])
845 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
846 if test "$_os_release" -lt "10"; then
847 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
849 AC_MSG_RESULT([ok ($_os_release)])
852 dnl Check whether we're using a SPARC or i386 processor
853 AC_MSG_CHECKING([the processor type])
854 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
855 AC_MSG_RESULT([ok ($host_cpu)])
857 AC_MSG_ERROR([only SPARC and i386 processors are supported])
861 linux-gnu*|k*bsd*-gnu*)
862 build_gstreamer_1_0=yes
868 if test "$enable_fuzzers" != yes; then
874 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
887 # When building on Windows normally with MSVC under Cygwin,
888 # configure thinks that the host platform (the platform the
889 # built code will run on) is Cygwin, even if it obviously is
890 # Windows, which in Autoconf terminology is called
891 # "mingw32". (Which is misleading as MinGW is the name of the
892 # tool-chain, not an operating system.)
894 # Somewhat confusing, yes. But this configure script doesn't
895 # look at $host etc that much, it mostly uses its own $_os
896 # variable, set here in this case statement.
910 if test "$host_cpu" = "aarch64"; then
913 enable_firebird_sdbc=no
917 darwin*|macos*) # macOS
923 if test -n "$LODE_HOME" ; then
925 AC_MSG_NOTICE([sanitized the PATH to $PATH])
928 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
929 INSTROOTCONTENTSUFFIX=/Contents
930 SDKDIRNAME=${PRODUCTNAME_WITHOUT_SPACES}${PRODUCTVERSION}_SDK
931 # See comment above the case "$host_os"
932 LINKFLAGSSHL="-dynamiclib -single_module"
939 # -undefined error is the default
945 # HOST_PLATFORM is used for external projects and their configury occasionally doesn't like
946 # the "macos" part so be sure to use aarch64-apple-darwin for now.
947 HOST_PLATFORM=aarch64-apple-darwin
951 # Apple's Clang uses "arm64"
952 host_cpu_for_clang=arm64
962 if test -n "$LODE_HOME" ; then
964 AC_MSG_NOTICE([sanitized the PATH to $PATH])
969 enable_mpl_subset=yes
970 enable_lotuswordpro=no
973 enable_mariadb_sdbc=no
974 enable_postgresql_sdbc=no
975 enable_extension_integration=no
976 enable_report_builder=no
978 if test "$enable_ios_simulator" = "yes"; then
979 host=x86_64-apple-darwin
981 # See comment above the case "$host_os"
982 LINKFLAGSSHL="-dynamiclib -single_module"
989 # -undefined error is the default
992 # HOST_PLATFORM is used for external projects and their configury typically doesn't like the "ios"
993 # part, so use aarch64-apple-darwin for now.
994 HOST_PLATFORM=aarch64-apple-darwin
996 # Apple's Clang uses "arm64"
997 host_cpu_for_clang=arm64
1001 build_gstreamer_1_0=yes
1006 AC_MSG_CHECKING([the FreeBSD operating system release])
1007 if test -n "$with_os_version"; then
1008 OSVERSION="$with_os_version"
1010 OSVERSION=`/sbin/sysctl -n kern.osreldate`
1012 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
1013 AC_MSG_CHECKING([which thread library to use])
1014 if test "$OSVERSION" -lt "500016"; then
1015 PTHREAD_CFLAGS="-D_THREAD_SAFE"
1016 PTHREAD_LIBS="-pthread"
1017 elif test "$OSVERSION" -lt "502102"; then
1018 PTHREAD_CFLAGS="-D_THREAD_SAFE"
1019 PTHREAD_LIBS="-lc_r"
1022 PTHREAD_LIBS="-pthread"
1024 AC_MSG_RESULT([$PTHREAD_LIBS])
1029 build_gstreamer_1_0=yes
1034 PTHREAD_LIBS="-pthread -lpthread"
1041 PTHREAD_LIBS=-pthread
1047 PTHREAD_CFLAGS="-D_THREAD_SAFE"
1048 PTHREAD_LIBS="-pthread"
1053 build_gstreamer_1_0=yes
1058 PTHREAD_LIBS="-pthread"
1063 build_gstreamer_1_0=no
1064 enable_lotuswordpro=no
1065 enable_mpl_subset=yes
1068 enable_mariadb_sdbc=no
1069 enable_report_builder=no
1071 enable_postgresql_sdbc=no
1084 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
1085 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
1095 enable_gstreamer_1_0=no
1100 enable_postgresql_sdbc=no
1101 enable_firebird_sdbc=no
1106 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
1110 AC_SUBST(HOST_PLATFORM)
1112 if test "$_os" = "Android" ; then
1113 # Verify that the NDK and SDK options are proper
1114 if test -z "$with_android_ndk"; then
1115 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
1116 elif test ! -f "$ANDROID_NDK_HOME/meta/abis.json"; then
1117 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
1120 if test -z "$ANDROID_SDK_HOME"; then
1121 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
1122 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
1123 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
1126 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
1127 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
1128 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
1129 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
1130 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
1131 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
1132 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
1133 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
1135 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
1136 AC_MSG_WARN([android support repository not found - install with
1137 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
1138 to allow the build to download the specified version of the android support libraries])
1139 add_warning "android support repository not found - install with"
1140 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
1141 add_warning "to allow the build to download the specified version of the android support libraries"
1145 if test "$_os" = "AIX"; then
1146 AC_PATH_PROG(GAWK, gawk)
1147 if test -z "$GAWK"; then
1148 AC_MSG_ERROR([gawk not found in \$PATH])
1152 AC_SUBST(SDKDIRNAME)
1154 AC_SUBST(PTHREAD_CFLAGS)
1155 AC_SUBST(PTHREAD_LIBS)
1157 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
1158 # By default use the ones specified by our build system,
1159 # but explicit override is possible.
1160 AC_MSG_CHECKING(for explicit AFLAGS)
1161 if test -n "$AFLAGS"; then
1162 AC_MSG_RESULT([$AFLAGS])
1168 AC_MSG_CHECKING(for explicit CFLAGS)
1169 if test -n "$CFLAGS"; then
1170 AC_MSG_RESULT([$CFLAGS])
1176 AC_MSG_CHECKING(for explicit CXXFLAGS)
1177 if test -n "$CXXFLAGS"; then
1178 AC_MSG_RESULT([$CXXFLAGS])
1184 AC_MSG_CHECKING(for explicit OBJCFLAGS)
1185 if test -n "$OBJCFLAGS"; then
1186 AC_MSG_RESULT([$OBJCFLAGS])
1192 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
1193 if test -n "$OBJCXXFLAGS"; then
1194 AC_MSG_RESULT([$OBJCXXFLAGS])
1200 AC_MSG_CHECKING(for explicit LDFLAGS)
1201 if test -n "$LDFLAGS"; then
1202 AC_MSG_RESULT([$LDFLAGS])
1212 AC_SUBST(OBJCXXFLAGS)
1216 AC_SUBST(x_CXXFLAGS)
1217 AC_SUBST(x_OBJCFLAGS)
1218 AC_SUBST(x_OBJCXXFLAGS)
1221 dnl These are potentially set for MSVC, in the code checking for UCRT below:
1222 my_original_CFLAGS=$CFLAGS
1223 my_original_CXXFLAGS=$CXXFLAGS
1224 my_original_CPPFLAGS=$CPPFLAGS
1226 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1227 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
1228 dnl AC_PROG_CC internally.
1229 if test "$_os" != "WINNT"; then
1230 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
1234 if test -z "$CC_BASE"; then
1235 CC_BASE=`first_arg_basename "$CC"`
1239 if test "$_os" != "WINNT"; then
1240 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
1244 AC_SUBST(ENDIANNESS)
1246 if test $_os != "WINNT"; then
1248 AC_SEARCH_LIBS([dlsym], [dl],
1249 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
1250 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
1253 AC_SUBST(DLOPEN_LIBS)
1255 AC_ARG_ENABLE(ios-simulator,
1256 AS_HELP_STRING([--enable-ios-simulator],
1257 [build for iOS simulator])
1260 AC_ARG_ENABLE(ios-libreofficelight-app,
1261 AS_HELP_STRING([--enable-ios-libreofficelight-app],
1262 [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
1263 (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
1264 and also that its actual build (in Xcode) requires some obvious modifications to the project.])
1267 ENABLE_IOS_LIBREOFFICELIGHT_APP=
1268 if test "$enable_ios_libreofficelight_app" = yes; then
1269 ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
1271 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
1273 ###############################################################################
1274 # Extensions switches --enable/--disable
1275 ###############################################################################
1276 # By default these should be enabled unless having extra dependencies.
1277 # If there is extra dependency over configure options then the enable should
1278 # be automagic based on whether the requiring feature is enabled or not.
1279 # All this options change anything only with --enable-extension-integration.
1281 # The name of this option and its help string makes it sound as if
1282 # extensions are built anyway, just not integrated in the installer,
1283 # if you use --disable-extension-integration. Is that really the
1286 libo_FUZZ_ARG_ENABLE(extension-integration,
1287 AS_HELP_STRING([--disable-extension-integration],
1288 [Disable integration of the built extensions in the installer of the
1289 product. Use this switch to disable the integration.])
1292 AC_ARG_ENABLE(avmedia,
1293 AS_HELP_STRING([--disable-avmedia],
1294 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
1297 AC_ARG_ENABLE(database-connectivity,
1298 AS_HELP_STRING([--disable-database-connectivity],
1299 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
1302 # This doesn't mean not building (or "integrating") extensions
1303 # (although it probably should; i.e. it should imply
1304 # --disable-extension-integration I guess), it means not supporting
1305 # any extension mechanism at all
1306 libo_FUZZ_ARG_ENABLE(extensions,
1307 AS_HELP_STRING([--disable-extensions],
1308 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1311 AC_ARG_ENABLE(scripting,
1312 AS_HELP_STRING([--disable-scripting],
1313 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1316 # This is mainly for Android and iOS, but could potentially be used in some
1317 # special case otherwise, too, so factored out as a separate setting
1319 AC_ARG_ENABLE(dynamic-loading,
1320 AS_HELP_STRING([--disable-dynamic-loading],
1321 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1324 libo_FUZZ_ARG_ENABLE(report-builder,
1325 AS_HELP_STRING([--disable-report-builder],
1326 [Disable the Report Builder.])
1329 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1330 AS_HELP_STRING([--enable-ext-wiki-publisher],
1331 [Enable the Wiki Publisher extension.])
1334 libo_FUZZ_ARG_ENABLE(lpsolve,
1335 AS_HELP_STRING([--disable-lpsolve],
1336 [Disable compilation of the lp solve solver ])
1338 libo_FUZZ_ARG_ENABLE(coinmp,
1339 AS_HELP_STRING([--disable-coinmp],
1340 [Disable compilation of the CoinMP solver ])
1343 libo_FUZZ_ARG_ENABLE(pdfimport,
1344 AS_HELP_STRING([--disable-pdfimport],
1345 [Disable building the PDF import feature.])
1348 libo_FUZZ_ARG_ENABLE(pdfium,
1349 AS_HELP_STRING([--disable-pdfium],
1350 [Disable building PDFium. Results in unsecure PDF signature verification.])
1353 libo_FUZZ_ARG_ENABLE(skia,
1354 AS_HELP_STRING([--disable-skia],
1355 [Disable building Skia. Use --enable-skia=debug to build without optimizations.])
1358 ###############################################################################
1360 dnl ---------- *** ----------
1362 libo_FUZZ_ARG_ENABLE(mergelibs,
1363 AS_HELP_STRING([--enable-mergelibs],
1364 [Merge several of the smaller libraries into one big, "merged", one.])
1367 libo_FUZZ_ARG_ENABLE(breakpad,
1368 AS_HELP_STRING([--enable-breakpad],
1369 [Enables breakpad for crash reporting.])
1372 libo_FUZZ_ARG_ENABLE(crashdump,
1373 AS_HELP_STRING([--disable-crashdump],
1374 [Disable dump.ini and dump-file, when --enable-breakpad])
1377 AC_ARG_ENABLE(fetch-external,
1378 AS_HELP_STRING([--disable-fetch-external],
1379 [Disables fetching external tarballs from web sources.])
1382 AC_ARG_ENABLE(fuzzers,
1383 AS_HELP_STRING([--enable-fuzzers],
1384 [Enables building libfuzzer targets for fuzz testing.])
1387 libo_FUZZ_ARG_ENABLE(pch,
1388 AS_HELP_STRING([--enable-pch=<yes/no/system/base/normal/full>],
1389 [Enables precompiled header support for C++. Forced default on Windows/VC build.
1390 Using 'system' will include only external headers, 'base' will add also headers
1391 from base modules, 'normal' will also add all headers except from the module built,
1392 'full' will use all suitable headers even from a module itself.])
1395 libo_FUZZ_ARG_ENABLE(epm,
1396 AS_HELP_STRING([--enable-epm],
1397 [LibreOffice includes self-packaging code, that requires epm, however epm is
1398 useless for large scale package building.])
1401 libo_FUZZ_ARG_ENABLE(odk,
1402 AS_HELP_STRING([--disable-odk],
1403 [LibreOffice includes an ODK, office development kit which some packagers may
1404 wish to build without.])
1407 AC_ARG_ENABLE(mpl-subset,
1408 AS_HELP_STRING([--enable-mpl-subset],
1409 [Don't compile any pieces which are not MPL or more liberally licensed])
1412 libo_FUZZ_ARG_ENABLE(evolution2,
1413 AS_HELP_STRING([--enable-evolution2],
1414 [Allows the built-in evolution 2 addressbook connectivity build to be
1418 AC_ARG_ENABLE(avahi,
1419 AS_HELP_STRING([--enable-avahi],
1420 [Determines whether to use Avahi to advertise Impress to remote controls.])
1423 libo_FUZZ_ARG_ENABLE(werror,
1424 AS_HELP_STRING([--enable-werror],
1425 [Turn warnings to errors. (Has no effect in modules where the treating
1426 of warnings as errors is disabled explicitly.)]),
1429 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1430 AS_HELP_STRING([--enable-assert-always-abort],
1431 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1434 libo_FUZZ_ARG_ENABLE(dbgutil,
1435 AS_HELP_STRING([--enable-dbgutil],
1436 [Provide debugging support from --enable-debug and include additional debugging
1437 utilities such as object counting or more expensive checks.
1438 This is the recommended option for developers.
1439 Note that this makes the build ABI incompatible, it is not possible to mix object
1440 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1442 libo_FUZZ_ARG_ENABLE(debug,
1443 AS_HELP_STRING([--enable-debug],
1444 [Include debugging information, disable compiler optimization and inlining plus
1445 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1447 libo_FUZZ_ARG_ENABLE(split-debug,
1448 AS_HELP_STRING([--disable-split-debug],
1449 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1450 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1452 libo_FUZZ_ARG_ENABLE(gdb-index,
1453 AS_HELP_STRING([--disable-gdb-index],
1454 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1455 The feature requires the gold or lld linker.]))
1457 libo_FUZZ_ARG_ENABLE(sal-log,
1458 AS_HELP_STRING([--enable-sal-log],
1459 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1461 libo_FUZZ_ARG_ENABLE(symbols,
1462 AS_HELP_STRING([--enable-symbols],
1463 [Generate debug information.
1464 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1465 otherwise. It is possible to explicitly specify gbuild build targets
1466 (where 'all' means everything, '-' prepended means to not enable, '/' appended means
1467 everything in the directory; there is no ordering, more specific overrides
1468 more general, and disabling takes precedence).
1469 Example: --enable-symbols="all -sw/ -Library_sc".]))
1471 libo_FUZZ_ARG_ENABLE(optimized,
1472 AS_HELP_STRING([--enable-optimized=<yes/no/debug>],
1473 [Whether to compile with optimization flags.
1474 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1475 otherwise. Using 'debug' will try to use only optimizations that should
1476 not interfere with debugging.]))
1478 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1479 AS_HELP_STRING([--disable-runtime-optimizations],
1480 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1481 JVM JIT) that are known to interact badly with certain dynamic analysis
1482 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1483 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1484 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1486 AC_ARG_WITH(valgrind,
1487 AS_HELP_STRING([--with-valgrind],
1488 [Make availability of Valgrind headers a hard requirement.]))
1490 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1491 AS_HELP_STRING([--enable-compiler-plugins],
1492 [Enable compiler plugins that will perform additional checks during
1493 building. Enabled automatically by --enable-dbgutil.
1494 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1495 COMPILER_PLUGINS_DEBUG=
1496 if test "$enable_compiler_plugins" = debug; then
1497 enable_compiler_plugins=yes
1498 COMPILER_PLUGINS_DEBUG=TRUE
1501 libo_FUZZ_ARG_ENABLE(compiler-plugins-analyzer-pch,
1502 AS_HELP_STRING([--disable-compiler-plugins-analyzer-pch],
1503 [Disable use of precompiled headers when running the Clang compiler plugin analyzer. Not
1504 relevant in the --disable-compiler-plugins case.]))
1506 libo_FUZZ_ARG_ENABLE(ooenv,
1507 AS_HELP_STRING([--disable-ooenv],
1508 [Disable ooenv for the instdir installation.]))
1511 AS_HELP_STRING([--enable-lto],
1512 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1513 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1514 linker. For MSVC, this option is broken at the moment. This is experimental work
1515 in progress that shouldn't be used unless you are working on it.)]))
1517 AC_ARG_ENABLE(python,
1518 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1519 [Enables or disables Python support at run-time.
1520 Also specifies what Python to use at build-time.
1521 'fully-internal' even forces the internal version for uses of Python
1523 On macOS the only choices are
1524 'internal' (default) or 'fully-internal'. Otherwise the default is 'auto'.
1527 libo_FUZZ_ARG_ENABLE(gtk3,
1528 AS_HELP_STRING([--disable-gtk3],
1529 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1530 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1532 AC_ARG_ENABLE(introspection,
1533 AS_HELP_STRING([--enable-introspection],
1534 [Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
1535 Linux distributions.)]))
1537 AC_ARG_ENABLE(split-app-modules,
1538 AS_HELP_STRING([--enable-split-app-modules],
1539 [Split file lists for app modules, e.g. base, calc.
1540 Has effect only with make distro-pack-install]),
1543 AC_ARG_ENABLE(split-opt-features,
1544 AS_HELP_STRING([--enable-split-opt-features],
1545 [Split file lists for some optional features, e.g. pyuno, testtool.
1546 Has effect only with make distro-pack-install]),
1549 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1550 AS_HELP_STRING([--disable-cairo-canvas],
1551 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1554 libo_FUZZ_ARG_ENABLE(dbus,
1555 AS_HELP_STRING([--disable-dbus],
1556 [Determines whether to enable features that depend on dbus.
1557 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1558 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1560 libo_FUZZ_ARG_ENABLE(sdremote,
1561 AS_HELP_STRING([--disable-sdremote],
1562 [Determines whether to enable Impress remote control (i.e. the server component).]),
1563 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1565 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1566 AS_HELP_STRING([--disable-sdremote-bluetooth],
1567 [Determines whether to build sdremote with bluetooth support.
1568 Requires dbus on Linux.]))
1570 libo_FUZZ_ARG_ENABLE(gio,
1571 AS_HELP_STRING([--disable-gio],
1572 [Determines whether to use the GIO support.]),
1573 ,test "${enable_gio+set}" = set || enable_gio=yes)
1576 AS_HELP_STRING([--enable-qt5],
1577 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1582 AS_HELP_STRING([--enable-kf5],
1583 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1584 KF5 are available.]),
1588 AS_HELP_STRING([--enable-kde5],
1589 [Compatibility switch for the kde5 => kf5 rename. Use --enable-kf5!])
1592 AC_ARG_ENABLE(gtk3_kde5,
1593 AS_HELP_STRING([--enable-gtk3-kde5],
1594 [Determines whether to use Gtk3 vclplug with KF5 file dialogs on
1595 platforms where Gtk3, Qt5 and Plasma is available.]),
1599 AS_HELP_STRING([--disable-gui],
1600 [Disable use of X11 or Wayland to reduce dependencies (e.g. for building LibreOfficeKit).]),
1603 libo_FUZZ_ARG_ENABLE(randr,
1604 AS_HELP_STRING([--disable-randr],
1605 [Disable RandR support in the vcl project.]),
1606 ,test "${enable_randr+set}" = set || enable_randr=yes)
1608 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1609 AS_HELP_STRING([--disable-gstreamer-1-0],
1610 [Disable building with the gstreamer 1.0 avmedia backend.]),
1611 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1613 libo_FUZZ_ARG_ENABLE(vlc,
1614 AS_HELP_STRING([--enable-vlc],
1615 [Enable building with the (experimental) VLC avmedia backend.]),
1616 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1618 libo_FUZZ_ARG_ENABLE(neon,
1619 AS_HELP_STRING([--disable-neon],
1620 [Disable neon and the compilation of webdav binding.]),
1623 libo_FUZZ_ARG_ENABLE([eot],
1624 [AS_HELP_STRING([--enable-eot],
1625 [Enable support for Embedded OpenType fonts.])],
1626 ,test "${enable_eot+set}" = set || enable_eot=no)
1628 libo_FUZZ_ARG_ENABLE(cve-tests,
1629 AS_HELP_STRING([--disable-cve-tests],
1630 [Prevent CVE tests to be executed]),
1633 libo_FUZZ_ARG_ENABLE(chart-tests,
1634 AS_HELP_STRING([--enable-chart-tests],
1635 [Executes chart XShape tests. In a perfect world these tests would be
1636 stable and everyone could run them, in reality it is best to run them
1637 only on a few machines that are known to work and maintained by people
1638 who can judge if a test failure is a regression or not.]),
1641 AC_ARG_ENABLE(build-unowinreg,
1642 AS_HELP_STRING([--enable-build-unowinreg],
1643 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1644 compiler is needed on Linux.]),
1647 AC_ARG_ENABLE(build-opensymbol,
1648 AS_HELP_STRING([--enable-build-opensymbol],
1649 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1650 fontforge installed.]),
1653 AC_ARG_ENABLE(dependency-tracking,
1654 AS_HELP_STRING([--enable-dependency-tracking],
1655 [Do not reject slow dependency extractors.])[
1656 --disable-dependency-tracking
1657 Disables generation of dependency information.
1658 Speed up one-time builds.],
1661 AC_ARG_ENABLE(icecream,
1662 AS_HELP_STRING([--enable-icecream],
1663 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1664 It defaults to /opt/icecream for the location of the icecream gcc/g++
1665 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1669 AS_HELP_STRING([--enable-ld=<linker>],
1670 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1671 By default tries to use the best linker possible, use --disable-ld to use the default linker.
1672 If <linker> contains any ':', the part before the first ':' is used as the value of
1673 -fuse-ld, while the part after the first ':' is used as the value of --ld-path (which is
1674 needed for Clang 12).]),
1677 libo_FUZZ_ARG_ENABLE(cups,
1678 AS_HELP_STRING([--disable-cups],
1679 [Do not build cups support.])
1682 AC_ARG_ENABLE(ccache,
1683 AS_HELP_STRING([--disable-ccache],
1684 [Do not try to use ccache automatically.
1685 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1686 CC/CXX are not yet set, and --enable-icecream is not given, we
1687 attempt to use ccache. --disable-ccache disables ccache completely.
1688 Additionally ccache's depend mode is enabled if possible,
1689 use --enable-ccache=nodepend to enable ccache without depend mode.
1693 libo_FUZZ_ARG_ENABLE(online-update,
1694 AS_HELP_STRING([--enable-online-update],
1695 [Enable the online update service that will check for new versions of
1696 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1697 If the value is "mar", the experimental Mozilla-like update will be
1698 enabled instead of the traditional update mechanism.]),
1701 AC_ARG_WITH(update-config,
1702 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1703 [Path to the update config ini file]))
1705 libo_FUZZ_ARG_ENABLE(extension-update,
1706 AS_HELP_STRING([--disable-extension-update],
1707 [Disable possibility to update installed extensions.]),
1710 libo_FUZZ_ARG_ENABLE(release-build,
1711 AS_HELP_STRING([--enable-release-build],
1712 [Enable release build. Note that the "release build" choice is orthogonal to
1713 whether symbols are present, debug info is generated, or optimization
1715 See http://wiki.documentfoundation.org/Development/DevBuild]),
1718 AC_ARG_ENABLE(windows-build-signing,
1719 AS_HELP_STRING([--enable-windows-build-signing],
1720 [Enable signing of windows binaries (*.exe, *.dll)]),
1723 AC_ARG_ENABLE(silent-msi,
1724 AS_HELP_STRING([--enable-silent-msi],
1725 [Enable MSI with LIMITUI=1 (silent install).]),
1728 AC_ARG_ENABLE(macosx-code-signing,
1729 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1730 [Sign executables, dylibs, frameworks and the app bundle. If you
1731 don't provide an identity the first suitable certificate
1732 in your keychain is used.]),
1735 AC_ARG_ENABLE(macosx-package-signing,
1736 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1737 [Create a .pkg suitable for uploading to the Mac App Store and sign
1738 it. If you don't provide an identity the first suitable certificate
1739 in your keychain is used.]),
1742 AC_ARG_ENABLE(macosx-sandbox,
1743 AS_HELP_STRING([--enable-macosx-sandbox],
1744 [Make the app bundle run in a sandbox. Requires code signing.
1745 Is required by apps distributed in the Mac App Store, and implies
1746 adherence to App Store rules.]),
1749 AC_ARG_WITH(macosx-bundle-identifier,
1750 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1751 [Define the macOS bundle identifier. Default is the somewhat weird
1752 org.libreoffice.script ("script", huh?).]),
1753 ,with_macosx_bundle_identifier=org.libreoffice.script)
1755 AC_ARG_WITH(product-name,
1756 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1757 [Define the product name. Default is AC_PACKAGE_NAME.]),
1758 ,with_product_name=$PRODUCTNAME)
1760 libo_FUZZ_ARG_ENABLE(community-flavor,
1761 AS_HELP_STRING([--disable-community-flavor],
1762 [Disable the Community branding.]),
1765 AC_ARG_WITH(package-version,
1766 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1767 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1770 libo_FUZZ_ARG_ENABLE(readonly-installset,
1771 AS_HELP_STRING([--enable-readonly-installset],
1772 [Prevents any attempts by LibreOffice to write into its installation. That means
1773 at least that no "system-wide" extensions can be added. Partly experimental work in
1774 progress, probably not fully implemented. Always enabled for macOS.]),
1777 libo_FUZZ_ARG_ENABLE(mariadb-sdbc,
1778 AS_HELP_STRING([--disable-mariadb-sdbc],
1779 [Disable the build of the MariaDB/MySQL-SDBC driver.])
1782 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1783 AS_HELP_STRING([--disable-postgresql-sdbc],
1784 [Disable the build of the PostgreSQL-SDBC driver.])
1787 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1788 AS_HELP_STRING([--disable-lotuswordpro],
1789 [Disable the build of the Lotus Word Pro filter.]),
1790 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1792 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1793 AS_HELP_STRING([--disable-firebird-sdbc],
1794 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1795 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1797 AC_ARG_ENABLE(bogus-pkg-config,
1798 AS_HELP_STRING([--enable-bogus-pkg-config],
1799 [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.]),
1802 AC_ARG_ENABLE(openssl,
1803 AS_HELP_STRING([--disable-openssl],
1804 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1805 components will either use GNUTLS or NSS. Work in progress,
1806 use only if you are hacking on it.]),
1807 ,enable_openssl=yes)
1809 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1810 AS_HELP_STRING([--enable-cipher-openssl-backend],
1811 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1812 Requires --enable-openssl.]))
1814 AC_ARG_ENABLE(library-bin-tar,
1815 AS_HELP_STRING([--enable-library-bin-tar],
1816 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1817 Some libraries can save their build result in a tarball
1818 stored in TARFILE_LOCATION. That binary tarball is
1819 uniquely identified by the source tarball,
1820 the content of the config_host.mk file and the content
1821 of the top-level directory in core for that library
1822 If this option is enabled, then if such a tarfile exist, it will be untarred
1823 instead of the source tarfile, and the build step will be skipped for that
1825 If a proper tarfile does not exist, then the normal source-based
1826 build is done for that library and a proper binary tarfile is created
1827 for the next time.]),
1830 AC_ARG_ENABLE(dconf,
1831 AS_HELP_STRING([--disable-dconf],
1832 [Disable the dconf configuration backend (enabled by default where
1835 libo_FUZZ_ARG_ENABLE(formula-logger,
1837 [--enable-formula-logger],
1838 [Enable formula logger for logging formula calculation flow in Calc.]
1843 AS_HELP_STRING([--disable-ldap],
1844 [Disable LDAP support.]),
1847 AC_ARG_ENABLE(opencl,
1848 AS_HELP_STRING([--disable-opencl],
1849 [Disable OpenCL support.]),
1852 dnl ===================================================================
1853 dnl Optional Packages (--with/without-)
1854 dnl ===================================================================
1856 AC_ARG_WITH(gcc-home,
1857 AS_HELP_STRING([--with-gcc-home],
1858 [Specify the location of gcc/g++ manually. This can be used in conjunction
1859 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1860 non-default path.]),
1863 AC_ARG_WITH(gnu-patch,
1864 AS_HELP_STRING([--with-gnu-patch],
1865 [Specify location of GNU patch on Solaris or FreeBSD.]),
1868 AC_ARG_WITH(build-platform-configure-options,
1869 AS_HELP_STRING([--with-build-platform-configure-options],
1870 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1874 AS_HELP_STRING([--with-gnu-cp],
1875 [Specify location of GNU cp on Solaris or FreeBSD.]),
1878 AC_ARG_WITH(external-tar,
1879 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1880 [Specify an absolute path of where to find (and store) tarfiles.]),
1881 TARFILE_LOCATION=$withval ,
1884 AC_ARG_WITH(referenced-git,
1885 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1886 [Specify another checkout directory to reference. This makes use of
1887 git submodule update --reference, and saves a lot of diskspace
1888 when having multiple trees side-by-side.]),
1889 GIT_REFERENCE_SRC=$withval ,
1892 AC_ARG_WITH(linked-git,
1893 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1894 [Specify a directory where the repositories of submodules are located.
1895 This uses a method similar to git-new-workdir to get submodules.]),
1896 GIT_LINK_SRC=$withval ,
1899 AC_ARG_WITH(galleries,
1900 AS_HELP_STRING([--with-galleries],
1901 [Specify how galleries should be built. It is possible either to
1902 build these internally from source ("build"),
1903 or to disable them ("no")]),
1907 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1908 [Choose which themes to include. By default those themes with an '*' are included.
1909 Possible choices: *breeze, *breeze_dark, *breeze_dark_svg, *breeze_svg, *colibre, *colibre_svg, *elementary,
1910 *elementary_svg, *karasa_jaga, *karasa_jaga_svg, *sifr, *sifr_dark, *sifr_dark_svg, *sifr_svg, *sukapura, *sukapura_svg.]),
1913 libo_FUZZ_ARG_WITH(helppack-integration,
1914 AS_HELP_STRING([--without-helppack-integration],
1915 [It will not integrate the helppacks to the installer
1916 of the product. Please use this switch to use the online help
1917 or separate help packages.]),
1920 libo_FUZZ_ARG_WITH(fonts,
1921 AS_HELP_STRING([--without-fonts],
1922 [LibreOffice includes some third-party fonts to provide a reliable basis for
1923 help content, templates, samples, etc. When these fonts are already
1924 known to be available on the system then you should use this option.]),
1927 AC_ARG_ENABLE(noto-font,
1928 AS_HELP_STRING([--enable-noto-font],
1929 [Add more Google Noto fonts.]),
1933 AS_HELP_STRING([--with-epm],
1934 [Decides which epm to use. Default is to use the one from the system if
1935 one is built. When either this is not there or you say =internal epm
1939 AC_ARG_WITH(package-format,
1940 AS_HELP_STRING([--with-package-format],
1941 [Specify package format(s) for LibreOffice installation sets. The
1942 implicit --without-package-format leads to no installation sets being
1943 generated. Possible values: aix, archive, bsd, deb, dmg,
1944 installed, msi, pkg, and rpm.
1945 Example: --with-package-format='deb rpm']),
1949 AS_HELP_STRING([--with-tls],
1950 [Decides which TLS/SSL and cryptographic implementations to use for
1951 LibreOffice's code. Notice that this doesn't apply for depending
1952 libraries like "neon", for example. Default is to use NSS
1953 although OpenSSL is also possible. Notice that selecting NSS restricts
1954 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1955 restrict by now the usage of NSS in LO's code. Possible values:
1956 openssl, nss. Example: --with-tls="nss"]),
1959 AC_ARG_WITH(system-libs,
1960 AS_HELP_STRING([--with-system-libs],
1961 [Use libraries already on system -- enables all --with-system-* flags.]),
1964 AC_ARG_WITH(system-bzip2,
1965 AS_HELP_STRING([--with-system-bzip2],
1966 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1967 [with_system_bzip2="$with_system_libs"])
1969 AC_ARG_WITH(system-headers,
1970 AS_HELP_STRING([--with-system-headers],
1971 [Use headers already on system -- enables all --with-system-* flags for
1972 external packages whose headers are the only entities used i.e.
1973 boost/odbc/sane-header(s).]),,
1974 [with_system_headers="$with_system_libs"])
1976 AC_ARG_WITH(system-jars,
1977 AS_HELP_STRING([--without-system-jars],
1978 [When building with --with-system-libs, also the needed jars are expected
1979 on the system. Use this to disable that]),,
1980 [with_system_jars="$with_system_libs"])
1982 AC_ARG_WITH(system-cairo,
1983 AS_HELP_STRING([--with-system-cairo],
1984 [Use cairo libraries already on system. Happens automatically for
1985 (implicit) --enable-gtk3.]))
1987 AC_ARG_WITH(system-epoxy,
1988 AS_HELP_STRING([--with-system-epoxy],
1989 [Use epoxy libraries already on system. Happens automatically for
1990 (implicit) --enable-gtk3.]),,
1991 [with_system_epoxy="$with_system_libs"])
1993 AC_ARG_WITH(myspell-dicts,
1994 AS_HELP_STRING([--with-myspell-dicts],
1995 [Adds myspell dictionaries to the LibreOffice installation set]),
1998 AC_ARG_WITH(system-dicts,
1999 AS_HELP_STRING([--without-system-dicts],
2000 [Do not use dictionaries from system paths.]),
2003 AC_ARG_WITH(external-dict-dir,
2004 AS_HELP_STRING([--with-external-dict-dir],
2005 [Specify external dictionary dir.]),
2008 AC_ARG_WITH(external-hyph-dir,
2009 AS_HELP_STRING([--with-external-hyph-dir],
2010 [Specify external hyphenation pattern dir.]),
2013 AC_ARG_WITH(external-thes-dir,
2014 AS_HELP_STRING([--with-external-thes-dir],
2015 [Specify external thesaurus dir.]),
2018 AC_ARG_WITH(system-zlib,
2019 AS_HELP_STRING([--with-system-zlib],
2020 [Use zlib already on system.]),,
2021 [with_system_zlib=auto])
2023 AC_ARG_WITH(system-jpeg,
2024 AS_HELP_STRING([--with-system-jpeg],
2025 [Use jpeg already on system.]),,
2026 [with_system_jpeg="$with_system_libs"])
2028 AC_ARG_WITH(system-clucene,
2029 AS_HELP_STRING([--with-system-clucene],
2030 [Use clucene already on system.]),,
2031 [with_system_clucene="$with_system_libs"])
2033 AC_ARG_WITH(system-expat,
2034 AS_HELP_STRING([--with-system-expat],
2035 [Use expat already on system.]),,
2036 [with_system_expat="$with_system_libs"])
2038 AC_ARG_WITH(system-libxml,
2039 AS_HELP_STRING([--with-system-libxml],
2040 [Use libxml/libxslt already on system.]),,
2041 [with_system_libxml=auto])
2043 AC_ARG_WITH(system-icu,
2044 AS_HELP_STRING([--with-system-icu],
2045 [Use icu already on system.]),,
2046 [with_system_icu="$with_system_libs"])
2048 AC_ARG_WITH(system-ucpp,
2049 AS_HELP_STRING([--with-system-ucpp],
2050 [Use ucpp already on system.]),,
2053 AC_ARG_WITH(system-openldap,
2054 AS_HELP_STRING([--with-system-openldap],
2055 [Use the OpenLDAP LDAP SDK already on system.]),,
2056 [with_system_openldap="$with_system_libs"])
2058 libo_FUZZ_ARG_ENABLE(poppler,
2059 AS_HELP_STRING([--disable-poppler],
2060 [Disable building Poppler.])
2063 AC_ARG_WITH(system-poppler,
2064 AS_HELP_STRING([--with-system-poppler],
2065 [Use system poppler (only needed for PDF import).]),,
2066 [with_system_poppler="$with_system_libs"])
2068 libo_FUZZ_ARG_ENABLE(gpgmepp,
2069 AS_HELP_STRING([--disable-gpgmepp],
2070 [Disable building gpgmepp. Do not use in normal cases unless you want to fix potential problems it causes.])
2073 AC_ARG_WITH(system-gpgmepp,
2074 AS_HELP_STRING([--with-system-gpgmepp],
2075 [Use gpgmepp already on system]),,
2076 [with_system_gpgmepp="$with_system_libs"])
2078 AC_ARG_WITH(system-apache-commons,
2079 AS_HELP_STRING([--with-system-apache-commons],
2080 [Use Apache commons libraries already on system.]),,
2081 [with_system_apache_commons="$with_system_jars"])
2083 AC_ARG_WITH(system-mariadb,
2084 AS_HELP_STRING([--with-system-mariadb],
2085 [Use MariaDB/MySQL libraries already on system.]),,
2086 [with_system_mariadb="$with_system_libs"])
2088 AC_ARG_ENABLE(bundle-mariadb,
2089 AS_HELP_STRING([--enable-bundle-mariadb],
2090 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
2093 AC_ARG_WITH(system-postgresql,
2094 AS_HELP_STRING([--with-system-postgresql],
2095 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
2096 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
2097 [with_system_postgresql="$with_system_libs"])
2099 AC_ARG_WITH(libpq-path,
2100 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
2101 [Use this PostgreSQL C interface (libpq) installation for building
2102 the PostgreSQL-SDBC extension.]),
2105 AC_ARG_WITH(system-firebird,
2106 AS_HELP_STRING([--with-system-firebird],
2107 [Use Firebird libraries already on system, for building the Firebird-SDBC
2108 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
2109 [with_system_firebird="$with_system_libs"])
2111 AC_ARG_WITH(system-libtommath,
2112 AS_HELP_STRING([--with-system-libtommath],
2113 [Use libtommath already on system]),,
2114 [with_system_libtommath="$with_system_libs"])
2116 AC_ARG_WITH(system-hsqldb,
2117 AS_HELP_STRING([--with-system-hsqldb],
2118 [Use hsqldb already on system.]))
2120 AC_ARG_WITH(hsqldb-jar,
2121 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
2122 [Specify path to jarfile manually.]),
2123 HSQLDB_JAR=$withval)
2125 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
2126 AS_HELP_STRING([--disable-scripting-beanshell],
2127 [Disable support for scripts in BeanShell.]),
2131 AC_ARG_WITH(system-beanshell,
2132 AS_HELP_STRING([--with-system-beanshell],
2133 [Use beanshell already on system.]),,
2134 [with_system_beanshell="$with_system_jars"])
2136 AC_ARG_WITH(beanshell-jar,
2137 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
2138 [Specify path to jarfile manually.]),
2141 libo_FUZZ_ARG_ENABLE(scripting-javascript,
2142 AS_HELP_STRING([--disable-scripting-javascript],
2143 [Disable support for scripts in JavaScript.]),
2147 AC_ARG_WITH(system-rhino,
2148 AS_HELP_STRING([--with-system-rhino],
2149 [Use rhino already on system.]),,)
2150 # [with_system_rhino="$with_system_jars"])
2151 # Above is not used as we have different debug interface
2152 # patched into internal rhino. This code needs to be fixed
2153 # before we can enable it by default.
2155 AC_ARG_WITH(rhino-jar,
2156 AS_HELP_STRING([--with-rhino-jar=JARFILE],
2157 [Specify path to jarfile manually.]),
2160 AC_ARG_WITH(commons-logging-jar,
2161 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
2162 [Specify path to jarfile manually.]),
2163 COMMONS_LOGGING_JAR=$withval)
2165 AC_ARG_WITH(system-jfreereport,
2166 AS_HELP_STRING([--with-system-jfreereport],
2167 [Use JFreeReport already on system.]),,
2168 [with_system_jfreereport="$with_system_jars"])
2170 AC_ARG_WITH(sac-jar,
2171 AS_HELP_STRING([--with-sac-jar=JARFILE],
2172 [Specify path to jarfile manually.]),
2175 AC_ARG_WITH(libxml-jar,
2176 AS_HELP_STRING([--with-libxml-jar=JARFILE],
2177 [Specify path to jarfile manually.]),
2178 LIBXML_JAR=$withval)
2180 AC_ARG_WITH(flute-jar,
2181 AS_HELP_STRING([--with-flute-jar=JARFILE],
2182 [Specify path to jarfile manually.]),
2185 AC_ARG_WITH(jfreereport-jar,
2186 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
2187 [Specify path to jarfile manually.]),
2188 JFREEREPORT_JAR=$withval)
2190 AC_ARG_WITH(liblayout-jar,
2191 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
2192 [Specify path to jarfile manually.]),
2193 LIBLAYOUT_JAR=$withval)
2195 AC_ARG_WITH(libloader-jar,
2196 AS_HELP_STRING([--with-libloader-jar=JARFILE],
2197 [Specify path to jarfile manually.]),
2198 LIBLOADER_JAR=$withval)
2200 AC_ARG_WITH(libformula-jar,
2201 AS_HELP_STRING([--with-libformula-jar=JARFILE],
2202 [Specify path to jarfile manually.]),
2203 LIBFORMULA_JAR=$withval)
2205 AC_ARG_WITH(librepository-jar,
2206 AS_HELP_STRING([--with-librepository-jar=JARFILE],
2207 [Specify path to jarfile manually.]),
2208 LIBREPOSITORY_JAR=$withval)
2210 AC_ARG_WITH(libfonts-jar,
2211 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
2212 [Specify path to jarfile manually.]),
2213 LIBFONTS_JAR=$withval)
2215 AC_ARG_WITH(libserializer-jar,
2216 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
2217 [Specify path to jarfile manually.]),
2218 LIBSERIALIZER_JAR=$withval)
2220 AC_ARG_WITH(libbase-jar,
2221 AS_HELP_STRING([--with-libbase-jar=JARFILE],
2222 [Specify path to jarfile manually.]),
2223 LIBBASE_JAR=$withval)
2225 AC_ARG_WITH(system-odbc,
2226 AS_HELP_STRING([--with-system-odbc],
2227 [Use the odbc headers already on system.]),,
2228 [with_system_odbc="auto"])
2230 AC_ARG_WITH(system-sane,
2231 AS_HELP_STRING([--with-system-sane],
2232 [Use sane.h already on system.]),,
2233 [with_system_sane="$with_system_headers"])
2235 AC_ARG_WITH(system-bluez,
2236 AS_HELP_STRING([--with-system-bluez],
2237 [Use bluetooth.h already on system.]),,
2238 [with_system_bluez="$with_system_headers"])
2240 AC_ARG_WITH(system-curl,
2241 AS_HELP_STRING([--with-system-curl],
2242 [Use curl already on system.]),,
2243 [with_system_curl=auto])
2245 AC_ARG_WITH(system-boost,
2246 AS_HELP_STRING([--with-system-boost],
2247 [Use boost already on system.]),,
2248 [with_system_boost="$with_system_headers"])
2250 AC_ARG_WITH(system-glm,
2251 AS_HELP_STRING([--with-system-glm],
2252 [Use glm already on system.]),,
2253 [with_system_glm="$with_system_headers"])
2255 AC_ARG_WITH(system-hunspell,
2256 AS_HELP_STRING([--with-system-hunspell],
2257 [Use libhunspell already on system.]),,
2258 [with_system_hunspell="$with_system_libs"])
2260 libo_FUZZ_ARG_ENABLE(qrcodegen,
2261 AS_HELP_STRING([--disable-qrcodegen],
2262 [Disable use of qrcodegen external library.]))
2264 AC_ARG_WITH(system-qrcodegen,
2265 AS_HELP_STRING([--with-system-qrcodegen],
2266 [Use libqrcodegen already on system.]),,
2267 [with_system_qrcodegen="$with_system_libs"])
2269 AC_ARG_WITH(system-box2d,
2270 AS_HELP_STRING([--with-system-box2d],
2271 [Use box2d already on system.]),,
2272 [with_system_box2d="$with_system_libs"])
2274 AC_ARG_WITH(system-mythes,
2275 AS_HELP_STRING([--with-system-mythes],
2276 [Use mythes already on system.]),,
2277 [with_system_mythes="$with_system_libs"])
2279 AC_ARG_WITH(system-altlinuxhyph,
2280 AS_HELP_STRING([--with-system-altlinuxhyph],
2281 [Use ALTLinuxhyph already on system.]),,
2282 [with_system_altlinuxhyph="$with_system_libs"])
2284 AC_ARG_WITH(system-lpsolve,
2285 AS_HELP_STRING([--with-system-lpsolve],
2286 [Use lpsolve already on system.]),,
2287 [with_system_lpsolve="$with_system_libs"])
2289 AC_ARG_WITH(system-coinmp,
2290 AS_HELP_STRING([--with-system-coinmp],
2291 [Use CoinMP already on system.]),,
2292 [with_system_coinmp="$with_system_libs"])
2294 AC_ARG_WITH(system-liblangtag,
2295 AS_HELP_STRING([--with-system-liblangtag],
2296 [Use liblangtag library already on system.]),,
2297 [with_system_liblangtag="$with_system_libs"])
2300 AS_HELP_STRING([--with-webdav],
2301 [Specify which library to use for webdav implementation.
2302 Possible values: "neon", "serf", "no". The default value is "neon".
2303 Example: --with-webdav="serf"]),
2304 WITH_WEBDAV=$withval,
2307 AC_ARG_WITH(linker-hash-style,
2308 AS_HELP_STRING([--with-linker-hash-style],
2309 [Use linker with --hash-style=<style> when linking shared objects.
2310 Possible values: "sysv", "gnu", "both". The default value is "gnu"
2311 if supported on the build system, and "sysv" otherwise.]))
2313 AC_ARG_WITH(jdk-home,
2314 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
2315 [If you have installed JDK 9 or later on your system please supply the
2316 path here. Note that this is not the location of the java command but the
2317 location of the entire distribution. In case of cross-compiling, this
2318 is the JDK of the host os. Use --with-build-platform-configure-options
2319 to point to a different build platform JDK.]),
2323 AS_HELP_STRING([--with-help],
2324 [Enable the build of help. There is a special parameter "common" that
2325 can be used to bundle only the common part, .e.g help-specific icons.
2326 This is useful when you build the helpcontent separately.])
2328 Usage: --with-help build the old local help
2329 --without-help no local help (default)
2330 --with-help=html build the new HTML local help
2331 --with-help=online build the new HTML online help
2335 AC_ARG_WITH(omindex,
2336 AS_HELP_STRING([--with-omindex],
2337 [Enable the support of xapian-omega index for online help.])
2339 Usage: --with-omindex=server prepare the pages for omindex
2340 but let xapian-omega be built in server.
2341 --with-omindex=noxap do not prepare online pages
2346 libo_FUZZ_ARG_WITH(java,
2347 AS_HELP_STRING([--with-java=<java command>],
2348 [Specify the name of the Java interpreter command. Typically "java"
2349 which is the default.
2351 To build without support for Java components, applets, accessibility
2352 or the XML filters written in Java, use --without-java or --with-java=no.]),
2353 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2354 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
2357 AC_ARG_WITH(jvm-path,
2358 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
2359 [Use a specific JVM search path at runtime.
2360 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2363 AC_ARG_WITH(ant-home,
2364 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2365 [If you have installed Apache Ant on your system, please supply the path here.
2366 Note that this is not the location of the Ant binary but the location
2367 of the entire distribution.]),
2370 AC_ARG_WITH(symbol-config,
2371 AS_HELP_STRING([--with-symbol-config],
2372 [Configuration for the crashreport symbol upload]),
2374 [with_symbol_config=no])
2376 AC_ARG_WITH(export-validation,
2377 AS_HELP_STRING([--without-export-validation],
2378 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2379 ,with_export_validation=auto)
2381 AC_ARG_WITH(bffvalidator,
2382 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2383 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2384 Requires installed Microsoft Office Binary File Format Validator.
2385 Note: export-validation (--with-export-validation) is required to be turned on.
2386 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2387 ,with_bffvalidator=no)
2389 libo_FUZZ_ARG_WITH(junit,
2390 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2391 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2392 --without-junit disables those tests. Not relevant in the --without-java case.]),
2395 AC_ARG_WITH(hamcrest,
2396 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2397 [Specifies the hamcrest jar file to use for JUnit-based tests.
2398 --without-junit disables those tests. Not relevant in the --without-java case.]),
2401 AC_ARG_WITH(perl-home,
2402 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2403 [If you have installed Perl 5 Distribution, on your system, please
2404 supply the path here. Note that this is not the location of the Perl
2405 binary but the location of the entire distribution.]),
2408 libo_FUZZ_ARG_WITH(doxygen,
2410 [--with-doxygen=<absolute path to doxygen executable>],
2411 [Specifies the doxygen executable to use when generating ODK C/C++
2412 documentation. --without-doxygen disables generation of ODK C/C++
2413 documentation. Not relevant in the --disable-odk case.]),
2416 AC_ARG_WITH(visual-studio,
2417 AS_HELP_STRING([--with-visual-studio=<2019>],
2418 [Specify which Visual Studio version to use in case several are
2419 installed. Currently only 2019 (default) is supported.]),
2422 AC_ARG_WITH(windows-sdk,
2423 AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10.0>],
2424 [Specify which Windows SDK, or "Windows Kit", version to use
2425 in case the one that came with the selected Visual Studio
2426 is not what you want for some reason. Note that not all compiler/SDK
2427 combinations are supported. The intent is that this option should not
2432 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2433 [Use this option to build LibreOffice with additional UI language support.
2434 English (US) is always included by default.
2435 Separate multiple languages with space.
2436 For all languages, use --with-lang=ALL.]),
2439 AC_ARG_WITH(locales,
2440 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2441 [Use this option to limit the locale information built in.
2442 Separate multiple locales with space.
2443 Very experimental and might well break stuff.
2444 Just a desperate measure to shrink code and data size.
2445 By default all the locales available is included.
2446 This option is completely unrelated to --with-lang.])
2448 Affects also our character encoding conversion
2449 tables for encodings mainly targeted for a
2450 particular locale, like EUC-CN and EUC-TW for
2451 zh, ISO-2022-JP for ja.
2453 Affects also our add-on break iterator data for
2456 For the default, all locales, don't use this switch at all.
2457 Specifying just the language part of a locale means all matching
2458 locales will be included.
2462 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2463 libo_FUZZ_ARG_WITH(krb5,
2464 AS_HELP_STRING([--with-krb5],
2465 [Enable MIT Kerberos 5 support in modules that support it.
2466 By default automatically enabled on platforms
2467 where a good system Kerberos 5 is available.]),
2470 libo_FUZZ_ARG_WITH(gssapi,
2471 AS_HELP_STRING([--with-gssapi],
2472 [Enable GSSAPI support in modules that support it.
2473 By default automatically enabled on platforms
2474 where a good system GSSAPI is available.]),
2478 AS_HELP_STRING([--with-iwyu],
2479 [Use given IWYU binary path to check unneeded includes instead of building.
2480 Use only if you are hacking on it.]),
2483 libo_FUZZ_ARG_WITH(lxml,
2484 AS_HELP_STRING([--without-lxml],
2485 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2486 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2487 report widget classes and ids.]),
2490 libo_FUZZ_ARG_WITH(latest-c++,
2491 AS_HELP_STRING([--with-latest-c++],
2492 [Try to enable the latest features of the C++ compiler, even if they are not yet part of a
2493 published standard.]),,
2494 [with_latest_c__=no])
2496 dnl ===================================================================
2498 dnl ===================================================================
2500 AC_ARG_WITH(branding,
2501 AS_HELP_STRING([--with-branding=/path/to/images],
2502 [Use given path to retrieve branding images set.])
2504 Search for intro.png about.svg and logo.svg.
2505 If any is missing, default ones will be used instead.
2507 Search also progress.conf for progress
2508 settings on intro screen :
2510 PROGRESSBARCOLOR="255,255,255" Set color of
2511 progress bar. Comma separated RGB decimal values.
2512 PROGRESSSIZE="407,6" Set size of progress bar.
2513 Comma separated decimal values (width, height).
2514 PROGRESSPOSITION="61,317" Set position of progress
2515 bar from left,top. Comma separated decimal values.
2516 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2517 bar frame. Comma separated RGB decimal values.
2518 PROGRESSTEXTCOLOR="0,0,0" Set color of progress
2519 bar text. Comma separated RGB decimal values.
2520 PROGRESSTEXTBASELINE="287" Set vertical position of
2521 progress bar text from top. Decimal value.
2523 Default values will be used if not found.
2528 AC_ARG_WITH(extra-buildid,
2529 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2530 [Show addition build identification in about dialog.]),
2535 AS_HELP_STRING([--with-vendor="John the Builder"],
2536 [Set vendor of the build.]),
2539 AC_ARG_WITH(android-package-name,
2540 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2541 [Set Android package name of the build.]),
2544 AC_ARG_WITH(compat-oowrappers,
2545 AS_HELP_STRING([--with-compat-oowrappers],
2546 [Install oo* wrappers in parallel with
2547 lo* ones to keep backward compatibility.
2548 Has effect only with make distro-pack-install]),
2551 AC_ARG_WITH(os-version,
2552 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2553 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2556 AC_ARG_WITH(mingw-cross-compiler,
2557 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2558 [Specify the MinGW cross-compiler to use.
2559 When building on the ODK on Unix and building unowinreg.dll,
2560 specify the MinGW C++ cross-compiler.]),
2563 AC_ARG_WITH(idlc-cpp,
2564 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2565 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2568 AC_ARG_WITH(parallelism,
2569 AS_HELP_STRING([--with-parallelism],
2570 [Number of jobs to run simultaneously during build. Parallel builds can
2571 save a lot of time on multi-cpu machines. Defaults to the number of
2572 CPUs on the machine, unless you configure --enable-icecream - then to
2576 AC_ARG_WITH(all-tarballs,
2577 AS_HELP_STRING([--with-all-tarballs],
2578 [Download all external tarballs unconditionally]))
2580 AC_ARG_WITH(gdrive-client-id,
2581 AS_HELP_STRING([--with-gdrive-client-id],
2582 [Provides the client id of the application for OAuth2 authentication
2583 on Google Drive. If either this or --with-gdrive-client-secret is
2584 empty, the feature will be disabled]),
2587 AC_ARG_WITH(gdrive-client-secret,
2588 AS_HELP_STRING([--with-gdrive-client-secret],
2589 [Provides the client secret of the application for OAuth2
2590 authentication on Google Drive. If either this or
2591 --with-gdrive-client-id is empty, the feature will be disabled]),
2594 AC_ARG_WITH(alfresco-cloud-client-id,
2595 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2596 [Provides the client id of the application for OAuth2 authentication
2597 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2598 empty, the feature will be disabled]),
2601 AC_ARG_WITH(alfresco-cloud-client-secret,
2602 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2603 [Provides the client secret of the application for OAuth2
2604 authentication on Alfresco Cloud. If either this or
2605 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2608 AC_ARG_WITH(onedrive-client-id,
2609 AS_HELP_STRING([--with-onedrive-client-id],
2610 [Provides the client id of the application for OAuth2 authentication
2611 on OneDrive. If either this or --with-onedrive-client-secret is
2612 empty, the feature will be disabled]),
2615 AC_ARG_WITH(onedrive-client-secret,
2616 AS_HELP_STRING([--with-onedrive-client-secret],
2617 [Provides the client secret of the application for OAuth2
2618 authentication on OneDrive. If either this or
2619 --with-onedrive-client-id is empty, the feature will be disabled]),
2621 dnl ===================================================================
2622 dnl Do we want to use pre-build binary tarball for recompile
2623 dnl ===================================================================
2625 if test "$enable_library_bin_tar" = "yes" ; then
2626 USE_LIBRARY_BIN_TAR=TRUE
2628 USE_LIBRARY_BIN_TAR=
2630 AC_SUBST(USE_LIBRARY_BIN_TAR)
2632 dnl ===================================================================
2633 dnl Test whether build target is Release Build
2634 dnl ===================================================================
2635 AC_MSG_CHECKING([whether build target is Release Build])
2636 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2638 ENABLE_RELEASE_BUILD=
2639 GET_TASK_ALLOW_ENTITLEMENT='
2640 <!-- We want to be able to debug a hardened process when not building for release -->
2641 <key>com.apple.security.get-task-allow</key>
2644 AC_MSG_RESULT([yes])
2645 ENABLE_RELEASE_BUILD=TRUE
2646 GET_TASK_ALLOW_ENTITLEMENT=''
2648 AC_SUBST(ENABLE_RELEASE_BUILD)
2649 AC_SUBST(GET_TASK_ALLOW_ENTITLEMENT)
2651 AC_MSG_CHECKING([whether to build a Community flavor])
2652 if test -z "$enable_community_flavor" -o "$enable_community_flavor" == "yes"; then
2653 AC_DEFINE(HAVE_FEATURE_COMMUNITY_FLAVOR)
2654 AC_MSG_RESULT([yes])
2659 dnl ===================================================================
2660 dnl Test whether to sign Windows Build
2661 dnl ===================================================================
2662 AC_MSG_CHECKING([whether to sign windows build])
2663 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2664 AC_MSG_RESULT([yes])
2665 WINDOWS_BUILD_SIGNING="TRUE"
2668 WINDOWS_BUILD_SIGNING="FALSE"
2670 AC_SUBST(WINDOWS_BUILD_SIGNING)
2672 dnl ===================================================================
2673 dnl MacOSX build and runtime environment options
2674 dnl ===================================================================
2676 AC_ARG_WITH(macosx-sdk,
2677 AS_HELP_STRING([--with-macosx-sdk=<version>],
2678 [Prefer a specific SDK for building.])
2680 If the requested SDK is not available, a search for the oldest one will be done.
2681 With current Xcode versions, only the latest SDK is included, so this option is
2682 not terribly useful. It works fine to build with a new SDK and run the result
2685 e. g.: --with-macosx-sdk=10.10
2687 there are 3 options to control the MacOSX build:
2688 --with-macosx-sdk (referred as 'sdk' below)
2689 --with-macosx-version-min-required (referred as 'min' below)
2690 --with-macosx-version-max-allowed (referred as 'max' below)
2692 the connection between these value and the default they take is as follow:
2693 ( ? means not specified on the command line, s means the SDK version found,
2694 constraint: 8 <= x <= y <= z)
2696 ==========================================
2697 command line || config result
2698 ==========================================
2699 min | max | sdk || min | max | sdk |
2700 ? | ? | ? || 10.10 | 10.s | 10.s |
2701 ? | ? | 10.x || 10.10 | 10.x | 10.x |
2702 ? | 10.x | ? || 10.10 | 10.s | 10.s |
2703 ? | 10.x | 10.y || 10.10 | 10.x | 10.y |
2704 10.x | ? | ? || 10.x | 10.s | 10.s |
2705 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2706 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2707 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2710 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2711 for a detailed technical explanation of these variables
2713 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2717 AC_ARG_WITH(macosx-version-min-required,
2718 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2719 [set the minimum OS version needed to run the built LibreOffice])
2721 e. g.: --with-macosx-version-min-required=10.10
2722 see --with-macosx-sdk for more info
2726 AC_ARG_WITH(macosx-version-max-allowed,
2727 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2728 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2730 e. g.: --with-macosx-version-max-allowed=10.10
2731 see --with-macosx-sdk for more info
2736 dnl ===================================================================
2737 dnl options for stuff used during cross-compilation build
2738 dnl Not quite superseded by --with-build-platform-configure-options.
2739 dnl TODO: check, if the "force" option is still needed anywhere.
2740 dnl ===================================================================
2742 AC_ARG_WITH(system-icu-for-build,
2743 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2744 [Use icu already on system for build tools (cross-compilation only).]))
2747 dnl ===================================================================
2748 dnl Check for incompatible options set by fuzzing, and reset those
2749 dnl automatically to working combinations
2750 dnl ===================================================================
2752 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2753 "$enable_dbus" != "$enable_avahi"; then
2754 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2755 enable_avahi=$enable_dbus
2760 if ! echo "$LO_PATH" | $EGREP -q "(^|${P_SEP})$1($|${P_SEP})"; then
2761 LO_PATH="${LO_PATH:+$LO_PATH$P_SEP}$1"
2765 add_lopath_before ()
2770 for dir in $LO_PATH ; do
2771 if test "$dir" != "$1" ; then
2772 path_cleanup=${path_cleanup:+$path_cleanup$P_SEP}$dir
2775 LO_PATH="$1${path_cleanup:+$P_SEP$path_cleanup}"
2778 dnl ===================================================================
2779 dnl check for required programs (grep, awk, sed, bash)
2780 dnl ===================================================================
2785 if test -n "$1"; then
2786 if test "$build_os" = "cygwin"; then
2787 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2789 new_path=`cygpath -sm "$formatted_path"`
2792 new_path=`cygpath -u "$formatted_path"`
2797 if test "$2" = "after"; then
2798 add_lopath_after "$new_path"
2800 add_lopath_before "$new_path"
2806 AC_PATH_PROG( AWK, $AWK)
2807 if test -z "$AWK"; then
2808 AC_MSG_ERROR([install awk to run this script])
2811 AC_PATH_PROG(BASH, bash)
2812 if test -z "$BASH"; then
2813 AC_MSG_ERROR([bash not found in \$PATH])
2817 AC_MSG_CHECKING([for GNU or BSD tar])
2818 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2819 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2820 if test $? -eq 0; then
2825 AC_MSG_RESULT($GNUTAR)
2826 if test -z "$GNUTAR"; then
2827 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2831 AC_MSG_CHECKING([for tar's option to strip components])
2832 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2833 if test $? -eq 0; then
2834 STRIP_COMPONENTS="--strip-components"
2836 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2837 if test $? -eq 0; then
2838 STRIP_COMPONENTS="--strip-path"
2840 STRIP_COMPONENTS="unsupported"
2843 AC_MSG_RESULT($STRIP_COMPONENTS)
2844 if test x$STRIP_COMPONENTS = xunsupported; then
2845 AC_MSG_ERROR([you need a tar that is able to strip components.])
2847 AC_SUBST(STRIP_COMPONENTS)
2849 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2850 dnl desktop OSes from "mobile" ones.
2852 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2853 dnl In other words, that when building for an OS that is not a
2854 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2856 dnl Note the direction of the implication; there is no assumption that
2857 dnl cross-compiling would imply a non-desktop OS.
2859 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2860 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2861 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2862 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2865 # Whether to build "avmedia" functionality or not.
2867 if test -z "$enable_avmedia"; then
2871 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2872 if test "$enable_avmedia" = yes; then
2873 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2875 USE_AVMEDIA_DUMMY='TRUE'
2877 AC_SUBST(USE_AVMEDIA_DUMMY)
2879 # Decide whether to build database connectivity stuff (including
2880 # Base) or not. We probably don't want to on non-desktop OSes.
2881 if test -z "$enable_database_connectivity"; then
2882 # --disable-database-connectivity is unfinished work in progress
2883 # and the iOS test app doesn't link if we actually try to use it.
2884 # if test $_os != iOS -a $_os != Android; then
2885 if test $_os != iOS; then
2886 enable_database_connectivity=yes
2890 if test "$enable_database_connectivity" = yes; then
2891 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2892 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2895 if test -z "$enable_extensions"; then
2896 # For iOS and Android Viewer, disable extensions unless specifically overridden with --enable-extensions.
2897 if test $_os != iOS && test $_os != Android -o "$ENABLE_ANDROID_LOK" = TRUE ; then
2898 enable_extensions=yes
2902 if test "$enable_extensions" = yes; then
2903 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2904 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2907 if test -z "$enable_scripting"; then
2908 enable_scripting=yes
2911 DISABLE_SCRIPTING=''
2912 if test "$enable_scripting" = yes; then
2913 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2914 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2916 DISABLE_SCRIPTING='TRUE'
2917 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2920 if test $_os = iOS -o $_os = Android; then
2921 # Disable dynamic_loading always for iOS and Android
2922 enable_dynamic_loading=no
2923 elif test -z "$enable_dynamic_loading"; then
2924 # Otherwise enable it unless specifically disabled
2925 enable_dynamic_loading=yes
2928 DISABLE_DYNLOADING=''
2929 if test "$enable_dynamic_loading" = yes; then
2930 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2932 DISABLE_DYNLOADING='TRUE'
2934 AC_SUBST(DISABLE_DYNLOADING)
2936 # remember SYSBASE value
2939 dnl ===================================================================
2940 dnl Sort out various gallery compilation options
2941 dnl ===================================================================
2942 AC_MSG_CHECKING([how to build and package galleries])
2943 if test -n "${with_galleries}"; then
2944 if test "$with_galleries" = "build"; then
2945 WITH_GALLERY_BUILD=TRUE
2946 AC_MSG_RESULT([build from source images internally])
2947 elif test "$with_galleries" = "no"; then
2949 AC_MSG_RESULT([disable non-internal gallery build])
2951 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2954 if test $_os != iOS -a $_os != Android; then
2955 WITH_GALLERY_BUILD=TRUE
2956 AC_MSG_RESULT([internal src images for desktop])
2959 AC_MSG_RESULT([disable src image build])
2962 AC_SUBST(WITH_GALLERY_BUILD)
2964 dnl ===================================================================
2965 dnl Checks if ccache is available
2966 dnl ===================================================================
2968 if test "$_os" = "WINNT"; then
2969 # on windows/VC build do not use ccache
2971 elif test "$enable_ccache" = "no"; then
2973 elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2974 case "%$CC%$CXX%" in
2975 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2976 # assume that's good then
2977 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2978 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2979 CCACHE_DEPEND_MODE=1
2982 AC_PATH_PROG([CCACHE],[ccache],[not found])
2983 if test "$CCACHE" = "not found"; then
2986 CCACHE_DEPEND_MODE=1
2987 # Need to check for ccache version: otherwise prevents
2988 # caching of the results (like "-x objective-c++" for Mac)
2989 if test $_os = Darwin -o $_os = iOS; then
2990 # Check ccache version
2991 AC_MSG_CHECKING([whether version of ccache is suitable])
2992 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2993 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2994 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2995 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2997 AC_MSG_RESULT([no, $CCACHE_VERSION])
3008 if test "$enable_ccache" = "nodepend"; then
3009 CCACHE_DEPEND_MODE=""
3011 AC_SUBST(CCACHE_DEPEND_MODE)
3013 if test "$CCACHE" != ""; then
3014 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
3015 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
3016 if test "$ccache_size" = ""; then
3017 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
3018 if test "$ccache_size" = ""; then
3021 # we could not determine the size or it was less than 1GB -> disable auto-ccache
3022 if test $ccache_size -lt 1024; then
3024 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
3025 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
3027 # warn that ccache may be too small for debug build
3028 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
3029 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
3032 if test $ccache_size -lt 5; then
3033 #warn that ccache may be too small for debug build
3034 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
3035 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
3040 dnl ===================================================================
3041 dnl Checks for C compiler,
3042 dnl The check for the C++ compiler is later on.
3043 dnl ===================================================================
3044 if test "$_os" != "WINNT"; then
3046 AC_MSG_CHECKING([gcc home])
3047 if test -z "$with_gcc_home"; then
3048 if test "$enable_icecream" = "yes"; then
3049 if test -d "/usr/lib/icecc/bin"; then
3050 GCC_HOME="/usr/lib/icecc/"
3051 elif test -d "/usr/libexec/icecc/bin"; then
3052 GCC_HOME="/usr/libexec/icecc/"
3053 elif test -d "/opt/icecream/bin"; then
3054 GCC_HOME="/opt/icecream/"
3056 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
3060 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
3061 GCC_HOME_SET="false"
3064 GCC_HOME="$with_gcc_home"
3066 AC_MSG_RESULT($GCC_HOME)
3069 if test "$GCC_HOME_SET" = "true"; then
3070 if test -z "$CC"; then
3071 CC="$GCC_HOME/bin/gcc"
3074 if test -z "$CXX"; then
3075 CXX="$GCC_HOME/bin/g++"
3081 COMPATH=`dirname "$CC"`
3082 if test "$COMPATH" = "."; then
3083 AC_PATH_PROGS(COMPATH, $CC)
3084 dnl double square bracket to get single because of M4 quote...
3085 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
3087 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
3089 dnl ===================================================================
3091 dnl ===================================================================
3092 AC_MSG_CHECKING([whether to build with Java support])
3093 if test "$with_java" != "no"; then
3094 if test "$DISABLE_SCRIPTING" = TRUE; then
3095 AC_MSG_RESULT([no, overridden by --disable-scripting])
3099 AC_MSG_RESULT([yes])
3101 AC_DEFINE(HAVE_FEATURE_JAVA)
3108 AC_SUBST(ENABLE_JAVA)
3110 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
3112 dnl ENABLE_JAVA="" indicate no Java support at all
3114 dnl ===================================================================
3115 dnl Check macOS SDK and compiler
3116 dnl ===================================================================
3118 if test $_os = Darwin; then
3120 # If no --with-macosx-sdk option is given, look for one
3122 # The intent is that for "most" Mac-based developers, a suitable
3123 # SDK will be found automatically without any configure options.
3125 # For developers with a current Xcode, the lowest-numbered SDK
3126 # higher than or equal to the minimum required should be found.
3128 AC_MSG_CHECKING([what macOS SDK to use])
3129 for _macosx_sdk in ${with_macosx_sdk-12.1 12.0 11.3 11.1 11.0 10.15 10.14 10.13}; do
3130 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
3131 if test -d "$MACOSX_SDK_PATH"; then
3132 with_macosx_sdk="${_macosx_sdk}"
3135 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
3136 if test -d "$MACOSX_SDK_PATH"; then
3137 with_macosx_sdk="${_macosx_sdk}"
3142 if test ! -d "$MACOSX_SDK_PATH"; then
3143 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
3146 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
3148 case $with_macosx_sdk in
3150 MACOSX_SDK_VERSION=101300
3153 MACOSX_SDK_VERSION=101400
3156 MACOSX_SDK_VERSION=101500
3159 MACOSX_SDK_VERSION=110000
3162 MACOSX_SDK_VERSION=110100
3165 MACOSX_SDK_VERSION=110300
3168 MACOSX_SDK_VERSION=120000
3171 MACOSX_SDK_VERSION=120100
3174 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.13--12.1])
3178 if test "$host_cpu" = arm64 -a $MACOSX_SDK_VERSION -lt 110000; then
3179 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value for Apple Silicon])
3182 if test "$with_macosx_version_min_required" = "" ; then
3183 if test "$host_cpu" = x86_64; then
3184 with_macosx_version_min_required="10.10";
3186 with_macosx_version_min_required="11.0";
3190 if test "$with_macosx_version_max_allowed" = "" ; then
3191 with_macosx_version_max_allowed="$with_macosx_sdk"
3194 # export this so that "xcrun" invocations later return matching values
3195 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
3196 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
3197 export DEVELOPER_DIR
3198 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
3199 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
3201 AC_MSG_CHECKING([whether Xcode is new enough])
3202 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
3203 my_xcode_ver2=${my_xcode_ver1#Xcode }
3204 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
3205 if test "$my_xcode_ver3" -ge 1103; then
3206 AC_MSG_RESULT([yes ($my_xcode_ver2)])
3208 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 11.3])
3211 case "$with_macosx_version_min_required" in
3213 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
3216 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
3219 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
3222 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
3225 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
3228 MAC_OS_X_VERSION_MIN_REQUIRED="101500"
3231 MAC_OS_X_VERSION_MIN_REQUIRED="101600"
3234 MAC_OS_X_VERSION_MIN_REQUIRED="110000"
3237 MAC_OS_X_VERSION_MIN_REQUIRED="110100"
3240 MAC_OS_X_VERSION_MIN_REQUIRED="110300"
3243 MAC_OS_X_VERSION_MIN_REQUIRED="120000"
3246 MAC_OS_X_VERSION_MIN_REQUIRED="120100"
3249 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--12.1])
3253 LIBTOOL=/usr/bin/libtool
3254 INSTALL_NAME_TOOL=install_name_tool
3255 if test -z "$save_CC"; then
3256 stdlib=-stdlib=libc++
3258 AC_MSG_CHECKING([what C compiler to use])
3259 CC="`xcrun -find clang`"
3260 CC_BASE=`first_arg_basename "$CC"`
3261 if test "$host_cpu" = x86_64; then
3262 CC+=" -target x86_64-apple-macos"
3264 CC+=" -target arm64-apple-macos"
3266 CC+=" -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
3267 AC_MSG_RESULT([$CC])
3269 AC_MSG_CHECKING([what C++ compiler to use])
3270 CXX="`xcrun -find clang++`"
3271 CXX_BASE=`first_arg_basename "$CXX"`
3272 if test "$host_cpu" = x86_64; then
3273 CXX+=" -target x86_64-apple-macos"
3275 CXX+=" -target arm64-apple-macos"
3277 CXX+=" $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
3278 AC_MSG_RESULT([$CXX])
3280 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3283 STRIP=`xcrun -find strip`
3284 LIBTOOL=`xcrun -find libtool`
3285 RANLIB=`xcrun -find ranlib`
3288 case "$with_macosx_version_max_allowed" in
3290 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
3293 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
3296 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
3299 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
3302 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
3305 MAC_OS_X_VERSION_MAX_ALLOWED="101500"
3308 MAC_OS_X_VERSION_MAX_ALLOWED="110000"
3311 MAC_OS_X_VERSION_MAX_ALLOWED="110100"
3314 MAC_OS_X_VERSION_MAX_ALLOWED="110300"
3317 MAC_OS_X_VERSION_MAX_ALLOWED="120000"
3320 MAC_OS_X_VERSION_MAX_ALLOWED="120100"
3323 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--12.1])
3327 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
3328 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
3329 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])
3334 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
3335 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
3336 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
3340 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
3341 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
3343 AC_MSG_CHECKING([whether to do code signing])
3345 if test "$enable_macosx_code_signing" = yes; then
3346 # By default use the first suitable certificate (?).
3348 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
3349 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
3350 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
3351 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
3352 # "Developer ID Application" one.
3354 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
3355 if test -n "$identity"; then
3356 MACOSX_CODESIGNING_IDENTITY=$identity
3357 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3358 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
3360 AC_MSG_ERROR([cannot determine identity to use])
3362 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
3363 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
3364 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3365 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
3370 AC_MSG_CHECKING([whether to create a Mac App Store package])
3372 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
3373 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
3374 elif test "$enable_macosx_package_signing" = yes; then
3375 # By default use the first suitable certificate.
3376 # It should be a "3rd Party Mac Developer Installer" one
3378 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
3379 if test -n "$identity"; then
3380 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
3381 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3382 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3384 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
3386 elif test -n "$enable_macosx_package_signing"; then
3387 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
3388 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3389 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3394 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
3395 AC_MSG_ERROR([You should not use the same identity for code and package signing])
3398 AC_MSG_CHECKING([whether to sandbox the application])
3400 if test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3401 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
3402 elif test "$enable_macosx_sandbox" = yes; then
3403 ENABLE_MACOSX_SANDBOX=TRUE
3404 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3405 AC_MSG_RESULT([yes])
3410 AC_MSG_CHECKING([what macOS app bundle identifier to use])
3411 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3412 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3414 AC_SUBST(MACOSX_SDK_PATH)
3415 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3416 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3417 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
3418 AC_SUBST(INSTALL_NAME_TOOL)
3419 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
3420 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3421 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3422 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3423 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3425 dnl ===================================================================
3426 dnl Check iOS SDK and compiler
3427 dnl ===================================================================
3429 if test $_os = iOS; then
3430 AC_MSG_CHECKING([what iOS SDK to use])
3431 current_sdk_ver=15.2
3432 older_sdk_vers="15.0 14.5 14.0"
3433 if test "$enable_ios_simulator" = "yes"; then
3434 platform=iPhoneSimulator
3435 versionmin=-mios-simulator-version-min=12.2
3438 versionmin=-miphoneos-version-min=12.2
3440 xcode_developer=`xcode-select -print-path`
3442 for sdkver in $current_sdk_ver $older_sdk_vers; do
3443 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3450 if test -z "$sysroot"; then
3451 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
3454 AC_MSG_RESULT($sysroot)
3456 stdlib="-stdlib=libc++"
3458 AC_MSG_CHECKING([what C compiler to use])
3459 CC="`xcrun -find clang`"
3460 CC_BASE=`first_arg_basename "$CC"`
3461 CC+=" -arch $host_cpu_for_clang -isysroot $sysroot $versionmin"
3462 AC_MSG_RESULT([$CC])
3464 AC_MSG_CHECKING([what C++ compiler to use])
3465 CXX="`xcrun -find clang++`"
3466 CXX_BASE=`first_arg_basename "$CXX"`
3467 CXX+=" -arch $host_cpu_for_clang $stdlib -isysroot $sysroot $versionmin"
3468 AC_MSG_RESULT([$CXX])
3470 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3473 STRIP=`xcrun -find strip`
3474 LIBTOOL=`xcrun -find libtool`
3475 RANLIB=`xcrun -find ranlib`
3478 AC_MSG_CHECKING([whether to treat the installation as read-only])
3480 if test $_os = Darwin; then
3481 enable_readonly_installset=yes
3482 elif test "$enable_extensions" != yes; then
3483 enable_readonly_installset=yes
3485 if test "$enable_readonly_installset" = yes; then
3486 AC_MSG_RESULT([yes])
3487 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3492 dnl ===================================================================
3493 dnl Structure of install set
3494 dnl ===================================================================
3496 if test $_os = Darwin; then
3497 LIBO_BIN_FOLDER=MacOS
3498 LIBO_ETC_FOLDER=Resources
3499 LIBO_LIBEXEC_FOLDER=MacOS
3500 LIBO_LIB_FOLDER=Frameworks
3501 LIBO_LIB_PYUNO_FOLDER=Resources
3502 LIBO_SHARE_FOLDER=Resources
3503 LIBO_SHARE_HELP_FOLDER=Resources/help
3504 LIBO_SHARE_JAVA_FOLDER=Resources/java
3505 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3506 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3507 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3508 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3509 LIBO_URE_BIN_FOLDER=MacOS
3510 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3511 LIBO_URE_LIB_FOLDER=Frameworks
3512 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3513 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3514 elif test $_os = WINNT; then
3515 LIBO_BIN_FOLDER=program
3516 LIBO_ETC_FOLDER=program
3517 LIBO_LIBEXEC_FOLDER=program
3518 LIBO_LIB_FOLDER=program
3519 LIBO_LIB_PYUNO_FOLDER=program
3520 LIBO_SHARE_FOLDER=share
3521 LIBO_SHARE_HELP_FOLDER=help
3522 LIBO_SHARE_JAVA_FOLDER=program/classes
3523 LIBO_SHARE_PRESETS_FOLDER=presets
3524 LIBO_SHARE_READMES_FOLDER=readmes
3525 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3526 LIBO_SHARE_SHELL_FOLDER=program/shell
3527 LIBO_URE_BIN_FOLDER=program
3528 LIBO_URE_ETC_FOLDER=program
3529 LIBO_URE_LIB_FOLDER=program
3530 LIBO_URE_MISC_FOLDER=program
3531 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3533 LIBO_BIN_FOLDER=program
3534 LIBO_ETC_FOLDER=program
3535 LIBO_LIBEXEC_FOLDER=program
3536 LIBO_LIB_FOLDER=program
3537 LIBO_LIB_PYUNO_FOLDER=program
3538 LIBO_SHARE_FOLDER=share
3539 LIBO_SHARE_HELP_FOLDER=help
3540 LIBO_SHARE_JAVA_FOLDER=program/classes
3541 LIBO_SHARE_PRESETS_FOLDER=presets
3542 LIBO_SHARE_READMES_FOLDER=readmes
3543 if test "$enable_fuzzers" != yes; then
3544 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3546 LIBO_SHARE_RESOURCE_FOLDER=resource
3548 LIBO_SHARE_SHELL_FOLDER=program/shell
3549 LIBO_URE_BIN_FOLDER=program
3550 LIBO_URE_ETC_FOLDER=program
3551 LIBO_URE_LIB_FOLDER=program
3552 LIBO_URE_MISC_FOLDER=program
3553 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3555 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3556 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3557 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3558 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3559 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3560 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3561 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3562 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3563 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3564 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3565 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3566 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3567 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3568 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3569 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3570 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3572 # Not all of them needed in config_host.mk, add more if need arises
3573 AC_SUBST(LIBO_BIN_FOLDER)
3574 AC_SUBST(LIBO_ETC_FOLDER)
3575 AC_SUBST(LIBO_LIB_FOLDER)
3576 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3577 AC_SUBST(LIBO_SHARE_FOLDER)
3578 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3579 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3580 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3581 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3582 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3583 AC_SUBST(LIBO_URE_BIN_FOLDER)
3584 AC_SUBST(LIBO_URE_ETC_FOLDER)
3585 AC_SUBST(LIBO_URE_LIB_FOLDER)
3586 AC_SUBST(LIBO_URE_MISC_FOLDER)
3587 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3589 dnl ===================================================================
3590 dnl Windows specific tests and stuff
3591 dnl ===================================================================
3595 # Return value: $regvalue
3598 if test "$build_os" = "wsl"; then
3599 regvalue=$($BUILDDIR/solenv/wsl/wsl-lo-helper.exe --read-registry $1 "$2" 2>/dev/null)
3603 local _regentry="/proc/registry${1}/${2}"
3604 if test -f "$_regentry"; then
3605 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3606 # Registry keys read via /proc/registry* are always \0 terminated!
3607 local _regvalue=$(tr -d '\0' < "$_regentry")
3608 if test $? -eq 0; then
3614 # Get a value from the 32-bit side of the Registry
3617 reg_get_value "32" "$1"
3620 # Get a value from the 64-bit side of the Registry
3623 reg_get_value "64" "$1"
3632 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
3641 PLATFORMID=windows_x86_64
3643 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
3645 WIN_MULTI_ARCH="x86"
3651 PLATFORMID=windows_x86
3654 WIN_OTHER_ARCH="x64"
3659 PLATFORMID=windows_arm64
3661 SCPDEFS="$SCPDEFS -DWINDOWS_ARM64"
3662 WIN_HOST_ARCH="arm64"
3667 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3671 case "$build_cpu" in
3672 x86_64) WIN_BUILD_ARCH="x64" ;;
3673 i*86) WIN_BUILD_ARCH="x86" ;;
3674 aarch64) WIN_BUILD_ARCH="arm64" ;;
3676 AC_MSG_ERROR([Unsupported build_cpu $build_cpu for host_os $host_os])
3680 SCPDEFS="$SCPDEFS -D_MSC_VER"
3681 AC_SUBST(WIN_HOST_ARCH)
3685 # multi-arch is an arch, which can execute on the host (x86 on x64), while
3686 # other-arch won't, but wouldn't break the build (x64 on x86).
3687 if test -n "$WIN_MULTI_ARCH" -a -n "$WIN_OTHER_ARCH"; then
3688 AC_MSG_ERROR([Broken configure.ac file: can't have set \$WIN_MULTI_ARCH and $WIN_OTHER_ARCH])
3692 if test "$_os" = "iOS" -o "$build_cpu" != "$host_cpu"; then
3693 # To allow building Windows multi-arch releases without cross-tooling
3694 if test -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH"; then
3695 cross_compiling="yes"
3698 if test "$cross_compiling" = "yes"; then
3699 export CROSS_COMPILING=TRUE
3702 BUILD_TYPE="$BUILD_TYPE NATIVE"
3704 AC_SUBST(CROSS_COMPILING)
3706 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3707 # NOTE: must _not_ be used for bundled external libraries!
3709 if test "$GCC" = "yes"; then
3710 AC_MSG_CHECKING( for -isystem )
3712 CFLAGS="$CFLAGS -Werror"
3713 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3715 if test -n "$ISYSTEM"; then
3721 if test -z "$ISYSTEM"; then
3722 # fall back to using -I
3727 dnl ===================================================================
3728 dnl Check which Visual Studio compiler is used
3729 dnl ===================================================================
3731 map_vs_year_to_version()
3733 # Return value: $vsversion
3741 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3745 vs_versions_to_check()
3747 # Args: $1 (optional) : versions to check, in the order of preference
3748 # Return value: $vsversions
3752 if test -n "$1"; then
3753 map_vs_year_to_version "$1"
3754 vsversions=$vsversion
3756 # We accept only 2019
3761 win_get_env_from_vsvars32bat()
3763 local WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3764 # Also seems to be located in another directory under the same name: vsvars32.bat
3765 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3766 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3767 # use 'echo.%ENV%' syntax (instead of 'echo %ENV%') to avoid outputting "ECHO is off." in case when ENV is empty or a space
3768 printf '@setlocal\r\n@echo.%%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3770 if test "$build_os" = "wsl"; then
3771 result=$(cd /mnt/c && cmd.exe /c $(wslpath -w $WRAPPERBATCHFILEPATH) | tr -d '\r')
3773 chmod +x $WRAPPERBATCHFILEPATH
3774 result=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3776 rm -f $WRAPPERBATCHFILEPATH
3777 printf '%s' "$result"
3782 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3783 if test -n "$regvalue"; then
3784 PathFormat "$regvalue"
3785 UCRTSDKDIR=$formatted_path_unix
3786 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3787 UCRTVERSION=$regvalue
3789 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3793 if test -z "$UCRTSDKDIR"; then
3794 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3795 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3796 if test -f "$ide_env_file"; then
3797 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3798 UCRTSDKDIR=$formatted_path
3799 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3800 dnl Hack needed at least by tml:
3801 if test "$UCRTVERSION" = 10.0.15063.0 \
3802 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3803 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3805 UCRTVERSION=10.0.14393.0
3808 AC_MSG_ERROR([No UCRT found])
3815 # Find Visual C++ 2019
3816 # Args: $1 (optional) : The VS version year
3817 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3819 unset vctest vcnum vcnumwithdot vcbuildnumber
3821 vs_versions_to_check "$1"
3822 if test "$build_os" = wsl; then
3823 vswhere="$PROGRAMFILESX86"
3825 vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
3827 vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
3828 PathFormat "$vswhere"
3829 vswhere=$formatted_path_unix
3830 for ver in $vsversions; do
3831 vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
3832 # Fall back to all MS products (this includes VC++ Build Tools)
3833 if ! test -n "$vswhereoutput"; then
3834 AC_MSG_CHECKING([VC++ Build Tools and similar])
3835 vswhereoutput=`$vswhere -products \* -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
3837 if test -n "$vswhereoutput"; then
3838 PathFormat "$vswhereoutput"
3839 vctest=$formatted_path_unix
3844 if test -n "$vctest"; then
3845 vcnumwithdot="$ver.0"
3846 case "$vcnumwithdot" in
3852 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3859 AC_MSG_CHECKING([$1 compiler])
3861 CL_EXE_PATH="$2/cl.exe"
3863 if test ! -f "$CL_EXE_PATH"; then
3864 if test "$1" = "multi-arch"; then
3865 AC_MSG_WARN([no compiler (cl.exe) in $2])
3868 AC_MSG_ERROR([no compiler (cl.exe) in $2])
3872 dnl ===========================================================
3873 dnl Check for the corresponding mspdb*.dll
3874 dnl ===========================================================
3876 # MSVC 15.0 has libraries from 14.0?
3879 if test ! -e "$2/mspdb${mspdbnum}.dll"; then
3880 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $2, Visual Studio installation broken?])
3883 # The compiles has to find its shared libraries
3885 TEMP_PATH=`cygpath -d "$2"`
3886 PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
3888 if ! "$CL_EXE_PATH" -? </dev/null >/dev/null 2>&1; then
3889 AC_MSG_ERROR([no compiler (cl.exe) in $2])
3894 AC_MSG_RESULT([$CL_EXE_PATH])
3900 if test "$_os" = "WINNT"; then
3901 AC_MSG_CHECKING([Visual C++])
3902 find_msvc "$with_visual_studio"
3903 if test -z "$vctest"; then
3904 if test -n "$with_visual_studio"; then
3905 AC_MSG_ERROR([no Visual Studio $with_visual_studio installation found])
3907 AC_MSG_ERROR([no Visual Studio 2019 installation found])
3912 VC_PRODUCT_DIR="$vctest/VC"
3913 COMPATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber"
3915 # $WIN_OTHER_ARCH is a hack to test the x64 compiler on x86, even if it's not multi-arch
3916 if test -n "$WIN_MULTI_ARCH" -o -n "$WIN_OTHER_ARCH"; then
3917 MSVC_MULTI_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/${WIN_MULTI_ARCH}${WIN_OTHER_ARCH}"
3918 test_cl_exe "multi-arch" "$MSVC_MULTI_PATH"
3919 if test $? -ne 0; then
3925 if test "$WIN_BUILD_ARCH" = "$WIN_HOST_ARCH"; then
3926 MSVC_BUILD_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_BUILD_ARCH"
3927 test_cl_exe "build" "$MSVC_BUILD_PATH"
3930 if test "$WIN_BUILD_ARCH" != "$WIN_HOST_ARCH"; then
3931 MSVC_HOST_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_HOST_ARCH"
3932 test_cl_exe "host" "$MSVC_HOST_PATH"
3934 MSVC_HOST_PATH="$MSVC_BUILD_PATH"
3937 AC_MSG_CHECKING([for short pathname of VC product directory])
3938 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3939 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3944 AC_MSG_CHECKING([for UCRT location])
3946 # find_ucrt errors out if it doesn't find it
3947 AC_MSG_RESULT([$UCRTSDKDIR ($UCRTVERSION)])
3948 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3949 ucrtincpath_formatted=$formatted_path
3950 # SOLARINC is used for external modules and must be set too.
3951 # And no, it's not sufficient to set SOLARINC only, as configure
3952 # itself doesn't honour it.
3953 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3954 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3955 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3956 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3958 AC_SUBST(UCRTSDKDIR)
3959 AC_SUBST(UCRTVERSION)
3961 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3962 # Find the proper version of MSBuild.exe to use based on the VS version
3963 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3964 if test -n "$regvalue" ; then
3965 AC_MSG_RESULT([found: $regvalue])
3966 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3968 if test "$vcnumwithdot" = "16.0"; then
3969 if test "$WIN_BUILD_ARCH" != "x64"; then
3970 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
3972 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
3975 if test "$WIN_BUILD_ARCH" != "x64"; then
3976 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3978 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3981 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3982 AC_MSG_RESULT([$regvalue])
3985 # Find the version of devenv.exe
3986 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3987 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3988 DEVENV_unix=$(cygpath -u "$DEVENV")
3989 if test ! -e "$DEVENV_unix"; then
3990 AC_MSG_WARN([No devenv.exe found - this is expected for VC++ Build Tools])
3993 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3994 dnl needed when building CLR code:
3995 if test -z "$MSVC_CXX"; then
3996 # This gives us a posix path with 8.3 filename restrictions
3997 MSVC_CXX=`win_short_path_for_make "$MSVC_HOST_PATH/cl.exe"`
4000 if test -z "$CC"; then
4002 CC_BASE=`first_arg_basename "$CC"`
4004 if test -z "$CXX"; then
4006 CXX_BASE=`first_arg_basename "$CXX"`
4009 if test -n "$CC"; then
4010 # Remove /cl.exe from CC case insensitive
4011 AC_MSG_NOTICE([found Visual C++ $vcyear])
4013 main_include_dir=`cygpath -d -m "$COMPATH/Include"`
4014 CPPFLAGS="$CPPFLAGS -I$main_include_dir"
4016 PathFormat "$COMPATH"
4017 COMPATH=`win_short_path_for_make "$formatted_path"`
4021 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
4022 # are always "better", we list them in reverse chronological order.
4026 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
4030 # The expectation is that --with-windows-sdk should not need to be used
4031 if test -n "$with_windows_sdk"; then
4032 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
4033 *" "$with_windows_sdk" "*)
4034 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
4037 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $vcyear])
4042 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
4047 AC_MSG_ERROR([Visual C++ not found after all, huh])
4050 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.4])
4051 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4052 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
4053 // between Visual Studio versions and _MSC_VER:
4057 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
4059 # Check for 64-bit (cross-)compiler to use to build the 64-bit
4060 # version of the Explorer extension (and maybe other small
4061 # bits, too) needed when installing a 32-bit LibreOffice on a
4062 # 64-bit OS. The 64-bit Explorer extension is a feature that
4063 # has been present since long in OOo. Don't confuse it with
4064 # building LibreOffice itself as 64-bit code.
4069 if test "$WIN_HOST_ARCH" = "x86" -a -n "$WIN_OTHER_ARCH"; then
4070 AC_MSG_CHECKING([for the libraries to build the 64-bit Explorer extensions])
4071 if test -f "$COMPATH/atlmfc/lib/x64/atls.lib" -o \
4072 -f "$COMPATH/atlmfc/lib/spectre/x64/atls.lib"
4075 CXX_X64_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
4076 AC_MSG_RESULT([found])
4078 AC_MSG_RESULT([not found])
4079 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
4081 elif test "$WIN_HOST_ARCH" = "x64"; then
4086 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
4087 AC_SUBST(CXX_X64_BINARY)
4089 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
4090 # needed to support TWAIN scan on both 32- and 64-bit systems
4092 case "$WIN_HOST_ARCH" in
4094 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
4095 if test -n "$CXX_X86_BINARY"; then
4097 AC_MSG_RESULT([preset])
4098 elif test -n "$WIN_MULTI_ARCH"; then
4100 CXX_X86_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
4101 CXX_X86_BINARY+=" /arch:SSE"
4102 AC_MSG_RESULT([found])
4104 AC_MSG_RESULT([not found])
4105 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
4110 CXX_X86_BINARY=$MSVC_CXX
4114 AC_SUBST(CXX_X86_BINARY)
4123 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
4124 AC_SUBST(UNOWINREG_DLL)
4127 AC_MSG_CHECKING([whether the compiler is actually Clang])
4128 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4134 [AC_MSG_RESULT([yes])
4136 [AC_MSG_RESULT([no])])
4137 AC_SUBST(COM_IS_CLANG)
4141 if test "$COM_IS_CLANG" = TRUE; then
4142 AC_MSG_CHECKING([whether Clang is new enough])
4143 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4144 #if !defined __apple_build_version__
4148 [my_apple_clang=yes],[my_apple_clang=])
4149 if test "$my_apple_clang" = yes; then
4150 AC_MSG_RESULT([assumed yes (Apple Clang)])
4152 if test "$_os" = WINNT; then
4153 dnl In which case, assume clang-cl:
4155 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
4163 CC_PLAIN="$CC_PLAIN $i"
4170 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args - | sed 's/ //g'`
4171 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
4172 CLANGVER=`echo $clang_version \
4173 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
4174 if test "$CLANGVER" -ge 50002; then
4175 AC_MSG_RESULT([yes ($clang_version)])
4177 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
4179 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
4180 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
4184 SHOWINCLUDES_PREFIX=
4185 if test "$_os" = WINNT; then
4186 dnl We need to guess the prefix of the -showIncludes output, it can be
4188 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
4189 echo "#include <stdlib.h>" > conftest.c
4190 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
4191 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
4192 rm -f conftest.c conftest.obj
4193 if test -z "$SHOWINCLUDES_PREFIX"; then
4194 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
4196 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
4199 AC_SUBST(SHOWINCLUDES_PREFIX)
4202 # prefix C with ccache if needed
4204 if test "$CCACHE" != ""; then
4205 AC_MSG_CHECKING([whether $CC_BASE is already ccached])
4209 CFLAGS="$CFLAGS --ccache-skip -O2"
4210 dnl an empty program will do, we're checking the compiler flags
4211 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
4212 [use_ccache=yes], [use_ccache=no])
4214 if test $use_ccache = yes; then
4215 AC_MSG_RESULT([yes])
4218 CC_BASE="ccache $CC_BASE"
4224 # ===================================================================
4225 # check various GCC options that Clang does not support now but maybe
4226 # will somewhen in the future, check them even for GCC, so that the
4228 # ===================================================================
4231 if test "$GCC" = "yes"; then
4232 AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
4234 CFLAGS="$CFLAGS -Werror -ggdb2"
4235 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
4237 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
4238 AC_MSG_RESULT([yes])
4243 if test "$host_cpu" = "m68k"; then
4244 AC_MSG_CHECKING([whether $CC_BASE supports -mlong-jump-table-offsets])
4246 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
4247 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
4249 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
4250 AC_MSG_RESULT([yes])
4256 AC_SUBST(HAVE_GCC_GGDB2)
4258 dnl ===================================================================
4259 dnl Test the gcc version
4260 dnl ===================================================================
4261 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
4262 AC_MSG_CHECKING([the GCC version])
4263 _gcc_version=`$CC -dumpversion`
4264 gcc_full_version=$(printf '%s' "$_gcc_version" | \
4265 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
4266 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
4268 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
4270 if test "$gcc_full_version" -lt 70000; then
4271 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 7.0.0])
4274 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
4275 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
4276 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
4277 # (which reports itself as GCC 4.2.1).
4280 AC_SUBST(GCC_VERSION)
4282 dnl Set the ENABLE_DBGUTIL variable
4283 dnl ===================================================================
4284 AC_MSG_CHECKING([whether to build with additional debug utilities])
4285 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
4286 ENABLE_DBGUTIL="TRUE"
4287 # this is an extra var so it can have different default on different MSVC
4288 # versions (in case there are version specific problems with it)
4289 MSVC_USE_DEBUG_RUNTIME="TRUE"
4291 AC_MSG_RESULT([yes])
4292 # cppunit and graphite expose STL in public headers
4293 if test "$with_system_cppunit" = "yes"; then
4294 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
4296 with_system_cppunit=no
4298 if test "$with_system_graphite" = "yes"; then
4299 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
4301 with_system_graphite=no
4303 if test "$with_system_orcus" = "yes"; then
4304 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
4306 with_system_orcus=no
4308 if test "$with_system_libcmis" = "yes"; then
4309 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
4311 with_system_libcmis=no
4313 if test "$with_system_hunspell" = "yes"; then
4314 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
4316 with_system_hunspell=no
4318 if test "$with_system_gpgmepp" = "yes"; then
4319 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
4321 with_system_gpgmepp=no
4323 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
4324 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
4325 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
4326 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
4327 # of those two is using the system variant:
4328 if test "$with_system_libnumbertext" = "yes"; then
4329 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
4331 with_system_libnumbertext=no
4333 if test "$with_system_libwps" = "yes"; then
4334 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
4336 with_system_libwps=no
4340 MSVC_USE_DEBUG_RUNTIME=""
4343 AC_SUBST(ENABLE_DBGUTIL)
4344 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
4346 dnl Set the ENABLE_DEBUG variable.
4347 dnl ===================================================================
4348 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
4349 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
4351 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
4352 if test -z "$libo_fuzzed_enable_debug"; then
4353 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
4355 AC_MSG_NOTICE([Resetting --enable-debug=yes])
4360 AC_MSG_CHECKING([whether to do a debug build])
4361 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
4363 if test -n "$ENABLE_DBGUTIL" ; then
4364 AC_MSG_RESULT([yes (dbgutil)])
4366 AC_MSG_RESULT([yes])
4372 AC_SUBST(ENABLE_DEBUG)
4374 dnl ===================================================================
4375 dnl Select the linker to use (gold/lld/ld.bfd).
4376 dnl This is done only after compiler checks (need to know if Clang is
4377 dnl used, for different defaults) and after checking if a debug build
4378 dnl is wanted (non-debug builds get the default linker if not explicitly
4379 dnl specified otherwise).
4380 dnl All checks for linker features/options should come after this.
4381 dnl ===================================================================
4384 use_ld=-fuse-ld=${1%%:*}
4386 if test "$use_ld_path" != "$1"; then
4387 use_ld="$use_ld --ld-path=$use_ld_path"
4389 use_ld_fail_if_error=$2
4391 AC_MSG_CHECKING([for $use_ld linker support])
4392 use_ld_ldflags_save="$LDFLAGS"
4393 LDFLAGS="$LDFLAGS $use_ld"
4394 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4397 printf ("hello world\n");
4398 ])], USE_LD=$use_ld, [])
4399 if test -n "$USE_LD"; then
4400 AC_MSG_RESULT( yes )
4403 if test -n "$use_ld_fail_if_error"; then
4409 if test -n "$use_ld_ok"; then
4410 dnl keep the value of LDFLAGS
4413 LDFLAGS="$use_ld_ldflags_save"
4417 if test "$enable_ld" != "no"; then
4418 if test "$GCC" = "yes"; then
4419 if test -n "$enable_ld"; then
4420 check_use_ld "$enable_ld" fail_if_error
4421 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4422 dnl non-debug builds default to the default linker
4424 elif test -n "$COM_IS_CLANG"; then
4426 if test $? -ne 0; then
4430 # For gcc first try gold, new versions also support lld.
4432 if test $? -ne 0; then
4436 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
4438 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD)')
4439 if test -z "$ld_used"; then
4442 AC_MSG_CHECKING([for linker that is used])
4443 AC_MSG_RESULT([$ld_used])
4444 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4445 if echo "$ld_used" | grep -q "^GNU ld"; then
4446 AC_MSG_WARN([The default GNU linker is slow, consider using the LLD or the GNU gold linker.])
4447 add_warning "The default GNU linker is slow, consider using the LLD or the GNU gold linker."
4451 if test "$enable_ld" = "yes"; then
4452 AC_MSG_ERROR([--enable-ld not supported])
4458 HAVE_LD_BSYMBOLIC_FUNCTIONS=
4459 if test "$GCC" = "yes"; then
4460 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
4461 bsymbolic_functions_ldflags_save=$LDFLAGS
4462 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
4463 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4466 printf ("hello world\n");
4467 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
4468 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
4469 AC_MSG_RESULT( found )
4471 AC_MSG_RESULT( not found )
4473 LDFLAGS=$bsymbolic_functions_ldflags_save
4475 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
4478 if test "$GCC" = "yes"; then
4479 for flag in "--gc-sections" "-dead_strip"; do
4480 AC_MSG_CHECKING([for $flag linker support])
4481 ldflags_save=$LDFLAGS
4482 LDFLAGS="$LDFLAGS -Wl,$flag"
4483 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4486 printf ("hello world\n");
4488 LD_GC_SECTIONS="-Wl,$flag"
4489 AC_MSG_RESULT( found )
4491 AC_MSG_RESULT( not found )
4493 LDFLAGS=$ldflags_save
4494 if test -n "$LD_GC_SECTIONS"; then
4499 AC_SUBST(LD_GC_SECTIONS)
4502 if test "$enable_split_debug" != no; then
4503 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
4504 if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4505 AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
4507 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
4508 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
4510 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
4511 AC_MSG_RESULT([yes])
4513 if test "$enable_split_debug" = yes; then
4520 if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4521 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
4522 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
4525 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
4527 HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=
4528 AC_MSG_CHECKING([whether $CC_BASE supports -Xclang -debug-info-kind=constructor])
4530 CFLAGS="$CFLAGS -Werror -Xclang -debug-info-kind=constructor"
4531 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=TRUE ],[])
4533 if test "$HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR" = "TRUE"; then
4534 AC_MSG_RESULT([yes])
4538 AC_SUBST(HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR)
4541 if test "$enable_gdb_index" != "no"; then
4542 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
4543 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -o -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4544 AC_MSG_CHECKING([whether $CC_BASE supports -ggnu-pubnames])
4546 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
4548 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
4549 if test "$have_ggnu_pubnames" != "TRUE"; then
4550 if test "$enable_gdb_index" = "yes"; then
4551 AC_MSG_ERROR([no, --enable-gdb-index not supported])
4556 AC_MSG_RESULT( yes )
4557 AC_MSG_CHECKING([whether $CC_BASE supports -Wl,--gdb-index])
4558 ldflags_save=$LDFLAGS
4559 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
4560 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4563 printf ("hello world\n");
4564 ])], ENABLE_GDB_INDEX=TRUE, [])
4565 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
4566 AC_MSG_RESULT( yes )
4568 if test "$enable_gdb_index" = "yes"; then
4574 LDFLAGS=$ldflags_save
4578 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4579 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
4580 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
4583 AC_SUBST(ENABLE_GDB_INDEX)
4585 if test -z "$enable_sal_log" && test "$ENABLE_DEBUG" = TRUE; then
4588 if test "$enable_sal_log" = yes; then
4591 AC_SUBST(ENABLE_SAL_LOG)
4593 dnl Check for enable symbols option
4594 dnl ===================================================================
4595 AC_MSG_CHECKING([whether to generate debug information])
4596 if test -z "$enable_symbols"; then
4597 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4603 if test "$enable_symbols" = yes; then
4604 ENABLE_SYMBOLS_FOR=all
4605 AC_MSG_RESULT([yes])
4606 elif test "$enable_symbols" = no; then
4610 # Selective debuginfo.
4611 ENABLE_SYMBOLS_FOR="$enable_symbols"
4612 AC_MSG_RESULT([for "$enable_symbols"])
4614 AC_SUBST(ENABLE_SYMBOLS_FOR)
4616 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
4617 # Building on Android with full symbols: without enough memory the linker never finishes currently.
4618 AC_MSG_CHECKING([whether enough memory is available for linking])
4619 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
4620 # Check for 15GB, as Linux reports a bit less than the physical memory size.
4621 if test -n "$mem_size" -a $mem_size -lt 15728640; then
4622 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
4624 AC_MSG_RESULT([yes])
4629 ENABLE_OPTIMIZED_DEBUG=
4630 AC_MSG_CHECKING([whether to compile with optimization flags])
4631 if test -z "$enable_optimized"; then
4632 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4635 enable_optimized=yes
4638 if test "$enable_optimized" = yes; then
4639 ENABLE_OPTIMIZED=TRUE
4640 AC_MSG_RESULT([yes])
4641 elif test "$enable_optimized" = debug; then
4642 ENABLE_OPTIMIZED_DEBUG=TRUE
4643 AC_MSG_RESULT([yes (debug)])
4645 if test "$GCC" = "yes"; then
4646 AC_MSG_CHECKING([whether $CC_BASE supports -Og])
4648 CFLAGS="$CFLAGS -Werror -Og"
4649 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_OG=TRUE ],[])
4651 if test "$HAVE_GCC_OG" = "TRUE"; then
4652 AC_MSG_RESULT([yes])
4657 if test -z "$HAVE_GCC_OG"; then
4658 AC_MSG_ERROR([The compiler does not support optimizations suitable for debugging.])
4663 AC_SUBST(ENABLE_OPTIMIZED)
4664 AC_SUBST(ENABLE_OPTIMIZED_DEBUG)
4667 # determine CPUNAME, OS, ...
4668 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
4679 PLATFORMID=aix_powerpc
4696 if test "$enable_ios_simulator" = "yes"; then
4701 PLATFORMID=macosx_arm64
4705 if test "$enable_ios_simulator" = "yes"; then
4710 PLATFORMID=macosx_x86_64
4713 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4727 if test "$enable_ios_simulator" = "yes"; then
4728 AC_MSG_ERROR([iOS simulator is only available in macOS not iOS])
4732 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4737 PLATFORMID=ios_arm64
4751 PLATFORMID=dragonfly_x86
4756 PLATFORMID=dragonfly_x86_64
4759 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4774 PLATFORMID=freebsd_aarch64
4780 PLATFORMID=freebsd_x86
4785 PLATFORMID=freebsd_x86_64
4790 PLATFORMID=freebsd_powerpc64
4795 PLATFORMID=freebsd_powerpc
4798 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4815 PLATFORMID=haiku_x86
4820 PLATFORMID=haiku_x86_64
4823 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4840 PLATFORMID=kfreebsd_x86
4845 PLATFORMID=kfreebsd_x86_64
4848 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4864 PLATFORMID=linux_aarch64
4866 EPM_FLAGS="-a arm64"
4871 PLATFORMID=linux_alpha
4877 PLATFORMID=linux_arm_eabi
4881 PLATFORMID=linux_arm_oabi
4889 PLATFORMID=linux_hppa
4894 PLATFORMID=linux_x86
4899 PLATFORMID=linux_ia64
4905 PLATFORMID=linux_mips_eb
4910 EPM_FLAGS="-a mips64"
4911 PLATFORMID=linux_mips64_eb
4916 EPM_FLAGS="-a mips64el"
4917 PLATFORMID=linux_mips64_el
4922 EPM_FLAGS="-a mipsel"
4923 PLATFORMID=linux_mips_el
4928 PLATFORMID=linux_m68k
4933 PLATFORMID=linux_powerpc
4938 PLATFORMID=linux_powerpc64
4942 RTL_ARCH=PowerPC_64_LE
4943 PLATFORMID=linux_powerpc64_le
4948 PLATFORMID=linux_sparc
4953 PLATFORMID=linux_sparc64
4958 PLATFORMID=linux_s390
4963 PLATFORMID=linux_s390x
4968 PLATFORMID=linux_x86_64
4971 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4988 PLATFORMID=android_arm_eabi
4993 PLATFORMID=android_aarch64
4998 PLATFORMID=android_x86
5003 PLATFORMID=android_x86_64
5006 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5022 PLATFORMID=netbsd_x86
5027 PLATFORMID=netbsd_powerpc
5032 PLATFORMID=netbsd_sparc
5037 PLATFORMID=netbsd_x86_64
5040 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5056 PLATFORMID=openbsd_x86
5061 PLATFORMID=openbsd_x86_64
5064 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5067 SOLARINC="$SOLARINC -I/usr/local/include"
5081 PLATFORMID=solaris_x86
5086 PLATFORMID=solaris_sparc
5091 PLATFORMID=solaris_sparc64
5094 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5097 SOLARINC="$SOLARINC -I/usr/local/include"
5101 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
5105 if test "$with_x" = "no"; then
5106 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
5110 if test "$enable_gui" = "no"; then
5111 if test "$USING_X11" != TRUE; then
5112 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
5116 AC_DEFINE(HAVE_FEATURE_UI,0)
5119 AC_SUBST(DISABLE_GUI)
5121 WORKDIR="${BUILDDIR}/workdir"
5122 INSTDIR="${BUILDDIR}/instdir"
5123 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
5124 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
5125 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
5133 AC_SUBST([INSTROOT])
5134 AC_SUBST([INSTROOTBASE])
5138 AC_SUBST(PLATFORMID)
5139 AC_SUBST(WINDOWS_X64)
5140 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
5142 dnl ===================================================================
5143 dnl Test which package format to use
5144 dnl ===================================================================
5145 AC_MSG_CHECKING([which package format to use])
5146 if test -n "$with_package_format" -a "$with_package_format" != no; then
5147 for i in $with_package_format; do
5149 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
5152 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
5153 aix - AIX software distribution
5154 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
5155 deb - Debian software distribution
5156 pkg - Solaris software distribution
5157 rpm - RedHat software distribution
5159 LibreOffice additionally supports:
5160 archive - .tar.gz or .zip
5162 installed - installation tree
5168 # fakeroot is needed to ensure correct file ownerships/permissions
5169 # inside deb packages and tar archives created on Linux and Solaris.
5170 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
5171 AC_PATH_PROG(FAKEROOT, fakeroot, no)
5172 if test "$FAKEROOT" = "no"; then
5174 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
5177 PKGFORMAT="$with_package_format"
5178 AC_MSG_RESULT([$PKGFORMAT])
5181 AC_MSG_RESULT([none])
5185 dnl ===================================================================
5186 dnl Set up a different compiler to produce tools to run on the build
5187 dnl machine when doing cross-compilation
5188 dnl ===================================================================
5190 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
5191 m4_pattern_allow([PKG_CONFIG_LIBDIR])
5192 if test "$cross_compiling" = "yes"; then
5193 AC_MSG_CHECKING([for BUILD platform configuration])
5195 rm -rf CONF-FOR-BUILD config_build.mk
5196 mkdir CONF-FOR-BUILD
5197 # Here must be listed all files needed when running the configure script. In particular, also
5198 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
5199 # keep them in the same order as there.
5200 (cd $SRC_ROOT && tar cf - \
5202 bin/get_config_variables \
5203 solenv/bin/getcompver.awk \
5204 solenv/inc/langlist.mk \
5207 config_host_lang.mk.in \
5209 bin/bffvalidator.sh.in \
5210 bin/odfvalidator.sh.in \
5211 bin/officeotron.sh.in \
5212 hardened_runtime.xcent.in \
5213 instsetoo_native/util/openoffice.lst.in \
5214 setup_native/source/packinfo/finals_instsetoo.txt.in \
5216 sysui/desktop/macosx/Info.plist.in) \
5217 | (cd CONF-FOR-BUILD && tar xf -)
5218 cp configure CONF-FOR-BUILD
5219 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
5221 unset COM USING_X11 OS CPUNAME
5222 unset CC CXX SYSBASE CFLAGS
5223 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
5224 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
5225 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
5226 if test -n "$CC_FOR_BUILD"; then
5227 export CC="$CC_FOR_BUILD"
5228 CC_BASE=`first_arg_basename "$CC"`
5230 if test -n "$CXX_FOR_BUILD"; then
5231 export CXX="$CXX_FOR_BUILD"
5232 CXX_BASE=`first_arg_basename "$CXX"`
5234 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
5238 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
5239 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
5240 test "$with_junit" = "no" && sub_conf_opts="$sub_conf_opts --without-junit"
5241 if test -n "$ENABLE_JAVA"; then
5243 iOS) sub_conf_opts="$sub_conf_opts --without-java" ;; # force it off, like it used to be
5245 # Hack for Android - the build doesn't need a host JDK, so just forward to build for convenience
5246 test -n "$with_jdk_home" && sub_conf_opts="$sub_conf_opts --with-jdk-home=$with_jdk_home"
5249 if test -z "$with_jdk_home"; then
5250 AC_MSG_ERROR([Missing host JDK! This can't be detected for the build OS, so you have to specify it with --with-jdk-home.])
5255 sub_conf_opts="$sub_conf_opts --without-java"
5257 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
5258 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
5259 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
5261 # Don't bother having configure look for stuff not needed for the build platform anyway
5263 --build="$build_alias" \
5265 --disable-firebird-sdbc \
5267 --disable-gstreamer-1-0 \
5269 --disable-mariadb-sdbc \
5270 --disable-online-update \
5272 --disable-pdfimport \
5273 --disable-postgresql-sdbc \
5275 --enable-icecream="$enable_icecream" \
5278 --with-parallelism="$with_parallelism" \
5279 --with-theme="$with_theme" \
5280 --with-tls=openssl \
5283 2>&1 | sed -e 's/^/ /'
5284 test -f ./config_host.mk 2>/dev/null || exit
5286 # filter permitted build targets
5287 PERMITTED_BUILD_TARGETS="
5316 # converts BUILD_TYPE and PERMITTED_BUILD_TARGETS into non-whitespace,
5317 # newlined lists, to use grep as a filter
5318 PERMITTED_BUILD_TARGETS=$(echo "$PERMITTED_BUILD_TARGETS" | sed -e '/^ *$/d' -e 's/ *//')
5319 BUILD_TARGETS="$(sed -n -e '/^export BUILD_TYPE=/ s/.*=//p' config_host.mk | tr ' ' '\n')"
5320 BUILD_TARGETS="$(echo "$BUILD_TARGETS" | grep -F "$PERMITTED_BUILD_TARGETS" | tr '\n' ' ')"
5321 sed -i -e "s/ BUILD_TYPE=.*$/ BUILD_TYPE=$BUILD_TARGETS/" config_host.mk
5323 cp config_host.mk ../config_build.mk
5324 cp config_host_lang.mk ../config_build_lang.mk
5325 mv config.log ../config.Build.log
5326 mkdir -p ../config_build
5327 mv config_host/*.h ../config_build
5329 # all these will get a _FOR_BUILD postfix
5330 DIRECT_FOR_BUILD_SETTINGS="
5340 LIBO_URE_MISC_FOLDER
5346 # these overwrite host config with build config
5347 OVERWRITING_SETTINGS="
5352 JAVA_CLASSPATH_NOT_SET
5360 # these need some special handling
5361 EXTRA_HANDLED_SETTINGS="
5368 . ./bin/get_config_variables $DIRECT_FOR_BUILD_SETTINGS $OVERWRITING_SETTINGS $EXTRA_HANDLED_SETTINGS
5372 line=`echo "LO_PATH_FOR_BUILD='${BUILD_PATH}'" | sed -e 's,/CONF-FOR-BUILD,,g'`
5373 echo "$line" >>build-config
5375 for V in $DIRECT_FOR_BUILD_SETTINGS; do
5377 VV=`eval "echo $VV"`
5378 if test -n "$VV"; then
5379 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
5380 echo "$line" >>build-config
5384 for V in $OVERWRITING_SETTINGS; do
5386 VV=`eval "echo $VV"`
5387 if test -n "$VV"; then
5388 line=${V}='${'${V}:-$VV'}'
5389 echo "$line" >>build-config
5393 for V in INSTDIR INSTROOT WORKDIR; do
5395 VV=`eval "echo $VV"`
5396 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
5397 if test -n "$VV"; then
5398 line="${V}_FOR_BUILD='$VV'"
5399 echo "$line" >>build-config
5404 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
5405 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])
5406 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
5407 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
5409 eval `cat CONF-FOR-BUILD/build-config`
5411 AC_MSG_RESULT([checking for BUILD platform configuration... done])
5413 rm -rf CONF-FOR-BUILD
5417 CXX_FOR_BUILD="$CXX"
5418 INSTDIR_FOR_BUILD="$INSTDIR"
5419 INSTROOT_FOR_BUILD="$INSTROOT"
5420 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
5421 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
5422 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
5423 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
5424 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
5425 WORKDIR_FOR_BUILD="$WORKDIR"
5427 AC_SUBST(OS_FOR_BUILD)
5428 AC_SUBST(INSTDIR_FOR_BUILD)
5429 AC_SUBST(INSTROOT_FOR_BUILD)
5430 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
5431 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
5432 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
5433 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
5434 AC_SUBST(SDKDIRNAME_FOR_BUILD)
5435 AC_SUBST(WORKDIR_FOR_BUILD)
5436 AC_SUBST(CC_FOR_BUILD)
5437 AC_SUBST(CXX_FOR_BUILD)
5439 dnl ===================================================================
5440 dnl Check for syslog header
5441 dnl ===================================================================
5442 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
5444 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
5445 dnl ===================================================================
5446 AC_MSG_CHECKING([whether to turn warnings to errors])
5447 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
5448 ENABLE_WERROR="TRUE"
5449 PYTHONWARNINGS="error"
5450 AC_MSG_RESULT([yes])
5452 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
5453 ENABLE_WERROR="TRUE"
5454 PYTHONWARNINGS="error"
5455 AC_MSG_RESULT([yes])
5460 AC_SUBST(ENABLE_WERROR)
5461 AC_SUBST(PYTHONWARNINGS)
5463 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
5464 dnl ===================================================================
5465 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
5466 if test -z "$enable_assert_always_abort"; then
5467 if test "$ENABLE_DEBUG" = TRUE; then
5468 enable_assert_always_abort=yes
5470 enable_assert_always_abort=no
5473 if test "$enable_assert_always_abort" = "yes"; then
5474 ASSERT_ALWAYS_ABORT="TRUE"
5475 AC_MSG_RESULT([yes])
5477 ASSERT_ALWAYS_ABORT="FALSE"
5480 AC_SUBST(ASSERT_ALWAYS_ABORT)
5482 # Determine whether to use ooenv for the instdir installation
5483 # ===================================================================
5484 if test $_os != "WINNT" -a $_os != "Darwin"; then
5485 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
5486 if test "$enable_ooenv" = "no"; then
5490 AC_MSG_RESULT([yes])
5493 AC_SUBST(ENABLE_OOENV)
5495 if test "$USING_X11" != TRUE; then
5496 # be sure to do not mess with unneeded stuff
5501 build_gstreamer_1_0=no
5505 enable_cairo_canvas=no
5508 if test "$OS" = "HAIKU"; then
5509 enable_cairo_canvas=yes
5513 if test "$test_kf5" = "yes" -a "$enable_kde5" = "yes"; then
5514 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!])
5515 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!"
5519 if test "$test_kf5" = "yes"; then
5523 if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; then
5524 if test "$enable_qt5" = "no"; then
5525 AC_MSG_ERROR([KF5 support depends on QT5, so it conflicts with --disable-qt5])
5531 dnl ===================================================================
5532 dnl check for cups support
5533 dnl ===================================================================
5536 if test "$enable_cups" = "no"; then
5540 AC_MSG_CHECKING([whether to enable CUPS support])
5541 if test "$test_cups" = "yes"; then
5543 AC_MSG_RESULT([yes])
5545 AC_MSG_CHECKING([whether cups support is present])
5546 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
5547 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
5548 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
5549 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
5556 AC_SUBST(ENABLE_CUPS)
5559 if test "$test_fontconfig" = "yes"; then
5560 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
5561 SYSTEM_FONTCONFIG=TRUE
5562 FilterLibs "${FONTCONFIG_LIBS}"
5563 FONTCONFIG_LIBS="${filteredlibs}"
5565 AC_SUBST(FONTCONFIG_CFLAGS)
5566 AC_SUBST(FONTCONFIG_LIBS)
5567 AC_SUBST([SYSTEM_FONTCONFIG])
5569 dnl whether to find & fetch external tarballs?
5570 dnl ===================================================================
5571 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
5572 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5573 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
5575 TARFILE_LOCATION="$LODE_HOME/ext_tar"
5578 if test -z "$TARFILE_LOCATION"; then
5579 if test -d "$SRC_ROOT/src" ; then
5580 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
5581 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
5583 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
5585 AbsolutePath "$TARFILE_LOCATION"
5586 PathFormat "${absolute_path}"
5587 TARFILE_LOCATION="${formatted_path}"
5589 AC_SUBST(TARFILE_LOCATION)
5591 AC_MSG_CHECKING([whether we want to fetch tarballs])
5592 if test "$enable_fetch_external" != "no"; then
5593 if test "$with_all_tarballs" = "yes"; then
5594 AC_MSG_RESULT([yes, all of them])
5595 DO_FETCH_TARBALLS="ALL"
5597 AC_MSG_RESULT([yes, if we use them])
5598 DO_FETCH_TARBALLS="TRUE"
5604 AC_SUBST(DO_FETCH_TARBALLS)
5606 AC_MSG_CHECKING([whether to build help])
5607 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
5608 BUILD_TYPE="$BUILD_TYPE HELP"
5609 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5610 case "$with_help" in
5612 ENABLE_HTMLHELP=TRUE
5613 SCPDEFS="$SCPDEFS -DWITH_HELP"
5614 AC_MSG_RESULT([HTML])
5617 ENABLE_HTMLHELP=TRUE
5619 AC_MSG_RESULT([HTML])
5622 SCPDEFS="$SCPDEFS -DWITH_HELP"
5623 AC_MSG_RESULT([yes])
5626 AC_MSG_ERROR([Unknown --with-help=$with_help])
5632 AC_SUBST([ENABLE_HTMLHELP])
5633 AC_SUBST([HELP_ONLINE])
5635 AC_MSG_CHECKING([whether to enable xapian-omega support for help])
5636 if test -n "$with_omindex" -a "$with_omindex" != "no" -a $_os != iOS -a $_os != Android; then
5637 BUILD_TYPE="$BUILD_TYPE HELP"
5638 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5639 case "$with_omindex" in
5641 ENABLE_HTMLHELP=TRUE
5643 HELP_OMINDEX_PAGE=TRUE
5644 AC_MSG_RESULT([SERVER])
5647 ENABLE_HTMLHELP=TRUE
5649 HELP_OMINDEX_PAGE=FALSE
5650 AC_MSG_RESULT([NOXAP])
5653 AC_MSG_ERROR([Unknown --with-omindex=$with_omindex])
5657 HELP_OMINDEX_PAGE=FALSE
5660 AC_SUBST([ENABLE_HTMLHELP])
5661 AC_SUBST([HELP_OMINDEX_PAGE])
5662 AC_SUBST([HELP_ONLINE])
5665 dnl Test whether to include MySpell dictionaries
5666 dnl ===================================================================
5667 AC_MSG_CHECKING([whether to include MySpell dictionaries])
5668 if test "$with_myspell_dicts" = "yes"; then
5669 AC_MSG_RESULT([yes])
5670 WITH_MYSPELL_DICTS=TRUE
5671 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
5672 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
5677 AC_SUBST(WITH_MYSPELL_DICTS)
5679 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
5680 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
5681 if test "$with_system_dicts" = yes; then
5682 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
5684 with_system_dicts=no
5687 AC_MSG_CHECKING([whether to use dicts from external paths])
5688 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
5689 AC_MSG_RESULT([yes])
5691 AC_MSG_CHECKING([for spelling dictionary directory])
5692 if test -n "$with_external_dict_dir"; then
5693 DICT_SYSTEM_DIR=file://$with_external_dict_dir
5695 DICT_SYSTEM_DIR=file:///usr/share/hunspell
5696 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
5697 DICT_SYSTEM_DIR=file:///usr/share/myspell
5700 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
5701 AC_MSG_CHECKING([for hyphenation patterns directory])
5702 if test -n "$with_external_hyph_dir"; then
5703 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
5705 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
5707 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
5708 AC_MSG_CHECKING([for thesaurus directory])
5709 if test -n "$with_external_thes_dir"; then
5710 THES_SYSTEM_DIR=file://$with_external_thes_dir
5712 THES_SYSTEM_DIR=file:///usr/share/mythes
5714 AC_MSG_RESULT([$THES_SYSTEM_DIR])
5719 AC_SUBST(SYSTEM_DICTS)
5720 AC_SUBST(DICT_SYSTEM_DIR)
5721 AC_SUBST(HYPH_SYSTEM_DIR)
5722 AC_SUBST(THES_SYSTEM_DIR)
5724 dnl ===================================================================
5725 dnl Precompiled headers.
5727 AC_MSG_CHECKING([whether to enable pch feature])
5728 if test -z "$enable_pch"; then
5729 if test "$_os" = "WINNT"; then
5730 # Enabled by default on Windows.
5736 if test "$enable_pch" != "no" -a "$_os" != "WINNT" -a "$GCC" != "yes" ; then
5737 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
5739 if test "$enable_pch" = "system"; then
5741 AC_MSG_RESULT([yes (system headers)])
5742 elif test "$enable_pch" = "base"; then
5744 AC_MSG_RESULT([yes (system and base headers)])
5745 elif test "$enable_pch" = "normal"; then
5747 AC_MSG_RESULT([yes (normal)])
5748 elif test "$enable_pch" = "full"; then
5750 AC_MSG_RESULT([yes (full)])
5751 elif test "$enable_pch" = "yes"; then
5752 # Pick a suitable default.
5753 if test "$GCC" = "yes"; then
5754 # With Clang and GCC higher levels do not seem to make a noticeable improvement,
5755 # while making the PCHs larger and rebuilds more likely.
5757 AC_MSG_RESULT([yes (system and base headers)])
5759 # With MSVC the highest level makes a significant difference,
5760 # and it was the default when there used to be no PCH levels.
5762 AC_MSG_RESULT([yes (full)])
5764 elif test "$enable_pch" = "no"; then
5767 AC_MSG_ERROR([Unknown value for --enable-pch])
5769 AC_SUBST(ENABLE_PCH)
5770 # ccache 3.7.1 and older do not properly detect/handle -include .gch in CCACHE_DEPEND mode
5771 if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_IS_CLANG" != "TRUE"; then
5772 AC_PATH_PROG([CCACHE_BIN],[ccache],[not found])
5773 if test "$CCACHE_BIN" != "not found"; then
5774 AC_MSG_CHECKING([ccache version])
5775 CCACHE_VERSION=`"$CCACHE_BIN" -V | "$AWK" '/^ccache version/{print $3}'`
5776 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5777 AC_MSG_RESULT([$CCACHE_VERSION])
5778 AC_MSG_CHECKING([whether ccache depend mode works properly with GCC PCH])
5779 if test "$CCACHE_NUMVER" -gt "030701"; then
5780 AC_MSG_RESULT([yes])
5782 AC_MSG_RESULT([no (not newer than 3.7.1)])
5788 PCH_INSTANTIATE_TEMPLATES=
5789 if test -n "$ENABLE_PCH"; then
5790 AC_MSG_CHECKING([whether $CC supports -fpch-instantiate-templates])
5792 CFLAGS="$CFLAGS -Werror -fpch-instantiate-templates"
5793 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_INSTANTIATE_TEMPLATES="-fpch-instantiate-templates" ],[])
5795 if test -n "$PCH_INSTANTIATE_TEMPLATES"; then
5801 AC_SUBST(PCH_INSTANTIATE_TEMPLATES)
5803 BUILDING_PCH_WITH_OBJ=
5804 if test -n "$ENABLE_PCH"; then
5805 AC_MSG_CHECKING([whether $CC supports -Xclang -building-pch-with-obj])
5807 CFLAGS="$CFLAGS -Werror -Xclang -building-pch-with-obj"
5808 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ BUILDING_PCH_WITH_OBJ="-Xclang -building-pch-with-obj" ],[])
5810 if test -n "$BUILDING_PCH_WITH_OBJ"; then
5816 AC_SUBST(BUILDING_PCH_WITH_OBJ)
5820 if test -n "$BUILDING_PCH_WITH_OBJ"; then
5821 AC_MSG_CHECKING([whether $CC supports -fpch-codegen])
5823 CFLAGS="$CFLAGS -Werror -fpch-codegen"
5824 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
5826 PCH_CODEGEN="-fpch-codegen"
5827 PCH_NO_CODEGEN="-fno-pch-codegen"
5830 if test -n "$PCH_CODEGEN"; then
5836 AC_SUBST(PCH_CODEGEN)
5837 AC_SUBST(PCH_NO_CODEGEN)
5839 if test -n "$BUILDING_PCH_WITH_OBJ"; then
5840 AC_MSG_CHECKING([whether $CC supports -fpch-debuginfo])
5842 CFLAGS="$CFLAGS -Werror -fpch-debuginfo"
5843 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_DEBUGINFO="-fpch-debuginfo" ],[])
5845 if test -n "$PCH_DEBUGINFO"; then
5851 AC_SUBST(PCH_DEBUGINFO)
5855 AC_MSG_CHECKING([the GNU Make version])
5856 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5857 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5858 if test "$_make_longver" -ge "038200"; then
5859 AC_MSG_RESULT([$GNUMAKE $_make_version])
5861 elif test "$_make_longver" -ge "038100"; then
5862 if test "$build_os" = "cygwin"; then
5863 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
5865 AC_MSG_RESULT([$GNUMAKE $_make_version])
5867 dnl ===================================================================
5868 dnl Search all the common names for sha1sum
5869 dnl ===================================================================
5870 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
5871 if test -z "$SHA1SUM"; then
5872 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
5873 elif test "$SHA1SUM" = "openssl"; then
5874 SHA1SUM="openssl sha1"
5876 AC_MSG_CHECKING([for GNU Make bug 20033])
5877 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
5878 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
5879 A := \$(wildcard *.a)
5883 <TAB>@echo survived bug20033.
5887 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5900 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5901 <TAB>\$(call d1,\$(CHECKSUM)),\
5902 <TAB>\$(call d2,\$(CHECKSUM)))
5904 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5905 no_parallelism_make="YES"
5906 AC_MSG_RESULT([yes, disable parallelism])
5908 AC_MSG_RESULT([no, keep parallelism enabled])
5910 rm -rf $TESTGMAKEBUG20033
5912 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5915 # find if gnumake support file function
5916 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5917 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5918 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5919 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5921 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5922 \$(file >test.txt,Success )
5929 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5930 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5931 HAVE_GNUMAKE_FILE_FUNC=TRUE
5932 AC_MSG_RESULT([yes])
5936 rm -rf $TESTGMAKEFILEFUNC
5937 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5939 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5941 if test "$_make_ver_check" = ""; then
5945 HAVE_LD_HASH_STYLE=FALSE
5946 WITH_LINKER_HASH_STYLE=
5947 AC_MSG_CHECKING([for --hash-style gcc linker support])
5948 if test "$GCC" = "yes"; then
5949 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5950 hash_styles="gnu sysv"
5951 elif test "$with_linker_hash_style" = "no"; then
5954 hash_styles="$with_linker_hash_style"
5957 for hash_style in $hash_styles; do
5958 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5959 hash_style_ldflags_save=$LDFLAGS
5960 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5962 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5969 HAVE_LD_HASH_STYLE=TRUE
5970 WITH_LINKER_HASH_STYLE=$hash_style
5972 [HAVE_LD_HASH_STYLE=FALSE],
5973 [HAVE_LD_HASH_STYLE=FALSE])
5974 LDFLAGS=$hash_style_ldflags_save
5977 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5978 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5982 LDFLAGS=$hash_style_ldflags_save
5986 AC_SUBST(HAVE_LD_HASH_STYLE)
5987 AC_SUBST(WITH_LINKER_HASH_STYLE)
5989 dnl ===================================================================
5990 dnl Check whether there's a Perl version available.
5991 dnl ===================================================================
5992 if test -z "$with_perl_home"; then
5993 AC_PATH_PROG(PERL, perl)
5995 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5996 _perl_path="$with_perl_home/bin/perl"
5997 if test -x "$_perl_path"; then
6000 AC_MSG_ERROR([$_perl_path not found])
6004 dnl ===================================================================
6005 dnl Testing for Perl version 5 or greater.
6006 dnl $] is the Perl version variable, it is returned as an integer
6007 dnl ===================================================================
6008 if test "$PERL"; then
6009 AC_MSG_CHECKING([the Perl version])
6010 ${PERL} -e "exit($]);"
6012 if test "$_perl_version" -lt 5; then
6013 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
6015 AC_MSG_RESULT([Perl $_perl_version])
6017 AC_MSG_ERROR([Perl not found, install Perl 5])
6020 dnl ===================================================================
6021 dnl Testing for required Perl modules
6022 dnl ===================================================================
6024 AC_MSG_CHECKING([for required Perl modules])
6025 perl_use_string="use Cwd ; use Digest::MD5"
6026 if test "$_os" = "WINNT"; then
6027 if test -n "$PKGFORMAT"; then
6028 for i in $PKGFORMAT; do
6031 # for getting fonts versions to use in MSI
6032 perl_use_string="$perl_use_string ; use Font::TTF::Font"
6038 if test "$with_system_hsqldb" = "yes"; then
6039 perl_use_string="$perl_use_string ; use Archive::Zip"
6041 if test "$enable_openssl" = "yes" -a "$with_system_openssl" != "yes"; then
6042 # OpenSSL needs that to build
6043 perl_use_string="$perl_use_string ; use FindBin"
6045 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
6046 AC_MSG_RESULT([all modules found])
6048 AC_MSG_RESULT([failed to find some modules])
6049 # Find out which modules are missing.
6050 for i in $perl_use_string; do
6051 if test "$i" != "use" -a "$i" != ";"; then
6052 if ! $PERL -e "use $i;">/dev/null 2>&1; then
6053 missing_perl_modules="$missing_perl_modules $i"
6058 The missing Perl modules are: $missing_perl_modules
6059 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
6062 dnl ===================================================================
6063 dnl Check for pkg-config
6064 dnl ===================================================================
6065 if test "$_os" != "WINNT"; then
6069 if test "$_os" != "WINNT"; then
6071 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
6072 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
6073 # explicitly. Or put /path/to/compiler in PATH yourself.
6075 # Use wrappers for LTO
6076 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
6077 AC_CHECK_TOOL(AR,gcc-ar)
6078 AC_CHECK_TOOL(NM,gcc-nm)
6079 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
6081 AC_CHECK_TOOL(AR,ar)
6082 AC_CHECK_TOOL(NM,nm)
6083 AC_CHECK_TOOL(RANLIB,ranlib)
6085 AC_CHECK_TOOL(OBJDUMP,objdump)
6086 AC_CHECK_TOOL(READELF,readelf)
6087 AC_CHECK_TOOL(STRIP,strip)
6088 if test "$_os" = "WINNT"; then
6089 AC_CHECK_TOOL(DLLTOOL,dlltool)
6090 AC_CHECK_TOOL(WINDRES,windres)
6097 AC_SUBST(PKG_CONFIG)
6103 dnl ===================================================================
6104 dnl pkg-config checks on macOS
6105 dnl ===================================================================
6107 if test $_os = Darwin; then
6108 AC_MSG_CHECKING([for bogus pkg-config])
6109 if test -n "$PKG_CONFIG"; then
6110 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
6111 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
6113 if test "$enable_bogus_pkg_config" = "yes"; then
6114 AC_MSG_RESULT([yes, user-approved from unknown origin.])
6116 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.])
6120 AC_MSG_RESULT([no, good])
6126 # Return value: $csctest
6130 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
6131 if test -n "$regvalue"; then
6139 # Return value: $altest
6143 # We need this check to detect 4.6.1 or above.
6144 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
6145 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
6146 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
6152 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
6153 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
6154 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
6165 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
6166 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
6167 if test -n "$regvalue"; then
6174 find_winsdk_version()
6176 # Args: $1 : SDK version as in "8.0", "8.1A" etc
6177 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
6179 unset winsdktest winsdkbinsubdir winsdklibsubdir
6183 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
6184 if test -n "$regvalue"; then
6185 winsdktest=$regvalue
6186 winsdklibsubdir=win8
6191 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
6192 if test -n "$regvalue"; then
6193 winsdktest=$regvalue
6194 winsdklibsubdir=winv6.3
6199 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
6200 if test -n "$regvalue"; then
6201 winsdktest=$regvalue
6202 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
6203 if test -n "$regvalue"; then
6204 winsdkbinsubdir="$regvalue".0
6205 winsdklibsubdir=$winsdkbinsubdir
6206 local tmppath="$winsdktest\\Include\\$winsdklibsubdir"
6207 local tmppath_unix=$(cygpath -u "$tmppath")
6208 # test exist the SDK path
6209 if test -d "$tmppath_unix"; then
6210 # when path is convertible to a short path then path is okay
6211 cygpath -d "$tmppath" >/dev/null 2>&1
6212 if test $? -ne 0; then
6213 AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
6216 AC_MSG_ERROR([The Windows SDK not found, check the installation])
6227 # Return value: From find_winsdk_version
6231 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
6232 find_winsdk_version $ver
6233 if test -n "$winsdktest"; then
6241 # Return value: $msmdir
6243 AC_MSG_CHECKING([for MSVC merge modules directory])
6244 local my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
6249 my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm ${my_msm_files}"
6252 for f in $my_msm_files; do
6253 echo "$as_me:$LINENO: searching for $f" >&5
6257 for ver in 14.0 15.0; do
6258 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
6259 if test -n "$regvalue"; then
6260 for f in ${my_msm_files}; do
6261 if test -e "$regvalue/${f}"; then
6268 dnl Is the following fallback really necessary, or was it added in response
6269 dnl to never having started Visual Studio on a given machine, so the
6270 dnl registry keys checked above had presumably not yet been created?
6271 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
6272 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
6273 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
6274 dnl expanding to "C:\Program Files\Common Files"), which would need
6275 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
6276 dnl obtain its value from cygwin:
6277 if test -z "$msmdir"; then
6278 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
6279 for f in ${my_msm_files}; do
6280 if test -e "$my_msm_dir/${f}"; then
6286 dnl Starting from MSVC 15.0, merge modules are located in different directory
6289 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
6290 echo "$as_me:$LINENO: looking in $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])" >&5
6291 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
6292 for f in ${my_msm_files}; do
6293 if test -e "$my_msm_dir/${f}"; then
6302 if test -n "$msmdir"; then
6303 msmdir=`cygpath -m "$msmdir"`
6304 AC_MSG_RESULT([$msmdir])
6306 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
6307 AC_MSG_FAILURE([not found])
6309 AC_MSG_WARN([not found (check config.log)])
6310 add_warning "MSM none of ${my_msm_files} found"
6315 find_msvc_x64_dlls()
6317 # Return value: $msvcdllpath, $msvcdlls
6319 AC_MSG_CHECKING([for MSVC x64 DLL path])
6320 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
6323 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
6324 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT" >&5
6325 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
6326 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
6329 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT" >&5
6330 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"; then
6331 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"
6337 AC_MSG_RESULT([$msvcdllpath])
6338 AC_MSG_CHECKING([for MSVC x64 DLLs])
6339 msvcdlls="msvcp140.dll vcruntime140.dll"
6340 for dll in $msvcdlls; do
6341 if ! test -f "$msvcdllpath/$dll"; then
6342 AC_MSG_FAILURE([missing $dll])
6345 AC_MSG_RESULT([found all ($msvcdlls)])
6348 dnl =========================================
6349 dnl Check for the Windows SDK.
6350 dnl =========================================
6351 if test "$_os" = "WINNT"; then
6352 AC_MSG_CHECKING([for Windows SDK])
6353 if test "$build_os" = "cygwin" -o "$build_os" = "wsl"; then
6355 WINDOWS_SDK_HOME=$winsdktest
6357 # normalize if found
6358 if test -n "$WINDOWS_SDK_HOME"; then
6359 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
6360 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
6363 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
6366 if test -n "$WINDOWS_SDK_HOME"; then
6367 # Remove a possible trailing backslash
6368 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
6370 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
6371 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
6372 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
6373 have_windows_sdk_headers=yes
6374 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
6375 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
6376 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
6377 have_windows_sdk_headers=yes
6378 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
6379 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
6380 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
6381 have_windows_sdk_headers=yes
6383 have_windows_sdk_headers=no
6386 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
6387 have_windows_sdk_libs=yes
6388 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/user32.lib"; then
6389 have_windows_sdk_libs=yes
6391 have_windows_sdk_libs=no
6394 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
6395 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
6396 the Windows SDK are installed.])
6400 if test -z "$WINDOWS_SDK_HOME"; then
6401 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
6402 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
6403 WINDOWS_SDK_VERSION=80
6404 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
6405 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
6406 WINDOWS_SDK_VERSION=81
6407 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
6408 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
6409 WINDOWS_SDK_VERSION=10
6410 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
6412 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
6414 PathFormat "$WINDOWS_SDK_HOME"
6415 WINDOWS_SDK_HOME="$formatted_path"
6416 WINDOWS_SDK_HOME_unix="$formatted_path_unix"
6417 if test "$build_os" = "cygwin" -o "$build_os" = "wsl"; then
6418 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
6419 if test -d "$WINDOWS_SDK_HOME/include/um"; then
6420 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
6421 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
6422 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
6426 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
6427 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
6428 dnl but not in v8.0), so allow this to be overridden with a
6429 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
6430 dnl and configuration error if no WiLangId.vbs is found would arguably be
6431 dnl better, but I do not know under which conditions exactly it is needed by
6433 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
6434 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
6435 WINDOWS_SDK_WILANGID_unix=$(cygpath -u "$WINDOWS_SDK_WILANGID")
6436 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6437 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WIN_BUILD_ARCH}/WiLangId.vbs"
6438 WINDOWS_SDK_WILANGID_unix=$(cygpath -u "$WINDOWS_SDK_WILANGID")
6440 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6441 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WIN_BUILD_ARCH/WiLangId.vbs
6442 WINDOWS_SDK_WILANGID_unix=$(cygpath -u "$WINDOWS_SDK_WILANGID")
6444 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6445 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WIN_BUILD_ARCH/WiLangId.vbs")
6446 WINDOWS_SDK_WILANGID_unix=$(cygpath -u "$WINDOWS_SDK_WILANGID")
6449 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
6450 if test -n "$with_package_format" -a "$with_package_format" != no; then
6451 for i in "$with_package_format"; do
6452 if test "$i" = "msi"; then
6453 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6454 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
6461 AC_SUBST(WINDOWS_SDK_HOME)
6462 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
6463 AC_SUBST(WINDOWS_SDK_VERSION)
6464 AC_SUBST(WINDOWS_SDK_WILANGID)
6466 if test "$build_os" = "cygwin"; then
6467 dnl Check midl.exe; this being the first check for a tool in the SDK bin
6468 dnl dir, it also determines that dir's path w/o an arch segment if any,
6469 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
6470 AC_MSG_CHECKING([for midl.exe])
6473 if test -n "$winsdkbinsubdir" \
6474 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/midl.exe"
6476 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH
6477 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
6478 elif test -f "$winsdktest/Bin/$WIN_BUILD_ARCH/midl.exe"; then
6479 MIDL_PATH=$winsdktest/Bin/$WIN_BUILD_ARCH
6480 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
6481 elif test -f "$winsdktest/Bin/midl.exe"; then
6482 MIDL_PATH=$winsdktest/Bin
6483 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
6485 if test ! -f "$MIDL_PATH/midl.exe"; then
6486 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WIN_BUILD_ARCH, Windows SDK installation broken?])
6488 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
6491 # Convert to posix path with 8.3 filename restrictions ( No spaces )
6492 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
6494 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
6495 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
6496 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
6497 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
6498 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
6499 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
6500 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
6501 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
6502 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
6503 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
6504 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
6505 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
6507 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
6511 AC_MSG_CHECKING([for csc.exe])
6513 if test -f "$csctest/csc.exe"; then
6516 if test ! -f "$CSC_PATH/csc.exe"; then
6517 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
6519 AC_MSG_RESULT([$CSC_PATH/csc.exe])
6522 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
6525 AC_MSG_CHECKING([for al.exe])
6527 if test -n "$winsdkbinsubdir" \
6528 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/al.exe"
6530 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH"
6531 elif test -f "$winsdktest/Bin/$WIN_BUILD_ARCH/al.exe"; then
6532 AL_PATH="$winsdktest/Bin/$WIN_BUILD_ARCH"
6533 elif test -f "$winsdktest/Bin/al.exe"; then
6534 AL_PATH="$winsdktest/Bin"
6537 if test -z "$AL_PATH"; then
6539 if test -f "$altest/bin/al.exe"; then
6540 AL_PATH="$altest/bin"
6541 elif test -f "$altest/al.exe"; then
6545 if test ! -f "$AL_PATH/al.exe"; then
6546 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
6548 AC_MSG_RESULT([$AL_PATH/al.exe])
6551 AL_PATH=`win_short_path_for_make "$AL_PATH"`
6553 dnl Check mscoree.lib / .NET Framework dir
6554 AC_MSG_CHECKING(.NET Framework)
6556 PathFormat "$frametest"
6557 frametest="$formatted_path"
6558 if test -f "$frametest/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
6559 DOTNET_FRAMEWORK_HOME="$frametest"
6562 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib"; then
6563 DOTNET_FRAMEWORK_HOME="$winsdktest"
6566 if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
6567 AC_MSG_ERROR([mscoree.lib not found])
6569 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
6571 PathFormat "$MIDL_PATH"
6572 MIDL_PATH="$formatted_path"
6574 PathFormat "$AL_PATH"
6575 AL_PATH="$formatted_path"
6577 PathFormat "$DOTNET_FRAMEWORK_HOME"
6578 DOTNET_FRAMEWORK_HOME="$formatted_path"
6580 PathFormat "$CSC_PATH"
6581 CSC_PATH="$formatted_path"
6584 dnl ===================================================================
6585 dnl Testing for C++ compiler and version...
6586 dnl ===================================================================
6588 if test "$_os" != "WINNT"; then
6589 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
6590 save_CXXFLAGS=$CXXFLAGS
6592 CXXFLAGS=$save_CXXFLAGS
6593 if test -z "$CXX_BASE"; then
6594 CXX_BASE=`first_arg_basename "$CXX"`
6598 dnl check for GNU C++ compiler version
6599 if test "$GXX" = "yes" -a -z "$COM_IS_CLANG"; then
6600 AC_MSG_CHECKING([the GNU C++ compiler version])
6602 _gpp_version=`$CXX -dumpversion`
6603 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
6605 if test "$_gpp_majmin" -lt "700"; then
6606 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 7.0 to build LibreOffice, you have $_gpp_version.])
6608 AC_MSG_RESULT([ok (g++ $_gpp_version)])
6611 dnl see https://code.google.com/p/android/issues/detail?id=41770
6615 AC_MSG_CHECKING([whether $CXX_BASE is broken with boost.thread])
6616 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
6617 #include <bits/c++config.h>]],[[
6618 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
6619 && !defined(_GLIBCXX__PTHREADS) \
6620 && !defined(_GLIBCXX_HAS_GTHREADS)
6623 ]])],[AC_MSG_RESULT([yes])
6624 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
6626 if test $glibcxx_threads = yes; then
6627 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
6630 AC_SUBST(BOOST_CXXFLAGS)
6633 # prefx CXX with ccache if needed
6635 if test "$CCACHE" != ""; then
6636 AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
6638 save_CXXFLAGS=$CXXFLAGS
6639 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
6640 dnl an empty program will do, we're checking the compiler flags
6641 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
6642 [use_ccache=yes], [use_ccache=no])
6643 if test $use_ccache = yes; then
6644 AC_MSG_RESULT([yes])
6647 CXX_BASE="ccache $CXX_BASE"
6650 CXXFLAGS=$save_CXXFLAGS
6654 dnl ===================================================================
6655 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
6656 dnl ===================================================================
6658 if test "$_os" != "WINNT"; then
6661 dnl Check whether there's a C pre-processor.
6666 dnl ===================================================================
6667 dnl Find integral type sizes and alignments
6668 dnl ===================================================================
6670 if test "$_os" != "WINNT"; then
6672 AC_CHECK_SIZEOF(long)
6673 AC_CHECK_SIZEOF(short)
6674 AC_CHECK_SIZEOF(int)
6675 AC_CHECK_SIZEOF(long long)
6676 AC_CHECK_SIZEOF(double)
6677 AC_CHECK_SIZEOF(void*)
6679 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
6680 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
6681 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
6682 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
6683 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
6685 dnl Allow build without AC_CHECK_ALIGNOF, grrr
6686 m4_pattern_allow([AC_CHECK_ALIGNOF])
6687 m4_ifdef([AC_CHECK_ALIGNOF],
6689 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
6690 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
6691 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
6692 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
6695 case "$_os-$host_cpu" in
6697 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6698 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6699 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
6700 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
6703 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6704 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6705 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
6706 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
6709 if test -z "$ac_cv_alignof_short" -o \
6710 -z "$ac_cv_alignof_int" -o \
6711 -z "$ac_cv_alignof_long" -o \
6712 -z "$ac_cv_alignof_double"; then
6713 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.])
6719 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
6720 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
6721 if test $ac_cv_sizeof_long -eq 8; then
6722 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
6723 elif test $ac_cv_sizeof_double -eq 8; then
6724 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
6726 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
6729 dnl Check for large file support
6731 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
6732 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
6734 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
6735 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
6739 SAL_TYPES_SIZEOFSHORT=2
6740 SAL_TYPES_SIZEOFINT=4
6741 SAL_TYPES_SIZEOFLONG=4
6742 SAL_TYPES_SIZEOFLONGLONG=8
6743 if test $WIN_HOST_BITS -eq 32; then
6744 SAL_TYPES_SIZEOFPOINTER=4
6746 SAL_TYPES_SIZEOFPOINTER=8
6748 SAL_TYPES_ALIGNMENT2=2
6749 SAL_TYPES_ALIGNMENT4=4
6750 SAL_TYPES_ALIGNMENT8=8
6753 AC_SUBST(LFS_CFLAGS)
6755 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
6756 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
6757 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
6758 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
6759 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
6760 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
6761 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
6762 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
6764 dnl ===================================================================
6765 dnl Check whether to enable runtime optimizations
6766 dnl ===================================================================
6767 ENABLE_RUNTIME_OPTIMIZATIONS=
6768 AC_MSG_CHECKING([whether to enable runtime optimizations])
6769 if test -z "$enable_runtime_optimizations"; then
6773 enable_runtime_optimizations=no
6779 if test "$enable_runtime_optimizations" != no; then
6780 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
6781 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
6782 AC_MSG_RESULT([yes])
6786 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
6788 dnl ===================================================================
6789 dnl Check if valgrind headers are available
6790 dnl ===================================================================
6792 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
6793 prev_cppflags=$CPPFLAGS
6794 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
6795 # or where does it come from?
6796 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
6797 AC_CHECK_HEADER([valgrind/valgrind.h],
6798 [ENABLE_VALGRIND=TRUE])
6799 CPPFLAGS=$prev_cppflags
6801 AC_SUBST([ENABLE_VALGRIND])
6802 if test -z "$ENABLE_VALGRIND"; then
6803 if test "$with_valgrind" = yes; then
6804 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
6808 AC_SUBST([VALGRIND_CFLAGS])
6811 dnl ===================================================================
6812 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
6813 dnl ===================================================================
6815 # We need at least the sys/sdt.h include header.
6816 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
6817 if test "$SDT_H_FOUND" = "TRUE"; then
6818 # Found sys/sdt.h header, now make sure the c++ compiler works.
6819 # Old g++ versions had problems with probes in constructors/destructors.
6820 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
6822 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6823 #include <sys/sdt.h>
6831 ProbeClass(int& v, const char *n) : ref(v), name(n)
6833 DTRACE_PROBE2(_test_, cons, name, ref);
6836 void method(int min)
6838 DTRACE_PROBE3(_test_, meth, name, ref, min);
6844 DTRACE_PROBE2(_test_, dest, name, ref);
6849 DTRACE_PROBE1(_test_, call, i);
6850 ProbeClass inst = ProbeClass(i, "call");
6852 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
6853 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
6856 AC_CONFIG_HEADERS([config_host/config_probes.h])
6858 dnl ===================================================================
6860 dnl ===================================================================
6861 HAVE_GCC_STACK_CLASH_PROTECTION=
6862 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6863 AC_MSG_CHECKING([whether $CC_BASE supports -fstack-clash-protection])
6865 CFLAGS="$CFLAGS -Werror -fstack-clash-protection"
6867 [AC_LANG_PROGRAM(, [[return 0;]])],
6868 [AC_MSG_RESULT([yes]); HAVE_GCC_STACK_CLASH_PROTECTION=TRUE],
6869 [AC_MSG_RESULT([no])])
6872 AC_MSG_CHECKING([whether $CC_BASE supports -mno-avx])
6874 CFLAGS="$CFLAGS -Werror -mno-avx"
6875 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
6877 if test "$HAVE_GCC_AVX" = "TRUE"; then
6878 AC_MSG_RESULT([yes])
6883 AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
6884 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6886 if (__sync_add_and_fetch(&v, 1) != 1 ||
6887 __sync_sub_and_fetch(&v, 1) != 0)
6889 __sync_synchronize();
6890 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6894 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6895 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6896 AC_MSG_RESULT([yes])
6897 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6902 AC_MSG_CHECKING([whether $CXX_BASE defines __base_class_type_info in cxxabi.h])
6904 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6907 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
6909 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
6910 AC_MSG_RESULT([yes])
6911 ], [AC_MSG_RESULT([no])])
6914 AC_MSG_CHECKING([whether $CXX_BASE defines __class_type_info in cxxabi.h])
6916 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6919 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
6921 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
6922 AC_MSG_RESULT([yes])
6923 ], [AC_MSG_RESULT([no])])
6926 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_allocate_exception in cxxabi.h])
6928 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6930 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6932 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6933 AC_MSG_RESULT([yes])
6934 ], [AC_MSG_RESULT([no])])
6937 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_eh_globals in cxxabi.h])
6939 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6942 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6944 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6945 AC_MSG_RESULT([yes])
6946 ], [AC_MSG_RESULT([no])])
6949 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exception in cxxabi.h])
6951 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6954 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exception); }
6956 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTION],[1])
6957 AC_MSG_RESULT([yes])
6958 ], [AC_MSG_RESULT([no])])
6961 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_get_globals in cxxabi.h])
6963 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6965 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6967 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6968 AC_MSG_RESULT([yes])
6969 ], [AC_MSG_RESULT([no])])
6972 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_current_exception_type in cxxabi.h])
6974 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6976 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6978 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6979 AC_MSG_RESULT([yes])
6980 ], [AC_MSG_RESULT([no])])
6983 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_throw in cxxabi.h])
6985 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6987 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6989 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6990 AC_MSG_RESULT([yes])
6991 ], [AC_MSG_RESULT([no])])
6994 AC_MSG_CHECKING([whether $CXX_BASE defines __si_class_type_info in cxxabi.h])
6996 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6999 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
7001 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
7002 AC_MSG_RESULT([yes])
7003 ], [AC_MSG_RESULT([no])])
7006 AC_MSG_CHECKING([whether $CXX_BASE defines __vmi_class_type_info in cxxabi.h])
7008 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7011 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
7013 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
7014 AC_MSG_RESULT([yes])
7015 ], [AC_MSG_RESULT([no])])
7019 AC_SUBST(HAVE_GCC_AVX)
7020 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
7021 AC_SUBST(HAVE_GCC_STACK_CLASH_PROTECTION)
7023 dnl ===================================================================
7024 dnl Identify the C++ library
7025 dnl ===================================================================
7027 AC_MSG_CHECKING([what the C++ library is])
7029 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7035 [CPP_LIBRARY=GLIBCXX
7036 cpp_library_name="GNU libstdc++"
7038 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7040 #ifndef _LIBCPP_VERSION
7045 cpp_library_name="LLVM libc++"
7046 AC_DEFINE([HAVE_LIBCXX])
7048 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7055 cpp_library_name="Microsoft"
7057 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
7058 AC_MSG_RESULT([$cpp_library_name])
7061 dnl ===================================================================
7063 dnl ===================================================================
7064 AC_PATH_PROG(GPERF, gperf)
7065 if test -z "$GPERF"; then
7066 AC_MSG_ERROR([gperf not found but needed. Install it.])
7068 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
7069 GPERF=`cygpath -m $GPERF`
7071 AC_MSG_CHECKING([whether gperf is new enough])
7072 my_gperf_ver1=$($GPERF --version | head -n 1)
7073 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
7074 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
7075 if test "$my_gperf_ver3" -ge 301; then
7076 AC_MSG_RESULT([yes ($my_gperf_ver2)])
7078 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
7082 dnl ===================================================================
7083 dnl Check for system libcmis
7084 dnl ===================================================================
7085 # libcmis requires curl and we can't build curl for iOS
7086 if test $_os != iOS; then
7087 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2])
7092 AC_SUBST(ENABLE_LIBCMIS)
7094 dnl ===================================================================
7096 dnl ===================================================================
7098 AC_MSG_CHECKING([whether $CXX_BASE supports C++17])
7100 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
7101 if test "$with_latest_c__" = yes; then
7102 CXXFLAGS_CXX11=-std:c++latest
7104 CXXFLAGS_CXX11=-std:c++17
7106 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -Zc:__cplusplus"
7107 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
7108 my_flags='-std=c++17 -std=c++1z'
7109 if test "$with_latest_c__" = yes; then
7110 my_flags="-std=c++20 -std=c++2a $my_flags"
7112 for flag in $my_flags; do
7113 if test "$COM" = MSC; then
7114 flag="-Xclang $flag"
7116 save_CXXFLAGS=$CXXFLAGS
7117 CXXFLAGS="$CXXFLAGS $flag -Werror"
7118 if test "$SYSTEM_LIBCMIS" = TRUE; then
7119 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
7122 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7123 #include <algorithm>
7124 #include <functional>
7127 #if defined SYSTEM_LIBCMIS
7128 // See ucb/source/ucp/cmis/auth_provider.hxx:
7129 #if !defined __clang__
7130 #pragma GCC diagnostic push
7131 #pragma GCC diagnostic ignored "-Wdeprecated"
7132 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
7134 #include <libcmis/libcmis.hxx>
7135 #if !defined __clang__
7136 #pragma GCC diagnostic pop
7140 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
7141 std::sort(v.begin(), v.end(), fn);
7143 ]])],[CXXFLAGS_CXX11=$flag])
7145 CXXFLAGS=$save_CXXFLAGS
7146 if test -n "$CXXFLAGS_CXX11"; then
7151 if test -n "$CXXFLAGS_CXX11"; then
7152 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
7156 AC_SUBST(CXXFLAGS_CXX11)
7158 if test "$GCC" = "yes"; then
7159 save_CXXFLAGS=$CXXFLAGS
7160 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7162 CXXFLAGS=$save_CXXFLAGS
7163 AC_SUBST(ATOMIC_LIB)
7166 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
7167 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
7168 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
7169 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
7170 dnl again towards 4.7.2:
7171 if test $CPP_LIBRARY = GLIBCXX; then
7172 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
7174 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7176 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
7177 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
7178 // GCC 4.7.0: 20120322
7179 // GCC 4.7.1: 20120614
7180 // and using a range check is not possible as the mapping between
7181 // __GLIBCXX__ values and GCC versions is not monotonic
7186 ]])], [AC_MSG_RESULT(no, ok)],
7187 [AC_MSG_ERROR(yes)])
7191 AC_MSG_CHECKING([whether $CXX_BASE supports C++11 without Language Defect 757])
7192 save_CXXFLAGS=$CXXFLAGS
7193 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7199 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
7215 a thinga[]={{0,0}, {1,1}};
7216 b thingb[]={{0,0}, {1,1}};
7217 size_t i = sizeof(sal_n_array_size(thinga));
7218 size_t j = sizeof(sal_n_array_size(thingb));
7219 return !(i != 0 && j != 0);
7221 ], [ AC_MSG_RESULT(yes) ],
7222 [ AC_MSG_ERROR(no)])
7224 CXXFLAGS=$save_CXXFLAGS
7226 HAVE_GCC_FNO_SIZED_DEALLOCATION=
7227 if test "$GCC" = yes; then
7228 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
7230 save_CXXFLAGS=$CXXFLAGS
7231 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
7232 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
7233 CXXFLAGS=$save_CXXFLAGS
7235 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
7236 AC_MSG_RESULT([yes])
7241 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
7243 AC_MSG_CHECKING([whether $CXX_BASE supports a working C++20 consteval])
7244 dnl ...that does not suffer from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994> "Missing code
7245 dnl from consteval constructor initializing const variable":
7247 save_CXXFLAGS=$CXXFLAGS
7248 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7249 AC_RUN_IFELSE([AC_LANG_PROGRAM([
7251 consteval S() { i = 1; }
7256 return (s.i == 1) ? 0 : 1;
7258 AC_DEFINE([HAVE_CPP_CONSTEVAL],[1])
7259 AC_MSG_RESULT([yes])
7260 ], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([assumed no (cross compiling)])])
7261 CXXFLAGS=$save_CXXFLAGS
7264 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a constinit sorted vectors])
7266 save_CXXFLAGS=$CXXFLAGS
7267 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7268 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7269 #include <algorithm>
7270 #include <initializer_list>
7272 template<typename T> class S {
7276 constexpr S(std::initializer_list<T> i): v_(i) { std::sort(v_.begin(), v_.end()); }
7278 constinit S<int> s{3, 2, 1};
7280 AC_DEFINE([HAVE_CPP_CONSTINIT_SORTED_VECTOR],[1])
7281 AC_MSG_RESULT([yes])
7282 ], [AC_MSG_RESULT([no])])
7283 CXXFLAGS=$save_CXXFLAGS
7286 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a <span> with unsigned size_type])
7288 save_CXXFLAGS=$CXXFLAGS
7289 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7290 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7292 #include <type_traits>
7293 // Don't check size_type directly, as it was called index_type before P1872R0:
7294 void f(std::span<int> s) { static_assert(std::is_unsigned_v<decltype(s.size())>); };
7296 AC_DEFINE([HAVE_CPP_SPAN],[1])
7297 AC_MSG_RESULT([yes])
7298 ], [AC_MSG_RESULT([no])])
7299 CXXFLAGS=$save_CXXFLAGS
7302 AC_MSG_CHECKING([whether $CXX_BASE implements C++ DR P1155R3])
7304 save_CXXFLAGS=$CXXFLAGS
7305 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7306 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7307 struct S1 { S1(S1 &&); };
7309 S1 f(S2 s) { return s; }
7311 AC_DEFINE([HAVE_P1155R3],[1])
7312 AC_MSG_RESULT([yes])
7313 ], [AC_MSG_RESULT([no])])
7314 CXXFLAGS=$save_CXXFLAGS
7317 dnl Supported since GCC 9 and Clang 10 (which each also started to support -Wdeprecated-copy, but
7318 dnl which is included in -Wextra anyway):
7319 HAVE_WDEPRECATED_COPY_DTOR=
7320 if test "$GCC" = yes; then
7321 AC_MSG_CHECKING([whether $CXX_BASE supports -Wdeprecated-copy-dtor])
7323 save_CXXFLAGS=$CXXFLAGS
7324 CXXFLAGS="$CXXFLAGS -Werror -Wdeprecated-copy-dtor"
7325 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
7326 HAVE_WDEPRECATED_COPY_DTOR=TRUE
7327 AC_MSG_RESULT([yes])
7328 ], [AC_MSG_RESULT([no])])
7329 CXXFLAGS=$save_CXXFLAGS
7332 AC_SUBST([HAVE_WDEPRECATED_COPY_DTOR])
7334 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
7335 dnl uninitialized warning for code like
7338 dnl boost::optional<OString> * g(bool b) {
7339 dnl boost::optional<OString> o;
7341 dnl return new boost::optional<OString>(o);
7344 dnl (as is e.g. present, in a slightly more elaborate form, in
7345 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
7346 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
7347 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
7348 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
7349 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=maybe-uninitialized])
7351 save_CXXFLAGS=$CXXFLAGS
7352 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
7353 if test "$ENABLE_OPTIMIZED" = TRUE; then
7354 CXXFLAGS="$CXXFLAGS -O2"
7356 CXXFLAGS="$CXXFLAGS -O0"
7358 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
7367 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
7368 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
7374 char stg[sizeof (S1)];
7382 ]])], [AC_MSG_RESULT([no])], [
7383 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
7384 AC_MSG_RESULT([yes])
7386 CXXFLAGS=$save_CXXFLAGS
7389 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
7391 dnl Check for <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87296#c5> "[8/9/10/11 Regression]
7392 dnl -Wstringop-overflow false positive due to using MEM_REF type of &MEM" (fixed in GCC 11), which
7393 dnl hits us e.g. with GCC 10 and --enable-optimized at
7395 dnl In file included from include/rtl/string.hxx:49,
7396 dnl from include/rtl/ustring.hxx:43,
7397 dnl from include/osl/file.hxx:35,
7398 dnl from include/codemaker/global.hxx:28,
7399 dnl from include/codemaker/options.hxx:23,
7400 dnl from codemaker/source/commoncpp/commoncpp.cxx:24:
7401 dnl In function ‘char* rtl::addDataHelper(char*, const char*, std::size_t)’,
7402 dnl inlined from ‘static char* rtl::ToStringHelper<const char [N]>::addData(char*, const char*) [with long unsigned int N = 3]’ at include/rtl/stringconcat.hxx:147:85,
7403 dnl inlined from ‘char* rtl::OStringConcat<T1, T2>::addData(char*) const [with T1 = const char [3]; T2 = rtl::OString]’ at include/rtl/stringconcat.hxx:226:103,
7404 dnl inlined from ‘rtl::OStringBuffer& rtl::OStringBuffer::append(rtl::OStringConcat<T1, T2>&&) [with T1 = const char [3]; T2 = rtl::OString]’ at include/rtl/strbuf.hxx:599:30,
7405 dnl inlined from ‘rtl::OString codemaker::cpp::scopedCppName(const rtl::OString&, bool)’ at codemaker/source/commoncpp/commoncpp.cxx:53:55:
7406 dnl include/rtl/stringconcat.hxx:78:15: error: writing 2 bytes into a region of size 1 [-Werror=stringop-overflow=]
7407 dnl 78 | memcpy( buffer, data, length );
7408 dnl | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
7409 HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=
7410 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
7411 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=stringop-overflow=])
7413 save_CXXFLAGS=$CXXFLAGS
7414 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wstringop-overflow"
7415 if test "$ENABLE_OPTIMIZED" = TRUE; then
7416 CXXFLAGS="$CXXFLAGS -O2"
7418 CXXFLAGS="$CXXFLAGS -O0"
7420 dnl Test code taken from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87296#c0>:
7421 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
7422 void fill(char const * begin, char const * end, char c);
7428 fill(c.ids, c.ids + sizeof(c.ids), '\0');
7429 __builtin_strncpy(c.username, "root", sizeof(c.username));
7431 ]])], [AC_MSG_RESULT([no])], [
7432 HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=TRUE
7433 AC_MSG_RESULT([yes])
7435 CXXFLAGS=$save_CXXFLAGS
7438 AC_SUBST([HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW])
7440 dnl ===================================================================
7441 dnl CPU Intrinsics support - SSE, AVX
7442 dnl ===================================================================
7444 CXXFLAGS_INTRINSICS_SSE2=
7445 CXXFLAGS_INTRINSICS_SSSE3=
7446 CXXFLAGS_INTRINSICS_SSE41=
7447 CXXFLAGS_INTRINSICS_SSE42=
7448 CXXFLAGS_INTRINSICS_AVX=
7449 CXXFLAGS_INTRINSICS_AVX2=
7450 CXXFLAGS_INTRINSICS_AVX512=
7451 CXXFLAGS_INTRINSICS_F16C=
7452 CXXFLAGS_INTRINSICS_FMA=
7454 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
7455 # GCC, Clang or Clang-cl (clang-cl + MSVC's -arch options don't work well together)
7462 flag_avx512="-mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd"
7466 # https://docs.microsoft.com/en-us/cpp/build/reference/arch-x86
7467 # MSVC seems to differentiate only between SSE and SSE2, where in fact
7468 # SSE2 seems to be SSE2+.
7469 # Even if -arch:SSE2 is the default, set it explicitly, so that the variable
7470 # is not empty (and can be tested in gbuild).
7471 flag_sse2=-arch:SSE2
7472 flag_ssse3=-arch:SSE2
7473 flag_sse41=-arch:SSE2
7474 flag_sse42=-arch:SSE2
7476 flag_avx2=-arch:AVX2
7477 flag_avx512=-arch:AVX512
7478 # These are part of -arch:AVX2
7479 flag_f16c=-arch:AVX2
7483 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
7485 save_CXXFLAGS=$CXXFLAGS
7486 CXXFLAGS="$CXXFLAGS $flag_sse2"
7487 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7488 #include <emmintrin.h>
7490 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
7491 c = _mm_xor_si128 (a, b);
7495 [can_compile_sse2=yes],
7496 [can_compile_sse2=no])
7498 CXXFLAGS=$save_CXXFLAGS
7499 AC_MSG_RESULT([${can_compile_sse2}])
7500 if test "${can_compile_sse2}" = "yes" ; then
7501 CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
7504 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
7506 save_CXXFLAGS=$CXXFLAGS
7507 CXXFLAGS="$CXXFLAGS $flag_ssse3"
7508 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7509 #include <tmmintrin.h>
7511 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
7512 c = _mm_maddubs_epi16 (a, b);
7516 [can_compile_ssse3=yes],
7517 [can_compile_ssse3=no])
7519 CXXFLAGS=$save_CXXFLAGS
7520 AC_MSG_RESULT([${can_compile_ssse3}])
7521 if test "${can_compile_ssse3}" = "yes" ; then
7522 CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
7525 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
7527 save_CXXFLAGS=$CXXFLAGS
7528 CXXFLAGS="$CXXFLAGS $flag_sse41"
7529 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7530 #include <smmintrin.h>
7532 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
7533 c = _mm_cmpeq_epi64 (a, b);
7537 [can_compile_sse41=yes],
7538 [can_compile_sse41=no])
7540 CXXFLAGS=$save_CXXFLAGS
7541 AC_MSG_RESULT([${can_compile_sse41}])
7542 if test "${can_compile_sse41}" = "yes" ; then
7543 CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
7546 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
7548 save_CXXFLAGS=$CXXFLAGS
7549 CXXFLAGS="$CXXFLAGS $flag_sse42"
7550 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7551 #include <nmmintrin.h>
7553 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
7554 c = _mm_cmpgt_epi64 (a, b);
7558 [can_compile_sse42=yes],
7559 [can_compile_sse42=no])
7561 CXXFLAGS=$save_CXXFLAGS
7562 AC_MSG_RESULT([${can_compile_sse42}])
7563 if test "${can_compile_sse42}" = "yes" ; then
7564 CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
7567 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
7569 save_CXXFLAGS=$CXXFLAGS
7570 CXXFLAGS="$CXXFLAGS $flag_avx"
7571 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7572 #include <immintrin.h>
7574 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
7575 c = _mm256_xor_ps(a, b);
7579 [can_compile_avx=yes],
7580 [can_compile_avx=no])
7582 CXXFLAGS=$save_CXXFLAGS
7583 AC_MSG_RESULT([${can_compile_avx}])
7584 if test "${can_compile_avx}" = "yes" ; then
7585 CXXFLAGS_INTRINSICS_AVX="$flag_avx"
7588 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
7590 save_CXXFLAGS=$CXXFLAGS
7591 CXXFLAGS="$CXXFLAGS $flag_avx2"
7592 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7593 #include <immintrin.h>
7595 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
7596 c = _mm256_maddubs_epi16(a, b);
7600 [can_compile_avx2=yes],
7601 [can_compile_avx2=no])
7603 CXXFLAGS=$save_CXXFLAGS
7604 AC_MSG_RESULT([${can_compile_avx2}])
7605 if test "${can_compile_avx2}" = "yes" ; then
7606 CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
7609 AC_MSG_CHECKING([whether $CXX can compile AVX512 intrinsics])
7611 save_CXXFLAGS=$CXXFLAGS
7612 CXXFLAGS="$CXXFLAGS $flag_avx512"
7613 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7614 #include <immintrin.h>
7616 __m512i a = _mm512_loadu_si512(0);
7620 [can_compile_avx512=yes],
7621 [can_compile_avx512=no])
7623 CXXFLAGS=$save_CXXFLAGS
7624 AC_MSG_RESULT([${can_compile_avx512}])
7625 if test "${can_compile_avx512}" = "yes" ; then
7626 CXXFLAGS_INTRINSICS_AVX512="$flag_avx512"
7629 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
7631 save_CXXFLAGS=$CXXFLAGS
7632 CXXFLAGS="$CXXFLAGS $flag_f16c"
7633 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7634 #include <immintrin.h>
7636 __m128i a = _mm_set1_epi32 (0);
7638 c = _mm_cvtph_ps(a);
7642 [can_compile_f16c=yes],
7643 [can_compile_f16c=no])
7645 CXXFLAGS=$save_CXXFLAGS
7646 AC_MSG_RESULT([${can_compile_f16c}])
7647 if test "${can_compile_f16c}" = "yes" ; then
7648 CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
7651 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
7653 save_CXXFLAGS=$CXXFLAGS
7654 CXXFLAGS="$CXXFLAGS $flag_fma"
7655 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7656 #include <immintrin.h>
7658 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
7659 d = _mm256_fmadd_ps(a, b, c);
7663 [can_compile_fma=yes],
7664 [can_compile_fma=no])
7666 CXXFLAGS=$save_CXXFLAGS
7667 AC_MSG_RESULT([${can_compile_fma}])
7668 if test "${can_compile_fma}" = "yes" ; then
7669 CXXFLAGS_INTRINSICS_FMA="$flag_fma"
7672 AC_SUBST([CXXFLAGS_INTRINSICS_SSE2])
7673 AC_SUBST([CXXFLAGS_INTRINSICS_SSSE3])
7674 AC_SUBST([CXXFLAGS_INTRINSICS_SSE41])
7675 AC_SUBST([CXXFLAGS_INTRINSICS_SSE42])
7676 AC_SUBST([CXXFLAGS_INTRINSICS_AVX])
7677 AC_SUBST([CXXFLAGS_INTRINSICS_AVX2])
7678 AC_SUBST([CXXFLAGS_INTRINSICS_AVX512])
7679 AC_SUBST([CXXFLAGS_INTRINSICS_F16C])
7680 AC_SUBST([CXXFLAGS_INTRINSICS_FMA])
7682 dnl ===================================================================
7683 dnl system stl sanity tests
7684 dnl ===================================================================
7685 if test "$_os" != "WINNT"; then
7689 save_CPPFLAGS="$CPPFLAGS"
7690 if test -n "$MACOSX_SDK_PATH"; then
7691 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
7694 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
7696 if test "$CPP_LIBRARY" = GLIBCXX; then
7697 dnl gcc#19664, gcc#22482, rhbz#162935
7698 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
7699 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
7700 AC_MSG_RESULT([$stlvisok])
7701 if test "$stlvisok" = "no"; then
7702 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
7706 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
7707 # when we don't make any dynamic libraries?
7708 if test "$DISABLE_DYNLOADING" = ""; then
7709 AC_MSG_CHECKING([if $CXX_BASE is -fvisibility-inlines-hidden safe (Clang bug 11250)])
7710 cat > conftestlib1.cc <<_ACEOF
7711 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
7712 struct S2: S1<int> { virtual ~S2(); };
7715 cat > conftestlib2.cc <<_ACEOF
7716 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
7717 struct S2: S1<int> { virtual ~S2(); };
7718 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
7720 gccvisinlineshiddenok=yes
7721 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
7722 gccvisinlineshiddenok=no
7724 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
7725 dnl known to not work with -z defs (unsetting which makes the test
7727 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
7728 if test "$COM_IS_CLANG" = TRUE; then
7729 for i in $CXX $CXXFLAGS; do
7732 my_linkflagsnoundefs=
7738 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
7739 gccvisinlineshiddenok=no
7744 AC_MSG_RESULT([$gccvisinlineshiddenok])
7745 if test "$gccvisinlineshiddenok" = "no"; then
7746 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
7750 AC_MSG_CHECKING([if $CXX_BASE has a visibility bug with class-level attributes (GCC bug 26905)])
7751 cat >visibility.cxx <<_ACEOF
7752 #pragma GCC visibility push(hidden)
7753 struct __attribute__ ((visibility ("default"))) TestStruct {
7756 __attribute__ ((visibility ("default"))) void TestFunc() {
7760 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
7765 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
7768 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
7780 rm -f visibility.s visibility.cxx
7782 AC_MSG_RESULT([$gccvisbroken])
7783 if test "$gccvisbroken" = "yes"; then
7784 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
7787 CPPFLAGS="$save_CPPFLAGS"
7792 dnl ===================================================================
7794 dnl ===================================================================
7796 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
7797 if test "$GCC" = "yes"; then
7798 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-enforce-eh-specs])
7800 save_CXXFLAGS=$CXXFLAGS
7801 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
7802 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
7803 CXXFLAGS=$save_CXXFLAGS
7805 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
7806 AC_MSG_RESULT([yes])
7811 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
7813 dnl ===================================================================
7814 dnl Compiler plugins
7815 dnl ===================================================================
7818 # currently only Clang
7820 if test "$COM_IS_CLANG" != "TRUE"; then
7821 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
7822 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
7823 enable_compiler_plugins=no
7827 COMPILER_PLUGINS_COM_IS_CLANG=
7828 if test "$COM_IS_CLANG" = "TRUE"; then
7829 if test -n "$enable_compiler_plugins"; then
7830 compiler_plugins="$enable_compiler_plugins"
7831 elif test -n "$ENABLE_DBGUTIL"; then
7832 compiler_plugins=test
7836 if test "$compiler_plugins" != no -a "$my_apple_clang" != yes; then
7837 if test "$CLANGVER" -lt 50002; then
7838 if test "$compiler_plugins" = yes; then
7839 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 5.0.2.])
7845 if test "$compiler_plugins" != "no"; then
7846 dnl The prefix where Clang resides, override to where Clang resides if
7847 dnl using a source build:
7848 if test -z "$CLANGDIR"; then
7849 CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $(printf '%s\n' $CXX | head -n 1)))))
7851 # Assume Clang is self-built, but allow overriding COMPILER_PLUGINS_CXX to the compiler Clang was built with.
7852 if test -z "$COMPILER_PLUGINS_CXX"; then
7853 COMPILER_PLUGINS_CXX=[$(echo $CXX | sed -e 's/-fsanitize=[^ ]*//g')]
7855 clangbindir=$CLANGDIR/bin
7856 if test "$build_os" = "cygwin"; then
7857 clangbindir=$(cygpath -u "$clangbindir")
7859 AC_PATH_PROG(LLVM_CONFIG, llvm-config,[],"$clangbindir" $PATH)
7860 if test -n "$LLVM_CONFIG"; then
7861 COMPILER_PLUGINS_CXXFLAGS=$($LLVM_CONFIG --cxxflags)
7862 COMPILER_PLUGINS_LINKFLAGS=$($LLVM_CONFIG --ldflags --libs --system-libs | tr '\n' ' ')
7863 if test -z "$CLANGLIBDIR"; then
7864 CLANGLIBDIR=$($LLVM_CONFIG --libdir)
7866 # Try if clang is built from source (in which case its includes are not together with llvm includes).
7867 # src-root is [llvm-toplevel-src-dir]/llvm, clang is [llvm-toplevel-src-dir]/clang
7868 clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
7869 if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d "$clangsrcdir/clang/include"; then
7870 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangsrcdir/clang/include"
7872 # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
7873 clangobjdir=$($LLVM_CONFIG --obj-root)
7874 if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
7875 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
7878 AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
7882 save_CPPFLAGS=$CPPFLAGS
7883 save_CXXFLAGS=$CXXFLAGS
7884 save_LDFLAGS=$LDFLAGS
7886 CXX=$COMPILER_PLUGINS_CXX
7887 CXXCPP="$COMPILER_PLUGINS_CXX -E"
7888 CPPFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7889 CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7890 AC_CHECK_HEADER(clang/Basic/SourceLocation.h,
7891 [COMPILER_PLUGINS=TRUE],
7893 if test "$compiler_plugins" = "yes"; then
7894 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
7896 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
7897 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
7900 dnl TODO: Windows doesn't use LO_CLANG_SHARED_PLUGINS for now, see corresponding TODO
7901 dnl comment in compilerplugins/Makefile-clang.mk:
7902 if test -n "$COMPILER_PLUGINS" && test "$_os" != "WINNT"; then
7904 AC_MSG_CHECKING([for clang libraries to use])
7905 if test -z "$CLANGTOOLLIBS"; then
7906 LIBS="-lclangTooling -lclangFrontend -lclangDriver -lclangParse -lclangSema -lclangEdit \
7907 -lclangAnalysis -lclangAST -lclangLex -lclangSerialization -lclangBasic $COMPILER_PLUGINS_LINKFLAGS"
7909 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7910 [[ clang::FullSourceLoc().dump(); ]])
7911 ],[CLANGTOOLLIBS="$LIBS"],[])
7913 if test -z "$CLANGTOOLLIBS"; then
7914 LIBS="-lclang-cpp $COMPILER_PLUGINS_LINKFLAGS"
7916 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7917 [[ clang::FullSourceLoc().dump(); ]])
7918 ],[CLANGTOOLLIBS="$LIBS"],[])
7920 AC_MSG_RESULT([$CLANGTOOLLIBS])
7921 if test -z "$CLANGTOOLLIBS"; then
7922 if test "$compiler_plugins" = "yes"; then
7923 AC_MSG_ERROR([Cannot find Clang libraries to build compiler plugins.])
7925 AC_MSG_WARN([Cannot find Clang libraries to build compiler plugins, plugins disabled])
7926 add_warning "Cannot find Clang libraries to build compiler plugins, plugins disabled."
7930 if test -n "$COMPILER_PLUGINS"; then
7931 if test -z "$CLANGSYSINCLUDE"; then
7932 if test -n "$LLVM_CONFIG"; then
7933 # Path to the clang system headers (no idea if there's a better way to get it).
7934 CLANGSYSINCLUDE=$($LLVM_CONFIG --libdir)/clang/$($LLVM_CONFIG --version | sed 's/git\|svn//')/include
7941 CPPFLAGS=$save_CPPFLAGS
7942 CXXFLAGS=$save_CXXFLAGS
7943 LDFLAGS=$save_LDFLAGS
7947 AC_MSG_CHECKING([whether the compiler for building compilerplugins is actually Clang])
7948 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
7954 [AC_MSG_RESULT([yes])
7955 COMPILER_PLUGINS_COM_IS_CLANG=TRUE],
7956 [AC_MSG_RESULT([no])])
7957 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
7960 if test "$enable_compiler_plugins" = "yes"; then
7961 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
7964 COMPILER_PLUGINS_ANALYZER_PCH=
7965 if test "$enable_compiler_plugins_analyzer_pch" != no; then
7966 COMPILER_PLUGINS_ANALYZER_PCH=TRUE
7968 AC_SUBST(COMPILER_PLUGINS)
7969 AC_SUBST(COMPILER_PLUGINS_ANALYZER_PCH)
7970 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
7971 AC_SUBST(COMPILER_PLUGINS_CXX)
7972 AC_SUBST(COMPILER_PLUGINS_CXXFLAGS)
7973 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
7974 AC_SUBST(COMPILER_PLUGINS_DEBUG)
7975 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
7977 AC_SUBST(CLANGLIBDIR)
7978 AC_SUBST(CLANGTOOLLIBS)
7979 AC_SUBST(CLANGSYSINCLUDE)
7981 # Plugin to help linker.
7982 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
7983 # This makes --enable-lto build with clang work.
7986 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
7987 AC_SUBST(HAVE_POSIX_FALLOCATE)
7989 JITC_PROCESSOR_TYPE=""
7990 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
7991 # IBMs JDK needs this...
7992 JITC_PROCESSOR_TYPE=6
7993 export JITC_PROCESSOR_TYPE
7995 AC_SUBST([JITC_PROCESSOR_TYPE])
7997 # Misc Windows Stuff
7998 AC_ARG_WITH(ucrt-dir,
7999 AS_HELP_STRING([--with-ucrt-dir],
8000 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
8001 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
8002 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
8003 Windows6.1-KB2999226-x64.msu
8004 Windows6.1-KB2999226-x86.msu
8005 Windows8.1-KB2999226-x64.msu
8006 Windows8.1-KB2999226-x86.msu
8007 Windows8-RT-KB2999226-x64.msu
8008 Windows8-RT-KB2999226-x86.msu
8009 A zip archive including those files is available from Microsoft site:
8010 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
8013 UCRT_REDISTDIR="$with_ucrt_dir"
8014 if test $_os = "WINNT"; then
8016 for i in $PKGFORMAT; do
8017 if test "$i" = msi; then
8022 MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
8023 MSVC_DLLS="$msvcdlls"
8024 test -n "$msmdir" && MSM_PATH=`win_short_path_for_make "$msmdir"`
8025 # MSVC 15.3 changed it to VC141
8026 if echo "$msvcdllpath" | grep -q "VC142.CRT$"; then
8027 SCPDEFS="$SCPDEFS -DWITH_VC142_REDIST"
8028 elif echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
8029 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
8031 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
8034 if test "$UCRT_REDISTDIR" = "no"; then
8035 dnl explicitly disabled
8038 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
8039 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
8040 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
8041 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
8042 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
8043 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
8045 if test -n "$PKGFORMAT"; then
8046 for i in $PKGFORMAT; do
8049 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
8050 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
8059 AC_SUBST(UCRT_REDISTDIR)
8060 AC_SUBST(MSVC_DLL_PATH)
8064 dnl ===================================================================
8066 dnl ===================================================================
8067 if test "$ENABLE_JAVA" != ""; then
8069 # Windows-specific tests
8070 if test "$build_os" = "cygwin"; then
8071 if test -z "$with_jdk_home"; then
8072 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
8073 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
8074 reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
8075 if test -n "$regvalue"; then
8077 reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
8078 reg_jdk_home=$regvalue
8081 if test -f "$reg_jdk_home/lib/jvm.lib" -a -f "$reg_jdk_home/bin/java.exe"; then
8082 with_jdk_home="$reg_jdk_home"
8083 howfound="found automatically"
8085 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $WIN_HOST_BITS-bit JDK >= 9])
8088 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
8089 howfound="you passed"
8093 # 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.
8094 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
8095 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
8096 with_jdk_home=`/usr/libexec/java_home`
8099 JAVA_HOME=; export JAVA_HOME
8100 if test -z "$with_jdk_home"; then
8101 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
8103 _java_path="$with_jdk_home/bin/$with_java"
8104 dnl Check if there is a Java interpreter at all.
8105 if test -x "$_java_path"; then
8106 JAVAINTERPRETER=$_java_path
8108 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
8112 dnl Check that the JDK found is correct architecture (at least 2 reasons to
8113 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
8114 dnl loaded by java to run JunitTests:
8115 if test "$build_os" = "cygwin" -a "$cross_compiling" != "yes"; then
8116 shortjdkhome=`cygpath -d "$with_jdk_home"`
8117 if test $WIN_HOST_BITS -eq 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
8118 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
8119 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
8120 elif test $WIN_HOST_BITS -eq 32 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
8121 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
8122 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
8125 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
8126 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
8128 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
8129 elif test "$cross_compiling" != "yes"; then
8131 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
8132 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
8133 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
8134 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
8137 *) # assumption: everything else 32-bit
8138 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
8139 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
8140 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
8147 dnl ===================================================================
8149 dnl ===================================================================
8151 # Whether all the complexity here actually is needed any more or not, no idea.
8153 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8155 AC_MSG_CHECKING([the installed JDK])
8156 if test -n "$JAVAINTERPRETER"; then
8157 dnl java -version sends output to stderr!
8158 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
8159 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8160 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
8161 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8162 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
8163 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8164 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
8165 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8169 dnl Sun JDK specific tests
8170 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
8171 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
8173 if test "$_jdk_ver" -lt 10900; then
8174 AC_MSG_ERROR([JDK is too old, you need at least 9 ($_jdk_ver < 10900)])
8176 if test "$_jdk_ver" -gt 10900; then
8177 JAVA_CLASSPATH_NOT_SET=TRUE
8180 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
8181 if test "$_os" = "WINNT"; then
8182 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
8184 AC_MSG_RESULT([found $JAVA_HOME (JDK $_jdk)])
8186 # set to limit VM usage for JunitTests
8188 # set to limit VM usage for javac
8189 JAVACFLAGS=-J-Xmx128M
8192 AC_MSG_ERROR([Java not found. You need at least JDK 9])
8195 if test -z "$ENABLE_JAVA"; then
8199 elif test "$cross_compiling" = "yes"; then
8200 # Just assume compatibility of build and host JDK
8202 JAVAIFLAGS=$JAVAIFLAGS_FOR_BUILD
8206 dnl ===================================================================
8207 dnl Checks for javac
8208 dnl ===================================================================
8209 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8210 javacompiler="javac"
8211 : ${JAVA_SOURCE_VER=8}
8212 : ${JAVA_TARGET_VER=8}
8213 if test -z "$with_jdk_home"; then
8214 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
8216 _javac_path="$with_jdk_home/bin/$javacompiler"
8217 dnl Check if there is a Java compiler at all.
8218 if test -x "$_javac_path"; then
8219 JAVACOMPILER=$_javac_path
8222 if test -z "$JAVACOMPILER"; then
8223 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
8225 if test "$build_os" = "cygwin"; then
8226 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
8227 JAVACOMPILER="${JAVACOMPILER}.exe"
8229 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
8233 dnl ===================================================================
8234 dnl Checks for javadoc
8235 dnl ===================================================================
8236 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8237 if test -z "$with_jdk_home"; then
8238 AC_PATH_PROG(JAVADOC, javadoc)
8240 _javadoc_path="$with_jdk_home/bin/javadoc"
8241 dnl Check if there is a javadoc at all.
8242 if test -x "$_javadoc_path"; then
8243 JAVADOC=$_javadoc_path
8245 AC_PATH_PROG(JAVADOC, javadoc)
8248 if test -z "$JAVADOC"; then
8249 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
8251 if test "$build_os" = "cygwin"; then
8252 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
8253 JAVADOC="${JAVADOC}.exe"
8255 JAVADOC=`win_short_path_for_make "$JAVADOC"`
8258 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
8259 JAVADOCISGJDOC="yes"
8263 AC_SUBST(JAVADOCISGJDOC)
8265 if test "$ENABLE_JAVA" != "" -a \( "$cross_compiling" != "yes" -o -n "$with_jdk_home" \); then
8266 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
8267 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
8268 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
8269 # try to recover first by looking whether we have an alternative
8270 # system as in Debian or newer SuSEs where following /usr/bin/javac
8271 # over /etc/alternatives/javac leads to the right bindir where we
8272 # just need to strip a bit away to get a valid JAVA_HOME
8273 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
8274 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
8275 # maybe only one level of symlink (e.g. on Mac)
8276 JAVA_HOME=$(readlink $JAVACOMPILER)
8277 if test "$(dirname $JAVA_HOME)" = "."; then
8278 # we've got no path to trim back
8283 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
8284 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
8285 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
8286 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
8288 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it...
8289 if test "$JAVA_HOME" != "/usr"; then
8290 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
8291 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
8292 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
8293 dnl Tiger already returns a JDK path...
8294 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
8296 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
8297 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
8298 dnl that checks which version to run
8299 if test -f "$JAVA_HOME"; then
8300 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
8305 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
8307 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
8308 if test -z "$JAVA_HOME"; then
8309 if test "x$with_jdk_home" = "x"; then
8310 cat > findhome.java <<_ACEOF
8311 [import java.io.File;
8315 public static void main(String args[])
8317 String jrelocation = System.getProperty("java.home");
8318 File jre = new File(jrelocation);
8319 System.out.println(jre.getParent());
8323 AC_MSG_CHECKING([if javac works])
8324 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
8325 AC_TRY_EVAL(javac_cmd)
8326 if test $? = 0 -a -f ./findhome.class; then
8327 AC_MSG_RESULT([javac works])
8329 echo "configure: javac test failed" >&5
8330 cat findhome.java >&5
8331 AC_MSG_ERROR([javac does not work - java projects will not build!])
8333 AC_MSG_CHECKING([if gij knows its java.home])
8334 JAVA_HOME=`$JAVAINTERPRETER findhome`
8335 if test $? = 0 -a "$JAVA_HOME" != ""; then
8336 AC_MSG_RESULT([$JAVA_HOME])
8338 echo "configure: java test failed" >&5
8339 cat findhome.java >&5
8340 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
8342 # clean-up after ourselves
8343 rm -f ./findhome.java ./findhome.class
8345 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
8349 # now check if $JAVA_HOME is really valid
8350 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
8351 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
8352 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
8353 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
8354 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
8355 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
8356 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
8357 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
8360 PathFormat "$JAVA_HOME"
8361 JAVA_HOME="$formatted_path"
8364 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
8367 AC_MSG_CHECKING([for JAWT lib])
8368 if test "$_os" = WINNT; then
8369 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
8374 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
8375 JAVA_ARCH=$my_java_arch
8390 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
8391 JAVA_ARCH=$my_java_arch
8394 my_java_arch=sparcv9
8400 my_java_arch=$host_cpu
8403 # This is where JDK9 puts the library
8404 if test -e "$JAVA_HOME/lib/libjawt.so"; then
8405 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
8407 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
8409 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
8411 AC_MSG_RESULT([$JAWTLIB])
8415 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
8419 JAVAINC="-I$JAVA_HOME/include"
8420 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
8421 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8425 JAVAINC="-I$JAVA_HOME/include/win32"
8426 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
8430 if test -d "$JAVA_HOME/include/darwin"; then
8431 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
8433 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
8438 JAVAINC="-I$JAVA_HOME/include"
8439 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8443 JAVAINC="-I$JAVA_HOME/include"
8444 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
8445 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
8446 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
8447 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8451 JAVAINC="-I$JAVA_HOME/include"
8452 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
8453 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8457 JAVAINC="-I$JAVA_HOME/include"
8458 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
8459 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8463 JAVAINC="-I$JAVA_HOME/include"
8464 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
8465 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8469 JAVAINC="-I$JAVA_HOME/include"
8470 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
8471 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8475 JAVAINC="-I$JAVA_HOME/include"
8476 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
8477 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
8481 SOLARINC="$SOLARINC $JAVAINC"
8483 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8484 JAVA_HOME_FOR_BUILD=$JAVA_HOME
8485 JAVAIFLAGS_FOR_BUILD=$JAVAIFLAGS
8489 AC_SUBST(JAVACFLAGS)
8490 AC_SUBST(JAVACOMPILER)
8491 AC_SUBST(JAVAINTERPRETER)
8492 AC_SUBST(JAVAIFLAGS)
8493 AC_SUBST(JAVAIFLAGS_FOR_BUILD)
8494 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
8496 AC_SUBST(JAVA_HOME_FOR_BUILD)
8498 AC_SUBST(JDK_FOR_BUILD)
8499 AC_SUBST(JAVA_SOURCE_VER)
8500 AC_SUBST(JAVA_TARGET_VER)
8503 dnl ===================================================================
8504 dnl Export file validation
8505 dnl ===================================================================
8506 AC_MSG_CHECKING([whether to enable export file validation])
8507 if test "$with_export_validation" != "no"; then
8508 if test -z "$ENABLE_JAVA"; then
8509 if test "$with_export_validation" = "yes"; then
8510 AC_MSG_ERROR([requested, but Java is disabled])
8512 AC_MSG_RESULT([no, as Java is disabled])
8514 elif ! test -d "${SRC_ROOT}/schema"; then
8515 if test "$with_export_validation" = "yes"; then
8516 AC_MSG_ERROR([requested, but schema directory is missing (it is excluded from tarballs)])
8518 AC_MSG_RESULT([no, schema directory is missing (it is excluded from tarballs)])
8521 AC_MSG_RESULT([yes])
8522 AC_DEFINE(HAVE_EXPORT_VALIDATION)
8524 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
8525 if test -z "$ODFVALIDATOR"; then
8526 # remember to download the ODF toolkit with validator later
8527 AC_MSG_NOTICE([no odfvalidator found, will download it])
8528 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
8529 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
8531 # and fetch name of odfvalidator jar name from download.lst
8532 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
8533 AC_SUBST(ODFVALIDATOR_JAR)
8535 if test -z "$ODFVALIDATOR_JAR"; then
8536 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
8539 if test "$build_os" = "cygwin"; then
8540 # In case of Cygwin it will be executed from Windows,
8541 # so we need to run bash and absolute path to validator
8542 # so instead of "odfvalidator" it will be
8543 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
8544 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
8546 ODFVALIDATOR="sh $ODFVALIDATOR"
8548 AC_SUBST(ODFVALIDATOR)
8551 AC_PATH_PROGS(OFFICEOTRON, officeotron)
8552 if test -z "$OFFICEOTRON"; then
8553 # remember to download the officeotron with validator later
8554 AC_MSG_NOTICE([no officeotron found, will download it])
8555 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
8556 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
8558 # and fetch name of officeotron jar name from download.lst
8559 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
8560 AC_SUBST(OFFICEOTRON_JAR)
8562 if test -z "$OFFICEOTRON_JAR"; then
8563 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
8566 # check version of existing officeotron
8567 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
8568 if test 0"$OFFICEOTRON_VER" -lt 704; then
8569 AC_MSG_ERROR([officeotron too old])
8572 if test "$build_os" = "cygwin"; then
8573 # In case of Cygwin it will be executed from Windows,
8574 # so we need to run bash and absolute path to validator
8575 # so instead of "odfvalidator" it will be
8576 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
8577 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
8579 OFFICEOTRON="sh $OFFICEOTRON"
8582 AC_SUBST(OFFICEOTRON)
8587 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
8588 if test "$with_bffvalidator" != "no"; then
8589 AC_DEFINE(HAVE_BFFVALIDATOR)
8591 if test "$with_export_validation" = "no"; then
8592 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
8595 if test "$with_bffvalidator" = "yes"; then
8596 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
8598 BFFVALIDATOR="$with_bffvalidator"
8601 if test "$build_os" = "cygwin"; then
8602 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
8603 AC_MSG_RESULT($BFFVALIDATOR)
8605 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
8607 elif test -n "$BFFVALIDATOR"; then
8608 # We are not in Cygwin but need to run Windows binary with wine
8609 AC_PATH_PROGS(WINE, wine)
8611 # so swap in a shell wrapper that converts paths transparently
8612 BFFVALIDATOR_EXE="$BFFVALIDATOR"
8613 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
8614 AC_SUBST(BFFVALIDATOR_EXE)
8615 AC_MSG_RESULT($BFFVALIDATOR)
8617 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
8619 AC_SUBST(BFFVALIDATOR)
8624 dnl ===================================================================
8625 dnl Check for C preprocessor to use
8626 dnl ===================================================================
8627 AC_MSG_CHECKING([which C preprocessor to use in idlc])
8628 if test -n "$with_idlc_cpp"; then
8629 AC_MSG_RESULT([$with_idlc_cpp])
8630 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
8632 AC_MSG_RESULT([ucpp])
8633 AC_MSG_CHECKING([which ucpp tp use])
8634 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
8635 AC_MSG_RESULT([external])
8636 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
8638 AC_MSG_RESULT([internal])
8639 BUILD_TYPE="$BUILD_TYPE UCPP"
8642 AC_SUBST(SYSTEM_UCPP)
8644 dnl ===================================================================
8645 dnl Check for epm (not needed for Windows)
8646 dnl ===================================================================
8647 AC_MSG_CHECKING([whether to enable EPM for packing])
8648 if test "$enable_epm" = "yes"; then
8649 AC_MSG_RESULT([yes])
8650 if test "$_os" != "WINNT"; then
8651 if test $_os = Darwin; then
8653 elif test -n "$with_epm"; then
8656 AC_PATH_PROG(EPM, epm, no)
8658 if test "$EPM" = "no" -o "$EPM" = "internal"; then
8659 AC_MSG_NOTICE([EPM will be built.])
8660 BUILD_TYPE="$BUILD_TYPE EPM"
8661 EPM=${WORKDIR}/UnpackedTarball/epm/epm
8663 # Gentoo has some epm which is something different...
8664 AC_MSG_CHECKING([whether the found epm is the right epm])
8665 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
8666 AC_MSG_RESULT([yes])
8668 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
8670 AC_MSG_CHECKING([epm version])
8671 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
8672 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
8673 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
8674 AC_MSG_RESULT([OK, >= 3.7])
8676 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
8677 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
8682 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
8683 AC_MSG_CHECKING([for rpm])
8684 for a in "$RPM" rpmbuild rpm; do
8685 $a --usage >/dev/null 2> /dev/null
8686 if test $? -eq 0; then
8690 $a --version >/dev/null 2> /dev/null
8691 if test $? -eq 0; then
8697 if test -z "$RPM"; then
8698 AC_MSG_ERROR([not found])
8699 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
8700 RPM_PATH=`which $RPM`
8701 AC_MSG_RESULT([$RPM_PATH])
8702 SCPDEFS="$SCPDEFS -DWITH_RPM"
8704 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
8707 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
8708 AC_PATH_PROG(DPKG, dpkg, no)
8709 if test "$DPKG" = "no"; then
8710 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
8713 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
8714 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
8715 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
8716 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
8717 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
8718 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
8719 AC_MSG_RESULT([yes])
8722 if echo "$PKGFORMAT" | $GREP -q rpm; then
8724 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
8725 add_warning "the rpms will need to be installed with --nodeps"
8729 AC_MSG_WARN([the ${_pt}s will not be relocatable])
8730 add_warning "the ${_pt}s will not be relocatable"
8731 AC_MSG_WARN([if you want to make sure installation without --nodeps and
8732 relocation will work, you need to patch your epm with the
8733 patch in epm/epm-3.7.patch or build with
8734 --with-epm=internal which will build a suitable epm])
8739 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
8740 AC_PATH_PROG(PKGMK, pkgmk, no)
8741 if test "$PKGMK" = "no"; then
8742 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
8749 for i in $PKGFORMAT; do
8751 aix | bsd | deb | pkg | rpm | native | portable)
8753 [--with-package-format='$PKGFORMAT' requires --enable-epm])
8763 if test "$enable_lotuswordpro" = "yes"; then
8766 AC_SUBST(ENABLE_LWP)
8768 dnl ===================================================================
8769 dnl Check for building ODK
8770 dnl ===================================================================
8771 if test "$enable_odk" = no; then
8774 if test "$with_doxygen" = no; then
8775 AC_MSG_CHECKING([for doxygen])
8779 if test "$with_doxygen" = yes; then
8780 AC_PATH_PROG([DOXYGEN], [doxygen])
8781 if test -z "$DOXYGEN"; then
8782 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
8784 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
8785 if ! dot -V 2>/dev/null; then
8786 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
8790 AC_MSG_CHECKING([for doxygen])
8791 DOXYGEN=$with_doxygen
8792 AC_MSG_RESULT([$DOXYGEN])
8794 if test -n "$DOXYGEN"; then
8795 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
8796 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
8797 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
8798 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
8805 AC_MSG_CHECKING([whether to build the ODK])
8806 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
8807 AC_MSG_RESULT([yes])
8809 if test "$with_java" != "no"; then
8810 AC_MSG_CHECKING([whether to build unowinreg.dll])
8811 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
8812 # build on Win by default
8813 enable_build_unowinreg=yes
8815 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
8819 AC_MSG_RESULT([yes])
8820 BUILD_UNOWINREG=TRUE
8822 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
8823 if test -z "$with_mingw_cross_compiler"; then
8825 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
8826 elif test -x "$with_mingw_cross_compiler"; then
8827 MINGWCXX="$with_mingw_cross_compiler"
8829 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
8832 if test "$MINGWCXX" = "false"; then
8833 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
8836 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
8837 if test -x "$mingwstrip_test"; then
8838 MINGWSTRIP="$mingwstrip_test"
8840 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
8843 if test "$MINGWSTRIP" = "false"; then
8844 AC_MSG_ERROR(MinGW32 binutils not found.)
8848 BUILD_TYPE="$BUILD_TYPE ODK"
8853 AC_SUBST(BUILD_UNOWINREG)
8855 AC_SUBST(MINGWSTRIP)
8857 dnl ===================================================================
8858 dnl Check for system zlib
8859 dnl ===================================================================
8860 if test "$with_system_zlib" = "auto"; then
8863 with_system_zlib="$with_system_libs"
8866 if test "$enable_fuzzers" != "yes"; then
8867 with_system_zlib=yes
8875 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
8876 dnl and has no pkg-config for it at least on some tinderboxes,
8877 dnl so leaving that out for now
8878 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
8879 AC_MSG_CHECKING([which zlib to use])
8880 if test "$with_system_zlib" = "yes"; then
8881 AC_MSG_RESULT([external])
8883 AC_CHECK_HEADER(zlib.h, [],
8884 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
8885 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
8886 [AC_MSG_ERROR(zlib not found or functional)], [])
8888 AC_MSG_RESULT([internal])
8890 BUILD_TYPE="$BUILD_TYPE ZLIB"
8891 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
8892 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
8894 AC_SUBST(ZLIB_CFLAGS)
8896 AC_SUBST(SYSTEM_ZLIB)
8898 dnl ===================================================================
8899 dnl Check for system jpeg
8900 dnl ===================================================================
8901 AC_MSG_CHECKING([which libjpeg to use])
8902 if test "$with_system_jpeg" = "yes"; then
8903 AC_MSG_RESULT([external])
8905 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
8906 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
8907 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
8908 [AC_MSG_ERROR(jpeg library not found or functional)], [])
8911 AC_MSG_RESULT([internal, libjpeg-turbo])
8912 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
8913 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
8914 if test "$COM" = "MSC"; then
8915 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
8917 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
8921 x86_64 | amd64 | i*86 | x86 | ia32)
8922 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
8923 if test -z "$NASM" -a "$build_os" = "cygwin"; then
8924 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
8925 NASM="$LODE_HOME/opt/bin/nasm"
8926 elif test -x "/opt/lo/bin/nasm"; then
8927 NASM="/opt/lo/bin/nasm"
8931 if test -n "$NASM"; then
8932 AC_MSG_CHECKING([for object file format of host system])
8934 cygwin* | mingw* | pw32* | wsl*)
8944 msdosdjgpp* | go32*)
8947 os2-emx*) # not tested
8948 objfmt='MSOMF' # obj
8950 linux*coff* | linux*oldld*)
8966 kfreebsd* | freebsd* | netbsd* | openbsd*)
8967 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8980 solaris* | sunos* | sysv* | sco*)
8990 darwin* | rhapsody* | nextstep* | openstep* | macos*)
9005 AC_MSG_RESULT([$objfmt])
9006 if test "$objfmt" = 'ELF ?'; then
9008 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
9011 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
9013 MSOMF) NAFLAGS='-fobj -DOBJ32';;
9014 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
9015 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
9016 COFF) NAFLAGS='-fcoff -DCOFF';;
9017 a.out) NAFLAGS='-faout -DAOUT';;
9018 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
9019 ELF) NAFLAGS='-felf -DELF';;
9020 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
9021 RDF) NAFLAGS='-frdf -DRDF';;
9022 Mach-O) NAFLAGS='-fmacho -DMACHO';;
9023 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
9025 AC_MSG_RESULT([$NAFLAGS])
9027 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
9028 cat > conftest.asm << EOF
9029 [%line __oline__ "configure"
9037 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
9038 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
9041 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
9042 cat conftest.asm >&AS_MESSAGE_LOG_FD
9045 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
9051 if test -z "$NASM"; then
9053 ****************************************************************************
9054 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
9058 if test "$build_os" = "cygwin"; then
9060 install a pre-compiled binary for Win32
9062 mkdir -p /opt/lo/bin
9064 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
9067 or get and install one from http://www.nasm.us/
9069 Then re-run autogen.sh
9071 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
9072 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
9077 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
9081 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
9082 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
9089 AC_SUBST(LIBJPEG_CFLAGS)
9090 AC_SUBST(LIBJPEG_LIBS)
9091 AC_SUBST(SYSTEM_LIBJPEG)
9093 dnl ===================================================================
9094 dnl Check for system clucene
9095 dnl ===================================================================
9096 dnl we should rather be using
9097 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
9098 dnl but the contribs-lib check seems tricky
9099 AC_MSG_CHECKING([which clucene to use])
9100 if test "$with_system_clucene" = "yes"; then
9101 AC_MSG_RESULT([external])
9103 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
9104 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
9105 FilterLibs "${CLUCENE_LIBS}"
9106 CLUCENE_LIBS="${filteredlibs}"
9108 save_CXXFLAGS=$CXXFLAGS
9109 save_CPPFLAGS=$CPPFLAGS
9110 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
9111 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
9112 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
9113 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
9114 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
9115 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
9116 CXXFLAGS=$save_CXXFLAGS
9117 CPPFLAGS=$save_CPPFLAGS
9120 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
9122 AC_MSG_RESULT([internal])
9124 BUILD_TYPE="$BUILD_TYPE CLUCENE"
9126 AC_SUBST(SYSTEM_CLUCENE)
9127 AC_SUBST(CLUCENE_CFLAGS)
9128 AC_SUBST(CLUCENE_LIBS)
9130 dnl ===================================================================
9131 dnl Check for system expat
9132 dnl ===================================================================
9133 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
9135 dnl ===================================================================
9136 dnl Check for system xmlsec
9137 dnl ===================================================================
9138 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.28])
9140 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
9141 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
9143 AC_DEFINE([ENABLE_EOT])
9144 AC_MSG_RESULT([yes])
9146 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
9151 AC_SUBST([ENABLE_EOT])
9153 dnl ===================================================================
9154 dnl Check for DLP libs
9155 dnl ===================================================================
9156 AS_IF([test "$COM" = "MSC"],
9157 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
9158 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
9160 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
9162 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
9164 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
9166 AS_IF([test "$COM" = "MSC"],
9167 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
9168 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
9170 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
9172 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
9174 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
9175 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.12])
9177 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
9179 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
9181 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
9183 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
9184 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.17])
9186 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
9187 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.10])
9189 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
9191 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
9192 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
9194 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
9196 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
9198 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
9200 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
9202 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
9203 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.7])
9205 dnl ===================================================================
9206 dnl Check for system lcms2
9207 dnl ===================================================================
9208 if test "$with_system_lcms2" != "yes"; then
9211 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
9212 if test "$GCC" = "yes"; then
9213 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
9215 if test "$COM" = "MSC"; then # override the above
9216 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
9219 dnl ===================================================================
9220 dnl Check for system cppunit
9221 dnl ===================================================================
9222 if test "$_os" != "Android" ; then
9223 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
9226 dnl ===================================================================
9227 dnl Check whether freetype is available
9228 dnl ===================================================================
9229 if test "$test_freetype" = "yes"; then
9230 AC_MSG_CHECKING([whether freetype is available])
9231 # FreeType has 3 different kinds of versions
9232 # * release, like 2.4.10
9233 # * libtool, like 13.0.7 (this what pkg-config returns)
9235 # FreeType's docs/VERSION.DLL provides a table mapping between the three
9238 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
9239 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9240 FilterLibs "${FREETYPE_LIBS}"
9241 FREETYPE_LIBS="${filteredlibs}"
9242 SYSTEM_FREETYPE=TRUE
9244 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
9245 if test "x$ac_config_site_64bit_host" = xYES; then
9246 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
9248 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
9251 AC_SUBST(FREETYPE_CFLAGS)
9252 AC_SUBST(FREETYPE_LIBS)
9253 AC_SUBST([SYSTEM_FREETYPE])
9255 # ===================================================================
9256 # Check for system libxslt
9257 # to prevent incompatibilities between internal libxml2 and external libxslt,
9258 # or vice versa, use with_system_libxml here
9259 # ===================================================================
9260 if test "$with_system_libxml" = "auto"; then
9263 with_system_libxml="$with_system_libs"
9266 if test "$enable_fuzzers" != "yes"; then
9267 with_system_libxml=yes
9269 with_system_libxml=no
9275 AC_MSG_CHECKING([which libxslt to use])
9276 if test "$with_system_libxml" = "yes"; then
9277 AC_MSG_RESULT([external])
9279 if test "$_os" = "Darwin"; then
9280 dnl make sure to use SDK path
9281 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
9282 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
9284 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
9285 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
9287 PKG_CHECK_MODULES(LIBXSLT, libxslt)
9288 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9289 FilterLibs "${LIBXSLT_LIBS}"
9290 LIBXSLT_LIBS="${filteredlibs}"
9291 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
9292 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9293 FilterLibs "${LIBEXSLT_LIBS}"
9294 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
9297 dnl Check for xsltproc
9298 AC_PATH_PROG(XSLTPROC, xsltproc, no)
9299 if test "$XSLTPROC" = "no"; then
9300 AC_MSG_ERROR([xsltproc is required])
9303 AC_MSG_RESULT([internal])
9305 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
9307 AC_SUBST(SYSTEM_LIBXSLT)
9308 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
9309 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
9311 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
9313 AC_SUBST(LIBEXSLT_CFLAGS)
9314 AC_SUBST(LIBEXSLT_LIBS)
9315 AC_SUBST(LIBXSLT_CFLAGS)
9316 AC_SUBST(LIBXSLT_LIBS)
9319 # ===================================================================
9320 # Check for system libxml
9321 # ===================================================================
9322 AC_MSG_CHECKING([which libxml to use])
9323 if test "$with_system_libxml" = "yes"; then
9324 AC_MSG_RESULT([external])
9326 if test "$_os" = "Darwin"; then
9327 dnl make sure to use SDK path
9328 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
9330 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
9331 elif test $_os = iOS; then
9332 dnl make sure to use SDK path
9333 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
9334 LIBXML_CFLAGS="-I$usr/include/libxml2"
9335 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
9337 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
9338 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9339 FilterLibs "${LIBXML_LIBS}"
9340 LIBXML_LIBS="${filteredlibs}"
9343 dnl Check for xmllint
9344 AC_PATH_PROG(XMLLINT, xmllint, no)
9345 if test "$XMLLINT" = "no"; then
9346 AC_MSG_ERROR([xmllint is required])
9349 AC_MSG_RESULT([internal])
9351 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
9352 if test "$COM" = "MSC"; then
9353 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9355 if test "$COM" = "MSC"; then
9356 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
9358 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
9359 if test "$_os" = Android; then
9360 LIBXML_LIBS="$LIBXML_LIBS -lm"
9363 BUILD_TYPE="$BUILD_TYPE LIBXML2"
9365 AC_SUBST(SYSTEM_LIBXML)
9366 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
9367 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
9369 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
9370 AC_SUBST(LIBXML_CFLAGS)
9371 AC_SUBST(LIBXML_LIBS)
9374 # =====================================================================
9375 # Checking for a Python interpreter with version >= 3.3.
9376 # Optionally user can pass an option to configure, i. e.
9377 # ./configure PYTHON=/usr/bin/python
9378 # =====================================================================
9379 if test $_os = Darwin -a "$enable_python" != no -a "$enable_python" != fully-internal -a "$enable_python" != internal; then
9380 # Only allowed choices for macOS are 'no', 'internal' (default), and 'fully-internal'
9381 enable_python=internal
9383 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
9384 if test -n "$PYTHON"; then
9385 PYTHON_FOR_BUILD=$PYTHON
9387 # This allows a lack of system python with no error, we use internal one in that case.
9388 AM_PATH_PYTHON([3.3],, [:])
9389 # Clean PYTHON_VERSION checked below if cross-compiling
9391 if test "$PYTHON" != ":"; then
9392 PYTHON_FOR_BUILD=$PYTHON
9396 AC_SUBST(PYTHON_FOR_BUILD)
9398 # Checks for Python to use for Pyuno
9399 AC_MSG_CHECKING([which Python to use for Pyuno])
9400 case "$enable_python" in
9402 if test -z $PYTHON_FOR_BUILD; then
9403 # Python is required to build LibreOffice. In theory we could separate the build-time Python
9404 # requirement from the choice whether to include Python stuff in the installer, but why
9406 AC_MSG_ERROR([Python is required at build time.])
9409 AC_MSG_RESULT([none])
9412 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
9413 AC_MSG_RESULT([no, overridden by --disable-scripting])
9415 elif test $build_os = cygwin; then
9416 dnl When building on Windows we don't attempt to use any installed
9417 dnl "system" Python.
9418 AC_MSG_RESULT([fully internal])
9419 enable_python=internal
9420 elif test "$cross_compiling" = yes; then
9421 AC_MSG_RESULT([system])
9422 enable_python=system
9424 # Unset variables set by the above AM_PATH_PYTHON so that
9425 # we actually do check anew.
9427 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
9428 AM_PATH_PYTHON([3.3],, [:])
9429 AC_MSG_CHECKING([which Python to use for Pyuno])
9430 if test "$PYTHON" = ":"; then
9431 if test -z "$PYTHON_FOR_BUILD"; then
9432 AC_MSG_RESULT([fully internal])
9434 AC_MSG_RESULT([internal])
9436 enable_python=internal
9438 AC_MSG_RESULT([system])
9439 enable_python=system
9444 AC_MSG_RESULT([internal])
9447 AC_MSG_RESULT([fully internal])
9448 enable_python=internal
9451 AC_MSG_RESULT([system])
9452 if test "$_os" = Darwin; then
9453 AC_MSG_ERROR([--enable-python=system doesn't work on macOS because the version provided is obsolete])
9457 AC_MSG_ERROR([Incorrect --enable-python option])
9461 if test $enable_python != no; then
9462 BUILD_TYPE="$BUILD_TYPE PYUNO"
9465 if test $enable_python = system; then
9466 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
9467 # Fallback: Accept these in the environment, or as set above
9470 elif test "$cross_compiling" != yes; then
9471 # Unset variables set by the above AM_PATH_PYTHON so that
9472 # we actually do check anew.
9473 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
9474 # This causes an error if no python command is found
9475 AM_PATH_PYTHON([3.3])
9476 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
9477 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
9478 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
9479 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
9480 if test -z "$PKG_CONFIG"; then
9481 PYTHON_CFLAGS="-I$python_include"
9482 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
9483 elif $PKG_CONFIG --exists python-$python_version-embed; then
9484 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
9485 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
9486 elif $PKG_CONFIG --exists python-$python_version; then
9487 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
9488 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
9490 PYTHON_CFLAGS="-I$python_include"
9491 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
9493 FilterLibs "${PYTHON_LIBS}"
9494 PYTHON_LIBS="${filteredlibs}"
9496 dnl How to find out the cross-compilation Python installation path?
9497 AC_MSG_CHECKING([for python version])
9498 AS_IF([test -n "$PYTHON_VERSION"],
9499 [AC_MSG_RESULT([$PYTHON_VERSION])],
9500 [AC_MSG_RESULT([not found])
9501 AC_MSG_ERROR([no usable python found])])
9502 test -n "$PYTHON_CFLAGS" && break
9505 dnl Check if the headers really work
9506 save_CPPFLAGS="$CPPFLAGS"
9507 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
9508 AC_CHECK_HEADER(Python.h)
9509 CPPFLAGS="$save_CPPFLAGS"
9511 # let the PYTHON_FOR_BUILD match the same python installation that
9512 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
9513 # better for PythonTests.
9514 PYTHON_FOR_BUILD=$PYTHON
9517 if test "$with_lxml" != no; then
9518 if test -z "$PYTHON_FOR_BUILD"; then
9521 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
9524 if test "$cross_compiling" != yes ; then
9525 BUILD_TYPE="$BUILD_TYPE LXML"
9530 AC_MSG_CHECKING([for python lxml])
9531 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
9532 AC_MSG_RESULT([yes])
9536 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
9539 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
9540 if test -n ${SYSTEM_LIBXSLT} -o -n ${SYSTEM_LIBXML}; then
9541 AC_MSG_RESULT([no, and no system libxml/libxslt, gla11y will only report widget classes and ids])
9543 BUILD_TYPE="$BUILD_TYPE LXML"
9544 AC_MSG_RESULT([no, using internal lxml])
9547 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
9555 dnl By now enable_python should be "system", "internal" or "no"
9556 case $enable_python in
9560 if test "x$ac_cv_header_Python_h" != "xyes"; then
9561 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
9565 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
9566 AC_MSG_CHECKING([for correct python library version])
9567 AC_RUN_IFELSE([AC_LANG_SOURCE([[
9570 int main(int argc, char **argv) {
9571 if ((PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
9574 ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3])],[AC_MSG_RESULT([skipped; cross-compiling])])
9577 dnl FIXME Check if the Python library can be linked with, too?
9582 PYTHON_VERSION_MAJOR=3
9583 PYTHON_VERSION_MINOR=8
9584 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.8
9585 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
9586 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
9588 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
9589 BUILD_TYPE="$BUILD_TYPE PYTHON"
9590 if test "$OS" = LINUX -o "$OS" = WNT ; then
9591 BUILD_TYPE="$BUILD_TYPE LIBFFI"
9593 # Embedded Python dies without Home set
9594 if test "$HOME" = ""; then
9603 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
9607 AC_SUBST(DISABLE_PYTHON)
9608 AC_SUBST(SYSTEM_PYTHON)
9609 AC_SUBST(PYTHON_CFLAGS)
9610 AC_SUBST(PYTHON_LIBS)
9611 AC_SUBST(PYTHON_VERSION)
9612 AC_SUBST(PYTHON_VERSION_MAJOR)
9613 AC_SUBST(PYTHON_VERSION_MINOR)
9619 AC_MSG_CHECKING([whether to build the MariaDB/MySQL SDBC driver])
9620 if test "x$enable_mariadb_sdbc" != "xno" -a "$enable_mpl_subset" != "yes"; then
9621 ENABLE_MARIADBC=TRUE
9622 AC_MSG_RESULT([yes])
9623 BUILD_TYPE="$BUILD_TYPE MARIADBC"
9627 AC_SUBST(ENABLE_MARIADBC)
9628 AC_SUBST(MARIADBC_MAJOR)
9629 AC_SUBST(MARIADBC_MINOR)
9630 AC_SUBST(MARIADBC_MICRO)
9632 if test "$ENABLE_MARIADBC" = "TRUE"; then
9633 dnl ===================================================================
9634 dnl Check for system MariaDB
9635 dnl ===================================================================
9636 AC_MSG_CHECKING([which MariaDB to use])
9637 if test "$with_system_mariadb" = "yes"; then
9638 AC_MSG_RESULT([external])
9639 SYSTEM_MARIADB_CONNECTOR_C=TRUE
9640 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
9641 if test -z "$MARIADBCONFIG"; then
9642 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
9643 if test -z "$MARIADBCONFIG"; then
9644 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
9645 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
9648 AC_MSG_CHECKING([MariaDB version])
9649 MARIADB_VERSION=`$MARIADBCONFIG --version`
9650 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
9651 if test "$MARIADB_MAJOR" -ge "5"; then
9654 AC_MSG_ERROR([too old, use 5.0.x or later])
9656 AC_MSG_CHECKING([for MariaDB Client library])
9657 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
9658 if test "$COM_IS_CLANG" = TRUE; then
9659 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
9661 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
9662 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
9663 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
9665 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
9666 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
9667 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
9668 | sed -e 's|/lib64/|/lib/|')
9670 FilterLibs "${MARIADB_LIBS}"
9671 MARIADB_LIBS="${filteredlibs}"
9672 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
9673 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
9674 if test "$enable_bundle_mariadb" = "yes"; then
9675 AC_MSG_RESULT([yes])
9676 BUNDLE_MARIADB_CONNECTOR_C=TRUE
9677 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
9679 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
9681 /g' | grep -E '(mysqlclient|mariadb)')
9682 if test "$_os" = "Darwin"; then
9683 LIBMARIADB=${LIBMARIADB}.dylib
9684 elif test "$_os" = "WINNT"; then
9685 LIBMARIADB=${LIBMARIADB}.dll
9687 LIBMARIADB=${LIBMARIADB}.so
9689 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
9690 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
9691 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
9692 AC_MSG_RESULT([found.])
9693 PathFormat "$LIBMARIADB_PATH"
9694 LIBMARIADB_PATH="$formatted_path"
9696 AC_MSG_ERROR([not found.])
9700 BUNDLE_MARIADB_CONNECTOR_C=
9703 AC_MSG_RESULT([internal])
9704 SYSTEM_MARIADB_CONNECTOR_C=
9705 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
9706 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
9707 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
9710 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
9711 AC_SUBST(MARIADB_CFLAGS)
9712 AC_SUBST(MARIADB_LIBS)
9713 AC_SUBST(LIBMARIADB)
9714 AC_SUBST(LIBMARIADB_PATH)
9715 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
9718 dnl ===================================================================
9719 dnl Check for system hsqldb
9720 dnl ===================================================================
9721 if test "$with_java" != "no" -a "$cross_compiling" != "yes"; then
9722 HSQLDB_USE_JDBC_4_1=
9723 AC_MSG_CHECKING([which hsqldb to use])
9724 if test "$with_system_hsqldb" = "yes"; then
9725 AC_MSG_RESULT([external])
9727 if test -z $HSQLDB_JAR; then
9728 HSQLDB_JAR=/usr/share/java/hsqldb.jar
9730 if ! test -f $HSQLDB_JAR; then
9731 AC_MSG_ERROR(hsqldb.jar not found.)
9733 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
9737 my $file = "$ENV{'HSQLDB_JAR'}";
9738 my $zip = Archive::Zip->new( $file );
9739 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
9740 if ( $mf =~ m/Specification-Version: 1.8.*/ )
9742 push @l, split(/\n/, $mf);
9743 foreach my $line (@l)
9745 if ($line =~ m/Specification-Version:/)
9747 ($t, $version) = split (/:/,$line);
9748 $version =~ s/^\s//;
9749 ($a, $b, $c, $d) = split (/\./,$version);
9750 if ($c == "0" && $d > "8")
9765 AC_MSG_RESULT([yes])
9767 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
9770 AC_MSG_RESULT([internal])
9772 BUILD_TYPE="$BUILD_TYPE HSQLDB"
9774 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
9775 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
9776 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
9777 AC_MSG_RESULT([yes])
9778 HSQLDB_USE_JDBC_4_1=TRUE
9784 if test "$with_java" != "no" -a -z "$HSQLDB_JAR"; then
9785 BUILD_TYPE="$BUILD_TYPE HSQLDB"
9788 AC_SUBST(SYSTEM_HSQLDB)
9789 AC_SUBST(HSQLDB_JAR)
9790 AC_SUBST([HSQLDB_USE_JDBC_4_1])
9792 dnl ===================================================================
9793 dnl Check for PostgreSQL stuff
9794 dnl ===================================================================
9795 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
9796 if test "x$enable_postgresql_sdbc" != "xno"; then
9797 AC_MSG_RESULT([yes])
9798 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
9800 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
9801 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
9803 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
9804 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
9807 postgres_interface=""
9808 if test "$with_system_postgresql" = "yes"; then
9809 postgres_interface="external PostgreSQL"
9810 SYSTEM_POSTGRESQL=TRUE
9811 if test "$_os" = Darwin; then
9813 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
9814 pg_supp_path="$P_SEP$d$pg_supp_path"
9817 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
9818 if test -n "$PGCONFIG"; then
9819 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
9820 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
9822 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
9823 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
9824 POSTGRESQL_LIB=$POSTGRESQL_LIBS
9826 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
9829 FilterLibs "${POSTGRESQL_LIB}"
9830 POSTGRESQL_LIB="${filteredlibs}"
9832 # if/when anything else than PostgreSQL uses Kerberos,
9833 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
9838 # macOS has system MIT Kerberos 5 since 10.4
9839 if test "$with_krb5" != "no"; then
9842 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
9843 # that the libraries where these functions are located on macOS will change, is it?
9844 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9845 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9848 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9849 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9850 KRB5_LIBS="$KRB5_LIBS $LIBS"
9853 if test "$with_gssapi" != "no"; then
9856 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9857 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9863 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
9864 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
9867 Linux|GNU|*BSD|DragonFly)
9868 if test "$with_krb5" != "no"; then
9871 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9872 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9875 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9876 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9877 KRB5_LIBS="$KRB5_LIBS $LIBS"
9880 if test "$with_gssapi" != "no"; then
9883 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9884 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9890 if test "$with_krb5" = "yes"; then
9893 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9894 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9897 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9898 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9899 KRB5_LIBS="$KRB5_LIBS $LIBS"
9902 if test "$with_gssapi" = "yes"; then
9905 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9906 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9912 if test -n "$with_libpq_path"; then
9913 SYSTEM_POSTGRESQL=TRUE
9914 postgres_interface="external libpq"
9915 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
9916 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
9919 postgres_interface="internal"
9921 POSTGRESQL_INC="%OVERRIDE_ME%"
9922 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
9926 AC_MSG_CHECKING([PostgreSQL C interface])
9927 AC_MSG_RESULT([$postgres_interface])
9929 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
9930 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
9932 save_CPPFLAGS=$CPPFLAGS
9934 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
9935 LIBS="${LIBS} ${POSTGRESQL_LIB}"
9936 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
9937 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
9938 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
9940 CPPFLAGS=$save_CPPFLAGS
9943 BUILD_POSTGRESQL_SDBC=TRUE
9948 AC_SUBST(WITH_GSSAPI)
9949 AC_SUBST(GSSAPI_LIBS)
9951 AC_SUBST(BUILD_POSTGRESQL_SDBC)
9952 AC_SUBST(SYSTEM_POSTGRESQL)
9953 AC_SUBST(POSTGRESQL_INC)
9954 AC_SUBST(POSTGRESQL_LIB)
9956 dnl ===================================================================
9957 dnl Check for Firebird stuff
9958 dnl ===================================================================
9959 ENABLE_FIREBIRD_SDBC=
9960 if test "$enable_firebird_sdbc" = "yes" ; then
9961 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
9963 dnl ===================================================================
9964 dnl Check for system Firebird
9965 dnl ===================================================================
9966 AC_MSG_CHECKING([which Firebird to use])
9967 if test "$with_system_firebird" = "yes"; then
9968 AC_MSG_RESULT([external])
9969 SYSTEM_FIREBIRD=TRUE
9970 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
9971 if test -z "$FIREBIRDCONFIG"; then
9972 AC_MSG_NOTICE([No fb_config -- using pkg-config])
9973 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
9974 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
9976 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
9978 AC_MSG_NOTICE([fb_config found])
9979 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
9980 AC_MSG_CHECKING([for Firebird Client library])
9981 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
9982 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
9983 FilterLibs "${FIREBIRD_LIBS}"
9984 FIREBIRD_LIBS="${filteredlibs}"
9986 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
9987 AC_MSG_CHECKING([Firebird version])
9988 if test -n "${FIREBIRD_VERSION}"; then
9989 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
9990 if test "$FIREBIRD_MAJOR" -ge "3"; then
9993 AC_MSG_ERROR([Ensure firebird >= 3 is installed])
9996 save_CFLAGS="${CFLAGS}"
9997 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
9998 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
9999 #if defined(FB_API_VER) && FB_API_VER == 30
10000 int fb_api_is_30(void) { return 0; }
10002 #error "Wrong Firebird API version"
10003 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
10004 CFLAGS="$save_CFLAGS"
10006 ENABLE_FIREBIRD_SDBC=TRUE
10007 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
10008 elif test "$enable_database_connectivity" != yes; then
10009 AC_MSG_RESULT([none])
10010 elif test "$cross_compiling" = "yes"; then
10011 AC_MSG_RESULT([none])
10013 dnl Embedded Firebird has version 3.0
10014 dnl We need libatomic_ops for any non X86/X64 system
10015 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
10016 dnl ===================================================================
10017 dnl Check for system libatomic_ops
10018 dnl ===================================================================
10019 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[LIBATOMIC_OPS],[atomic_ops >= 0.7.2])
10020 if test "$with_system_libatomic_ops" = "yes"; then
10021 SYSTEM_LIBATOMIC_OPS=TRUE
10022 AC_CHECK_HEADERS(atomic_ops.h, [],
10023 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
10025 SYSTEM_LIBATOMIC_OPS=
10026 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
10027 LIBATOMIC_OPS_LIBS="-latomic_ops"
10028 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
10032 AC_MSG_RESULT([internal])
10034 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
10035 FIREBIRD_LIBS="-lfbclient"
10037 if test "$with_system_libtommath" = "yes"; then
10038 SYSTEM_LIBTOMMATH=TRUE
10039 dnl check for tommath presence
10041 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
10042 AC_CHECK_LIB(tommath, mp_init, LIBTOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
10046 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
10047 LIBTOMMATH_LIBS="-ltommath"
10048 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
10051 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
10052 ENABLE_FIREBIRD_SDBC=TRUE
10053 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
10056 AC_SUBST(ENABLE_FIREBIRD_SDBC)
10057 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
10058 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
10059 AC_SUBST(LIBATOMIC_OPS_LIBS)
10060 AC_SUBST(SYSTEM_FIREBIRD)
10061 AC_SUBST(FIREBIRD_CFLAGS)
10062 AC_SUBST(FIREBIRD_LIBS)
10063 AC_SUBST(SYSTEM_LIBTOMMATH)
10064 AC_SUBST(LIBTOMMATH_CFLAGS)
10065 AC_SUBST(LIBTOMMATH_LIBS)
10067 dnl ===================================================================
10068 dnl Check for system curl
10069 dnl ===================================================================
10070 AC_MSG_CHECKING([which libcurl to use])
10071 if test "$with_system_curl" = "auto"; then
10072 with_system_curl="$with_system_libs"
10075 if test "$with_system_curl" = "yes"; then
10076 AC_MSG_RESULT([external])
10079 # First try PKGCONFIG and then fall back
10080 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
10082 if test -n "$CURL_PKG_ERRORS"; then
10083 AC_PATH_PROG(CURLCONFIG, curl-config)
10084 if test -z "$CURLCONFIG"; then
10085 AC_MSG_ERROR([curl development files not found])
10087 CURL_LIBS=`$CURLCONFIG --libs`
10088 FilterLibs "${CURL_LIBS}"
10089 CURL_LIBS="${filteredlibs}"
10090 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
10091 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
10093 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
10094 case $curl_version in
10095 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
10096 dnl so they need to be doubled to end up in the configure script
10097 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
10098 AC_MSG_RESULT([yes])
10101 AC_MSG_ERROR([no, you have $curl_version])
10108 AC_MSG_RESULT([internal])
10110 BUILD_TYPE="$BUILD_TYPE CURL"
10113 AC_SUBST(SYSTEM_CURL)
10114 AC_SUBST(CURL_CFLAGS)
10115 AC_SUBST(CURL_LIBS)
10116 AC_SUBST(ENABLE_CURL)
10118 dnl ===================================================================
10119 dnl Check for system boost
10120 dnl ===================================================================
10121 AC_MSG_CHECKING([which boost to use])
10122 if test "$with_system_boost" = "yes"; then
10123 AC_MSG_RESULT([external])
10125 AX_BOOST_BASE([1.66],,[AC_MSG_ERROR([no suitable Boost found])])
10127 AX_BOOST_FILESYSTEM
10130 AC_LANG_PUSH([C++])
10131 save_CXXFLAGS=$CXXFLAGS
10132 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
10133 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
10134 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
10135 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
10136 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
10137 CXXFLAGS=$save_CXXFLAGS
10139 # this is in m4/ax_boost_base.m4
10140 FilterLibs "${BOOST_LDFLAGS}"
10141 BOOST_LDFLAGS="${filteredlibs}"
10143 AC_MSG_RESULT([internal])
10144 BUILD_TYPE="$BUILD_TYPE BOOST"
10146 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
10147 # use warning-suppressing wrapper headers
10148 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
10150 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
10153 AC_SUBST(SYSTEM_BOOST)
10155 dnl ===================================================================
10156 dnl Check for system mdds
10157 dnl ===================================================================
10158 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.5 >= 1.5.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
10160 dnl ===================================================================
10161 dnl Check for system glm
10162 dnl ===================================================================
10163 AC_MSG_CHECKING([which glm to use])
10164 if test "$with_system_glm" = "yes"; then
10165 AC_MSG_RESULT([external])
10167 AC_LANG_PUSH([C++])
10168 AC_CHECK_HEADER([glm/glm.hpp], [],
10169 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
10172 AC_MSG_RESULT([internal])
10173 BUILD_TYPE="$BUILD_TYPE GLM"
10175 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
10177 AC_SUBST([GLM_CFLAGS])
10178 AC_SUBST([SYSTEM_GLM])
10180 dnl ===================================================================
10181 dnl Check for system odbc
10182 dnl ===================================================================
10183 AC_MSG_CHECKING([which odbc headers to use])
10184 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
10185 AC_MSG_RESULT([external])
10186 SYSTEM_ODBC_HEADERS=TRUE
10188 if test "$build_os" = "cygwin" -o "$build_os" = "wsl"; then
10189 save_CPPFLAGS=$CPPFLAGS
10191 PathFormat "$winsdktest"
10192 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"
10193 AC_CHECK_HEADER(sqlext.h, [],
10194 [AC_MSG_ERROR(odbc not found. install odbc)],
10195 [#include <windows.h>])
10196 CPPFLAGS=$save_CPPFLAGS
10198 AC_CHECK_HEADER(sqlext.h, [],
10199 [AC_MSG_ERROR(odbc not found. install odbc)],[])
10201 elif test "$enable_database_connectivity" != yes; then
10202 AC_MSG_RESULT([none])
10204 AC_MSG_RESULT([internal])
10205 SYSTEM_ODBC_HEADERS=
10206 BUILD_TYPE="$BUILD_TYPE IODBC"
10208 AC_SUBST(SYSTEM_ODBC_HEADERS)
10210 dnl ===================================================================
10211 dnl Enable LDAP support
10212 dnl ===================================================================
10214 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
10215 AC_MSG_CHECKING([whether to enable LDAP support])
10216 if test "$enable_ldap" != "yes"; then
10217 AC_MSG_RESULT([no])
10221 AC_MSG_RESULT([yes])
10225 AC_SUBST(ENABLE_LDAP)
10227 dnl ===================================================================
10228 dnl Check for system openldap
10229 dnl ===================================================================
10231 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android" -a "$ENABLE_LDAP" != ""; then
10232 AC_MSG_CHECKING([which openldap library to use])
10233 if test "$with_system_openldap" = "yes"; then
10234 AC_MSG_RESULT([external])
10235 SYSTEM_OPENLDAP=TRUE
10236 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
10237 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
10238 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
10240 AC_MSG_RESULT([internal])
10242 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
10245 AC_SUBST(SYSTEM_OPENLDAP)
10247 dnl ===================================================================
10248 dnl Check for system NSS
10249 dnl ===================================================================
10250 if test "$enable_fuzzers" != "yes"; then
10251 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
10252 AC_DEFINE(HAVE_FEATURE_NSS)
10254 AC_DEFINE(ENABLE_NSS)
10255 elif test $_os != iOS ; then
10258 AC_SUBST(ENABLE_NSS)
10260 dnl ===================================================================
10261 dnl Check for TLS/SSL and cryptographic implementation to use
10262 dnl ===================================================================
10263 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
10264 if test -n "$with_tls"; then
10267 AC_DEFINE(USE_TLS_OPENSSL)
10269 AC_MSG_RESULT([$TLS])
10271 if test "$enable_openssl" != "yes"; then
10272 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
10275 # warn that OpenSSL has been selected but not all TLS code has this option
10276 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
10277 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
10280 AC_DEFINE(USE_TLS_NSS)
10282 AC_MSG_RESULT([$TLS])
10285 AC_MSG_RESULT([none])
10286 AC_MSG_WARN([Skipping TLS/SSL])
10290 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
10292 nss - Mozilla's Network Security Services (NSS)
10297 # default to using NSS, it results in smaller oox lib
10298 AC_DEFINE(USE_TLS_NSS)
10300 AC_MSG_RESULT([$TLS])
10304 dnl ===================================================================
10305 dnl Check for system sane
10306 dnl ===================================================================
10307 AC_MSG_CHECKING([which sane header to use])
10308 if test "$with_system_sane" = "yes"; then
10309 AC_MSG_RESULT([external])
10310 AC_CHECK_HEADER(sane/sane.h, [],
10311 [AC_MSG_ERROR(sane not found. install sane)], [])
10313 AC_MSG_RESULT([internal])
10314 BUILD_TYPE="$BUILD_TYPE SANE"
10317 dnl ===================================================================
10318 dnl Check for system icu
10319 dnl ===================================================================
10326 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
10327 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
10328 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
10329 AC_MSG_CHECKING([which icu to use])
10330 if test "$with_system_icu" = "yes"; then
10331 AC_MSG_RESULT([external])
10333 AC_LANG_PUSH([C++])
10334 AC_MSG_CHECKING([for unicode/rbbi.h])
10335 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([icu headers not found])])
10338 if test "$cross_compiling" != "yes"; then
10339 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
10340 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
10341 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
10342 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
10345 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
10346 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
10347 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
10348 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
10349 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
10350 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
10351 AC_MSG_RESULT([yes])
10353 AC_MSG_RESULT([no])
10354 if test "$with_system_icu_for_build" != "force"; then
10355 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
10356 You can use --with-system-icu-for-build=force to use it anyway.])
10361 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
10362 # using the system icu tools can lead to version confusion, use the
10363 # ones from the build environment when cross-compiling
10364 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
10365 if test -z "$SYSTEM_GENBRK"; then
10366 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
10368 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
10369 if test -z "$SYSTEM_GENCCODE"; then
10370 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
10372 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
10373 if test -z "$SYSTEM_GENCMN"; then
10374 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
10376 if test "$ICU_MAJOR" -ge "49"; then
10377 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
10378 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
10379 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
10381 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
10382 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
10383 ICU_RECLASSIFIED_HEBREW_LETTER=
10387 if test "$cross_compiling" = "yes"; then
10388 if test "$ICU_MAJOR" -ge "50"; then
10389 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
10394 AC_MSG_RESULT([internal])
10396 BUILD_TYPE="$BUILD_TYPE ICU"
10397 # surprisingly set these only for "internal" (to be used by various other
10398 # external libs): the system icu-config is quite unhelpful and spits out
10399 # dozens of weird flags and also default path -I/usr/include
10400 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
10401 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
10403 if test "$ICU_MAJOR" -ge "59"; then
10404 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
10405 # with -std=c++11 but not all external libraries can be built with that,
10406 # for those use a bit-compatible typedef uint16_t UChar; see
10407 # icu/source/common/unicode/umachine.h
10408 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
10412 AC_SUBST(SYSTEM_ICU)
10413 AC_SUBST(SYSTEM_GENBRK)
10414 AC_SUBST(SYSTEM_GENCCODE)
10415 AC_SUBST(SYSTEM_GENCMN)
10416 AC_SUBST(ICU_MAJOR)
10417 AC_SUBST(ICU_MINOR)
10418 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
10419 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
10420 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
10421 AC_SUBST(ICU_CFLAGS)
10423 AC_SUBST(ICU_UCHAR_TYPE)
10425 dnl ==================================================================
10427 dnl ==================================================================
10428 DEFAULT_CRASHDUMP_VALUE="true"
10429 AC_MSG_CHECKING([whether to enable breakpad])
10430 if test "$enable_breakpad" != yes; then
10431 AC_MSG_RESULT([no])
10433 AC_MSG_RESULT([yes])
10434 ENABLE_BREAKPAD="TRUE"
10435 AC_DEFINE(ENABLE_BREAKPAD)
10436 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
10437 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
10439 AC_MSG_CHECKING([for disable crash dump])
10440 if test "$enable_crashdump" = no; then
10441 DEFAULT_CRASHDUMP_VALUE="false"
10442 AC_MSG_RESULT([yes])
10444 AC_MSG_RESULT([no])
10447 AC_MSG_CHECKING([for crashreport config])
10448 if test "$with_symbol_config" = "no"; then
10449 BREAKPAD_SYMBOL_CONFIG="invalid"
10450 AC_MSG_RESULT([no])
10452 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
10453 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
10454 AC_MSG_RESULT([yes])
10456 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
10458 AC_SUBST(ENABLE_BREAKPAD)
10459 AC_SUBST(DEFAULT_CRASHDUMP_VALUE)
10461 dnl ==================================================================
10463 dnl ==================================================================
10464 AC_MSG_CHECKING([whether to enable fuzzers])
10465 if test "$enable_fuzzers" != yes; then
10466 AC_MSG_RESULT([no])
10468 AC_MSG_RESULT([yes])
10469 ENABLE_FUZZERS="TRUE"
10470 AC_DEFINE([ENABLE_FUZZERS],1)
10471 BUILD_TYPE="$BUILD_TYPE FUZZERS"
10473 AC_SUBST(ENABLE_FUZZERS)
10475 dnl ===================================================================
10477 dnl ===================================================================
10478 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.16 >= 0.16.0])
10479 if test "$with_system_orcus" != "yes"; then
10480 if test "$SYSTEM_BOOST" = "TRUE"; then
10481 # ===========================================================
10482 # Determine if we are going to need to link with Boost.System
10483 # ===========================================================
10484 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
10485 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
10486 dnl in documentation has no effect.
10487 AC_MSG_CHECKING([if we need to link with Boost.System])
10488 AC_LANG_PUSH([C++])
10489 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
10490 @%:@include <boost/version.hpp>
10492 #if BOOST_VERSION >= 105000
10493 # error yes, we need to link with Boost.System
10496 AC_MSG_RESULT([no])
10498 AC_MSG_RESULT([yes])
10504 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
10505 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
10506 AC_SUBST([BOOST_SYSTEM_LIB])
10507 AC_SUBST(SYSTEM_LIBORCUS)
10509 dnl ===================================================================
10511 dnl ===================================================================
10512 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
10513 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
10514 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
10516 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
10517 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
10518 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
10520 if test "$COM" = "MSC"; then # override the above
10521 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
10522 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
10525 if test "$with_system_harfbuzz" = "yes"; then
10526 if test "$with_system_graphite" = "no"; then
10527 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
10529 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
10531 save_CFLAGS="$CFLAGS"
10532 LIBS="$LIBS $HARFBUZZ_LIBS"
10533 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
10534 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
10536 CFLAGS="$save_CFLAGS"
10538 if test "$with_system_graphite" = "yes"; then
10539 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
10543 AC_MSG_CHECKING([whether to use X11])
10544 dnl ***************************************
10545 dnl testing for X libraries and includes...
10546 dnl ***************************************
10547 if test "$USING_X11" = TRUE; then
10548 AC_DEFINE(HAVE_FEATURE_X11)
10550 AC_MSG_RESULT([$USING_X11])
10552 if test "$USING_X11" = TRUE; then
10555 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
10557 if test -z "$x_includes"; then
10558 x_includes="default_x_includes"
10560 if test -z "$x_libraries"; then
10561 x_libraries="default_x_libraries"
10563 CFLAGS="$CFLAGS $X_CFLAGS"
10564 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
10565 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
10567 x_includes="no_x_includes"
10568 x_libraries="no_x_libraries"
10571 if test "$USING_X11" = TRUE; then
10572 dnl ===================================================================
10573 dnl Check for extension headers
10574 dnl ===================================================================
10575 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
10576 [#include <X11/extensions/shape.h>])
10578 # vcl needs ICE and SM
10579 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
10580 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
10581 [AC_MSG_ERROR(ICE library not found)])
10582 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
10583 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
10584 [AC_MSG_ERROR(SM library not found)])
10587 if test "$USING_X11" = TRUE -a "$ENABLE_JAVA" != ""; then
10588 # bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c needs Xt
10589 AC_CHECK_HEADERS(X11/Intrinsic.h,[],[AC_MSG_ERROR([libXt headers not found])])
10592 dnl ===================================================================
10593 dnl Check for system Xrender
10594 dnl ===================================================================
10595 AC_MSG_CHECKING([whether to use Xrender])
10596 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
10597 AC_MSG_RESULT([yes])
10598 PKG_CHECK_MODULES(XRENDER, xrender)
10599 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10600 FilterLibs "${XRENDER_LIBS}"
10601 XRENDER_LIBS="${filteredlibs}"
10602 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
10603 [AC_MSG_ERROR(libXrender not found or functional)], [])
10604 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
10605 [AC_MSG_ERROR(Xrender not found. install X)], [])
10607 AC_MSG_RESULT([no])
10609 AC_SUBST(XRENDER_CFLAGS)
10610 AC_SUBST(XRENDER_LIBS)
10612 dnl ===================================================================
10613 dnl Check for XRandr
10614 dnl ===================================================================
10615 AC_MSG_CHECKING([whether to enable RandR support])
10616 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
10617 AC_MSG_RESULT([yes])
10618 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
10619 if test "$ENABLE_RANDR" != "TRUE"; then
10620 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
10621 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
10623 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
10624 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
10625 XRANDR_LIBS="-lXrandr "
10626 ENABLE_RANDR="TRUE"
10628 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10629 FilterLibs "${XRANDR_LIBS}"
10630 XRANDR_LIBS="${filteredlibs}"
10633 AC_MSG_RESULT([no])
10635 AC_SUBST(XRANDR_CFLAGS)
10636 AC_SUBST(XRANDR_LIBS)
10637 AC_SUBST(ENABLE_RANDR)
10639 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
10640 if test -z "$WITH_WEBDAV"; then
10644 if test $_os = iOS -o $_os = Android; then
10647 AC_MSG_CHECKING([for webdav library])
10648 case "$WITH_WEBDAV" in
10650 AC_MSG_RESULT([serf])
10651 # Check for system apr-util
10652 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
10653 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
10654 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
10655 if test "$COM" = "MSC"; then
10657 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
10658 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
10661 # Check for system serf
10662 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.3.9])
10665 AC_MSG_RESULT([neon])
10666 # Check for system neon
10667 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.31.2])
10668 if test "$with_system_neon" = "yes"; then
10669 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
10673 AC_SUBST(NEON_VERSION)
10676 AC_MSG_RESULT([none, disabled])
10680 AC_SUBST(WITH_WEBDAV)
10682 dnl ===================================================================
10683 dnl Check for disabling cve_tests
10684 dnl ===================================================================
10685 AC_MSG_CHECKING([whether to execute CVE tests])
10686 # If not explicitly enabled or disabled, default
10687 if test -z "$enable_cve_tests"; then
10690 # Default cves off for Windows with its wild and wonderful
10691 # variety of AV software kicking in and panicking
10692 enable_cve_tests=no
10696 enable_cve_tests=yes
10700 if test "$enable_cve_tests" = "no"; then
10701 AC_MSG_RESULT([no])
10702 DISABLE_CVE_TESTS=TRUE
10703 AC_SUBST(DISABLE_CVE_TESTS)
10705 AC_MSG_RESULT([yes])
10708 dnl ===================================================================
10709 dnl Check for enabling chart XShape tests
10710 dnl ===================================================================
10711 AC_MSG_CHECKING([whether to execute chart XShape tests])
10712 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
10713 AC_MSG_RESULT([yes])
10714 ENABLE_CHART_TESTS=TRUE
10715 AC_SUBST(ENABLE_CHART_TESTS)
10717 AC_MSG_RESULT([no])
10720 dnl ===================================================================
10721 dnl Check for system openssl
10722 dnl ===================================================================
10724 AC_MSG_CHECKING([whether to disable OpenSSL usage])
10725 if test "$enable_openssl" = "yes"; then
10726 AC_MSG_RESULT([no])
10727 if test "$_os" = Darwin ; then
10728 # OpenSSL is deprecated when building for 10.7 or later.
10730 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
10731 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
10733 with_system_openssl=no
10734 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
10735 elif test "$_os" = "FreeBSD" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
10736 && test "$with_system_openssl" != "no"; then
10737 with_system_openssl=yes
10738 SYSTEM_OPENSSL=TRUE
10740 OPENSSL_LIBS="-lssl -lcrypto"
10742 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
10744 if test "$with_system_openssl" = "yes"; then
10745 AC_MSG_CHECKING([whether openssl supports SHA512])
10747 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
10748 SHA512_CTX context;
10749 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
10753 AC_MSG_RESULT([yes])
10754 DISABLE_OPENSSL=TRUE
10756 # warn that although OpenSSL is disabled, system libraries may depend on it
10757 AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
10758 add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
10761 AC_SUBST([DISABLE_OPENSSL])
10763 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
10764 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
10765 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
10766 enable_cipher_openssl_backend=no
10768 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
10771 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
10772 ENABLE_CIPHER_OPENSSL_BACKEND=
10773 if test "$enable_cipher_openssl_backend" = yes; then
10774 AC_MSG_RESULT([yes])
10775 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
10777 AC_MSG_RESULT([no])
10779 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
10781 dnl ===================================================================
10782 dnl Check for building gnutls
10783 dnl ===================================================================
10784 AC_MSG_CHECKING([whether to use gnutls])
10785 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
10786 AC_MSG_RESULT([yes])
10787 AM_PATH_LIBGCRYPT()
10788 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
10789 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
10790 available in the system to use as replacement.]]))
10791 FilterLibs "${LIBGCRYPT_LIBS}"
10792 LIBGCRYPT_LIBS="${filteredlibs}"
10794 AC_MSG_RESULT([no])
10797 AC_SUBST([LIBGCRYPT_CFLAGS])
10798 AC_SUBST([LIBGCRYPT_LIBS])
10800 dnl ===================================================================
10801 dnl Check for system redland
10802 dnl ===================================================================
10803 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
10804 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
10805 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
10806 if test "$with_system_redland" = "yes"; then
10807 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
10808 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
10814 AC_SUBST(RAPTOR_MAJOR)
10815 AC_SUBST(RASQAL_MAJOR)
10816 AC_SUBST(REDLAND_MAJOR)
10818 dnl ===================================================================
10819 dnl Check for system hunspell
10820 dnl ===================================================================
10821 AC_MSG_CHECKING([which libhunspell to use])
10822 if test "$with_system_hunspell" = "yes"; then
10823 AC_MSG_RESULT([external])
10824 SYSTEM_HUNSPELL=TRUE
10825 AC_LANG_PUSH([C++])
10826 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
10827 if test "$HUNSPELL_PC" != "TRUE"; then
10828 AC_CHECK_HEADER(hunspell.hxx, [],
10830 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
10831 [AC_MSG_ERROR(hunspell headers not found.)], [])
10833 AC_CHECK_LIB([hunspell], [main], [:],
10834 [ AC_MSG_ERROR(hunspell library not found.) ], [])
10835 HUNSPELL_LIBS=-lhunspell
10838 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10839 FilterLibs "${HUNSPELL_LIBS}"
10840 HUNSPELL_LIBS="${filteredlibs}"
10842 AC_MSG_RESULT([internal])
10844 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
10845 if test "$COM" = "MSC"; then
10846 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
10848 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
10850 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
10852 AC_SUBST(SYSTEM_HUNSPELL)
10853 AC_SUBST(HUNSPELL_CFLAGS)
10854 AC_SUBST(HUNSPELL_LIBS)
10856 dnl ===================================================================
10857 dnl Check for system qrcodegen
10858 dnl ===================================================================
10859 AC_MSG_CHECKING([whether to use libqrcodegen])
10860 if test "$enable_qrcodegen" = "no"; then
10861 AC_MSG_RESULT([no])
10865 AC_MSG_RESULT([yes])
10866 ENABLE_QRCODEGEN=TRUE
10867 AC_MSG_CHECKING([which libqrcodegen to use])
10868 if test "$with_system_qrcodegen" = "yes"; then
10869 AC_MSG_RESULT([external])
10870 SYSTEM_QRCODEGEN=TRUE
10871 AC_LANG_PUSH([C++])
10872 AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
10873 [AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
10874 AC_CHECK_LIB([qrcodegencpp], [main], [:],
10875 [ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
10876 QRCODEGEN_LIBS=-lqrcodegencpp
10878 QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10879 FilterLibs "${QRCODEGEN_LIBS}"
10880 QRCODEGEN_LIBS="${filteredlibs}"
10882 AC_MSG_RESULT([internal])
10884 BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
10886 if test "$ENABLE_QRCODEGEN" = TRUE; then
10887 AC_DEFINE(ENABLE_QRCODEGEN)
10890 AC_SUBST(SYSTEM_QRCODEGEN)
10891 AC_SUBST(ENABLE_QRCODEGEN)
10892 AC_SUBST(QRCODEGEN_CFLAGS)
10893 AC_SUBST(QRCODEGEN_LIBS)
10895 dnl ===================================================================
10896 dnl Check for system box2d
10897 dnl ===================================================================
10898 AC_MSG_CHECKING([which box2d to use])
10899 if test "$with_system_box2d" = "yes"; then
10900 AC_MSG_RESULT([external])
10902 AC_LANG_PUSH([C++])
10903 AC_CHECK_HEADER(box2d/box2d.h, [BOX2D_H_FOUND='TRUE'],
10904 [BOX2D_H_FOUND='FALSE'])
10905 if test "$BOX2D_H_FOUND" = "TRUE"; then # 2.4.0+
10907 AC_DEFINE(BOX2D_HEADER,<box2d/box2d.h>)
10909 # fail this. there's no other alternative to check when we are here.
10910 AC_CHECK_HEADER([Box2D/Box2D.h], [],
10911 [AC_MSG_ERROR(box2d headers not found.)])
10913 AC_DEFINE(BOX2D_HEADER,<Box2D/Box2D.h>)
10915 AC_CHECK_LIB([$_BOX2D_LIB], [main], [:],
10916 [ AC_MSG_ERROR(box2d library not found.) ], [])
10917 BOX2D_LIBS=-l$_BOX2D_LIB
10919 BOX2D_CFLAGS=$(printf '%s' "$BOX2D_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10920 FilterLibs "${BOX2D_LIBS}"
10921 BOX2D_LIBS="${filteredlibs}"
10923 AC_MSG_RESULT([internal])
10925 BUILD_TYPE="$BUILD_TYPE BOX2D"
10927 AC_SUBST(SYSTEM_BOX2D)
10928 AC_SUBST(BOX2D_CFLAGS)
10929 AC_SUBST(BOX2D_LIBS)
10931 dnl ===================================================================
10932 dnl Checking for altlinuxhyph
10933 dnl ===================================================================
10934 AC_MSG_CHECKING([which altlinuxhyph to use])
10935 if test "$with_system_altlinuxhyph" = "yes"; then
10936 AC_MSG_RESULT([external])
10938 AC_CHECK_HEADER(hyphen.h, [],
10939 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
10940 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
10941 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
10942 [#include <hyphen.h>])
10943 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
10944 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10945 if test -z "$HYPHEN_LIB"; then
10946 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
10947 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10949 if test -z "$HYPHEN_LIB"; then
10950 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
10951 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10954 AC_MSG_RESULT([internal])
10956 BUILD_TYPE="$BUILD_TYPE HYPHEN"
10957 if test "$COM" = "MSC"; then
10958 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
10960 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
10963 AC_SUBST(SYSTEM_HYPH)
10964 AC_SUBST(HYPHEN_LIB)
10966 dnl ===================================================================
10967 dnl Checking for mythes
10968 dnl ===================================================================
10969 AC_MSG_CHECKING([which mythes to use])
10970 if test "$with_system_mythes" = "yes"; then
10971 AC_MSG_RESULT([external])
10973 AC_LANG_PUSH([C++])
10974 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
10975 if test "$MYTHES_PKGCONFIG" = "no"; then
10976 AC_CHECK_HEADER(mythes.hxx, [],
10977 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
10978 AC_CHECK_LIB([mythes-1.2], [main], [:],
10979 [ MYTHES_FOUND=no], [])
10980 if test "$MYTHES_FOUND" = "no"; then
10981 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
10982 [ MYTHES_FOUND=no], [])
10984 if test "$MYTHES_FOUND" = "no"; then
10985 AC_MSG_ERROR([mythes library not found!.])
10989 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10990 FilterLibs "${MYTHES_LIBS}"
10991 MYTHES_LIBS="${filteredlibs}"
10993 AC_MSG_RESULT([internal])
10995 BUILD_TYPE="$BUILD_TYPE MYTHES"
10996 if test "$COM" = "MSC"; then
10997 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
10999 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
11002 AC_SUBST(SYSTEM_MYTHES)
11003 AC_SUBST(MYTHES_CFLAGS)
11004 AC_SUBST(MYTHES_LIBS)
11006 dnl ===================================================================
11007 dnl How should we build the linear programming solver ?
11008 dnl ===================================================================
11011 AC_MSG_CHECKING([whether to build with CoinMP])
11012 if test "$enable_coinmp" != "no"; then
11014 AC_MSG_RESULT([yes])
11015 if test "$with_system_coinmp" = "yes"; then
11017 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
11018 FilterLibs "${COINMP_LIBS}"
11019 COINMP_LIBS="${filteredlibs}"
11021 BUILD_TYPE="$BUILD_TYPE COINMP"
11024 AC_MSG_RESULT([no])
11026 AC_SUBST(ENABLE_COINMP)
11027 AC_SUBST(SYSTEM_COINMP)
11028 AC_SUBST(COINMP_CFLAGS)
11029 AC_SUBST(COINMP_LIBS)
11032 AC_MSG_CHECKING([whether to build with lpsolve])
11033 if test "$enable_lpsolve" != "no"; then
11034 ENABLE_LPSOLVE=TRUE
11035 AC_MSG_RESULT([yes])
11037 AC_MSG_RESULT([no])
11039 AC_SUBST(ENABLE_LPSOLVE)
11041 if test "$ENABLE_LPSOLVE" = TRUE; then
11042 AC_MSG_CHECKING([which lpsolve to use])
11043 if test "$with_system_lpsolve" = "yes"; then
11044 AC_MSG_RESULT([external])
11045 SYSTEM_LPSOLVE=TRUE
11046 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
11047 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
11049 # some systems need this. Like Ubuntu...
11050 AC_CHECK_LIB(m, floor)
11051 AC_CHECK_LIB(dl, dlopen)
11052 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
11053 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
11056 AC_MSG_RESULT([internal])
11058 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
11061 AC_SUBST(SYSTEM_LPSOLVE)
11063 dnl ===================================================================
11064 dnl Checking for libexttextcat
11065 dnl ===================================================================
11066 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
11067 if test "$with_system_libexttextcat" = "yes"; then
11068 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
11070 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
11072 dnl ===================================================================
11073 dnl Checking for libnumbertext
11074 dnl ===================================================================
11075 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.6])
11076 if test "$with_system_libnumbertext" = "yes"; then
11077 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
11078 SYSTEM_LIBNUMBERTEXT=YES
11080 SYSTEM_LIBNUMBERTEXT=
11081 AC_LANG_PUSH([C++])
11082 save_CPPFLAGS=$CPPFLAGS
11083 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
11084 AC_CHECK_HEADERS([codecvt regex])
11085 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
11086 [ LIBNUMBERTEXT_CFLAGS=''
11087 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
11088 Enable libnumbertext fallback (missing number to number name conversion).])
11090 CPPFLAGS=$save_CPPFLAGS
11093 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
11094 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
11095 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
11097 dnl ***************************************
11098 dnl testing libc version for Linux...
11099 dnl ***************************************
11100 if test "$_os" = "Linux"; then
11101 AC_MSG_CHECKING([whether libc is >= 2.1.1])
11102 exec 6>/dev/null # no output
11103 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
11104 exec 6>&1 # output on again
11105 if test "$HAVE_LIBC"; then
11106 AC_MSG_RESULT([yes])
11108 AC_MSG_ERROR([no, upgrade libc])
11112 dnl =========================================
11113 dnl Check for uuidgen
11114 dnl =========================================
11115 if test "$_os" = "WINNT"; then
11116 # we must use the uuidgen from the Windows SDK, which will be in the LO_PATH, but isn't in
11117 # the PATH for AC_PATH_PROG. It is already tested above in the WINDOWS_SDK_HOME check.
11118 UUIDGEN=uuidgen.exe
11121 AC_PATH_PROG([UUIDGEN], [uuidgen])
11122 if test -z "$UUIDGEN"; then
11123 AC_MSG_WARN([uuid is needed for building installation sets])
11127 dnl ***************************************
11128 dnl Checking for bison and flex
11129 dnl ***************************************
11130 AC_PATH_PROG(BISON, bison)
11131 if test -z "$BISON"; then
11132 AC_MSG_ERROR([no bison found in \$PATH, install it])
11134 AC_MSG_CHECKING([the bison version])
11135 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
11136 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
11137 dnl Accept newer than 2.0; for --enable-compiler-plugins at least 2.3 is known to be bad and
11140 dnl idlc/source/parser.y:222:15: error: externally available entity 'YYSTYPE' is not previously declared in an included file (if it is only used in this translation unit, put it in an unnamed namespace; otherwise, provide a declaration of it in an included file) [loplugin:external]
11141 dnl typedef union YYSTYPE
11144 dnl while at least 3.4.1 is know to be good:
11145 if test "$COMPILER_PLUGINS" = TRUE; then
11146 if test "$_bison_longver" -lt 2004; then
11147 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.4+ for --enable-compiler-plugins)])
11150 if test "$_bison_longver" -lt 2000; then
11151 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
11157 AC_PATH_PROG(FLEX, flex)
11158 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11159 FLEX=`cygpath -m $FLEX`
11161 if test -z "$FLEX"; then
11162 AC_MSG_ERROR([no flex found in \$PATH, install it])
11164 AC_MSG_CHECKING([the flex version])
11165 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
11166 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
11167 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
11171 dnl ***************************************
11172 dnl Checking for patch
11173 dnl ***************************************
11174 AC_PATH_PROG(PATCH, patch)
11175 if test -z "$PATCH"; then
11176 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
11179 dnl On Solaris or macOS, check if --with-gnu-patch was used
11180 if test "$_os" = "SunOS" -o "$_os" = "Darwin" -o "$_os" = "FreeBSD"; then
11181 if test -z "$with_gnu_patch"; then
11184 if test -x "$with_gnu_patch"; then
11185 GNUPATCH=$with_gnu_patch
11187 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
11191 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
11192 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
11193 AC_MSG_RESULT([yes])
11195 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
11201 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11202 GNUPATCH=`cygpath -m $GNUPATCH`
11205 dnl We also need to check for --with-gnu-cp
11207 if test -z "$with_gnu_cp"; then
11208 # check the place where the good stuff is hidden on Solaris...
11209 if test -x /usr/gnu/bin/cp; then
11210 GNUCP=/usr/gnu/bin/cp
11212 AC_PATH_PROGS(GNUCP, gnucp cp)
11214 if test -z $GNUCP; then
11215 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
11218 if test -x "$with_gnu_cp"; then
11221 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
11225 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11226 GNUCP=`cygpath -m $GNUCP`
11229 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
11230 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
11231 AC_MSG_RESULT([yes])
11232 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
11233 AC_MSG_RESULT([yes])
11235 case "$build_os" in
11236 darwin*|macos*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
11239 AC_MSG_RESULT([no gnucp found - using the system's cp command])
11242 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
11251 dnl ***************************************
11252 dnl testing assembler path
11253 dnl ***************************************
11255 if test "$_os" = "WINNT"; then
11256 case "$WIN_HOST_ARCH" in
11257 x86) assembler=ml.exe ;;
11258 x64) assembler=ml64.exe ;;
11259 arm64) assembler=armasm64.exe ;;
11262 AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
11263 if test -f "$MSVC_HOST_PATH/$assembler"; then
11264 ML_EXE=`win_short_path_for_make "$MSVC_HOST_PATH/$assembler"`
11265 AC_MSG_RESULT([$ML_EXE])
11267 AC_MSG_ERROR([not found in $MSVC_HOST_PATH])
11273 dnl ===================================================================
11274 dnl We need zip and unzip
11275 dnl ===================================================================
11276 AC_PATH_PROG(ZIP, zip)
11277 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
11278 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
11279 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],,)
11282 AC_PATH_PROG(UNZIP, unzip)
11283 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
11285 dnl ===================================================================
11286 dnl Zip must be a specific type for different build types.
11287 dnl ===================================================================
11288 if test $build_os = cygwin; then
11289 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
11290 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
11294 dnl ===================================================================
11295 dnl We need touch with -h option support.
11296 dnl ===================================================================
11297 AC_PATH_PROG(TOUCH, touch)
11298 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
11300 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
11301 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],,)
11304 dnl ===================================================================
11305 dnl Check for system epoxy
11306 dnl ===================================================================
11307 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
11309 dnl ===================================================================
11310 dnl Set vcl option: coordinate device in double or sal_Int32
11311 dnl ===================================================================
11313 dnl disabled for now, we don't want subtle differences between OSs
11314 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
11315 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
11316 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
11317 dnl AC_MSG_RESULT([double])
11319 dnl AC_MSG_RESULT([sal_Int32])
11322 dnl ===================================================================
11323 dnl Test which vclplugs have to be built.
11324 dnl ===================================================================
11326 if test "$USING_X11" != TRUE; then
11331 if test "x$enable_gtk3" = "xyes"; then
11333 AC_DEFINE(ENABLE_GTK3)
11336 AC_SUBST(ENABLE_GTK3)
11338 ENABLE_GTK3_KDE5=""
11339 if test "x$enable_gtk3_kde5" = "xyes"; then
11340 ENABLE_GTK3_KDE5="TRUE"
11341 AC_DEFINE(ENABLE_GTK3_KDE5)
11344 AC_SUBST(ENABLE_GTK3_KDE5)
11347 if test "x$enable_qt5" = "xyes"; then
11349 AC_DEFINE(ENABLE_QT5)
11352 AC_SUBST(ENABLE_QT5)
11355 if test "x$enable_kf5" = "xyes"; then
11357 AC_DEFINE(ENABLE_KF5)
11360 AC_SUBST(ENABLE_KF5)
11364 if test "x$enable_gtk3" = "xyes" -o "x$enable_gtk3_kde5" = "xyes"; then
11365 if test "$with_system_cairo" = no; then
11366 add_warning 'Non-system cairo combined with gtk3 is assumed to cause trouble; proceed at your own risk.'
11368 : ${with_system_cairo:=yes}
11369 PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.20 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo)
11370 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11371 FilterLibs "${GTK3_LIBS}"
11372 GTK3_LIBS="${filteredlibs}"
11374 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
11375 if test "$with_system_epoxy" != "yes"; then
11376 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
11377 AC_CHECK_HEADER(EGL/eglplatform.h, [],
11378 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
11381 AC_SUBST(GTK3_LIBS)
11382 AC_SUBST(GTK3_CFLAGS)
11384 if test "$enable_introspection" = yes; then
11385 if test "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
11386 GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
11388 AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
11392 if test "$_os" = "WINNT"; then
11394 elif test "$_os" = "Darwin"; then
11396 elif test "$_os" = "iOS"; then
11400 build_vcl_plugins="$R"
11401 if test -z "$build_vcl_plugins"; then
11402 build_vcl_plugins="none"
11404 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
11406 dnl ===================================================================
11407 dnl check for dbus support
11408 dnl ===================================================================
11412 DBUS_GLIB_CFLAGS=""
11416 if test "$enable_dbus" = "no"; then
11420 AC_MSG_CHECKING([whether to enable DBUS support])
11421 if test "$test_dbus" = "yes"; then
11423 AC_MSG_RESULT([yes])
11424 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
11425 AC_DEFINE(ENABLE_DBUS)
11426 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11427 FilterLibs "${DBUS_LIBS}"
11428 DBUS_LIBS="${filteredlibs}"
11430 # Glib is needed for BluetoothServer
11431 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
11432 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
11434 DBUS_HAVE_GLIB="TRUE"
11435 AC_DEFINE(DBUS_HAVE_GLIB,1)
11437 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
11440 AC_MSG_RESULT([no])
11443 AC_SUBST(ENABLE_DBUS)
11444 AC_SUBST(DBUS_CFLAGS)
11445 AC_SUBST(DBUS_LIBS)
11446 AC_SUBST(DBUS_GLIB_CFLAGS)
11447 AC_SUBST(DBUS_GLIB_LIBS)
11448 AC_SUBST(DBUS_HAVE_GLIB)
11450 AC_MSG_CHECKING([whether to enable Impress remote control])
11451 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
11452 AC_MSG_RESULT([yes])
11453 ENABLE_SDREMOTE=TRUE
11454 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
11456 if test $OS = MACOSX && test "$MACOSX_SDK_VERSION" -ge 101500; then
11457 # The Bluetooth code doesn't compile with macOS SDK 10.15
11458 if test "$enable_sdremote_bluetooth" = yes; then
11459 AC_MSG_ERROR([macOS SDK $with_macosx_sdk does not currently support --enable-sdremote-bluetooth])
11461 enable_sdremote_bluetooth=no
11463 # If not explicitly enabled or disabled, default
11464 if test -z "$enable_sdremote_bluetooth"; then
11467 # Default to yes for these
11468 enable_sdremote_bluetooth=yes
11472 enable_sdremote_bluetooth=no
11476 # $enable_sdremote_bluetooth is guaranteed non-empty now
11478 if test "$enable_sdremote_bluetooth" != "no"; then
11479 if test "$OS" = "LINUX"; then
11480 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
11481 AC_MSG_RESULT([yes])
11482 ENABLE_SDREMOTE_BLUETOOTH=TRUE
11483 dnl ===================================================================
11484 dnl Check for system bluez
11485 dnl ===================================================================
11486 AC_MSG_CHECKING([which Bluetooth header to use])
11487 if test "$with_system_bluez" = "yes"; then
11488 AC_MSG_RESULT([external])
11489 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
11490 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
11493 AC_MSG_RESULT([internal])
11497 AC_MSG_RESULT([no, dbus disabled])
11498 ENABLE_SDREMOTE_BLUETOOTH=
11502 AC_MSG_RESULT([yes])
11503 ENABLE_SDREMOTE_BLUETOOTH=TRUE
11507 AC_MSG_RESULT([no])
11508 ENABLE_SDREMOTE_BLUETOOTH=
11514 AC_MSG_RESULT([no])
11516 AC_SUBST(ENABLE_SDREMOTE)
11517 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
11518 AC_SUBST(SYSTEM_BLUEZ)
11520 dnl ===================================================================
11521 dnl Check whether to enable GIO support
11522 dnl ===================================================================
11523 if test "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
11524 AC_MSG_CHECKING([whether to enable GIO support])
11525 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
11526 dnl Need at least 2.26 for the dbus support.
11527 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
11528 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
11529 if test "$ENABLE_GIO" = "TRUE"; then
11530 AC_DEFINE(ENABLE_GIO)
11531 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11532 FilterLibs "${GIO_LIBS}"
11533 GIO_LIBS="${filteredlibs}"
11536 AC_MSG_RESULT([no])
11539 AC_SUBST(ENABLE_GIO)
11540 AC_SUBST(GIO_CFLAGS)
11544 dnl ===================================================================
11546 SPLIT_APP_MODULES=""
11547 if test "$enable_split_app_modules" = "yes"; then
11548 SPLIT_APP_MODULES="TRUE"
11550 AC_SUBST(SPLIT_APP_MODULES)
11552 SPLIT_OPT_FEATURES=""
11553 if test "$enable_split_opt_features" = "yes"; then
11554 SPLIT_OPT_FEATURES="TRUE"
11556 AC_SUBST(SPLIT_OPT_FEATURES)
11558 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
11559 if test "$enable_cairo_canvas" = yes; then
11560 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
11562 enable_cairo_canvas=no
11563 elif test -z "$enable_cairo_canvas"; then
11564 enable_cairo_canvas=yes
11567 ENABLE_CAIRO_CANVAS=""
11568 if test "$enable_cairo_canvas" = "yes"; then
11570 ENABLE_CAIRO_CANVAS="TRUE"
11571 AC_DEFINE(ENABLE_CAIRO_CANVAS)
11573 AC_SUBST(ENABLE_CAIRO_CANVAS)
11575 dnl ===================================================================
11576 dnl Check whether the GStreamer libraries are available.
11577 dnl ===================================================================
11579 ENABLE_GSTREAMER_1_0=""
11581 if test "$build_gstreamer_1_0" = "yes"; then
11583 AC_MSG_CHECKING([whether to enable the GStreamer 1.0 avmedia backend])
11584 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
11585 ENABLE_GSTREAMER_1_0="TRUE"
11586 AC_MSG_RESULT([yes])
11587 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
11588 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11589 FilterLibs "${GSTREAMER_1_0_LIBS}"
11590 GSTREAMER_1_0_LIBS="${filteredlibs}"
11591 AC_DEFINE(ENABLE_GSTREAMER_1_0)
11593 AC_MSG_RESULT([no])
11596 AC_SUBST(GSTREAMER_1_0_CFLAGS)
11597 AC_SUBST(GSTREAMER_1_0_LIBS)
11598 AC_SUBST(ENABLE_GSTREAMER_1_0)
11600 dnl ===================================================================
11601 dnl Check whether to build the VLC avmedia backend
11602 dnl ===================================================================
11606 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
11607 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
11609 AC_MSG_RESULT([yes])
11611 AC_MSG_RESULT([no])
11613 AC_SUBST(ENABLE_VLC)
11615 ENABLE_OPENGL_TRANSITIONS=
11616 ENABLE_OPENGL_CANVAS=
11617 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
11619 elif test "$_os" = "Darwin"; then
11620 # We use frameworks on macOS, no need for detail checks
11621 ENABLE_OPENGL_TRANSITIONS=TRUE
11622 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
11623 ENABLE_OPENGL_CANVAS=TRUE
11624 elif test $_os = WINNT; then
11625 ENABLE_OPENGL_TRANSITIONS=TRUE
11626 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
11627 ENABLE_OPENGL_CANVAS=TRUE
11629 if test "$USING_X11" = TRUE; then
11630 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
11631 ENABLE_OPENGL_TRANSITIONS=TRUE
11632 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
11633 ENABLE_OPENGL_CANVAS=TRUE
11637 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
11638 AC_SUBST(ENABLE_OPENGL_CANVAS)
11640 dnl =================================================
11641 dnl Check whether to build with OpenCL support.
11642 dnl =================================================
11644 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE" -a "$enable_opencl" = "yes"; then
11645 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
11646 # platform (optional at run-time, used through clew).
11647 BUILD_TYPE="$BUILD_TYPE OPENCL"
11648 AC_DEFINE(HAVE_FEATURE_OPENCL)
11651 dnl =================================================
11652 dnl Check whether to build with dconf support.
11653 dnl =================================================
11655 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
11656 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
11657 if test "$enable_dconf" = yes; then
11658 AC_MSG_ERROR([dconf not found])
11663 AC_MSG_CHECKING([whether to enable dconf])
11664 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
11668 AC_MSG_RESULT([no])
11671 AC_DEFINE(ENABLE_DCONF)
11672 AC_MSG_RESULT([yes])
11674 AC_SUBST([DCONF_CFLAGS])
11675 AC_SUBST([DCONF_LIBS])
11676 AC_SUBST([ENABLE_DCONF])
11679 AC_MSG_CHECKING([whether to build the PDF import feature])
11681 if test -z "$enable_pdfimport" -o "$enable_pdfimport" = yes; then
11682 AC_MSG_RESULT([yes])
11683 ENABLE_PDFIMPORT=TRUE
11684 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
11686 AC_MSG_RESULT([no])
11690 AC_MSG_CHECKING([whether to build PDFium])
11692 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_pdfium" = yes; then
11693 AC_MSG_RESULT([yes])
11695 AC_DEFINE(HAVE_FEATURE_PDFIUM)
11696 BUILD_TYPE="$BUILD_TYPE PDFIUM"
11698 AC_MSG_RESULT([no])
11700 AC_SUBST(ENABLE_PDFIUM)
11702 dnl ===================================================================
11703 dnl Check for poppler
11704 dnl ===================================================================
11706 AC_MSG_CHECKING([whether to build Poppler])
11707 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" = "TRUE" -a $_os != Android \) -o "$enable_poppler" = yes; then
11708 AC_MSG_RESULT([yes])
11709 ENABLE_POPPLER=TRUE
11710 AC_DEFINE(HAVE_FEATURE_POPPLER)
11712 AC_MSG_RESULT([no])
11714 AC_SUBST(ENABLE_POPPLER)
11716 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
11717 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
11720 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" = "TRUE" -o "$ENABLE_PDFIUM" = "TRUE" \); then
11721 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
11724 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
11725 dnl ===================================================================
11726 dnl Check for system poppler
11727 dnl ===================================================================
11728 AC_MSG_CHECKING([which PDF import poppler to use])
11729 if test "$with_system_poppler" = "yes"; then
11730 AC_MSG_RESULT([external])
11731 SYSTEM_POPPLER=TRUE
11732 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
11733 AC_LANG_PUSH([C++])
11734 save_CXXFLAGS=$CXXFLAGS
11735 save_CPPFLAGS=$CPPFLAGS
11736 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
11737 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
11738 AC_CHECK_HEADER([cpp/poppler-version.h],
11739 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
11741 CXXFLAGS=$save_CXXFLAGS
11742 CPPFLAGS=$save_CPPFLAGS
11744 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11746 FilterLibs "${POPPLER_LIBS}"
11747 POPPLER_LIBS="${filteredlibs}"
11749 AC_MSG_RESULT([internal])
11751 BUILD_TYPE="$BUILD_TYPE POPPLER"
11752 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
11754 AC_DEFINE([ENABLE_PDFIMPORT],1)
11756 AC_SUBST(ENABLE_PDFIMPORT)
11757 AC_SUBST(SYSTEM_POPPLER)
11758 AC_SUBST(POPPLER_CFLAGS)
11759 AC_SUBST(POPPLER_LIBS)
11762 AC_MSG_CHECKING([whether to build Skia])
11764 if test "$enable_skia" != "no" -a "$build_skia" = "yes" -a -z "$DISABLE_GUI"; then
11765 if test "$enable_skia" = "debug"; then
11766 AC_MSG_RESULT([yes (debug)])
11767 ENABLE_SKIA_DEBUG=TRUE
11769 AC_MSG_RESULT([yes])
11773 AC_DEFINE(HAVE_FEATURE_SKIA)
11774 BUILD_TYPE="$BUILD_TYPE SKIA"
11776 AC_MSG_RESULT([no])
11778 AC_SUBST(ENABLE_SKIA)
11779 AC_SUBST(ENABLE_SKIA_DEBUG)
11781 LO_CLANG_CXXFLAGS_INTRINSICS_SSE2=
11782 LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3=
11783 LO_CLANG_CXXFLAGS_INTRINSICS_SSE41=
11784 LO_CLANG_CXXFLAGS_INTRINSICS_SSE42=
11785 LO_CLANG_CXXFLAGS_INTRINSICS_AVX=
11786 LO_CLANG_CXXFLAGS_INTRINSICS_AVX2=
11787 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512=
11788 LO_CLANG_CXXFLAGS_INTRINSICS_F16C=
11789 LO_CLANG_CXXFLAGS_INTRINSICS_FMA=
11790 HAVE_LO_CLANG_DLLEXPORTINLINES=
11792 if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE -a ! \( "$_os" = "WINNT" -a "$CPUNAME" = "ARM64" \); then
11793 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
11794 AC_MSG_CHECKING([for Clang])
11795 AC_MSG_RESULT([$LO_CLANG_CC / $LO_CLANG_CXX])
11797 if test "$_os" = "WINNT"; then
11798 AC_MSG_CHECKING([for clang-cl])
11799 if test -x "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"; then
11800 LO_CLANG_CC=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"`
11801 dnl explicitly set -m32/-m64
11802 LO_CLANG_CC="$LO_CLANG_CC -m$WIN_HOST_BITS"
11803 LO_CLANG_CXX="$LO_CLANG_CC"
11804 AC_MSG_RESULT([$LO_CLANG_CC])
11806 AC_MSG_RESULT([no])
11809 AC_CHECK_PROG(LO_CLANG_CC,clang,clang,[])
11810 AC_CHECK_PROG(LO_CLANG_CXX,clang++,clang++,[])
11813 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
11814 clang2_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $LO_CLANG_CC -E - | tail -1 | sed 's/ //g'`
11815 clang2_ver=`echo "$clang2_version" | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
11816 if test "$clang2_ver" -lt 50002; then
11817 AC_MSG_WARN(["$clang2_version" is too old or unrecognized, must be at least Clang 5.0.2])
11822 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX" -a "$_os" = "WINNT"; then
11824 CXX="$LO_CLANG_CXX"
11825 AC_MSG_CHECKING([whether $CXX supports -Zc:dllexportInlines-])
11826 AC_LANG_PUSH([C++])
11827 save_CXXFLAGS=$CXXFLAGS
11828 CXXFLAGS="$CXXFLAGS -Werror -Zc:dllexportInlines-"
11829 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
11830 HAVE_LO_CLANG_DLLEXPORTINLINES=TRUE
11831 AC_MSG_RESULT([yes])
11832 ], [AC_MSG_RESULT([no])])
11833 CXXFLAGS=$save_CXXFLAGS
11836 if test -z "$HAVE_LO_CLANG_DLLEXPORTINLINES"; then
11837 AC_MSG_ERROR([Clang compiler does not support -Zc:dllexportInlines-. The Skia library needs to be built using a newer Clang version, or use --disable-skia.])
11840 if test -z "$LO_CLANG_CC" -o -z "$LO_CLANG_CXX"; then
11841 # Skia is the default on Windows, so hard-require Clang.
11842 # Elsewhere it's used just by the 'gen' VCL backend which is rarely used.
11843 if test "$_os" = "WINNT"; then
11844 AC_MSG_ERROR([Clang compiler not found. The Skia library needs to be built using Clang.])
11846 AC_MSG_WARN([Clang compiler not found.])
11851 CXX="$LO_CLANG_CXX"
11852 # copy&paste (and adjust) of intrinsics checks, since MSVC's -arch doesn't work well for Clang-cl
11855 flag_sse41=-msse4.1
11856 flag_sse42=-msse4.2
11859 flag_avx512="-mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd"
11863 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
11864 AC_LANG_PUSH([C++])
11865 save_CXXFLAGS=$CXXFLAGS
11866 CXXFLAGS="$CXXFLAGS $flag_sse2"
11867 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11868 #include <emmintrin.h>
11870 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
11871 c = _mm_xor_si128 (a, b);
11875 [can_compile_sse2=yes],
11876 [can_compile_sse2=no])
11878 CXXFLAGS=$save_CXXFLAGS
11879 AC_MSG_RESULT([${can_compile_sse2}])
11880 if test "${can_compile_sse2}" = "yes" ; then
11881 LO_CLANG_CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
11884 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
11885 AC_LANG_PUSH([C++])
11886 save_CXXFLAGS=$CXXFLAGS
11887 CXXFLAGS="$CXXFLAGS $flag_ssse3"
11888 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11889 #include <tmmintrin.h>
11891 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
11892 c = _mm_maddubs_epi16 (a, b);
11896 [can_compile_ssse3=yes],
11897 [can_compile_ssse3=no])
11899 CXXFLAGS=$save_CXXFLAGS
11900 AC_MSG_RESULT([${can_compile_ssse3}])
11901 if test "${can_compile_ssse3}" = "yes" ; then
11902 LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
11905 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
11906 AC_LANG_PUSH([C++])
11907 save_CXXFLAGS=$CXXFLAGS
11908 CXXFLAGS="$CXXFLAGS $flag_sse41"
11909 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11910 #include <smmintrin.h>
11912 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
11913 c = _mm_cmpeq_epi64 (a, b);
11917 [can_compile_sse41=yes],
11918 [can_compile_sse41=no])
11920 CXXFLAGS=$save_CXXFLAGS
11921 AC_MSG_RESULT([${can_compile_sse41}])
11922 if test "${can_compile_sse41}" = "yes" ; then
11923 LO_CLANG_CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
11926 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
11927 AC_LANG_PUSH([C++])
11928 save_CXXFLAGS=$CXXFLAGS
11929 CXXFLAGS="$CXXFLAGS $flag_sse42"
11930 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11931 #include <nmmintrin.h>
11933 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
11934 c = _mm_cmpgt_epi64 (a, b);
11938 [can_compile_sse42=yes],
11939 [can_compile_sse42=no])
11941 CXXFLAGS=$save_CXXFLAGS
11942 AC_MSG_RESULT([${can_compile_sse42}])
11943 if test "${can_compile_sse42}" = "yes" ; then
11944 LO_CLANG_CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
11947 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
11948 AC_LANG_PUSH([C++])
11949 save_CXXFLAGS=$CXXFLAGS
11950 CXXFLAGS="$CXXFLAGS $flag_avx"
11951 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11952 #include <immintrin.h>
11954 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
11955 c = _mm256_xor_ps(a, b);
11959 [can_compile_avx=yes],
11960 [can_compile_avx=no])
11962 CXXFLAGS=$save_CXXFLAGS
11963 AC_MSG_RESULT([${can_compile_avx}])
11964 if test "${can_compile_avx}" = "yes" ; then
11965 LO_CLANG_CXXFLAGS_INTRINSICS_AVX="$flag_avx"
11968 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
11969 AC_LANG_PUSH([C++])
11970 save_CXXFLAGS=$CXXFLAGS
11971 CXXFLAGS="$CXXFLAGS $flag_avx2"
11972 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11973 #include <immintrin.h>
11975 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
11976 c = _mm256_maddubs_epi16(a, b);
11980 [can_compile_avx2=yes],
11981 [can_compile_avx2=no])
11983 CXXFLAGS=$save_CXXFLAGS
11984 AC_MSG_RESULT([${can_compile_avx2}])
11985 if test "${can_compile_avx2}" = "yes" ; then
11986 LO_CLANG_CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
11989 AC_MSG_CHECKING([whether $CXX can compile AVX512 intrinsics])
11990 AC_LANG_PUSH([C++])
11991 save_CXXFLAGS=$CXXFLAGS
11992 CXXFLAGS="$CXXFLAGS $flag_avx512"
11993 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11994 #include <immintrin.h>
11996 __m512i a = _mm512_loadu_si512(0);
12000 [can_compile_avx512=yes],
12001 [can_compile_avx512=no])
12003 CXXFLAGS=$save_CXXFLAGS
12004 AC_MSG_RESULT([${can_compile_avx512}])
12005 if test "${can_compile_avx512}" = "yes" ; then
12006 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512="$flag_avx512"
12009 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
12010 AC_LANG_PUSH([C++])
12011 save_CXXFLAGS=$CXXFLAGS
12012 CXXFLAGS="$CXXFLAGS $flag_f16c"
12013 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12014 #include <immintrin.h>
12016 __m128i a = _mm_set1_epi32 (0);
12018 c = _mm_cvtph_ps(a);
12022 [can_compile_f16c=yes],
12023 [can_compile_f16c=no])
12025 CXXFLAGS=$save_CXXFLAGS
12026 AC_MSG_RESULT([${can_compile_f16c}])
12027 if test "${can_compile_f16c}" = "yes" ; then
12028 LO_CLANG_CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
12031 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
12032 AC_LANG_PUSH([C++])
12033 save_CXXFLAGS=$CXXFLAGS
12034 CXXFLAGS="$CXXFLAGS $flag_fma"
12035 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12036 #include <immintrin.h>
12038 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
12039 d = _mm256_fmadd_ps(a, b, c);
12043 [can_compile_fma=yes],
12044 [can_compile_fma=no])
12046 CXXFLAGS=$save_CXXFLAGS
12047 AC_MSG_RESULT([${can_compile_fma}])
12048 if test "${can_compile_fma}" = "yes" ; then
12049 LO_CLANG_CXXFLAGS_INTRINSICS_FMA="$flag_fma"
12056 # prefix LO_CLANG_CC/LO_CLANG_CXX with ccache if needed
12058 if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
12059 AC_MSG_CHECKING([whether $LO_CLANG_CC is already ccached])
12063 save_CFLAGS=$CFLAGS
12064 CFLAGS="$CFLAGS --ccache-skip -O2"
12065 dnl an empty program will do, we're checking the compiler flags
12066 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
12067 [use_ccache=yes], [use_ccache=no])
12068 CFLAGS=$save_CFLAGS
12070 if test $use_ccache = yes; then
12071 AC_MSG_RESULT([yes])
12073 LO_CLANG_CC="$CCACHE $LO_CLANG_CC"
12074 AC_MSG_RESULT([no])
12078 AC_MSG_CHECKING([whether $LO_CLANG_CXX is already ccached])
12079 AC_LANG_PUSH([C++])
12081 CXX="$LO_CLANG_CXX"
12082 save_CXXFLAGS=$CXXFLAGS
12083 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
12084 dnl an empty program will do, we're checking the compiler flags
12085 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
12086 [use_ccache=yes], [use_ccache=no])
12087 if test $use_ccache = yes; then
12088 AC_MSG_RESULT([yes])
12090 LO_CLANG_CXX="$CCACHE $LO_CLANG_CXX"
12091 AC_MSG_RESULT([no])
12093 CXXFLAGS=$save_CXXFLAGS
12098 AC_SUBST(LO_CLANG_CC)
12099 AC_SUBST(LO_CLANG_CXX)
12100 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE2)
12101 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3)
12102 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE41)
12103 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE42)
12104 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX)
12105 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX2)
12106 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512)
12107 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_F16C)
12108 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_FMA)
12109 AC_SUBST(CLANG_USE_LD)
12110 AC_SUBST([HAVE_LO_CLANG_DLLEXPORTINLINES])
12114 if test "$enable_gpgmepp" = no; then
12115 AC_MSG_CHECKING([whether to enable gpgmepp])
12116 AC_MSG_RESULT([no])
12117 elif test "$enable_mpl_subset" = "yes"; then
12118 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
12119 AC_MSG_RESULT([yes])
12120 elif test "$enable_fuzzers" = "yes"; then
12121 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
12122 AC_MSG_RESULT([yes])
12123 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
12124 dnl ===================================================================
12125 dnl Check for system gpgme
12126 dnl ===================================================================
12127 AC_MSG_CHECKING([which gpgmepp to use])
12128 if test "$with_system_gpgmepp" = "yes"; then
12129 AC_MSG_RESULT([external])
12130 SYSTEM_GPGMEPP=TRUE
12132 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
12133 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
12134 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
12135 # progress_callback is the only func with plain C linkage
12136 # checking for it also filters out older, KDE-dependent libgpgmepp versions
12137 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
12138 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
12139 AC_CHECK_HEADER(gpgme.h, [],
12140 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
12142 AC_MSG_RESULT([internal])
12143 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
12144 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
12146 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
12147 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
12148 if test "$_os" != "WINNT"; then
12149 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
12150 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
12153 ENABLE_GPGMEPP=TRUE
12154 AC_DEFINE([HAVE_FEATURE_GPGME])
12155 AC_PATH_PROG(GPG, gpg)
12156 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
12157 # so let's exclude that manually for the moment
12158 if test -n "$GPG" -a "$_os" != "WINNT"; then
12159 # make sure we not only have a working gpgme, but a full working
12160 # gpg installation to run OpenPGP signature verification
12161 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
12163 if test "$_os" = "Linux"; then
12165 AC_MSG_CHECKING([for /run/user/$uid])
12166 if test -d /run/user/$uid; then
12167 AC_MSG_RESULT([yes])
12168 AC_PATH_PROG(GPGCONF, gpgconf)
12170 # Older versions of gpgconf are not working as expected, since
12171 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
12172 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
12173 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
12174 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
12175 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
12176 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
12177 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
12178 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
12179 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
12180 if $GPGCONF --dump-options > /dev/null ; then
12181 if $GPGCONF --dump-options | grep -q create-socketdir ; then
12182 AC_MSG_RESULT([yes])
12183 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
12184 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
12186 AC_MSG_RESULT([no])
12189 AC_MSG_RESULT([no. missing or broken gpgconf?])
12192 AC_MSG_RESULT([no, $GPGCONF_VERSION])
12195 AC_MSG_RESULT([no])
12199 AC_SUBST(ENABLE_GPGMEPP)
12200 AC_SUBST(SYSTEM_GPGMEPP)
12201 AC_SUBST(GPG_ERROR_CFLAGS)
12202 AC_SUBST(GPG_ERROR_LIBS)
12203 AC_SUBST(LIBASSUAN_CFLAGS)
12204 AC_SUBST(LIBASSUAN_LIBS)
12205 AC_SUBST(GPGMEPP_CFLAGS)
12206 AC_SUBST(GPGMEPP_LIBS)
12208 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
12209 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
12210 AC_MSG_RESULT([yes])
12211 ENABLE_MEDIAWIKI=TRUE
12212 BUILD_TYPE="$BUILD_TYPE XSLTML"
12213 if test "x$with_java" = "xno"; then
12214 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
12217 AC_MSG_RESULT([no])
12219 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
12221 AC_SUBST(ENABLE_MEDIAWIKI)
12223 AC_MSG_CHECKING([whether to build the Report Builder])
12224 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12225 AC_MSG_RESULT([yes])
12226 ENABLE_REPORTBUILDER=TRUE
12227 AC_MSG_CHECKING([which jfreereport libs to use])
12228 if test "$with_system_jfreereport" = "yes"; then
12229 SYSTEM_JFREEREPORT=TRUE
12230 AC_MSG_RESULT([external])
12231 if test -z $SAC_JAR; then
12232 SAC_JAR=/usr/share/java/sac.jar
12234 if ! test -f $SAC_JAR; then
12235 AC_MSG_ERROR(sac.jar not found.)
12238 if test -z $LIBXML_JAR; then
12239 if test -f /usr/share/java/libxml-1.0.0.jar; then
12240 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
12241 elif test -f /usr/share/java/libxml.jar; then
12242 LIBXML_JAR=/usr/share/java/libxml.jar
12244 AC_MSG_ERROR(libxml.jar replacement not found.)
12246 elif ! test -f $LIBXML_JAR; then
12247 AC_MSG_ERROR(libxml.jar not found.)
12250 if test -z $FLUTE_JAR; then
12251 if test -f /usr/share/java/flute-1.3.0.jar; then
12252 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
12253 elif test -f /usr/share/java/flute.jar; then
12254 FLUTE_JAR=/usr/share/java/flute.jar
12256 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
12258 elif ! test -f $FLUTE_JAR; then
12259 AC_MSG_ERROR(flute-1.3.0.jar not found.)
12262 if test -z $JFREEREPORT_JAR; then
12263 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
12264 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
12265 elif test -f /usr/share/java/flow-engine.jar; then
12266 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
12268 AC_MSG_ERROR(jfreereport.jar replacement not found.)
12270 elif ! test -f $JFREEREPORT_JAR; then
12271 AC_MSG_ERROR(jfreereport.jar not found.)
12274 if test -z $LIBLAYOUT_JAR; then
12275 if test -f /usr/share/java/liblayout-0.2.9.jar; then
12276 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
12277 elif test -f /usr/share/java/liblayout.jar; then
12278 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
12280 AC_MSG_ERROR(liblayout.jar replacement not found.)
12282 elif ! test -f $LIBLAYOUT_JAR; then
12283 AC_MSG_ERROR(liblayout.jar not found.)
12286 if test -z $LIBLOADER_JAR; then
12287 if test -f /usr/share/java/libloader-1.0.0.jar; then
12288 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
12289 elif test -f /usr/share/java/libloader.jar; then
12290 LIBLOADER_JAR=/usr/share/java/libloader.jar
12292 AC_MSG_ERROR(libloader.jar replacement not found.)
12294 elif ! test -f $LIBLOADER_JAR; then
12295 AC_MSG_ERROR(libloader.jar not found.)
12298 if test -z $LIBFORMULA_JAR; then
12299 if test -f /usr/share/java/libformula-0.2.0.jar; then
12300 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
12301 elif test -f /usr/share/java/libformula.jar; then
12302 LIBFORMULA_JAR=/usr/share/java/libformula.jar
12304 AC_MSG_ERROR(libformula.jar replacement not found.)
12306 elif ! test -f $LIBFORMULA_JAR; then
12307 AC_MSG_ERROR(libformula.jar not found.)
12310 if test -z $LIBREPOSITORY_JAR; then
12311 if test -f /usr/share/java/librepository-1.0.0.jar; then
12312 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
12313 elif test -f /usr/share/java/librepository.jar; then
12314 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
12316 AC_MSG_ERROR(librepository.jar replacement not found.)
12318 elif ! test -f $LIBREPOSITORY_JAR; then
12319 AC_MSG_ERROR(librepository.jar not found.)
12322 if test -z $LIBFONTS_JAR; then
12323 if test -f /usr/share/java/libfonts-1.0.0.jar; then
12324 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
12325 elif test -f /usr/share/java/libfonts.jar; then
12326 LIBFONTS_JAR=/usr/share/java/libfonts.jar
12328 AC_MSG_ERROR(libfonts.jar replacement not found.)
12330 elif ! test -f $LIBFONTS_JAR; then
12331 AC_MSG_ERROR(libfonts.jar not found.)
12334 if test -z $LIBSERIALIZER_JAR; then
12335 if test -f /usr/share/java/libserializer-1.0.0.jar; then
12336 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
12337 elif test -f /usr/share/java/libserializer.jar; then
12338 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
12340 AC_MSG_ERROR(libserializer.jar replacement not found.)
12342 elif ! test -f $LIBSERIALIZER_JAR; then
12343 AC_MSG_ERROR(libserializer.jar not found.)
12346 if test -z $LIBBASE_JAR; then
12347 if test -f /usr/share/java/libbase-1.0.0.jar; then
12348 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
12349 elif test -f /usr/share/java/libbase.jar; then
12350 LIBBASE_JAR=/usr/share/java/libbase.jar
12352 AC_MSG_ERROR(libbase.jar replacement not found.)
12354 elif ! test -f $LIBBASE_JAR; then
12355 AC_MSG_ERROR(libbase.jar not found.)
12359 AC_MSG_RESULT([internal])
12360 SYSTEM_JFREEREPORT=
12361 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
12365 AC_MSG_RESULT([no])
12366 ENABLE_REPORTBUILDER=
12367 SYSTEM_JFREEREPORT=
12369 AC_SUBST(ENABLE_REPORTBUILDER)
12370 AC_SUBST(SYSTEM_JFREEREPORT)
12372 AC_SUBST(LIBXML_JAR)
12373 AC_SUBST(FLUTE_JAR)
12374 AC_SUBST(JFREEREPORT_JAR)
12375 AC_SUBST(LIBBASE_JAR)
12376 AC_SUBST(LIBLAYOUT_JAR)
12377 AC_SUBST(LIBLOADER_JAR)
12378 AC_SUBST(LIBFORMULA_JAR)
12379 AC_SUBST(LIBREPOSITORY_JAR)
12380 AC_SUBST(LIBFONTS_JAR)
12381 AC_SUBST(LIBSERIALIZER_JAR)
12383 # this has to be here because both the Wiki Publisher and the SRB use
12385 COMMONS_LOGGING_VERSION=1.2
12386 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12387 AC_MSG_CHECKING([which Apache commons-* libs to use])
12388 if test "$with_system_apache_commons" = "yes"; then
12389 SYSTEM_APACHE_COMMONS=TRUE
12390 AC_MSG_RESULT([external])
12391 if test -z $COMMONS_LOGGING_JAR; then
12392 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
12393 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
12394 elif test -f /usr/share/java/commons-logging.jar; then
12395 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
12397 AC_MSG_ERROR(commons-logging.jar replacement not found.)
12399 elif ! test -f $COMMONS_LOGGING_JAR; then
12400 AC_MSG_ERROR(commons-logging.jar not found.)
12403 AC_MSG_RESULT([internal])
12404 SYSTEM_APACHE_COMMONS=
12405 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
12409 AC_SUBST(SYSTEM_APACHE_COMMONS)
12410 AC_SUBST(COMMONS_LOGGING_JAR)
12411 AC_SUBST(COMMONS_LOGGING_VERSION)
12413 # scripting provider for BeanShell?
12414 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
12415 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
12416 AC_MSG_RESULT([yes])
12417 ENABLE_SCRIPTING_BEANSHELL=TRUE
12419 dnl ===================================================================
12420 dnl Check for system beanshell
12421 dnl ===================================================================
12422 AC_MSG_CHECKING([which beanshell to use])
12423 if test "$with_system_beanshell" = "yes"; then
12424 AC_MSG_RESULT([external])
12426 if test -z $BSH_JAR; then
12427 BSH_JAR=/usr/share/java/bsh.jar
12429 if ! test -f $BSH_JAR; then
12430 AC_MSG_ERROR(bsh.jar not found.)
12433 AC_MSG_RESULT([internal])
12435 BUILD_TYPE="$BUILD_TYPE BSH"
12438 AC_MSG_RESULT([no])
12439 ENABLE_SCRIPTING_BEANSHELL=
12440 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
12442 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
12443 AC_SUBST(SYSTEM_BSH)
12446 # scripting provider for JavaScript?
12447 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
12448 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
12449 AC_MSG_RESULT([yes])
12450 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
12452 dnl ===================================================================
12453 dnl Check for system rhino
12454 dnl ===================================================================
12455 AC_MSG_CHECKING([which rhino to use])
12456 if test "$with_system_rhino" = "yes"; then
12457 AC_MSG_RESULT([external])
12459 if test -z $RHINO_JAR; then
12460 RHINO_JAR=/usr/share/java/js.jar
12462 if ! test -f $RHINO_JAR; then
12463 AC_MSG_ERROR(js.jar not found.)
12466 AC_MSG_RESULT([internal])
12468 BUILD_TYPE="$BUILD_TYPE RHINO"
12472 AC_MSG_RESULT([no])
12473 ENABLE_SCRIPTING_JAVASCRIPT=
12474 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
12476 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
12477 AC_SUBST(SYSTEM_RHINO)
12478 AC_SUBST(RHINO_JAR)
12480 # This is only used in Qt5/KF5 checks to determine if /usr/lib64
12481 # paths should be added to library search path. So lets put all 64-bit
12484 case "$host_cpu" in
12485 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
12486 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
12487 supports_multilib="yes"
12494 dnl ===================================================================
12495 dnl QT5 Integration
12496 dnl ===================================================================
12502 QT5_GOBJECT_CFLAGS=""
12503 QT5_GOBJECT_LIBS=""
12504 QT5_HAVE_GOBJECT=""
12505 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
12506 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
12507 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
12509 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
12510 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
12512 if test -n "$supports_multilib"; then
12513 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
12516 qt5_test_include="QtWidgets/qapplication.h"
12517 qt5_test_library="libQt5Widgets.so"
12519 dnl Check for qmake5
12520 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH])
12521 if test "$QMAKE5" = "no"; then
12522 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
12524 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
12525 if test -z "$qmake5_test_ver"; then
12526 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
12528 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
12529 qt5_minimal_minor="6"
12530 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
12531 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
12533 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
12537 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
12538 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
12540 AC_MSG_CHECKING([for Qt5 headers])
12542 for inc_dir in $qt5_incdirs; do
12543 if test -r "$inc_dir/$qt5_test_include"; then
12544 qt5_incdir="$inc_dir"
12548 AC_MSG_RESULT([$qt5_incdir])
12549 if test "x$qt5_incdir" = "xno"; then
12550 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
12552 # check for scenario: qt5-qtbase-devel-*.86_64 installed but host is i686
12553 AC_LANG_PUSH([C++])
12554 save_CPPFLAGS=$CPPFLAGS
12555 CPPFLAGS="${CPPFLAGS} -I${qt5_incdir}"
12556 AC_CHECK_HEADER(QtCore/qconfig.h, [],
12557 [AC_MSG_ERROR(qconfig.h header not found.)], [])
12558 CPPFLAGS=$save_CPPFLAGS
12561 AC_MSG_CHECKING([for Qt5 libraries])
12563 for lib_dir in $qt5_libdirs; do
12564 if test -r "$lib_dir/$qt5_test_library"; then
12565 qt5_libdir="$lib_dir"
12569 AC_MSG_RESULT([$qt5_libdir])
12570 if test "x$qt5_libdir" = "xno"; then
12571 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
12574 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
12575 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12576 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
12578 if test "$USING_X11" = TRUE; then
12579 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
12580 PKG_CHECK_MODULES(QT5_XCB_ICCCM,[xcb-icccm],[
12581 QT5_HAVE_XCB_ICCCM=1
12582 AC_DEFINE(QT5_HAVE_XCB_ICCCM)
12584 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)])
12585 add_warning "XCB ICCCM not found, which is needed for Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)"
12587 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
12588 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
12590 AC_DEFINE(QT5_USING_X11)
12593 dnl Check for Meta Object Compiler
12595 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH])
12596 if test "$MOC5" = "no"; then
12597 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
12598 the root of your Qt installation by exporting QT5DIR before running "configure".])
12601 if test "$build_gstreamer_1_0" = "yes"; then
12602 PKG_CHECK_MODULES(QT5_GOBJECT,[gobject-2.0], [
12604 AC_DEFINE(QT5_HAVE_GOBJECT)
12606 AC_MSG_WARN([[No GObject found, can't use QWidget GStreamer sink on wayland!]])
12610 AC_SUBST(QT5_CFLAGS)
12613 AC_SUBST(QT5_GOBJECT_CFLAGS)
12614 AC_SUBST(QT5_GOBJECT_LIBS)
12615 AC_SUBST(QT5_HAVE_GOBJECT)
12617 dnl ===================================================================
12618 dnl KF5 Integration
12619 dnl ===================================================================
12623 KF5_CONFIG="kf5-config"
12624 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
12625 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
12627 if test "$OS" = "HAIKU"; then
12628 haiku_arch="`echo $RTL_ARCH | tr X x`"
12629 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
12630 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
12633 kf5_incdirs="$KF5INC /usr/include $kf5_haiku_incdirs $x_includes"
12634 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
12635 if test -n "$supports_multilib"; then
12636 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
12639 kf5_test_include="KF5/kcoreaddons_version.h"
12640 kf5_test_library="libKF5CoreAddons.so"
12641 kf5_libdirs="$qt5_libdir $kf5_libdirs"
12643 dnl kf5 KDE4 support compatibility installed
12644 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
12645 if test "$KF5_CONFIG" != "no"; then
12646 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
12647 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
12650 dnl Check for KF5 headers
12651 AC_MSG_CHECKING([for KF5 headers])
12653 for kf5_check in $kf5_incdirs; do
12654 if test -r "$kf5_check/$kf5_test_include"; then
12655 kf5_incdir="$kf5_check/KF5"
12659 AC_MSG_RESULT([$kf5_incdir])
12660 if test "x$kf5_incdir" = "xno"; then
12661 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
12664 dnl Check for KF5 libraries
12665 AC_MSG_CHECKING([for KF5 libraries])
12667 for kf5_check in $kf5_libdirs; do
12668 if test -r "$kf5_check/$kf5_test_library"; then
12669 kf5_libdir="$kf5_check"
12674 AC_MSG_RESULT([$kf5_libdir])
12675 if test "x$kf5_libdir" = "xno"; then
12676 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
12679 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"
12680 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
12681 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12683 if test "$USING_X11" = TRUE; then
12684 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
12687 AC_LANG_PUSH([C++])
12688 save_CXXFLAGS=$CXXFLAGS
12689 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
12690 AC_MSG_CHECKING([whether KDE is >= 5.0])
12691 AC_RUN_IFELSE([AC_LANG_SOURCE([[
12692 #include <kcoreaddons_version.h>
12694 int main(int argc, char **argv) {
12695 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
12698 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
12699 CXXFLAGS=$save_CXXFLAGS
12702 AC_SUBST(KF5_CFLAGS)
12705 dnl ===================================================================
12706 dnl Test whether to include Evolution 2 support
12707 dnl ===================================================================
12708 AC_MSG_CHECKING([whether to enable evolution 2 support])
12709 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
12710 AC_MSG_RESULT([yes])
12711 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
12712 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12713 FilterLibs "${GOBJECT_LIBS}"
12714 GOBJECT_LIBS="${filteredlibs}"
12715 ENABLE_EVOAB2="TRUE"
12718 AC_MSG_RESULT([no])
12720 AC_SUBST(ENABLE_EVOAB2)
12721 AC_SUBST(GOBJECT_CFLAGS)
12722 AC_SUBST(GOBJECT_LIBS)
12724 dnl ===================================================================
12725 dnl Test which themes to include
12726 dnl ===================================================================
12727 AC_MSG_CHECKING([which themes to include])
12728 # if none given use default subset of available themes
12729 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
12730 with_theme="breeze breeze_dark breeze_dark_svg breeze_svg colibre colibre_svg elementary elementary_svg karasa_jaga karasa_jaga_svg sifr sifr_svg sifr_dark sifr_dark_svg sukapura sukapura_svg"
12734 if test "x$with_theme" != "xno"; then
12735 for theme in $with_theme; do
12737 breeze|breeze_dark|breeze_dark_svg|breeze_svg|colibre|colibre_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg|sifr|sifr_svg|sifr_dark|sifr_dark_svg|sukapura|sukapura_svg) real_theme="$theme" ;;
12738 default) real_theme=colibre ;;
12739 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
12741 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
12744 AC_MSG_RESULT([$WITH_THEMES])
12745 AC_SUBST([WITH_THEMES])
12746 # FIXME: remove this, and the convenience default->colibre remapping after a grace period
12747 for theme in $with_theme; do
12749 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
12754 dnl ===================================================================
12755 dnl Test whether to integrate helppacks into the product's installer
12756 dnl ===================================================================
12757 AC_MSG_CHECKING([for helppack integration])
12758 if test "$with_helppack_integration" = "no"; then
12759 AC_MSG_RESULT([no integration])
12761 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
12762 AC_MSG_RESULT([integration])
12765 ###############################################################################
12766 # Extensions checking
12767 ###############################################################################
12768 AC_MSG_CHECKING([for extensions integration])
12769 if test "x$enable_extension_integration" != "xno"; then
12770 WITH_EXTENSION_INTEGRATION=TRUE
12771 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
12772 AC_MSG_RESULT([yes, use integration])
12774 WITH_EXTENSION_INTEGRATION=
12775 AC_MSG_RESULT([no, do not integrate])
12777 AC_SUBST(WITH_EXTENSION_INTEGRATION)
12779 dnl Should any extra extensions be included?
12780 dnl There are standalone tests for each of these below.
12781 WITH_EXTRA_EXTENSIONS=
12782 AC_SUBST([WITH_EXTRA_EXTENSIONS])
12784 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
12785 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
12786 if test "x$with_java" != "xno"; then
12787 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
12788 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
12791 AC_MSG_CHECKING([whether to build opens___.ttf])
12792 if test "$enable_build_opensymbol" = "yes"; then
12793 AC_MSG_RESULT([yes])
12794 AC_PATH_PROG(FONTFORGE, fontforge)
12795 if test -z "$FONTFORGE"; then
12796 AC_MSG_ERROR([fontforge not installed])
12799 AC_MSG_RESULT([no])
12800 OPENSYMBOL_TTF=f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140-opens___.ttf
12801 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
12803 AC_SUBST(OPENSYMBOL_TTF)
12804 AC_SUBST(FONTFORGE)
12806 dnl ===================================================================
12807 dnl Test whether to include fonts
12808 dnl ===================================================================
12809 AC_MSG_CHECKING([whether to include third-party fonts])
12810 if test "$with_fonts" != "no"; then
12811 AC_MSG_RESULT([yes])
12813 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
12814 AC_DEFINE(HAVE_MORE_FONTS)
12816 AC_MSG_RESULT([no])
12818 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
12820 AC_SUBST(WITH_FONTS)
12822 dnl Test whether to include more Google Noto fonts
12823 dnl ===================================================================
12824 AC_MSG_CHECKING([whether to include more Google Noto fonts])
12825 if test "$enable_noto_font" = "" -o "$enable_noto_font" = "no" -o "$with_fonts" = "no"; then
12826 AC_MSG_RESULT([no])
12829 AC_MSG_RESULT([yes])
12830 WITH_NOTO_FONT=TRUE
12831 BUILD_TYPE="$BUILD_TYPE NOTO_FONT"
12832 SCPDEFS="$SCPDEFS -DWITH_NOTO_FONT"
12834 AC_SUBST(WITH_NOTO_FONT)
12836 dnl ===================================================================
12837 dnl Test whether to enable online update service
12838 dnl ===================================================================
12839 AC_MSG_CHECKING([whether to enable online update])
12840 ENABLE_ONLINE_UPDATE=
12841 ENABLE_ONLINE_UPDATE_MAR=
12843 if test "$enable_online_update" = ""; then
12844 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
12845 AC_MSG_RESULT([yes])
12846 ENABLE_ONLINE_UPDATE="TRUE"
12848 AC_MSG_RESULT([no])
12851 if test "$enable_online_update" = "mar"; then
12852 AC_MSG_RESULT([yes - MAR-based online update])
12853 ENABLE_ONLINE_UPDATE_MAR="TRUE"
12854 if test "$with_update_config" = ""; then
12855 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
12857 UPDATE_CONFIG="$with_update_config"
12858 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
12859 elif test "$enable_online_update" = "yes"; then
12860 AC_MSG_RESULT([yes])
12861 ENABLE_ONLINE_UPDATE="TRUE"
12863 AC_MSG_RESULT([no])
12866 AC_SUBST(ENABLE_ONLINE_UPDATE)
12867 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
12868 AC_SUBST(UPDATE_CONFIG)
12870 dnl ===================================================================
12871 dnl Test whether we need bzip2
12872 dnl ===================================================================
12874 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
12875 AC_MSG_CHECKING([whether to use system bzip2])
12876 if test "$with_system_bzip2" = yes; then
12878 AC_MSG_RESULT([yes])
12879 PKG_CHECK_MODULES(BZIP2, bzip2)
12880 FilterLibs "${BZIP2_LIBS}"
12881 BZIP2_LIBS="${filteredlibs}"
12883 AC_MSG_RESULT([no])
12884 BUILD_TYPE="$BUILD_TYPE BZIP2"
12887 AC_SUBST(SYSTEM_BZIP2)
12888 AC_SUBST(BZIP2_CFLAGS)
12889 AC_SUBST(BZIP2_LIBS)
12891 dnl ===================================================================
12892 dnl Test whether to enable extension update
12893 dnl ===================================================================
12894 AC_MSG_CHECKING([whether to enable extension update])
12895 ENABLE_EXTENSION_UPDATE=
12896 if test "x$enable_extension_update" = "xno"; then
12897 AC_MSG_RESULT([no])
12899 AC_MSG_RESULT([yes])
12900 ENABLE_EXTENSION_UPDATE="TRUE"
12901 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
12902 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
12904 AC_SUBST(ENABLE_EXTENSION_UPDATE)
12907 dnl ===================================================================
12908 dnl Test whether to create MSI with LIMITUI=1 (silent install)
12909 dnl ===================================================================
12910 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
12911 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
12912 AC_MSG_RESULT([no])
12915 AC_MSG_RESULT([yes])
12916 ENABLE_SILENT_MSI=TRUE
12917 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
12919 AC_SUBST(ENABLE_SILENT_MSI)
12921 AC_MSG_CHECKING([whether and how to use Xinerama])
12922 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
12923 if test "$x_libraries" = "default_x_libraries"; then
12924 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
12925 if test "x$XINERAMALIB" = x; then
12926 XINERAMALIB="/usr/lib"
12929 XINERAMALIB="$x_libraries"
12931 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
12932 # we have both versions, let the user decide but use the dynamic one
12935 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
12936 XINERAMA_LINK=dynamic
12938 XINERAMA_LINK=static
12940 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
12941 # we have only the dynamic version
12943 XINERAMA_LINK=dynamic
12944 elif test -e "$XINERAMALIB/libXinerama.a"; then
12946 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
12948 XINERAMA_LINK=static
12958 if test "$USE_XINERAMA" = "TRUE"; then
12959 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
12960 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
12961 [AC_MSG_ERROR(Xinerama header not found.)], [])
12962 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
12963 if test "x$XEXTLIB" = x; then
12964 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
12966 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
12967 if test "$_os" = "FreeBSD"; then
12968 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
12970 if test "$_os" = "Linux"; then
12971 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
12973 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
12974 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
12976 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
12981 AC_MSG_RESULT([no])
12983 AC_SUBST(USE_XINERAMA)
12984 AC_SUBST(XINERAMA_LINK)
12986 dnl ===================================================================
12987 dnl Test whether to build cairo or rely on the system version
12988 dnl ===================================================================
12990 if test "$USING_X11" = TRUE; then
12991 # Used in vcl/Library_vclplug_gen.mk
12995 if test "$test_cairo" = "yes"; then
12996 AC_MSG_CHECKING([whether to use the system cairo])
12998 : ${with_system_cairo:=$with_system_libs}
12999 if test "$with_system_cairo" = "yes"; then
13001 AC_MSG_RESULT([yes])
13003 PKG_CHECK_MODULES( CAIRO, cairo >= 1.8.0 )
13004 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13005 FilterLibs "${CAIRO_LIBS}"
13006 CAIRO_LIBS="${filteredlibs}"
13008 if test "$test_xrender" = "yes"; then
13009 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
13011 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
13012 #ifdef PictStandardA8
13016 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
13022 AC_MSG_RESULT([no])
13024 BUILD_TYPE="$BUILD_TYPE CAIRO"
13028 AC_SUBST(SYSTEM_CAIRO)
13029 AC_SUBST(CAIRO_CFLAGS)
13030 AC_SUBST(CAIRO_LIBS)
13032 dnl ===================================================================
13033 dnl Test whether to use avahi
13034 dnl ===================================================================
13035 if test "$_os" = "WINNT"; then
13036 # Windows uses bundled mDNSResponder
13037 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
13038 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
13039 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
13040 [ENABLE_AVAHI="TRUE"])
13041 AC_DEFINE(HAVE_FEATURE_AVAHI)
13042 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13043 FilterLibs "${AVAHI_LIBS}"
13044 AVAHI_LIBS="${filteredlibs}"
13047 AC_SUBST(ENABLE_AVAHI)
13048 AC_SUBST(AVAHI_CFLAGS)
13049 AC_SUBST(AVAHI_LIBS)
13051 dnl ===================================================================
13052 dnl Test whether to use liblangtag
13053 dnl ===================================================================
13055 AC_MSG_CHECKING([whether to use system liblangtag])
13056 if test "$with_system_liblangtag" = yes; then
13057 SYSTEM_LIBLANGTAG=TRUE
13058 AC_MSG_RESULT([yes])
13059 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
13060 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
13061 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
13062 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13063 FilterLibs "${LIBLANGTAG_LIBS}"
13064 LIBLANGTAG_LIBS="${filteredlibs}"
13067 AC_MSG_RESULT([no])
13068 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
13069 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
13070 if test "$COM" = "MSC"; then
13071 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
13073 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
13076 AC_SUBST(SYSTEM_LIBLANGTAG)
13077 AC_SUBST(LIBLANGTAG_CFLAGS)
13078 AC_SUBST(LIBLANGTAG_LIBS)
13080 dnl ===================================================================
13081 dnl Test whether to build libpng or rely on the system version
13082 dnl ===================================================================
13084 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
13086 dnl ===================================================================
13087 dnl Check for runtime JVM search path
13088 dnl ===================================================================
13089 if test "$ENABLE_JAVA" != ""; then
13090 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
13091 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
13092 AC_MSG_RESULT([yes])
13093 if ! test -d "$with_jvm_path"; then
13094 AC_MSG_ERROR(["$with_jvm_path" not a directory])
13096 if ! test -d "$with_jvm_path"jvm; then
13097 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
13099 JVM_ONE_PATH_CHECK="$with_jvm_path"
13100 AC_SUBST(JVM_ONE_PATH_CHECK)
13102 AC_MSG_RESULT([no])
13106 dnl ===================================================================
13107 dnl Test for the presence of Ant and that it works
13108 dnl ===================================================================
13110 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE" -a "$cross_compiling" != "yes"; then
13111 ANT_HOME=; export ANT_HOME
13112 WITH_ANT_HOME=; export WITH_ANT_HOME
13113 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
13114 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
13115 if test "$_os" = "WINNT"; then
13116 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
13118 with_ant_home="$LODE_HOME/opt/ant"
13120 elif test -x "$LODE_HOME/opt/bin/ant" ; then
13121 with_ant_home="$LODE_HOME/opt/ant"
13124 if test -z "$with_ant_home"; then
13125 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
13127 if test "$_os" = "WINNT"; then
13128 # AC_PATH_PROGS needs unix path
13129 with_ant_home=`cygpath -u "$with_ant_home"`
13131 AbsolutePath "$with_ant_home"
13132 with_ant_home=$absolute_path
13133 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
13134 WITH_ANT_HOME=$with_ant_home
13135 ANT_HOME=$with_ant_home
13138 if test -z "$ANT"; then
13139 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
13141 # resolve relative or absolute symlink
13142 while test -h "$ANT"; do
13144 a_basename=`basename "$ANT"`
13145 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
13146 cd "`dirname "$ANT"`"
13147 cd "`dirname "$a_script"`"
13148 ANT="`pwd`"/"`basename "$a_script"`"
13152 AC_MSG_CHECKING([if $ANT works])
13153 mkdir -p conftest.dir
13156 cat > conftest.java << EOF
13157 public class conftest {
13158 int testmethod(int a, int b) {
13164 cat > conftest.xml << EOF
13165 <project name="conftest" default="conftest">
13166 <target name="conftest">
13167 <javac srcdir="." includes="conftest.java">
13173 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
13174 if test $? = 0 -a -f ./conftest.class; then
13175 AC_MSG_RESULT([Ant works])
13176 if test -z "$WITH_ANT_HOME"; then
13177 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
13178 if test -z "$ANT_HOME"; then
13179 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
13182 ANT_HOME="$WITH_ANT_HOME"
13185 echo "configure: Ant test failed" >&5
13186 cat conftest.java >&5
13187 cat conftest.xml >&5
13188 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
13191 rm -fr conftest.dir
13193 if test -z "$ANT_HOME"; then
13194 ANT_HOME="NO_ANT_HOME"
13196 PathFormat "$ANT_HOME"
13197 ANT_HOME="$formatted_path"
13199 ANT="$formatted_path"
13202 dnl Checking for ant.jar
13203 if test "$ANT_HOME" != "NO_ANT_HOME"; then
13204 AC_MSG_CHECKING([Ant lib directory])
13205 if test -f $ANT_HOME/lib/ant.jar; then
13206 ANT_LIB="$ANT_HOME/lib"
13208 if test -f $ANT_HOME/ant.jar; then
13209 ANT_LIB="$ANT_HOME"
13211 if test -f /usr/share/java/ant.jar; then
13212 ANT_LIB=/usr/share/java
13214 if test -f /usr/share/ant-core/lib/ant.jar; then
13215 ANT_LIB=/usr/share/ant-core/lib
13217 if test -f $ANT_HOME/lib/ant/ant.jar; then
13218 ANT_LIB="$ANT_HOME/lib/ant"
13220 if test -f /usr/share/lib/ant/ant.jar; then
13221 ANT_LIB=/usr/share/lib/ant
13223 AC_MSG_ERROR([Ant libraries not found!])
13230 PathFormat "$ANT_LIB"
13231 ANT_LIB="$formatted_path"
13232 AC_MSG_RESULT([Ant lib directory found.])
13236 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
13238 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
13239 ant_version=`"$ANT" -version | $AWK '$3 == "version" { print $4; }'`
13240 ant_version_major=`echo $ant_version | cut -d. -f1`
13241 ant_version_minor=`echo $ant_version | cut -d. -f2`
13242 echo "configure: ant_version $ant_version " >&5
13243 echo "configure: ant_version_major $ant_version_major " >&5
13244 echo "configure: ant_version_minor $ant_version_minor " >&5
13245 if test "$ant_version_major" -ge "2"; then
13246 AC_MSG_RESULT([yes, $ant_version])
13247 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
13248 AC_MSG_RESULT([yes, $ant_version])
13250 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
13253 rm -f conftest* core core.* *.core
13261 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no" -a "$cross_compiling" != "yes"; then
13262 AC_MSG_CHECKING([for JUnit 4])
13263 if test "$with_junit" = "yes"; then
13264 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
13265 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
13266 elif test -e /usr/share/java/junit4.jar; then
13267 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
13269 if test -e /usr/share/lib/java/junit.jar; then
13270 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
13272 OOO_JUNIT_JAR=/usr/share/java/junit.jar
13276 OOO_JUNIT_JAR=$with_junit
13278 if test "$_os" = "WINNT"; then
13279 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
13281 printf 'import org.junit.Before;' > conftest.java
13282 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
13283 AC_MSG_RESULT([$OOO_JUNIT_JAR])
13286 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
13287 specify its pathname via --with-junit=..., or disable it via --without-junit])
13289 rm -f conftest.class conftest.java
13290 if test $OOO_JUNIT_JAR != ""; then
13291 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
13294 AC_MSG_CHECKING([for included Hamcrest])
13295 printf 'import org.hamcrest.BaseDescription;' > conftest.java
13296 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
13297 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
13299 AC_MSG_RESULT([Not included])
13300 AC_MSG_CHECKING([for standalone hamcrest jar.])
13301 if test "$with_hamcrest" = "yes"; then
13302 if test -e /usr/share/lib/java/hamcrest.jar; then
13303 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
13304 elif test -e /usr/share/java/hamcrest/core.jar; then
13305 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
13306 elif test -e /usr/share/java/hamcrest/hamcrest.jar; then
13307 HAMCREST_JAR=/usr/share/java/hamcrest/hamcrest.jar
13309 HAMCREST_JAR=/usr/share/java/hamcrest.jar
13312 HAMCREST_JAR=$with_hamcrest
13314 if test "$_os" = "WINNT"; then
13315 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
13317 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
13318 AC_MSG_RESULT([$HAMCREST_JAR])
13320 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),
13321 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
13324 rm -f conftest.class conftest.java
13326 AC_SUBST(OOO_JUNIT_JAR)
13327 AC_SUBST(HAMCREST_JAR)
13333 # check for wget and curl
13338 if test "$enable_fetch_external" != "no"; then
13340 CURL=`which curl 2>/dev/null`
13342 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
13344 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
13345 if test $? -eq 0; then
13351 if test -z "$WGET" -a -z "$CURL"; then
13352 AC_MSG_ERROR([neither wget nor curl found!])
13361 # check for sha256sum
13365 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
13366 eval "$i -a 256 --version" > /dev/null 2>&1
13368 if test $ret -eq 0; then
13369 SHA256SUM="$i -a 256"
13374 if test -z "$SHA256SUM"; then
13375 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
13376 eval "$i --version" > /dev/null 2>&1
13378 if test $ret -eq 0; then
13385 if test -z "$SHA256SUM"; then
13386 AC_MSG_ERROR([no sha256sum found!])
13389 AC_SUBST(SHA256SUM)
13391 dnl ===================================================================
13392 dnl Dealing with l10n options
13393 dnl ===================================================================
13394 AC_MSG_CHECKING([which languages to be built])
13395 # get list of all languages
13396 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
13397 # the sed command does the following:
13398 # + if a line ends with a backslash, append the next line to it
13399 # + adds " on the beginning of the value (after =)
13400 # + adds " at the end of the value
13401 # + removes en-US; we want to put it on the beginning
13402 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
13403 [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)]
13404 ALL_LANGS="en-US $completelangiso"
13405 # check the configured localizations
13406 WITH_LANG="$with_lang"
13408 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
13409 # (Norwegian is "nb" and "nn".)
13410 if test "$WITH_LANG" = "no"; then
13414 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
13415 AC_MSG_RESULT([en-US])
13417 AC_MSG_RESULT([$WITH_LANG])
13418 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
13419 if test -z "$MSGFMT"; then
13420 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
13421 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
13422 elif test -x "/opt/lo/bin/msgfmt"; then
13423 MSGFMT="/opt/lo/bin/msgfmt"
13425 AC_CHECK_PROGS(MSGFMT, [msgfmt])
13426 if test -z "$MSGFMT"; then
13427 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
13431 if test -z "$MSGUNIQ"; then
13432 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
13433 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
13434 elif test -x "/opt/lo/bin/msguniq"; then
13435 MSGUNIQ="/opt/lo/bin/msguniq"
13437 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
13438 if test -z "$MSGUNIQ"; then
13439 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
13446 # check that the list is valid
13447 for lang in $WITH_LANG; do
13448 test "$lang" = "ALL" && continue
13449 # need to check for the exact string, so add space before and after the list of all languages
13450 for vl in $ALL_LANGS; do
13451 if test "$vl" = "$lang"; then
13455 if test "$vl" != "$lang"; then
13456 # if you're reading this - you prolly quoted your languages remove the quotes ...
13457 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
13460 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
13461 echo $WITH_LANG | grep -q en-US
13462 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
13464 # list with substituted ALL
13465 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
13466 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
13467 test "$WITH_LANG" = "en-US" && WITH_LANG=
13468 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
13469 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
13470 ALL_LANGS=`echo $ALL_LANGS qtz`
13472 AC_SUBST(ALL_LANGS)
13473 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
13474 AC_SUBST(WITH_LANG)
13475 AC_SUBST(WITH_LANG_LIST)
13476 AC_SUBST(GIT_NEEDED_SUBMODULES)
13478 WITH_POOR_HELP_LOCALIZATIONS=
13479 if test -d "$SRC_ROOT/translations/source"; then
13480 for l in `ls -1 $SRC_ROOT/translations/source`; do
13481 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
13482 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
13486 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
13488 if test -n "$with_locales"; then
13489 WITH_LOCALES="$with_locales"
13491 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
13492 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
13493 # config_host/config_locales.h.in
13494 for locale in $WITH_LOCALES; do
13497 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
13501 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
13504 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
13509 AC_DEFINE(WITH_LOCALE_ALL)
13511 AC_SUBST(WITH_LOCALES)
13513 dnl git submodule update --reference
13514 dnl ===================================================================
13515 if test -n "${GIT_REFERENCE_SRC}"; then
13516 for repo in ${GIT_NEEDED_SUBMODULES}; do
13517 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
13518 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
13522 AC_SUBST(GIT_REFERENCE_SRC)
13524 dnl git submodules linked dirs
13525 dnl ===================================================================
13526 if test -n "${GIT_LINK_SRC}"; then
13527 for repo in ${GIT_NEEDED_SUBMODULES}; do
13528 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
13529 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
13533 AC_SUBST(GIT_LINK_SRC)
13536 dnl ===================================================================
13537 AC_MSG_CHECKING([for alternative branding images directory])
13538 # initialize mapped arrays
13539 BRAND_INTRO_IMAGES="intro.png intro-highres.png"
13540 brand_files="$BRAND_INTRO_IMAGES logo.svg logo_inverted.svg logo-sc.svg logo-sc_inverted.svg about.svg"
13542 if test -z "$with_branding" -o "$with_branding" = "no"; then
13543 AC_MSG_RESULT([none])
13544 DEFAULT_BRAND_IMAGES="$brand_files"
13546 if ! test -d $with_branding ; then
13547 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
13549 AC_MSG_RESULT([$with_branding])
13550 CUSTOM_BRAND_DIR="$with_branding"
13551 for lfile in $brand_files
13553 if ! test -f $with_branding/$lfile ; then
13554 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
13555 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
13557 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
13560 check_for_progress="yes"
13563 AC_SUBST([BRAND_INTRO_IMAGES])
13564 AC_SUBST([CUSTOM_BRAND_DIR])
13565 AC_SUBST([CUSTOM_BRAND_IMAGES])
13566 AC_SUBST([DEFAULT_BRAND_IMAGES])
13569 AC_MSG_CHECKING([for 'intro' progress settings])
13573 PROGRESSFRAMECOLOR=
13575 PROGRESSTEXTBASELINE=
13577 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
13578 source "$with_branding/progress.conf"
13579 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
13581 AC_MSG_RESULT([none])
13584 AC_SUBST(PROGRESSBARCOLOR)
13585 AC_SUBST(PROGRESSSIZE)
13586 AC_SUBST(PROGRESSPOSITION)
13587 AC_SUBST(PROGRESSFRAMECOLOR)
13588 AC_SUBST(PROGRESSTEXTCOLOR)
13589 AC_SUBST(PROGRESSTEXTBASELINE)
13592 dnl ===================================================================
13593 dnl Custom build version
13594 dnl ===================================================================
13595 AC_MSG_CHECKING([for extra build ID])
13596 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
13597 EXTRA_BUILDID="$with_extra_buildid"
13599 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
13600 if test -n "$EXTRA_BUILDID" ; then
13601 AC_MSG_RESULT([$EXTRA_BUILDID])
13603 AC_MSG_RESULT([not set])
13605 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
13608 AC_MSG_CHECKING([for vendor])
13609 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
13610 OOO_VENDOR="$USERNAME"
13612 if test -z "$OOO_VENDOR"; then
13616 if test -z "$OOO_VENDOR"; then
13617 OOO_VENDOR="`id -u -n`"
13620 AC_MSG_RESULT([not set, using $OOO_VENDOR])
13622 OOO_VENDOR="$with_vendor"
13623 AC_MSG_RESULT([$OOO_VENDOR])
13625 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
13626 AC_SUBST(OOO_VENDOR)
13628 if test "$_os" = "Android" ; then
13629 ANDROID_PACKAGE_NAME=
13630 AC_MSG_CHECKING([for Android package name])
13631 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
13632 if test -n "$ENABLE_DEBUG"; then
13633 # Default to the package name that makes ndk-gdb happy.
13634 ANDROID_PACKAGE_NAME="org.libreoffice"
13636 ANDROID_PACKAGE_NAME="org.example.libreoffice"
13639 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
13641 ANDROID_PACKAGE_NAME="$with_android_package_name"
13642 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
13644 AC_SUBST(ANDROID_PACKAGE_NAME)
13647 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
13648 if test "$with_compat_oowrappers" = "yes"; then
13649 WITH_COMPAT_OOWRAPPERS=TRUE
13652 WITH_COMPAT_OOWRAPPERS=
13655 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
13657 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{gsub(" ", "", $0);print tolower($0)}'`
13658 AC_MSG_CHECKING([for install dirname])
13659 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
13660 INSTALLDIRNAME="$with_install_dirname"
13662 AC_MSG_RESULT([$INSTALLDIRNAME])
13663 AC_SUBST(INSTALLDIRNAME)
13665 AC_MSG_CHECKING([for prefix])
13666 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13667 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
13668 PREFIXDIR="$prefix"
13669 AC_MSG_RESULT([$PREFIXDIR])
13670 AC_SUBST(PREFIXDIR)
13672 LIBDIR=[$(eval echo $(eval echo $libdir))]
13675 DATADIR=[$(eval echo $(eval echo $datadir))]
13678 MANDIR=[$(eval echo $(eval echo $mandir))]
13681 DOCDIR=[$(eval echo $(eval echo $docdir))]
13684 BINDIR=[$(eval echo $(eval echo $bindir))]
13687 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
13688 AC_SUBST(INSTALLDIR)
13690 TESTINSTALLDIR="${BUILDDIR}/test-install"
13691 AC_SUBST(TESTINSTALLDIR)
13694 # ===================================================================
13695 # OAuth2 id and secrets
13696 # ===================================================================
13698 AC_MSG_CHECKING([for Google Drive client id and secret])
13699 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
13700 AC_MSG_RESULT([not set])
13701 GDRIVE_CLIENT_ID="\"\""
13702 GDRIVE_CLIENT_SECRET="\"\""
13704 AC_MSG_RESULT([set])
13705 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
13706 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
13708 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
13709 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
13711 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
13712 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
13713 AC_MSG_RESULT([not set])
13714 ALFRESCO_CLOUD_CLIENT_ID="\"\""
13715 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
13717 AC_MSG_RESULT([set])
13718 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
13719 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
13721 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
13722 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
13724 AC_MSG_CHECKING([for OneDrive client id and secret])
13725 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
13726 AC_MSG_RESULT([not set])
13727 ONEDRIVE_CLIENT_ID="\"\""
13728 ONEDRIVE_CLIENT_SECRET="\"\""
13730 AC_MSG_RESULT([set])
13731 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
13732 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
13734 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
13735 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
13738 dnl ===================================================================
13739 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
13740 dnl --enable-dependency-tracking configure option
13741 dnl ===================================================================
13742 AC_MSG_CHECKING([whether to enable dependency tracking])
13743 if test "$enable_dependency_tracking" = "no"; then
13745 AC_MSG_RESULT([no])
13747 AC_MSG_RESULT([yes])
13751 dnl ===================================================================
13752 dnl Number of CPUs to use during the build
13753 dnl ===================================================================
13754 AC_MSG_CHECKING([for number of processors to use])
13755 # plain --with-parallelism is just the default
13756 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
13757 if test "$with_parallelism" = "no"; then
13760 PARALLELISM=$with_parallelism
13763 if test "$enable_icecream" = "yes"; then
13768 Darwin|FreeBSD|NetBSD|OpenBSD)
13769 PARALLELISM=`sysctl -n hw.ncpu`
13773 PARALLELISM=`getconf _NPROCESSORS_ONLN`
13775 # what else than above does profit here *and* has /proc?
13777 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
13781 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
13782 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
13786 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
13787 if test -z "$with_parallelism"; then
13788 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
13789 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
13792 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."
13796 if test $PARALLELISM -eq 0; then
13797 AC_MSG_RESULT([explicit make -j option needed])
13799 AC_MSG_RESULT([$PARALLELISM])
13801 AC_SUBST(PARALLELISM)
13803 IWYU_PATH="$with_iwyu"
13804 AC_SUBST(IWYU_PATH)
13805 if test ! -z "$IWYU_PATH"; then
13806 if test ! -f "$IWYU_PATH"; then
13807 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
13812 # Set up ILIB for MSVC build
13815 if test "$build_os" = "cygwin"; then
13817 if test -n "$JAVA_HOME"; then
13818 ILIB="$ILIB;$JAVA_HOME/lib"
13821 ILIB="$ILIB;$COMPATH/lib/$WIN_HOST_ARCH"
13822 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/$WIN_HOST_ARCH"
13823 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
13824 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
13825 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
13826 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
13827 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
13829 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/$WIN_HOST_ARCH"
13830 ucrtlibpath_formatted=$formatted_path
13831 ILIB="$ILIB;$ucrtlibpath_formatted"
13832 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
13833 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
13834 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
13836 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WIN_HOST_ARCH"
13839 if test "$cross_compiling" != "yes"; then
13840 ILIB_FOR_BUILD="$ILIB"
13844 AC_SUBST(ILIB_FOR_BUILD)
13846 # ===================================================================
13847 # Creating bigger shared library to link against
13848 # ===================================================================
13849 AC_MSG_CHECKING([whether to create huge library])
13852 if test $_os = iOS -o $_os = Android; then
13853 # Never any point in mergelibs for these as we build just static
13854 # libraries anyway...
13855 enable_mergelibs=no
13858 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
13859 if test $_os != Linux -a $_os != WINNT; then
13860 add_warning "--enable-mergelibs is not tested for this platform"
13863 AC_MSG_RESULT([yes])
13864 AC_DEFINE(ENABLE_MERGELIBS)
13866 AC_MSG_RESULT([no])
13868 AC_SUBST([MERGELIBS])
13870 dnl ===================================================================
13871 dnl icerun is a wrapper that stops us spawning tens of processes
13872 dnl locally - for tools that can't be executed on the compile cluster
13873 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
13874 dnl ===================================================================
13875 AC_MSG_CHECKING([whether to use icerun wrapper])
13877 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
13878 ICECREAM_RUN=icerun
13879 AC_MSG_RESULT([yes])
13881 AC_MSG_RESULT([no])
13883 AC_SUBST(ICECREAM_RUN)
13885 dnl ===================================================================
13886 dnl Setup the ICECC_VERSION for the build the same way it was set for
13887 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
13888 dnl ===================================================================
13889 x_ICECC_VERSION=[\#]
13890 if test -n "$ICECC_VERSION" ; then
13893 AC_SUBST(x_ICECC_VERSION)
13894 AC_SUBST(ICECC_VERSION)
13896 dnl ===================================================================
13898 AC_MSG_CHECKING([MPL subset])
13901 if test "$enable_mpl_subset" = "yes"; then
13903 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
13905 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
13908 if test "$warn_report" = "true"; then
13909 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
13911 if test "x$enable_postgresql_sdbc" != "xno"; then
13912 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
13914 if test "$enable_lotuswordpro" = "yes"; then
13915 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
13917 if test "$WITH_WEBDAV" = "neon"; then
13918 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
13920 if test -n "$ENABLE_POPPLER"; then
13921 if test "x$SYSTEM_POPPLER" = "x"; then
13922 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
13925 # cf. m4/libo_check_extension.m4
13926 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
13927 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
13929 for theme in $WITH_THEMES; do
13931 breeze|breeze_dark|breeze_dark_svg|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg) #denylist of icon themes under GPL or LGPL
13932 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=colibre]) ;;
13937 ENABLE_OPENGL_TRANSITIONS=
13939 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
13940 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
13944 AC_DEFINE(MPL_HAVE_SUBSET)
13945 AC_MSG_RESULT([only])
13947 AC_MSG_RESULT([no restrictions])
13949 AC_SUBST(MPL_SUBSET)
13951 dnl ===================================================================
13953 AC_MSG_CHECKING([formula logger])
13954 ENABLE_FORMULA_LOGGER=
13956 if test "x$enable_formula_logger" = "xyes"; then
13957 AC_MSG_RESULT([yes])
13958 AC_DEFINE(ENABLE_FORMULA_LOGGER)
13959 ENABLE_FORMULA_LOGGER=TRUE
13960 elif test -n "$ENABLE_DBGUTIL" ; then
13961 AC_MSG_RESULT([yes])
13962 AC_DEFINE(ENABLE_FORMULA_LOGGER)
13963 ENABLE_FORMULA_LOGGER=TRUE
13965 AC_MSG_RESULT([no])
13968 AC_SUBST(ENABLE_FORMULA_LOGGER)
13970 dnl ===================================================================
13971 dnl Checking for active Antivirus software.
13972 dnl ===================================================================
13974 if test $_os = WINNT -a -f "$SRC_ROOT/antivirusDetection.vbs" ; then
13975 AC_MSG_CHECKING([for active Antivirus software])
13976 ANTIVIRUS_LIST=`cscript.exe //Nologo $SRC_ROOT/antivirusDetection.vbs`
13977 if [ [ "$ANTIVIRUS_LIST" != "NULL" ] ]; then
13978 if [ [ "$ANTIVIRUS_LIST" != "NOT_FOUND" ] ]; then
13979 AC_MSG_RESULT([found])
13980 EICAR_STRING='X5O!P%@AP@<:@4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
13981 echo $EICAR_STRING > $SRC_ROOT/eicar
13982 EICAR_TEMP_FILE_CONTENTS=`cat $SRC_ROOT/eicar`
13984 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
13985 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
13987 echo $EICAR_STRING > $BUILDDIR/eicar
13988 EICAR_TEMP_FILE_CONTENTS=`cat $BUILDDIR/eicar`
13990 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
13991 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
13993 add_warning "To speed up builds and avoid failures in unit tests, it is highly recommended that you exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST"
13995 AC_MSG_RESULT([not found])
13998 AC_MSG_RESULT([n/a])
14002 dnl ===================================================================
14003 dnl Setting up the environment.
14004 dnl ===================================================================
14005 AC_MSG_NOTICE([setting up the build environment variables...])
14009 if test "$build_os" = "cygwin"; then
14010 if test -d "$COMPATH/atlmfc/lib/spectre"; then
14011 ATL_LIB="$COMPATH/atlmfc/lib/spectre"
14012 ATL_INCLUDE="$COMPATH/atlmfc/include"
14013 elif test -d "$COMPATH/atlmfc/lib"; then
14014 ATL_LIB="$COMPATH/atlmfc/lib"
14015 ATL_INCLUDE="$COMPATH/atlmfc/include"
14017 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
14018 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
14020 ATL_LIB="$ATL_LIB/$WIN_HOST_ARCH"
14021 ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
14022 ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
14024 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
14025 PathFormat "/usr/bin/find.exe"
14026 FIND="$formatted_path"
14027 PathFormat "/usr/bin/sort.exe"
14028 SORT="$formatted_path"
14029 PathFormat "/usr/bin/grep.exe"
14030 WIN_GREP="$formatted_path"
14031 PathFormat "/usr/bin/ls.exe"
14032 WIN_LS="$formatted_path"
14033 PathFormat "/usr/bin/touch.exe"
14034 WIN_TOUCH="$formatted_path"
14040 AC_SUBST(ATL_INCLUDE)
14046 AC_SUBST(WIN_TOUCH)
14048 AC_SUBST(BUILD_TYPE)
14053 PERL="$formatted_path"
14056 if test -n "$TMPDIR"; then
14057 TEMP_DIRECTORY="$TMPDIR"
14059 TEMP_DIRECTORY="/tmp"
14061 if test "$build_os" = "cygwin"; then
14062 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
14064 AC_SUBST(TEMP_DIRECTORY)
14066 # setup the PATH for the environment
14067 if test -n "$LO_PATH_FOR_BUILD"; then
14068 LO_PATH="$LO_PATH_FOR_BUILD"
14071 pathmunge "$MSVC_HOST_PATH" "before"
14079 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
14080 if test "$ENABLE_JAVA" != ""; then
14081 pathmunge "$JAVA_HOME/bin" "after"
14086 # Win32 make needs native paths
14087 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
14088 LO_PATH=`cygpath -p -m "$PATH"`
14090 if test "$WIN_BUILD_ARCH" = "x64"; then
14091 # needed for msi packaging
14092 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
14094 # .NET 4.6 and higher don't have bin directory
14095 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
14096 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
14098 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
14099 pathmunge "$CSC_PATH" "before"
14100 pathmunge "$MIDL_PATH" "before"
14101 pathmunge "$AL_PATH" "before"
14102 pathmunge "$MSVC_MULTI_PATH" "before"
14103 pathmunge "$MSVC_BUILD_PATH" "before"
14104 if test -n "$MSBUILD_PATH" ; then
14105 pathmunge "$MSBUILD_PATH" "before"
14107 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/$WIN_BUILD_ARCH" "before"
14108 if test "$ENABLE_JAVA" != ""; then
14109 if test -d "$JAVA_HOME/jre/bin/client"; then
14110 pathmunge "$JAVA_HOME/jre/bin/client" "before"
14112 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
14113 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
14115 pathmunge "$JAVA_HOME/bin" "before"
14117 pathmunge "$MSVC_HOST_PATH" "before"
14121 pathmunge "/usr/css/bin" "before"
14122 if test "$ENABLE_JAVA" != ""; then
14123 pathmunge "$JAVA_HOME/bin" "after"
14131 # Allow to pass LO_ELFCHECK_ALLOWLIST from autogen.input to bin/check-elf-dynamic-objects:
14132 if test "$LO_ELFCHECK_ALLOWLIST" = x || test "${LO_ELFCHECK_ALLOWLIST-x}" != x; then
14133 x_LO_ELFCHECK_ALLOWLIST=
14135 x_LO_ELFCHECK_ALLOWLIST=[\#]
14137 AC_SUBST(x_LO_ELFCHECK_ALLOWLIST)
14138 AC_SUBST(LO_ELFCHECK_ALLOWLIST)
14142 # Generate a configuration sha256 we can use for deps
14143 if test -f config_host.mk; then
14144 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
14146 if test -f config_host_lang.mk; then
14147 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
14150 CFLAGS=$my_original_CFLAGS
14151 CXXFLAGS=$my_original_CXXFLAGS
14152 CPPFLAGS=$my_original_CPPFLAGS
14154 AC_CONFIG_LINKS([include:include])
14156 # Keep in sync with list of files far up, at AC_MSG_CHECKING([for
14157 # BUILD platform configuration] - otherwise breaks cross building
14158 AC_CONFIG_FILES([config_host.mk
14159 config_host_lang.mk
14161 bin/bffvalidator.sh
14162 bin/odfvalidator.sh
14164 hardened_runtime.xcent
14165 instsetoo_native/util/openoffice.lst
14166 setup_native/source/packinfo/finals_instsetoo.txt
14167 sysui/desktop/macosx/Info.plist])
14168 AC_CONFIG_HEADERS([config_host/config_buildid.h])
14169 AC_CONFIG_HEADERS([config_host/config_box2d.h])
14170 AC_CONFIG_HEADERS([config_host/config_clang.h])
14171 AC_CONFIG_HEADERS([config_host/config_dconf.h])
14172 AC_CONFIG_HEADERS([config_host/config_eot.h])
14173 AC_CONFIG_HEADERS([config_host/config_extensions.h])
14174 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
14175 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
14176 AC_CONFIG_HEADERS([config_host/config_dbus.h])
14177 AC_CONFIG_HEADERS([config_host/config_features.h])
14178 AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
14179 AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
14180 AC_CONFIG_HEADERS([config_host/config_firebird.h])
14181 AC_CONFIG_HEADERS([config_host/config_folders.h])
14182 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
14183 AC_CONFIG_HEADERS([config_host/config_gio.h])
14184 AC_CONFIG_HEADERS([config_host/config_global.h])
14185 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
14186 AC_CONFIG_HEADERS([config_host/config_java.h])
14187 AC_CONFIG_HEADERS([config_host/config_langs.h])
14188 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
14189 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
14190 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
14191 AC_CONFIG_HEADERS([config_host/config_locales.h])
14192 AC_CONFIG_HEADERS([config_host/config_mpl.h])
14193 AC_CONFIG_HEADERS([config_host/config_oox.h])
14194 AC_CONFIG_HEADERS([config_host/config_options.h])
14195 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
14196 AC_CONFIG_HEADERS([config_host/config_qrcodegen.h])
14197 AC_CONFIG_HEADERS([config_host/config_skia.h])
14198 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
14199 AC_CONFIG_HEADERS([config_host/config_vendor.h])
14200 AC_CONFIG_HEADERS([config_host/config_vcl.h])
14201 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
14202 AC_CONFIG_HEADERS([config_host/config_version.h])
14203 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
14204 AC_CONFIG_HEADERS([config_host/config_poppler.h])
14205 AC_CONFIG_HEADERS([config_host/config_python.h])
14206 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
14209 if test "$CROSS_COMPILING" = TRUE; then
14210 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
14213 # touch the config timestamp file
14214 if test ! -f config_host.mk.stamp; then
14215 echo > config_host.mk.stamp
14216 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
14217 echo "Host Configuration unchanged - avoiding scp2 stamp update"
14219 echo > config_host.mk.stamp
14222 # touch the config lang timestamp file
14223 if test ! -f config_host_lang.mk.stamp; then
14224 echo > config_host_lang.mk.stamp
14225 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
14226 echo "Language Configuration unchanged - avoiding scp2 stamp update"
14228 echo > config_host_lang.mk.stamp
14232 if test \( "$STALE_MAKE" = "TRUE" -o "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE" \) \
14233 -a "$build_os" = "cygwin"; then
14236 ****************************************************************************
14238 Your make version is known to be horribly slow, and hard to debug
14239 problems with. To get a reasonably functional make please do:
14241 to install a pre-compiled binary make for Win32
14243 mkdir -p /opt/lo/bin
14245 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
14246 cp make-4.2.1-msvc.exe make
14249 to install from source:
14250 place yourself in a working directory of you choice.
14252 git clone git://git.savannah.gnu.org/make.git
14254 [go to Start menu, open "Visual Studio 2019", click "x86 Native Tools Command Prompt" or "x64 Native Tools Command Prompt"]
14255 set PATH=%PATH%;C:\Cygwin\bin
14256 [or Cygwin64, if that is what you have]
14257 cd path-to-make-repo-you-cloned-above
14258 build_w32.bat --without-guile
14260 should result in a WinRel/gnumake.exe.
14261 Copy it to the Cygwin /opt/lo/bin directory as make.exe
14263 Then re-run autogen.sh
14265 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
14266 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
14269 if test "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE"; then
14270 AC_MSG_ERROR([no file function found; the build will fail without it; use GNU make 4.0 or later])
14276 ****************************************************************************
14281 To view some help, run:
14286 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
14288 After the build has finished successfully, you can immediately run what you built using the command:
14291 if test $_os = Darwin; then
14292 echo open instdir/$PRODUCTNAME_WITHOUT_SPACES.app
14294 echo instdir/program/soffice
14298 If you want to run the smoketest, run:
14304 if test -f warn; then
14309 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: