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([LibreOffice],[25.2.0.0.alpha0+],[],[],[http://documentfoundation.org/])
14 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed
15 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard
16 dnl so check for the version of autoconf that is actually used to create the configure script
18 m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.68]), -1,
19 [AC_MSG_ERROR([at least autoconf version 2.68 is needed (you can use AUTOCONF environment variable to point to a suitable one)])])
21 if test -n "$BUILD_TYPE"; then
22 AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
36 CC_BASE=`first_arg_basename "$CC"`
37 CXX_BASE=`first_arg_basename "$CXX"`
41 GIT_NEEDED_SUBMODULES=""
42 LO_PATH= # used by path_munge to construct a PATH variable
47 # Return value: $filteredlibs
50 if test "$COM" = "MSC"; then
52 if test "x$f" != "x${f#-L}"; then
53 filteredlibs="$filteredlibs -LIBPATH:${f:2}"
54 elif test "x$f" != "x${f#-l}"; then
55 filteredlibs="$filteredlibs ${f:2}.lib"
57 filteredlibs="$filteredlibs $f"
63 # let's start with Fedora's paths for now
64 -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
65 # ignore it: on UNIXoids it is searched by default anyway
66 # but if it's given explicitly then it may override other paths
67 # (on macOS it would be an error to use it instead of SDK)
70 filteredlibs="$filteredlibs $f"
79 # Args: $1: A pathname. On Cygwin and WSL, in either the Unix or the Windows format. Note that this
80 # function is called also on Unix.
82 # Return value: $formatted_path and $formatted_path_unix.
84 # $formatted_path is the argument in Windows format, but using forward slashes instead of
85 # backslashes, using 8.3 pathname components if necessary (if it otherwise would contains spaces
86 # or shell metacharacters).
88 # $formatted_path_unix is the argument in a form usable in Cygwin or WSL, using 8.3 components if
89 # necessary. On Cygwin, it is the same as $formatted_path, but on WSL it is $formatted_path as a
92 # Errors out if 8.3 names are needed but aren't present for some of the path components.
96 # /home/tml/lo/master-optimised => C:/cygwin64/home/tml/lo/master-optimised
98 # C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe => C:/PROGRA~2/MICROS~3/INSTAL~1/vswhere.exe
100 # C:\Program Files (x86)\Microsoft Visual Studio\2019\Community => C:/PROGRA~2/MICROS~3/2019/COMMUN~1
102 # C:/PROGRA~2/WI3CF2~1/10/Include/10.0.18362.0/ucrt => C:/PROGRA~2/WI3CF2~1/10/Include/10.0.18362.0/ucrt
104 # /cygdrive/c/PROGRA~2/WI3CF2~1/10 => C:/PROGRA~2/WI3CF2~1/10
106 # C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\ => C:/PROGRA~2/WI3CF2~1/NETFXSDK/4.8/
108 # /usr/bin/find.exe => C:/cygwin64/bin/find.exe
110 if test -n "$UNITTEST_WSL_PATHFORMAT"; then
111 printf "PathFormat $1 ==> "
115 if test "$build_os" = "cygwin" -o "$build_os" = "wsl"; then
116 if test "$build_os" = "wsl"; then
117 formatted_path=$(echo "$formatted_path" | tr -d '\r')
121 # spaces,parentheses,brackets,braces are problematic in pathname
123 case "$formatted_path" in
124 *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
128 if test "$pf_conv_to_dos" = "yes"; then
129 if test "$build_os" = "wsl"; then
130 case "$formatted_path" in
132 formatted_path=$(wslpath -w "$formatted_path")
135 formatted_path=$($WSL_LO_HELPER --8.3 "$formatted_path")
136 elif test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
137 formatted_path=`cygpath -sm "$formatted_path"`
139 formatted_path=`cygpath -d "$formatted_path"`
141 if test $? -ne 0; then
142 AC_MSG_ERROR([path conversion failed for "$1".])
145 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
146 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
147 if test "$fp_count_slash$fp_count_colon" != "00"; then
148 if test "$fp_count_colon" = "0"; then
149 new_formatted_path=`realpath "$formatted_path"`
150 if test $? -ne 0; then
151 AC_MSG_WARN([realpath failed for "$formatted_path", not necessarily a problem.])
153 formatted_path="$new_formatted_path"
156 if test "$build_os" = "wsl"; then
157 if test "$fp_count_colon" != "0"; then
158 formatted_path=$(wslpath "$formatted_path")
160 case "$formatted_path" in
165 formatted_path=$(wslpath -m $formatted_path)
166 case "$formatted_path" in
170 formatted_path="$formatted_path"$final_slash
174 formatted_path=$(wslpath -m "$formatted_path")
177 formatted_path=`cygpath -m "$formatted_path"`
179 if test $? -ne 0; then
180 AC_MSG_ERROR([path conversion failed for "$1".])
183 fp_count_space=`echo "$formatted_path" | $GREP -c "[ ]"`
184 if test "$fp_count_space" != "0"; then
185 AC_MSG_ERROR([converted path "$formatted_path" still contains spaces. Short filenames (8.3 filenames) support was disabled on this system?])
188 if test "$build_os" = "wsl"; then
189 # WSL can't run Windows binaries from Windows pathnames so we need a separate return value in Unix format
190 formatted_path_unix=$(wslpath "$formatted_path")
193 formatted_path_unix="$formatted_path"
195 if test -n "$WSL_ONLY_AS_HELPER"; then
196 # if already in unix format, switch to windows format to create shortened path
197 case "$formatted_path" in
199 formatted_path=$(wslpath -m "$formatted_path")
203 # cd to /mnt/c to avoid wsl/cmd complaining about not supporting UNC paths/the current working directory
204 formatted_path_unix=$(wslpath -u "$(cd /mnt/c; cmd.exe /c $shortpath_cmd "$formatted_path" | tr -d '\r')")
205 # WSL can't run Windows binaries from Windows pathnames so we need a separate return value in Unix format
206 formatted_path=$(wslpath -m "$formatted_path_unix")
212 # There appears to be no simple and portable method to get an absolute and
213 # canonical path, so we try creating the directory if does not exist and
214 # utilizing the shell and pwd.
216 # Args: $1: A possibly relative pathname
217 # Return value: $absolute_path
219 # Convert to unix path, mkdir would treat c:/path as a relative path.
221 local rel="$formatted_path_unix"
223 test ! -e "$rel" && mkdir -p "$rel"
224 if test -d "$rel" ; then
225 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
226 absolute_path="$(pwd)"
229 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
233 WARNINGS_FILE=config.warn
234 WARNINGS_FILE_FOR_BUILD=config.Build.warn
235 rm -f "$WARNINGS_FILE" "$WARNINGS_FILE_FOR_BUILD"
239 if test "$have_WARNINGS" = "no"; then
240 echo "*************************************" > "$WARNINGS_FILE"
242 if command -v tput >/dev/null && test "`tput colors 2>/dev/null || echo 0`" -ge 8; then
243 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
244 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
246 COLORWARN="* WARNING :"
249 echo "$COLORWARN $@" >> "$WARNINGS_FILE"
252 dnl Some Mac User have the bad habit of letting a lot of crap
253 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
254 dnl that confuse the build.
255 dnl For the ones that use LODE, let's be nice and protect them
260 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
261 dnl a common but nevertheless necessary thing that may be in a fancy
262 dnl path location is git, so make sure we have it
263 mac_git_path=`command -v git`
264 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
265 mac_path="$mac_path:`dirname $mac_git_path`"
267 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
268 dnl path location is gpg, so make sure we find it
269 mac_gpg_path=`command -v gpg`
270 if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
271 mac_path="$mac_path:`dirname $mac_gpg_path`"
279 dnl semantically test a three digits version
280 dnl $1 - $3 = minimal version
281 dnl $4 - $6 = current version
283 check_semantic_version_three()
286 -o \( "$4" -eq "$1" -a "$5" -gt "$2" \) \
287 -o \( "$4" -eq "$1" -a "$5" -eq "$2" -a "$6" -ge "$3" \)
291 dnl calls check_semantic_version_three with digits in named variables $1_MAJOR, $1_MINOR, $1_TINY
292 dnl $1 = current version prefix, e.g. EMSCRIPTEN => EMSCRIPTEN_
293 dnl $2 = postfix to $1, e.g. MIN => EMSCRIPTEN_MIN_
295 check_semantic_version_three_prefixed()
297 eval local MIN_MAJOR="\$${1}_${2}_MAJOR"
298 eval local MIN_MINOR="\$${1}_${2}_MINOR"
299 eval local MIN_TINY="\$${1}_${2}_TINY"
300 eval local CUR_MAJOR="\$${1}_MAJOR"
301 eval local CUR_MINOR="\$${1}_MINOR"
302 eval local CUR_TINY="\$${1}_TINY"
303 check_semantic_version_three $MIN_MAJOR $MIN_MINOR $MIN_TINY $CUR_MAJOR $CUR_MINOR $CUR_TINY
307 echo "********************************************************************"
309 echo "* Running ${PACKAGE_NAME} build configuration."
311 echo "********************************************************************"
314 dnl ===================================================================
315 dnl checks build and host OSes
316 dnl do this before argument processing to allow for platform dependent defaults
317 dnl ===================================================================
319 # are we running in wsl but are called from git-bash/env with mingw64 in path?
320 # if so, we aim to run nearly everything in the Windows realm, and only run autogen/configure
321 # in wsl and run a few tools via wsl
323 if test -n "$WSL_DISTRO_NAME" && $(echo $PATH |grep -q mingw64); then
324 WSL_ONLY_AS_HELPER=TRUE
325 AC_ARG_WITH([strawberry-perl-portable],
326 [AS_HELP_STRING([--with-strawberry-perl-portable],
327 [Specify the base path to strawberry perl portable])],
330 [for the moment strawberry-perl-portable is a requirement, feel free to replace it])])
331 shortpath_cmd=$(wslpath -m $srcdir/solenv/bin/shortpath.cmd)
332 PathFormat "$with_strawberry_perl_portable"
333 if test ! -f "$formatted_path_unix/perl/bin/perl.exe" -o ! -d "$formatted_path_unix/c/bin"; then
334 AC_MSG_ERROR([$formatted_path doesn't contain perl or the utilities - sure you provided the base path?])
336 STRAWBERRY_TOOLS="$formatted_path/c/bin"
337 STRAWBERRY_PERL="$formatted_path/perl/bin/perl.exe"
338 AC_ARG_WITH([wsl-command],
339 [AS_HELP_STRING([--with-wsl-command],
340 [Specify your wsl distro command if it isn't the default/the one used with just wsl.exe –
341 for example: wsl.exe -d MyDistro -u NonDefaultUser])],
343 [with_wsl_command="wsl.exe"])
344 WSL="$with_wsl_command"
346 AC_SUBST([STRAWBERRY_PERL])
349 # Check for WSL (version 2, at least). But if --host is explicitly specified (to really do build for
350 # Linux on WSL) trust that.
351 if test -z "$host" -a -z "$build" -a "`wslsys -v 2>/dev/null`" != ""; then
352 ac_cv_host="x86_64-pc-wsl"
353 ac_cv_host_cpu="x86_64"
355 ac_cv_build="$ac_cv_host"
356 ac_cv_build_cpu="$ac_cv_host_cpu"
357 ac_cv_build_os="$ac_cv_host_os"
359 # Emulation of Cygwin's cygpath command for WSL.
362 if test -n "$UNITTEST_WSL_CYGPATH"; then
363 echo -n cygpath "$@" "==> "
366 # Cygwin's real cygpath has a plethora of options but we use only a few here.
369 local opt_d opt_m opt_u opt_w opt_l opt_s opt_p
372 while getopts dmuwlsp opt; do
375 AC_MSG_ERROR([Unimplemented cygpath emulation option in invocation: cygpath $args])
385 if test $# -ne 1; then
386 AC_MSG_ERROR([Invalid cygpath emulation invocation: Pathname missing]);
393 if test -n "$opt_d" -o -n "$opt_m" -o -n "$opt_w"; then
394 # Print Windows path, possibly in 8.3 form (-d) or with forward slashes (-m)
396 if test -n "$opt_u"; then
397 AC_MSG_ERROR([Invalid cygpath invocation: Both Windows and Unix path output requested])
402 # A Windows file in WSL format
403 input=$(wslpath -w "$input")
405 [[a-zA-Z]]:\\* | \\* | [[a-zA-Z]]:/* | /*)
406 # Already in Windows format
409 input=$(wslpath -w "$input")
412 AC_MSG_ERROR([Invalid cygpath invocation: Path '$input' is not absolute])
415 if test -n "$opt_d" -o -n "$opt_s"; then
416 input=$($WSL_LO_HELPER --8.3 "$input")
418 if test -n "$opt_m"; then
419 input="${input//\\//}"
426 [[a-zA-Z]]:\\* | \\* | [[a-zA-Z]]:/* | /*)
433 AC_MSG_ERROR([Invalid cygpath invocation: Path '$input' is not absolute])
439 if test -n "$UNITTEST_WSL_CYGPATH"; then
442 # Nothing special with these file names, just arbitrary ones picked to test with
443 cygpath -d /usr/lib64/ld-linux-x86-64.so.2
444 cygpath -w /usr/lib64/ld-linux-x86-64.so.2
445 cygpath -m /usr/lib64/ld-linux-x86-64.so.2
446 cygpath -m -s /usr/lib64/ld-linux-x86-64.so.2
447 # At least on my machine for instance this file does have an 8.3 name
448 cygpath -d /mnt/c/windows/WindowsUpdate.log
449 # But for instance this one doesn't
450 cygpath -w /mnt/c/windows/system32/AboutSettingsHandlers.dll
451 cygpath -ws /mnt/c/windows/WindowsUpdate.log
452 cygpath -m /mnt/c/windows/system32/AboutSettingsHandlers.dll
453 cygpath -ms /mnt/c/windows/WindowsUpdate.log
455 cygpath -u 'c:\windows\system32\AboutSettingsHandlers.dll'
456 cygpath -u 'c:/windows/system32/AboutSettingsHandlers.dll'
461 if test -z "$WSL_LO_HELPER"; then
462 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/wsl-lo-helper" ; then
463 WSL_LO_HELPER="$LODE_HOME/opt/bin/wsl-lo-helper"
464 elif test -x "/opt/lo/bin/wsl-lo-helper"; then
465 WSL_LO_HELPER="/opt/lo/bin/wsl-lo-helper"
468 if test -z "$WSL_LO_HELPER"; then
469 AC_MSG_ERROR([wsl-lo-helper not found. See solenv/wsl/README.])
476 if test -n "$UNITTEST_WSL_PATHFORMAT"; then
480 # Use of PathFormat must be after AC_CANONICAL_BUILD above
482 printf "$formatted_path , $formatted_path_unix\n"
485 printf "$formatted_path , $formatted_path_unix\n"
487 PathFormat "$PROGRAMFILESX86"
488 printf "$formatted_path , $formatted_path_unix\n"
493 AC_MSG_CHECKING([for product name])
494 PRODUCTNAME="AC_PACKAGE_NAME"
495 if test -n "$with_product_name" -a "$with_product_name" != no; then
496 PRODUCTNAME="$with_product_name"
498 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
499 PRODUCTNAME="${PRODUCTNAME}Dev"
501 AC_MSG_RESULT([$PRODUCTNAME])
502 AC_SUBST(PRODUCTNAME)
503 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
504 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
506 dnl ===================================================================
507 dnl Our version is defined by the AC_INIT() at the top of this script.
508 dnl ===================================================================
510 AC_MSG_CHECKING([for package version])
511 if test -n "$with_package_version" -a "$with_package_version" != no; then
512 PACKAGE_VERSION="$with_package_version"
514 AC_MSG_RESULT([$PACKAGE_VERSION])
516 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
518 LIBO_VERSION_MAJOR=$1
519 LIBO_VERSION_MINOR=$2
520 LIBO_VERSION_MICRO=$3
521 LIBO_VERSION_PATCH=$4
523 LIBO_VERSION_SUFFIX=$5
525 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
526 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
527 # they get undoubled before actually passed to sed.
528 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
529 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
530 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
531 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
533 # The value for key CFBundleVersion in the Info.plist file must be a period-separated list of at most
534 # three non-negative integers. Please find more information about CFBundleVersion at
535 # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion
537 # The value for key CFBundleShortVersionString in the Info.plist file must be a period-separated list
538 # of at most three non-negative integers. Please find more information about
539 # CFBundleShortVersionString at
540 # https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring
542 # But that is enforced only in the App Store, and we apparently want to break the rules otherwise.
544 if test "$enable_macosx_sandbox" = yes; then
545 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
546 MACOSX_BUNDLE_VERSION=$MACOSX_BUNDLE_SHORTVERSION
548 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.$LIBO_VERSION_MICRO.$LIBO_VERSION_PATCH
549 MACOSX_BUNDLE_VERSION=$MACOSX_BUNDLE_SHORTVERSION$LIBO_VERSION_SUFFIX
552 AC_SUBST(LIBO_VERSION_MAJOR)
553 AC_SUBST(LIBO_VERSION_MINOR)
554 AC_SUBST(LIBO_VERSION_MICRO)
555 AC_SUBST(LIBO_VERSION_PATCH)
556 AC_SUBST(LIBO_VERSION_SUFFIX)
557 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
558 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
559 AC_SUBST(MACOSX_BUNDLE_VERSION)
561 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
562 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
563 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
564 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
566 git_date=`git log -1 --pretty=format:"%cd" --date=format:'%Y' 2>/dev/null`
567 LIBO_THIS_YEAR=${git_date:-2024}
568 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
570 dnl ===================================================================
572 dnl ===================================================================
573 AC_MSG_CHECKING([for product version])
574 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
575 AC_MSG_RESULT([$PRODUCTVERSION])
576 AC_SUBST(PRODUCTVERSION)
579 # AC_PROG_EGREP doesn't set GREP on all systems as well
580 AC_PATH_PROG(GREP, grep)
588 dnl ======================================
589 dnl Required GObject introspection version
590 dnl ======================================
591 INTROSPECTION_REQUIRED_VERSION=1.32.0
593 dnl ===================================================================
594 dnl Search all the common names for GNU Make
595 dnl ===================================================================
596 AC_MSG_CHECKING([for GNU Make])
598 # try to use our own make if it is available and GNUMAKE was not already defined
599 if test -z "$GNUMAKE"; then
600 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
601 GNUMAKE="$LODE_HOME/opt/bin/make"
602 elif test -x "/opt/lo/bin/make"; then
603 GNUMAKE="/opt/lo/bin/make"
608 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
609 if test -n "$a"; then
610 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
611 if test $? -eq 0; then
612 if test "$build_os" = "cygwin"; then
613 if test -n "$($a -v | grep 'Built for Windows')" ; then
614 GNUMAKE="$(cygpath -m "$(command -v "$(cygpath -u $a)")")"
615 GNUMAKE_WIN_NATIVE="TRUE"
617 GNUMAKE=`command -v $a`
620 GNUMAKE=`command -v $a`
626 AC_MSG_RESULT($GNUMAKE)
627 if test -z "$GNUMAKE"; then
628 AC_MSG_ERROR([not found. install GNU Make.])
630 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
631 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
635 win_short_path_for_make()
637 local short_path="$1"
638 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
639 cygpath -sm "$short_path"
640 elif test -n "$WSL_ONLY_AS_HELPER"; then
641 # when already unix-style path, wslpath doesn't return anything
642 case "$short_path" in
648 wslpath -m "$(wslpath -u "$short_path")"
650 cygpath -u "$(cygpath -d "$short_path")"
655 if test "$build_os" = "cygwin"; then
656 PathFormat "$SRC_ROOT"
657 SRC_ROOT="$formatted_path"
658 PathFormat "$BUILDDIR"
659 BUILDDIR="$formatted_path"
661 AC_MSG_CHECKING(for explicit COMSPEC)
662 if test -z "$COMSPEC"; then
663 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
665 AC_MSG_RESULT([found: $COMSPEC])
672 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
673 AC_DEFINE_UNQUOTED(SRC_ROOT,"$SRC_ROOT")
674 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
676 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
677 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
680 # need sed in os checks...
681 AC_PATH_PROGS(SED, sed)
682 if test -z "$SED"; then
683 AC_MSG_ERROR([install sed to run this script])
686 # Set the ENABLE_LTO variable
687 # ===================================================================
688 AC_MSG_CHECKING([whether to use link-time optimization])
689 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
698 AC_ARG_ENABLE(fuzz-options,
699 AS_HELP_STRING([--enable-fuzz-options],
700 [Randomly enable or disable each of those configurable options
701 that are supposed to be freely selectable without interdependencies,
702 or where bad interaction from interdependencies is automatically avoided.])
705 dnl ===================================================================
706 dnl When building for Android, --with-android-ndk,
707 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
709 dnl ===================================================================
711 AC_ARG_WITH(android-ndk,
712 AS_HELP_STRING([--with-android-ndk],
713 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
716 AC_ARG_WITH(android-ndk-toolchain-version,
717 AS_HELP_STRING([--with-android-ndk-toolchain-version],
718 [Specify which toolchain version to use, of those present in the
719 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
720 with_android_ndk_toolchain_version=clang5.0)
722 AC_ARG_WITH(android-sdk,
723 AS_HELP_STRING([--with-android-sdk],
724 [Specify location of the Android SDK. Mandatory when building for Android.]),
727 AC_ARG_WITH(android-api-level,
728 AS_HELP_STRING([--with-android-api-level],
729 [Specify the API level when building for Android. Defaults to 16 for ARM and x86 and to 21 for ARM64 and x86-64]),
733 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
734 with_android_ndk="$SRC_ROOT/external/android-ndk"
736 if test -n "$with_android_ndk"; then
737 eval ANDROID_NDK_DIR=$with_android_ndk
740 if test -n "$with_android_api_level" ; then
741 ANDROID_API_LEVEL="$with_android_api_level"
744 if test $host_cpu = arm; then
745 LLVM_TRIPLE=armv7a-linux-androideabi
746 ANDROID_SYSROOT_PLATFORM=arm-linux-androideabi
747 ANDROID_APP_ABI=armeabi-v7a
748 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
749 elif test $host_cpu = aarch64; then
750 LLVM_TRIPLE=aarch64-linux-android
751 ANDROID_SYSROOT_PLATFORM=$LLVM_TRIPLE
752 ANDROID_APP_ABI=arm64-v8a
753 elif test $host_cpu = x86_64; then
754 LLVM_TRIPLE=x86_64-linux-android
755 ANDROID_SYSROOT_PLATFORM=$LLVM_TRIPLE
756 ANDROID_APP_ABI=x86_64
758 # host_cpu is something like "i386" or "i686" I guess, NDK uses
759 # "x86" in some contexts
760 LLVM_TRIPLE=i686-linux-android
761 ANDROID_SYSROOT_PLATFORM=$LLVM_TRIPLE
765 # Set up a lot of pre-canned defaults
767 if test ! -f $ANDROID_NDK_DIR/RELEASE.TXT; then
768 if test ! -f $ANDROID_NDK_DIR/source.properties; then
769 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_DIR.])
771 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_DIR/source.properties`
773 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_DIR/RELEASE.TXT`
775 if test -z "$ANDROID_NDK_VERSION"; then
776 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
778 case $ANDROID_NDK_VERSION in
780 AC_MSG_ERROR([Building for Android requires NDK version >= 23.*])
782 11.1.*|12.1.*|13.1.*|14.1.*|16.*|17.*|18.*|19.*|20.*|21.*|22.*)
783 AC_MSG_ERROR([Building for Android requires NDK version >= 23.*])
788 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* to 25.* have been used successfully. Proceed at your own risk.])
789 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* to 25.* have been used successfully. Proceed at your own risk."
793 case "$with_android_ndk_toolchain_version" in
795 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
798 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
801 AC_MSG_NOTICE([using the Android API level... $ANDROID_API_LEVEL])
803 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
804 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
805 # manage to link the (app-specific) single huge .so that is built for the app in
806 # android/source/ if there is debug information in a significant part of the object files.
807 # (A 64-bit ld.gold grows too much over 10 gigabytes of virtual space when linking such a .so if
808 # all objects have been built with debug information.)
811 android_HOST_TAG=linux-x86_64
814 android_HOST_TAG=darwin-x86_64
817 AC_MSG_ERROR([We only support building for Android from Linux or macOS])
818 # ndk would also support windows and windows-x86_64
821 ANDROID_TOOLCHAIN=$ANDROID_NDK_DIR/toolchains/llvm/prebuilt/$android_HOST_TAG
822 ANDROID_COMPILER_BIN=$ANDROID_TOOLCHAIN/bin
824 test -z "$AR" && AR=$ANDROID_COMPILER_BIN/llvm-ar
825 test -z "$NM" && NM=$ANDROID_COMPILER_BIN/llvm-nm
826 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/llvm-objdump
827 test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/llvm-ranlib
828 test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/llvm-strip
830 ANDROIDCFLAGS="$ANDROIDCFLAGS -target ${LLVM_TRIPLE}${ANDROID_API_LEVEL}"
831 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes -ffunction-sections -fdata-sections -Qunused-arguments"
832 if test "$ENABLE_LTO" = TRUE; then
833 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
834 # $CC and $CXX when building external libraries
835 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
838 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -stdlib=libc++"
840 if test -z "$CC"; then
841 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
844 if test -z "$CXX"; then
845 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
849 AC_SUBST(ANDROID_NDK_DIR)
850 AC_SUBST(ANDROID_NDK_VERSION)
851 AC_SUBST(ANDROID_API_LEVEL)
852 AC_SUBST(ANDROID_APP_ABI)
853 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
854 AC_SUBST(ANDROID_SYSROOT_PLATFORM)
855 AC_SUBST(ANDROID_TOOLCHAIN)
857 dnl ===================================================================
858 dnl --with-android-sdk
859 dnl ===================================================================
861 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
862 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
864 if test -n "$with_android_sdk"; then
865 eval ANDROID_SDK_DIR=$with_android_sdk
866 PATH="$ANDROID_SDK_DIR/platform-tools:$ANDROID_SDK_DIR/tools:$PATH"
868 AC_SUBST(ANDROID_SDK_DIR)
870 AC_ARG_ENABLE([android-lok],
871 AS_HELP_STRING([--enable-android-lok],
872 [The Android app from the android/ subdir needs several tweaks all
873 over the place that break the LOK when used in the Online-based
874 Android app. This switch indicates that the intent of this build is
875 actually the Online-based, non-modified LOK.])
878 if test -n "$ANDROID_NDK_DIR" ; then
879 if test "$enable_android_lok" = yes; then
880 ENABLE_ANDROID_LOK=TRUE
881 AC_DEFINE(HAVE_FEATURE_ANDROID_LOK)
882 AC_MSG_NOTICE([building the Android version... for the Online-based Android app])
884 AC_MSG_NOTICE([building the Android version... for the app from the android/ subdir])
887 AC_SUBST([ENABLE_ANDROID_LOK])
889 libo_FUZZ_ARG_ENABLE([android-editing],
890 AS_HELP_STRING([--enable-android-editing],
891 [Enable the experimental editing feature on Android.])
893 ENABLE_ANDROID_EDITING=
894 if test "$enable_android_editing" = yes; then
895 ENABLE_ANDROID_EDITING=TRUE
897 AC_SUBST([ENABLE_ANDROID_EDITING])
899 disable_database_connectivity_dependencies()
902 enable_firebird_sdbc=no
903 enable_mariadb_sdbc=no
904 enable_postgresql_sdbc=no
905 enable_report_builder=no
908 # ===================================================================
910 # Start initial platform setup
912 # The using_* variables reflect platform support and should not be
913 # changed after the "End initial platform setup" block.
914 # This is also true for most test_* variables.
915 # ===================================================================
924 # There is currently just iOS not using salplug, so this explicitly enables it.
925 # must: using_freetype_fontconfig
926 # may: using_headless_plugin defaults to $using_freetype_fontconfig
929 # Default values, as such probably valid just for Linux, set
930 # differently below just for Mac OSX, but at least better than
931 # hardcoding these as we used to do. Much of this is duplicated also
932 # in solenv for old build system and for gbuild, ideally we should
933 # perhaps define stuff like this only here in configure.ac?
935 LINKFLAGSSHL="-shared"
939 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
942 INSTROOTCONTENTSUFFIX=
945 HOST_PLATFORM="$host"
947 host_cpu_for_clang="$host_cpu"
952 using_freetype_fontconfig=yes
957 dnl ===========================================================
958 dnl Check whether we're using Solaris 10 - SPARC or Intel.
959 dnl ===========================================================
960 AC_MSG_CHECKING([the Solaris operating system release])
961 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
962 if test "$_os_release" -lt "10"; then
963 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
965 AC_MSG_RESULT([ok ($_os_release)])
968 dnl Check whether we're using a SPARC or i386 processor
969 AC_MSG_CHECKING([the processor type])
970 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
971 AC_MSG_RESULT([ok ($host_cpu)])
973 AC_MSG_ERROR([only SPARC and i386 processors are supported])
977 linux-gnu*|k*bsd*-gnu*|linux-musl*)
978 using_freetype_fontconfig=yes
983 if test "$enable_fuzzers" = yes; then
984 test_system_freetype=no
990 using_freetype_fontconfig=yes
996 # When building on Windows normally with MSVC under Cygwin,
997 # configure thinks that the host platform (the platform the
998 # built code will run on) is Cygwin, even if it obviously is
999 # Windows, which in Autoconf terminology is called
1000 # "mingw32". (Which is misleading as MinGW is the name of the
1001 # tool-chain, not an operating system.)
1003 # Somewhat confusing, yes. But this configure script doesn't
1004 # look at $host etc that much, it mostly uses its own $_os
1005 # variable, set here in this case statement.
1007 using_freetype_fontconfig=no
1018 if test "$host_cpu" = "aarch64"; then
1022 enable_firebird_sdbc=no
1027 using_freetype_fontconfig=no
1031 if test -n "$LODE_HOME" ; then
1033 AC_MSG_NOTICE([sanitized the PATH to $PATH])
1036 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
1037 INSTROOTCONTENTSUFFIX=/Contents
1038 SDKDIRNAME=${PRODUCTNAME_WITHOUT_SPACES}${PRODUCTVERSION}_SDK
1039 # See "Default values, as such probably valid just for Linux" comment above the case "$host_os"
1040 LINKFLAGSSHL="-dynamiclib"
1047 # -undefined error is the default
1048 LINKFLAGSNOUNDEFS=""
1051 # Apple's Clang uses "arm64"
1052 host_cpu_for_clang=arm64
1057 using_freetype_fontconfig=no
1064 if test -n "$LODE_HOME" ; then
1066 AC_MSG_NOTICE([sanitized the PATH to $PATH])
1070 enable_mpl_subset=yes
1071 enable_lotuswordpro=no
1072 disable_database_connectivity_dependencies
1075 enable_extension_integration=no
1078 if test "$enable_ios_simulator" = "yes"; then
1079 host=x86_64-apple-darwin
1081 # See "Default values, as such probably valid just for Linux" comment above the case "$host_os"
1082 LINKFLAGSSHL="-dynamiclib"
1089 # -undefined error is the default
1090 LINKFLAGSNOUNDEFS=""
1092 # HOST_PLATFORM is used for external projects and their configury typically doesn't like the "ios"
1093 # part, so use aarch64-apple-darwin for now.
1094 HOST_PLATFORM=aarch64-apple-darwin
1096 # Apple's Clang uses "arm64"
1097 host_cpu_for_clang=arm64
1101 using_freetype_fontconfig=yes
1104 AC_MSG_CHECKING([the FreeBSD operating system release])
1105 if test -n "$with_os_version"; then
1106 OSVERSION="$with_os_version"
1108 OSVERSION=`/sbin/sysctl -n kern.osreldate`
1110 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
1111 AC_MSG_CHECKING([which thread library to use])
1112 if test "$OSVERSION" -lt "500016"; then
1113 PTHREAD_CFLAGS="-D_THREAD_SAFE"
1114 PTHREAD_LIBS="-pthread"
1115 elif test "$OSVERSION" -lt "502102"; then
1116 PTHREAD_CFLAGS="-D_THREAD_SAFE"
1117 PTHREAD_LIBS="-lc_r"
1120 PTHREAD_LIBS="-pthread"
1122 AC_MSG_RESULT([$PTHREAD_LIBS])
1127 using_freetype_fontconfig=yes
1131 PTHREAD_LIBS="-pthread -lpthread"
1136 using_freetype_fontconfig=yes
1138 PTHREAD_CFLAGS="-D_THREAD_SAFE"
1139 PTHREAD_LIBS="-pthread"
1144 using_freetype_fontconfig=yes
1147 PTHREAD_LIBS="-pthread"
1152 # API exists, but seems not really usable since Android 7 AFAIK
1154 using_freetype_fontconfig=yes
1155 using_headless_plugin=no
1159 test_system_freetype=no
1162 disable_database_connectivity_dependencies
1163 enable_lotuswordpro=no
1164 enable_mpl_subset=yes
1165 enable_cairo_canvas=no
1175 using_freetype_fontconfig=yes
1185 enable_postgresql_sdbc=no
1186 enable_firebird_sdbc=no
1191 # API currently just exists in headers, not code
1193 using_freetype_fontconfig=yes
1197 test_split_debug=yes
1198 test_system_freetype=no
1199 enable_compiler_plugins=no
1200 enable_customtarget_components=yes
1201 enable_split_debug=yes
1202 enable_wasm_strip=yes
1204 with_theme="colibre"
1209 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
1213 AC_SUBST(HOST_PLATFORM)
1215 if test -z "$using_x11" -o -z "$using_freetype_fontconfig"; then
1216 AC_MSG_ERROR([You must set \$using_freetype_fontconfig and \$using_x11 for your platform])
1219 # Set defaults, if not set by platform
1220 test "${test_cpdb+set}" = set || test_cpdb="$using_x11"
1221 test "${test_cups+set}" = set || test_cups="$using_x11"
1222 test "${test_dbus+set}" = set || test_dbus="$using_x11"
1223 test "${test_gen+set}" = set || test_gen="$using_x11"
1224 test "${test_gstreamer_1_0+set}" = set || test_gstreamer_1_0="$using_x11"
1225 test "${test_gtk3+set}" = set || test_gtk3="$using_x11"
1226 test "${test_gtk4+set}" = set || test_gtk4="$using_x11"
1227 test "${test_kf5+set}" = set || test_kf5="$using_x11"
1228 test "${test_kf6+set}" = set || test_kf6="$using_x11"
1229 # don't handle test_qt5, so it can disable test_kf5 later
1230 test "${test_qt6+set}" = set || test_qt6="$using_x11"
1231 test "${test_randr+set}" = set || test_randr="$using_x11"
1232 test "${test_xrender+set}" = set || test_xrender="$using_x11"
1233 test "${using_headless_plugin+set}" = set || using_headless_plugin="$using_freetype_fontconfig"
1235 test "${test_gtk3_kde5+set}" != set -a "$test_kf5" = yes -a "$test_gtk3" = yes && test_gtk3_kde5="yes"
1236 # Make sure fontconfig and freetype test both either system or not
1237 test "${test_system_fontconfig+set}" != set -a "${test_system_freetype+set}" = set && test_system_fontconfig="$test_system_freetype"
1238 test "${test_system_freetype+set}" != set -a "${test_system_fontconfig+set}" = set && test_system_freetype="$test_system_fontconfig"
1240 # convenience / platform overriding "fixes"
1242 test "$test_kf5" = yes -a "$test_qt5" = no && test_kf5=no
1243 test "$test_kf5" = yes && test_qt5=yes
1244 test "$test_gtk3" != yes && enable_gtk3=no
1245 test "$test_gtk3" != yes -o "$test_kf5" != yes && test_gtk3_kde5=no
1246 test "$using_freetype_fontconfig" = no && using_headless_plugin=no
1247 test "$using_freetype_fontconfig" = yes && test_cairo=yes
1249 # Keep in sync with the above $using_x11 depending test default list
1256 test_gstreamer_1_0=no
1268 test "$using_x11" = yes && USING_X11=TRUE
1270 if test "$using_freetype_fontconfig" = yes; then
1271 AC_DEFINE(USE_HEADLESS_CODE)
1272 USE_HEADLESS_CODE=TRUE
1273 if test "$using_headless_plugin" = yes; then
1274 AC_DEFINE(ENABLE_HEADLESS)
1275 ENABLE_HEADLESS=TRUE
1282 AC_SUBST(ENABLE_HEADLESS)
1283 AC_SUBST(USE_HEADLESS_CODE)
1285 AC_MSG_NOTICE([VCL platform has a usable dynamic loading API: $usable_dlapi])
1286 AC_MSG_NOTICE([VCL platform uses freetype+fontconfig: $using_freetype_fontconfig])
1287 AC_MSG_NOTICE([VCL platform uses headless plugin: $using_headless_plugin])
1288 AC_MSG_NOTICE([VCL platform uses X11: $using_x11])
1290 # ===================================================================
1292 # End initial platform setup
1294 # ===================================================================
1296 if test "$_os" = "Android" ; then
1297 # Verify that the NDK and SDK options are proper
1298 if test -z "$with_android_ndk"; then
1299 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
1300 elif test ! -f "$ANDROID_NDK_DIR/meta/abis.json"; then
1301 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
1304 if test -z "$ANDROID_SDK_DIR"; then
1305 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
1306 elif test ! -d "$ANDROID_SDK_DIR/platforms"; then
1307 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
1311 AC_SUBST(SDKDIRNAME)
1313 AC_SUBST(PTHREAD_CFLAGS)
1314 AC_SUBST(PTHREAD_LIBS)
1316 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
1317 # By default use the ones specified by our build system,
1318 # but explicit override is possible.
1319 AC_MSG_CHECKING(for explicit AFLAGS)
1320 if test -n "$AFLAGS"; then
1321 AC_MSG_RESULT([$AFLAGS])
1327 AC_MSG_CHECKING(for explicit CFLAGS)
1328 if test -n "$CFLAGS"; then
1329 AC_MSG_RESULT([$CFLAGS])
1335 AC_MSG_CHECKING(for explicit CXXFLAGS)
1336 if test -n "$CXXFLAGS"; then
1337 AC_MSG_RESULT([$CXXFLAGS])
1343 AC_MSG_CHECKING(for explicit OBJCFLAGS)
1344 if test -n "$OBJCFLAGS"; then
1345 AC_MSG_RESULT([$OBJCFLAGS])
1351 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
1352 if test -n "$OBJCXXFLAGS"; then
1353 AC_MSG_RESULT([$OBJCXXFLAGS])
1359 AC_MSG_CHECKING(for explicit LDFLAGS)
1360 if test -n "$LDFLAGS"; then
1361 AC_MSG_RESULT([$LDFLAGS])
1371 AC_SUBST(OBJCXXFLAGS)
1375 AC_SUBST(x_CXXFLAGS)
1376 AC_SUBST(x_OBJCFLAGS)
1377 AC_SUBST(x_OBJCXXFLAGS)
1380 dnl These are potentially set for MSVC, in the code checking for UCRT below:
1381 my_original_CFLAGS=$CFLAGS
1382 my_original_CXXFLAGS=$CXXFLAGS
1383 my_original_CPPFLAGS=$CPPFLAGS
1385 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1386 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
1387 dnl AC_PROG_CC internally.
1388 if test "$_os" != "WINNT"; then
1389 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that (and avoid -O2 during AC_PROG_CC,
1390 # Clang 12.0.1 occasionally SEGVs on some of the test invocations during AC_PROG_CC with -O2):
1395 if test -z "$CC_BASE"; then
1396 CC_BASE=`first_arg_basename "$CC"`
1400 if test "$_os" != "WINNT"; then
1401 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
1405 AC_SUBST(ENDIANNESS)
1407 if test "$usable_dlapi" != no; then
1408 AC_DEFINE([HAVE_DLAPI])
1409 if test "$test_unix_dlapi" != no; then
1411 AC_SEARCH_LIBS([dlsym], [dl],
1412 [case "$ac_cv_search_dlsym" in -l*) UNIX_DLAPI_LIBS="$ac_cv_search_dlsym";; esac],
1413 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
1415 AC_DEFINE([HAVE_UNIX_DLAPI])
1418 AC_SUBST(UNIX_DLAPI_LIBS)
1420 # Check for a (GNU) backtrace implementation
1421 AC_ARG_VAR([BACKTRACE_CFLAGS], [Compiler flags needed to use backtrace(3)])
1422 AC_ARG_VAR([BACKTRACE_LIBS], [Linker flags needed to use backtrace(3)])
1423 AS_IF([test "x$BACKTRACE_LIBS$BACKTRACE_CFLAGS" = x], [
1425 AC_SEARCH_LIBS([backtrace], [libexecinfo],
1426 [case "$ac_cv_search_backtrace" in -l*) BACKTRACE_LIBS="$ac_cv_search_backtrace";; esac],
1427 [PKG_CHECK_MODULES([BACKTRACE], [libexecinfo], [ac_cv_search_backtrace=], [:])])
1430 AS_IF([test "x$ac_cv_search_backtrace" != xno ], [
1431 AC_DEFINE([HAVE_FEATURE_BACKTRACE])
1434 dnl ===================================================================
1435 dnl Sanity checks for Emscripten SDK setup
1436 dnl ===================================================================
1438 EMSCRIPTEN_MIN_MAJOR=3
1439 EMSCRIPTEN_MIN_MINOR=1
1440 EMSCRIPTEN_MIN_TINY=46
1441 EMSCRIPTEN_MIN_VERSION="${EMSCRIPTEN_MIN_MAJOR}.${EMSCRIPTEN_MIN_MINOR}.${EMSCRIPTEN_MIN_TINY}"
1443 if test "$_os" = "Emscripten"; then
1444 AC_MSG_CHECKING([if Emscripten is at least $EMSCRIPTEN_MIN_VERSION])
1445 if test -z "$EMSCRIPTEN_VERSION_H"; then
1446 AS_IF([test -z "$EMSDK"],
1447 [AC_MSG_ERROR([No \$EMSDK environment variable.])])
1448 EMSCRIPTEN_VERSION_H=$EMSDK/upstream/emscripten/cache/sysroot/include/emscripten/version.h
1450 if test -f "$EMSCRIPTEN_VERSION_H"; then
1451 EMSCRIPTEN_MAJOR=$($GREP __EMSCRIPTEN_major__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_major__ //p')
1452 EMSCRIPTEN_MINOR=$($GREP __EMSCRIPTEN_minor__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_minor__ //p')
1453 EMSCRIPTEN_TINY=$($GREP __EMSCRIPTEN_tiny__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_tiny__ //p')
1455 EMSCRIPTEN_DEFINES=$(echo | emcc -dM -E - | $GREP __EMSCRIPTEN_)
1456 EMSCRIPTEN_MAJOR=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 's/.*__EMSCRIPTEN_major__ //p')
1457 EMSCRIPTEN_MINOR=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 's/.*__EMSCRIPTEN_minor__ //p')
1458 EMSCRIPTEN_TINY=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 's/.*__EMSCRIPTEN_tiny__ //p')
1461 EMSCRIPTEN_VERSION="${EMSCRIPTEN_MAJOR}.${EMSCRIPTEN_MINOR}.${EMSCRIPTEN_TINY}"
1463 check_semantic_version_three_prefixed EMSCRIPTEN MIN
1464 if test $? -eq 0; then
1465 AC_MSG_RESULT([yes ($EMSCRIPTEN_VERSION)])
1467 AC_MSG_ERROR([no, found $EMSCRIPTEN_VERSION])
1471 if ! command -v emconfigure >/dev/null 2>&1; then
1472 AC_MSG_WARN([emconfigure must be in your \$PATH])
1475 if test -z "$EMMAKEN_JUST_CONFIGURE"; then
1476 AC_MSG_WARN(["\$EMMAKEN_JUST_CONFIGURE wasn't set by emconfigure. Prefix configure or use autogen.sh])
1479 EMSDK_FILE_PACKAGER="$(em-config EMSCRIPTEN_ROOT)"/tools/file_packager
1480 if ! test -x "$EMSDK_FILE_PACKAGER"; then
1481 AC_MSG_WARN([No file_packager found in $(em-config EMSCRIPTEN_ROOT)/tools/file_packager.])
1484 if test $EMSCRIPTEN_ERROR -ne 0; then
1485 AC_MSG_ERROR(["Please fix your EMSDK setup to build with Emscripten!"])
1488 dnl Some build-side things are conditional on "EMSCRIPTEN in BUILD_TYPE_FOR_HOST":
1489 BUILD_TYPE="$BUILD_TYPE EMSCRIPTEN"
1491 AC_SUBST(EMSDK_FILE_PACKAGER)
1492 AC_SUBST(EMSCRIPTEN_EXTRA_SOFFICE_POST_JS)
1494 ###############################################################################
1495 # Extensions switches --enable/--disable
1496 ###############################################################################
1497 # By default these should be enabled unless having extra dependencies.
1498 # If there is extra dependency over configure options then the enable should
1499 # be automagic based on whether the requiring feature is enabled or not.
1500 # All this options change anything only with --enable-extension-integration.
1502 # The name of this option and its help string makes it sound as if
1503 # extensions are built anyway, just not integrated in the installer,
1504 # if you use --disable-extension-integration. Is that really the
1507 AC_ARG_ENABLE(ios-simulator,
1508 AS_HELP_STRING([--enable-ios-simulator],
1509 [build for iOS simulator])
1512 libo_FUZZ_ARG_ENABLE(extension-integration,
1513 AS_HELP_STRING([--disable-extension-integration],
1514 [Disable integration of the built extensions in the installer of the
1515 product. Use this switch to disable the integration.])
1518 AC_ARG_ENABLE(avmedia,
1519 AS_HELP_STRING([--disable-avmedia],
1520 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.]),
1521 ,test "${enable_avmedia+set}" = set || enable_avmedia=yes)
1523 AC_ARG_ENABLE(database-connectivity,
1524 AS_HELP_STRING([--disable-database-connectivity],
1525 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
1528 # This doesn't mean not building (or "integrating") extensions
1529 # (although it probably should; i.e. it should imply
1530 # --disable-extension-integration I guess), it means not supporting
1531 # any extension mechanism at all
1532 libo_FUZZ_ARG_ENABLE(extensions,
1533 AS_HELP_STRING([--disable-extensions],
1534 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1537 AC_ARG_ENABLE(scripting,
1538 AS_HELP_STRING([--disable-scripting],
1539 [Disable BASIC, Java, Python and .NET. Work in progress, use only if you are hacking on it.]),
1540 ,test "${enable_scripting+set}" = set || enable_scripting=yes)
1542 # This is mainly for Android and iOS, but could potentially be used in some
1543 # special case otherwise, too, so factored out as a separate setting
1545 AC_ARG_ENABLE(dynamic-loading,
1546 AS_HELP_STRING([--disable-dynamic-loading],
1547 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1550 libo_FUZZ_ARG_ENABLE(report-builder,
1551 AS_HELP_STRING([--disable-report-builder],
1552 [Disable the Report Builder.])
1555 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1556 AS_HELP_STRING([--enable-ext-wiki-publisher],
1557 [Enable the Wiki Publisher extension.])
1560 libo_FUZZ_ARG_ENABLE(lpsolve,
1561 AS_HELP_STRING([--disable-lpsolve],
1562 [Disable compilation of the lp solve solver ])
1564 libo_FUZZ_ARG_ENABLE(coinmp,
1565 AS_HELP_STRING([--disable-coinmp],
1566 [Disable compilation of the CoinMP solver ])
1569 libo_FUZZ_ARG_ENABLE(pdfimport,
1570 AS_HELP_STRING([--disable-pdfimport],
1571 [Disable building the PDF import feature.])
1574 libo_FUZZ_ARG_ENABLE(pdfium,
1575 AS_HELP_STRING([--disable-pdfium],
1576 [Disable building PDFium. Results in insecure PDF signature verification.])
1579 libo_FUZZ_ARG_ENABLE(skia,
1580 AS_HELP_STRING([--disable-skia],
1581 [Disable building Skia. Use --enable-skia=debug to build without optimizations.])
1584 ###############################################################################
1586 dnl ---------- *** ----------
1588 libo_FUZZ_ARG_ENABLE(mergelibs,
1589 AS_HELP_STRING([--enable-mergelibs=yes/no/more],
1590 [Merge several of the smaller libraries into one big "merged" library.
1591 The "more" option will link even more of the smaller libraries.
1592 "more" not appropriate for distros which split up LibreOffice into multiple packages.
1593 It is only appropriate for situations where all of LO is delivered in a single install/package. ])
1596 libo_FUZZ_ARG_ENABLE(breakpad,
1597 AS_HELP_STRING([--enable-breakpad],
1598 [Enables breakpad for crash reporting.])
1601 libo_FUZZ_ARG_ENABLE(crashdump,
1602 AS_HELP_STRING([--disable-crashdump],
1603 [Disable dump.ini and dump-file, when --enable-breakpad])
1606 AC_ARG_ENABLE(fetch-external,
1607 AS_HELP_STRING([--disable-fetch-external],
1608 [Disables fetching external tarballs from web sources.])
1611 AC_ARG_ENABLE(fuzzers,
1612 AS_HELP_STRING([--enable-fuzzers],
1613 [Enables building libfuzzer targets for fuzz testing.])
1616 libo_FUZZ_ARG_ENABLE(pch,
1617 AS_HELP_STRING([--enable-pch=<yes/no/system/base/normal/full>],
1618 [Enables precompiled header support for C++. Forced default on Windows/VC build.
1619 Using 'system' will include only external headers, 'base' will add also headers
1620 from base modules, 'normal' will also add all headers except from the module built,
1621 'full' will use all suitable headers even from a module itself.])
1624 libo_FUZZ_ARG_ENABLE(epm,
1625 AS_HELP_STRING([--enable-epm],
1626 [LibreOffice includes self-packaging code, that requires epm, however epm is
1627 useless for large scale package building.])
1630 libo_FUZZ_ARG_ENABLE(odk,
1631 AS_HELP_STRING([--enable-odk],
1632 [Enable building the Office Development Kit, the part that extensions need to build against])
1635 AC_ARG_ENABLE(mpl-subset,
1636 AS_HELP_STRING([--enable-mpl-subset],
1637 [Don't compile any pieces which are not MPL or more liberally licensed])
1640 libo_FUZZ_ARG_ENABLE(evolution2,
1641 AS_HELP_STRING([--enable-evolution2],
1642 [Allows the built-in evolution 2 addressbook connectivity build to be
1646 AC_ARG_ENABLE(avahi,
1647 AS_HELP_STRING([--enable-avahi],
1648 [Determines whether to use Avahi to advertise Impress to remote controls.])
1651 AC_ARG_ENABLE(msvc-analyze,
1652 AS_HELP_STRING([--enable-msvc-analyze],
1653 [Determines whether to enable the Microsoft Visual Studio /analyze flag to provide additional warnings.])
1656 libo_FUZZ_ARG_ENABLE(werror,
1657 AS_HELP_STRING([--enable-werror],
1658 [Turn warnings to errors. (Has no effect in modules where the treating
1659 of warnings as errors is disabled explicitly.)]),
1662 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1663 AS_HELP_STRING([--enable-assert-always-abort],
1664 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1667 libo_FUZZ_ARG_ENABLE(dbgutil,
1668 AS_HELP_STRING([--enable-dbgutil],
1669 [Provide debugging support from --enable-debug and include additional debugging
1670 utilities such as object counting or more expensive checks.
1671 This is the recommended option for developers.
1672 Note that this makes the build ABI incompatible, it is not possible to mix object
1673 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1675 libo_FUZZ_ARG_ENABLE(debug,
1676 AS_HELP_STRING([--enable-debug],
1677 [Include debugging information, disable compiler optimization and inlining plus
1678 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1680 libo_FUZZ_ARG_ENABLE(split-debug,
1681 AS_HELP_STRING([--disable-split-debug],
1682 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1683 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1685 libo_FUZZ_ARG_ENABLE(gdb-index,
1686 AS_HELP_STRING([--disable-gdb-index],
1687 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1688 The feature requires a linker that supports the --gdb-index option.]))
1690 libo_FUZZ_ARG_ENABLE(sal-log,
1691 AS_HELP_STRING([--enable-sal-log],
1692 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1694 libo_FUZZ_ARG_ENABLE(symbols,
1695 AS_HELP_STRING([--enable-symbols],
1696 [Generate debug information.
1697 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1698 otherwise. It is possible to explicitly specify gbuild build targets
1699 (where 'all' means everything, '-' prepended means to not enable, '/' appended means
1700 everything in the directory; there is no ordering, more specific overrides
1701 more general, and disabling takes precedence).
1702 Example: --enable-symbols="all -sw/ -Library_sc".]))
1704 libo_FUZZ_ARG_ENABLE(optimized,
1705 AS_HELP_STRING([--enable-optimized=<yes/no/debug>],
1706 [Whether to compile with optimization flags.
1707 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1708 otherwise. Using 'debug' will try to use only optimizations that should
1709 not interfere with debugging. For Emscripten we default to optimized (-O1)
1710 debug build, as otherwise binaries become too large.]))
1712 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1713 AS_HELP_STRING([--disable-runtime-optimizations],
1714 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1715 JVM JIT) that are known to interact badly with certain dynamic analysis
1716 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1717 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1718 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1720 AC_ARG_WITH(valgrind,
1721 AS_HELP_STRING([--with-valgrind],
1722 [Make availability of Valgrind headers a hard requirement.]))
1724 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1725 AS_HELP_STRING([--enable-compiler-plugins],
1726 [Enable compiler plugins that will perform additional checks during
1727 building. Enabled automatically by --enable-dbgutil.
1728 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1729 COMPILER_PLUGINS_DEBUG=
1730 if test "$enable_compiler_plugins" = debug; then
1731 enable_compiler_plugins=yes
1732 COMPILER_PLUGINS_DEBUG=TRUE
1735 libo_FUZZ_ARG_ENABLE(compiler-plugins-analyzer-pch,
1736 AS_HELP_STRING([--disable-compiler-plugins-analyzer-pch],
1737 [Disable use of precompiled headers when running the Clang compiler plugin analyzer. Not
1738 relevant in the --disable-compiler-plugins case.]))
1740 libo_FUZZ_ARG_ENABLE(ooenv,
1741 AS_HELP_STRING([--enable-ooenv],
1742 [Enable ooenv for the instdir installation.]))
1745 AS_HELP_STRING([--enable-lto],
1746 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1747 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1750 AC_ARG_ENABLE(python,
1751 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1752 [Enables or disables Python support at run-time.
1753 Also specifies what Python to use at build-time.
1754 'fully-internal' even forces the internal version for uses of Python
1756 On macOS the only choices are
1757 'internal' (default) or 'fully-internal'. Otherwise the default is 'auto'.
1760 libo_FUZZ_ARG_ENABLE(gtk3,
1761 AS_HELP_STRING([--disable-gtk3],
1762 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1763 ,test "${test_gtk3}" = no -o "${enable_gtk3+set}" = set || enable_gtk3=yes)
1766 AS_HELP_STRING([--enable-gtk4],
1767 [Determines whether to use Gtk+ 4.0 vclplug on platforms where Gtk+ 4.0 is available.]))
1769 AC_ARG_ENABLE(atspi-tests,
1770 AS_HELP_STRING([--disable-atspi-tests],
1771 [Determines whether to enable AT-SPI2 tests for the GTK3 vclplug.]))
1773 AC_ARG_ENABLE(introspection,
1774 AS_HELP_STRING([--enable-introspection],
1775 [Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
1776 Linux distributions.)]))
1778 AC_ARG_ENABLE(split-app-modules,
1779 AS_HELP_STRING([--enable-split-app-modules],
1780 [Split file lists for app modules, e.g. base, calc.
1781 Has effect only with make distro-pack-install]),
1784 AC_ARG_ENABLE(split-opt-features,
1785 AS_HELP_STRING([--enable-split-opt-features],
1786 [Split file lists for some optional features, e.g. pyuno, testtool.
1787 Has effect only with make distro-pack-install]),
1790 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1791 AS_HELP_STRING([--disable-cairo-canvas],
1792 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1795 libo_FUZZ_ARG_ENABLE(dbus,
1796 AS_HELP_STRING([--disable-dbus],
1797 [Determines whether to enable features that depend on dbus.
1798 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1799 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1801 libo_FUZZ_ARG_ENABLE(sdremote,
1802 AS_HELP_STRING([--disable-sdremote],
1803 [Determines whether to enable Impress remote control (i.e. the server component).]),
1804 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1806 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1807 AS_HELP_STRING([--disable-sdremote-bluetooth],
1808 [Determines whether to build sdremote with bluetooth support.
1809 Requires dbus on Linux.]))
1811 libo_FUZZ_ARG_ENABLE(gio,
1812 AS_HELP_STRING([--disable-gio],
1813 [Determines whether to use the GIO support.]),
1814 ,test "${enable_gio+set}" = set || enable_gio=yes)
1817 AS_HELP_STRING([--enable-qt5],
1818 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1823 AS_HELP_STRING([--enable-qt6],
1824 [Determines whether to use Qt6 vclplug on platforms where Qt6 is
1828 AC_ARG_ENABLE(qt6-multimedia,
1829 AS_HELP_STRING([--disable-qt6-multimedia],
1830 [Determines whether to enable media playback using QtMultimedia when using the qt6/kf6 VCL plugins.]))
1833 AS_HELP_STRING([--enable-kf5],
1834 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1835 KF5 are available.]),
1839 AS_HELP_STRING([--enable-kf6],
1840 [Determines whether to use KF6 vclplug on platforms where Qt6 and
1841 KF6 are available.]),
1845 AC_ARG_ENABLE(gtk3_kde5,
1846 AS_HELP_STRING([--enable-gtk3-kde5],
1847 [Determines whether to use Gtk3 vclplug with KF5 file dialogs on
1848 platforms where Gtk3, Qt5 and Plasma is available.]),
1852 AS_HELP_STRING([--enable-gen],
1853 [To select the gen backend in case of --disable-dynamic-loading.
1854 Per default auto-enabled when X11 is used.]),
1855 ,test "${test_gen}" = no -o "${enable_gen+set}" = set || enable_gen=yes)
1858 AS_HELP_STRING([--disable-gui],
1859 [Disable use of X11 or Wayland to reduce dependencies (e.g. for building LibreOfficeKit).]),
1862 libo_FUZZ_ARG_ENABLE(randr,
1863 AS_HELP_STRING([--disable-randr],
1864 [Disable RandR support in the vcl project.]),
1865 ,test "${enable_randr+set}" = set || enable_randr=yes)
1867 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1868 AS_HELP_STRING([--disable-gstreamer-1-0],
1869 [Disable building with the gstreamer 1.0 avmedia backend.]),
1870 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1872 libo_FUZZ_ARG_ENABLE([eot],
1873 [AS_HELP_STRING([--enable-eot],
1874 [Enable support for Embedded OpenType fonts.])],
1875 ,test "${enable_eot+set}" = set || enable_eot=no)
1877 libo_FUZZ_ARG_ENABLE(cve-tests,
1878 AS_HELP_STRING([--disable-cve-tests],
1879 [Prevent CVE tests to be executed]),
1882 AC_ARG_ENABLE(build-opensymbol,
1883 AS_HELP_STRING([--enable-build-opensymbol],
1884 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1885 fontforge installed.]),
1888 AC_ARG_ENABLE(dependency-tracking,
1889 AS_HELP_STRING([--enable-dependency-tracking],
1890 [Do not reject slow dependency extractors.])[
1891 --disable-dependency-tracking
1892 Disables generation of dependency information.
1893 Speed up one-time builds.],
1896 AC_ARG_ENABLE(icecream,
1897 AS_HELP_STRING([--enable-icecream],
1898 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1899 It defaults to /opt/icecream for the location of the icecream gcc/g++
1900 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1904 AS_HELP_STRING([--enable-ld=<linker>],
1905 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1906 By default tries to use the best linker possible, use --disable-ld to use the default linker.
1907 If <linker> contains any ':', the part before the first ':' is used as the value of
1908 -fuse-ld, while the part after the first ':' is used as the value of --ld-path (which is
1909 needed for Clang 12).]),
1913 AS_HELP_STRING([--enable-cpdb],
1914 [Build CPDB (Common Print Dialog Backends) support.]),
1917 libo_FUZZ_ARG_ENABLE(cups,
1918 AS_HELP_STRING([--disable-cups],
1919 [Do not build cups support.])
1922 AC_ARG_ENABLE(ccache,
1923 AS_HELP_STRING([--disable-ccache],
1924 [Do not try to use ccache automatically.
1925 By default we will try to detect if ccache is available; in that case if
1926 CC/CXX are not yet set, and --enable-icecream is not given, we
1927 attempt to use ccache. --disable-ccache disables ccache completely.
1928 Additionally ccache's depend mode is enabled if possible,
1929 use --enable-ccache=nodepend to enable ccache without depend mode.
1933 AC_ARG_ENABLE(z7-debug,
1934 AS_HELP_STRING([--enable-z7-debug],
1935 [Makes the MSVC compiler use -Z7 for debugging instead of the default -Zi. Using this option takes
1936 more disk spaces but allows to use ccache. Final PDB files are created even with this option enabled.
1937 Enabled by default if ccache is detected.]))
1939 libo_FUZZ_ARG_ENABLE(online-update,
1940 AS_HELP_STRING([--enable-online-update],
1941 [Enable the online update service that will check for new versions of
1942 LibreOffice. Disabled by default. Requires --with-privacy-policy-url to be set.]),
1945 libo_FUZZ_ARG_ENABLE(online-update-mar,
1946 AS_HELP_STRING([--enable-online-update-mar],
1947 [Enable the experimental Mozilla-like online update service that will
1948 check for new versions of LibreOffice. Disabled by default.]),
1951 libo_FUZZ_ARG_WITH(online-update-mar-baseurl,
1952 AS_HELP_STRING([--with-online-update-mar-baseurl=...],
1953 [Set the base URL value for --enable-online-update-mar.
1954 (Can be left off for debug purposes, even if that may render the feature
1958 libo_FUZZ_ARG_WITH(online-update-mar-certificateder,
1959 AS_HELP_STRING([--with-online-update-mar-certificateder=...],
1960 [Set the certificate DER value for --enable-online-update-mar.
1961 (Can be left off for debug purposes, even if that may render the feature
1965 libo_FUZZ_ARG_WITH(online-update-mar-certificatename,
1966 AS_HELP_STRING([--with-online-update-mar-certificatename=...],
1967 [Set the certificate name value for --enable-online-update-mar.
1968 (Can be left off for debug purposes, even if that may render the feature
1972 libo_FUZZ_ARG_WITH(online-update-mar-certificatepath,
1973 AS_HELP_STRING([--with-online-update-mar-certificatepath=...],
1974 [Set the certificate path value for --enable-online-update-mar.
1975 (Can be left off for debug purposes, even if that may render the feature
1979 libo_FUZZ_ARG_ENABLE(extension-update,
1980 AS_HELP_STRING([--disable-extension-update],
1981 [Disable possibility to update installed extensions.]),
1984 libo_FUZZ_ARG_ENABLE(release-build,
1985 AS_HELP_STRING([--enable-release-build],
1986 [Enable release build. Note that the "release build" choice is orthogonal to
1987 whether symbols are present, debug info is generated, or optimization
1989 See https://wiki.documentfoundation.org/Development/DevBuild]),
1992 libo_FUZZ_ARG_ENABLE(hardening-flags,
1993 AS_HELP_STRING([--enable-hardening-flags],
1994 [Enable automatically using hardening compiler flags. Distros typically
1995 instead use their default configuration via CXXFLAGS, etc. But this provides a
1996 convenient set of default hardening flags for non-distros]),
1999 AC_ARG_ENABLE(windows-build-signing,
2000 AS_HELP_STRING([--enable-windows-build-signing],
2001 [Enable signing of windows binaries (*.exe, *.dll)]),
2004 AC_ARG_ENABLE(silent-msi,
2005 AS_HELP_STRING([--enable-silent-msi],
2006 [Enable MSI with LIMITUI=1 (silent install).]),
2010 AS_HELP_STRING([--enable-wix],
2011 [Build Windows installer using WiX.]),
2014 AC_ARG_ENABLE(macosx-code-signing,
2015 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
2016 [Sign executables, dylibs, frameworks and the app bundle. If you
2017 don't provide an identity the first suitable certificate
2018 in your keychain is used.]),
2021 AC_ARG_ENABLE(macosx-package-signing,
2022 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
2023 [Create a .pkg suitable for uploading to the Mac App Store and sign
2024 it. If you don't provide an identity the first suitable certificate
2025 in your keychain is used.]),
2028 AC_ARG_ENABLE(macosx-sandbox,
2029 AS_HELP_STRING([--enable-macosx-sandbox],
2030 [Make the app bundle run in a sandbox. Requires code signing.
2031 Is required by apps distributed in the Mac App Store, and implies
2032 adherence to App Store rules.]),
2035 AC_ARG_WITH(macosx-bundle-identifier,
2036 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
2037 [Define the macOS bundle identifier. Default is the somewhat weird
2038 org.libreoffice.script ("script", huh?).]),
2039 ,with_macosx_bundle_identifier=org.libreoffice.script)
2041 AC_ARG_WITH(macosx-provisioning-profile,
2042 AS_HELP_STRING([--with-macosx-provisioning-profile=/path/to/mac.provisionprofile],
2043 [Specify the path to a provisioning profile to use]),
2046 AC_ARG_WITH(product-name,
2047 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
2048 [Define the product name. Default is AC_PACKAGE_NAME.]),
2049 ,with_product_name=$PRODUCTNAME)
2051 libo_FUZZ_ARG_ENABLE(community-flavor,
2052 AS_HELP_STRING([--disable-community-flavor],
2053 [Disable the Community branding.]),
2056 AC_ARG_WITH(package-version,
2057 AS_HELP_STRING([--with-package-version='3.1.4.5'],
2058 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
2061 libo_FUZZ_ARG_ENABLE(readonly-installset,
2062 AS_HELP_STRING([--enable-readonly-installset],
2063 [Prevents any attempts by LibreOffice to write into its installation. That means
2064 at least that no "system-wide" extensions can be added. Partly experimental work in
2065 progress, probably not fully implemented. Always enabled for macOS.]),
2068 libo_FUZZ_ARG_ENABLE(mariadb-sdbc,
2069 AS_HELP_STRING([--disable-mariadb-sdbc],
2070 [Disable the build of the MariaDB/MySQL-SDBC driver.])
2073 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
2074 AS_HELP_STRING([--disable-postgresql-sdbc],
2075 [Disable the build of the PostgreSQL-SDBC driver.])
2078 libo_FUZZ_ARG_ENABLE(lotuswordpro,
2079 AS_HELP_STRING([--disable-lotuswordpro],
2080 [Disable the build of the Lotus Word Pro filter.]),
2081 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
2083 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
2084 AS_HELP_STRING([--disable-firebird-sdbc],
2085 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
2086 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
2088 AC_ARG_ENABLE(bogus-pkg-config,
2089 AS_HELP_STRING([--enable-bogus-pkg-config],
2090 [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.]),
2093 AC_ARG_ENABLE(openssl,
2094 AS_HELP_STRING([--disable-openssl],
2095 [Disable using libssl/libcrypto from OpenSSL. If disabled,
2096 components will use NSS. Work in progress,
2097 use only if you are hacking on it.]),
2098 ,enable_openssl=yes)
2100 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
2101 AS_HELP_STRING([--enable-cipher-openssl-backend],
2102 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
2103 Requires --enable-openssl.]))
2106 AS_HELP_STRING([--disable-nss],
2107 [Disable using NSS. If disabled,
2108 components will use openssl. Work in progress,
2109 use only if you are hacking on it.]),
2112 AC_ARG_ENABLE(library-bin-tar,
2113 AS_HELP_STRING([--enable-library-bin-tar],
2114 [Enable the building and reused of tarball of binary build for some 'external' libraries.
2115 Some libraries can save their build result in a tarball
2116 stored in TARFILE_LOCATION. That binary tarball is
2117 uniquely identified by the source tarball,
2118 the content of the config_host.mk file and the content
2119 of the top-level directory in core for that library
2120 If this option is enabled, then if such a tarfile exist, it will be untarred
2121 instead of the source tarfile, and the build step will be skipped for that
2123 If a proper tarfile does not exist, then the normal source-based
2124 build is done for that library and a proper binary tarfile is created
2125 for the next time.]),
2128 AC_ARG_ENABLE(dconf,
2129 AS_HELP_STRING([--disable-dconf],
2130 [Disable the dconf configuration backend (enabled by default where
2133 libo_FUZZ_ARG_ENABLE(formula-logger,
2135 [--enable-formula-logger],
2136 [Enable formula logger for logging formula calculation flow in Calc.]
2141 AS_HELP_STRING([--disable-ldap],
2142 [Disable LDAP support.]),
2145 AC_ARG_ENABLE(opencl,
2146 AS_HELP_STRING([--disable-opencl],
2147 [Disable OpenCL support.]),
2150 libo_FUZZ_ARG_ENABLE(librelogo,
2151 AS_HELP_STRING([--disable-librelogo],
2152 [Do not build LibreLogo.]),
2153 ,enable_librelogo=yes)
2155 AC_ARG_ENABLE(wasm-strip,
2156 AS_HELP_STRING([--enable-wasm-strip],
2157 [Strip the static build like for WASM/emscripten platform.]),
2160 AC_ARG_WITH(main-module,
2161 AS_HELP_STRING([--with-main-module=<writer/calc>],
2162 [Specify which main module to build for wasm.
2163 Default value is 'writer'.]),
2166 AC_ARG_ENABLE(xmlhelp,
2167 AS_HELP_STRING([--disable-xmlhelp],
2168 [Disable XML help support]),
2169 ,enable_xmlhelp=yes)
2171 AC_ARG_ENABLE(customtarget-components,
2172 AS_HELP_STRING([--enable-customtarget-components],
2173 [Generates the static UNO object constructor mapping from the build.]))
2176 AS_HELP_STRING([--disable-cli],
2177 [Disable the generation of old CLI bindings.]),
2180 AC_ARG_ENABLE(dotnet,
2181 AS_HELP_STRING([--enable-dotnet],
2182 [Enables or disables .NET 8.0 support and bindings generation.]))
2184 dnl ===================================================================
2185 dnl Optional Packages (--with/without-)
2186 dnl ===================================================================
2188 AC_ARG_WITH(gcc-home,
2189 AS_HELP_STRING([--with-gcc-home],
2190 [Specify the location of gcc/g++ manually. This can be used in conjunction
2191 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
2192 non-default path.]),
2195 AC_ARG_WITH(gnu-patch,
2196 AS_HELP_STRING([--with-gnu-patch],
2197 [Specify location of GNU patch on Solaris or FreeBSD.]),
2200 AC_ARG_WITH(build-platform-configure-options,
2201 AS_HELP_STRING([--with-build-platform-configure-options],
2202 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
2206 AS_HELP_STRING([--with-gnu-cp],
2207 [Specify location of GNU cp on Solaris or FreeBSD.]),
2210 AC_ARG_WITH(external-tar,
2211 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
2212 [Specify an absolute path of where to find (and store) tarfiles.]),
2213 TARFILE_LOCATION=$withval ,
2216 AC_ARG_WITH(referenced-git,
2217 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
2218 [Specify another checkout directory to reference. This makes use of
2219 git submodule update --reference, and saves a lot of diskspace
2220 when having multiple trees side-by-side.]),
2221 GIT_REFERENCE_SRC=$withval ,
2224 AC_ARG_WITH(linked-git,
2225 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
2226 [Specify a directory where the repositories of submodules are located.
2227 This uses a method similar to git-new-workdir to get submodules.]),
2228 GIT_LINK_SRC=$withval ,
2231 AC_ARG_WITH(galleries,
2232 AS_HELP_STRING([--with-galleries],
2233 [Specify how galleries should be built. It is possible either to
2234 build these internally from source ("build"),
2235 or to disable them ("no")]),
2238 AC_ARG_WITH(templates,
2239 AS_HELP_STRING([--with-templates],
2240 [Specify we build with or without template files. It is possible either to
2241 build with templates ("yes"),
2242 or to disable them ("no")]),
2246 AS_HELP_STRING([--with-theme="theme1 theme2..."],
2247 [Choose which themes to include. By default those themes with an '*' are included.
2248 Possible choices: *breeze, *breeze_dark, *breeze_dark_svg, *breeze_svg,
2249 *colibre, *colibre_svg, *colibre_dark, *colibre_dark_svg,
2250 *elementary, *elementary_svg,
2251 *karasa_jaga, *karasa_jaga_svg,
2252 *sifr, *sifr_dark, *sifr_dark_svg, *sifr_svg,
2253 *sukapura, *sukapura_dark, *sukapura_dark_svg, *sukapura_svg.]),
2256 libo_FUZZ_ARG_WITH(helppack-integration,
2257 AS_HELP_STRING([--without-helppack-integration],
2258 [It will not integrate the helppacks to the installer
2259 of the product. Please use this switch to use the online help
2260 or separate help packages.]),
2263 libo_FUZZ_ARG_WITH(fonts,
2264 AS_HELP_STRING([--without-fonts],
2265 [LibreOffice includes some third-party fonts to provide a reliable basis for
2266 help content, templates, samples, etc. When these fonts are already
2267 known to be available on the system then you should use this option.]),
2271 AS_HELP_STRING([--with-epm],
2272 [Decides which epm to use. Default is to use the one from the system if
2273 one is built. When either this is not there or you say =internal epm
2277 AC_ARG_WITH(package-format,
2278 AS_HELP_STRING([--with-package-format],
2279 [Specify package format(s) for LibreOffice installation sets. The
2280 implicit --without-package-format leads to no installation sets being
2281 generated. Possible values: archive, bsd, deb, dmg, emscripten,
2282 installed, msi, pkg, and rpm.
2283 Example: --with-package-format='deb rpm']),
2287 AS_HELP_STRING([--with-tls],
2288 [Decides which TLS/SSL and cryptographic implementations to use for
2289 LibreOffice's code. Default is to use NSS although OpenSSL is also
2290 possible. Notice that selecting NSS restricts the usage of OpenSSL
2291 in LO's code but selecting OpenSSL doesn't restrict by now the
2292 usage of NSS in LO's code. Possible values: openssl, nss.
2293 Example: --with-tls="nss"]),
2296 AC_ARG_WITH(system-libs,
2297 AS_HELP_STRING([--with-system-libs],
2298 [Use libraries already on system -- enables all --with-system-* flags.]),
2301 AC_ARG_WITH(system-bzip2,
2302 AS_HELP_STRING([--with-system-bzip2],
2303 [Use bzip2 already on system. Used when --enable-online-update-mar
2304 or --enable-python=internal]),,
2305 [with_system_bzip2="$with_system_libs"])
2307 AC_ARG_WITH(system-headers,
2308 AS_HELP_STRING([--with-system-headers],
2309 [Use headers already on system -- enables all --with-system-* flags for
2310 external packages whose headers are the only entities used i.e.
2311 boost/odbc/sane-header(s).]),,
2312 [with_system_headers="$with_system_libs"])
2314 AC_ARG_WITH(system-jars,
2315 AS_HELP_STRING([--without-system-jars],
2316 [When building with --with-system-libs, also the needed jars are expected
2317 on the system. Use this to disable that]),,
2318 [with_system_jars="$with_system_libs"])
2320 AC_ARG_WITH(system-cairo,
2321 AS_HELP_STRING([--with-system-cairo],
2322 [Use cairo libraries already on system. Happens automatically for
2323 (implicit) --enable-gtk3.]))
2325 AC_ARG_WITH(system-epoxy,
2326 AS_HELP_STRING([--with-system-epoxy],
2327 [Use epoxy libraries already on system. Happens automatically for
2328 (implicit) --enable-gtk3.]),,
2329 [with_system_epoxy="$with_system_libs"])
2331 AC_ARG_WITH(myspell-dicts,
2332 AS_HELP_STRING([--with-myspell-dicts],
2333 [Adds myspell dictionaries to the LibreOffice installation set]),
2336 AC_ARG_WITH(system-dicts,
2337 AS_HELP_STRING([--without-system-dicts],
2338 [Do not use dictionaries from system paths.]),
2341 AC_ARG_WITH(external-dict-dir,
2342 AS_HELP_STRING([--with-external-dict-dir],
2343 [Specify external dictionary dir.]),
2346 AC_ARG_WITH(external-hyph-dir,
2347 AS_HELP_STRING([--with-external-hyph-dir],
2348 [Specify external hyphenation pattern dir.]),
2351 AC_ARG_WITH(external-thes-dir,
2352 AS_HELP_STRING([--with-external-thes-dir],
2353 [Specify external thesaurus dir.]),
2356 AC_ARG_WITH(system-zlib,
2357 AS_HELP_STRING([--with-system-zlib],
2358 [Use zlib already on system.]),,
2359 [with_system_zlib=auto])
2361 AC_ARG_WITH(system-jpeg,
2362 AS_HELP_STRING([--with-system-jpeg],
2363 [Use jpeg already on system.]),,
2364 [with_system_jpeg="$with_system_libs"])
2366 AC_ARG_WITH(system-expat,
2367 AS_HELP_STRING([--with-system-expat],
2368 [Use expat already on system.]),,
2369 [with_system_expat="$with_system_libs"])
2371 AC_ARG_WITH(system-libxml,
2372 AS_HELP_STRING([--with-system-libxml],
2373 [Use libxml/libxslt already on system.]),,
2374 [with_system_libxml=auto])
2376 AC_ARG_WITH(system-openldap,
2377 AS_HELP_STRING([--with-system-openldap],
2378 [Use the OpenLDAP LDAP SDK already on system.]),,
2379 [with_system_openldap="$with_system_libs"])
2381 libo_FUZZ_ARG_ENABLE(poppler,
2382 AS_HELP_STRING([--disable-poppler],
2383 [Disable building Poppler.])
2386 AC_ARG_WITH(system-poppler,
2387 AS_HELP_STRING([--with-system-poppler],
2388 [Use system poppler (only needed for PDF import).]),,
2389 [with_system_poppler="$with_system_libs"])
2391 AC_ARG_WITH(system-abseil,
2392 AS_HELP_STRING([--with-system-abseil],
2393 [Use the abseil libraries already on system.]),,
2394 [with_system_abseil="$with_system_libs"])
2396 AC_ARG_WITH(system-openjpeg,
2397 AS_HELP_STRING([--with-system-openjpeg],
2398 [Use the OpenJPEG library already on system.]),,
2399 [with_system_openjpeg="$with_system_libs"])
2401 libo_FUZZ_ARG_ENABLE(gpgmepp,
2402 AS_HELP_STRING([--disable-gpgmepp],
2403 [Disable building gpgmepp. Do not use in normal cases unless you want to fix potential problems it causes.])
2406 AC_ARG_WITH(system-gpgmepp,
2407 AS_HELP_STRING([--with-system-gpgmepp],
2408 [Use gpgmepp already on system]),,
2409 [with_system_gpgmepp="$with_system_libs"])
2411 AC_ARG_WITH(system-mariadb,
2412 AS_HELP_STRING([--with-system-mariadb],
2413 [Use MariaDB/MySQL libraries already on system.]),,
2414 [with_system_mariadb="$with_system_libs"])
2416 AC_ARG_ENABLE(bundle-mariadb,
2417 AS_HELP_STRING([--enable-bundle-mariadb],
2418 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
2421 AC_ARG_WITH(system-postgresql,
2422 AS_HELP_STRING([--with-system-postgresql],
2423 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
2424 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
2425 [with_system_postgresql="$with_system_libs"])
2427 AC_ARG_WITH(libpq-path,
2428 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
2429 [Use this PostgreSQL C interface (libpq) installation for building
2430 the PostgreSQL-SDBC extension.]),
2433 AC_ARG_WITH(system-firebird,
2434 AS_HELP_STRING([--with-system-firebird],
2435 [Use Firebird libraries already on system, for building the Firebird-SDBC
2436 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
2437 [with_system_firebird="$with_system_libs"])
2439 AC_ARG_WITH(system-libtommath,
2440 AS_HELP_STRING([--with-system-libtommath],
2441 [Use libtommath already on system]),,
2442 [with_system_libtommath="$with_system_libs"])
2444 AC_ARG_WITH(system-hsqldb,
2445 AS_HELP_STRING([--with-system-hsqldb],
2446 [Use hsqldb already on system.]))
2448 AC_ARG_WITH(hsqldb-jar,
2449 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
2450 [Specify path to jarfile manually.]),
2451 HSQLDB_JAR=$withval)
2453 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
2454 AS_HELP_STRING([--disable-scripting-beanshell],
2455 [Disable support for scripts in BeanShell.]),
2459 AC_ARG_WITH(system-beanshell,
2460 AS_HELP_STRING([--with-system-beanshell],
2461 [Use beanshell already on system.]),,
2462 [with_system_beanshell="$with_system_jars"])
2464 AC_ARG_WITH(beanshell-jar,
2465 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
2466 [Specify path to jarfile manually.]),
2469 libo_FUZZ_ARG_ENABLE(scripting-javascript,
2470 AS_HELP_STRING([--disable-scripting-javascript],
2471 [Disable support for scripts in JavaScript.]),
2475 AC_ARG_WITH(system-rhino,
2476 AS_HELP_STRING([--with-system-rhino],
2477 [Use rhino already on system.]),,
2478 [with_system_rhino="$with_system_jars"])
2480 AC_ARG_WITH(rhino-jar,
2481 AS_HELP_STRING([--with-rhino-jar=JARFILE],
2482 [Specify path to jarfile manually.]),
2485 AC_ARG_WITH(system-jfreereport,
2486 AS_HELP_STRING([--with-system-jfreereport],
2487 [Use JFreeReport already on system.]),,
2488 [with_system_jfreereport="$with_system_jars"])
2490 AC_ARG_WITH(sac-jar,
2491 AS_HELP_STRING([--with-sac-jar=JARFILE],
2492 [Specify path to jarfile manually.]),
2495 AC_ARG_WITH(libxml-jar,
2496 AS_HELP_STRING([--with-libxml-jar=JARFILE],
2497 [Specify path to jarfile manually.]),
2498 LIBXML_JAR=$withval)
2500 AC_ARG_WITH(flute-jar,
2501 AS_HELP_STRING([--with-flute-jar=JARFILE],
2502 [Specify path to jarfile manually.]),
2505 AC_ARG_WITH(jfreereport-jar,
2506 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
2507 [Specify path to jarfile manually.]),
2508 JFREEREPORT_JAR=$withval)
2510 AC_ARG_WITH(liblayout-jar,
2511 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
2512 [Specify path to jarfile manually.]),
2513 LIBLAYOUT_JAR=$withval)
2515 AC_ARG_WITH(libloader-jar,
2516 AS_HELP_STRING([--with-libloader-jar=JARFILE],
2517 [Specify path to jarfile manually.]),
2518 LIBLOADER_JAR=$withval)
2520 AC_ARG_WITH(libformula-jar,
2521 AS_HELP_STRING([--with-libformula-jar=JARFILE],
2522 [Specify path to jarfile manually.]),
2523 LIBFORMULA_JAR=$withval)
2525 AC_ARG_WITH(librepository-jar,
2526 AS_HELP_STRING([--with-librepository-jar=JARFILE],
2527 [Specify path to jarfile manually.]),
2528 LIBREPOSITORY_JAR=$withval)
2530 AC_ARG_WITH(libfonts-jar,
2531 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
2532 [Specify path to jarfile manually.]),
2533 LIBFONTS_JAR=$withval)
2535 AC_ARG_WITH(libserializer-jar,
2536 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
2537 [Specify path to jarfile manually.]),
2538 LIBSERIALIZER_JAR=$withval)
2540 AC_ARG_WITH(libbase-jar,
2541 AS_HELP_STRING([--with-libbase-jar=JARFILE],
2542 [Specify path to jarfile manually.]),
2543 LIBBASE_JAR=$withval)
2545 AC_ARG_WITH(system-odbc,
2546 AS_HELP_STRING([--with-system-odbc],
2547 [Use the odbc headers already on system.]),,
2548 [with_system_odbc="auto"])
2550 AC_ARG_WITH(system-sane,
2551 AS_HELP_STRING([--with-system-sane],
2552 [Use sane.h already on system.]),,
2553 [with_system_sane="$with_system_headers"])
2555 AC_ARG_WITH(system-bluez,
2556 AS_HELP_STRING([--with-system-bluez],
2557 [Use bluetooth.h already on system.]),,
2558 [with_system_bluez="$with_system_headers"])
2560 AC_ARG_WITH(system-boost,
2561 AS_HELP_STRING([--with-system-boost],
2562 [Use boost already on system.]),,
2563 [with_system_boost="$with_system_headers"])
2565 AC_ARG_WITH(system-dragonbox,
2566 AS_HELP_STRING([--with-system-dragonbox],
2567 [Use dragonbox already on system.]),,
2568 [with_system_dragonbox="$with_system_headers"])
2570 AC_ARG_WITH(system-frozen,
2571 AS_HELP_STRING([--with-system-frozen],
2572 [Use frozen already on system.]),,
2573 [with_system_frozen="$with_system_headers"])
2575 AC_ARG_WITH(system-libfixmath,
2576 AS_HELP_STRING([--with-system-libfixmath],
2577 [Use libfixmath already on system.]),,
2578 [with_system_libfixmath="$with_system_libs"])
2580 AC_ARG_WITH(system-glm,
2581 AS_HELP_STRING([--with-system-glm],
2582 [Use glm already on system.]),,
2583 [with_system_glm="$with_system_headers"])
2585 AC_ARG_WITH(system-hunspell,
2586 AS_HELP_STRING([--with-system-hunspell],
2587 [Use libhunspell already on system.]),,
2588 [with_system_hunspell="$with_system_libs"])
2590 libo_FUZZ_ARG_ENABLE(cairo-rgba,
2591 AS_HELP_STRING([--enable-cairo-rgba],
2592 [Use RGBA order, instead of default BRGA. Not possible with --with-system-cairo]))
2594 libo_FUZZ_ARG_ENABLE(zxing,
2595 AS_HELP_STRING([--disable-zxing],
2596 [Disable use of zxing external library.]))
2598 AC_ARG_WITH(system-zxing,
2599 AS_HELP_STRING([--with-system-zxing],
2600 [Use libzxing already on system.]),,
2601 [with_system_zxing="$with_system_libs"])
2603 AC_ARG_WITH(system-zxcvbn,
2604 AS_HELP_STRING([--with-system-zxcvbn],
2605 [Use libzxcvbn already on system.]),,
2606 [with_system_zxcvbn="$with_system_libs"])
2608 AC_ARG_WITH(system-box2d,
2609 AS_HELP_STRING([--with-system-box2d],
2610 [Use box2d already on system.]),,
2611 [with_system_box2d="$with_system_libs"])
2613 AC_ARG_WITH(system-mythes,
2614 AS_HELP_STRING([--with-system-mythes],
2615 [Use mythes already on system.]),,
2616 [with_system_mythes="$with_system_libs"])
2618 AC_ARG_WITH(system-altlinuxhyph,
2619 AS_HELP_STRING([--with-system-altlinuxhyph],
2620 [Use ALTLinuxhyph already on system.]),,
2621 [with_system_altlinuxhyph="$with_system_libs"])
2623 AC_ARG_WITH(system-lpsolve,
2624 AS_HELP_STRING([--with-system-lpsolve],
2625 [Use lpsolve already on system.]),,
2626 [with_system_lpsolve="$with_system_libs"])
2628 AC_ARG_WITH(system-coinmp,
2629 AS_HELP_STRING([--with-system-coinmp],
2630 [Use CoinMP already on system.]),,
2631 [with_system_coinmp="$with_system_libs"])
2633 AC_ARG_WITH(system-liblangtag,
2634 AS_HELP_STRING([--with-system-liblangtag],
2635 [Use liblangtag library already on system.]),,
2636 [with_system_liblangtag="$with_system_libs"])
2638 AC_ARG_WITH(system-lockfile,
2639 AS_HELP_STRING([--with-system-lockfile[=file]],
2640 [Detect a system lockfile program or use the \$file argument.]))
2643 AS_HELP_STRING([--without-webdav],
2644 [Disable WebDAV support in the UCB.]))
2646 AC_ARG_WITH(linker-hash-style,
2647 AS_HELP_STRING([--with-linker-hash-style],
2648 [Use linker with --hash-style=<style> when linking shared objects.
2649 Possible values: "sysv", "gnu", "both". The default value is "gnu"
2650 if supported on the build system, and "sysv" otherwise.]))
2652 AC_ARG_WITH(jdk-home,
2653 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
2654 [If you have installed JDK 8 or later on your system please supply the
2655 path here. Note that this is not the location of the java command but the
2656 location of the entire distribution. In case of cross-compiling, this
2657 is the JDK of the host os. Use --with-build-platform-configure-options
2658 to point to a different build platform JDK.]),
2662 AS_HELP_STRING([--with-help],
2663 [Enable the build of help. There is a special parameter "common" that
2664 can be used to bundle only the common part, .e.g help-specific icons.
2665 This is useful when you build the helpcontent separately.])
2667 Usage: --with-help build the old local help
2668 --without-help no local help (default)
2669 --with-help=html build the new HTML local help
2670 --with-help=online build the new HTML online help
2674 AC_ARG_WITH(omindex,
2675 AS_HELP_STRING([--with-omindex],
2676 [Enable the support of xapian-omega index for online help.])
2678 Usage: --with-omindex=server prepare the pages for omindex
2679 but let xapian-omega be built in server.
2680 --with-omindex=noxap do not prepare online pages
2685 libo_FUZZ_ARG_WITH(java,
2686 AS_HELP_STRING([--with-java=<java command>],
2687 [Specify the name of the Java interpreter command. Typically "java"
2688 which is the default.
2690 To build without support for Java components, applets, accessibility
2691 or the XML filters written in Java, use --without-java or --with-java=no.]),
2692 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2693 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
2696 AC_ARG_WITH(jvm-path,
2697 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
2698 [Use a specific JVM search path at runtime.
2699 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2702 AC_ARG_WITH(ant-home,
2703 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2704 [If you have installed Apache Ant on your system, please supply the path here.
2705 Note that this is not the location of the Ant binary but the location
2706 of the entire distribution.]),
2709 AC_ARG_WITH(symbol-config,
2710 AS_HELP_STRING([--with-symbol-config],
2711 [Configuration for the crashreport symbol upload]),
2713 [with_symbol_config=no])
2715 AC_ARG_WITH(export-validation,
2716 AS_HELP_STRING([--without-export-validation],
2717 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2718 ,with_export_validation=auto)
2720 AC_ARG_WITH(bffvalidator,
2721 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2722 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2723 Requires installed Microsoft Office Binary File Format Validator.
2724 Note: export-validation (--with-export-validation) is required to be turned on.
2725 See https://web.archive.org/web/20200804155745/https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2726 ,with_bffvalidator=no)
2728 libo_FUZZ_ARG_WITH(junit,
2729 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2730 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2731 --without-junit disables those tests. Not relevant in the --without-java case.]),
2734 AC_ARG_WITH(hamcrest,
2735 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2736 [Specifies the hamcrest jar file to use for JUnit-based tests.
2737 --without-junit disables those tests. Not relevant in the --without-java case.]),
2740 AC_ARG_WITH(perl-home,
2741 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2742 [If you have installed Perl 5 Distribution, on your system, please
2743 supply the path here. Note that this is not the location of the Perl
2744 binary but the location of the entire distribution.]),
2747 libo_FUZZ_ARG_WITH(doxygen,
2749 [--with-doxygen=<absolute path to doxygen executable>],
2750 [Only relevant when --enable-odk is set. Specifies the doxygen
2751 executable to use when generating ODK C/C++ documentation.
2752 --without-doxygen disables generation of ODK C/C++ documentation.]),
2755 AC_ARG_WITH(visual-studio,
2756 AS_HELP_STRING([--with-visual-studio=<2019/2022/2022preview>],
2757 [Specify which Visual Studio version to use in case several are
2758 installed. Currently 2019 (default) and 2022 are supported.]),
2761 AC_ARG_WITH(windows-sdk,
2762 AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10.0>],
2763 [Specify which Windows SDK, or "Windows Kit", version to use
2764 in case the one that came with the selected Visual Studio
2765 is not what you want for some reason. Note that not all compiler/SDK
2766 combinations are supported. The intent is that this option should not
2771 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2772 [Use this option to build LibreOffice with additional UI language support.
2773 English (US) is always included by default.
2774 Separate multiple languages with space.
2775 For all languages, use --with-lang=ALL.]),
2778 AC_ARG_WITH(locales,
2779 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2780 [Use this option to limit the locale information built in.
2781 Separate multiple locales with space.
2782 Very experimental and might well break stuff.
2783 Just a desperate measure to shrink code and data size.
2784 By default all the locales available is included.
2785 Just works with --disable-dynloading. Defaults to "ALL".
2786 This option is completely unrelated to --with-lang.])
2788 Affects also our character encoding conversion
2789 tables for encodings mainly targeted for a
2790 particular locale, like EUC-CN and EUC-TW for
2791 zh, ISO-2022-JP for ja.
2793 Affects also our add-on break iterator data for
2796 For the default, all locales, don't use this switch at all.
2797 Specifying just the language part of a locale means all matching
2798 locales will be included.
2802 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2803 #Â and also by Mariadb/Mysql and libcurl since LibO 24.8
2804 libo_FUZZ_ARG_WITH(krb5,
2805 AS_HELP_STRING([--with-krb5],
2806 [Enable MIT Kerberos 5 support in modules that support it.
2807 By default automatically enabled on platforms
2808 where a good system Kerberos 5 is available.]),
2811 libo_FUZZ_ARG_WITH(gssapi,
2812 AS_HELP_STRING([--with-gssapi],
2813 [Enable GSSAPI support in modules that support it.
2814 By default automatically enabled on platforms
2815 where a good system GSSAPI is available.]),
2818 libo_FUZZ_ARG_WITH(lxml,
2819 AS_HELP_STRING([--without-lxml],
2820 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2821 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2822 report widget classes and ids.]),
2825 libo_FUZZ_ARG_WITH(latest-c++,
2826 AS_HELP_STRING([--with-latest-c++],
2827 [Try to enable the latest features of the C++ compiler, even if they are not yet part of a
2828 published standard. This option is ignored when CXXFLAGS_CXX11 is set explicitly.]),,
2829 [with_latest_c__=no])
2831 AC_ARG_WITH(gtk3-build,
2832 AS_HELP_STRING([--with-gtk3-build=<absolute path to GTK3 build>],
2833 [(Windows-only) In order to build GtkTiledViewer on Windows, pass the path
2834 to a GTK3 build, like '--with-gtk3-build=C:/gtk-build/gtk/x64/release'.]))
2836 AC_ARG_WITH(keep-awake,
2837 AS_HELP_STRING([--with-keep-awake],
2838 [command to prefix make with in order to prevent the system from going to sleep/suspend
2840 If no command is specified, defaults to using Awake (from Microsoft PowerToys) on Windows
2841 and caffeinate on macOS]))
2843 dnl ===================================================================
2845 dnl ===================================================================
2847 AC_ARG_WITH(branding,
2848 AS_HELP_STRING([--with-branding=/path/to/images],
2849 [Use given path to retrieve branding images set.])
2851 Search for intro.png about.svg and logo.svg.
2852 If any is missing, default ones will be used instead.
2854 Search also progress.conf for progress
2855 settings on intro screen :
2857 PROGRESSBARCOLOR="255,255,255" Set color of
2858 progress bar. Comma separated RGB decimal values.
2859 PROGRESSSIZE="407,6" Set size of progress bar.
2860 Comma separated decimal values (width, height).
2861 PROGRESSPOSITION="61,317" Set position of progress
2862 bar from left,top. Comma separated decimal values.
2863 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2864 bar frame. Comma separated RGB decimal values.
2865 PROGRESSTEXTCOLOR="0,0,0" Set color of progress
2866 bar text. Comma separated RGB decimal values.
2867 PROGRESSTEXTBASELINE="287" Set vertical position of
2868 progress bar text from top. Decimal value.
2870 Default values will be used if not found.
2875 AC_ARG_WITH(extra-buildid,
2876 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2877 [Show addition build identification in about dialog.]),
2882 AS_HELP_STRING([--with-vendor="John the Builder"],
2883 [Set vendor of the build.]),
2886 AC_ARG_WITH(privacy-policy-url,
2887 AS_HELP_STRING([--with-privacy-policy-url="https://yourdomain/privacy-policy"],
2888 [The URL to your privacy policy (needed when
2889 enabling online-update or crashreporting via breakpad)]),
2890 [if test "x$with_privacy_policy_url" = "xyes"; then
2891 AC_MSG_FAILURE([you need to specify an argument when using --with-privacy-policy-url])
2892 elif test "x$with_privacy_policy_url" = "xno"; then
2893 with_privacy_policy_url="undefined"
2895 ,[with_privacy_policy_url="undefined"])
2897 AC_ARG_WITH(android-package-name,
2898 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2899 [Set Android package name of the build.]),
2902 AC_ARG_WITH(compat-oowrappers,
2903 AS_HELP_STRING([--with-compat-oowrappers],
2904 [Install oo* wrappers in parallel with
2905 lo* ones to keep backward compatibility.
2906 Has effect only with make distro-pack-install]),
2909 AC_ARG_WITH(os-version,
2910 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2911 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2914 AC_ARG_WITH(parallelism,
2915 AS_HELP_STRING([--with-parallelism],
2916 [Number of jobs to run simultaneously during build. Parallel builds can
2917 save a lot of time on multi-cpu machines. Defaults to the number of
2918 CPUs on the machine, unless you configure --enable-icecream - then to
2922 AC_ARG_WITH(all-tarballs,
2923 AS_HELP_STRING([--with-all-tarballs],
2924 [Download all external tarballs unconditionally]))
2926 AC_ARG_WITH(gdrive-client-id,
2927 AS_HELP_STRING([--with-gdrive-client-id],
2928 [Provides the client id of the application for OAuth2 authentication
2929 on Google Drive. If either this or --with-gdrive-client-secret is
2930 empty, the feature will be disabled]),
2933 AC_ARG_WITH(gdrive-client-secret,
2934 AS_HELP_STRING([--with-gdrive-client-secret],
2935 [Provides the client secret of the application for OAuth2
2936 authentication on Google Drive. If either this or
2937 --with-gdrive-client-id is empty, the feature will be disabled]),
2940 AC_ARG_WITH(alfresco-cloud-client-id,
2941 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2942 [Provides the client id of the application for OAuth2 authentication
2943 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2944 empty, the feature will be disabled]),
2947 AC_ARG_WITH(alfresco-cloud-client-secret,
2948 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2949 [Provides the client secret of the application for OAuth2
2950 authentication on Alfresco Cloud. If either this or
2951 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2954 AC_ARG_WITH(onedrive-client-id,
2955 AS_HELP_STRING([--with-onedrive-client-id],
2956 [Provides the client id of the application for OAuth2 authentication
2957 on OneDrive. If either this or --with-onedrive-client-secret is
2958 empty, the feature will be disabled]),
2961 AC_ARG_WITH(onedrive-client-secret,
2962 AS_HELP_STRING([--with-onedrive-client-secret],
2963 [Provides the client secret of the application for OAuth2
2964 authentication on OneDrive. If either this or
2965 --with-onedrive-client-id is empty, the feature will be disabled]),
2968 dnl Check for coredumpctl support to present information about crashing test processes:
2969 AC_ARG_WITH(coredumpctl,
2970 AS_HELP_STRING([--with-coredumpctl],
2971 [Use coredumpctl (together with systemd-run) to retrieve core dumps of crashing test
2974 AC_ARG_WITH(buildconfig-recorded,
2975 AS_HELP_STRING([--with-buildconfig-recorded],
2976 [Put build config into version info reported by LOK. Incompatible with reproducible builds.]),
2979 AC_MSG_CHECKING([whether to record build config])
2980 if test -z "$with_buildconfig_recorded"; then
2981 with_buildconfig_recorded=no
2983 if test "$with_buildconfig_recorded" = no; then
2986 AC_MSG_RESULT([yes])
2987 # replace backslashes, to get a valid c++ string
2988 config_args=$(echo $ac_configure_args | tr '\\' '/')
2989 AC_DEFINE_UNQUOTED([BUILDCONFIG],[["$config_args"]],[Options passed to configure script])
2990 AC_DEFINE([BUILDCONFIG_RECORDED],[1],[Options passed to configure script])
2993 dnl ===================================================================
2994 dnl Do we want to use pre-build binary tarball for recompile
2995 dnl ===================================================================
2997 if test "$enable_library_bin_tar" = "yes" ; then
2998 USE_LIBRARY_BIN_TAR=TRUE
3000 USE_LIBRARY_BIN_TAR=
3002 AC_SUBST(USE_LIBRARY_BIN_TAR)
3004 dnl ===================================================================
3005 dnl Test whether build target is Release Build
3006 dnl ===================================================================
3007 AC_MSG_CHECKING([whether build target is Release Build])
3008 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
3010 ENABLE_RELEASE_BUILD=
3011 dnl Pu the value on one line as make (at least on macOS) seems to ignore
3012 dnl the newlines and then complains about spaces.
3013 GET_TASK_ALLOW_ENTITLEMENT='<!-- We want to be able to debug a hardened process when not building for release --><key>com.apple.security.get-task-allow</key><true/>'
3015 AC_MSG_RESULT([yes])
3016 ENABLE_RELEASE_BUILD=TRUE
3017 GET_TASK_ALLOW_ENTITLEMENT=
3019 AC_SUBST(ENABLE_RELEASE_BUILD)
3020 AC_SUBST(GET_TASK_ALLOW_ENTITLEMENT)
3022 dnl ===================================================================
3023 dnl Test whether build should auto use hardening compiler flags
3024 dnl ===================================================================
3025 AC_MSG_CHECKING([whether build should auto use hardening compiler flags])
3026 if test "$enable_hardening_flags" = "" -o "$enable_hardening_flags" = "no"; then
3028 ENABLE_HARDENING_FLAGS=
3030 AC_MSG_RESULT([yes])
3031 ENABLE_HARDENING_FLAGS=TRUE
3033 AC_SUBST(ENABLE_HARDENING_FLAGS)
3035 AC_MSG_CHECKING([whether to build a Community flavor])
3036 if test -z "$enable_community_flavor" -o "$enable_community_flavor" = "yes"; then
3037 AC_DEFINE(HAVE_FEATURE_COMMUNITY_FLAVOR)
3038 AC_MSG_RESULT([yes])
3043 dnl ===================================================================
3044 dnl Test whether to sign Windows Build
3045 dnl ===================================================================
3046 AC_MSG_CHECKING([whether to sign windows build])
3047 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
3048 AC_MSG_RESULT([yes])
3049 WINDOWS_BUILD_SIGNING="TRUE"
3052 WINDOWS_BUILD_SIGNING="FALSE"
3054 AC_SUBST(WINDOWS_BUILD_SIGNING)
3056 dnl ===================================================================
3057 dnl MacOSX build and runtime environment options
3058 dnl ===================================================================
3060 AC_ARG_WITH(macosx-version-min-required,
3061 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
3062 [set the minimum OS version needed to run the built LibreOffice])
3064 e. g.: --with-macosx-version-min-required=10.15
3068 dnl ===================================================================
3069 dnl Check for incompatible options set by fuzzing, and reset those
3070 dnl automatically to working combinations
3071 dnl ===================================================================
3073 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
3074 "$enable_dbus" != "$enable_avahi"; then
3075 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
3076 enable_avahi=$enable_dbus
3081 if ! echo "$LO_PATH" | $EGREP -q "(^|${P_SEP})$1($|${P_SEP})"; then
3082 LO_PATH="${LO_PATH:+$LO_PATH$P_SEP}$1"
3086 add_lopath_before ()
3091 for dir in $LO_PATH ; do
3092 if test "$dir" != "$1" ; then
3093 path_cleanup=${path_cleanup:+$path_cleanup$P_SEP}$dir
3096 LO_PATH="$1${path_cleanup:+$P_SEP$path_cleanup}"
3099 dnl ===================================================================
3100 dnl check for required programs (grep, awk, sed, bash)
3101 dnl ===================================================================
3106 if test -n "$1"; then
3107 if test "$build_os" = "cygwin"; then
3108 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
3110 new_path=`cygpath -sm "$formatted_path"`
3113 new_path=`cygpath -u "$formatted_path"`
3118 if test "$2" = "after"; then
3119 add_lopath_after "$new_path"
3121 add_lopath_before "$new_path"
3127 AC_PATH_PROG( AWK, $AWK)
3128 if test -z "$AWK"; then
3129 AC_MSG_ERROR([install awk to run this script])
3132 AC_PATH_PROG(BASH, bash)
3133 if test -z "$BASH"; then
3134 AC_MSG_ERROR([bash not found in \$PATH])
3138 # prefer parallel compression tools, if available
3139 AC_PATH_PROG(COMPRESSIONTOOL, pigz)
3140 if test -z "$COMPRESSIONTOOL"; then
3141 AC_PATH_PROG(COMPRESSIONTOOL, gzip)
3142 if test -z "$COMPRESSIONTOOL"; then
3143 AC_MSG_ERROR([gzip not found in \$PATH])
3146 AC_SUBST(COMPRESSIONTOOL)
3148 AC_MSG_CHECKING([for GNU or BSD tar])
3149 for a in $GNUTAR gtar gnutar tar bsdtar /usr/sfw/bin/gtar; do
3150 $a --version 2> /dev/null | grep -E "GNU|bsdtar" 2>&1 > /dev/null
3151 if test $? -eq 0; then
3156 AC_MSG_RESULT($GNUTAR)
3157 if test -z "$GNUTAR"; then
3158 AC_MSG_ERROR([not found. install GNU or BSD tar.])
3162 AC_MSG_CHECKING([for tar's option to strip components])
3163 $GNUTAR --help 2> /dev/null | grep -E "bsdtar|strip-components" 2>&1 >/dev/null
3164 if test $? -eq 0; then
3165 STRIP_COMPONENTS="--strip-components"
3167 $GNUTAR --help 2> /dev/null | grep -E "strip-path" 2>&1 >/dev/null
3168 if test $? -eq 0; then
3169 STRIP_COMPONENTS="--strip-path"
3171 STRIP_COMPONENTS="unsupported"
3174 AC_MSG_RESULT($STRIP_COMPONENTS)
3175 if test x$STRIP_COMPONENTS = xunsupported; then
3176 AC_MSG_ERROR([you need a tar that is able to strip components.])
3178 AC_SUBST(STRIP_COMPONENTS)
3180 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
3181 dnl desktop OSes from "mobile" ones.
3183 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
3184 dnl In other words, that when building for an OS that is not a
3185 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
3187 dnl Note the direction of the implication; there is no assumption that
3188 dnl cross-compiling would imply a non-desktop OS.
3190 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
3191 BUILD_TYPE="$BUILD_TYPE DESKTOP"
3192 AC_DEFINE(HAVE_FEATURE_DESKTOP)
3193 if test "$_os" != Emscripten; then
3194 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
3198 # explicitly doesn't include enable_gtk3=no and enable_qt5=yes, so it should
3199 # also work with the default gtk3 plugin.
3200 if test "$enable_wasm_strip" = "yes"; then
3205 test "$_os" = Emscripten && enable_curl=no
3206 enable_database_connectivity=no
3209 test "${enable_dynamic_loading+set}" = set -o "$_os" != Emscripten || enable_dynamic_loading=no
3210 enable_extension_integration=no
3211 enable_extensions=no
3212 enable_extension_update=no
3216 enable_lotuswordpro=no
3220 enable_online_update=no
3224 enable_report_builder=no
3226 enable_sdremote_bluetooth=no
3236 test_libpagemaker=no
3246 test "${with_fonts+set}" = set || with_fonts=yes
3247 test "${with_locales+set}" = set || with_locales=en
3249 AC_DEFINE(ENABLE_WASM_STRIP_ACCESSIBILITY)
3250 AC_DEFINE(ENABLE_WASM_STRIP_WRITER)
3251 AC_DEFINE(ENABLE_WASM_STRIP_CALC)
3252 AC_DEFINE(ENABLE_WASM_STRIP_CANVAS)
3253 # AC_DEFINE(ENABLE_WASM_STRIP_CHART)
3254 AC_DEFINE(ENABLE_WASM_STRIP_DBACCESS)
3255 AC_DEFINE(ENABLE_WASM_STRIP_EPUB)
3256 AC_DEFINE(ENABLE_WASM_STRIP_EXTRA)
3257 AC_DEFINE(ENABLE_WASM_STRIP_GUESSLANG)
3258 # AC_DEFINE(ENABLE_WASM_STRIP_HUNSPELL)
3259 AC_DEFINE(ENABLE_WASM_STRIP_LANGUAGETOOL)
3260 AC_DEFINE(ENABLE_WASM_STRIP_PINGUSER)
3261 AC_DEFINE(ENABLE_WASM_STRIP_PREMULTIPLY)
3262 AC_DEFINE(ENABLE_WASM_STRIP_RECENT)
3263 AC_DEFINE(ENABLE_WASM_STRIP_RECOVERYUI)
3264 AC_DEFINE(ENABLE_WASM_STRIP_SPLASH)
3265 AC_DEFINE(ENABLE_WASM_STRIP_SWEXPORTS)
3266 AC_DEFINE(ENABLE_WASM_STRIP_SCEXPORTS)
3269 # Whether to build "avmedia" functionality or not.
3271 if test "$enable_avmedia" = yes; then
3272 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
3273 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
3275 test_gstreamer_1_0=no
3278 # Decide whether to build database connectivity stuff (including Base) or not.
3279 if test "$enable_database_connectivity" != no; then
3280 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
3281 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
3283 if test "$_os" = iOS; then
3284 AC_MSG_ERROR([Presumly can't disable DB connectivity on iOS.])
3286 disable_database_connectivity_dependencies
3289 if test -z "$enable_extensions"; then
3290 # For iOS and Android Viewer, disable extensions unless specifically overridden with --enable-extensions.
3291 if test $_os != iOS && test $_os != Android -o "$ENABLE_ANDROID_LOK" = TRUE ; then
3292 enable_extensions=yes
3296 DISABLE_SCRIPTING=''
3297 if test "$enable_scripting" = yes; then
3298 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
3299 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
3301 DISABLE_SCRIPTING='TRUE'
3302 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
3305 if test $_os = iOS -o $_os = Android -o $_os = Emscripten; then
3306 # Disable dynamic_loading always for iOS and Android
3307 enable_dynamic_loading=no
3308 elif test -z "$enable_dynamic_loading"; then
3309 # Otherwise enable it unless specifically disabled
3310 enable_dynamic_loading=yes
3313 DISABLE_DYNLOADING=''
3314 if test "$enable_dynamic_loading" = yes; then
3315 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
3317 DISABLE_DYNLOADING='TRUE'
3318 if test $_os != iOS -a $_os != Android; then
3319 enable_database_connectivity=no
3327 AC_SUBST(DISABLE_DYNLOADING)
3329 ENABLE_CUSTOMTARGET_COMPONENTS=
3330 if test "$enable_customtarget_components" = yes -a "$DISABLE_DYNLOADING" = TRUE; then
3331 ENABLE_CUSTOMTARGET_COMPONENTS=TRUE
3332 if test -n "$with_locales" -a "$with_locales" != en -a "$with_locales" != ALL; then
3333 AC_MSG_ERROR([Currently just --with-locales=all or en is supported with --enable-customtarget-components])
3336 AC_SUBST(ENABLE_CUSTOMTARGET_COMPONENTS)
3338 if test "$enable_extensions" = yes; then
3339 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
3340 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
3342 enable_extension_integration=no
3343 enable_extension_update=no
3346 # remember SYSBASE value
3349 dnl ===================================================================
3350 dnl Sort out various gallery compilation options
3351 dnl ===================================================================
3352 WITH_GALLERY_BUILD=TRUE
3353 AC_MSG_CHECKING([how to build and package galleries])
3354 if test -n "${with_galleries}"; then
3355 if test "$with_galleries" = "build"; then
3356 if test "$enable_database_connectivity" = no; then
3357 AC_MSG_ERROR([DB connectivity is needed for gengal / svx])
3359 AC_MSG_RESULT([build from source images internally])
3360 elif test "$with_galleries" = "no"; then
3362 AC_MSG_RESULT([disable non-internal gallery build])
3364 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
3367 if test $_os != iOS -a $_os != Android; then
3368 AC_MSG_RESULT([internal src images for desktop])
3371 AC_MSG_RESULT([disable src image build])
3374 AC_SUBST(WITH_GALLERY_BUILD)
3376 dnl ===================================================================
3377 dnl Sort out various templates compilation options
3378 dnl ===================================================================
3380 AC_MSG_CHECKING([build with or without template files])
3381 if test -n "${with_templates}"; then
3382 if test "$with_templates" = "yes"; then
3383 AC_MSG_RESULT([enable all templates])
3384 elif test "$with_templates" = "no"; then
3386 AC_MSG_RESULT([disable non-internal templates])
3388 AC_MSG_ERROR([unknown value --with-templates=$with_templates])
3391 if test $_os != iOS -a $_os != Android -a $_os != Emscripten; then
3392 AC_MSG_RESULT([enable all templates])
3395 AC_MSG_RESULT([disable non-internal templates])
3398 AC_SUBST(WITH_TEMPLATES)
3400 dnl ===================================================================
3401 dnl Checks if ccache is available
3402 dnl ===================================================================
3404 if test "$enable_ccache" = "no"; then
3406 elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
3407 case "%$CC%$CXX%" in
3408 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
3409 # assume that's good then
3410 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
3411 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
3412 CCACHE_DEPEND_MODE=1
3415 # try to use our own ccache if it is available and CCACHE was not already defined
3416 if test -z "$CCACHE"; then
3417 if test "$_os" = "WINNT"; then
3418 ccache_ext=.exe # e.g. openssl build needs ccache.exe, not just ccache
3420 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/ccache$ccache_ext" ; then
3421 CCACHE="$LODE_HOME/opt/bin/ccache$ccache_ext"
3422 elif test -x "/opt/lo/bin/ccache$ccache_ext"; then
3423 CCACHE="/opt/lo/bin/ccache$ccache_ext"
3426 AC_PATH_PROG([CCACHE],[ccache],[not found])
3427 if test "$CCACHE" != "not found" -a "$_os" = "WINNT"; then
3428 CCACHE=`win_short_path_for_make "$CCACHE"`
3429 # check that it has MSVC support (it should recognize it in CCACHE_COMPILERTYPE)
3431 AC_MSG_CHECKING([whether $CCACHE has MSVC support])
3432 CCACHE_COMPILERTYPE=cl CCACHE_LOGFILE=conftest.txt $CCACHE echo >/dev/null 2>/dev/null
3433 if grep -q 'Config: (environment) compiler_type = cl' conftest.txt; then
3441 if test "$CCACHE" = "not found" -a "$_os" = "WINNT"; then
3442 # on windows/VC perhaps sccache is around?
3443 case "%$CC%$CXX%" in
3444 # If $CC and/or $CXX already contain "sccache" (possibly suffixed with some version number etc),
3445 # assume that's good then
3446 *%sccache[[-_' ']]*|*/sccache[[-_' ']]*)
3447 AC_MSG_NOTICE([sccache seems to be included in a pre-defined CC and/or CXX])
3448 CCACHE_DEPEND_MODE=1
3452 # for sharing code below, reuse CCACHE env var
3453 AC_PATH_PROG([CCACHE],[sccache],[not found])
3454 if test "$CCACHE" != "not found"; then
3455 CCACHE=`win_short_path_for_make "$CCACHE"`
3457 CCACHE_DEPEND_MODE=1
3462 if test "$CCACHE" = "not found"; then
3465 if test -n "$CCACHE" -a -z "$SCCACHE"; then
3466 CCACHE_DEPEND_MODE=1
3467 # Need to check for ccache version: otherwise prevents
3468 # caching of the results (like "-x objective-c++" for Mac)
3469 if test $_os = Darwin -o $_os = iOS; then
3470 # Check ccache version
3471 AC_MSG_CHECKING([whether version of ccache is suitable])
3472 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
3473 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3474 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
3475 AC_MSG_RESULT([yes, $CCACHE_VERSION])
3477 AC_MSG_RESULT([no, $CCACHE_VERSION])
3483 if test "$enable_ccache" = yes && test -z "$CCACHE"; then
3484 AC_MSG_ERROR([No suitable ccache found])
3491 if test "$enable_ccache" = "nodepend"; then
3492 CCACHE_DEPEND_MODE=""
3494 AC_SUBST(CCACHE_DEPEND_MODE)
3496 # sccache defaults are good enough
3497 if test "$CCACHE" != "" -a -z "$SCCACHE"; then
3498 # e.g. (/home/rene/.config/ccache/ccache.conf) max_size = 20.0G
3499 # or (...) max_size = 20.0 G
3500 # -p works with both 4.2 and 4.4
3501 ccache_size_msg=$([$CCACHE -p | $AWK /max_size/'{ print $4 $5 }' | sed -e 's/\.[0-9]*//'])
3502 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
3503 if test "$ccache_size" = ""; then
3504 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
3505 if test "$ccache_size" = ""; then
3508 # we could not determine the size or it was less than 1GB -> disable auto-ccache
3509 if test $ccache_size -lt 1024; then
3511 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
3512 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
3514 # warn that ccache may be too small for debug build
3515 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
3516 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
3519 if test $ccache_size -lt 5; then
3520 #warn that ccache may be too small for debug build
3521 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
3522 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
3528 if test "$enable_z7_debug" != no; then
3529 if test "$enable_z7_debug" = yes -o -n "$CCACHE"; then
3530 ENABLE_Z7_DEBUG=TRUE
3533 AC_MSG_WARN([ccache will not work with --disable-z7-debug])
3534 add_warning "ccache will not work with --disable-z7-debug"
3536 AC_SUBST(ENABLE_Z7_DEBUG)
3538 dnl ===================================================================
3539 dnl Checks for C compiler,
3540 dnl The check for the C++ compiler is later on.
3541 dnl ===================================================================
3542 if test "$_os" != "WINNT"; then
3544 AC_MSG_CHECKING([gcc home])
3545 if test -z "$with_gcc_home"; then
3546 if test "$enable_icecream" = "yes"; then
3547 if test -d "/usr/lib/icecc/bin"; then
3548 GCC_HOME="/usr/lib/icecc/"
3549 elif test -d "/usr/libexec/icecc/bin"; then
3550 GCC_HOME="/usr/libexec/icecc/"
3551 elif test -d "/opt/icecream/bin"; then
3552 GCC_HOME="/opt/icecream/"
3554 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
3558 GCC_HOME=`command -v gcc | $SED -e s,/bin/gcc,,`
3559 GCC_HOME_SET="false"
3562 GCC_HOME="$with_gcc_home"
3564 AC_MSG_RESULT($GCC_HOME)
3567 if test "$GCC_HOME_SET" = "true"; then
3568 if test -z "$CC"; then
3569 CC="$GCC_HOME/bin/gcc"
3572 if test -z "$CXX"; then
3573 CXX="$GCC_HOME/bin/g++"
3579 COMPATH=`dirname "$CC"`
3580 if test "$COMPATH" = "."; then
3581 AC_PATH_PROGS(COMPATH, $CC)
3582 dnl double square bracket to get single because of M4 quote...
3583 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
3585 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
3587 dnl ===================================================================
3589 dnl ===================================================================
3590 AC_MSG_CHECKING([whether to build with .NET support])
3591 if test "$enable_dotnet" != "no"; then
3592 if test "$DISABLE_SCRIPTING" = TRUE; then
3593 AC_MSG_RESULT([no, overridden by --disable-scripting])
3597 AC_MSG_RESULT([yes])
3598 ENABLE_DOTNET="TRUE"
3605 if test "$ENABLE_DOTNET" = TRUE; then
3606 AC_PATH_PROG(DOTNET, dotnet)
3607 if test "$DOTNET" != ""; then
3608 AC_MSG_CHECKING([whether .NET SDK is installed])
3609 DOTNET_SDK_VERSION=`dotnet --list-sdks`
3610 if test "$DOTNET_SDK_VERSION" != ""; then
3611 AC_MSG_RESULT([yes])
3612 AC_DEFINE(HAVE_FEATURE_DOTNET)
3622 AC_SUBST(ENABLE_DOTNET)
3624 dnl set ENABLE_DOTNET="TRUE" for build-time and run-time .NET support
3625 dnl set ENABLE_DOTNET="" for no .NET support at all
3627 dnl ===================================================================
3629 dnl ===================================================================
3630 AC_MSG_CHECKING([whether to build with Java support])
3631 javacompiler="javac"
3633 if test "$with_java" != "no"; then
3634 if test "$DISABLE_SCRIPTING" = TRUE; then
3635 AC_MSG_RESULT([no, overridden by --disable-scripting])
3639 AC_MSG_RESULT([yes])
3641 AC_DEFINE(HAVE_FEATURE_JAVA)
3648 AC_SUBST(ENABLE_JAVA)
3650 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
3652 dnl ENABLE_JAVA="" indicate no Java support at all
3654 dnl ===================================================================
3655 dnl Check macOS SDK and compiler
3656 dnl ===================================================================
3658 if test $_os = Darwin; then
3660 # The SDK in the currently selected Xcode should be found.
3662 AC_MSG_CHECKING([what macOS SDK to use])
3663 # XCode only ships with a single SDK for a while now, and using older SDKs alongside is not
3664 # really supported anymore, instead you'd use different copies of Xcode, each with their own
3665 # SDK, and thus xcrun will pick the SDK that matches the currently selected Xcode version
3666 # also restricting the SDK version to "known good" versions doesn't seem necessary anymore, the
3667 # problems that existed in the PPC days with target versions not being respected or random
3668 # failures seems to be a thing of the past or rather: limiting either the Xcode version or the
3669 # SDK version is enough, no need to do both...
3670 MACOSX_SDK_PATH=`xcrun --sdk macosx --show-sdk-path 2> /dev/null`
3671 if test ! -d "$MACOSX_SDK_PATH"; then
3672 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
3674 macosx_sdk=`xcodebuild -version -sdk "$MACOSX_SDK_PATH" SDKVersion`
3675 MACOSX_SDK_BUILD_VERSION=$(xcodebuild -version -sdk "$MACOSX_SDK_PATH" ProductBuildVersion)
3676 # format changed between 10.9 and 10.10 - up to 10.9 it was just four digits (1090), starting
3677 # with macOS 10.10 it was switched to account for x.y.z with six digits, 10.10 is 101000,
3679 # we don't target the lower versions anymore, so it doesn't matter that we don't generate the
3680 # correct version in case such an old SDK is specified, it will be rejected later anyway
3681 MACOSX_SDK_VERSION=$(echo $macosx_sdk | $AWK -F. '{ print $1*10000+$2*100+$3 }')
3682 if test $MACOSX_SDK_VERSION -lt 101500; then
3683 AC_MSG_ERROR([macOS SDK $macosx_sdk is not supported, lowest supported version is 10.15])
3685 if test "$host_cpu" = arm64 -a $MACOSX_SDK_VERSION -lt 110000; then
3686 AC_MSG_ERROR([macOS SDK $macosx_sdk is not supported for Apple Silicon (need at least 11.0)])
3688 AC_MSG_RESULT([macOS SDK $macosx_sdk at $MACOSX_SDK_PATH])
3690 AC_MSG_CHECKING([what minimum version of macOS to require])
3691 if test "$with_macosx_version_min_required" = "" ; then
3692 if test "$host_cpu" = x86_64; then
3693 with_macosx_version_min_required="10.15";
3695 with_macosx_version_min_required="11.0";
3698 # see same notes about MACOSX_SDK_VERSION above
3699 MAC_OS_X_VERSION_MIN_REQUIRED=$(echo $with_macosx_version_min_required | $AWK -F. '{ print $1*10000+$2*100+$3 }')
3700 if test $MAC_OS_X_VERSION_MIN_REQUIRED -lt 101500; then
3701 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, minimum supported version is 10.15])
3703 AC_MSG_RESULT([$with_macosx_version_min_required])
3705 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macos-with-sdk])
3706 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MACOSX_SDK_VERSION; then
3707 AC_MSG_ERROR([the version minimum required ($with_macosx_version_min_required) cannot be greater than the sdk level ($macosx_sdk)])
3709 AC_MSG_RESULT([yes])
3712 # export this so that "xcrun" invocations later return matching values
3713 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
3714 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
3715 export DEVELOPER_DIR
3716 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
3717 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
3719 AC_MSG_CHECKING([whether Xcode is new enough])
3720 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
3721 my_xcode_ver2=${my_xcode_ver1#Xcode }
3722 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
3723 if test "$my_xcode_ver3" -ge 1205; then
3724 AC_MSG_RESULT([yes ($my_xcode_ver2)])
3725 if test $MAC_OS_X_VERSION_MIN_REQUIRED -lt 120000; then
3726 if test "$my_xcode_ver3" -eq 1500; then
3727 dnl the bug was already fixed on 15.1 and 15.2 still has the same OS requirements as 15.0
3728 dnl in other words all affected users could update to a working Xcode version
3729 AC_MSG_WARN([Use a current version of XCode or bump the minimum deployment target])
3730 AC_MSG_WARN([[see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking]])
3731 AC_MSG_ERROR([Xcode 15.0 has a bug in the new linker that causes runtime crashes on macOS 11 - aborting])
3735 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 12.5])
3738 my_xcode_ver1=$(xcrun xcodebuild -version | tail -n 1)
3739 MACOSX_XCODE_BUILD_VERSION=${my_xcode_ver1#Build version }
3741 LIBTOOL=/usr/bin/libtool
3742 INSTALL_NAME_TOOL=install_name_tool
3743 if test -z "$save_CC"; then
3744 stdlib=-stdlib=libc++
3746 AC_MSG_CHECKING([what C compiler to use])
3747 CC="`xcrun -find clang`"
3748 CC_BASE=`first_arg_basename "$CC"`
3749 if test "$host_cpu" = x86_64; then
3750 CC+=" -target x86_64-apple-macos"
3752 CC+=" -target arm64-apple-macos"
3754 CC+=" -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
3755 AC_MSG_RESULT([$CC])
3757 AC_MSG_CHECKING([what C++ compiler to use])
3758 CXX="`xcrun -find clang++`"
3759 CXX_BASE=`first_arg_basename "$CXX"`
3760 if test "$host_cpu" = x86_64; then
3761 CXX+=" -target x86_64-apple-macos"
3763 CXX+=" -target arm64-apple-macos"
3765 CXX+=" $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
3766 AC_MSG_RESULT([$CXX])
3768 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3771 STRIP=`xcrun -find strip`
3772 LIBTOOL=`xcrun -find libtool`
3773 RANLIB=`xcrun -find ranlib`
3776 AC_MSG_CHECKING([whether to do code signing])
3778 if test -z "$enable_macosx_code_signing" -o "$enable_macosx_code_signing" == "no" ; then
3781 if test "$enable_macosx_code_signing" = yes; then
3782 # By default use the first suitable certificate (?).
3784 # https://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
3785 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
3786 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
3787 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
3788 # "Developer ID Application" one.
3789 identity="Developer ID Application:"
3791 identity=$enable_macosx_code_signing
3793 identity=`security find-identity -p codesigning -v 2>/dev/null | $AWK "/$identity/{print \\$2; exit}"`
3794 if test -n "$identity"; then
3795 MACOSX_CODESIGNING_IDENTITY=$identity
3796 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3797 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
3799 AC_MSG_ERROR([cannot determine identity to use])
3803 AC_MSG_CHECKING([whether to create a Mac App Store package])
3805 if test -z "$enable_macosx_package_signing" || test "$enable_macosx_package_signing" == no; then
3807 elif test -z "$MACOSX_CODESIGNING_IDENTITY"; then
3808 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
3810 if test "$enable_macosx_package_signing" = yes; then
3811 # By default use the first suitable certificate.
3812 # It should be a "3rd Party Mac Developer Installer" one
3813 identity="3rd Party Mac Developer Installer:"
3815 identity=$enable_macosx_package_signing
3817 identity=`security find-identity -v 2>/dev/null | $AWK "/$identity/ {print \\$2; exit}"`
3818 if test -n "$identity"; then
3819 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
3820 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3821 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3823 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
3827 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
3828 AC_MSG_ERROR([You should not use the same identity for code and package signing])
3831 AC_MSG_CHECKING([whether to sandbox the application])
3833 if test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3834 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
3835 elif test "$enable_macosx_sandbox" = yes; then
3836 ENABLE_MACOSX_SANDBOX=TRUE
3837 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3838 AC_MSG_RESULT([yes])
3843 AC_MSG_CHECKING([what macOS app bundle identifier to use])
3844 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3845 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3847 if test -n "$with_macosx_provisioning_profile" ; then
3848 if test ! -f "$with_macosx_provisioning_profile"; then
3849 AC_MSG_ERROR([provisioning profile not found at $with_macosx_provisioning_profile])
3851 MACOSX_PROVISIONING_PROFILE=$with_macosx_provisioning_profile
3852 MACOSX_PROVISIONING_INFO=$([security cms -D -i "$MACOSX_PROVISIONING_PROFILE" | \
3853 xmllint --xpath "//key[.='com.apple.application-identifier' or .='com.apple.developer.team-identifier'] \
3854 | //key[.='com.apple.application-identifier' or .='com.apple.developer.team-identifier']/following-sibling::string[1]" - | \
3855 sed -e 's#><#>\n\t<#g' -e 's#^#\t#'])
3859 AC_SUBST(MACOSX_SDK_PATH)
3860 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3861 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3862 AC_SUBST(INSTALL_NAME_TOOL)
3863 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
3864 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3865 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3866 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3867 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3868 AC_SUBST(MACOSX_PROVISIONING_INFO)
3869 AC_SUBST(MACOSX_PROVISIONING_PROFILE)
3870 AC_SUBST(MACOSX_SDK_BUILD_VERSION)
3871 AC_SUBST(MACOSX_XCODE_BUILD_VERSION)
3873 dnl ===================================================================
3874 dnl Check iOS SDK and compiler
3875 dnl ===================================================================
3877 if test $_os = iOS; then
3878 AC_MSG_CHECKING([what iOS SDK to use])
3880 if test "$enable_ios_simulator" = "yes"; then
3881 platformlc=iphonesimulator
3882 versionmin=-mios-simulator-version-min=14.5
3885 versionmin=-miphoneos-version-min=14.5
3888 sysroot=`xcrun --sdk $platformlc --show-sdk-path`
3890 if ! test -d "$sysroot"; then
3891 AC_MSG_ERROR([Could not find iOS SDK $sysroot])
3894 AC_MSG_RESULT($sysroot)
3896 stdlib="-stdlib=libc++"
3898 AC_MSG_CHECKING([what C compiler to use])
3899 CC="`xcrun -find clang`"
3900 CC_BASE=`first_arg_basename "$CC"`
3901 CC+=" -arch $host_cpu_for_clang -isysroot $sysroot $versionmin"
3902 AC_MSG_RESULT([$CC])
3904 AC_MSG_CHECKING([what C++ compiler to use])
3905 CXX="`xcrun -find clang++`"
3906 CXX_BASE=`first_arg_basename "$CXX"`
3907 CXX+=" -arch $host_cpu_for_clang $stdlib -isysroot $sysroot $versionmin"
3908 AC_MSG_RESULT([$CXX])
3910 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3913 STRIP=`xcrun -find strip`
3914 LIBTOOL=`xcrun -find libtool`
3915 RANLIB=`xcrun -find ranlib`
3918 AC_MSG_CHECKING([whether to treat the installation as read-only])
3920 if test $_os = Darwin; then
3921 enable_readonly_installset=yes
3922 elif test "$enable_extensions" != yes; then
3923 enable_readonly_installset=yes
3925 if test "$enable_readonly_installset" = yes; then
3926 AC_MSG_RESULT([yes])
3927 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3932 dnl ===================================================================
3933 dnl Structure of install set
3934 dnl ===================================================================
3936 if test $_os = Darwin; then
3937 LIBO_BIN_FOLDER=MacOS
3938 LIBO_ETC_FOLDER=Resources
3939 LIBO_LIBEXEC_FOLDER=MacOS
3940 LIBO_LIB_FOLDER=Frameworks
3941 LIBO_LIB_PYUNO_FOLDER=Resources
3942 LIBO_SHARE_FOLDER=Resources
3943 LIBO_SHARE_HELP_FOLDER=Resources/help
3944 LIBO_SHARE_JAVA_FOLDER=Resources/java
3945 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3946 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3947 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3948 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3949 LIBO_URE_BIN_FOLDER=MacOS
3950 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3951 LIBO_URE_LIB_FOLDER=Frameworks
3952 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3953 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3954 elif test $_os = WINNT; then
3955 LIBO_BIN_FOLDER=program
3956 LIBO_ETC_FOLDER=program
3957 LIBO_LIBEXEC_FOLDER=program
3958 LIBO_LIB_FOLDER=program
3959 LIBO_LIB_PYUNO_FOLDER=program
3960 LIBO_SHARE_FOLDER=share
3961 LIBO_SHARE_HELP_FOLDER=help
3962 LIBO_SHARE_JAVA_FOLDER=program/classes
3963 LIBO_SHARE_PRESETS_FOLDER=presets
3964 LIBO_SHARE_READMES_FOLDER=readmes
3965 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3966 LIBO_SHARE_SHELL_FOLDER=program/shell
3967 LIBO_URE_BIN_FOLDER=program
3968 LIBO_URE_ETC_FOLDER=program
3969 LIBO_URE_LIB_FOLDER=program
3970 LIBO_URE_MISC_FOLDER=program
3971 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3973 LIBO_BIN_FOLDER=program
3974 LIBO_ETC_FOLDER=program
3975 LIBO_LIBEXEC_FOLDER=program
3976 LIBO_LIB_FOLDER=program
3977 LIBO_LIB_PYUNO_FOLDER=program
3978 LIBO_SHARE_FOLDER=share
3979 LIBO_SHARE_HELP_FOLDER=help
3980 LIBO_SHARE_JAVA_FOLDER=program/classes
3981 LIBO_SHARE_PRESETS_FOLDER=presets
3982 LIBO_SHARE_READMES_FOLDER=readmes
3983 if test "$enable_fuzzers" != yes; then
3984 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3986 LIBO_SHARE_RESOURCE_FOLDER=resource
3988 LIBO_SHARE_SHELL_FOLDER=program/shell
3989 LIBO_URE_BIN_FOLDER=program
3990 LIBO_URE_ETC_FOLDER=program
3991 LIBO_URE_LIB_FOLDER=program
3992 LIBO_URE_MISC_FOLDER=program
3993 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3995 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3996 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3997 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3998 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3999 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
4000 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
4001 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
4002 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
4003 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
4004 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
4005 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
4006 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
4007 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
4008 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
4009 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
4010 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
4012 # Not all of them needed in config_host.mk, add more if need arises
4013 AC_SUBST(LIBO_BIN_FOLDER)
4014 AC_SUBST(LIBO_ETC_FOLDER)
4015 AC_SUBST(LIBO_LIB_FOLDER)
4016 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
4017 AC_SUBST(LIBO_SHARE_FOLDER)
4018 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
4019 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
4020 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
4021 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
4022 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
4023 AC_SUBST(LIBO_URE_BIN_FOLDER)
4024 AC_SUBST(LIBO_URE_ETC_FOLDER)
4025 AC_SUBST(LIBO_URE_LIB_FOLDER)
4026 AC_SUBST(LIBO_URE_MISC_FOLDER)
4027 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
4029 dnl ===================================================================
4030 dnl Windows specific tests and stuff
4031 dnl ===================================================================
4035 # Return value: $regvalue
4038 if test "$build_os" = "wsl"; then
4039 regvalue=$($WSL_LO_HELPER --read-registry $1 "$2/$3" 2>/dev/null)
4041 elif test -n "$WSL_ONLY_AS_HELPER"; then
4042 regvalue=$(reg.exe query "$(echo $2 | tr '/' '\\')" /v "$3" /reg:$1 |sed -ne "s|\s*$3.*REG_SZ\s*\(.*\)[\s\r]*$|\1|p")
4046 local _regentry="/proc/registry${1}/${2}/${3}"
4047 if test -f "$_regentry"; then
4048 # Stop bash complaining about \0 bytes in input, as it can't handle them.
4049 # Registry keys read via /proc/registry* are always \0 terminated!
4050 local _regvalue=$(tr -d '\0' < "$_regentry")
4051 if test $? -eq 0; then
4057 # Get a value from the 32-bit side of the Registry
4060 reg_get_value "32" "$1" "$2"
4063 # Get a value from the 64-bit side of the Registry
4066 reg_get_value "64" "$1" "$2"
4071 # Return value: $reglist
4074 if test "$build_os" = "wsl"; then
4075 reglist=$($WSL_LO_HELPER --list-registry $1 "$2" 2>/dev/null | tr -d '\r')
4079 reglist=$(ls "/proc/registry${1}/${2}")
4082 # List values from the 32-bit side of the Registry
4083 reg_list_values_32()
4085 reg_list_values "32" "$1"
4088 # List values from the 64-bit side of the Registry
4089 reg_list_values_64()
4091 reg_list_values "64" "$1"
4099 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4108 PLATFORMID=windows_x86_64
4110 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4112 WIN_MULTI_ARCH="x86"
4118 PLATFORMID=windows_x86
4121 WIN_OTHER_ARCH="x64"
4126 PLATFORMID=windows_aarch64
4128 SCPDEFS="$SCPDEFS -DWINDOWS_AARCH64"
4129 WIN_HOST_ARCH="arm64"
4134 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4138 case "$build_cpu" in
4139 x86_64) WIN_BUILD_ARCH="x64" ;;
4140 i*86) WIN_BUILD_ARCH="x86" ;;
4141 aarch64) WIN_BUILD_ARCH="arm64" ;;
4143 AC_MSG_ERROR([Unsupported build_cpu $build_cpu for host_os $host_os])
4147 SCPDEFS="$SCPDEFS -D_MSC_VER"
4151 # multi-arch is an arch, which can execute on the host (x86 on x64), while
4152 # other-arch won't, but wouldn't break the build (x64 on x86).
4153 if test -n "$WIN_MULTI_ARCH" -a -n "$WIN_OTHER_ARCH"; then
4154 AC_MSG_ERROR([Broken configure.ac file: can't have set \$WIN_MULTI_ARCH and $WIN_OTHER_ARCH])
4158 if test "$build_cpu" != "$host_cpu" -o "$DISABLE_DYNLOADING" = TRUE; then
4159 # To allow building Windows multi-arch releases without cross-tooling
4160 if test "$DISABLE_DYNLOADING" = TRUE -o \( -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH" \); then
4161 cross_compiling="yes"
4165 if test "$cross_compiling" = "yes"; then
4166 export CROSS_COMPILING=TRUE
4167 if test "$enable_dynamic_loading" != yes -a "$enable_wasm_strip" = yes; then
4168 ENABLE_WASM_STRIP=TRUE
4170 if test "$_os" = "Emscripten"; then
4171 if test "$with_main_module" = "calc"; then
4172 ENABLE_WASM_STRIP_WRITER=TRUE
4173 elif test "$with_main_module" = "writer"; then
4174 ENABLE_WASM_STRIP_CALC=TRUE
4179 BUILD_TYPE="$BUILD_TYPE NATIVE"
4181 AC_SUBST(CROSS_COMPILING)
4182 AC_SUBST(ENABLE_WASM_STRIP)
4183 AC_SUBST(ENABLE_WASM_STRIP_WRITER)
4184 AC_SUBST(ENABLE_WASM_STRIP_CALC)
4186 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
4187 # NOTE: must _not_ be used for bundled external libraries!
4189 if test "$GCC" = "yes"; then
4190 AC_MSG_CHECKING( for -isystem )
4192 CFLAGS="$CFLAGS -isystem /usr/include -Werror"
4193 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
4195 if test -n "$ISYSTEM"; then
4201 if test -z "$ISYSTEM"; then
4202 # fall back to using -I
4207 dnl ===================================================================
4208 dnl Check which Visual Studio compiler is used
4209 dnl ===================================================================
4211 map_vs_year_to_version()
4213 # Return value: $vsversion
4225 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
4229 vs_versions_to_check()
4231 # Args: $1 (optional) : versions to check, in the order of preference
4232 # Return value: $vsversions
4236 if test -n "$1"; then
4237 map_vs_year_to_version "$1"
4238 vsversions=$vsversion
4240 # Default version is 2019
4245 win_get_env_from_vsdevcmdbat()
4247 local WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
4248 printf '@set VSCMD_SKIP_SENDTELEMETRY=1\r\n' > $WRAPPERBATCHFILEPATH
4249 PathFormat "$VC_PRODUCT_DIR"
4250 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$formatted_path" >> $WRAPPERBATCHFILEPATH
4251 # use 'echo.%ENV%' syntax (instead of 'echo %ENV%') to avoid outputting "ECHO is off." in case when ENV is empty or a space
4252 printf '@setlocal\r\n@echo.%%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
4254 if test "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
4255 result=$(cd /mnt/c && cmd.exe /c $(wslpath -w $WRAPPERBATCHFILEPATH) | tr -d '\r')
4257 chmod +x $WRAPPERBATCHFILEPATH
4258 result=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
4260 rm -f $WRAPPERBATCHFILEPATH
4261 printf '%s' "$result"
4266 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0" "InstallationFolder"
4267 if test -n "$regvalue"; then
4268 PathFormat "$regvalue"
4269 UCRTSDKDIR=$formatted_path_unix
4270 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0" "ProductVersion"
4271 if test -n "$regvalue"; then
4272 UCRTVERSION="$regvalue".0
4276 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
4280 if test -z "$UCRTSDKDIR"; then
4281 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
4282 ide_env_file="${ide_env_dir}VsDevCmd.bat"
4283 if test -f "$ide_env_file"; then
4284 PathFormat "$(win_get_env_from_vsdevcmdbat UniversalCRTSdkDir)"
4285 UCRTSDKDIR=$formatted_path_unix
4286 UCRTVERSION=$(win_get_env_from_vsdevcmdbat UCRTVersion)
4287 dnl Hack needed at least by tml:
4288 if test "$UCRTVERSION" = 10.0.15063.0 \
4289 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
4290 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
4292 UCRTVERSION=10.0.14393.0
4295 AC_MSG_ERROR([No UCRT found])
4303 # Args: $1 (optional) : The VS version year
4304 # Return values: $vctest, $vcyear, $vctoolset, $vcnumwithdot, $vcbuildnumber
4306 unset vctest vctoolset vcnumwithdot vcbuildnumber
4308 vs_versions_to_check "$1"
4309 if test "$build_os" = wsl; then
4310 vswhere="$PROGRAMFILESX86"
4311 if test -z "$vswhere"; then
4312 vswhere="c:\\Program Files (x86)"
4314 elif test -n "$WSL_ONLY_AS_HELPER"; then
4315 vswhere="$(perl.exe -e 'print $ENV{"ProgramFiles(x86)"}')"
4317 vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
4319 vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
4320 PathFormat "$vswhere"
4321 vswhere=$formatted_path_unix
4322 for ver in $vsversions; do
4323 vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr ${ver%%.*} + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
4324 if test -z "$vswhereoutput"; then
4325 vswhereoutput=`$vswhere -prerelease -version "@<:@ $ver , $(expr ${ver%%.*} + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
4327 # Fall back to all MS products (this includes VC++ Build Tools)
4328 if ! test -n "$vswhereoutput"; then
4329 AC_MSG_CHECKING([VC++ Build Tools and similar])
4330 vswhereoutput=`$vswhere -products \* -version "@<:@ $ver , $(expr ${ver%%.*} + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
4332 if test -n "$vswhereoutput"; then
4333 PathFormat "$vswhereoutput"
4334 vctest=$formatted_path_unix
4339 if test -n "$vctest"; then
4341 if test "${vcnumwithdot%%.*}" = "$vcnumwithdot"; then
4342 vcnumwithdot=$vcnumwithdot.0
4344 case "$vcnumwithdot" in
4354 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
4361 AC_MSG_CHECKING([$1 compiler])
4363 CL_EXE_PATH="$2/cl.exe"
4365 if test ! -f "$CL_EXE_PATH"; then
4366 if test "$1" = "multi-arch"; then
4367 AC_MSG_WARN([no compiler (cl.exe) in $2])
4370 AC_MSG_ERROR([no compiler (cl.exe) in $2])
4374 dnl ===========================================================
4375 dnl Check for the corresponding mspdb*.dll
4376 dnl ===========================================================
4378 # MSVC 15.0 has libraries from 14.0?
4381 if test ! -e "$2/mspdb${mspdbnum}.dll"; then
4382 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $2, Visual Studio installation broken?])
4385 # The compiles has to find its shared libraries
4387 TEMP_PATH=`cygpath -d "$2"`
4388 PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
4390 if ! "$CL_EXE_PATH" -? </dev/null >/dev/null 2>&1; then
4391 AC_MSG_ERROR([no compiler (cl.exe) in $2])
4396 AC_MSG_RESULT([$CL_EXE_PATH])
4402 if test "$_os" = "WINNT"; then
4403 AC_MSG_CHECKING([Visual C++])
4404 find_msvc "$with_visual_studio"
4405 if test -z "$vctest"; then
4406 if test -n "$with_visual_studio"; then
4407 AC_MSG_ERROR([no Visual Studio $with_visual_studio installation found])
4409 AC_MSG_ERROR([no Visual Studio installation found])
4414 VC_PRODUCT_DIR="$vctest/VC"
4415 COMPATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber"
4417 # $WIN_OTHER_ARCH is a hack to test the x64 compiler on x86, even if it's not multi-arch
4418 if test -n "$WIN_MULTI_ARCH" -o -n "$WIN_OTHER_ARCH"; then
4419 MSVC_MULTI_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/${WIN_MULTI_ARCH}${WIN_OTHER_ARCH}"
4420 test_cl_exe "multi-arch" "$MSVC_MULTI_PATH"
4421 if test $? -ne 0; then
4427 if test "$WIN_BUILD_ARCH" = "$WIN_HOST_ARCH"; then
4428 MSVC_BUILD_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_BUILD_ARCH"
4429 test_cl_exe "build" "$MSVC_BUILD_PATH"
4432 if test "$WIN_BUILD_ARCH" != "$WIN_HOST_ARCH"; then
4433 MSVC_HOST_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_HOST_ARCH"
4434 test_cl_exe "host" "$MSVC_HOST_PATH"
4436 MSVC_HOST_PATH="$MSVC_BUILD_PATH"
4439 AC_MSG_CHECKING([for short pathname of VC product directory])
4440 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
4441 AC_MSG_RESULT([$VC_PRODUCT_DIR])
4446 AC_MSG_CHECKING([for UCRT location])
4448 # find_ucrt errors out if it doesn't find it
4449 AC_MSG_RESULT([$UCRTSDKDIR ($UCRTVERSION)])
4450 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
4451 ucrtincpath_formatted=$formatted_path
4452 # SOLARINC is used for external modules and must be set too.
4453 # And no, it's not sufficient to set SOLARINC only, as configure
4454 # itself doesn't honour it.
4455 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
4456 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
4457 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
4458 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
4460 AC_SUBST(UCRTSDKDIR)
4461 AC_SUBST(UCRTVERSION)
4463 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
4464 # Find the proper version of MSBuild.exe to use based on the VS version
4465 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot MSBuildOverrideTasksPath
4466 if test -z "$regvalue" ; then
4467 if test "$WIN_BUILD_ARCH" != "x64"; then
4468 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
4470 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
4473 if test -d "$regvalue" ; then
4474 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
4475 AC_MSG_RESULT([$regvalue])
4477 AC_MSG_ERROR([MSBuild.exe location not found])
4480 # Find the version of devenv.exe
4481 PathFormat "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe"
4482 DEVENV="$formatted_path"
4483 DEVENV_unix="$formatted_path_unix"
4484 if test ! -e "$DEVENV_unix"; then
4485 AC_MSG_WARN([No devenv.exe found - this is expected for VC++ Build Tools])
4488 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
4489 dnl needed when building CLR code:
4490 if test -z "$MSVC_CXX"; then
4491 # This gives us a posix path with 8.3 filename restrictions
4492 MSVC_CXX=`win_short_path_for_make "$MSVC_HOST_PATH/cl.exe"`
4495 if test -z "$CC"; then
4497 CC_BASE=`first_arg_basename "$CC"`
4499 if test -z "$CXX"; then
4501 CXX_BASE=`first_arg_basename "$CXX"`
4504 if test -n "$CC"; then
4505 # Remove /cl.exe from CC case insensitive
4506 AC_MSG_NOTICE([found Visual C++ $vcyear])
4508 PathFormat "$COMPATH"
4509 COMPATH="$formatted_path"
4510 COMPATH_unix="$formatted_path_unix"
4511 CPPFLAGS="$CPPFLAGS -I$COMPATH/Include"
4514 VCTOOLSET=$vctoolset
4516 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
4517 # are always "better", we list them in reverse chronological order.
4519 case "$vcnumwithdot" in
4520 16.0 | 17.0 | 17.11)
4521 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
4525 # The expectation is that --with-windows-sdk should not need to be used
4526 if test -n "$with_windows_sdk"; then
4527 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
4528 *" "$with_windows_sdk" "*)
4529 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
4532 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $vcyear])
4537 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
4542 AC_MSG_ERROR([Visual C++ not found after all, huh])
4545 # ERROR if VS version < 16.5
4546 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.5])
4547 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4548 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
4549 // between Visual Studio versions and _MSC_VER:
4553 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
4555 # WARN if VS version < 16.10
4556 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.10])
4557 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4561 ]])],[vs2019_recommended_version=yes],[vs2019_recommended_version=no])
4563 if test $vs2019_recommended_version = yes; then
4564 AC_MSG_RESULT([yes])
4567 add_warning "You should have at least Visual Studio 2019 version 16.10 to avoid build problems. Otherwise, you may face problems with the build of some modules including dragonbox."
4570 # Check for 64-bit (cross-)compiler to use to build the 64-bit
4571 # version of the Explorer extension (and maybe other small
4572 # bits, too) needed when installing a 32-bit LibreOffice on a
4573 # 64-bit OS. The 64-bit Explorer extension is a feature that
4574 # has been present since long in OOo. Don't confuse it with
4575 # building LibreOffice itself as 64-bit code.
4580 if test "$WIN_HOST_ARCH" = "x86" -a -n "$WIN_OTHER_ARCH"; then
4581 AC_MSG_CHECKING([for the libraries to build the 64-bit Explorer extensions])
4582 if test -f "$COMPATH/atlmfc/lib/x64/atls.lib" -o \
4583 -f "$COMPATH/atlmfc/lib/spectre/x64/atls.lib"
4586 CXX_X64_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
4587 AC_MSG_RESULT([found])
4589 AC_MSG_RESULT([not found])
4590 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
4592 elif test "$WIN_HOST_ARCH" = "x64"; then
4597 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
4598 AC_SUBST(CXX_X64_BINARY)
4600 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
4601 # needed to support TWAIN scan on both 32- and 64-bit systems
4603 case "$WIN_HOST_ARCH" in
4605 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
4606 if test -n "$CXX_X86_BINARY"; then
4608 AC_MSG_RESULT([preset])
4609 elif test -n "$WIN_MULTI_ARCH"; then
4611 CXX_X86_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
4612 AC_MSG_RESULT([found])
4614 AC_MSG_RESULT([not found])
4615 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
4620 CXX_X86_BINARY=$MSVC_CXX
4624 AC_SUBST(CXX_X86_BINARY)
4632 AC_MSG_CHECKING([whether the compiler is actually Clang])
4633 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4639 [AC_MSG_RESULT([yes])
4641 [AC_MSG_RESULT([no])])
4642 AC_SUBST(COM_IS_CLANG)
4645 if test "$COM_IS_CLANG" = TRUE; then
4646 AC_MSG_CHECKING([whether Clang is new enough])
4647 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4648 #if !defined __apple_build_version__
4652 [my_apple_clang=yes],[my_apple_clang=])
4653 if test "$my_apple_clang" = yes; then
4654 AC_MSG_RESULT([assumed yes (Apple Clang)])
4655 elif test "$_os" = Emscripten; then
4656 AC_MSG_RESULT([assumed yes (Emscripten Clang)])
4658 if test "$_os" = WINNT; then
4659 dnl In which case, assume clang-cl:
4664 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC $my_args - | sed 's/ //g'`
4665 CLANG_FULL_VERSION=`echo __clang_version__ | $CC $my_args -`
4666 CLANGVER=`echo $clang_version \
4667 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
4668 if test "$CLANGVER" -ge 120000; then
4669 AC_MSG_RESULT([yes ($clang_version)])
4671 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 12])
4673 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
4674 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
4678 SHOWINCLUDES_PREFIX=
4679 if test "$_os" = WINNT; then
4680 dnl We need to guess the prefix of the -showIncludes output, it can be
4682 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
4683 echo "#include <stdlib.h>" > conftest.c
4684 SHOWINCLUDES_PREFIX=`VSLANG=1033 $CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
4685 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
4686 rm -f conftest.c conftest.obj
4687 if test -z "$SHOWINCLUDES_PREFIX"; then
4688 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
4690 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
4693 AC_SUBST(SHOWINCLUDES_PREFIX)
4696 # prefix C with ccache if needed
4698 if test "$CCACHE" != ""; then
4699 AC_MSG_CHECKING([whether $CC_BASE is already ccached])
4703 CFLAGS="$CFLAGS --ccache-skip -O2"
4704 # msvc does not fail on unknown options, check stdout
4705 if test "$COM" = MSC; then
4706 CFLAGS="$CFLAGS -nologo"
4708 save_ac_c_werror_flag=$ac_c_werror_flag
4709 ac_c_werror_flag=yes
4710 dnl an empty program will do, we're checking the compiler flags
4711 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
4712 [use_ccache=yes], [use_ccache=no])
4714 ac_c_werror_flag=$save_ac_c_werror_flag
4715 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
4716 AC_MSG_RESULT([yes])
4719 CC_BASE="ccache $CC_BASE"
4725 # ===================================================================
4726 # check various GCC options that Clang does not support now but maybe
4727 # will somewhen in the future, check them even for GCC, so that the
4729 # ===================================================================
4732 if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
4733 AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
4735 CFLAGS="$CFLAGS -Werror -ggdb2"
4736 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
4738 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
4739 AC_MSG_RESULT([yes])
4744 if test "$host_cpu" = "m68k"; then
4745 AC_MSG_CHECKING([whether $CC_BASE supports -mlong-jump-table-offsets])
4747 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
4748 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
4750 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
4751 AC_MSG_RESULT([yes])
4757 AC_SUBST(HAVE_GCC_GGDB2)
4759 dnl ===================================================================
4760 dnl Test the gcc version
4761 dnl ===================================================================
4762 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
4763 AC_MSG_CHECKING([the GCC version])
4764 _gcc_version=`$CC -dumpfullversion`
4765 gcc_full_version=$(printf '%s' "$_gcc_version" | \
4766 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
4767 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
4769 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
4771 if test "$gcc_full_version" -lt 120000; then
4772 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 12])
4775 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
4776 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
4777 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
4778 # (which reports itself as GCC 4.2.1).
4781 AC_SUBST(GCC_VERSION)
4783 dnl Set the ENABLE_DBGUTIL variable
4784 dnl ===================================================================
4785 AC_MSG_CHECKING([whether to build with additional debug utilities])
4786 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
4787 ENABLE_DBGUTIL="TRUE"
4788 # this is an extra var so it can have different default on different MSVC
4789 # versions (in case there are version specific problems with it)
4790 MSVC_USE_DEBUG_RUNTIME="TRUE"
4792 AC_MSG_RESULT([yes])
4793 # cppunit and graphite expose STL in public headers
4794 if test "$with_system_cppunit" = "yes"; then
4795 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
4797 with_system_cppunit=no
4799 if test "$with_system_graphite" = "yes"; then
4800 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
4802 with_system_graphite=no
4804 if test "$with_system_orcus" = "yes"; then
4805 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
4807 with_system_orcus=no
4809 if test "$with_system_libcmis" = "yes"; then
4810 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
4812 with_system_libcmis=no
4814 if test "$with_system_hunspell" = "yes"; then
4815 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
4817 with_system_hunspell=no
4819 if test "$with_system_gpgmepp" = "yes"; then
4820 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
4822 with_system_gpgmepp=no
4824 if test "$with_system_zxing" = "yes"; then
4825 AC_MSG_ERROR([--with-system-zxing conflicts with --enable-dbgutil])
4827 with_system_zxing=no
4829 if test "$with_system_poppler" = "yes"; then
4830 AC_MSG_ERROR([--with-system-poppler conflicts with --enable-dbgutil])
4832 with_system_poppler=no
4834 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
4835 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
4836 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
4837 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
4838 # of those two is using the system variant:
4839 if test "$with_system_libnumbertext" = "yes"; then
4840 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
4842 with_system_libnumbertext=no
4844 if test "$with_system_libwps" = "yes"; then
4845 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
4847 with_system_libwps=no
4851 MSVC_USE_DEBUG_RUNTIME=""
4854 AC_SUBST(ENABLE_DBGUTIL)
4855 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
4857 dnl Set the ENABLE_DEBUG variable.
4858 dnl ===================================================================
4859 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
4860 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
4862 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
4863 if test -z "$libo_fuzzed_enable_debug"; then
4864 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
4866 AC_MSG_NOTICE([Resetting --enable-debug=yes])
4871 AC_MSG_CHECKING([whether to do a debug build])
4872 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
4874 if test -n "$ENABLE_DBGUTIL" ; then
4875 AC_MSG_RESULT([yes (dbgutil)])
4877 AC_MSG_RESULT([yes])
4883 AC_SUBST(ENABLE_DEBUG)
4885 dnl ===================================================================
4886 dnl Select the linker to use (gold/lld/ld.bfd/mold).
4887 dnl This is done only after compiler checks (need to know if Clang is
4888 dnl used, for different defaults) and after checking if a debug build
4889 dnl is wanted (non-debug builds get the default linker if not explicitly
4890 dnl specified otherwise).
4891 dnl All checks for linker features/options should come after this.
4892 dnl ===================================================================
4895 use_ld=-fuse-ld=${1%%:*}
4897 if test "$use_ld_path" != "$1"; then
4898 if test "$COM_IS_CLANG" = TRUE; then
4899 if test "$CLANGVER" -ge 120000; then
4900 use_ld="${use_ld} --ld-path=${use_ld_path}"
4902 use_ld="-fuse-ld=${use_ld_path}"
4905 # I tried to use gcc's '-B<path>' and a directory + symlink setup in
4906 # $BUILDDIR, but libtool always filtered-out that option, so gcc wouldn't
4907 # pickup the alternative linker, when called by libtool for linking.
4908 # For mold, one can use LD_PRELOAD=/usr/lib/mold/mold-wrapper.so instead.
4909 AC_MSG_ERROR([A linker path is just supported with clang, because of libtool's -B filtering!])
4912 use_ld_fail_if_error=$2
4914 AC_MSG_CHECKING([for $use_ld linker support])
4915 use_ld_ldflags_save="$LDFLAGS"
4916 LDFLAGS="$LDFLAGS $use_ld"
4917 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4920 printf ("hello world\n");
4921 ])], USE_LD=$use_ld, [])
4922 if test -n "$USE_LD"; then
4923 AC_MSG_RESULT( yes )
4926 if test -n "$use_ld_fail_if_error"; then
4932 if test -n "$use_ld_ok"; then
4933 dnl keep the value of LDFLAGS
4936 LDFLAGS="$use_ld_ldflags_save"
4940 if test "$enable_ld" != "no"; then
4941 if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
4942 if test -n "$enable_ld"; then
4943 check_use_ld "$enable_ld" fail_if_error
4944 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4945 dnl non-debug builds default to the default linker
4947 elif test -n "$COM_IS_CLANG"; then
4949 if test $? -ne 0; then
4951 if test $? -ne 0; then
4956 # For gcc first try gold, new versions also support lld/mold.
4958 if test $? -ne 0; then
4960 if test $? -ne 0; then
4965 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
4967 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD|^mold)')
4968 if test -z "$ld_used"; then
4971 AC_MSG_CHECKING([for linker that is used])
4972 AC_MSG_RESULT([$ld_used])
4973 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4974 if echo "$ld_used" | grep -q "^GNU ld"; then
4975 AC_MSG_WARN([The default GNU linker is slow, consider using LLD, mold or the GNU gold linker.])
4976 add_warning "The default GNU linker is slow, consider using LLD, mold or the GNU gold linker."
4980 if test "$enable_ld" = "yes"; then
4981 AC_MSG_ERROR([--enable-ld not supported])
4988 HAVE_LD_BSYMBOLIC_FUNCTIONS=
4989 if test "$GCC" = "yes" -a "$_os" != Emscripten ; then
4990 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
4991 bsymbolic_functions_ldflags_save=$LDFLAGS
4992 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
4993 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4996 printf ("hello world\n");
4997 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
4998 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
4999 AC_MSG_RESULT( found )
5001 AC_MSG_RESULT( not found )
5003 LDFLAGS=$bsymbolic_functions_ldflags_save
5005 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
5008 if test "$GCC" = "yes"; then
5009 for flag in "--gc-sections" "-dead_strip"; do
5010 AC_MSG_CHECKING([for $flag linker support])
5011 ldflags_save=$LDFLAGS
5012 LDFLAGS="$LDFLAGS -Wl,$flag"
5013 AC_LINK_IFELSE([AC_LANG_PROGRAM([
5016 printf ("hello world\n");
5018 LD_GC_SECTIONS="-Wl,$flag"
5019 AC_MSG_RESULT( found )
5021 AC_MSG_RESULT( not found )
5023 LDFLAGS=$ldflags_save
5024 if test -n "$LD_GC_SECTIONS"; then
5029 AC_SUBST(LD_GC_SECTIONS)
5031 HAVE_EXTERNAL_DWARF=
5032 if test "$enable_split_debug" != no; then
5034 if test -n "$ENABLE_LTO"; then
5035 : # Inherently incompatible, since no debug info is created while compiling, GCC complains.
5036 elif test "$enable_split_debug" = yes; then
5038 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
5039 elif test "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
5042 if test -n "$use_split_debug"; then
5043 if test "$_os" = "Emscripten"; then
5044 TEST_CC_FLAG=-gsplit-dwarf -gpubnames
5046 TEST_CC_FLAG=-gsplit-dwarf
5048 AC_MSG_CHECKING([whether $CC_BASE supports $TEST_CC_FLAG])
5050 CFLAGS="$CFLAGS -Werror $TEST_CC_FLAG"
5051 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_EXTERNAL_DWARF=TRUE ],[])
5053 if test "$HAVE_EXTERNAL_DWARF" = "TRUE"; then
5054 AC_MSG_RESULT([yes])
5056 if test "$enable_split_debug" = yes; then
5063 if test -z "$HAVE_EXTERNAL_DWARF" -a "$test_split_debug" = "yes" -a -n "$use_split_debug"; then
5064 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
5065 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
5068 AC_SUBST(HAVE_EXTERNAL_DWARF)
5070 HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=
5071 AC_MSG_CHECKING([whether $CC_BASE supports -Xclang -debug-info-kind=constructor])
5073 CFLAGS="$CFLAGS -Werror -Xclang -debug-info-kind=constructor"
5074 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=TRUE ],[])
5076 if test "$HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR" = "TRUE"; then
5077 AC_MSG_RESULT([yes])
5081 AC_SUBST(HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR)
5084 if test "$enable_gdb_index" != "no"; then
5085 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
5086 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
5087 AC_MSG_CHECKING([whether $CC_BASE supports -ggnu-pubnames])
5089 CFLAGS="$CFLAGS -Werror -g -ggnu-pubnames"
5091 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
5092 if test "$have_ggnu_pubnames" != "TRUE"; then
5093 if test "$enable_gdb_index" = "yes"; then
5094 AC_MSG_ERROR([no, --enable-gdb-index not supported])
5099 AC_MSG_RESULT( yes )
5100 AC_MSG_CHECKING([whether $CC_BASE supports -Wl,--gdb-index])
5101 ldflags_save=$LDFLAGS
5102 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
5103 AC_LINK_IFELSE([AC_LANG_PROGRAM([
5106 printf ("hello world\n");
5107 ])], ENABLE_GDB_INDEX=TRUE, [])
5108 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
5109 AC_MSG_RESULT( yes )
5111 if test "$enable_gdb_index" = "yes"; then
5117 LDFLAGS=$ldflags_save
5121 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
5122 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
5123 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
5126 AC_SUBST(ENABLE_GDB_INDEX)
5128 if test -z "$enable_sal_log" && test "$ENABLE_DEBUG" = TRUE; then
5131 if test "$enable_sal_log" = yes; then
5134 AC_SUBST(ENABLE_SAL_LOG)
5136 dnl Check for enable symbols option
5137 dnl ===================================================================
5138 AC_MSG_CHECKING([whether to generate debug information])
5139 if test -z "$enable_symbols"; then
5140 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
5146 if test "$enable_symbols" = yes; then
5147 ENABLE_SYMBOLS_FOR=all
5148 AC_MSG_RESULT([yes])
5149 elif test "$enable_symbols" = no; then
5153 # Selective debuginfo.
5154 ENABLE_SYMBOLS_FOR="$enable_symbols"
5155 AC_MSG_RESULT([for "$enable_symbols"])
5157 AC_SUBST(ENABLE_SYMBOLS_FOR)
5159 if test -n "$with_android_ndk" -a \( -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_SYMBOLS_FOR" = "all"; then
5160 # Building on Android with full symbols: without enough memory the linker never finishes currently.
5161 AC_MSG_CHECKING([whether enough memory is available for linking])
5162 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
5163 # Check for 15GB, as Linux reports a bit less than the physical memory size.
5164 if test -n "$mem_size" -a $mem_size -lt 15728640; then
5165 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
5167 AC_MSG_RESULT([yes])
5172 ENABLE_OPTIMIZED_DEBUG=
5173 AC_MSG_CHECKING([whether to compile with optimization flags])
5174 if test -z "$enable_optimized"; then
5175 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
5178 enable_optimized=yes
5181 if test "$enable_optimized" = yes; then
5182 ENABLE_OPTIMIZED=TRUE
5183 AC_MSG_RESULT([yes])
5184 elif test "$enable_optimized" = debug; then
5185 ENABLE_OPTIMIZED_DEBUG=TRUE
5186 AC_MSG_RESULT([yes (debug)])
5188 if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
5189 AC_MSG_CHECKING([whether $CC_BASE supports -Og])
5191 CFLAGS="$CFLAGS -Werror -Og"
5192 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_OG=TRUE ],[])
5194 if test "$HAVE_GCC_OG" = "TRUE"; then
5195 AC_MSG_RESULT([yes])
5200 if test -z "$HAVE_GCC_OG" -a "$_os" != "Emscripten"; then
5201 AC_MSG_ERROR([The compiler does not support optimizations suitable for debugging.])
5206 AC_SUBST(ENABLE_OPTIMIZED)
5207 AC_SUBST(ENABLE_OPTIMIZED_DEBUG)
5210 # determine CPUNAME, OS, ...
5226 if test "$enable_ios_simulator" = "yes"; then
5231 PLATFORMID=macosx_aarch64
5235 if test "$enable_ios_simulator" = "yes"; then
5240 PLATFORMID=macosx_x86_64
5243 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5256 if test "$enable_ios_simulator" = "yes"; then
5257 AC_MSG_ERROR([iOS simulator is only available in macOS not iOS])
5261 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5266 PLATFORMID=ios_arm64
5279 PLATFORMID=dragonfly_x86
5284 PLATFORMID=dragonfly_x86_64
5287 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5301 PLATFORMID=freebsd_aarch64
5307 PLATFORMID=freebsd_x86
5312 PLATFORMID=freebsd_x86_64
5317 PLATFORMID=freebsd_powerpc64
5322 PLATFORMID=freebsd_powerpc
5325 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5341 PLATFORMID=haiku_x86
5346 PLATFORMID=haiku_x86_64
5349 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5365 PLATFORMID=kfreebsd_x86
5370 PLATFORMID=kfreebsd_x86_64
5373 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5378 linux-gnu*|linux-musl*)
5388 PLATFORMID=linux_aarch64
5390 EPM_FLAGS="-a arm64"
5395 PLATFORMID=linux_alpha
5401 PLATFORMID=linux_arm_eabi
5405 PLATFORMID=linux_arm_oabi
5413 PLATFORMID=linux_hppa
5418 PLATFORMID=linux_x86
5423 PLATFORMID=linux_ia64
5429 PLATFORMID=linux_mips_eb
5434 EPM_FLAGS="-a mips64"
5435 PLATFORMID=linux_mips64_eb
5440 EPM_FLAGS="-a mips64el"
5441 PLATFORMID=linux_mips64_el
5446 EPM_FLAGS="-a mipsel"
5447 PLATFORMID=linux_mips_el
5452 EPM_FLAGS="-a riscv64"
5453 PLATFORMID=linux_riscv64
5458 PLATFORMID=linux_m68k
5463 PLATFORMID=linux_powerpc
5468 PLATFORMID=linux_powerpc64
5472 RTL_ARCH=PowerPC_64_LE
5473 PLATFORMID=linux_powerpc64_le
5478 PLATFORMID=linux_sparc
5483 PLATFORMID=linux_sparc64
5488 PLATFORMID=linux_s390x
5493 PLATFORMID=linux_x86_64
5497 RTL_ARCH=LOONGARCH64
5498 PLATFORMID=linux_loongarch64
5501 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5517 PLATFORMID=android_arm_eabi
5522 PLATFORMID=android_aarch64
5527 PLATFORMID=android_x86
5532 PLATFORMID=android_x86_64
5535 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5550 PLATFORMID=netbsd_x86
5555 PLATFORMID=netbsd_powerpc
5560 PLATFORMID=netbsd_sparc
5565 PLATFORMID=netbsd_x86_64
5568 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5583 PLATFORMID=openbsd_x86
5588 PLATFORMID=openbsd_x86_64
5591 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5594 SOLARINC="$SOLARINC -I/usr/local/include"
5607 PLATFORMID=solaris_x86
5612 PLATFORMID=solaris_sparc
5617 PLATFORMID=solaris_sparc64
5620 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5623 SOLARINC="$SOLARINC -I/usr/local/include"
5636 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5641 PLATFORMID=linux_x86
5645 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
5650 if test "$enable_gui" = "no"; then
5651 if test "$using_x11" != yes; then
5652 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
5658 AC_DEFINE(HAVE_FEATURE_UI)
5660 AC_SUBST(DISABLE_GUI)
5662 if test "$with_x" = "no"; then
5666 if test -z "$USING_X11" -a "$enable_qt5" = "yes" -a "$enable_gen" = "yes"; then
5667 AC_MSG_ERROR([Can't select gen VCL plugin, if --without-x is used!])
5670 if test "$using_x11" = yes; then
5671 if test "$USING_X11" = TRUE; then
5672 AC_DEFINE(USING_X11)
5675 if test "$DISABLE_DYNLOADING" = TRUE; then
5681 if test "$USING_X11" = TRUE; then
5682 AC_MSG_ERROR([Platform doesn't support X11 (\$using_x11), but \$USING_X11 is set!])
5686 WORKDIR="${BUILDDIR}/workdir"
5687 INSTDIR="${BUILDDIR}/instdir"
5688 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
5689 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
5697 AC_SUBST([INSTROOT])
5698 AC_SUBST([INSTROOTBASE])
5702 AC_SUBST(PLATFORMID)
5703 AC_SUBST(WINDOWS_X64)
5704 AC_DEFINE_UNQUOTED(SDKDIR, "$INSTDIR/$SDKDIRNAME")
5705 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
5707 if test "$OS" = WNT -a "$COM" = MSC; then
5709 INTEL) CPPU_ENV=msci ;;
5710 X86_64) CPPU_ENV=mscx ;;
5711 AARCH64) CPPU_ENV=msca ;;
5713 AC_MSG_ERROR([Unknown \$CPUNAME '$CPUNAME' for $OS / $COM"])
5721 dnl ===================================================================
5722 dnl Test which package format to use
5723 dnl ===================================================================
5724 AC_MSG_CHECKING([which package format to use])
5725 if test -n "$with_package_format" -a "$with_package_format" != no; then
5726 for i in $with_package_format; do
5728 bsd | deb | pkg | rpm | archive | dmg | installed | msi | emscripten)
5731 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
5732 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
5733 deb - Debian software distribution
5734 pkg - Solaris software distribution
5735 rpm - RedHat software distribution
5737 LibreOffice additionally supports:
5738 archive - .tar.gz or .zip
5740 emscripten - directory with qt_soffice.html etc.
5741 installed - installation tree
5747 # fakeroot is needed to ensure correct file ownerships/permissions
5748 # inside deb packages and tar archives created on Linux and Solaris.
5749 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
5750 AC_PATH_PROG(FAKEROOT, fakeroot, no)
5751 if test "$FAKEROOT" = "no"; then
5753 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
5756 PKGFORMAT="$with_package_format"
5757 AC_MSG_RESULT([$PKGFORMAT])
5760 AC_MSG_RESULT([none])
5764 dnl ===================================================================
5765 dnl handle help related options
5767 dnl If you change help related options, please update README.help
5768 dnl ===================================================================
5775 AC_MSG_CHECKING([which help to build])
5776 if test -n "$with_help" -a "$with_help" != "no"; then
5777 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5778 BUILD_TYPE="$BUILD_TYPE HELP"
5779 case "$with_help" in
5781 ENABLE_HTMLHELP=TRUE
5783 SCPDEFS="$SCPDEFS -DWITH_HELPPACKS"
5784 AC_MSG_RESULT([HTML (local)])
5787 ENABLE_HTMLHELP=TRUE
5789 AC_MSG_RESULT([HTML (online)])
5793 SCPDEFS="$SCPDEFS -DWITH_HELPPACKS"
5794 AC_MSG_RESULT([XML (local)])
5797 AC_MSG_ERROR([Unknown --with-help=$with_help])
5804 AC_MSG_CHECKING([if we need to build the help index tooling])
5805 if test \( "$with_help" = yes -o "$enable_extension_integration" != no \) -a -z "$DISABLE_DYNLOADING"; then
5806 BUILD_TYPE="$BUILD_TYPE HELPTOOLS"
5808 AC_MSG_RESULT([yes])
5813 AC_MSG_CHECKING([whether to enable xapian-omega support for online help])
5814 if test -n "$with_omindex" -a "$with_omindex" != "no"; then
5815 if test "$HELP_ONLINE" != TRUE; then
5816 AC_MSG_ERROR([Can't build xapian-omega index without --help=online])
5818 case "$with_omindex" in
5820 HELP_OMINDEX_PAGE=TRUE
5821 AC_MSG_RESULT([SERVER])
5824 AC_MSG_RESULT([NOXAP])
5827 AC_MSG_ERROR([Unknown --with-omindex=$with_omindex])
5834 AC_MSG_CHECKING([whether to include the XML-help support])
5835 if test "$enable_xmlhelp" = yes; then
5836 BUILD_TYPE="$BUILD_TYPE XMLHELP"
5838 AC_DEFINE(HAVE_FEATURE_XMLHELP)
5839 AC_MSG_RESULT([yes])
5841 if test "$with_help" = yes; then
5842 add_warning "Building the XML help, but LO with disabled xmlhelp support. Generated help can't be accessed from this LO build!"
5847 dnl Test whether to integrate helppacks into the product's installer
5848 AC_MSG_CHECKING([for helppack integration])
5849 if test -z "$WITH_HELPPACKS" -o "$with_helppack_integration" = no; then
5850 AC_MSG_RESULT([no integration])
5852 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
5853 AC_MSG_RESULT([integration])
5856 AC_SUBST([ENABLE_HTMLHELP])
5857 AC_SUBST([HELP_OMINDEX_PAGE])
5858 AC_SUBST([HELP_ONLINE])
5859 # WITH_HELPPACKS is used only in configure
5861 dnl ===================================================================
5862 dnl Set up a different compiler to produce tools to run on the build
5863 dnl machine when doing cross-compilation
5864 dnl ===================================================================
5866 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
5867 m4_pattern_allow([PKG_CONFIG_LIBDIR])
5868 if test "$cross_compiling" = "yes"; then
5869 AC_MSG_CHECKING([for BUILD platform configuration])
5871 rm -rf CONF-FOR-BUILD config_build.mk
5872 mkdir CONF-FOR-BUILD
5873 # Here must be listed all files needed when running the configure script. In particular, also
5874 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
5875 # keep them in the same order as there.
5876 (cd $SRC_ROOT && tar cf - \
5878 bin/get_config_variables \
5879 solenv/bin/getcompver.awk \
5880 solenv/inc/langlist.mk \
5883 config_host_lang.mk.in \
5885 bin/bffvalidator.sh.in \
5886 bin/odfvalidator.sh.in \
5887 bin/officeotron.sh.in \
5888 instsetoo_native/util/openoffice.lst.in \
5890 sysui/desktop/macosx/Info.plist.in \
5891 sysui/desktop/macosx/hardened_runtime.xcent.in \
5892 sysui/desktop/macosx/lo.xcent.in \
5893 .vscode/vs-code-template.code-workspace.in \
5894 solenv/lockfile/autoconf.h.in \
5896 | (cd CONF-FOR-BUILD && tar xf -)
5897 cp configure CONF-FOR-BUILD
5898 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
5900 unset COM USING_X11 OS CPUNAME
5901 unset CC CXX SYSBASE CFLAGS
5902 unset AR LD NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
5903 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
5904 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
5905 unset PKG_CONFIG_LIBDIR PKG_CONFIG_PATH
5906 if test -n "$CC_FOR_BUILD"; then
5907 export CC="$CC_FOR_BUILD"
5908 CC_BASE=`first_arg_basename "$CC"`
5910 if test -n "$CXX_FOR_BUILD"; then
5911 export CXX="$CXX_FOR_BUILD"
5912 CXX_BASE=`first_arg_basename "$CXX"`
5914 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
5917 # Handle host configuration, which affects the cross-toolset too
5919 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
5920 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
5921 test "$with_junit" = "no" && sub_conf_opts="$sub_conf_opts --without-junit"
5922 # While we don't need scripting support, we don't have a PYTHON_FOR_BUILD Java equivalent, so must enable scripting for Java
5923 if test -n "$ENABLE_JAVA"; then
5926 # Hack for Android - the build doesn't need a host JDK, so just forward to build for convenience
5927 test -n "$with_jdk_home" && sub_conf_opts="$sub_conf_opts --with-jdk-home=$with_jdk_home"
5930 if test -z "$with_jdk_home"; then
5931 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.])
5936 sub_conf_opts="$sub_conf_opts --without-java"
5938 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
5939 test "$with_galleries" = "no" -o -z "$WITH_GALLERY_BUILD" && sub_conf_opts="$sub_conf_opts --with-galleries=no --disable-database-connectivity"
5940 test "$with_templates" = "no" -o -z "$WITH_TEMPLATES" && sub_conf_opts="$sub_conf_opts --with-templates=no"
5941 test -n "$with_help" -a "$with_help" != "no" && sub_conf_opts="$sub_conf_opts --with-help=$with_help"
5942 test "$enable_extensions" = yes || sub_conf_opts="$sub_conf_opts --disable-extensions"
5943 test "${enable_ld+set}" = set -a "$build_cpu" = "$host_cpu" && sub_conf_opts="$sub_conf_opts --enable-ld=${enable_ld}"
5944 test "${enable_pch+set}" = set && sub_conf_opts="$sub_conf_opts --enable-pch=${enable_pch}"
5945 test "$enable_wasm_strip" = "yes" && sub_conf_opts="$sub_conf_opts --enable-wasm-strip"
5946 test "${with_system_lockfile+set}" = set && sub_conf_opts="$sub_conf_opts --with-system-lockfile=${with_system_lockfile}"
5947 test "${enable_fuzzers}" = yes && sub_conf_opts="$sub_conf_opts --without-system-libxml"
5948 if test "$_os" = "Emscripten"; then
5949 sub_conf_opts="$sub_conf_opts --without-system-libxml --without-system-fontconfig --without-system-freetype --without-system-zlib"
5950 if test "${with_main_module+set}" = set; then
5951 sub_conf_opts="$sub_conf_opts --with-main-module=${with_main_module}"
5953 sub_conf_opts="$sub_conf_opts --with-main-module=writer"
5956 # windows uses full-internal python and that in turn relies on openssl, so also enable openssl
5957 # when cross-compiling for aarch64, overriding the defaults below
5958 test "${PLATFORMID}" = "windows_aarch64" && sub_conf_opts="$sub_conf_opts --enable-openssl --with-tls=openssl"
5960 # Don't bother having configure look for stuff not needed for the build platform anyway
5961 # WARNING: any option with an argument containing spaces must be handled separately (see --with-theme)
5962 sub_conf_defaults=" \
5963 --build="$build_alias" \
5964 --disable-cairo-canvas \
5966 --disable-customtarget-components \
5967 --disable-firebird-sdbc \
5969 --disable-gstreamer-1-0 \
5973 --disable-mariadb-sdbc \
5975 --disable-online-update \
5978 --disable-pdfimport \
5979 --disable-postgresql-sdbc \
5982 --enable-dynamic-loading \
5983 --enable-icecream="$enable_icecream" \
5990 # single quotes added for better readability in case of spaces
5991 echo " Running CONF-FOR-BUILD/configure" \
5992 $sub_conf_defaults \
5993 --with-parallelism="'$with_parallelism'" \
5994 --with-theme="'$with_theme'" \
5995 --with-vendor="'$with_vendor'" \
5997 $with_build_platform_configure_options \
6001 $sub_conf_defaults \
6002 --with-parallelism="$with_parallelism" \
6003 --with-theme="$with_theme" \
6004 "--with-vendor=$with_vendor" \
6006 $with_build_platform_configure_options \
6008 2>&1 | sed -e 's/^/ /'
6009 if test [${PIPESTATUS[0]}] -ne 0; then
6010 AC_MSG_ERROR([Running the configure script for BUILD side failed, see CONF-FOR-BUILD/config.log])
6013 # filter permitted build targets
6014 PERMITTED_BUILD_TARGETS="
6054 # converts BUILD_TYPE and PERMITTED_BUILD_TARGETS into non-whitespace,
6055 # newlined lists, to use grep as a filter
6056 PERMITTED_BUILD_TARGETS=$(echo "$PERMITTED_BUILD_TARGETS" | sed -e '/^ *$/d' -e 's/ *//')
6057 BUILD_TARGETS="$(sed -n -e '/^export BUILD_TYPE=/ s/.*=//p' config_host.mk | tr ' ' '\n')"
6058 BUILD_TARGETS="$(echo "$BUILD_TARGETS" | grep -F "$PERMITTED_BUILD_TARGETS" | tr '\n' ' ')"
6059 sed -i -e "s/ BUILD_TYPE=.*$/ BUILD_TYPE=$BUILD_TARGETS/" config_host.mk
6061 cp config_host.mk ../config_build.mk
6062 cp config_host_lang.mk ../config_build_lang.mk
6063 mv config.log ../config.Build.log
6064 mkdir -p ../config_build
6065 mv config_host/*.h ../config_build
6066 test -f "$WARNINGS_FILE" && mv "$WARNINGS_FILE" "../$WARNINGS_FILE_FOR_BUILD"
6068 # all these will get a _FOR_BUILD postfix
6069 DIRECT_FOR_BUILD_SETTINGS="
6077 JDK_SECURITYMANAGER_DISALLOWED
6081 LIBO_URE_MISC_FOLDER
6087 # these overwrite host config with build config
6088 OVERWRITING_SETTINGS="
6103 # these need some special handling
6104 EXTRA_HANDLED_SETTINGS="
6111 . ./bin/get_config_variables $DIRECT_FOR_BUILD_SETTINGS $OVERWRITING_SETTINGS $EXTRA_HANDLED_SETTINGS
6115 line=`echo "LO_PATH_FOR_BUILD='${BUILD_PATH}'" | sed -e 's,/CONF-FOR-BUILD,,g'`
6116 echo "$line" >>build-config
6118 for V in $DIRECT_FOR_BUILD_SETTINGS; do
6120 VV=`eval "echo $VV"`
6121 if test -n "$VV"; then
6122 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
6123 echo "$line" >>build-config
6127 for V in $OVERWRITING_SETTINGS; do
6129 VV=`eval "echo $VV"`
6130 if test -n "$VV"; then
6131 line=${V}='${'${V}:-$VV'}'
6132 echo "$line" >>build-config
6136 for V in INSTDIR INSTROOT WORKDIR; do
6138 VV=`eval "echo $VV"`
6139 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
6140 if test -n "$VV"; then
6141 line="${V}_FOR_BUILD='$VV'"
6142 echo "$line" >>build-config
6147 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([setup/configure for BUILD side failed, see CONF-FOR-BUILD/config.log])
6148 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])
6149 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
6150 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
6152 eval `cat CONF-FOR-BUILD/build-config`
6154 AC_MSG_RESULT([checking for BUILD platform configuration... done])
6156 rm -rf CONF-FOR-BUILD
6160 CPPU_ENV_FOR_BUILD="$CPPU_ENV"
6161 CXX_FOR_BUILD="$CXX"
6162 INSTDIR_FOR_BUILD="$INSTDIR"
6163 INSTROOT_FOR_BUILD="$INSTROOT"
6164 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
6165 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
6166 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
6167 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
6168 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
6169 WORKDIR_FOR_BUILD="$WORKDIR"
6171 AC_SUBST(OS_FOR_BUILD)
6172 AC_SUBST(INSTDIR_FOR_BUILD)
6173 AC_SUBST(INSTROOT_FOR_BUILD)
6174 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
6175 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
6176 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
6177 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
6178 AC_SUBST(SDKDIRNAME_FOR_BUILD)
6179 AC_SUBST(WORKDIR_FOR_BUILD)
6180 AC_SUBST(CC_FOR_BUILD)
6181 AC_SUBST(CXX_FOR_BUILD)
6182 AC_SUBST(CPPU_ENV_FOR_BUILD)
6184 dnl ===================================================================
6185 dnl Check for lockfile deps
6186 dnl ===================================================================
6187 if test -z "$CROSS_COMPILING"; then
6188 test -n "$LOCKFILE" -a "${with_system_lockfile+set}" != set && with_system_lockfile="$LOCKFILE"
6189 test "${with_system_lockfile+set}" = set || with_system_lockfile=no
6190 AC_MSG_CHECKING([which lockfile binary to use])
6191 case "$with_system_lockfile" in
6193 AC_MSG_RESULT([external])
6194 AC_PATH_PROGS([LOCKFILE],[dotlockfile lockfile])
6197 AC_MSG_RESULT([internal])
6200 if test -x "$with_system_lockfile"; then
6201 LOCKFILE="$with_system_lockfile"
6203 AC_MSG_ERROR(['$with_system_lockfile' is not executable.])
6205 AC_MSG_RESULT([$with_system_lockfile])
6210 if test -n "$LOCKFILE" -a "$DISABLE_DYNLOADING" = TRUE; then
6211 add_warning "The default system lockfile has increasing poll intervals up to 60s, so linking executables may be delayed."
6214 AC_CHECK_HEADERS([getopt.h paths.h sys/param.h])
6215 AC_CHECK_FUNCS([utime utimes])
6218 dnl ===================================================================
6219 dnl Check for syslog header
6220 dnl ===================================================================
6221 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
6223 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
6224 dnl ===================================================================
6225 AC_MSG_CHECKING([whether to turn warnings to errors])
6226 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
6227 ENABLE_WERROR="TRUE"
6228 PYTHONWARNINGS="error"
6229 AC_MSG_RESULT([yes])
6231 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
6232 ENABLE_WERROR="TRUE"
6233 PYTHONWARNINGS="error"
6234 AC_MSG_RESULT([yes])
6239 AC_SUBST(ENABLE_WERROR)
6240 AC_SUBST(PYTHONWARNINGS)
6242 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
6243 dnl ===================================================================
6244 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
6245 if test -z "$enable_assert_always_abort"; then
6246 if test "$ENABLE_DEBUG" = TRUE; then
6247 enable_assert_always_abort=yes
6249 enable_assert_always_abort=no
6252 if test "$enable_assert_always_abort" = "yes"; then
6253 ASSERT_ALWAYS_ABORT="TRUE"
6254 AC_MSG_RESULT([yes])
6256 ASSERT_ALWAYS_ABORT="FALSE"
6259 AC_SUBST(ASSERT_ALWAYS_ABORT)
6261 # Determine whether to use ooenv for the instdir installation
6262 # ===================================================================
6263 if test $_os != "WINNT" -a $_os != "Darwin"; then
6264 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
6265 if test -z "$enable_ooenv"; then
6266 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
6272 if test "$enable_ooenv" = "no"; then
6276 AC_MSG_RESULT([yes])
6279 AC_SUBST(ENABLE_OOENV)
6281 if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; then
6282 if test "$enable_qt5" = "no"; then
6283 AC_MSG_ERROR([KF5 support depends on QT5, so it conflicts with --disable-qt5])
6289 if test "$test_kf6" = "yes" -a "$enable_kf6" = "yes"; then
6290 if test "$enable_qt6" = "no"; then
6291 AC_MSG_ERROR([KF6 support depends on QT6, so it conflicts with --disable-qt6])
6298 AC_MSG_CHECKING([whether to build the pagein binaries for oosplash])
6299 if test "${enable_pagein}" != no -a -z "$DISABLE_DYNLOADING"; then
6300 AC_MSG_RESULT([yes])
6302 AC_DEFINE(HAVE_FEATURE_PAGEIN)
6306 AC_SUBST(ENABLE_PAGEIN)
6309 AC_MSG_CHECKING([whether to enable CPDB support])
6313 if test "$test_cpdb" = yes -a "x$enable_cpdb" = "xyes"; then
6315 AC_MSG_RESULT([yes])
6316 PKG_CHECK_MODULES(CPDB, cpdb-frontend)
6317 CPDB_CFLAGS=$(printf '%s' "$CPDB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
6318 FilterLibs "${CPDB_LIBS}"
6319 CPDB_LIBS="${filteredlibs}"
6320 AC_DEFINE([ENABLE_CPDB],[1])
6324 AC_SUBST(ENABLE_CPDB)
6326 AC_SUBST(CPDB_CFLAGS)
6328 dnl ===================================================================
6329 dnl check for cups support
6330 dnl ===================================================================
6332 AC_MSG_CHECKING([whether to enable CUPS support])
6333 if test "$test_cups" = yes -a "$enable_cups" != no; then
6335 AC_MSG_RESULT([yes])
6337 AC_MSG_CHECKING([whether cups support is present])
6338 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
6339 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
6340 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
6341 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
6347 AC_SUBST(ENABLE_CUPS)
6349 libo_CHECK_SYSTEM_MODULE([fontconfig],[FONTCONFIG],[fontconfig >= 2.12.0],,system,TRUE)
6351 dnl whether to find & fetch external tarballs?
6352 dnl ===================================================================
6353 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
6354 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6355 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
6357 TARFILE_LOCATION="$LODE_HOME/ext_tar"
6360 if test -z "$TARFILE_LOCATION"; then
6361 if test -d "$SRC_ROOT/src" ; then
6362 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
6363 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
6365 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
6367 AbsolutePath "$TARFILE_LOCATION"
6368 PathFormat "${absolute_path}"
6369 TARFILE_LOCATION="${formatted_path_unix}"
6371 PathFormat "$TARFILE_LOCATION"
6372 TARFILE_LOCATION_NATIVE="$formatted_path"
6373 AC_SUBST(TARFILE_LOCATION)
6374 AC_SUBST(TARFILE_LOCATION_NATIVE)
6376 AC_MSG_CHECKING([whether we want to fetch tarballs])
6377 if test "$enable_fetch_external" != "no"; then
6378 if test "$with_all_tarballs" = "yes"; then
6379 AC_MSG_RESULT([yes, all of them])
6380 DO_FETCH_TARBALLS="ALL"
6382 AC_MSG_RESULT([yes, if we use them])
6383 DO_FETCH_TARBALLS="TRUE"
6389 AC_SUBST(DO_FETCH_TARBALLS)
6391 dnl Test whether to include MySpell dictionaries
6392 dnl ===================================================================
6393 AC_MSG_CHECKING([whether to include MySpell dictionaries])
6394 if test "$with_myspell_dicts" = "yes"; then
6395 AC_MSG_RESULT([yes])
6396 WITH_MYSPELL_DICTS=TRUE
6397 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
6398 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
6403 AC_SUBST(WITH_MYSPELL_DICTS)
6405 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
6406 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
6407 if test "$with_system_dicts" = yes; then
6408 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
6410 with_system_dicts=no
6413 AC_MSG_CHECKING([whether to use dicts from external paths])
6414 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
6415 AC_MSG_RESULT([yes])
6417 AC_MSG_CHECKING([for spelling dictionary directory])
6418 if test -n "$with_external_dict_dir"; then
6419 DICT_SYSTEM_DIR=file://$with_external_dict_dir
6421 DICT_SYSTEM_DIR=file:///usr/share/hunspell
6422 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
6423 DICT_SYSTEM_DIR=file:///usr/share/myspell
6426 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
6427 AC_MSG_CHECKING([for hyphenation patterns directory])
6428 if test -n "$with_external_hyph_dir"; then
6429 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
6431 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
6433 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
6434 AC_MSG_CHECKING([for thesaurus directory])
6435 if test -n "$with_external_thes_dir"; then
6436 THES_SYSTEM_DIR=file://$with_external_thes_dir
6438 THES_SYSTEM_DIR=file:///usr/share/mythes
6440 AC_MSG_RESULT([$THES_SYSTEM_DIR])
6445 AC_SUBST(SYSTEM_DICTS)
6446 AC_SUBST(DICT_SYSTEM_DIR)
6447 AC_SUBST(HYPH_SYSTEM_DIR)
6448 AC_SUBST(THES_SYSTEM_DIR)
6450 dnl ===================================================================
6451 dnl Precompiled headers.
6453 AC_MSG_CHECKING([whether to enable pch feature])
6454 if test -z "$enable_pch"; then
6455 if test "$_os" = "WINNT"; then
6456 # Enabled by default on Windows.
6458 # never use sccache on auto-enabled PCH builds, except if requested explicitly
6459 if test -z "$enable_ccache" -a "$SCCACHE"; then
6466 if test "$enable_pch" != no -a "$_os" = Emscripten; then
6467 AC_MSG_ERROR([PCH currently isn't supported for Emscripten with native EH (nEH) because of missing Sj/Lj support with nEH in clang.])
6469 if test "$enable_pch" != "no" -a "$_os" != "WINNT" -a "$GCC" != "yes" ; then
6470 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
6472 if test "$enable_pch" = "system"; then
6474 AC_MSG_RESULT([yes (system headers)])
6475 elif test "$enable_pch" = "base"; then
6477 AC_MSG_RESULT([yes (system and base headers)])
6478 elif test "$enable_pch" = "normal"; then
6480 AC_MSG_RESULT([yes (normal)])
6481 elif test "$enable_pch" = "full"; then
6483 AC_MSG_RESULT([yes (full)])
6484 elif test "$enable_pch" = "yes"; then
6485 # Pick a suitable default.
6486 if test "$GCC" = "yes"; then
6487 # With Clang and GCC higher levels do not seem to make a noticeable improvement,
6488 # while making the PCHs larger and rebuilds more likely.
6490 AC_MSG_RESULT([yes (system and base headers)])
6492 # With MSVC the highest level makes a significant difference,
6493 # and it was the default when there used to be no PCH levels.
6495 AC_MSG_RESULT([yes (full)])
6497 elif test "$enable_pch" = "no"; then
6500 AC_MSG_ERROR([Unknown value for --enable-pch])
6502 AC_SUBST(ENABLE_PCH)
6503 # ccache 3.7.1 and older do not properly detect/handle -include .gch in CCACHE_DEPEND mode
6504 if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_IS_CLANG" != "TRUE"; then
6505 AC_PATH_PROG([CCACHE_BIN],[ccache],[not found])
6506 if test "$CCACHE_BIN" != "not found"; then
6507 AC_MSG_CHECKING([ccache version])
6508 CCACHE_VERSION=`"$CCACHE_BIN" -V | "$AWK" '/^ccache version/{print $3}'`
6509 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6510 AC_MSG_RESULT([$CCACHE_VERSION])
6511 AC_MSG_CHECKING([whether ccache depend mode works properly with GCC PCH])
6512 if test "$CCACHE_NUMVER" -gt "030701"; then
6513 AC_MSG_RESULT([yes])
6515 AC_MSG_RESULT([no (not newer than 3.7.1)])
6521 PCH_INSTANTIATE_TEMPLATES=
6522 if test -n "$ENABLE_PCH"; then
6523 AC_MSG_CHECKING([whether $CC supports -fpch-instantiate-templates])
6525 CFLAGS="$CFLAGS -Werror -fpch-instantiate-templates"
6526 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_INSTANTIATE_TEMPLATES="-fpch-instantiate-templates" ],[])
6528 if test -n "$PCH_INSTANTIATE_TEMPLATES"; then
6534 AC_SUBST(PCH_INSTANTIATE_TEMPLATES)
6536 BUILDING_PCH_WITH_OBJ=
6537 if test -n "$ENABLE_PCH"; then
6538 AC_MSG_CHECKING([whether $CC supports -Xclang -building-pch-with-obj])
6540 CFLAGS="$CFLAGS -Werror -Xclang -building-pch-with-obj"
6541 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ BUILDING_PCH_WITH_OBJ="-Xclang -building-pch-with-obj" ],[])
6543 if test -n "$BUILDING_PCH_WITH_OBJ"; then
6549 AC_SUBST(BUILDING_PCH_WITH_OBJ)
6554 if test "$COM" = MSC; then
6555 fpch_prefix="-Xclang "
6557 if test -n "$BUILDING_PCH_WITH_OBJ"; then
6558 AC_MSG_CHECKING([whether $CC supports ${fpch_prefix}-fpch-codegen])
6560 CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fpch-codegen"
6561 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
6562 [ PCH_CODEGEN="${fpch_prefix}-fpch-codegen" ],[])
6564 CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fno-pch-codegen"
6565 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
6566 [ PCH_NO_CODEGEN="${fpch_prefix}-fno-pch-codegen" ],[])
6568 if test -n "$PCH_CODEGEN"; then
6574 AC_SUBST(PCH_CODEGEN)
6575 AC_SUBST(PCH_NO_CODEGEN)
6577 if test -n "$BUILDING_PCH_WITH_OBJ"; then
6578 AC_MSG_CHECKING([whether $CC supports ${fpch_prefix}-fpch-debuginfo])
6580 CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fpch-debuginfo"
6581 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_DEBUGINFO="${fpch_prefix}-fpch-debuginfo" ],[])
6583 if test -n "$PCH_DEBUGINFO"; then
6589 AC_SUBST(PCH_DEBUGINFO)
6593 AC_MSG_CHECKING([the GNU Make version])
6594 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
6595 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6596 if test "$_make_longver" -ge "040000"; then
6597 AC_MSG_RESULT([$GNUMAKE $_make_version])
6599 AC_MSG_ERROR([failed ($GNUMAKE version >= 4.0 needed)])
6602 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
6604 if test "$_make_ver_check" = ""; then
6608 HAVE_LD_HASH_STYLE=FALSE
6609 WITH_LINKER_HASH_STYLE=
6610 AC_MSG_CHECKING([for --hash-style gcc linker support])
6611 if test "$GCC" = "yes"; then
6612 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
6613 hash_styles="gnu sysv"
6614 elif test "$with_linker_hash_style" = "no"; then
6617 hash_styles="$with_linker_hash_style"
6620 for hash_style in $hash_styles; do
6621 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
6622 hash_style_ldflags_save=$LDFLAGS
6623 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
6625 AC_RUN_IFELSE([AC_LANG_PROGRAM(
6632 HAVE_LD_HASH_STYLE=TRUE
6633 WITH_LINKER_HASH_STYLE=$hash_style
6635 [HAVE_LD_HASH_STYLE=FALSE],
6636 [HAVE_LD_HASH_STYLE=FALSE])
6637 LDFLAGS=$hash_style_ldflags_save
6640 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
6641 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
6645 LDFLAGS=$hash_style_ldflags_save
6649 AC_SUBST(HAVE_LD_HASH_STYLE)
6650 AC_SUBST(WITH_LINKER_HASH_STYLE)
6652 dnl ===================================================================
6653 dnl Check whether there's a Perl version available.
6654 dnl ===================================================================
6655 if test -z "$with_perl_home"; then
6656 AC_PATH_PROG(PERL, perl)
6658 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
6659 _perl_path="$with_perl_home/bin/perl"
6660 if test -x "$_perl_path"; then
6663 AC_MSG_ERROR([$_perl_path not found])
6667 dnl ===================================================================
6668 dnl Testing for Perl version 5 or greater.
6669 dnl $] is the Perl version variable, it is returned as an integer
6670 dnl ===================================================================
6671 if test "$PERL"; then
6672 AC_MSG_CHECKING([the Perl version])
6673 ${PERL} -e "exit($]);"
6675 if test "$_perl_version" -lt 5; then
6676 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
6678 AC_MSG_RESULT([Perl $_perl_version])
6680 AC_MSG_ERROR([Perl not found, install Perl 5])
6683 dnl ===================================================================
6684 dnl Testing for required Perl modules
6685 dnl ===================================================================
6687 AC_MSG_CHECKING([for required Perl modules])
6688 perl_use_string="use Cwd ; use Digest::MD5"
6689 if test "$_os" = "WINNT"; then
6690 if test -n "$PKGFORMAT"; then
6691 for i in $PKGFORMAT; do
6694 # for getting fonts versions to use in MSI
6695 perl_use_string="$perl_use_string ; use Font::TTF::Font"
6701 if test "$with_system_hsqldb" = "yes"; then
6702 perl_use_string="$perl_use_string ; use Archive::Zip"
6704 if test "$enable_openssl" = "yes" -a "$with_system_openssl" != "yes"; then
6705 # OpenSSL needs that to build
6706 perl_use_string="$perl_use_string ; use FindBin"
6708 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
6709 AC_MSG_RESULT([all modules found])
6711 AC_MSG_RESULT([failed to find some modules])
6712 # Find out which modules are missing.
6713 for i in $perl_use_string; do
6714 if test "$i" != "use" -a "$i" != ";"; then
6715 if ! $PERL -e "use $i;">/dev/null 2>&1; then
6716 missing_perl_modules="$missing_perl_modules $i"
6721 The missing Perl modules are: $missing_perl_modules
6722 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
6725 dnl ===================================================================
6726 dnl Check for pkg-config
6727 dnl ===================================================================
6728 if test "$_os" != "WINNT"; then
6731 AC_SUBST(PKG_CONFIG)
6732 AC_SUBST(PKG_CONFIG_PATH)
6733 AC_SUBST(PKG_CONFIG_LIBDIR)
6735 if test "$_os" != "WINNT"; then
6737 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
6738 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
6739 # explicitly. Or put /path/to/compiler in PATH yourself.
6742 if test "$COM_IS_CLANG" = "TRUE"; then
6745 AC_CHECK_TOOLS(AR,$toolprefix-ar ar)
6746 AC_CHECK_TOOLS(NM,$toolprefix-nm nm)
6747 AC_CHECK_TOOLS(RANLIB,$toolprefix-ranlib ranlib)
6748 AC_CHECK_TOOLS(OBJDUMP,$toolprefix-objdump objdump)
6749 AC_CHECK_TOOLS(READELF,$toolprefix-readelf readelf)
6750 AC_CHECK_TOOLS(STRIP,$toolprefix-strip strip)
6759 dnl ===================================================================
6760 dnl pkg-config checks on macOS
6761 dnl ===================================================================
6763 if test $_os = Darwin; then
6764 AC_MSG_CHECKING([for bogus pkg-config])
6765 if test -n "$PKG_CONFIG"; then
6766 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
6767 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
6769 if test "$enable_bogus_pkg_config" = "yes"; then
6770 AC_MSG_RESULT([yes, user-approved from unknown origin.])
6772 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.])
6776 AC_MSG_RESULT([no, good])
6782 # Return value: $csctest
6786 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client" "InstallPath"
6787 if test -n "$regvalue"; then
6795 # Return value: $altest
6799 # We need this check to detect 4.6.1 or above.
6800 for ver in 4.8.1 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
6801 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools" "InstallationFolder"
6802 PathFormat "$regvalue"
6803 if test -n "$regvalue" -a \( -f "$formatted_path_unix/al.exe" -o -f "$formatted_path_unix/bin/al.exe" \); then
6809 reg_list_values_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows"
6810 for x in $reglist; do
6811 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools" "InstallationFolder"
6812 PathFormat "$regvalue"
6813 if test -n "$regvalue" -a \( -f "$formatted_path_unix/al.exe" -o -f "$formatted_path_unix/bin/al.exe" \); then
6824 for ver in 4.8.1 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
6825 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver" "KitsInstallationFolder"
6826 if test -n "$regvalue"; then
6831 AC_MSG_ERROR([The Windows NET SDK (minimum 4.6) not found, check the installation])
6834 find_winsdk_version()
6836 # Args: $1 : SDK version as in "8.0", "8.1A" etc
6837 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
6839 unset winsdktest winsdkbinsubdir winsdklibsubdir
6843 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots" "KitsRoot"
6844 if test -n "$regvalue"; then
6845 winsdktest=$regvalue
6846 winsdklibsubdir=win8
6851 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots" "KitsRoot81"
6852 if test -n "$regvalue"; then
6853 winsdktest=$regvalue
6854 winsdklibsubdir=winv6.3
6859 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}" "InstallationFolder"
6860 if test -n "$regvalue"; then
6861 winsdktest=$regvalue
6862 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}" "ProductVersion"
6863 if test -n "$regvalue"; then
6864 winsdkbinsubdir="$regvalue".0
6865 winsdklibsubdir=$winsdkbinsubdir
6866 local tmppath="$winsdktest\\Include\\$winsdklibsubdir"
6867 PathFormat "$tmppath"
6868 local tmppath_unix=$formatted_path_unix
6869 # test exist the SDK path
6870 if test ! -d "$tmppath_unix"; then
6871 AC_MSG_ERROR([The Windows SDK not found, check the installation])
6882 # Return value: From find_winsdk_version
6886 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
6887 find_winsdk_version $ver
6888 if test -n "$winsdktest"; then
6896 # Return value: $msmdir
6899 AC_MSG_CHECKING([for MSVC $version merge modules directory])
6900 local my_msm_file="Microsoft_VC${version}_CRT_x86.msm"
6903 echo "$as_me:$LINENO: searching for $my_msm_file" >&5
6907 16.0 | 17.0 | 17.11)
6908 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
6909 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
6910 echo "$as_me:$LINENO: looking for $my_msm_dir${my_msm_file}])" >&5
6911 if test -e "$my_msm_dir${my_msm_file}"; then
6918 if test -n "$msmdir"; then
6919 msmdir=`cygpath -m "$msmdir"`
6920 AC_MSG_RESULT([$msmdir])
6922 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
6923 AC_MSG_FAILURE([not found])
6925 AC_MSG_WARN([not found (check config.log)])
6926 add_warning "MSM ${my_msm_file} not found"
6931 find_msvc_x64_dlls()
6933 # Return value: $msvcdllpath, $msvcdlls
6935 AC_MSG_CHECKING([for MSVC x64 DLL path])
6937 dnl Order crtver in increasing order. Then check the directories returned by
6938 dnl ls in an inner loop; assuming they are also ordered in increasing order,
6939 dnl the result will be the highest CRT version found in the highest directory.
6941 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
6943 16.0 | 17.0 | 17.11)
6944 for crtver in 141 142 143; do
6945 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
6946 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT" >&5
6947 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT"; then
6948 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT"
6954 AC_MSG_RESULT([$msvcdllpath])
6955 AC_MSG_CHECKING([for MSVC x64 DLLs])
6956 msvcdlls="msvcp140.dll vcruntime140.dll"
6957 for dll in $msvcdlls; do
6958 if ! test -f "$msvcdllpath/$dll"; then
6959 AC_MSG_FAILURE([missing $dll])
6962 AC_MSG_RESULT([found all ($msvcdlls)])
6965 dnl =========================================
6966 dnl Check for the Windows SDK.
6967 dnl =========================================
6968 if test "$_os" = "WINNT"; then
6969 AC_MSG_CHECKING([for Windows SDK])
6970 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
6972 WINDOWS_SDK_HOME=$winsdktest
6974 # normalize if found
6975 if test -n "$WINDOWS_SDK_HOME"; then
6976 PathFormat "$WINDOWS_SDK_HOME"
6977 WINDOWS_SDK_HOME=$formatted_path_unix
6980 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
6981 # The variable also contains the Windows SDK version
6982 echo $WINDOWS_SDK_LIB_SUBDIR
6983 IFS='.' read -r SDK_v1 SDK_v2 SDK_v3 SDK_v4 <<< "$WINDOWS_SDK_LIB_SUBDIR"
6984 # Assuming maximum of 5 digits for each part and ignoring last part
6985 SDK_NORMALIZED_VER=$((SDK_v1 * 10000000000 + SDK_v2 * 100000 + SDK_v3))
6986 # 10.0.20348.0 is the minimum required version
6987 if test "$SDK_NORMALIZED_VER" -lt 100000020348; then
6988 AC_MSG_ERROR([You need Windows SDK greater than or equal 10.0.20348.0])
6992 if test -n "$WINDOWS_SDK_HOME"; then
6993 # Remove a possible trailing backslash
6994 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
6996 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
6997 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
6998 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
6999 have_windows_sdk_headers=yes
7000 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
7001 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
7002 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
7003 have_windows_sdk_headers=yes
7004 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
7005 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
7006 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
7007 have_windows_sdk_headers=yes
7009 have_windows_sdk_headers=no
7012 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
7013 have_windows_sdk_libs=yes
7014 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/user32.lib"; then
7015 have_windows_sdk_libs=yes
7017 have_windows_sdk_libs=no
7020 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
7021 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
7022 the Windows SDK are installed.])
7026 if test -z "$WINDOWS_SDK_HOME"; then
7027 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
7028 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
7029 WINDOWS_SDK_VERSION=80
7030 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
7031 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
7032 WINDOWS_SDK_VERSION=81
7033 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
7034 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
7035 WINDOWS_SDK_VERSION=10
7036 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
7038 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
7040 PathFormat "$WINDOWS_SDK_HOME"
7041 WINDOWS_SDK_HOME="$formatted_path"
7042 WINDOWS_SDK_HOME_unix="$formatted_path_unix"
7043 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
7044 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
7045 if test -d "$WINDOWS_SDK_HOME_unix/include/um"; then
7046 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
7047 elif test -d "$WINDOWS_SDK_HOME_unix/Include/$winsdklibsubdir/um"; then
7048 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
7052 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
7053 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
7054 dnl but not in v8.0), so allow this to be overridden with a
7055 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
7056 dnl and configuration error if no WiLangId.vbs is found would arguably be
7057 dnl better, but I do not know under which conditions exactly it is needed by
7059 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
7060 WINDOWS_SDK_WILANGID_unix=$WINDOWS_SDK_HOME_unix/Samples/sysmgmt/msi/scripts/WiLangId.vbs
7061 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
7062 WINDOWS_SDK_WILANGID_unix="${WINDOWS_SDK_HOME_unix}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WIN_BUILD_ARCH}/WiLangId.vbs"
7064 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
7065 WINDOWS_SDK_WILANGID_unix=$WINDOWS_SDK_HOME_unix/bin/$WIN_BUILD_ARCH/WiLangId.vbs
7067 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
7068 WINDOWS_SDK_WILANGID_unix="C:/Program Files (x86)/Windows Kits/8.1/bin/$WIN_BUILD_ARCH/WiLangId.vbs"
7070 PathFormat "$WINDOWS_SDK_WILANGID_unix"
7071 WINDOWS_SDK_WILANGID="$formatted_path"
7073 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
7074 if test -n "$with_package_format" -a "$with_package_format" != no; then
7075 for i in "$with_package_format"; do
7076 if test "$i" = "msi"; then
7077 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
7078 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
7085 AC_SUBST(WINDOWS_SDK_HOME)
7086 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
7087 AC_SUBST(WINDOWS_SDK_VERSION)
7088 AC_SUBST(WINDOWS_SDK_WILANGID)
7090 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
7091 dnl Check midl.exe; this being the first check for a tool in the SDK bin
7092 dnl dir, it also determines that dir's path w/o an arch segment if any,
7093 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
7094 AC_MSG_CHECKING([for midl.exe])
7097 PathFormat "$winsdktest"
7098 winsdktest_unix="$formatted_path_unix"
7100 if test -n "$winsdkbinsubdir" \
7101 -a -f "$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/midl.exe"
7103 MIDL_PATH=$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH
7104 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME_unix/Bin/$winsdkbinsubdir
7105 elif test -f "$winsdktest_unix/Bin/$WIN_BUILD_ARCH/midl.exe"; then
7106 MIDL_PATH=$winsdktest_unix/Bin/$WIN_BUILD_ARCH
7107 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME_unix/Bin
7108 elif test -f "$winsdktest_unix/Bin/midl.exe"; then
7109 MIDL_PATH=$winsdktest_unix/Bin
7110 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME_unix/Bin
7112 PathFormat "$MIDL_PATH"
7113 if test ! -f "$formatted_path_unix/midl.exe"; then
7114 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WIN_BUILD_ARCH, Windows SDK installation broken?])
7116 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
7119 # Convert to posix path with 8.3 filename restrictions ( No spaces )
7120 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
7122 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
7123 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
7124 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
7125 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
7126 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
7127 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
7128 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
7129 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
7130 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
7131 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
7132 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
7133 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
7135 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
7138 PathFormat "$MIDL_PATH"
7139 MIDL_PATH="$formatted_path"
7141 if test "$enable_cli" = yes; then
7143 AC_MSG_CHECKING([for csc.exe])
7145 PathFormat "$csctest"
7146 csctest_unix="$formatted_path_unix"
7147 if test -f "$csctest_unix/csc.exe"; then
7150 if test ! -f "$csctest_unix/csc.exe"; then
7151 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
7153 AC_MSG_RESULT([$CSC_PATH/csc.exe])
7156 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
7159 AC_MSG_CHECKING([for al.exe])
7160 if test -n "$winsdkbinsubdir" \
7161 -a -f "$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/al.exe"
7163 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH"
7164 elif test -f "$winsdktest_unix/Bin/$WIN_BUILD_ARCH/al.exe"; then
7165 AL_PATH="$winsdktest/Bin/$WIN_BUILD_ARCH"
7166 elif test -f "$winsdktest_unix/Bin/al.exe"; then
7167 AL_PATH="$winsdktest/Bin"
7170 if test -z "$AL_PATH"; then
7172 PathFormat "$altest"
7173 altest_unix="$formatted_path_unix"
7174 if test -f "$altest_unix/bin/al.exe"; then
7175 AL_PATH="$altest/bin"
7176 elif test -f "$altest_unix/al.exe"; then
7180 PathFormat "$AL_PATH"
7181 if test ! -f "$formatted_path_unix/al.exe"; then
7182 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
7184 AC_MSG_RESULT([$AL_PATH/al.exe])
7187 AL_PATH=`win_short_path_for_make "$AL_PATH"`
7189 dnl Check mscoree.lib / .NET Framework dir
7190 AC_MSG_CHECKING(.NET Framework)
7192 PathFormat "$frametest"
7193 frametest="$formatted_path_unix"
7194 if test -f "$frametest/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
7195 DOTNET_FRAMEWORK_HOME="$frametest"
7197 if test -f "$winsdktest_unix/lib/mscoree.lib" -o -f "$winsdktest_unix/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib"; then
7198 DOTNET_FRAMEWORK_HOME="$winsdktest"
7201 PathFormat "$DOTNET_FRAMEWORK_HOME"
7202 if test ! -f "$formatted_path_unix/lib/mscoree.lib" -a ! -f "$formatted_path_unix/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib" -a ! -f "$formatted_path_unix/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
7203 AC_MSG_ERROR([mscoree.lib not found])
7205 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
7207 PathFormat "$AL_PATH"
7208 AL_PATH="$formatted_path"
7210 PathFormat "$DOTNET_FRAMEWORK_HOME"
7211 DOTNET_FRAMEWORK_HOME="$formatted_path"
7213 PathFormat "$CSC_PATH"
7214 CSC_PATH="$formatted_path"
7223 AC_SUBST(ENABLE_CLI)
7225 dnl ===================================================================
7226 dnl Testing for C++ compiler and version...
7227 dnl ===================================================================
7229 if test "$_os" != "WINNT"; then
7230 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that (and avoid -O2 during AC_PROG_CXX,
7231 # see AC_PROG_CC above):
7232 save_CXXFLAGS=$CXXFLAGS
7235 CXXFLAGS=$save_CXXFLAGS
7236 if test -z "$CXX_BASE"; then
7237 CXX_BASE=`first_arg_basename "$CXX"`
7241 dnl check for GNU C++ compiler version
7242 if test "$GXX" = "yes" -a -z "$COM_IS_CLANG"; then
7243 AC_MSG_CHECKING([the GNU C++ compiler version])
7245 _gpp_version=`$CXX -dumpversion`
7246 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
7248 if test "$_gpp_majmin" -lt "700"; then
7249 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 7.0 to build LibreOffice, you have $_gpp_version.])
7251 AC_MSG_RESULT([ok (g++ $_gpp_version)])
7254 dnl see https://issuetracker.google.com/issues/36962819
7258 AC_MSG_CHECKING([whether $CXX_BASE is broken with boost.thread])
7259 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
7260 #include <bits/c++config.h>]],[[
7261 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
7262 && !defined(_GLIBCXX__PTHREADS) \
7263 && !defined(_GLIBCXX_HAS_GTHREADS)
7266 ]])],[AC_MSG_RESULT([yes])
7267 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
7269 if test $glibcxx_threads = yes; then
7270 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
7273 AC_SUBST(BOOST_CXXFLAGS)
7276 # prefx CXX with ccache if needed
7278 if test "$CCACHE" != ""; then
7279 AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
7281 save_CXXFLAGS=$CXXFLAGS
7282 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
7283 # msvc does not fail on unknown options, check stdout
7284 if test "$COM" = MSC; then
7285 CXXFLAGS="$CXXFLAGS -nologo"
7287 save_ac_cxx_werror_flag=$ac_cxx_werror_flag
7288 ac_cxx_werror_flag=yes
7289 dnl an empty program will do, we're checking the compiler flags
7290 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
7291 [use_ccache=yes], [use_ccache=no])
7292 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
7293 AC_MSG_RESULT([yes])
7296 CXX_BASE="ccache $CXX_BASE"
7299 CXXFLAGS=$save_CXXFLAGS
7300 ac_cxx_werror_flag=$save_ac_cxx_werror_flag
7304 dnl ===================================================================
7305 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
7306 dnl ===================================================================
7308 if test "$_os" != "WINNT"; then
7311 dnl Check whether there's a C pre-processor.
7316 dnl ===================================================================
7317 dnl Find integral type sizes and alignments
7318 dnl ===================================================================
7320 if test "$_os" != "WINNT"; then
7322 AC_CHECK_SIZEOF(long)
7323 AC_CHECK_SIZEOF(short)
7324 AC_CHECK_SIZEOF(int)
7325 AC_CHECK_SIZEOF(long long)
7326 AC_CHECK_SIZEOF(double)
7327 AC_CHECK_SIZEOF(void*)
7328 AC_CHECK_SIZEOF(size_t)
7330 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
7331 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
7332 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
7333 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
7334 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
7335 SIZEOF_SIZE_T=$ac_cv_sizeof_size_t
7337 dnl Allow build without AC_CHECK_ALIGNOF, grrr
7338 m4_pattern_allow([AC_CHECK_ALIGNOF])
7339 m4_ifdef([AC_CHECK_ALIGNOF],
7341 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
7342 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
7343 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
7344 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
7347 case "$_os-$host_cpu" in
7349 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
7350 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
7351 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
7352 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
7355 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
7356 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
7357 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
7358 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
7361 if test -z "$ac_cv_alignof_short" -o \
7362 -z "$ac_cv_alignof_int" -o \
7363 -z "$ac_cv_alignof_long" -o \
7364 -z "$ac_cv_alignof_double"; then
7365 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.])
7371 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
7372 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
7373 if test $ac_cv_sizeof_long -eq 8; then
7374 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
7375 elif test $ac_cv_sizeof_double -eq 8; then
7376 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
7378 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
7381 dnl Check for large file support
7383 if test -n "$ac_cv_sys_largefile_opts" -a "$ac_cv_sys_largefile_opts" != "none needed" -a "$ac_cv_sys_largefile_opts" != "support not detected"; then
7384 LFS_CFLAGS="$ac_cv_sys_largefile_opts"
7385 elif test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
7386 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
7388 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
7389 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
7393 SAL_TYPES_SIZEOFSHORT=2
7394 SAL_TYPES_SIZEOFINT=4
7395 SAL_TYPES_SIZEOFLONG=4
7396 SAL_TYPES_SIZEOFLONGLONG=8
7397 if test $WIN_HOST_BITS -eq 32; then
7398 SAL_TYPES_SIZEOFPOINTER=4
7401 SAL_TYPES_SIZEOFPOINTER=8
7404 SAL_TYPES_ALIGNMENT2=2
7405 SAL_TYPES_ALIGNMENT4=4
7406 SAL_TYPES_ALIGNMENT8=8
7409 AC_SUBST(LFS_CFLAGS)
7410 AC_SUBST(SIZEOF_SIZE_T)
7412 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
7413 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
7414 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
7415 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
7416 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
7417 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
7418 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
7419 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
7421 dnl Calc jumbo sheets (1m+ rows) depend on 64 bit tools::Long .
7422 AC_MSG_CHECKING([whether jumbo sheets are supported])
7423 if test "$_os" != "WINNT"; then
7424 if test $SAL_TYPES_SIZEOFLONG -gt 4; then
7425 AC_MSG_RESULT([yes])
7426 ENABLE_JUMBO_SHEETS=TRUE
7427 AC_DEFINE(HAVE_FEATURE_JUMBO_SHEETS)
7432 if test $WIN_HOST_BITS -gt 32; then
7433 # 64bit windows is special-cased for tools::Long because long is 32bit
7434 AC_MSG_RESULT([yes])
7435 ENABLE_JUMBO_SHEETS=TRUE
7436 AC_DEFINE(HAVE_FEATURE_JUMBO_SHEETS)
7441 AC_SUBST(ENABLE_JUMBO_SHEETS)
7443 dnl ===================================================================
7444 dnl Check whether to enable runtime optimizations
7445 dnl ===================================================================
7446 ENABLE_RUNTIME_OPTIMIZATIONS=
7447 AC_MSG_CHECKING([whether to enable runtime optimizations])
7448 if test -z "$enable_runtime_optimizations"; then
7452 enable_runtime_optimizations=no
7458 if test "$enable_runtime_optimizations" != no; then
7459 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
7460 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
7461 AC_MSG_RESULT([yes])
7465 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
7467 dnl ===================================================================
7468 dnl Check if valgrind headers are available
7469 dnl ===================================================================
7471 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
7472 prev_cppflags=$CPPFLAGS
7473 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
7474 # or where does it come from?
7475 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
7476 AC_CHECK_HEADER([valgrind/valgrind.h],
7477 [ENABLE_VALGRIND=TRUE])
7478 CPPFLAGS=$prev_cppflags
7480 AC_SUBST([ENABLE_VALGRIND])
7481 if test -z "$ENABLE_VALGRIND"; then
7482 if test "$with_valgrind" = yes; then
7483 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
7487 AC_SUBST([VALGRIND_CFLAGS])
7490 dnl ===================================================================
7491 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
7492 dnl ===================================================================
7494 # We need at least the sys/sdt.h include header.
7495 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
7496 if test "$SDT_H_FOUND" = "TRUE"; then
7497 # Found sys/sdt.h header, now make sure the c++ compiler works.
7498 # Old g++ versions had problems with probes in constructors/destructors.
7499 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
7501 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
7502 #include <sys/sdt.h>
7510 ProbeClass(int& v, const char *n) : ref(v), name(n)
7512 DTRACE_PROBE2(_test_, cons, name, ref);
7515 void method(int min)
7517 DTRACE_PROBE3(_test_, meth, name, ref, min);
7523 DTRACE_PROBE2(_test_, dest, name, ref);
7528 DTRACE_PROBE1(_test_, call, i);
7529 ProbeClass inst = ProbeClass(i, "call");
7531 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
7532 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
7535 AC_CONFIG_HEADERS([config_host/config_probes.h])
7537 dnl ===================================================================
7539 dnl ===================================================================
7540 HAVE_GCC_STACK_CLASH_PROTECTION=
7542 HARDENING_OPT_CFLAGS=
7543 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
7544 AC_MSG_CHECKING([whether $CC_BASE supports -grecord-gcc-switches])
7546 CFLAGS="$CFLAGS -Werror -grecord-gcc-switches"
7548 [AC_LANG_PROGRAM(, [[return 0;]])],
7549 [AC_MSG_RESULT([yes]); HARDENING_CFLAGS="$HARDENING_CFLAGS -grecord-gcc-switches"],
7550 [AC_MSG_RESULT([no])])
7553 AC_MSG_CHECKING([whether $CC_BASE supports -D_FORTIFY_SOURCE=2])
7555 CFLAGS="$CFLAGS -Werror -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2"
7556 if test "$ENABLE_OPTIMIZED" = TRUE; then
7557 CFLAGS="$CFLAGS -O2"
7560 [AC_LANG_PROGRAM([[#include <string.h>]], [[return 0;]])],
7561 [AC_MSG_RESULT([yes]); HARDENING_OPT_CFLAGS="$HARDENING_OPT_CFLAGS -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2"],
7562 [AC_MSG_RESULT([no])])
7565 AC_MSG_CHECKING([whether $CC_BASE supports -D_GLIBCXX_ASSERTIONS])
7567 CFLAGS="$CFLAGS -Werror -Wp,-D_GLIBCXX_ASSERTIONS"
7569 [AC_LANG_PROGRAM(, [[return 0;]])],
7570 [AC_MSG_RESULT([yes]); HARDENING_CFLAGS="$HARDENING_CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"],
7571 [AC_MSG_RESULT([no])])
7574 AC_MSG_CHECKING([whether $CC_BASE supports -fstack-clash-protection])
7576 CFLAGS="$CFLAGS -Werror -fstack-clash-protection"
7578 [AC_LANG_PROGRAM(, [[return 0;]])],
7579 [AC_MSG_RESULT([yes]); HAVE_GCC_STACK_CLASH_PROTECTION=TRUE; HARDENING_CFLAGS="$HARDENING_CFLAGS -fstack-clash-protection"],
7580 [AC_MSG_RESULT([no])])
7583 AC_MSG_CHECKING([whether $CC_BASE supports -fcf-protection])
7585 CFLAGS="$CFLAGS -Werror -fcf-protection"
7587 [AC_LANG_PROGRAM(, [[return 0;]])],
7588 [AC_MSG_RESULT([yes]); HARDENING_CFLAGS="$HARDENING_CFLAGS -fcf-protection"],
7589 [AC_MSG_RESULT([no])])
7592 AC_MSG_CHECKING([whether $CC_BASE supports -mno-avx])
7594 CFLAGS="$CFLAGS -Werror -mno-avx"
7595 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
7597 if test "$HAVE_GCC_AVX" = "TRUE"; then
7598 AC_MSG_RESULT([yes])
7603 AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
7604 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
7606 if (__sync_add_and_fetch(&v, 1) != 1 ||
7607 __sync_sub_and_fetch(&v, 1) != 0)
7609 __sync_synchronize();
7610 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
7614 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
7615 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
7616 AC_MSG_RESULT([yes])
7617 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
7622 AC_MSG_CHECKING([whether $CXX_BASE defines __base_class_type_info in cxxabi.h])
7624 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7627 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
7629 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
7630 AC_MSG_RESULT([yes])
7631 ], [AC_MSG_RESULT([no])])
7634 AC_MSG_CHECKING([whether $CXX_BASE defines __class_type_info in cxxabi.h])
7636 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7639 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
7641 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
7642 AC_MSG_RESULT([yes])
7643 ], [AC_MSG_RESULT([no])])
7646 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_allocate_exception in cxxabi.h])
7648 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7650 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
7652 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
7653 AC_MSG_RESULT([yes])
7654 ], [AC_MSG_RESULT([no])])
7657 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_eh_globals in cxxabi.h])
7659 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7662 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
7664 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
7665 AC_MSG_RESULT([yes])
7666 ], [AC_MSG_RESULT([no])])
7669 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exception in cxxabi.h])
7671 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7674 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exception); }
7676 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTION],[1])
7677 AC_MSG_RESULT([yes])
7678 ], [AC_MSG_RESULT([no])])
7681 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_get_globals in cxxabi.h])
7683 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7685 void * f() { return __cxxabiv1::__cxa_get_globals(); }
7687 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
7688 AC_MSG_RESULT([yes])
7689 ], [AC_MSG_RESULT([no])])
7692 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_current_exception_type in cxxabi.h])
7694 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7696 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
7698 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
7699 AC_MSG_RESULT([yes])
7700 ], [AC_MSG_RESULT([no])])
7703 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_throw in cxxabi.h])
7705 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7707 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
7709 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
7710 AC_MSG_RESULT([yes])
7711 ], [AC_MSG_RESULT([no])])
7714 AC_MSG_CHECKING([whether $CXX_BASE defines __si_class_type_info in cxxabi.h])
7716 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7719 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
7721 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
7722 AC_MSG_RESULT([yes])
7723 ], [AC_MSG_RESULT([no])])
7726 AC_MSG_CHECKING([whether $CXX_BASE defines __vmi_class_type_info in cxxabi.h])
7728 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7731 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
7733 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
7734 AC_MSG_RESULT([yes])
7735 ], [AC_MSG_RESULT([no])])
7739 AC_SUBST(HAVE_GCC_AVX)
7740 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
7741 AC_SUBST(HAVE_GCC_STACK_CLASH_PROTECTION)
7742 AC_SUBST(HARDENING_CFLAGS)
7743 AC_SUBST(HARDENING_OPT_CFLAGS)
7745 dnl ===================================================================
7746 dnl Identify the C++ library
7747 dnl ===================================================================
7749 AC_MSG_CHECKING([what the C++ library is])
7753 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7759 [CPP_LIBRARY=GLIBCXX
7760 cpp_library_name="GNU libstdc++"
7763 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7765 #ifndef _LIBCPP_VERSION
7770 cpp_library_name="LLVM libc++"
7771 AC_DEFINE([HAVE_LIBCPP])
7774 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7781 cpp_library_name="Microsoft"
7783 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
7784 AC_MSG_RESULT([$cpp_library_name])
7786 AC_SUBST([HAVE_LIBSTDCPP])
7787 AC_SUBST([HAVE_LIBCPP])
7789 if test -z "${LIBCPP_DEBUG+x}" -a -z "$CROSS_COMPILING" -a -n "$HAVE_LIBCPP" -a -n "$ENABLE_DBGUTIL"
7791 # Libc++ has two levels of debug mode, assertions mode enabled with -D_LIBCPP_DEBUG=0,
7792 # and actual debug mode enabled with -D_LIBCPP_DEBUG=1 (and starting with LLVM15
7793 # assertions mode will be separate and controlled by -D_LIBCPP_ENABLE_ASSERTIONS=1,
7794 # although there will be backwards compatibility).
7795 # Debug mode is supported by libc++ only if built for it, e.g. Mac libc++ isn't,
7796 # and there would be undefined references to debug functions.
7797 # Moreover std::to_string() has a bug (https://reviews.llvm.org/D125184).
7798 # So check if debug mode can be used and disable or downgrade it to assertions
7800 AC_MSG_CHECKING([if libc++ has a usable debug mode])
7803 AC_LINK_IFELSE([AC_LANG_SOURCE([[
7804 #define _LIBCPP_DEBUG 0 // only assertions
7812 ]])], [libcpp_debug_links=1])
7813 if test -n "$libcpp_debug_links"; then
7814 # we can use at least assertions, check if debug mode works
7815 AC_RUN_IFELSE([AC_LANG_SOURCE([[
7816 #define _LIBCPP_DEBUG 1 // debug mode
7819 int foo(const std::vector<int>& v) { return *v.begin(); }
7824 std::string s = "xxxxxxxxxxxxxxxxxxxxxxxxx" + std::to_string(10);
7825 return (foo(v) + s.size()) != 0 ? 0 : 1;
7829 LIBCPP_DEBUG=-D_LIBCPP_DEBUG=1
7831 [AC_MSG_RESULT(no, using only assertions)
7832 LIBCPP_DEBUG=-D_LIBCPP_DEBUG=0
7840 AC_SUBST([LIBCPP_DEBUG])
7842 dnl ===================================================================
7844 dnl ===================================================================
7845 AC_PATH_PROG(GPERF, gperf)
7846 if test -z "$GPERF"; then
7847 AC_MSG_ERROR([gperf not found but needed. Install it.])
7849 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
7850 GPERF=`cygpath -m $GPERF`
7852 AC_MSG_CHECKING([whether gperf is new enough])
7853 my_gperf_ver1=$($GPERF --version | head -n 1)
7854 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
7855 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
7856 if test "$my_gperf_ver3" -ge 301; then
7857 AC_MSG_RESULT([yes ($my_gperf_ver2)])
7859 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
7863 dnl ===================================================================
7864 dnl Check for system libcmis
7865 dnl ===================================================================
7866 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.6 >= 0.6.1],enabled)
7868 dnl ===================================================================
7870 dnl ===================================================================
7872 if test -z "${CXXFLAGS_CXX11+x}"; then
7873 AC_MSG_CHECKING([whether $CXX_BASE supports C++20])
7874 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
7875 if test "$with_latest_c__" = yes; then
7876 CXXFLAGS_CXX11=-std:c++latest
7878 CXXFLAGS_CXX11=-std:c++20
7880 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -permissive- -Zc:__cplusplus,preprocessor"
7881 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
7882 my_flags='-std=c++20 -std=c++2a'
7883 if test "$with_latest_c__" = yes; then
7884 my_flags="-std=c++26 -std=c++2c -std=c++23 -std=c++2b $my_flags"
7886 for flag in $my_flags; do
7887 if test "$COM" = MSC; then
7888 flag="-Xclang $flag"
7890 save_CXXFLAGS=$CXXFLAGS
7891 CXXFLAGS="$CXXFLAGS $flag -Werror"
7893 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7894 #include <algorithm>
7895 #include <functional>
7898 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
7899 std::sort(v.begin(), v.end(), fn);
7901 ]])],[CXXFLAGS_CXX11=$flag])
7903 CXXFLAGS=$save_CXXFLAGS
7904 if test -n "$CXXFLAGS_CXX11"; then
7909 if test -n "$CXXFLAGS_CXX11"; then
7910 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
7915 AC_SUBST(CXXFLAGS_CXX11)
7917 if test "$GCC" = "yes"; then
7918 save_CXXFLAGS=$CXXFLAGS
7919 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7921 CXXFLAGS=$save_CXXFLAGS
7922 AC_SUBST(ATOMIC_LIB)
7925 AC_MSG_CHECKING([whether $CXX_BASE supports C++11 without Language Defect 757])
7926 save_CXXFLAGS=$CXXFLAGS
7927 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7930 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7933 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
7949 a thinga[]={{0,0}, {1,1}};
7950 b thingb[]={{0,0}, {1,1}};
7951 size_t i = sizeof(sal_n_array_size(thinga));
7952 size_t j = sizeof(sal_n_array_size(thingb));
7953 return !(i != 0 && j != 0);
7955 ], [ AC_MSG_RESULT(yes) ],
7956 [ AC_MSG_ERROR(no)])
7958 CXXFLAGS=$save_CXXFLAGS
7960 HAVE_GCC_FNO_SIZED_DEALLOCATION=
7961 if test "$GCC" = yes; then
7962 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
7964 save_CXXFLAGS=$CXXFLAGS
7965 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
7966 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
7967 CXXFLAGS=$save_CXXFLAGS
7969 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
7970 AC_MSG_RESULT([yes])
7975 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
7977 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a constinit sorted vectors])
7979 save_CXXFLAGS=$CXXFLAGS
7980 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7981 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7982 #include <algorithm>
7983 #include <initializer_list>
7985 template<typename T> class S {
7989 constexpr S(std::initializer_list<T> i): v_(i) { std::sort(v_.begin(), v_.end()); }
7991 constinit S<int> s{3, 2, 1};
7993 AC_DEFINE([HAVE_CPP_CONSTINIT_SORTED_VECTOR],[1])
7994 AC_MSG_RESULT([yes])
7995 ], [AC_MSG_RESULT([no])])
7996 CXXFLAGS=$save_CXXFLAGS
7999 AC_MSG_CHECKING([whether $CXX_BASE implements C++ DR P1155R3])
8001 save_CXXFLAGS=$CXXFLAGS
8002 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
8003 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8004 struct S1 { S1(S1 &&); };
8006 S1 f(S2 s) { return s; }
8008 AC_DEFINE([HAVE_P1155R3],[1])
8009 AC_MSG_RESULT([yes])
8010 ], [AC_MSG_RESULT([no])])
8011 CXXFLAGS=$save_CXXFLAGS
8014 AC_MSG_CHECKING([whether $CXX_BASE supports C++20 std::atomic_ref])
8015 HAVE_CXX20_ATOMIC_REF=
8017 save_CXXFLAGS=$CXXFLAGS
8018 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
8019 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8022 std::atomic_ref<int> y(x);
8024 HAVE_CXX20_ATOMIC_REF=TRUE
8025 AC_MSG_RESULT([yes])
8026 ], [AC_MSG_RESULT([no])])
8027 CXXFLAGS=$save_CXXFLAGS
8029 AC_SUBST([HAVE_CXX20_ATOMIC_REF])
8031 dnl Supported since GCC 9 and Clang 10 (which each also started to support -Wdeprecated-copy, but
8032 dnl which is included in -Wextra anyway):
8033 HAVE_WDEPRECATED_COPY_DTOR=
8034 if test "$GCC" = yes; then
8035 AC_MSG_CHECKING([whether $CXX_BASE supports -Wdeprecated-copy-dtor])
8037 save_CXXFLAGS=$CXXFLAGS
8038 CXXFLAGS="$CXXFLAGS -Werror -Wdeprecated-copy-dtor"
8039 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
8040 HAVE_WDEPRECATED_COPY_DTOR=TRUE
8041 AC_MSG_RESULT([yes])
8042 ], [AC_MSG_RESULT([no])])
8043 CXXFLAGS=$save_CXXFLAGS
8046 AC_SUBST([HAVE_WDEPRECATED_COPY_DTOR])
8048 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
8049 dnl uninitialized warning for code like
8052 dnl boost::optional<OString> * g(bool b) {
8053 dnl boost::optional<OString> o;
8055 dnl return new boost::optional<OString>(o);
8058 dnl (as is e.g. present, in a slightly more elaborate form, in
8059 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
8060 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
8061 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
8062 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
8063 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=maybe-uninitialized])
8065 save_CXXFLAGS=$CXXFLAGS
8066 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
8067 if test "$ENABLE_OPTIMIZED" = TRUE; then
8068 CXXFLAGS="$CXXFLAGS -O2"
8070 CXXFLAGS="$CXXFLAGS -O0"
8072 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
8081 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
8082 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
8088 char stg[sizeof (S1)];
8096 ]])], [AC_MSG_RESULT([no])], [
8097 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
8098 AC_MSG_RESULT([yes])
8100 CXXFLAGS=$save_CXXFLAGS
8103 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
8105 dnl Check for <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87296#c5> "[8/9/10/11 Regression]
8106 dnl -Wstringop-overflow false positive due to using MEM_REF type of &MEM" (fixed in GCC 11), which
8107 dnl hits us e.g. with GCC 10 and --enable-optimized at
8109 dnl In file included from include/rtl/string.hxx:49,
8110 dnl from include/rtl/ustring.hxx:43,
8111 dnl from include/osl/file.hxx:35,
8112 dnl from include/codemaker/global.hxx:28,
8113 dnl from include/codemaker/options.hxx:23,
8114 dnl from codemaker/source/commoncpp/commoncpp.cxx:24:
8115 dnl In function ‘char* rtl::addDataHelper(char*, const char*, std::size_t)’,
8116 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,
8117 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,
8118 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,
8119 dnl inlined from ‘rtl::OString codemaker::cpp::scopedCppName(const rtl::OString&, bool)’ at codemaker/source/commoncpp/commoncpp.cxx:53:55:
8120 dnl include/rtl/stringconcat.hxx:78:15: error: writing 2 bytes into a region of size 1 [-Werror=stringop-overflow=]
8121 dnl 78 | memcpy( buffer, data, length );
8122 dnl | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
8123 HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=
8124 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
8125 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=stringop-overflow=])
8127 save_CXXFLAGS=$CXXFLAGS
8128 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wstringop-overflow"
8129 if test "$ENABLE_OPTIMIZED" = TRUE; then
8130 CXXFLAGS="$CXXFLAGS -O2"
8132 CXXFLAGS="$CXXFLAGS -O0"
8134 dnl Test code taken from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87296#c0>:
8135 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
8136 void fill(char const * begin, char const * end, char c);
8142 fill(c.ids, c.ids + sizeof(c.ids), '\0');
8143 __builtin_strncpy(c.username, "root", sizeof(c.username));
8145 ]])], [AC_MSG_RESULT([no])], [
8146 HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=TRUE
8147 AC_MSG_RESULT([yes])
8149 CXXFLAGS=$save_CXXFLAGS
8152 AC_SUBST([HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW])
8154 HAVE_DLLEXPORTINLINES=
8155 if test "$_os" = "WINNT"; then
8156 AC_MSG_CHECKING([whether $CXX_BASE supports -Zc:dllexportInlines-])
8158 save_CXXFLAGS=$CXXFLAGS
8159 CXXFLAGS="$CXXFLAGS -Werror -Zc:dllexportInlines-"
8160 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
8161 HAVE_DLLEXPORTINLINES=TRUE
8162 AC_MSG_RESULT([yes])
8163 ], [AC_MSG_RESULT([no])])
8164 CXXFLAGS=$save_CXXFLAGS
8167 AC_SUBST([HAVE_DLLEXPORTINLINES])
8169 dnl ===================================================================
8170 dnl CPU Intrinsics support - SSE, AVX
8171 dnl ===================================================================
8173 CXXFLAGS_INTRINSICS_SSE2=
8174 CXXFLAGS_INTRINSICS_SSSE3=
8175 CXXFLAGS_INTRINSICS_SSE41=
8176 CXXFLAGS_INTRINSICS_SSE42=
8177 CXXFLAGS_INTRINSICS_AVX=
8178 CXXFLAGS_INTRINSICS_AVX2=
8179 CXXFLAGS_INTRINSICS_AVX512=
8180 CXXFLAGS_INTRINSICS_AVX512F=
8181 CXXFLAGS_INTRINSICS_F16C=
8182 CXXFLAGS_INTRINSICS_FMA=
8184 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
8185 # GCC, Clang or Clang-cl (clang-cl + MSVC's -arch options don't work well together)
8192 flag_avx512="-mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd"
8193 flag_avx512f=-mavx512f
8197 # With MSVC using -arch is in fact not necessary for being able
8198 # to use CPU intrinsics, code using AVX512F intrinsics will compile
8199 # even if compiled with -arch:AVX, the -arch option really only affects
8200 # instructions generated for C/C++ code.
8201 # So use the matching same (or lower) -arch options, but only in order
8202 # to generate the best matching instructions for the C++ code surrounding
8204 # SSE2 is the default for x86/x64, so no need to specify the option.
8206 # No specific options for these, use the next lower.
8207 flag_ssse3="$flag_sse2"
8208 flag_sse41="$flag_sse2"
8209 flag_sse42="$flag_sse2"
8211 flag_avx2=-arch:AVX2
8212 flag_avx512=-arch:AVX512
8213 # Using -arch:AVX512 would enable more than just AVX512F, so use only AVX2.
8214 flag_avx512f=-arch:AVX2
8215 # No MSVC options for these.
8216 flag_f16c="$flag_sse2"
8217 flag_fma="$flag_sse2"
8220 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
8222 save_CXXFLAGS=$CXXFLAGS
8223 CXXFLAGS="$CXXFLAGS $flag_sse2"
8224 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8225 #include <emmintrin.h>
8227 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8228 c = _mm_xor_si128 (a, b);
8232 [can_compile_sse2=yes],
8233 [can_compile_sse2=no])
8235 CXXFLAGS=$save_CXXFLAGS
8236 AC_MSG_RESULT([${can_compile_sse2}])
8237 if test "${can_compile_sse2}" = "yes" ; then
8238 CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
8241 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
8243 save_CXXFLAGS=$CXXFLAGS
8244 CXXFLAGS="$CXXFLAGS $flag_ssse3"
8245 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8246 #include <tmmintrin.h>
8248 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8249 c = _mm_maddubs_epi16 (a, b);
8253 [can_compile_ssse3=yes],
8254 [can_compile_ssse3=no])
8256 CXXFLAGS=$save_CXXFLAGS
8257 AC_MSG_RESULT([${can_compile_ssse3}])
8258 if test "${can_compile_ssse3}" = "yes" ; then
8259 CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
8262 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
8264 save_CXXFLAGS=$CXXFLAGS
8265 CXXFLAGS="$CXXFLAGS $flag_sse41"
8266 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8267 #include <smmintrin.h>
8269 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8270 c = _mm_cmpeq_epi64 (a, b);
8274 [can_compile_sse41=yes],
8275 [can_compile_sse41=no])
8277 CXXFLAGS=$save_CXXFLAGS
8278 AC_MSG_RESULT([${can_compile_sse41}])
8279 if test "${can_compile_sse41}" = "yes" ; then
8280 CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
8283 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
8285 save_CXXFLAGS=$CXXFLAGS
8286 CXXFLAGS="$CXXFLAGS $flag_sse42"
8287 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8288 #include <nmmintrin.h>
8290 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8291 c = _mm_cmpgt_epi64 (a, b);
8295 [can_compile_sse42=yes],
8296 [can_compile_sse42=no])
8298 CXXFLAGS=$save_CXXFLAGS
8299 AC_MSG_RESULT([${can_compile_sse42}])
8300 if test "${can_compile_sse42}" = "yes" ; then
8301 CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
8304 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
8306 save_CXXFLAGS=$CXXFLAGS
8307 CXXFLAGS="$CXXFLAGS $flag_avx"
8308 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8309 #include <immintrin.h>
8311 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
8312 c = _mm256_xor_ps(a, b);
8316 [can_compile_avx=yes],
8317 [can_compile_avx=no])
8319 CXXFLAGS=$save_CXXFLAGS
8320 AC_MSG_RESULT([${can_compile_avx}])
8321 if test "${can_compile_avx}" = "yes" ; then
8322 CXXFLAGS_INTRINSICS_AVX="$flag_avx"
8325 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
8327 save_CXXFLAGS=$CXXFLAGS
8328 CXXFLAGS="$CXXFLAGS $flag_avx2"
8329 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8330 #include <immintrin.h>
8332 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
8333 c = _mm256_maddubs_epi16(a, b);
8337 [can_compile_avx2=yes],
8338 [can_compile_avx2=no])
8340 CXXFLAGS=$save_CXXFLAGS
8341 AC_MSG_RESULT([${can_compile_avx2}])
8342 if test "${can_compile_avx2}" = "yes" ; then
8343 CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
8346 AC_MSG_CHECKING([whether $CXX can compile AVX512 intrinsics])
8348 save_CXXFLAGS=$CXXFLAGS
8349 CXXFLAGS="$CXXFLAGS $flag_avx512"
8350 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8351 #include <immintrin.h>
8353 __m512i a = _mm512_loadu_si512(0);
8354 __m512d v1 = _mm512_load_pd(0);
8355 // https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=gcc/config/i386/avx512fintrin.h;h=23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2
8356 __m512d v2 = _mm512_abs_pd(v1);
8360 [can_compile_avx512=yes],
8361 [can_compile_avx512=no])
8363 CXXFLAGS=$save_CXXFLAGS
8364 AC_MSG_RESULT([${can_compile_avx512}])
8365 if test "${can_compile_avx512}" = "yes" ; then
8366 CXXFLAGS_INTRINSICS_AVX512="$flag_avx512"
8367 CXXFLAGS_INTRINSICS_AVX512F="$flag_avx512f"
8370 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
8372 save_CXXFLAGS=$CXXFLAGS
8373 CXXFLAGS="$CXXFLAGS $flag_f16c"
8374 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8375 #include <immintrin.h>
8377 __m128i a = _mm_set1_epi32 (0);
8379 c = _mm_cvtph_ps(a);
8383 [can_compile_f16c=yes],
8384 [can_compile_f16c=no])
8386 CXXFLAGS=$save_CXXFLAGS
8387 AC_MSG_RESULT([${can_compile_f16c}])
8388 if test "${can_compile_f16c}" = "yes" ; then
8389 CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
8392 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
8394 save_CXXFLAGS=$CXXFLAGS
8395 CXXFLAGS="$CXXFLAGS $flag_fma"
8396 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8397 #include <immintrin.h>
8399 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
8400 d = _mm256_fmadd_ps(a, b, c);
8404 [can_compile_fma=yes],
8405 [can_compile_fma=no])
8407 CXXFLAGS=$save_CXXFLAGS
8408 AC_MSG_RESULT([${can_compile_fma}])
8409 if test "${can_compile_fma}" = "yes" ; then
8410 CXXFLAGS_INTRINSICS_FMA="$flag_fma"
8413 AC_SUBST([CXXFLAGS_INTRINSICS_SSE2])
8414 AC_SUBST([CXXFLAGS_INTRINSICS_SSSE3])
8415 AC_SUBST([CXXFLAGS_INTRINSICS_SSE41])
8416 AC_SUBST([CXXFLAGS_INTRINSICS_SSE42])
8417 AC_SUBST([CXXFLAGS_INTRINSICS_AVX])
8418 AC_SUBST([CXXFLAGS_INTRINSICS_AVX2])
8419 AC_SUBST([CXXFLAGS_INTRINSICS_AVX512])
8420 AC_SUBST([CXXFLAGS_INTRINSICS_AVX512F])
8421 AC_SUBST([CXXFLAGS_INTRINSICS_F16C])
8422 AC_SUBST([CXXFLAGS_INTRINSICS_FMA])
8424 dnl ===================================================================
8425 dnl system stl sanity tests
8426 dnl ===================================================================
8427 if test "$_os" != "WINNT"; then
8431 save_CPPFLAGS="$CPPFLAGS"
8432 if test -n "$MACOSX_SDK_PATH"; then
8433 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
8436 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
8438 if test "$CPP_LIBRARY" = GLIBCXX; then
8439 dnl gcc#19664, gcc#22482, rhbz#162935
8440 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
8441 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
8442 AC_MSG_RESULT([$stlvisok])
8443 if test "$stlvisok" = "no"; then
8444 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
8448 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
8449 # when we don't make any dynamic libraries?
8450 if test "$DISABLE_DYNLOADING" = ""; then
8451 AC_MSG_CHECKING([if $CXX_BASE is -fvisibility-inlines-hidden safe (Clang bug 11250)])
8452 cat > conftestlib1.cc <<_ACEOF
8453 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
8454 struct S2: S1<int> { virtual ~S2(); };
8457 cat > conftestlib2.cc <<_ACEOF
8458 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
8459 struct S2: S1<int> { virtual ~S2(); };
8460 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
8462 gccvisinlineshiddenok=yes
8463 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
8464 gccvisinlineshiddenok=no
8466 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
8467 dnl known to not work with -z defs (unsetting which makes the test
8469 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
8470 if test "$COM_IS_CLANG" = TRUE; then
8471 for i in $CXX $CXXFLAGS; do
8474 my_linkflagsnoundefs=
8480 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
8481 gccvisinlineshiddenok=no
8486 AC_MSG_RESULT([$gccvisinlineshiddenok])
8487 if test "$gccvisinlineshiddenok" = "no"; then
8488 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
8492 AC_MSG_CHECKING([if $CXX_BASE has a visibility bug with class-level attributes (GCC bug 26905)])
8493 cat >visibility.cxx <<_ACEOF
8494 #pragma GCC visibility push(hidden)
8495 struct __attribute__ ((visibility ("default"))) TestStruct {
8498 __attribute__ ((visibility ("default"))) void TestFunc() {
8502 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
8507 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
8510 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
8522 rm -f visibility.s visibility.cxx
8524 AC_MSG_RESULT([$gccvisbroken])
8525 if test "$gccvisbroken" = "yes"; then
8526 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
8529 CPPFLAGS="$save_CPPFLAGS"
8531 AC_MSG_CHECKING([if CET endbranch is recognized])
8532 cat > endbr.s <<_ACEOF
8535 HAVE_ASM_END_BRANCH_INS_SUPPORT=
8536 if $CXX -c endbr.s -o endbr.o >/dev/null 2>&5; then
8537 AC_MSG_RESULT([yes])
8538 HAVE_ASM_END_BRANCH_INS_SUPPORT=TRUE
8542 rm -f endbr.s endbr.o
8543 AC_SUBST(HAVE_ASM_END_BRANCH_INS_SUPPORT)
8548 dnl ===================================================================
8550 dnl ===================================================================
8552 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
8553 if test "$GCC" = "yes"; then
8554 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-enforce-eh-specs])
8556 save_CXXFLAGS=$CXXFLAGS
8557 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
8558 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
8559 CXXFLAGS=$save_CXXFLAGS
8561 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
8562 AC_MSG_RESULT([yes])
8567 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
8569 dnl ===================================================================
8570 dnl Compiler plugins
8571 dnl ===================================================================
8574 # currently only Clang
8576 if test "$COM_IS_CLANG" != "TRUE"; then
8577 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
8578 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
8579 enable_compiler_plugins=no
8583 COMPILER_PLUGINS_COM_IS_CLANG=
8584 if test "$COM_IS_CLANG" = "TRUE"; then
8585 if test -n "$enable_compiler_plugins"; then
8586 compiler_plugins="$enable_compiler_plugins"
8587 elif test -n "$ENABLE_DBGUTIL"; then
8588 compiler_plugins=test
8592 if test "$compiler_plugins" != no -a "$my_apple_clang" != yes; then
8593 if test "$CLANGVER" -lt 120001; then
8594 if test "$compiler_plugins" = yes; then
8596 [Clang $CLANGVER is too old to build compiler plugins; need >= 12.0.1.])
8602 if test "$compiler_plugins" != "no"; then
8603 dnl The prefix where Clang resides, override to where Clang resides if
8604 dnl using a source build:
8605 if test -z "$CLANGDIR"; then
8606 CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $(printf '%s\n' $CXX | grep clang | head -n 1)))))
8608 # Assume Clang is self-built, but allow overriding COMPILER_PLUGINS_CXX to the compiler Clang was built with.
8609 if test -z "$COMPILER_PLUGINS_CXX"; then
8610 COMPILER_PLUGINS_CXX=[$(echo $CXX | sed -e 's/-fsanitize=[^ ]*//g')]
8612 clangbindir=$CLANGDIR/bin
8613 if test "$build_os" = "cygwin"; then
8614 clangbindir=$(cygpath -u "$clangbindir")
8616 AC_PATH_PROG(LLVM_CONFIG, llvm-config,[],"$clangbindir" $PATH)
8617 if test -n "$LLVM_CONFIG"; then
8618 COMPILER_PLUGINS_CXXFLAGS=$($LLVM_CONFIG --cxxflags)
8619 COMPILER_PLUGINS_LINKFLAGS=$($LLVM_CONFIG --ldflags --libs --system-libs | tr '\n' ' ')
8620 if test -z "$CLANGLIBDIR"; then
8621 CLANGLIBDIR=$($LLVM_CONFIG --libdir)
8623 # Try if clang is built from source (in which case its includes are not together with llvm includes).
8624 # src-root is [llvm-toplevel-src-dir]/llvm, clang is [llvm-toplevel-src-dir]/clang
8625 if $LLVM_CONFIG --src-root >/dev/null 2>&1; then
8626 clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
8627 if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d "$clangsrcdir/clang/include"; then
8628 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangsrcdir/clang/include"
8631 # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
8632 clangobjdir=$($LLVM_CONFIG --obj-root)
8633 if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
8634 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
8637 AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
8641 save_CPPFLAGS=$CPPFLAGS
8642 save_CXXFLAGS=$CXXFLAGS
8643 save_LDFLAGS=$LDFLAGS
8645 CXX=$COMPILER_PLUGINS_CXX
8646 CXXCPP="$COMPILER_PLUGINS_CXX -E"
8647 CPPFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
8648 CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
8649 AC_CHECK_HEADER(clang/Basic/SourceLocation.h,
8650 [COMPILER_PLUGINS=TRUE],
8652 if test "$compiler_plugins" = "yes"; then
8653 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
8655 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
8656 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
8659 dnl TODO: Windows doesn't use LO_CLANG_SHARED_PLUGINS for now, see corresponding TODO
8660 dnl comment in compilerplugins/Makefile-clang.mk:
8661 if test -n "$COMPILER_PLUGINS" && test "$_os" != "WINNT"; then
8663 AC_MSG_CHECKING([for clang libraries to use])
8664 if test -z "$CLANGTOOLLIBS"; then
8665 LIBS="-lclang-cpp $COMPILER_PLUGINS_LINKFLAGS"
8667 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
8668 [[ clang::FullSourceLoc().dump(); ]])
8669 ],[CLANGTOOLLIBS="$LIBS"],[])
8671 dnl If the above check for the combined -lclang-cpp failed, fall back to a hand-curated
8672 dnl list of individual -lclang* (but note that that list can become outdated over time,
8673 dnl see e.g. the since-reverted 5078591de9a0e65ca560a4f1913e90dfe95f66bf "CLANGTOOLLIBS
8674 dnl needs to include -lclangSupport now"):
8675 if test -z "$CLANGTOOLLIBS"; then
8676 LIBS="-lclangTooling -lclangFrontend -lclangDriver -lclangParse -lclangSema -lclangEdit \
8677 -lclangAnalysis -lclangAST -lclangLex -lclangSerialization -lclangBasic $COMPILER_PLUGINS_LINKFLAGS"
8679 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
8680 [[ clang::FullSourceLoc().dump(); ]])
8681 ],[CLANGTOOLLIBS="$LIBS"],[])
8683 AC_MSG_RESULT([$CLANGTOOLLIBS])
8684 if test -z "$CLANGTOOLLIBS"; then
8685 if test "$compiler_plugins" = "yes"; then
8686 AC_MSG_ERROR([Cannot find Clang libraries to build compiler plugins.])
8688 AC_MSG_WARN([Cannot find Clang libraries to build compiler plugins, plugins disabled])
8689 add_warning "Cannot find Clang libraries to build compiler plugins, plugins disabled."
8693 if test -n "$COMPILER_PLUGINS"; then
8694 if test -z "$CLANGSYSINCLUDE"; then
8695 if test -n "$LLVM_CONFIG"; then
8696 # Path to the clang system headers (no idea if there's a better way to get it).
8697 CLANGSYSINCLUDE=$($LLVM_CONFIG --libdir)/clang/$($LLVM_CONFIG --version | sed 's/git\|svn//')/include
8704 CPPFLAGS=$save_CPPFLAGS
8705 CXXFLAGS=$save_CXXFLAGS
8706 LDFLAGS=$save_LDFLAGS
8710 AC_MSG_CHECKING([whether the compiler for building compilerplugins is actually Clang])
8711 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
8717 [AC_MSG_RESULT([yes])
8718 COMPILER_PLUGINS_COM_IS_CLANG=TRUE],
8719 [AC_MSG_RESULT([no])])
8720 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
8723 if test "$enable_compiler_plugins" = "yes"; then
8724 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
8727 COMPILER_PLUGINS_ANALYZER_PCH=
8728 if test "$enable_compiler_plugins_analyzer_pch" != no; then
8729 COMPILER_PLUGINS_ANALYZER_PCH=TRUE
8731 AC_SUBST(COMPILER_PLUGINS)
8732 AC_SUBST(COMPILER_PLUGINS_ANALYZER_PCH)
8733 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
8734 AC_SUBST(COMPILER_PLUGINS_CXX)
8735 AC_SUBST(COMPILER_PLUGINS_CXXFLAGS)
8736 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
8737 AC_SUBST(COMPILER_PLUGINS_DEBUG)
8738 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
8740 AC_SUBST(CLANGLIBDIR)
8741 AC_SUBST(CLANGTOOLLIBS)
8742 AC_SUBST(CLANGSYSINCLUDE)
8744 # Plugin to help linker.
8745 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
8746 # This makes --enable-lto build with clang work.
8749 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
8750 AC_SUBST(HAVE_POSIX_FALLOCATE)
8752 JITC_PROCESSOR_TYPE=""
8753 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
8754 # IBMs JDK needs this...
8755 JITC_PROCESSOR_TYPE=6
8756 export JITC_PROCESSOR_TYPE
8758 AC_SUBST([JITC_PROCESSOR_TYPE])
8760 # Misc Windows Stuff
8761 AC_ARG_WITH(ucrt-dir,
8762 AS_HELP_STRING([--with-ucrt-dir],
8763 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
8764 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
8765 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
8766 Windows6.1-KB2999226-x64.msu
8767 Windows6.1-KB2999226-x86.msu
8768 Windows8.1-KB2999226-x64.msu
8769 Windows8.1-KB2999226-x86.msu
8770 Windows8-RT-KB2999226-x64.msu
8771 Windows8-RT-KB2999226-x86.msu
8772 A zip archive including those files is available from Microsoft site:
8773 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
8776 UCRT_REDISTDIR="$with_ucrt_dir"
8777 if test $_os = "WINNT"; then
8779 MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
8780 MSVC_DLLS="$msvcdlls"
8781 if echo "$msvcdllpath" | grep -q "VC143.CRT$"; then
8783 elif echo "$msvcdllpath" | grep -q "VC142.CRT$"; then
8785 elif echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
8788 for i in $PKGFORMAT; do
8789 if test "$i" = msi; then
8790 find_msms "$with_redist"
8791 if test -n "$msmdir"; then
8792 MSM_PATH=`win_short_path_for_make "$msmdir"`
8793 SCPDEFS="$SCPDEFS -DWITH_VC_REDIST=$with_redist"
8799 if test "$UCRT_REDISTDIR" = "no"; then
8800 dnl explicitly disabled
8803 PathFormat "$UCRT_REDISTDIR"
8804 UCRT_REDISTDIR="$formatted_path"
8805 UCRT_REDISTDIR_unix="$formatted_path_unix"
8806 if ! test -f "$UCRT_REDISTDIR_unix/Windows6.1-KB2999226-x64.msu" -a \
8807 -f "$UCRT_REDISTDIR_unix/Windows6.1-KB2999226-x86.msu" -a \
8808 -f "$UCRT_REDISTDIR_unix/Windows8.1-KB2999226-x64.msu" -a \
8809 -f "$UCRT_REDISTDIR_unix/Windows8.1-KB2999226-x86.msu" -a \
8810 -f "$UCRT_REDISTDIR_unix/Windows8-RT-KB2999226-x64.msu" -a \
8811 -f "$UCRT_REDISTDIR_unix/Windows8-RT-KB2999226-x86.msu"; then
8813 if test -n "$PKGFORMAT"; then
8814 for i in $PKGFORMAT; do
8817 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
8818 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
8827 AC_SUBST(UCRT_REDISTDIR)
8828 AC_SUBST(MSVC_DLL_PATH)
8833 dnl ===================================================================
8835 dnl ===================================================================
8836 if test "$ENABLE_JAVA" != ""; then
8838 # Windows-specific tests
8839 if test "$build_os" = "cygwin" -o -n "$WSL_ONLY_AS_HELPER"; then
8840 if test -z "$with_jdk_home"; then
8841 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
8842 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
8843 reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK" "CurrentVersion"
8844 if test -n "$regvalue"; then
8846 reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver" "JavaHome"
8847 with_jdk_home=$regvalue
8849 howfound="found automatically"
8851 howfound="you passed"
8853 PathFormat "$with_jdk_home"
8854 with_jdk_home="$formatted_path_unix"
8856 if ! test -f "$with_jdk_home/lib/jvm.lib" -a -f "$with_jdk_home/bin/java.exe"; then
8857 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option (or fix the path) pointing to a $WIN_HOST_BITS-bit JDK >= 8])
8859 with_java="java.exe"
8860 javacompiler="javac.exe"
8861 javadoc="javadoc.exe"
8864 # 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.
8865 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
8866 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
8867 with_jdk_home=`/usr/libexec/java_home`
8870 JAVA_HOME=; export JAVA_HOME
8871 if test -z "$with_jdk_home"; then
8872 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
8874 _java_path="$with_jdk_home/bin/$with_java"
8875 dnl Check if there is a Java interpreter at all.
8876 if test -x "$_java_path"; then
8877 JAVAINTERPRETER=$_java_path
8879 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
8883 dnl Check that the JDK found is correct architecture (at least 2 reasons to
8884 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
8885 dnl loaded by java to run JunitTests:
8886 if test "$build_os" = "cygwin" -a "$cross_compiling" != "yes"; then
8887 shortjdkhome=`cygpath -d "$with_jdk_home"`
8888 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
8889 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
8890 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
8891 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
8892 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
8893 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
8896 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
8897 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
8899 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
8900 elif test "$cross_compiling" != "yes"; then
8902 AARCH64|AXP|X86_64|IA64|POWERPC64|S390X|SPARC64|MIPS64|RISCV64|LOONGARCH64)
8903 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
8904 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
8905 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
8908 *) # assumption: everything else 32-bit
8909 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
8910 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
8911 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
8918 dnl ===================================================================
8920 dnl ===================================================================
8922 # Whether all the complexity here actually is needed any more or not, no idea.
8924 JDK_SECURITYMANAGER_DISALLOWED=
8926 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8928 AC_MSG_CHECKING([the installed JDK])
8929 if test -n "$JAVAINTERPRETER"; then
8930 dnl java -version sends output to stderr!
8931 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
8932 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8933 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
8934 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8935 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
8936 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8937 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
8938 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8942 dnl Sun JDK specific tests
8943 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
8944 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
8946 if test "$_jdk_ver" -lt 10800; then
8947 AC_MSG_ERROR([JDK is too old, you need at least 8 ($_jdk_ver < 10800)])
8949 dnl TODO: Presumably, the Security Manager will not merely be disallowed, but be
8950 dnl completely removed in some Java version > 18 (see
8951 dnl <https://openjdk.java.net/jeps/411> "Deprecate the Security Manager for Removal"):
8952 if test "$_jdk_ver" -ge 180000; then
8953 JDK_SECURITYMANAGER_DISALLOWED=TRUE
8956 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
8957 if test "$_os" = "WINNT"; then
8958 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
8960 AC_MSG_RESULT([found $JAVA_HOME (JDK $_jdk)])
8962 dnl Check whether the build Java supports modules
8963 if test "$_jdk_ver" -ge 90000; then
8966 AC_MSG_WARN([Modular jars will not be built. They need at least Java 9 ($_jdk_ver < 90000)])
8967 add_warning "Modular jars will not be built. They need at least Java 9 ($_jdk_ver < 90000)"
8970 # set to limit VM usage for JunitTests
8972 # set to limit VM usage for javac
8973 JAVACFLAGS=-J-Xmx128M
8976 AC_MSG_ERROR([Java not found. You need at least JDK 8])
8979 if test -z "$ENABLE_JAVA"; then
8983 elif test "$cross_compiling" = "yes"; then
8984 # Just assume compatibility of build and host JDK
8986 JAVAIFLAGS=$JAVAIFLAGS_FOR_BUILD
8990 dnl ===================================================================
8991 dnl Checks for javac
8992 dnl ===================================================================
8993 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8994 : ${JAVA_SOURCE_VER=8}
8995 : ${JAVA_TARGET_VER=8}
8996 if test -z "$with_jdk_home"; then
8997 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
8999 _javac_path="$with_jdk_home/bin/$javacompiler"
9000 dnl Check if there is a Java compiler at all.
9001 if test -x "$_javac_path"; then
9002 JAVACOMPILER=$_javac_path
9005 if test -z "$JAVACOMPILER"; then
9006 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
9008 if test "$build_os" = "cygwin"; then
9009 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
9010 JAVACOMPILER="${JAVACOMPILER}.exe"
9012 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
9016 dnl ===================================================================
9017 dnl Checks for javadoc
9018 dnl ===================================================================
9019 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
9020 if test -z "$with_jdk_home"; then
9021 AC_PATH_PROG(JAVADOC, $javadoc)
9023 _javadoc_path="$with_jdk_home/bin/$javadoc"
9024 dnl Check if there is a javadoc at all.
9025 if test -x "$_javadoc_path"; then
9026 JAVADOC=$_javadoc_path
9028 AC_PATH_PROG(JAVADOC, $javadoc)
9031 if test -z "$JAVADOC"; then
9032 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
9034 if test "$build_os" = "cygwin"; then
9035 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
9036 JAVADOC="${JAVADOC}.exe"
9038 JAVADOC=`win_short_path_for_make "$JAVADOC"`
9041 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
9042 JAVADOCISGJDOC="yes"
9046 AC_SUBST(JAVADOCISGJDOC)
9048 if test "$ENABLE_JAVA" != "" -a \( "$cross_compiling" != "yes" -o -n "$with_jdk_home" \); then
9049 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
9050 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
9051 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
9052 # try to recover first by looking whether we have an alternative
9053 # system as in Debian or newer SuSEs where following /usr/bin/javac
9054 # over /etc/alternatives/javac leads to the right bindir where we
9055 # just need to strip a bit away to get a valid JAVA_HOME
9056 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
9057 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
9058 # maybe only one level of symlink (e.g. on Mac)
9059 JAVA_HOME=$(readlink $JAVACOMPILER)
9060 if test "$(dirname $JAVA_HOME)" = "."; then
9061 # we've got no path to trim back
9066 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
9067 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
9068 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
9069 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
9071 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it...
9072 if test "$JAVA_HOME" != "/usr"; then
9073 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
9074 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
9075 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
9076 dnl Tiger already returns a JDK path...
9077 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
9079 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
9080 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
9081 dnl that checks which version to run
9082 if test -f "$JAVA_HOME"; then
9083 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
9088 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
9090 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
9091 if test -z "$JAVA_HOME"; then
9092 if test "x$with_jdk_home" = "x"; then
9093 cat > findhome.java <<_ACEOF
9094 [import java.io.File;
9098 public static void main(String args[])
9100 String jrelocation = System.getProperty("java.home");
9101 File jre = new File(jrelocation);
9102 System.out.println(jre.getParent());
9106 AC_MSG_CHECKING([if javac works])
9107 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
9108 AC_TRY_EVAL(javac_cmd)
9109 if test $? = 0 -a -f ./findhome.class; then
9110 AC_MSG_RESULT([javac works])
9112 echo "configure: javac test failed" >&5
9113 cat findhome.java >&5
9114 AC_MSG_ERROR([javac does not work - java projects will not build!])
9116 AC_MSG_CHECKING([if gij knows its java.home])
9117 JAVA_HOME=`$JAVAINTERPRETER findhome`
9118 if test $? = 0 -a "$JAVA_HOME" != ""; then
9119 AC_MSG_RESULT([$JAVA_HOME])
9121 echo "configure: java test failed" >&5
9122 cat findhome.java >&5
9123 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
9125 # clean-up after ourselves
9126 rm -f ./findhome.java ./findhome.class
9128 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
9132 # now check if $JAVA_HOME is really valid
9133 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
9134 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
9135 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
9136 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
9137 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
9138 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
9139 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
9140 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
9143 PathFormat "$JAVA_HOME"
9144 JAVA_HOME="$formatted_path_unix"
9147 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
9150 AC_MSG_CHECKING([for JAWT lib])
9151 if test "$_os" = WINNT; then
9152 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
9157 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
9158 JAVA_ARCH=$my_java_arch
9173 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
9174 JAVA_ARCH=$my_java_arch
9177 my_java_arch=sparcv9
9183 my_java_arch=$host_cpu
9186 # This is where JDK9 puts the library
9187 if test -e "$JAVA_HOME/lib/libjawt.so"; then
9188 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
9190 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
9192 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
9194 AC_MSG_RESULT([$JAWTLIB])
9198 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
9202 JAVAINC="-I$JAVA_HOME/include/win32"
9203 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
9207 if test -d "$JAVA_HOME/include/darwin"; then
9208 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
9210 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
9215 JAVAINC="-I$JAVA_HOME/include"
9216 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9220 JAVAINC="-I$JAVA_HOME/include"
9221 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
9222 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
9223 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
9224 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9228 JAVAINC="-I$JAVA_HOME/include"
9229 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
9230 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9234 JAVAINC="-I$JAVA_HOME/include"
9235 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
9236 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9240 JAVAINC="-I$JAVA_HOME/include"
9241 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
9242 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9246 JAVAINC="-I$JAVA_HOME/include"
9247 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
9248 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9252 JAVAINC="-I$JAVA_HOME/include"
9253 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
9254 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9258 SOLARINC="$SOLARINC $JAVAINC"
9260 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
9261 JAVA_HOME_FOR_BUILD=$JAVA_HOME
9262 JAVAIFLAGS_FOR_BUILD=$JAVAIFLAGS
9264 JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD=$JDK_SECURITYMANAGER_DISALLOWED
9267 AC_SUBST(JAVACFLAGS)
9268 AC_SUBST(JAVACOMPILER)
9269 AC_SUBST(JAVAINTERPRETER)
9270 AC_SUBST(JAVAIFLAGS)
9271 AC_SUBST(JAVAIFLAGS_FOR_BUILD)
9273 AC_SUBST(JAVA_HOME_FOR_BUILD)
9275 AC_SUBST(JDK_FOR_BUILD)
9276 AC_SUBST(JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD)
9277 AC_SUBST(JAVA_SOURCE_VER)
9278 AC_SUBST(JAVA_TARGET_VER)
9279 AC_SUBST(MODULAR_JAVA)
9282 dnl ===================================================================
9283 dnl Export file validation
9284 dnl ===================================================================
9285 AC_MSG_CHECKING([whether to enable export file validation])
9286 if test "$with_export_validation" != "no"; then
9287 if test -z "$ENABLE_JAVA"; then
9288 if test "$with_export_validation" = "yes"; then
9289 AC_MSG_ERROR([requested, but Java is disabled])
9291 AC_MSG_RESULT([no, as Java is disabled])
9293 elif ! test -d "${SRC_ROOT}/schema"; then
9294 if test "$with_export_validation" = "yes"; then
9295 AC_MSG_ERROR([requested, but schema directory is missing (it is excluded from tarballs)])
9297 AC_MSG_RESULT([no, schema directory is missing (it is excluded from tarballs)])
9300 AC_MSG_RESULT([yes])
9301 AC_DEFINE(HAVE_EXPORT_VALIDATION)
9303 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
9304 if test -z "$ODFVALIDATOR"; then
9305 # remember to download the ODF toolkit with validator later
9306 AC_MSG_NOTICE([no odfvalidator found, will download it])
9307 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
9308 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
9310 # and fetch name of odfvalidator jar name from download.lst
9311 ODFVALIDATOR_JAR=`$SED -n -e "s/^ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
9312 AC_SUBST(ODFVALIDATOR_JAR)
9314 if test -z "$ODFVALIDATOR_JAR"; then
9315 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
9318 if test "$build_os" = "cygwin"; then
9319 # In case of Cygwin it will be executed from Windows,
9320 # so we need to run bash and absolute path to validator
9321 # so instead of "odfvalidator" it will be
9322 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
9323 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
9325 ODFVALIDATOR="sh $ODFVALIDATOR"
9327 AC_SUBST(ODFVALIDATOR)
9330 AC_PATH_PROGS(OFFICEOTRON, officeotron)
9331 if test -z "$OFFICEOTRON"; then
9332 # remember to download the officeotron with validator later
9333 AC_MSG_NOTICE([no officeotron found, will download it])
9334 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
9335 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
9337 # and fetch name of officeotron jar name from download.lst
9338 OFFICEOTRON_JAR=`$SED -n -e "s/^OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
9339 AC_SUBST(OFFICEOTRON_JAR)
9341 if test -z "$OFFICEOTRON_JAR"; then
9342 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
9345 # check version of existing officeotron
9346 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
9347 if test 0"$OFFICEOTRON_VER" -lt 704; then
9348 AC_MSG_ERROR([officeotron too old])
9351 if test "$build_os" = "cygwin"; then
9352 # In case of Cygwin it will be executed from Windows,
9353 # so we need to run bash and absolute path to validator
9354 # so instead of "odfvalidator" it will be
9355 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
9356 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
9358 OFFICEOTRON="sh $OFFICEOTRON"
9361 AC_SUBST(OFFICEOTRON)
9366 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
9367 if test "$with_bffvalidator" != "no"; then
9368 AC_DEFINE(HAVE_BFFVALIDATOR)
9370 if test "$with_export_validation" = "no"; then
9371 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
9374 if test "$with_bffvalidator" = "yes"; then
9375 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
9377 BFFVALIDATOR="$with_bffvalidator"
9380 if test "$build_os" = "cygwin"; then
9381 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
9382 AC_MSG_RESULT($BFFVALIDATOR)
9384 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
9386 elif test -n "$BFFVALIDATOR"; then
9387 # We are not in Cygwin but need to run Windows binary with wine
9388 AC_PATH_PROGS(WINE, wine)
9390 # so swap in a shell wrapper that converts paths transparently
9391 BFFVALIDATOR_EXE="$BFFVALIDATOR"
9392 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
9393 AC_SUBST(BFFVALIDATOR_EXE)
9394 AC_MSG_RESULT($BFFVALIDATOR)
9396 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
9398 AC_SUBST(BFFVALIDATOR)
9403 dnl ===================================================================
9404 dnl Check for epm (not needed for Windows)
9405 dnl ===================================================================
9406 AC_MSG_CHECKING([whether to enable EPM for packing])
9407 if test "$enable_epm" = "yes"; then
9408 AC_MSG_RESULT([yes])
9409 if test "$_os" != "WINNT"; then
9410 if test $_os = Darwin; then
9412 elif test -n "$with_epm"; then
9415 AC_PATH_PROG(EPM, epm, no)
9417 if test "$EPM" = "no" -o "$EPM" = "internal"; then
9418 AC_MSG_NOTICE([EPM will be built.])
9419 BUILD_TYPE="$BUILD_TYPE EPM"
9420 EPM=${WORKDIR}/UnpackedTarball/epm/epm
9422 # Gentoo has some epm which is something different...
9423 AC_MSG_CHECKING([whether the found epm is the right epm])
9424 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
9425 AC_MSG_RESULT([yes])
9427 AC_MSG_ERROR([no. Install ESP Package Manager (https://jimjag.github.io/epm/) and/or specify the path to the right epm])
9429 AC_MSG_CHECKING([epm version])
9430 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
9431 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
9432 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
9433 AC_MSG_RESULT([OK, >= 3.7])
9435 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
9436 AC_MSG_ERROR([Install ESP Package Manager (https://jimjag.github.io/epm/) and/or specify the path to the right epm])
9441 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
9442 AC_MSG_CHECKING([for rpm])
9443 for a in "$RPM" rpmbuild rpm; do
9444 $a --usage >/dev/null 2> /dev/null
9445 if test $? -eq 0; then
9449 $a --version >/dev/null 2> /dev/null
9450 if test $? -eq 0; then
9456 if test -z "$RPM"; then
9457 AC_MSG_ERROR([not found])
9458 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
9459 RPM_PATH=`command -v $RPM`
9460 AC_MSG_RESULT([$RPM_PATH])
9461 SCPDEFS="$SCPDEFS -DWITH_RPM"
9463 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
9466 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
9467 AC_PATH_PROG(DPKG, dpkg, no)
9468 if test "$DPKG" = "no"; then
9469 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
9472 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
9473 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
9474 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
9475 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
9476 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
9477 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
9478 AC_MSG_RESULT([yes])
9481 if echo "$PKGFORMAT" | $GREP -q rpm; then
9483 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
9484 add_warning "the rpms will need to be installed with --nodeps"
9488 AC_MSG_WARN([the ${_pt}s will not be relocatable])
9489 add_warning "the ${_pt}s will not be relocatable"
9490 AC_MSG_WARN([if you want to make sure installation without --nodeps and
9491 relocation will work, you need to patch your epm with the
9492 patch in epm/epm-3.7.patch or build with
9493 --with-epm=internal which will build a suitable epm])
9498 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
9499 AC_PATH_PROG(PKGMK, pkgmk, no)
9500 if test "$PKGMK" = "no"; then
9501 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
9508 for i in $PKGFORMAT; do
9510 bsd | deb | pkg | rpm | native | portable)
9512 [--with-package-format='$PKGFORMAT' requires --enable-epm])
9522 if test "$enable_lotuswordpro" = "yes"; then
9525 AC_SUBST(ENABLE_LWP)
9527 dnl ===================================================================
9528 dnl Check for building ODK
9529 dnl ===================================================================
9530 AC_MSG_CHECKING([whether to build the ODK])
9531 if test "$enable_odk" = yes; then
9532 if test "$DISABLE_DYNLOADING" = TRUE; then
9533 AC_MSG_ERROR([can't build ODK for --disable-dynamic-loading builds])
9535 AC_MSG_RESULT([yes])
9536 BUILD_TYPE="$BUILD_TYPE ODK"
9541 if test "$enable_odk" != yes; then
9544 if test "$with_doxygen" = no; then
9545 AC_MSG_CHECKING([for doxygen])
9549 if test "$with_doxygen" = yes; then
9550 AC_PATH_PROG([DOXYGEN], [doxygen])
9551 if test -z "$DOXYGEN"; then
9552 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
9554 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
9555 if ! dot -V 2>/dev/null; then
9556 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
9560 AC_MSG_CHECKING([for doxygen])
9561 PathFormat "$with_doxygen"
9562 DOXYGEN="$formatted_path_unix"
9563 AC_MSG_RESULT([$formatted_path])
9565 if test -n "$DOXYGEN"; then
9566 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
9567 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
9568 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
9569 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
9572 if test -n "$WSL_ONLY_AS_HELPER"; then
9573 dnl what really should be tested is whether it is doxygen from windows-realm
9574 dnl i.e. one that runs on the windows-side and deals with windows-pathnames
9575 dnl using doxygen from wsl container would be possible, but there's a performance
9576 dnl penalty when accessing the files outside the container
9577 AC_MSG_CHECKING([whether doxygen is a windows executable])
9578 if $(file "$DOXYGEN" | grep -q "PE32"); then
9579 AC_MSG_RESULT([yes])
9582 AC_MSG_ERROR([please provide a path to a windows version of doxygen or use --without-doxygen])
9589 dnl ==================================================================
9591 dnl ==================================================================
9592 AC_MSG_CHECKING([whether to enable fuzzers])
9593 if test "$enable_fuzzers" != yes; then
9596 if test -z $LIB_FUZZING_ENGINE; then
9597 AC_MSG_ERROR(['LIB_FUZZING_ENGINE' must be set when using --enable-fuzzers. Examples include '-fsanitize=fuzzer'.])
9599 AC_MSG_RESULT([yes])
9600 ENABLE_FUZZERS="TRUE"
9601 AC_DEFINE([ENABLE_FUZZERS],1)
9602 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9604 AC_SUBST(LIB_FUZZING_ENGINE)
9606 dnl ===================================================================
9607 dnl Check for system zlib
9608 dnl ===================================================================
9609 if test "$with_system_zlib" = "auto"; then
9612 with_system_zlib="$with_system_libs"
9615 if test "$enable_fuzzers" != "yes"; then
9616 with_system_zlib=yes
9624 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
9625 dnl and has no pkg-config for it at least on some tinderboxes,
9626 dnl so leaving that out for now
9627 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
9628 AC_MSG_CHECKING([which zlib to use])
9629 if test "$with_system_zlib" = "yes"; then
9630 AC_MSG_RESULT([external])
9632 AC_CHECK_HEADER(zlib.h, [],
9633 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
9634 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
9635 [AC_MSG_ERROR(zlib not found or functional)], [])
9637 AC_MSG_RESULT([internal])
9639 BUILD_TYPE="$BUILD_TYPE ZLIB"
9640 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
9641 if test "$COM" = "MSC"; then
9642 ZLIB_LIBS='$(gb_StaticLibrary_WORKDIR)/zlib.lib'
9644 ZLIB_LIBS='-L$(gb_StaticLibrary_WORKDIR) -lzlib'
9647 AC_SUBST(ZLIB_CFLAGS)
9649 AC_SUBST(SYSTEM_ZLIB)
9651 dnl ===================================================================
9652 dnl Check for system jpeg
9653 dnl ===================================================================
9654 AC_MSG_CHECKING([which libjpeg to use])
9655 if test "$with_system_jpeg" = "yes"; then
9656 AC_MSG_RESULT([external])
9658 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
9659 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
9660 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
9661 [AC_MSG_ERROR(jpeg library not found or functional)], [])
9664 AC_MSG_RESULT([internal, libjpeg-turbo])
9665 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
9668 x86_64 | amd64 | i*86 | x86 | ia32)
9669 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
9670 if test -z "$NASM" -a "$build_os" = "cygwin"; then
9671 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
9672 NASM="$LODE_HOME/opt/bin/nasm"
9673 elif test -x "/opt/lo/bin/nasm"; then
9674 NASM="/opt/lo/bin/nasm"
9678 if test -n "$NASM"; then
9679 AC_MSG_CHECKING([for object file format of host system])
9681 cygwin* | mingw* | pw32* | wsl*)
9691 msdosdjgpp* | go32*)
9694 os2-emx*) # not tested
9695 objfmt='MSOMF' # obj
9697 linux*coff* | linux*oldld*)
9713 kfreebsd* | freebsd* | netbsd* | openbsd*)
9714 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
9727 solaris* | sunos* | sysv* | sco*)
9737 darwin* | rhapsody* | nextstep* | openstep* | macos*)
9752 AC_MSG_RESULT([$objfmt])
9753 if test "$objfmt" = 'ELF ?'; then
9755 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
9758 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
9760 MSOMF) NAFLAGS='-fobj -DOBJ32 -DPIC';;
9761 Win32-COFF) NAFLAGS='-fwin32 -DWIN32 -DPIC';;
9762 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__ -DPIC';;
9763 COFF) NAFLAGS='-fcoff -DCOFF -DPIC';;
9764 a.out) NAFLAGS='-faout -DAOUT -DPIC';;
9765 BSD-a.out) NAFLAGS='-faoutb -DAOUT -DPIC';;
9766 ELF) NAFLAGS='-felf -DELF -DPIC';;
9767 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__ -DPIC';;
9768 RDF) NAFLAGS='-frdf -DRDF -DPIC';;
9769 Mach-O) NAFLAGS='-fmacho -DMACHO -DPIC';;
9770 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__ -DPIC';;
9772 AC_MSG_RESULT([$NAFLAGS])
9774 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
9775 cat > conftest.asm << EOF
9776 [%line __oline__ "configure"
9784 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
9785 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
9788 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
9789 cat conftest.asm >&AS_MESSAGE_LOG_FD
9792 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
9798 if test -z "$NASM"; then
9800 ****************************************************************************
9801 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
9805 if test "$build_os" = "cygwin"; then
9807 install a pre-compiled binary for Win32
9809 mkdir -p /opt/lo/bin
9811 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
9814 or get and install one from https://www.nasm.us/
9816 Then re-run autogen.sh
9818 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
9819 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`command -v nasm\` finds it.
9824 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/main/BUILDING.md
9828 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
9829 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
9837 AC_SUBST(LIBJPEG_CFLAGS)
9838 AC_SUBST(LIBJPEG_LIBS)
9839 AC_SUBST(SYSTEM_LIBJPEG)
9841 dnl ===================================================================
9842 dnl Check for system clucene
9843 dnl ===================================================================
9844 libo_CHECK_SYSTEM_MODULE([clucene],[CLUCENE],[libclucene-core])
9845 if test "$SYSTEM_CLUCENE" = TRUE; then
9847 save_CXXFLAGS=$CXXFLAGS
9848 save_CPPFLAGS=$CPPFLAGS
9849 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
9850 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
9851 dnl https://sourceforge.net/p/clucene/bugs/200/
9852 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
9853 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
9854 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
9855 CXXFLAGS=$save_CXXFLAGS
9856 CPPFLAGS=$save_CPPFLAGS
9858 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
9861 dnl ===================================================================
9862 dnl Check for system expat
9863 dnl ===================================================================
9864 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
9866 dnl ===================================================================
9867 dnl Check for system xmlsec
9868 dnl ===================================================================
9869 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.35])
9871 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
9872 if test "$enable_eot" = "yes"; then
9874 AC_DEFINE([ENABLE_EOT])
9875 AC_MSG_RESULT([yes])
9877 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
9882 AC_SUBST([ENABLE_EOT])
9884 dnl ===================================================================
9885 dnl Check for DLP libs
9886 dnl ===================================================================
9887 REVENGE_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/librevenge/inc"
9888 AS_IF([test "$COM" = "MSC"],
9889 [librevenge_libdir='$(gb_Library_DLLDIR)'],
9890 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
9892 REVENGE_LIBS_internal="-L${librevenge_libdir} -lrevenge-0.0"
9893 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1])
9895 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
9897 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
9899 WPD_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/libwpd/inc"
9900 AS_IF([test "$COM" = "MSC"],
9901 [libwpd_libdir='$(gb_Library_DLLDIR)'],
9902 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
9904 WPD_LIBS_internal="-L${libwpd_libdir} -lwpd-0.10"
9905 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10])
9907 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
9909 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
9910 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.14])
9912 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
9914 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
9916 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
9918 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.21])
9919 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.21])
9921 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
9922 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.10])
9924 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
9926 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
9927 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
9929 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
9931 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
9933 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
9935 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
9937 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
9938 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.7])
9940 dnl ===================================================================
9941 dnl Check for system lcms2
9942 dnl ===================================================================
9943 if test "$with_system_lcms2" != "yes"; then
9946 LCMS2_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/lcms2/include"
9947 LCMS2_LIBS_internal="-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"
9948 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2])
9949 if test "$GCC" = "yes"; then
9950 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
9952 if test "$COM" = "MSC"; then # override the above
9953 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
9956 dnl ===================================================================
9957 dnl Check for system cppunit
9958 dnl ===================================================================
9959 if test "$_os" != "Android" ; then
9960 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
9963 dnl ===================================================================
9964 dnl Check whether freetype is available
9966 dnl FreeType has 3 different kinds of versions
9967 dnl * release, like 2.4.10
9968 dnl * libtool, like 13.0.7 (this what pkg-config returns)
9970 dnl FreeType's docs/VERSION.DLL provides a table mapping between the three
9973 dnl When the minimal version is at least 2.8.1, remove Skia's check down below.
9974 dnl ===================================================================
9975 FREETYPE_CFLAGS_internal="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
9976 if test "x$ac_config_site_64bit_host" = xYES; then
9977 FREETYPE_LIBS_internal="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
9979 FREETYPE_LIBS_internal="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
9981 libo_CHECK_SYSTEM_MODULE([freetype],[FREETYPE],[freetype2 >= 9.9.3],,system,TRUE)
9983 # ===================================================================
9984 # Check for system libxslt
9985 # to prevent incompatibilities between internal libxml2 and external libxslt,
9986 # or vice versa, use with_system_libxml here
9987 # ===================================================================
9988 if test "$with_system_libxml" = "auto"; then
9991 with_system_libxml="$with_system_libs"
9994 with_system_libxml=no
9997 if test "$enable_fuzzers" != "yes"; then
9998 with_system_libxml=yes
10000 with_system_libxml=no
10006 AC_MSG_CHECKING([which libxslt to use])
10007 if test "$with_system_libxml" = "yes"; then
10008 AC_MSG_RESULT([external])
10009 SYSTEM_LIBXSLT=TRUE
10010 if test "$_os" = "Darwin"; then
10011 dnl make sure to use SDK path
10012 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
10013 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
10014 dnl omit -L/usr/lib
10015 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
10016 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
10018 PKG_CHECK_MODULES(LIBXSLT, libxslt)
10019 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10020 FilterLibs "${LIBXSLT_LIBS}"
10021 LIBXSLT_LIBS="${filteredlibs}"
10022 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
10023 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10024 FilterLibs "${LIBEXSLT_LIBS}"
10025 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
10028 dnl Check for xsltproc
10029 AC_PATH_PROG(XSLTPROC, xsltproc, no)
10030 if test "$XSLTPROC" = "no"; then
10031 AC_MSG_ERROR([xsltproc is required])
10034 AC_MSG_RESULT([internal])
10036 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
10038 AC_SUBST(SYSTEM_LIBXSLT)
10039 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
10040 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
10042 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
10044 AC_SUBST(LIBEXSLT_CFLAGS)
10045 AC_SUBST(LIBEXSLT_LIBS)
10046 AC_SUBST(LIBXSLT_CFLAGS)
10047 AC_SUBST(LIBXSLT_LIBS)
10050 # ===================================================================
10051 # Check for system libxml
10052 # ===================================================================
10053 AC_MSG_CHECKING([which libxml to use])
10054 if test "$with_system_libxml" = "yes"; then
10055 AC_MSG_RESULT([external])
10057 if test "$_os" = "Darwin"; then
10058 dnl make sure to use SDK path
10059 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
10060 dnl omit -L/usr/lib
10061 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
10062 elif test $_os = iOS; then
10063 dnl make sure to use SDK path
10064 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
10065 LIBXML_CFLAGS="-I$usr/include/libxml2"
10066 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
10068 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
10069 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10070 FilterLibs "${LIBXML_LIBS}"
10071 LIBXML_LIBS="${filteredlibs}"
10074 dnl Check for xmllint
10075 AC_PATH_PROG(XMLLINT, xmllint, no)
10076 if test "$XMLLINT" = "no"; then
10077 AC_MSG_ERROR([xmllint is required])
10080 AC_MSG_RESULT([internal])
10082 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
10083 if test "$COM" = "MSC"; then
10084 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
10086 if test "$COM" = "MSC"; then
10087 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
10089 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
10090 if test "$DISABLE_DYNLOADING" = TRUE; then
10091 LIBXML_LIBS="$LIBXML_LIBS -lm"
10094 BUILD_TYPE="$BUILD_TYPE LIBXML2"
10096 AC_SUBST(SYSTEM_LIBXML)
10097 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
10098 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
10100 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
10101 AC_SUBST(LIBXML_CFLAGS)
10102 AC_SUBST(LIBXML_LIBS)
10105 # =====================================================================
10106 # Checking for a Python interpreter with version >= 3.3.
10107 # Optionally user can pass an option to configure, i. e.
10108 # ./configure PYTHON=/usr/bin/python
10109 # =====================================================================
10110 if test $_os = Darwin -a "$enable_python" != no -a "$enable_python" != fully-internal -a "$enable_python" != internal -a "$enable_python" != system; then
10111 # Only allowed choices for macOS are 'no', 'internal' (default), and 'fully-internal'
10112 # unless PYTHON is defined as above which allows 'system'
10113 enable_python=internal
10115 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
10116 if test -n "$PYTHON"; then
10117 PYTHON_FOR_BUILD=$PYTHON
10119 # This allows a lack of system python with no error, we use internal one in that case.
10120 AM_PATH_PYTHON([3.3],, [:])
10121 # Clean PYTHON_VERSION checked below if cross-compiling
10123 if test "$PYTHON" != ":"; then
10124 PYTHON_FOR_BUILD=$PYTHON
10129 # Checks for Python to use for Pyuno
10130 AC_MSG_CHECKING([which Python to use for Pyuno])
10131 case "$enable_python" in
10133 if test -z "$PYTHON_FOR_BUILD" -a "$cross_compiling" != yes; then
10134 # Python is required to build LibreOffice. In theory we could separate the build-time Python
10135 # requirement from the choice whether to include Python stuff in the installer, but why
10137 AC_MSG_ERROR([Python is required at build time.])
10140 AC_MSG_RESULT([none])
10143 if test "$DISABLE_SCRIPTING" = TRUE; then
10144 if test -z "$PYTHON_FOR_BUILD" -a "$cross_compiling" != yes; then
10145 AC_MSG_ERROR([Python support can't be disabled without cross-compiling or a system python.])
10147 AC_MSG_RESULT([none, overridden by --disable-scripting])
10149 elif test $build_os = cygwin -o $build_os = wsl; then
10150 dnl When building on Windows we don't attempt to use any installed
10151 dnl "system" Python.
10152 AC_MSG_RESULT([fully internal])
10153 enable_python=internal
10154 elif test "$cross_compiling" = yes; then
10155 AC_MSG_RESULT([system])
10156 enable_python=system
10158 # Unset variables set by the above AM_PATH_PYTHON so that
10159 # we actually do check anew.
10161 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
10162 AM_PATH_PYTHON([3.3],, [:])
10163 AC_MSG_CHECKING([which Python to use for Pyuno])
10164 if test "$PYTHON" = ":"; then
10165 if test -z "$PYTHON_FOR_BUILD"; then
10166 AC_MSG_RESULT([fully internal])
10168 AC_MSG_RESULT([internal])
10170 enable_python=internal
10172 AC_MSG_RESULT([system])
10173 enable_python=system
10178 AC_MSG_RESULT([internal])
10181 AC_MSG_RESULT([fully internal])
10182 enable_python=internal
10185 AC_MSG_RESULT([system])
10186 if test "$_os" = Darwin -a -z "$PYTHON"; then
10187 AC_MSG_ERROR([--enable-python=system doesn't work on macOS because the version provided is obsolete])
10191 AC_MSG_ERROR([Incorrect --enable-python option])
10195 if test $enable_python != no; then
10196 BUILD_TYPE="$BUILD_TYPE PYUNO"
10199 if test $enable_python = system; then
10200 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
10201 # Fallback: Accept these in the environment, or as set above
10204 elif test "$cross_compiling" != yes; then
10205 # Unset variables set by the above AM_PATH_PYTHON so that
10206 # we actually do check anew.
10207 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
10208 # This causes an error if no python command is found
10209 AM_PATH_PYTHON([3.3])
10210 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
10211 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
10212 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
10213 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
10214 if test -z "$PKG_CONFIG"; then
10215 PYTHON_CFLAGS="-I$python_include"
10216 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
10217 elif $PKG_CONFIG --exists python-$python_version-embed; then
10218 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
10219 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
10220 elif $PKG_CONFIG --exists python-$python_version; then
10221 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
10222 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
10224 PYTHON_CFLAGS="-I$python_include"
10225 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
10227 FilterLibs "${PYTHON_LIBS}"
10228 PYTHON_LIBS="${filteredlibs}"
10230 dnl How to find out the cross-compilation Python installation path?
10231 AC_MSG_CHECKING([for python version])
10232 AS_IF([test -n "$PYTHON_VERSION"],
10233 [AC_MSG_RESULT([$PYTHON_VERSION])],
10234 [AC_MSG_RESULT([not found])
10235 AC_MSG_ERROR([no usable python found])])
10236 test -n "$PYTHON_CFLAGS" && break
10239 dnl Check if the headers really work
10240 save_CPPFLAGS="$CPPFLAGS"
10241 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
10242 AC_CHECK_HEADER(Python.h)
10243 CPPFLAGS="$save_CPPFLAGS"
10245 # let the PYTHON_FOR_BUILD match the same python installation that
10246 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
10247 # better for PythonTests.
10248 PYTHON_FOR_BUILD=$PYTHON
10251 if test "$with_lxml" != no; then
10252 if test -z "$PYTHON_FOR_BUILD"; then
10255 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
10258 if test "$cross_compiling" != yes ; then
10259 BUILD_TYPE="$BUILD_TYPE LXML"
10264 AC_MSG_CHECKING([for python lxml])
10265 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
10266 AC_MSG_RESULT([yes])
10270 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
10273 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
10274 if test -n ${SYSTEM_LIBXSLT} -o -n ${SYSTEM_LIBXML}; then
10275 AC_MSG_RESULT([no, and no system libxml/libxslt, gla11y will only report widget classes and ids])
10277 BUILD_TYPE="$BUILD_TYPE LXML"
10278 AC_MSG_RESULT([no, using internal lxml])
10281 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
10289 if test \( "$cross_compiling" = yes -a -z "$PYTHON_FOR_BUILD" \) -o "$enable_python" = internal; then
10291 PYTHON_VERSION_MAJOR=3
10292 PYTHON_VERSION_MINOR=10
10293 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.14
10294 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
10295 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
10297 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
10299 # Embedded Python dies without Home set
10300 if test "$HOME" = ""; then
10305 dnl By now enable_python should be "system", "internal" or "no"
10306 case $enable_python in
10310 if test "x$ac_cv_header_Python_h" != "xyes"; then
10311 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
10315 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
10316 AC_MSG_CHECKING([for correct python library version])
10317 AC_RUN_IFELSE([AC_LANG_SOURCE([[
10318 #include <Python.h>
10320 int main(int argc, char **argv) {
10321 if ((PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
10324 ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3])],[AC_MSG_RESULT([skipped; cross-compiling])])
10327 dnl FIXME Check if the Python library can be linked with, too?
10331 BUILD_TYPE="$BUILD_TYPE PYTHON"
10332 if test "$OS" = LINUX -o "$OS" = WNT ; then
10333 BUILD_TYPE="$BUILD_TYPE LIBFFI"
10337 DISABLE_PYTHON=TRUE
10341 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
10345 AC_SUBST(DISABLE_PYTHON)
10346 AC_SUBST(SYSTEM_PYTHON)
10347 AC_SUBST(PYTHON_CFLAGS)
10348 AC_SUBST(PYTHON_FOR_BUILD)
10349 AC_SUBST(PYTHON_LIBS)
10350 AC_SUBST(PYTHON_VERSION)
10351 AC_SUBST(PYTHON_VERSION_MAJOR)
10352 AC_SUBST(PYTHON_VERSION_MINOR)
10354 AC_MSG_CHECKING([whether to build LibreLogo])
10355 case "$enable_python" in
10357 AC_MSG_RESULT([no; Python disabled])
10360 if test "${enable_librelogo}" = "no"; then
10361 AC_MSG_RESULT([no])
10363 AC_MSG_RESULT([yes])
10364 BUILD_TYPE="${BUILD_TYPE} LIBRELOGO"
10365 AC_DEFINE([ENABLE_LIBRELOGO],1)
10369 AC_SUBST(ENABLE_LIBRELOGO)
10375 AC_MSG_CHECKING([whether to build the MariaDB/MySQL SDBC driver])
10376 if test "x$enable_mariadb_sdbc" != "xno" -a "$enable_mpl_subset" != "yes"; then
10377 ENABLE_MARIADBC=TRUE
10378 AC_MSG_RESULT([yes])
10379 BUILD_TYPE="$BUILD_TYPE MARIADBC"
10381 AC_MSG_RESULT([no])
10383 AC_SUBST(ENABLE_MARIADBC)
10384 AC_SUBST(MARIADBC_MAJOR)
10385 AC_SUBST(MARIADBC_MINOR)
10386 AC_SUBST(MARIADBC_MICRO)
10388 if test "$ENABLE_MARIADBC" = "TRUE"; then
10389 dnl ===================================================================
10390 dnl Check for system MariaDB
10391 dnl ===================================================================
10393 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
10394 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
10397 AC_MSG_CHECKING([which MariaDB to use])
10398 if test "$with_system_mariadb" = "yes"; then
10399 AC_MSG_RESULT([external])
10400 SYSTEM_MARIADB_CONNECTOR_C=TRUE
10401 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
10402 if test -z "$MARIADBCONFIG"; then
10403 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
10404 if test -z "$MARIADBCONFIG"; then
10405 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
10406 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
10409 AC_MSG_CHECKING([MariaDB version])
10410 MARIADB_VERSION=`$MARIADBCONFIG --version`
10411 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
10412 if test "$MARIADB_MAJOR" -ge "5"; then
10413 AC_MSG_RESULT([OK])
10415 AC_MSG_ERROR([too old, use 5.0.x or later])
10417 AC_MSG_CHECKING([for MariaDB Client library])
10418 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
10419 if test "$COM_IS_CLANG" = TRUE; then
10420 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
10422 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
10423 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
10424 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
10426 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
10427 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
10428 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
10429 | sed -e 's|/lib64/|/lib/|')
10431 FilterLibs "${MARIADB_LIBS}"
10432 MARIADB_LIBS="${filteredlibs}"
10433 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
10434 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
10435 if test "$enable_bundle_mariadb" = "yes"; then
10436 AC_MSG_RESULT([yes])
10437 BUNDLE_MARIADB_CONNECTOR_C=TRUE
10438 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
10440 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
10442 /g' | grep -E '(mysqlclient|mariadb)')
10443 if test "$_os" = "Darwin"; then
10444 LIBMARIADB=${LIBMARIADB}.dylib
10445 if test "$with_gssapi" != "no"; then
10448 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10449 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10453 elif test "$_os" = "WINNT"; then
10454 LIBMARIADB=${LIBMARIADB}.dll
10456 LIBMARIADB=${LIBMARIADB}.so
10457 if test "$with_gssapi" != "no"; then
10460 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10461 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10466 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
10467 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
10468 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
10469 AC_MSG_RESULT([found.])
10470 PathFormat "$LIBMARIADB_PATH"
10471 LIBMARIADB_PATH="$formatted_path"
10473 AC_MSG_ERROR([not found.])
10476 AC_MSG_RESULT([no])
10477 BUNDLE_MARIADB_CONNECTOR_C=
10480 AC_MSG_RESULT([internal])
10481 SYSTEM_MARIADB_CONNECTOR_C=
10482 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
10483 MARIADB_LIBS='-L$(gb_StaticLibrary_WORKDIR) -lmariadb-connector-c'
10484 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
10487 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
10488 AC_SUBST(MARIADB_CFLAGS)
10489 AC_SUBST(MARIADB_LIBS)
10490 AC_SUBST(LIBMARIADB)
10491 AC_SUBST(LIBMARIADB_PATH)
10492 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
10495 dnl ===================================================================
10496 dnl Check for system hsqldb
10497 dnl ===================================================================
10498 if test "$with_java" != "no" -a "$cross_compiling" != "yes"; then
10499 AC_MSG_CHECKING([which hsqldb to use])
10500 if test "$with_system_hsqldb" = "yes"; then
10501 AC_MSG_RESULT([external])
10503 if test -z $HSQLDB_JAR; then
10504 HSQLDB_JAR=/usr/share/java/hsqldb.jar
10506 if ! test -f $HSQLDB_JAR; then
10507 AC_MSG_ERROR(hsqldb.jar not found.)
10509 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
10513 my $file = "$ENV{'HSQLDB_JAR'}";
10514 my $zip = Archive::Zip->new( $file );
10515 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
10516 if ( $mf =~ m/Specification-Version: 1.8.*/ )
10518 push @l, split(/\n/, $mf);
10519 foreach my $line (@l)
10521 if ($line =~ m/Specification-Version:/)
10523 ($t, $version) = split (/:/,$line);
10524 $version =~ s/^\s//;
10525 ($a, $b, $c, $d) = split (/\./,$version);
10526 if ($c == "0" && $d > "8")
10541 AC_MSG_RESULT([yes])
10543 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
10546 AC_MSG_RESULT([internal])
10548 BUILD_TYPE="$BUILD_TYPE HSQLDB"
10552 if test "$with_java" != "no" -a -z "$HSQLDB_JAR"; then
10553 BUILD_TYPE="$BUILD_TYPE HSQLDB"
10556 AC_SUBST(SYSTEM_HSQLDB)
10557 AC_SUBST(HSQLDB_JAR)
10559 dnl ===================================================================
10560 dnl Check for PostgreSQL stuff
10561 dnl ===================================================================
10562 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
10563 if test "x$enable_postgresql_sdbc" != "xno"; then
10564 AC_MSG_RESULT([yes])
10565 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
10567 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
10568 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
10570 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
10571 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
10574 postgres_interface=""
10575 if test "$with_system_postgresql" = "yes"; then
10576 postgres_interface="external PostgreSQL"
10577 SYSTEM_POSTGRESQL=TRUE
10578 if test "$_os" = Darwin; then
10580 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
10581 pg_supp_path="$P_SEP$d$pg_supp_path"
10584 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
10585 if test -n "$PGCONFIG"; then
10586 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
10587 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
10589 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
10590 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
10591 POSTGRESQL_LIB=$POSTGRESQL_LIBS
10593 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
10596 FilterLibs "${POSTGRESQL_LIB}"
10597 POSTGRESQL_LIB="${filteredlibs}"
10599 # if/when anything else than PostgreSQL uses Kerberos,
10600 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
10605 # macOS has system MIT Kerberos 5 since 10.4
10606 if test "$with_krb5" != "no"; then
10609 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
10610 # that the libraries where these functions are located on macOS will change, is it?
10611 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10612 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
10615 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10616 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
10617 KRB5_LIBS="$KRB5_LIBS $LIBS"
10620 if test "$with_gssapi" != "no"; then
10623 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10624 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10630 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
10631 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
10634 Linux|GNU|*BSD|DragonFly)
10635 if test "$with_krb5" != "no"; then
10638 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10639 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
10642 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10643 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
10644 KRB5_LIBS="$KRB5_LIBS $LIBS"
10647 if test "$with_gssapi" != "no"; then
10650 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10651 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10657 if test "$with_krb5" = "yes"; then
10660 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10661 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
10664 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10665 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
10666 KRB5_LIBS="$KRB5_LIBS $LIBS"
10669 if test "$with_gssapi" = "yes"; then
10672 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10673 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10679 if test -n "$with_libpq_path"; then
10680 SYSTEM_POSTGRESQL=TRUE
10681 postgres_interface="external libpq"
10682 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
10683 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
10686 postgres_interface="internal"
10688 POSTGRESQL_INC="%OVERRIDE_ME%"
10689 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
10693 AC_MSG_CHECKING([PostgreSQL C interface])
10694 AC_MSG_RESULT([$postgres_interface])
10696 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
10697 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
10698 save_CFLAGS=$CFLAGS
10699 save_CPPFLAGS=$CPPFLAGS
10701 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
10702 LIBS="${LIBS} ${POSTGRESQL_LIB}"
10703 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
10704 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
10705 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
10706 CFLAGS=$save_CFLAGS
10707 CPPFLAGS=$save_CPPFLAGS
10710 BUILD_POSTGRESQL_SDBC=TRUE
10712 AC_MSG_RESULT([no])
10714 AC_SUBST(WITH_KRB5)
10715 AC_SUBST(WITH_GSSAPI)
10716 AC_SUBST(GSSAPI_LIBS)
10717 AC_SUBST(KRB5_LIBS)
10718 AC_SUBST(BUILD_POSTGRESQL_SDBC)
10719 AC_SUBST(SYSTEM_POSTGRESQL)
10720 AC_SUBST(POSTGRESQL_INC)
10721 AC_SUBST(POSTGRESQL_LIB)
10723 dnl ===================================================================
10724 dnl Check for Firebird stuff
10725 dnl ===================================================================
10726 ENABLE_FIREBIRD_SDBC=
10727 if test "$enable_firebird_sdbc" = "yes" ; then
10728 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
10730 dnl ===================================================================
10731 dnl Check for system Firebird
10732 dnl ===================================================================
10733 AC_MSG_CHECKING([which Firebird to use])
10734 if test "$with_system_firebird" = "yes"; then
10735 AC_MSG_RESULT([external])
10736 SYSTEM_FIREBIRD=TRUE
10737 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
10738 if test -z "$FIREBIRDCONFIG"; then
10739 AC_MSG_NOTICE([No fb_config -- using pkg-config])
10740 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
10741 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
10743 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
10745 AC_MSG_NOTICE([fb_config found])
10746 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
10747 AC_MSG_CHECKING([for Firebird Client library])
10748 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
10749 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
10750 FilterLibs "${FIREBIRD_LIBS}"
10751 FIREBIRD_LIBS="${filteredlibs}"
10753 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
10754 AC_MSG_CHECKING([Firebird version])
10755 if test -n "${FIREBIRD_VERSION}"; then
10756 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
10757 if test "$FIREBIRD_MAJOR" -ge "3"; then
10758 AC_MSG_RESULT([OK])
10760 AC_MSG_ERROR([Ensure firebird >= 3 is installed])
10763 save_CFLAGS="${CFLAGS}"
10764 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
10765 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
10766 #if defined(FB_API_VER) && FB_API_VER == 30
10767 int fb_api_is_30(void) { return 0; }
10769 #error "Wrong Firebird API version"
10770 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
10771 CFLAGS="$save_CFLAGS"
10773 ENABLE_FIREBIRD_SDBC=TRUE
10774 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
10775 elif test "$enable_database_connectivity" = no; then
10776 AC_MSG_RESULT([none])
10777 elif test "$cross_compiling" = "yes"; then
10778 AC_MSG_RESULT([none])
10780 dnl Embedded Firebird has version 3.0
10781 dnl We need libatomic_ops for any non X86/X64 system
10782 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
10783 dnl ===================================================================
10784 dnl Check for system libatomic_ops
10785 dnl ===================================================================
10786 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[LIBATOMIC_OPS],[atomic_ops >= 0.7.2])
10787 if test "$with_system_libatomic_ops" = "yes"; then
10788 SYSTEM_LIBATOMIC_OPS=TRUE
10789 AC_CHECK_HEADERS(atomic_ops.h, [],
10790 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
10792 SYSTEM_LIBATOMIC_OPS=
10793 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
10794 LIBATOMIC_OPS_LIBS="-latomic_ops"
10795 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
10799 AC_MSG_RESULT([internal])
10801 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
10802 FIREBIRD_LIBS="-lfbclient"
10804 if test "$with_system_libtommath" = "yes"; then
10805 SYSTEM_LIBTOMMATH=TRUE
10806 dnl check for tommath presence
10808 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
10809 AC_CHECK_LIB(tommath, mp_init, LIBTOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
10813 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
10814 LIBTOMMATH_LIBS="-ltommath"
10815 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
10818 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
10819 ENABLE_FIREBIRD_SDBC=TRUE
10820 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
10823 AC_SUBST(ENABLE_FIREBIRD_SDBC)
10824 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
10825 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
10826 AC_SUBST(LIBATOMIC_OPS_LIBS)
10827 AC_SUBST(SYSTEM_FIREBIRD)
10828 AC_SUBST(FIREBIRD_CFLAGS)
10829 AC_SUBST(FIREBIRD_LIBS)
10830 AC_SUBST(SYSTEM_LIBTOMMATH)
10831 AC_SUBST(LIBTOMMATH_CFLAGS)
10832 AC_SUBST(LIBTOMMATH_LIBS)
10834 dnl ===================================================================
10835 dnl Check for system curl
10836 dnl ===================================================================
10837 libo_CHECK_SYSTEM_MODULE([curl],[CURL],[libcurl >= 7.68.0],enabled)
10839 if test "$enable_curl" = "yes" -a "$with_system_curl" != "yes" -a "$with_gssapi" != "no"; then
10840 if test "$_os" != "WINNT"; then
10843 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10844 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10850 dnl ===================================================================
10851 dnl Check for system boost
10852 dnl ===================================================================
10853 AC_MSG_CHECKING([which boost to use])
10854 if test "$with_system_boost" = "yes"; then
10855 AC_MSG_RESULT([external])
10857 AX_BOOST_BASE([1.69],,[AC_MSG_ERROR([no suitable Boost found])])
10859 AX_BOOST_FILESYSTEM
10862 AC_LANG_PUSH([C++])
10863 save_CXXFLAGS=$CXXFLAGS
10864 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
10865 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
10866 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
10867 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
10868 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
10869 CXXFLAGS=$save_CXXFLAGS
10871 # this is in m4/ax_boost_base.m4
10872 FilterLibs "${BOOST_LDFLAGS}"
10873 BOOST_LDFLAGS="${filteredlibs}"
10875 AC_MSG_RESULT([internal])
10876 BUILD_TYPE="$BUILD_TYPE BOOST"
10878 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
10879 # use warning-suppressing wrapper headers
10880 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
10882 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
10885 AC_SUBST(SYSTEM_BOOST)
10887 dnl ===================================================================
10888 dnl Check for system mdds
10889 dnl ===================================================================
10890 MDDS_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/mdds/include"
10891 libo_CHECK_SYSTEM_MODULE([mdds],[MDDS],[mdds-2.1 >= 2.1.0])
10893 dnl ===================================================================
10894 dnl Check for system dragonbox
10895 dnl ===================================================================
10896 AC_MSG_CHECKING([which dragonbox to use])
10897 if test "$with_system_dragonbox" = "yes"; then
10898 AC_MSG_RESULT([external])
10899 SYSTEM_DRAGONBOX=TRUE
10900 AC_LANG_PUSH([C++])
10901 save_CPPFLAGS=$CPPFLAGS
10902 # This is where upstream installs to, unfortunately no .pc or so...
10903 DRAGONBOX_CFLAGS=-I/usr/include/dragonbox-1.1.3
10904 CPPFLAGS="$CPPFLAGS $DRAGONBOX_CFLAGS"
10905 AC_CHECK_HEADER([dragonbox/dragonbox.h], [],
10906 [AC_MSG_ERROR([dragonbox/dragonbox.h not found. install dragonbox])], [])
10908 CPPFLAGS=$save_CPPFLAGS
10910 AC_MSG_RESULT([internal])
10911 BUILD_TYPE="$BUILD_TYPE DRAGONBOX"
10914 AC_SUBST([SYSTEM_DRAGONBOX])
10915 AC_SUBST([DRAGONBOX_CFLAGS])
10917 dnl ===================================================================
10918 dnl Check for system frozen
10919 dnl ===================================================================
10920 AC_MSG_CHECKING([which frozen to use])
10921 if test "$with_system_frozen" = "yes"; then
10922 AC_MSG_RESULT([external])
10924 AC_LANG_PUSH([C++])
10925 save_CPPFLAGS=$CPPFLAGS
10926 AC_CHECK_HEADER([frozen/unordered_map.h], [],
10927 [AC_MSG_ERROR([frozen/unordered_map.h not found. install frozen headers])], [])
10929 CPPFLAGS=$save_CPPFLAGS
10931 AC_MSG_RESULT([internal])
10932 BUILD_TYPE="$BUILD_TYPE FROZEN"
10935 AC_SUBST([SYSTEM_FROZEN])
10936 AC_SUBST([FROZEN_CFLAGS])
10938 dnl ===================================================================
10939 dnl Check for system libfixmath
10940 dnl ===================================================================
10941 AC_MSG_CHECKING([which libfixmath to use])
10942 if test "$with_system_libfixmath" = "yes"; then
10943 AC_MSG_RESULT([external])
10944 SYSTEM_LIBFIXMATH=TRUE
10945 AC_LANG_PUSH([C++])
10946 AC_CHECK_HEADER([libfixmath/fix16.hpp], [],
10947 [AC_MSG_ERROR([libfixmath/fix16.hpp not found. install libfixmath])], [])
10948 AC_CHECK_LIB([libfixmath], [fix16_mul], [LIBFIXMATH_LIBS=-llibfixmath],
10949 [AC_CHECK_LIB([fixmath], [fix16_mul], [LIBFIXMATH_LIBS=-lfixmath],
10950 [AC_MSG_ERROR(libfixmath lib not found or functional)])])
10953 AC_MSG_RESULT([internal])
10957 AC_SUBST([SYSTEM_LIBFIXMATH])
10958 AC_SUBST([LIBFIXMATH_LIBS])
10960 dnl ===================================================================
10961 dnl Check for system glm
10962 dnl ===================================================================
10963 AC_MSG_CHECKING([which glm to use])
10964 if test "$with_system_glm" = "yes"; then
10965 AC_MSG_RESULT([external])
10967 AC_LANG_PUSH([C++])
10968 AC_CHECK_HEADER([glm/glm.hpp], [],
10969 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
10972 AC_MSG_RESULT([internal])
10973 BUILD_TYPE="$BUILD_TYPE GLM"
10975 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
10977 AC_SUBST([GLM_CFLAGS])
10978 AC_SUBST([SYSTEM_GLM])
10980 dnl ===================================================================
10981 dnl Check for system odbc
10982 dnl ===================================================================
10983 AC_MSG_CHECKING([which odbc headers to use])
10984 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
10985 AC_MSG_RESULT([external])
10986 SYSTEM_ODBC_HEADERS=TRUE
10988 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
10989 save_CPPFLAGS=$CPPFLAGS
10991 PathFormat "$winsdktest"
10992 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"
10993 AC_CHECK_HEADER(sqlext.h, [],
10994 [AC_MSG_ERROR(odbc not found. install odbc)],
10995 [#include <windows.h>])
10996 CPPFLAGS=$save_CPPFLAGS
10998 AC_CHECK_HEADER(sqlext.h, [],
10999 [AC_MSG_ERROR(odbc not found. install odbc)],[])
11001 elif test "$enable_database_connectivity" = no; then
11002 AC_MSG_RESULT([none])
11004 AC_MSG_RESULT([internal])
11005 SYSTEM_ODBC_HEADERS=
11007 AC_SUBST(SYSTEM_ODBC_HEADERS)
11009 dnl ===================================================================
11010 dnl Check for system NSS
11011 dnl ===================================================================
11012 if test "$enable_fuzzers" != "yes" -a "$enable_nss" = "yes"; then
11013 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8],,system-if-linux)
11014 AC_DEFINE(HAVE_FEATURE_NSS)
11016 elif test $_os != iOS -a "$enable_openssl" != "no"; then
11019 AC_SUBST(ENABLE_NSS)
11021 dnl ===================================================================
11022 dnl Enable LDAP support
11023 dnl ===================================================================
11025 if test "$test_openldap" = yes; then
11026 AC_MSG_CHECKING([whether to enable LDAP support])
11027 if test "$enable_ldap" = yes -a \( "$enable_openssl" = yes -o "$with_system_openldap" = yes \); then
11028 AC_MSG_RESULT([yes])
11031 if test "$enable_ldap" != "yes"; then
11032 AC_MSG_RESULT([no])
11034 AC_MSG_RESULT([no (needs OPENSSL or system openldap)])
11038 dnl ===================================================================
11039 dnl Check for system openldap
11040 dnl ===================================================================
11042 if test "$ENABLE_LDAP" = TRUE; then
11043 AC_MSG_CHECKING([which openldap library to use])
11044 if test "$with_system_openldap" = yes; then
11045 AC_MSG_RESULT([external])
11046 SYSTEM_OPENLDAP=TRUE
11047 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
11048 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
11049 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
11051 AC_MSG_RESULT([internal])
11052 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
11057 AC_SUBST(ENABLE_LDAP)
11058 AC_SUBST(SYSTEM_OPENLDAP)
11060 dnl ===================================================================
11061 dnl Check for TLS/SSL and cryptographic implementation to use
11062 dnl ===================================================================
11063 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
11064 if test -n "$with_tls"; then
11067 AC_DEFINE(USE_TLS_OPENSSL)
11069 AC_MSG_RESULT([$TLS])
11071 if test "$enable_openssl" != "yes"; then
11072 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
11075 # warn that OpenSSL has been selected but not all TLS code has this option
11076 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS])
11077 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS"
11080 AC_DEFINE(USE_TLS_NSS)
11082 AC_MSG_RESULT([$TLS])
11085 AC_MSG_RESULT([none])
11086 AC_MSG_WARN([Skipping TLS/SSL])
11090 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
11092 nss - Mozilla's Network Security Services (NSS)
11097 # default to using NSS, it results in smaller oox lib
11098 AC_DEFINE(USE_TLS_NSS)
11100 AC_MSG_RESULT([$TLS])
11104 dnl ===================================================================
11105 dnl Check for system sane
11106 dnl ===================================================================
11107 AC_MSG_CHECKING([which sane header to use])
11108 if test "$with_system_sane" = "yes"; then
11109 AC_MSG_RESULT([external])
11110 AC_CHECK_HEADER(sane/sane.h, [],
11111 [AC_MSG_ERROR(sane not found. install sane)], [])
11113 AC_MSG_RESULT([internal])
11114 BUILD_TYPE="$BUILD_TYPE SANE"
11117 dnl ===================================================================
11118 dnl Check for system icu
11119 dnl ===================================================================
11122 ICU_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
11123 ICU_LIBS_internal="-L${WORKDIR}/UnpackedTarball/icu/source/lib -licuuc"
11124 libo_CHECK_SYSTEM_MODULE([icu],[ICU],[icu-i18n >= 66])
11125 if test "$SYSTEM_ICU" = TRUE; then
11126 AC_LANG_PUSH([C++])
11127 AC_MSG_CHECKING([for unicode/rbbi.h])
11128 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([icu headers not found])])
11131 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
11132 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
11133 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
11135 if test "$CROSS_COMPILING" != TRUE; then
11136 # using the system icu tools can lead to version confusion, use the
11137 # ones from the build environment when cross-compiling
11138 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
11139 if test -z "$SYSTEM_GENBRK"; then
11140 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
11142 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
11143 if test -z "$SYSTEM_GENCCODE"; then
11144 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
11146 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
11147 if test -z "$SYSTEM_GENCMN"; then
11148 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
11153 AC_SUBST(SYSTEM_GENBRK)
11154 AC_SUBST(SYSTEM_GENCCODE)
11155 AC_SUBST(SYSTEM_GENCMN)
11156 AC_SUBST(ICU_MAJOR)
11157 AC_SUBST(ICU_MINOR)
11159 dnl ==================================================================
11161 dnl ==================================================================
11162 if test "$enable_curl" = "yes"; then
11163 AC_DEFINE([HAVE_FEATURE_CURL])
11166 dnl ==================================================================
11168 dnl ==================================================================
11169 DEFAULT_CRASHDUMP_VALUE="true"
11170 AC_MSG_CHECKING([whether to enable breakpad])
11171 if test "$enable_breakpad" != yes; then
11172 AC_MSG_RESULT([no])
11174 if test "$enable_curl" != "yes"; then
11175 AC_MSG_ERROR([--disable-breakpad must be used when --disable-curl is used])
11177 AC_MSG_RESULT([yes])
11178 ENABLE_BREAKPAD="TRUE"
11179 AC_DEFINE(ENABLE_BREAKPAD)
11180 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
11181 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
11183 AC_MSG_CHECKING([for disable crash dump])
11184 if test "$enable_crashdump" = no; then
11185 DEFAULT_CRASHDUMP_VALUE="false"
11186 AC_MSG_RESULT([yes])
11188 AC_MSG_RESULT([no])
11191 AC_MSG_CHECKING([for crashreport config])
11192 if test "$with_symbol_config" = "no"; then
11193 BREAKPAD_SYMBOL_CONFIG="invalid"
11194 AC_MSG_RESULT([no])
11196 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
11197 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
11198 AC_MSG_RESULT([yes])
11200 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
11202 AC_SUBST(ENABLE_BREAKPAD)
11203 AC_SUBST(DEFAULT_CRASHDUMP_VALUE)
11205 dnl ==================================================================
11207 dnl ==================================================================
11208 if test "$enable_libcmis" = "yes"; then
11209 if test "$enable_curl" != "yes"; then
11210 AC_MSG_ERROR([--disable-libcmis must be used when --disable-curl is used])
11214 dnl ===================================================================
11216 dnl ===================================================================
11217 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.18 >= 0.19.1])
11218 if test "$with_system_orcus" != "yes"; then
11219 if test "$SYSTEM_BOOST" = "TRUE"; then
11220 dnl Link with Boost.System
11221 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
11222 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
11223 dnl in documentation has no effect.
11227 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
11228 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
11229 AC_SUBST([BOOST_SYSTEM_LIB])
11230 AC_SUBST(SYSTEM_LIBORCUS)
11232 dnl ===================================================================
11234 dnl ===================================================================
11235 harfbuzz_required_version=5.1.0
11237 GRAPHITE_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"
11238 HARFBUZZ_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/harfbuzz/src"
11241 GRAPHITE_LIBS_internal='$(gb_StaticLibrary_WORKDIR)/libgraphite.a'
11242 HARFBUZZ_LIBS_internal="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.a"
11245 GRAPHITE_LIBS_internal='-L$(gb_StaticLibrary_WORKDIR) -lgraphite'
11246 HARFBUZZ_LIBS_internal="-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"
11249 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3])
11250 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= $harfbuzz_required_version])
11252 if test "$COM" = "MSC"; then # override the above
11253 GRAPHITE_LIBS='$(gb_StaticLibrary_WORKDIR)/graphite.lib'
11254 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
11257 if test "$with_system_harfbuzz" = "yes"; then
11258 if test "$with_system_graphite" = "no"; then
11259 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
11261 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
11263 save_CFLAGS="$CFLAGS"
11264 LIBS="$LIBS $HARFBUZZ_LIBS"
11265 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
11266 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
11268 CFLAGS="$save_CFLAGS"
11270 if test "$with_system_graphite" = "yes"; then
11271 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
11275 if test "$USING_X11" = TRUE; then
11278 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
11280 if test -z "$x_includes"; then
11281 x_includes="default_x_includes"
11283 if test -z "$x_libraries"; then
11284 x_libraries="default_x_libraries"
11286 CFLAGS="$CFLAGS $X_CFLAGS"
11287 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
11288 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
11290 x_includes="no_x_includes"
11291 x_libraries="no_x_libraries"
11294 if test "$USING_X11" = TRUE; then
11295 dnl ===================================================================
11296 dnl Check for extension headers
11297 dnl ===================================================================
11298 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
11299 [#include <X11/extensions/shape.h>])
11301 # vcl needs ICE and SM
11302 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
11303 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
11304 [AC_MSG_ERROR(ICE library not found)])
11305 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
11306 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
11307 [AC_MSG_ERROR(SM library not found)])
11310 if test "$USING_X11" = TRUE -a "$ENABLE_JAVA" != ""; then
11311 # bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c needs Xt
11312 AC_CHECK_HEADERS(X11/Intrinsic.h,[],[AC_MSG_ERROR([libXt headers not found])])
11315 dnl ===================================================================
11316 dnl Check for system Xrender
11317 dnl ===================================================================
11318 AC_MSG_CHECKING([whether to use Xrender])
11319 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
11320 AC_MSG_RESULT([yes])
11321 PKG_CHECK_MODULES(XRENDER, xrender)
11322 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11323 FilterLibs "${XRENDER_LIBS}"
11324 XRENDER_LIBS="${filteredlibs}"
11325 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
11326 [AC_MSG_ERROR(libXrender not found or functional)], [])
11327 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
11328 [AC_MSG_ERROR(Xrender not found. install X)], [])
11330 AC_MSG_RESULT([no])
11332 AC_SUBST(XRENDER_CFLAGS)
11333 AC_SUBST(XRENDER_LIBS)
11335 dnl ===================================================================
11336 dnl Check for XRandr
11337 dnl ===================================================================
11338 AC_MSG_CHECKING([whether to enable RandR support])
11339 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
11340 AC_MSG_RESULT([yes])
11341 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
11342 if test "$ENABLE_RANDR" != "TRUE"; then
11343 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
11344 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
11346 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
11347 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
11348 XRANDR_LIBS="-lXrandr "
11349 ENABLE_RANDR="TRUE"
11351 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11352 FilterLibs "${XRANDR_LIBS}"
11353 XRANDR_LIBS="${filteredlibs}"
11356 AC_MSG_RESULT([no])
11358 AC_SUBST(XRANDR_CFLAGS)
11359 AC_SUBST(XRANDR_LIBS)
11360 AC_SUBST(ENABLE_RANDR)
11362 if test -z "$with_webdav"; then
11363 with_webdav=$test_webdav
11366 AC_MSG_CHECKING([for WebDAV support])
11367 case "$with_webdav" in
11369 AC_MSG_RESULT([no])
11373 AC_MSG_RESULT([yes])
11374 # curl is already mandatory (almost) and checked elsewhere
11375 if test "$enable_curl" = "no"; then
11376 AC_MSG_ERROR(["--without-webdav must be used when --disable-curl is used"])
11381 AC_SUBST(WITH_WEBDAV)
11383 dnl ===================================================================
11384 dnl Check for disabling cve_tests
11385 dnl ===================================================================
11386 AC_MSG_CHECKING([whether to execute CVE tests])
11387 if test "$enable_cve_tests" = "no"; then
11388 AC_MSG_RESULT([no])
11389 DISABLE_CVE_TESTS=TRUE
11390 AC_SUBST(DISABLE_CVE_TESTS)
11392 AC_MSG_RESULT([yes])
11395 dnl ===================================================================
11396 dnl Check for system openssl
11397 dnl ===================================================================
11399 AC_MSG_CHECKING([whether to disable OpenSSL usage])
11400 if test "$enable_openssl" = "yes"; then
11401 AC_MSG_RESULT([no])
11402 ENABLE_OPENSSL=TRUE
11403 if test "$_os" = Darwin ; then
11404 # OpenSSL is deprecated when building for 10.7 or later.
11406 # https://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
11407 # https://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
11409 with_system_openssl=no
11410 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
11411 elif test "$_os" = "FreeBSD" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
11412 && test "$with_system_openssl" != "no"; then
11413 with_system_openssl=yes
11414 SYSTEM_OPENSSL=TRUE
11416 OPENSSL_LIBS="-lssl -lcrypto"
11418 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
11419 if test -n "${SYSTEM_OPENSSL}"; then
11420 AC_DEFINE([SYSTEM_OPENSSL])
11423 if test "$with_system_openssl" = "yes"; then
11424 AC_MSG_CHECKING([whether openssl supports SHA512])
11426 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
11427 SHA512_CTX context;
11428 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
11432 AC_MSG_RESULT([yes])
11434 # warn that although OpenSSL is disabled, system libraries may depend on it
11435 AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
11436 add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
11439 AC_SUBST([ENABLE_OPENSSL])
11441 if test "$enable_cipher_openssl_backend" = yes && test "$ENABLE_OPENSSL" != TRUE; then
11442 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
11443 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
11444 enable_cipher_openssl_backend=no
11446 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
11449 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
11450 ENABLE_CIPHER_OPENSSL_BACKEND=
11451 if test "$enable_cipher_openssl_backend" = yes; then
11452 AC_MSG_RESULT([yes])
11453 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
11455 AC_MSG_RESULT([no])
11457 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
11459 dnl ===================================================================
11460 dnl Select the crypto backends used by LO
11461 dnl ===================================================================
11463 if test "$build_crypto" = yes; then
11464 if test "$OS" = WNT; then
11465 BUILD_TYPE="$BUILD_TYPE CRYPTO_MSCAPI"
11466 AC_DEFINE([USE_CRYPTO_MSCAPI])
11467 elif test "$ENABLE_NSS" = TRUE; then
11468 BUILD_TYPE="$BUILD_TYPE CRYPTO_NSS"
11469 AC_DEFINE([USE_CRYPTO_NSS])
11473 ARGON2_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/argon2/include"
11474 if test "$COM" = "MSC"; then
11475 ARGON2_LIBS_internal="${WORKDIR}/UnpackedTarball/argon2/vs2015/build/Argon2OptDll.lib"
11477 ARGON2_LIBS_internal="${WORKDIR}/UnpackedTarball/argon2/libargon2.a"
11479 libo_CHECK_SYSTEM_MODULE([argon2],[ARGON2],[libargon2])
11481 dnl ===================================================================
11482 dnl Check for system redland
11483 dnl ===================================================================
11484 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
11485 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
11486 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
11487 if test "$with_system_redland" = "yes"; then
11488 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
11489 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
11495 AC_SUBST(RAPTOR_MAJOR)
11496 AC_SUBST(RASQAL_MAJOR)
11497 AC_SUBST(REDLAND_MAJOR)
11499 dnl ===================================================================
11500 dnl Check for system hunspell
11501 dnl ===================================================================
11502 AC_MSG_CHECKING([which libhunspell to use])
11503 if test "$with_system_hunspell" = "yes"; then
11504 AC_MSG_RESULT([external])
11505 SYSTEM_HUNSPELL=TRUE
11506 AC_LANG_PUSH([C++])
11507 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
11508 if test "$HUNSPELL_PC" != "TRUE"; then
11509 AC_CHECK_HEADER(hunspell.hxx, [],
11511 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
11512 [AC_MSG_ERROR(hunspell headers not found.)], [])
11514 AC_CHECK_LIB([hunspell], [main], [:],
11515 [ AC_MSG_ERROR(hunspell library not found.) ], [])
11516 HUNSPELL_LIBS=-lhunspell
11519 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11520 FilterLibs "${HUNSPELL_LIBS}"
11521 HUNSPELL_LIBS="${filteredlibs}"
11523 AC_MSG_RESULT([internal])
11525 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
11526 if test "$COM" = "MSC"; then
11527 HUNSPELL_LIBS='$(gb_StaticLibrary_WORKDIR)/hunspell.lib'
11529 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
11531 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
11533 AC_SUBST(SYSTEM_HUNSPELL)
11534 AC_SUBST(HUNSPELL_CFLAGS)
11535 AC_SUBST(HUNSPELL_LIBS)
11537 dnl ===================================================================
11538 dnl Check for system zxcvbn
11539 dnl ===================================================================
11540 AC_MSG_CHECKING([which zxcvbn to use])
11541 if test "$with_system_zxcvbn" = "yes"; then
11542 AC_MSG_RESULT([external])
11544 AC_CHECK_HEADER(zxcvbn.h, [],
11545 [ AC_MSG_ERROR(zxcvbn headers not found.)], [])
11546 AC_CHECK_LIB(zxcvbn, ZxcvbnMatch, [],
11547 [ AC_MSG_ERROR(zxcvbn library not found.)], [])
11549 AC_MSG_RESULT([internal])
11550 BUILD_TYPE="$BUILD_TYPE ZXCVBN"
11553 AC_SUBST(SYSTEM_ZXCVBN)
11555 dnl ===================================================================
11556 dnl Check for system zxing
11557 dnl ===================================================================
11558 AC_MSG_CHECKING([whether to use zxing])
11559 if test "$enable_zxing" = "no"; then
11560 AC_MSG_RESULT([no])
11564 AC_MSG_RESULT([yes])
11566 AC_MSG_CHECKING([which libzxing to use])
11567 if test "$with_system_zxing" = "yes"; then
11568 AC_MSG_RESULT([external])
11571 AC_LANG_PUSH([C++])
11572 save_CXXFLAGS=$CXXFLAGS
11575 for i in $CPLUS_INCLUDE_PATH /usr/include; do
11576 dnl Reset IFS as soon as possible, to avoid unexpected side effects (and the
11577 dnl "/usr/include" fallback makes sure we get here at least once; resetting rather than
11578 dnl unsetting follows the advice at <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;
11579 dnl a=commitdiff;h=e51c9919f2cf70185b7916ac040bc0bbfd0f743b> "Add recommendation on (not)
11580 dnl unsetting IFS."):
11582 dnl TODO: GCC and Clang treat empty paths in CPLUS_INCLUDE_PATH like ".", but we simply
11583 dnl ignore them here:
11584 if test -z "$i"; then
11587 dnl TODO: White space in $i would cause problems:
11588 CXXFLAGS="$save_CXXFLAGS ${CXXFLAGS_CXX11} -I$i/ZXing"
11589 AC_CHECK_HEADER(MultiFormatWriter.h, [ZXING_CFLAGS=-I$i/ZXing; break],
11590 [unset ac_cv_header_MultiFormatWriter_h], [#include <stdexcept>])
11592 CXXFLAGS=$save_CXXFLAGS
11593 if test -z "$ZXING_CFLAGS"; then
11594 AC_MSG_ERROR(zxing headers not found.)
11596 AC_CHECK_LIB([ZXing], [main], [ZXING_LIBS=-lZXing],
11597 [ AC_CHECK_LIB([ZXingCore], [main], [ZXING_LIBS=-lZXingCore],
11598 [ AC_MSG_ERROR(zxing C++ library not found.) ])], [])
11600 ZXING_CFLAGS=$(printf '%s' "$ZXING_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11601 FilterLibs "${ZXING_LIBS}"
11602 ZXING_LIBS="${filteredlibs}"
11604 AC_MSG_RESULT([internal])
11606 BUILD_TYPE="$BUILD_TYPE ZXING"
11607 ZXING_CFLAGS="-I${WORKDIR}/UnpackedTarball/zxing/core/src"
11609 if test "$ENABLE_ZXING" = TRUE; then
11610 AC_DEFINE(ENABLE_ZXING)
11612 AC_MSG_CHECKING([whether zxing::tosvg function is available])
11613 AC_LANG_PUSH([C++])
11614 save_CXXFLAGS=$CXXFLAGS
11615 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 $ZXING_CFLAGS"
11616 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11617 #include <BitMatrix.h>
11618 #include <BitMatrixIO.h>
11620 ZXing::BitMatrix matrix(1, 1);
11621 matrix.set(0, 0, true);
11622 ZXing::ToSVG(matrix);
11626 AC_DEFINE([HAVE_ZXING_TOSVG],[1])
11627 AC_MSG_RESULT([yes])
11628 ], [AC_MSG_RESULT([no])])
11629 CXXFLAGS=$save_CXXFLAGS
11631 AC_SUBST(HAVE_ZXING_TOSVG)
11633 AC_SUBST(SYSTEM_ZXING)
11634 AC_SUBST(ENABLE_ZXING)
11635 AC_SUBST(ZXING_CFLAGS)
11636 AC_SUBST(ZXING_LIBS)
11638 dnl ===================================================================
11639 dnl Check for system box2d
11640 dnl ===================================================================
11641 AC_MSG_CHECKING([which box2d to use])
11642 if test "$with_system_box2d" = "yes"; then
11643 AC_MSG_RESULT([external])
11645 AC_LANG_PUSH([C++])
11646 AC_CHECK_HEADER(box2d/box2d.h, [BOX2D_H_FOUND='TRUE'],
11647 [BOX2D_H_FOUND='FALSE'])
11648 if test "$BOX2D_H_FOUND" = "TRUE"; then # 2.4.0+
11650 AC_DEFINE(BOX2D_HEADER,<box2d/box2d.h>)
11652 # fail this. there's no other alternative to check when we are here.
11653 AC_CHECK_HEADER([Box2D/Box2D.h], [],
11654 [AC_MSG_ERROR(box2d headers not found.)])
11656 AC_DEFINE(BOX2D_HEADER,<Box2D/Box2D.h>)
11658 AC_CHECK_LIB([$_BOX2D_LIB], [main], [:],
11659 [ AC_MSG_ERROR(box2d library not found.) ], [])
11660 BOX2D_LIBS=-l$_BOX2D_LIB
11662 BOX2D_CFLAGS=$(printf '%s' "$BOX2D_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11663 FilterLibs "${BOX2D_LIBS}"
11664 BOX2D_LIBS="${filteredlibs}"
11666 AC_MSG_RESULT([internal])
11668 BUILD_TYPE="$BUILD_TYPE BOX2D"
11670 AC_SUBST(SYSTEM_BOX2D)
11671 AC_SUBST(BOX2D_CFLAGS)
11672 AC_SUBST(BOX2D_LIBS)
11674 dnl ===================================================================
11675 dnl Checking for altlinuxhyph
11676 dnl ===================================================================
11677 AC_MSG_CHECKING([which altlinuxhyph to use])
11678 if test "$with_system_altlinuxhyph" = "yes"; then
11679 AC_MSG_RESULT([external])
11681 AC_CHECK_HEADER(hyphen.h, [],
11682 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
11683 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
11684 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
11685 [#include <hyphen.h>])
11686 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
11687 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
11688 if test -z "$HYPHEN_LIB"; then
11689 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
11690 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
11692 if test -z "$HYPHEN_LIB"; then
11693 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
11694 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
11697 AC_MSG_RESULT([internal])
11699 BUILD_TYPE="$BUILD_TYPE HYPHEN"
11700 if test "$COM" = "MSC"; then
11701 HYPHEN_LIB='$(gb_StaticLibrary_WORKDIR)/hyphen.lib'
11703 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
11706 AC_SUBST(SYSTEM_HYPH)
11707 AC_SUBST(HYPHEN_LIB)
11709 dnl ===================================================================
11710 dnl Checking for mythes
11711 dnl ===================================================================
11712 AC_MSG_CHECKING([which mythes to use])
11713 if test "$with_system_mythes" = "yes"; then
11714 AC_MSG_RESULT([external])
11716 AC_LANG_PUSH([C++])
11717 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
11718 if test "$MYTHES_PKGCONFIG" = "no"; then
11719 AC_CHECK_HEADER(mythes.hxx, [],
11720 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
11721 AC_CHECK_LIB([mythes-1.2], [main], [:],
11722 [ MYTHES_FOUND=no], [])
11723 if test "$MYTHES_FOUND" = "no"; then
11724 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
11725 [ MYTHES_FOUND=no], [])
11727 if test "$MYTHES_FOUND" = "no"; then
11728 AC_MSG_ERROR([mythes library not found!.])
11732 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11733 FilterLibs "${MYTHES_LIBS}"
11734 MYTHES_LIBS="${filteredlibs}"
11736 AC_MSG_RESULT([internal])
11738 BUILD_TYPE="$BUILD_TYPE MYTHES"
11739 if test "$COM" = "MSC"; then
11740 MYTHES_LIBS='$(gb_StaticLibrary_WORKDIR)/mythes.lib'
11742 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
11745 AC_SUBST(SYSTEM_MYTHES)
11746 AC_SUBST(MYTHES_CFLAGS)
11747 AC_SUBST(MYTHES_LIBS)
11749 dnl ===================================================================
11750 dnl How should we build the linear programming solver ?
11751 dnl ===================================================================
11754 AC_MSG_CHECKING([whether to build with CoinMP])
11755 if test "$enable_coinmp" != "no"; then
11757 AC_MSG_RESULT([yes])
11758 if test "$with_system_coinmp" = "yes"; then
11760 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
11761 FilterLibs "${COINMP_LIBS}"
11762 COINMP_LIBS="${filteredlibs}"
11764 BUILD_TYPE="$BUILD_TYPE COINMP"
11767 AC_MSG_RESULT([no])
11769 AC_SUBST(ENABLE_COINMP)
11770 AC_SUBST(SYSTEM_COINMP)
11771 AC_SUBST(COINMP_CFLAGS)
11772 AC_SUBST(COINMP_LIBS)
11775 AC_MSG_CHECKING([whether to build with lpsolve])
11776 if test "$enable_lpsolve" != "no"; then
11777 ENABLE_LPSOLVE=TRUE
11778 AC_MSG_RESULT([yes])
11780 AC_MSG_RESULT([no])
11782 AC_SUBST(ENABLE_LPSOLVE)
11784 if test "$ENABLE_LPSOLVE" = TRUE; then
11785 AC_MSG_CHECKING([which lpsolve to use])
11786 if test "$with_system_lpsolve" = "yes"; then
11787 AC_MSG_RESULT([external])
11788 SYSTEM_LPSOLVE=TRUE
11789 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
11790 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
11792 # some systems need this. Like Ubuntu...
11793 AC_CHECK_LIB(m, floor)
11794 AC_CHECK_LIB(dl, dlopen)
11795 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
11796 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
11799 AC_MSG_RESULT([internal])
11801 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
11804 AC_SUBST(SYSTEM_LPSOLVE)
11806 dnl ===================================================================
11807 dnl Checking for libexttextcat
11808 dnl ===================================================================
11809 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
11810 if test "$with_system_libexttextcat" = "yes"; then
11811 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
11813 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
11815 dnl ===================================================================
11816 dnl Checking for libnumbertext
11817 dnl ===================================================================
11818 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.6])
11819 if test "$with_system_libnumbertext" = "yes"; then
11820 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
11821 SYSTEM_LIBNUMBERTEXT=YES
11823 SYSTEM_LIBNUMBERTEXT=
11825 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
11826 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
11828 dnl ***************************************
11829 dnl testing libc version for Linux...
11830 dnl ***************************************
11831 if test "$_os" = "Linux"; then
11832 AC_MSG_CHECKING([whether the libc is recent enough])
11833 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11834 #include <features.h>
11835 #if defined(__GNU_LIBRARY__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
11836 #error glibc >= 2.1 is required
11838 ]])],, [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, upgrade libc])])
11841 dnl =========================================
11842 dnl Check for uuidgen
11843 dnl =========================================
11844 if test "$_os" = "WINNT"; then
11845 # we must use the uuidgen from the Windows SDK, which will be in the LO_PATH, but isn't in
11846 # the PATH for AC_PATH_PROG. It is already tested above in the WINDOWS_SDK_HOME check.
11847 UUIDGEN=uuidgen.exe
11850 AC_PATH_PROG([UUIDGEN], [uuidgen])
11851 if test -z "$UUIDGEN"; then
11852 AC_MSG_WARN([uuid is needed for building installation sets])
11856 dnl ***************************************
11857 dnl Checking for bison and flex
11858 dnl ***************************************
11859 AC_PATH_PROG(BISON, bison)
11860 if test -z "$BISON"; then
11861 AC_MSG_ERROR([no bison found in \$PATH, install it])
11863 AC_MSG_CHECKING([the bison version])
11864 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
11865 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
11866 dnl Accept newer than 2.0; for --enable-compiler-plugins at least 2.3 is known to be bad and
11869 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]
11870 dnl typedef union YYSTYPE
11873 dnl while at least 3.4.1 is know to be good:
11874 if test "$COMPILER_PLUGINS" = TRUE; then
11875 if test "$_bison_longver" -lt 2004; then
11876 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.4+ for --enable-compiler-plugins)])
11879 if test "$_bison_longver" -lt 2000; then
11880 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
11886 AC_PATH_PROG(FLEX, flex)
11887 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11888 FLEX=`cygpath -m $FLEX`
11890 if test -z "$FLEX"; then
11891 AC_MSG_ERROR([no flex found in \$PATH, install it])
11893 AC_MSG_CHECKING([the flex version])
11894 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
11895 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
11896 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
11901 AC_PATH_PROG(DIFF, diff)
11902 if test -z "$DIFF"; then
11903 AC_MSG_ERROR(["diff" not found in \$PATH, install it])
11907 AC_PATH_PROG(UNIQ, uniq)
11908 if test -z "$UNIQ"; then
11909 AC_MSG_ERROR(["uniq" not found in \$PATH, install it])
11913 dnl ***************************************
11914 dnl Checking for patch
11915 dnl ***************************************
11916 AC_PATH_PROG(PATCH, patch)
11917 if test -z "$PATCH"; then
11918 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
11921 dnl On Solaris or macOS, check if --with-gnu-patch was used
11922 if test "$_os" = "SunOS" -o "$_os" = "Darwin" -o "$_os" = "FreeBSD"; then
11923 if test -z "$with_gnu_patch"; then
11926 if test -x "$with_gnu_patch"; then
11927 GNUPATCH=$with_gnu_patch
11929 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
11933 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
11934 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
11935 AC_MSG_RESULT([yes])
11937 if $GNUPATCH --version | grep "2\.0-.*-Apple" >/dev/null 2>/dev/null; then
11938 AC_MSG_RESULT([no, but accepted (Apple patch)])
11939 add_warning "patch utility is not GNU patch. Apple's patch should work OK, but it might experience issues where GNU patch doesn't."
11941 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
11948 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11949 GNUPATCH=`cygpath -m $GNUPATCH`
11952 dnl We also need to check for --with-gnu-cp
11954 if test -z "$with_gnu_cp"; then
11955 # check the place where the good stuff is hidden on Solaris...
11956 if test -x /usr/gnu/bin/cp; then
11957 GNUCP=/usr/gnu/bin/cp
11959 AC_PATH_PROGS(GNUCP, gnucp cp)
11961 if test -z $GNUCP; then
11962 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
11965 if test -x "$with_gnu_cp"; then
11968 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
11972 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11973 GNUCP=`cygpath -m $GNUCP`
11976 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
11977 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
11978 AC_MSG_RESULT([yes])
11979 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
11980 AC_MSG_RESULT([yes])
11982 case "$build_os" in
11983 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*)
11986 AC_MSG_RESULT([no gnucp found - using the system's cp command])
11989 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
11998 dnl ***************************************
11999 dnl testing assembler path
12000 dnl ***************************************
12002 if test "$_os" = "WINNT"; then
12003 case "$WIN_HOST_ARCH" in
12004 x86) assembler=ml.exe ;;
12005 x64) assembler=ml64.exe ;;
12006 arm64) assembler=armasm64.exe ;;
12009 AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
12010 if test -f "$MSVC_HOST_PATH/$assembler"; then
12011 ML_EXE=`win_short_path_for_make "$MSVC_HOST_PATH/$assembler"`
12012 AC_MSG_RESULT([$ML_EXE])
12014 AC_MSG_ERROR([not found in $MSVC_HOST_PATH])
12020 dnl ===================================================================
12021 dnl We need zip and unzip
12022 dnl ===================================================================
12023 AC_PATH_PROG(ZIP, zip)
12024 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
12025 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
12026 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],,)
12029 AC_PATH_PROG(UNZIP, unzip)
12030 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
12032 dnl ===================================================================
12033 dnl Zip must be a specific type for different build types.
12034 dnl ===================================================================
12035 if test $build_os = cygwin; then
12036 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
12037 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
12041 dnl ===================================================================
12042 dnl We need touch with -h option support.
12043 dnl ===================================================================
12044 AC_PATH_PROG(TOUCH, touch)
12045 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
12046 touch "$WARNINGS_FILE"
12047 if ! "$TOUCH" -h "$WARNINGS_FILE" 2>/dev/null > /dev/null; then
12048 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],,)
12051 dnl ===================================================================
12052 dnl Check for system epoxy
12053 dnl ===================================================================
12054 EPOXY_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/epoxy/include"
12055 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2])
12057 dnl ===================================================================
12058 dnl Show which vclplugs will be built.
12059 dnl ===================================================================
12062 libo_ENABLE_VCLPLUG([gen])
12063 libo_ENABLE_VCLPLUG([gtk3])
12064 libo_ENABLE_VCLPLUG([gtk3_kde5])
12065 libo_ENABLE_VCLPLUG([gtk4])
12066 libo_ENABLE_VCLPLUG([kf5])
12067 libo_ENABLE_VCLPLUG([kf6])
12068 libo_ENABLE_VCLPLUG([qt5])
12069 libo_ENABLE_VCLPLUG([qt6])
12071 if test "$_os" = "WINNT"; then
12073 elif test "$_os" = "Darwin"; then
12075 elif test "$_os" = "iOS"; then
12077 elif test "$_os" = Android; then
12081 build_vcl_plugins="$R"
12082 if test -z "$build_vcl_plugins"; then
12083 build_vcl_plugins=" none"
12085 AC_MSG_NOTICE([VCLplugs to be built:${build_vcl_plugins}])
12087 AC_SUBST([VCL_PLUGIN_INFO])
12089 if test "$DISABLE_DYNLOADING" = TRUE -a -z "$DISABLE_GUI" -a \( -z "$R" -o $(echo "$R" | wc -w) -ne 1 \); then
12090 AC_MSG_ERROR([Can't build --disable-dynamic-loading without --disable-gui and a single VCL plugin"])
12093 dnl ===================================================================
12094 dnl Check for GTK libraries
12095 dnl ===================================================================
12099 ENABLE_GTKTILEDVIEWER=""
12100 if test "$test_gtk3" = yes -a "x$enable_gtk3" = "xyes" -o "x$enable_gtk3_kde5" = "xyes"; then
12101 if test "$with_system_cairo" = no; then
12102 add_warning 'Non-system cairo combined with gtk3 is known to cause trouble (eg. broken image in the splashscreen). Use --with-system-cairo unless you know what you are doing.'
12104 : ${with_system_cairo:=yes}
12105 PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.20 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 atk >= 2.28.1 cairo)
12106 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12107 GTK3_CFLAGS="$GTK3_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
12108 FilterLibs "${GTK3_LIBS}"
12109 GTK3_LIBS="${filteredlibs}"
12111 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
12112 if test "$with_system_epoxy" != "yes"; then
12113 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
12114 AC_CHECK_HEADER(EGL/eglplatform.h, [],
12115 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
12117 elif test -n "$with_gtk3_build" -a "$OS" = "WNT"; then
12118 PathFormat "${with_gtk3_build}/lib/pkgconfig"
12119 if test "$build_os" = "cygwin"; then
12120 dnl cygwin's pkg-config does not recognize "C:/..."-style paths, only "/cygdrive/c/..."
12121 formatted_path_unix=`cygpath -au "$formatted_path_unix"`
12124 PKG_CONFIG_PATH="$formatted_path_unix"; export PKG_CONFIG_PATH
12125 PKG_CHECK_MODULES(GTK3, cairo gdk-3.0 gio-2.0 glib-2.0 gobject-2.0 gtk+-3.0)
12126 GTK3_CFLAGS="$GTK3_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
12127 FilterLibs "${GTK3_LIBS}"
12128 GTK3_LIBS="${filteredlibs}"
12129 ENABLE_GTKTILEDVIEWER="yes"
12131 AC_SUBST(GTK3_LIBS)
12132 AC_SUBST(GTK3_CFLAGS)
12133 AC_SUBST(ENABLE_GTKTILEDVIEWER)
12137 if test "$test_gtk4" = yes -a "x$enable_gtk4" = "xyes"; then
12138 if test "$with_system_cairo" = no; then
12139 add_warning 'Non-system cairo combined with gtk4 is assumed to cause trouble; proceed at your own risk.'
12141 : ${with_system_cairo:=yes}
12142 PKG_CHECK_MODULES(GTK4, gtk4 >= 4.10 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo atk)
12143 GTK4_CFLAGS=$(printf '%s' "$GTK4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12144 GTK4_CFLAGS="$GTK4_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
12145 FilterLibs "${GTK4_LIBS}"
12146 GTK4_LIBS="${filteredlibs}"
12148 dnl We require egl only for the gtk4 plugin. Otherwise we use glx.
12149 if test "$with_system_epoxy" != "yes"; then
12150 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
12151 AC_CHECK_HEADER(EGL/eglplatform.h, [],
12152 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
12155 AC_SUBST(GTK4_LIBS)
12156 AC_SUBST(GTK4_CFLAGS)
12158 if test "$enable_introspection" = yes; then
12159 if test "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
12160 GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
12162 AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
12166 # AT-SPI2 tests require gtk3, xvfb-run, dbus-launch and atspi-2
12167 if ! test "$ENABLE_GTK3" = TRUE; then
12168 if test "$enable_atspi_tests" = yes; then
12169 AC_MSG_ERROR([--enable-atspi-tests requires --enable-gtk3])
12171 enable_atspi_tests=no
12173 if ! test "$enable_atspi_tests" = no; then
12174 AC_PATH_PROGS([XVFB_RUN], [xvfb-run], no)
12175 if ! test "$XVFB_RUN" = no; then
12176 dnl make sure the found xvfb-run actually works
12177 AC_MSG_CHECKING([whether $XVFB_RUN works...])
12178 if $XVFB_RUN --auto-servernum true >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
12179 AC_MSG_RESULT([yes])
12181 AC_MSG_RESULT([no])
12185 if test "$XVFB_RUN" = no; then
12186 if test "$enable_atspi_tests" = yes; then
12187 AC_MSG_ERROR([xvfb-run required by --enable-atspi-tests not found])
12189 enable_atspi_tests=no
12192 if ! test "$enable_atspi_tests" = no; then
12193 AC_PATH_PROGS([DBUS_LAUNCH], [dbus-launch], no)
12194 if test "$DBUS_LAUNCH" = no; then
12195 if test "$enable_atspi_tests" = yes; then
12196 AC_MSG_ERROR([dbus-launch required by --enable-atspi-tests not found])
12198 enable_atspi_tests=no
12201 if ! test "$enable_atspi_tests" = no; then
12202 PKG_CHECK_MODULES([ATSPI2], [atspi-2 gobject-2.0],,
12203 [if test "$enable_atspi_tests" = yes; then
12204 AC_MSG_ERROR([$ATSPI2_PKG_ERRORS])
12206 enable_atspi_tests=no
12209 if ! test "x$enable_atspi_tests" = xno; then
12210 PKG_CHECK_MODULES([ATSPI2_2_32], [atspi-2 >= 2.32],
12211 [have_atspi_scroll_to=1],
12212 [have_atspi_scroll_to=0])
12213 AC_DEFINE_UNQUOTED([HAVE_ATSPI2_SCROLL_TO], [$have_atspi_scroll_to],
12214 [Whether AT-SPI2 has the scrollTo API])
12216 ENABLE_ATSPI_TESTS=
12217 test "$enable_atspi_tests" = no || ENABLE_ATSPI_TESTS=TRUE
12218 AC_SUBST([ENABLE_ATSPI_TESTS])
12220 dnl ===================================================================
12221 dnl check for dbus support
12222 dnl ===================================================================
12226 DBUS_GLIB_CFLAGS=""
12230 if test "$enable_dbus" = "no"; then
12234 AC_MSG_CHECKING([whether to enable DBUS support])
12235 if test "$test_dbus" = "yes"; then
12237 AC_MSG_RESULT([yes])
12238 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
12239 AC_DEFINE(ENABLE_DBUS)
12240 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12241 FilterLibs "${DBUS_LIBS}"
12242 DBUS_LIBS="${filteredlibs}"
12244 # Glib is needed for BluetoothServer
12245 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
12246 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
12248 DBUS_HAVE_GLIB="TRUE"
12249 AC_DEFINE(DBUS_HAVE_GLIB,1)
12251 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
12254 AC_MSG_RESULT([no])
12257 AC_SUBST(ENABLE_DBUS)
12258 AC_SUBST(DBUS_CFLAGS)
12259 AC_SUBST(DBUS_LIBS)
12260 AC_SUBST(DBUS_GLIB_CFLAGS)
12261 AC_SUBST(DBUS_GLIB_LIBS)
12262 AC_SUBST(DBUS_HAVE_GLIB)
12264 AC_MSG_CHECKING([whether to enable Impress remote control])
12265 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
12266 AC_MSG_RESULT([yes])
12267 ENABLE_SDREMOTE=TRUE
12268 SDREMOTE_ENTITLEMENT=" <key>com.apple.security.network.server</key>
12270 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
12272 if test $OS = MACOSX && test "$MACOSX_SDK_VERSION" -ge 101500; then
12273 # The Bluetooth code doesn't compile with macOS SDK 10.15
12274 if test "$enable_sdremote_bluetooth" = yes; then
12275 AC_MSG_ERROR([macOS SDK $macosx_sdk does not currently support --enable-sdremote-bluetooth])
12277 add_warning "not building the bluetooth part of the sdremote - used api was removed from macOS SDK 10.15"
12278 enable_sdremote_bluetooth=no
12280 # If not explicitly enabled or disabled, default
12281 if test -z "$enable_sdremote_bluetooth"; then
12284 # Default to yes for these
12285 enable_sdremote_bluetooth=yes
12289 enable_sdremote_bluetooth=no
12293 # $enable_sdremote_bluetooth is guaranteed non-empty now
12295 if test "$enable_sdremote_bluetooth" != "no"; then
12296 if test "$OS" = "LINUX"; then
12297 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
12298 AC_MSG_RESULT([yes])
12299 ENABLE_SDREMOTE_BLUETOOTH=TRUE
12300 dnl ===================================================================
12301 dnl Check for system bluez
12302 dnl ===================================================================
12303 AC_MSG_CHECKING([which Bluetooth header to use])
12304 if test "$with_system_bluez" = "yes"; then
12305 AC_MSG_RESULT([external])
12306 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
12307 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
12310 AC_MSG_RESULT([internal])
12314 AC_MSG_RESULT([no, dbus disabled])
12315 ENABLE_SDREMOTE_BLUETOOTH=
12319 AC_MSG_RESULT([yes])
12320 ENABLE_SDREMOTE_BLUETOOTH=TRUE
12322 SDREMOTE_ENTITLEMENT="$SDREMOTE_ENTITLEMENT
12323 <key>com.apple.security.device.bluetooth</key>
12327 AC_MSG_RESULT([no])
12328 ENABLE_SDREMOTE_BLUETOOTH=
12334 AC_MSG_RESULT([no])
12336 AC_SUBST(ENABLE_SDREMOTE)
12337 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
12338 AC_SUBST(SDREMOTE_ENTITLEMENT)
12339 AC_SUBST(SYSTEM_BLUEZ)
12341 dnl ===================================================================
12342 dnl Check whether to enable GIO support
12343 dnl ===================================================================
12344 if test "$ENABLE_GTK4" = "TRUE" -o "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
12345 AC_MSG_CHECKING([whether to enable GIO support])
12346 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
12347 dnl Need at least 2.26 for the dbus support.
12348 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
12349 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
12350 if test "$ENABLE_GIO" = "TRUE"; then
12351 AC_DEFINE(ENABLE_GIO)
12352 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12353 FilterLibs "${GIO_LIBS}"
12354 GIO_LIBS="${filteredlibs}"
12357 AC_MSG_RESULT([no])
12360 AC_SUBST(ENABLE_GIO)
12361 AC_SUBST(GIO_CFLAGS)
12365 dnl ===================================================================
12367 SPLIT_APP_MODULES=""
12368 if test "$enable_split_app_modules" = "yes"; then
12369 SPLIT_APP_MODULES="TRUE"
12371 AC_SUBST(SPLIT_APP_MODULES)
12373 SPLIT_OPT_FEATURES=""
12374 if test "$enable_split_opt_features" = "yes"; then
12375 SPLIT_OPT_FEATURES="TRUE"
12377 AC_SUBST(SPLIT_OPT_FEATURES)
12379 dnl ===================================================================
12380 dnl Check whether the GStreamer libraries are available.
12381 dnl ===================================================================
12383 ENABLE_GSTREAMER_1_0=""
12385 if test "$test_gstreamer_1_0" = yes; then
12387 AC_MSG_CHECKING([whether to enable the GStreamer 1.0 avmedia backend])
12388 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
12389 ENABLE_GSTREAMER_1_0="TRUE"
12390 AC_MSG_RESULT([yes])
12391 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
12392 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12393 FilterLibs "${GSTREAMER_1_0_LIBS}"
12394 GSTREAMER_1_0_LIBS="${filteredlibs}"
12395 AC_DEFINE(ENABLE_GSTREAMER_1_0)
12397 AC_MSG_RESULT([no])
12400 AC_SUBST(GSTREAMER_1_0_CFLAGS)
12401 AC_SUBST(GSTREAMER_1_0_LIBS)
12402 AC_SUBST(ENABLE_GSTREAMER_1_0)
12404 ENABLE_OPENGL_TRANSITIONS=
12405 ENABLE_OPENGL_CANVAS=
12406 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
12408 elif test "$_os" = "Darwin"; then
12409 # We use frameworks on macOS, no need for detail checks
12410 ENABLE_OPENGL_TRANSITIONS=TRUE
12411 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
12412 ENABLE_OPENGL_CANVAS=TRUE
12413 elif test $_os = WINNT; then
12414 ENABLE_OPENGL_TRANSITIONS=TRUE
12415 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
12416 ENABLE_OPENGL_CANVAS=TRUE
12418 if test "$USING_X11" = TRUE; then
12419 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
12420 ENABLE_OPENGL_TRANSITIONS=TRUE
12421 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
12422 ENABLE_OPENGL_CANVAS=TRUE
12426 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
12427 AC_SUBST(ENABLE_OPENGL_CANVAS)
12429 dnl =================================================
12430 dnl Check whether to build with OpenCL support.
12431 dnl =================================================
12433 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE" -a "$enable_opencl" = "yes"; then
12434 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
12435 # platform (optional at run-time, used through clew).
12436 BUILD_TYPE="$BUILD_TYPE OPENCL"
12437 AC_DEFINE(HAVE_FEATURE_OPENCL)
12440 dnl =================================================
12441 dnl Check whether to build with dconf support.
12442 dnl =================================================
12444 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
12445 PKG_CHECK_MODULES([DCONF], [dconf >= 0.40.0], [], [
12446 if test "$enable_dconf" = yes; then
12447 AC_MSG_ERROR([dconf not found])
12452 AC_MSG_CHECKING([whether to enable dconf])
12453 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
12457 AC_MSG_RESULT([no])
12460 AC_DEFINE(ENABLE_DCONF)
12461 AC_MSG_RESULT([yes])
12463 AC_SUBST([DCONF_CFLAGS])
12464 AC_SUBST([DCONF_LIBS])
12465 AC_SUBST([ENABLE_DCONF])
12468 AC_MSG_CHECKING([whether to build the PDF import feature])
12470 if test -z "$enable_pdfimport" -o "$enable_pdfimport" = yes; then
12471 AC_MSG_RESULT([yes])
12472 ENABLE_PDFIMPORT=TRUE
12473 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
12475 AC_MSG_RESULT([no])
12479 AC_MSG_CHECKING([whether to build PDFium])
12481 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_pdfium" = yes; then
12482 AC_MSG_RESULT([yes])
12484 BUILD_TYPE="$BUILD_TYPE PDFIUM"
12486 AC_MSG_RESULT([no])
12488 AC_SUBST(ENABLE_PDFIUM)
12490 if test "$ENABLE_PDFIUM" = "TRUE"; then
12491 AC_MSG_CHECKING([which OpenJPEG library to use])
12492 if test "$with_system_openjpeg" = "yes"; then
12493 SYSTEM_OPENJPEG2=TRUE
12494 AC_MSG_RESULT([external])
12495 PKG_CHECK_MODULES( OPENJPEG2, libopenjp2 )
12496 OPENJPEG2_CFLAGS=$(printf '%s' "$OPENJPEG2_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12497 FilterLibs "${OPENJPEG2_LIBS}"
12498 OPENJPEG2_LIBS="${filteredlibs}"
12500 SYSTEM_OPENJPEG2=FALSE
12501 AC_MSG_RESULT([internal])
12504 AC_MSG_CHECKING([which Abseil library to use])
12505 if test "$with_system_abseil" = "yes"; then
12506 AC_MSG_RESULT([external])
12508 AC_LANG_PUSH([C++])
12509 PKG_CHECK_MODULES(ABSEIL, absl_bad_optional_access absl_bad_variant_access absl_inlined_vector )
12511 ABSEIL_CFLAGS=$(printf '%s' "$ABSEIL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12512 FilterLibs "${ABSEIL_LIBS}"
12513 ABSEIL_LIBS="${filteredlibs}"
12515 AC_MSG_RESULT([internal])
12518 AC_SUBST(SYSTEM_OPENJPEG2)
12519 AC_SUBST(SYSTEM_ABSEIL)
12520 AC_SUBST(ABSEIL_CFLAGS)
12521 AC_SUBST(ABSEIL_LIBS)
12523 dnl ===================================================================
12524 dnl Check for poppler
12525 dnl ===================================================================
12527 AC_MSG_CHECKING([whether to build Poppler])
12528 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" = "TRUE" -a $_os != Android \) -o "$enable_poppler" = yes; then
12529 AC_MSG_RESULT([yes])
12530 ENABLE_POPPLER=TRUE
12531 AC_DEFINE(HAVE_FEATURE_POPPLER)
12533 AC_MSG_RESULT([no])
12535 AC_SUBST(ENABLE_POPPLER)
12537 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
12538 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
12541 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" = "TRUE" -o "$ENABLE_PDFIUM" = "TRUE" \); then
12542 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
12545 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
12546 dnl ===================================================================
12547 dnl Check for system poppler
12548 dnl ===================================================================
12549 AC_MSG_CHECKING([which PDF import poppler to use])
12550 if test "$with_system_poppler" = "yes"; then
12551 AC_MSG_RESULT([external])
12552 SYSTEM_POPPLER=TRUE
12553 PKG_CHECK_MODULES(POPPLER,[poppler >= 0.14 poppler-cpp])
12554 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12555 FilterLibs "${POPPLER_LIBS}"
12556 POPPLER_LIBS="${filteredlibs}"
12558 AC_MSG_RESULT([internal])
12560 BUILD_TYPE="$BUILD_TYPE POPPLER"
12562 AC_DEFINE([ENABLE_PDFIMPORT],1)
12564 AC_SUBST(ENABLE_PDFIMPORT)
12565 AC_SUBST(SYSTEM_POPPLER)
12566 AC_SUBST(POPPLER_CFLAGS)
12567 AC_SUBST(POPPLER_LIBS)
12571 if test "$enable_skia" != "no" -a "$build_skia" = "yes" -a -z "$DISABLE_GUI"; then
12572 # Skia now requires at least freetype2 >= 2.8.1, which is less that what LO requires as system freetype.
12573 if test "$SYSTEM_FREETYPE" = TRUE; then
12574 PKG_CHECK_EXISTS(freetype2 >= 21.0.15, # 21.0.15 = 2.8.1
12575 [skia_freetype_ok=yes],
12576 [skia_freetype_ok=no])
12577 else # internal is ok
12578 skia_freetype_ok=yes
12580 AC_MSG_CHECKING([whether to build Skia])
12581 if test "$skia_freetype_ok" = "yes"; then
12582 if test "$enable_skia" = "debug"; then
12583 AC_MSG_RESULT([yes (debug)])
12584 ENABLE_SKIA_DEBUG=TRUE
12586 AC_MSG_RESULT([yes])
12590 if test "$ENDIANNESS" = "big" && test "$ENABLE_SKIA" = "TRUE"; then
12591 AC_MSG_ERROR([skia doesn't work/isn't supported upstream on big-endian. Use --disable-skia])
12594 AC_DEFINE(HAVE_FEATURE_SKIA)
12595 BUILD_TYPE="$BUILD_TYPE SKIA"
12597 if test "$OS" = "MACOSX"; then
12598 AC_DEFINE(SK_GANESH,1)
12599 AC_DEFINE(SK_METAL,1)
12603 AC_DEFINE(SK_GANESH,1)
12604 AC_DEFINE(SK_VULKAN,1)
12609 AC_MSG_RESULT([no (freetype too old)])
12610 add_warning "freetype version is too old for Skia library, at least 2.8.1 required, Skia support disabled"
12614 AC_MSG_CHECKING([whether to build Skia])
12615 AC_MSG_RESULT([no])
12617 AC_SUBST(ENABLE_SKIA)
12618 AC_SUBST(ENABLE_SKIA_DEBUG)
12620 LO_CLANG_CXXFLAGS_INTRINSICS_SSE2=
12621 LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3=
12622 LO_CLANG_CXXFLAGS_INTRINSICS_SSE41=
12623 LO_CLANG_CXXFLAGS_INTRINSICS_SSE42=
12624 LO_CLANG_CXXFLAGS_INTRINSICS_AVX=
12625 LO_CLANG_CXXFLAGS_INTRINSICS_AVX2=
12626 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512=
12627 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F=
12628 LO_CLANG_CXXFLAGS_INTRINSICS_F16C=
12629 LO_CLANG_CXXFLAGS_INTRINSICS_FMA=
12631 HAVE_LO_CLANG_DLLEXPORTINLINES=
12633 if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE; then
12634 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
12635 AC_MSG_CHECKING([for Clang])
12636 AC_MSG_RESULT([$LO_CLANG_CC / $LO_CLANG_CXX])
12638 if test "$_os" = "WINNT"; then
12639 AC_MSG_CHECKING([for clang-cl])
12640 if test -x "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"; then
12641 LO_CLANG_CC=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"`
12642 elif test -n "$PROGRAMFILES" -a -x "$(cygpath -u "$PROGRAMFILES/LLVM/bin/clang-cl.exe")"; then
12643 LO_CLANG_CC=`win_short_path_for_make "$PROGRAMFILES/LLVM/bin/clang-cl.exe"`
12644 elif test -x "$(cygpath -u "c:/Program Files/LLVM/bin/clang-cl.exe")"; then
12645 LO_CLANG_CC=`win_short_path_for_make "c:/Program Files/LLVM/bin/clang-cl.exe"`
12647 if test -n "$LO_CLANG_CC"; then
12648 dnl explicitly set -m32/-m64
12649 LO_CLANG_CC="$LO_CLANG_CC -m$WIN_HOST_BITS"
12650 LO_CLANG_CXX="$LO_CLANG_CC"
12651 AC_MSG_RESULT([$LO_CLANG_CC])
12653 AC_MSG_RESULT([no])
12656 AC_MSG_CHECKING([the dependency generation prefix (clang.exe -showIncludes)])
12657 echo "#include <stdlib.h>" > conftest.c
12658 LO_CLANG_SHOWINCLUDES_PREFIX=`VSLANG=1033 $LO_CLANG_CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
12659 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
12660 rm -f conftest.c conftest.obj
12661 if test -z "$LO_CLANG_SHOWINCLUDES_PREFIX"; then
12662 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
12664 AC_MSG_RESULT(["$LO_CLANG_SHOWINCLUDES_PREFIX"])
12667 AC_CHECK_PROG(LO_CLANG_CC,clang,clang,[])
12668 AC_CHECK_PROG(LO_CLANG_CXX,clang++,clang++,[])
12671 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
12672 clang2_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $LO_CLANG_CC -E - | tail -1 | sed 's/ //g'`
12673 LO_CLANG_VERSION=`echo "$clang2_version" | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
12674 if test "$LO_CLANG_VERSION" -lt 50002; then
12675 AC_MSG_WARN(["$clang2_version" is too old or unrecognized, must be at least Clang 5.0.2])
12680 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX" -a "$_os" = "WINNT"; then
12682 CXX="$LO_CLANG_CXX"
12683 AC_MSG_CHECKING([whether $CXX supports -Zc:dllexportInlines-])
12684 AC_LANG_PUSH([C++])
12685 save_CXXFLAGS=$CXXFLAGS
12686 CXXFLAGS="$CXXFLAGS -Werror -Zc:dllexportInlines-"
12687 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
12688 HAVE_LO_CLANG_DLLEXPORTINLINES=TRUE
12689 AC_MSG_RESULT([yes])
12690 ], [AC_MSG_RESULT([no])])
12691 CXXFLAGS=$save_CXXFLAGS
12694 if test -z "$HAVE_LO_CLANG_DLLEXPORTINLINES"; then
12695 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.])
12698 if test -z "$LO_CLANG_CC" -o -z "$LO_CLANG_CXX"; then
12699 # Skia is the default on Windows and Mac, so hard-require Clang.
12700 # Elsewhere it's used just by the 'gen' VCL backend which is rarely used.
12701 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
12702 AC_MSG_ERROR([Clang compiler not found. The Skia library needs to be built using Clang, or use --disable-skia.])
12704 AC_MSG_WARN([Clang compiler not found.])
12709 CXX="$LO_CLANG_CXX"
12710 # copy&paste (and adjust) of intrinsics checks, since MSVC's -arch doesn't work well for Clang-cl
12713 flag_sse41=-msse4.1
12714 flag_sse42=-msse4.2
12717 flag_avx512="-mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd"
12718 flag_avx512f=-mavx512f
12722 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
12723 AC_LANG_PUSH([C++])
12724 save_CXXFLAGS=$CXXFLAGS
12725 CXXFLAGS="$CXXFLAGS $flag_sse2"
12726 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12727 #include <emmintrin.h>
12729 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12730 c = _mm_xor_si128 (a, b);
12734 [can_compile_sse2=yes],
12735 [can_compile_sse2=no])
12737 CXXFLAGS=$save_CXXFLAGS
12738 AC_MSG_RESULT([${can_compile_sse2}])
12739 if test "${can_compile_sse2}" = "yes" ; then
12740 LO_CLANG_CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
12743 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
12744 AC_LANG_PUSH([C++])
12745 save_CXXFLAGS=$CXXFLAGS
12746 CXXFLAGS="$CXXFLAGS $flag_ssse3"
12747 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12748 #include <tmmintrin.h>
12750 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12751 c = _mm_maddubs_epi16 (a, b);
12755 [can_compile_ssse3=yes],
12756 [can_compile_ssse3=no])
12758 CXXFLAGS=$save_CXXFLAGS
12759 AC_MSG_RESULT([${can_compile_ssse3}])
12760 if test "${can_compile_ssse3}" = "yes" ; then
12761 LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
12764 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
12765 AC_LANG_PUSH([C++])
12766 save_CXXFLAGS=$CXXFLAGS
12767 CXXFLAGS="$CXXFLAGS $flag_sse41"
12768 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12769 #include <smmintrin.h>
12771 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12772 c = _mm_cmpeq_epi64 (a, b);
12776 [can_compile_sse41=yes],
12777 [can_compile_sse41=no])
12779 CXXFLAGS=$save_CXXFLAGS
12780 AC_MSG_RESULT([${can_compile_sse41}])
12781 if test "${can_compile_sse41}" = "yes" ; then
12782 LO_CLANG_CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
12785 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
12786 AC_LANG_PUSH([C++])
12787 save_CXXFLAGS=$CXXFLAGS
12788 CXXFLAGS="$CXXFLAGS $flag_sse42"
12789 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12790 #include <nmmintrin.h>
12792 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12793 c = _mm_cmpgt_epi64 (a, b);
12797 [can_compile_sse42=yes],
12798 [can_compile_sse42=no])
12800 CXXFLAGS=$save_CXXFLAGS
12801 AC_MSG_RESULT([${can_compile_sse42}])
12802 if test "${can_compile_sse42}" = "yes" ; then
12803 LO_CLANG_CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
12806 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
12807 AC_LANG_PUSH([C++])
12808 save_CXXFLAGS=$CXXFLAGS
12809 CXXFLAGS="$CXXFLAGS $flag_avx"
12810 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12811 #include <immintrin.h>
12813 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
12814 c = _mm256_xor_ps(a, b);
12818 [can_compile_avx=yes],
12819 [can_compile_avx=no])
12821 CXXFLAGS=$save_CXXFLAGS
12822 AC_MSG_RESULT([${can_compile_avx}])
12823 if test "${can_compile_avx}" = "yes" ; then
12824 LO_CLANG_CXXFLAGS_INTRINSICS_AVX="$flag_avx"
12827 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
12828 AC_LANG_PUSH([C++])
12829 save_CXXFLAGS=$CXXFLAGS
12830 CXXFLAGS="$CXXFLAGS $flag_avx2"
12831 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12832 #include <immintrin.h>
12834 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
12835 c = _mm256_maddubs_epi16(a, b);
12839 [can_compile_avx2=yes],
12840 [can_compile_avx2=no])
12842 CXXFLAGS=$save_CXXFLAGS
12843 AC_MSG_RESULT([${can_compile_avx2}])
12844 if test "${can_compile_avx2}" = "yes" ; then
12845 LO_CLANG_CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
12848 AC_MSG_CHECKING([whether $CXX can compile AVX512 intrinsics])
12849 AC_LANG_PUSH([C++])
12850 save_CXXFLAGS=$CXXFLAGS
12851 CXXFLAGS="$CXXFLAGS $flag_avx512"
12852 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12853 #include <immintrin.h>
12855 __m512i a = _mm512_loadu_si512(0);
12856 __m512d v1 = _mm512_load_pd(0);
12857 // https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=gcc/config/i386/avx512fintrin.h;h=23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2
12858 __m512d v2 = _mm512_abs_pd(v1);
12862 [can_compile_avx512=yes],
12863 [can_compile_avx512=no])
12865 CXXFLAGS=$save_CXXFLAGS
12866 AC_MSG_RESULT([${can_compile_avx512}])
12867 if test "${can_compile_avx512}" = "yes" ; then
12868 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512="$flag_avx512"
12869 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F="$flag_avx512f"
12872 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
12873 AC_LANG_PUSH([C++])
12874 save_CXXFLAGS=$CXXFLAGS
12875 CXXFLAGS="$CXXFLAGS $flag_f16c"
12876 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12877 #include <immintrin.h>
12879 __m128i a = _mm_set1_epi32 (0);
12881 c = _mm_cvtph_ps(a);
12885 [can_compile_f16c=yes],
12886 [can_compile_f16c=no])
12888 CXXFLAGS=$save_CXXFLAGS
12889 AC_MSG_RESULT([${can_compile_f16c}])
12890 if test "${can_compile_f16c}" = "yes" ; then
12891 LO_CLANG_CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
12894 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
12895 AC_LANG_PUSH([C++])
12896 save_CXXFLAGS=$CXXFLAGS
12897 CXXFLAGS="$CXXFLAGS $flag_fma"
12898 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12899 #include <immintrin.h>
12901 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
12902 d = _mm256_fmadd_ps(a, b, c);
12906 [can_compile_fma=yes],
12907 [can_compile_fma=no])
12909 CXXFLAGS=$save_CXXFLAGS
12910 AC_MSG_RESULT([${can_compile_fma}])
12911 if test "${can_compile_fma}" = "yes" ; then
12912 LO_CLANG_CXXFLAGS_INTRINSICS_FMA="$flag_fma"
12919 # prefix LO_CLANG_CC/LO_CLANG_CXX with ccache if needed
12921 if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
12922 AC_MSG_CHECKING([whether $LO_CLANG_CC is already ccached])
12926 save_CFLAGS=$CFLAGS
12927 CFLAGS="$CFLAGS --ccache-skip -O2 -Werror"
12928 dnl an empty program will do, we're checking the compiler flags
12929 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
12930 [use_ccache=yes], [use_ccache=no])
12931 CFLAGS=$save_CFLAGS
12933 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
12934 AC_MSG_RESULT([yes])
12936 LO_CLANG_CC="$CCACHE $LO_CLANG_CC"
12937 AC_MSG_RESULT([no])
12941 AC_MSG_CHECKING([whether $LO_CLANG_CXX is already ccached])
12942 AC_LANG_PUSH([C++])
12944 CXX="$LO_CLANG_CXX"
12945 save_CXXFLAGS=$CXXFLAGS
12946 CXXFLAGS="$CXXFLAGS --ccache-skip -O2 -Werror"
12947 dnl an empty program will do, we're checking the compiler flags
12948 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
12949 [use_ccache=yes], [use_ccache=no])
12950 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
12951 AC_MSG_RESULT([yes])
12953 LO_CLANG_CXX="$CCACHE $LO_CLANG_CXX"
12954 AC_MSG_RESULT([no])
12956 CXXFLAGS=$save_CXXFLAGS
12961 AC_SUBST(LO_CLANG_CC)
12962 AC_SUBST(LO_CLANG_CXX)
12963 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE2)
12964 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3)
12965 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE41)
12966 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE42)
12967 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX)
12968 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX2)
12969 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512)
12970 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F)
12971 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_F16C)
12972 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_FMA)
12973 AC_SUBST(LO_CLANG_SHOWINCLUDES_PREFIX)
12974 AC_SUBST(LO_CLANG_VERSION)
12975 AC_SUBST(CLANG_USE_LD)
12976 AC_SUBST([HAVE_LO_CLANG_DLLEXPORTINLINES])
12980 AC_MSG_CHECKING([whether to enable gpgmepp])
12981 if test "$enable_gpgmepp" = no; then
12982 AC_MSG_RESULT([no])
12983 elif test "$enable_mpl_subset" = "yes"; then
12984 AC_MSG_RESULT([no (MPL only)])
12985 elif test "$enable_fuzzers" = "yes"; then
12986 AC_MSG_RESULT([no (oss-fuzz)])
12987 elif test \( \( "$_os" = "Linux" -o "$_os" = "Darwin" \) -a "$ENABLE_NSS" = TRUE \) -o "$_os" = "WINNT" ; then
12988 AC_MSG_RESULT([yes])
12989 dnl ===================================================================
12990 dnl Check for system gpgme
12991 dnl ===================================================================
12992 AC_MSG_CHECKING([which gpgmepp to use])
12993 if test "$with_system_gpgmepp" = "yes"; then
12994 AC_MSG_RESULT([external])
12995 SYSTEM_GPGMEPP=TRUE
12997 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
12998 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
12999 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp >= 1.14 development package])], [])
13000 AC_CHECK_HEADER(gpgme.h, [],
13001 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
13002 AC_CHECK_LIB(gpgmepp, main, [],
13003 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
13004 GPGMEPP_LIBS=-lgpgmepp
13006 AC_MSG_RESULT([internal])
13007 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
13009 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
13010 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
13011 if test "$_os" != "WINNT"; then
13012 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
13013 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
13016 ENABLE_GPGMEPP=TRUE
13017 AC_DEFINE([HAVE_FEATURE_GPGME])
13018 AC_PATH_PROG(GPG, gpg)
13019 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
13020 # so let's exclude that manually for the moment
13021 if test -n "$GPG" -a "$_os" != "WINNT"; then
13022 # make sure we not only have a working gpgme, but a full working
13023 # gpg installation to run OpenPGP signature verification
13024 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
13026 if test "$_os" = "Linux"; then
13028 AC_MSG_CHECKING([for /run/user/$uid])
13029 if test -d /run/user/$uid; then
13030 AC_MSG_RESULT([yes])
13031 AC_PATH_PROG(GPGCONF, gpgconf)
13033 # Older versions of gpgconf are not working as expected, since
13034 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
13035 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
13036 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
13037 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
13038 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
13039 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
13040 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
13041 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
13042 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
13043 if $GPGCONF --dump-options > /dev/null ; then
13044 if $GPGCONF --dump-options | grep -q create-socketdir ; then
13045 AC_MSG_RESULT([yes])
13046 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
13047 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
13049 AC_MSG_RESULT([no])
13052 AC_MSG_RESULT([no. missing or broken gpgconf?])
13055 AC_MSG_RESULT([no, $GPGCONF_VERSION])
13058 AC_MSG_RESULT([no])
13062 AC_MSG_RESULT([no (unsupported OS or missing NSS)])
13064 AC_SUBST(ENABLE_GPGMEPP)
13065 AC_SUBST(SYSTEM_GPGMEPP)
13066 AC_SUBST(GPG_ERROR_CFLAGS)
13067 AC_SUBST(GPG_ERROR_LIBS)
13068 AC_SUBST(LIBASSUAN_CFLAGS)
13069 AC_SUBST(LIBASSUAN_LIBS)
13070 AC_SUBST(GPGMEPP_CFLAGS)
13071 AC_SUBST(GPGMEPP_LIBS)
13073 AC_MSG_CHECKING([whether to build Java Websocket for the UNO remote websocket client])
13074 if test "$with_java" != "no"; then
13075 AC_MSG_RESULT([yes])
13076 ENABLE_JAVA_WEBSOCKET=TRUE
13077 BUILD_TYPE="$BUILD_TYPE JAVA_WEBSOCKET"
13080 AC_MSG_RESULT([no])
13081 ENABLE_JAVA_WEBSOCKET=
13083 AC_SUBST(ENABLE_JAVA_WEBSOCKET)
13085 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
13086 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
13087 AC_MSG_RESULT([yes])
13088 ENABLE_MEDIAWIKI=TRUE
13089 BUILD_TYPE="$BUILD_TYPE XSLTML"
13090 if test "x$with_java" = "xno"; then
13091 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
13094 AC_MSG_RESULT([no])
13096 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
13098 AC_SUBST(ENABLE_MEDIAWIKI)
13100 AC_MSG_CHECKING([whether to build the Report Builder])
13101 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
13102 AC_MSG_RESULT([yes])
13103 ENABLE_REPORTBUILDER=TRUE
13104 AC_MSG_CHECKING([which jfreereport libs to use])
13105 if test "$with_system_jfreereport" = "yes"; then
13106 SYSTEM_JFREEREPORT=TRUE
13107 AC_MSG_RESULT([external])
13108 if test -z $SAC_JAR; then
13109 SAC_JAR=/usr/share/java/sac.jar
13111 if ! test -f $SAC_JAR; then
13112 AC_MSG_ERROR(sac.jar not found.)
13115 if test -z $LIBXML_JAR; then
13116 if test -f /usr/share/java/libxml-1.0.0.jar; then
13117 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
13118 elif test -f /usr/share/java/libxml.jar; then
13119 LIBXML_JAR=/usr/share/java/libxml.jar
13121 AC_MSG_ERROR(libxml.jar replacement not found.)
13123 elif ! test -f $LIBXML_JAR; then
13124 AC_MSG_ERROR(libxml.jar not found.)
13127 if test -z $FLUTE_JAR; then
13128 if test -f /usr/share/java/flute-1.3.0.jar; then
13129 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
13130 elif test -f /usr/share/java/flute.jar; then
13131 FLUTE_JAR=/usr/share/java/flute.jar
13133 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
13135 elif ! test -f $FLUTE_JAR; then
13136 AC_MSG_ERROR(flute-1.3.0.jar not found.)
13139 if test -z $JFREEREPORT_JAR; then
13140 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
13141 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
13142 elif test -f /usr/share/java/flow-engine.jar; then
13143 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
13145 AC_MSG_ERROR(jfreereport.jar replacement not found.)
13147 elif ! test -f $JFREEREPORT_JAR; then
13148 AC_MSG_ERROR(jfreereport.jar not found.)
13151 if test -z $LIBLAYOUT_JAR; then
13152 if test -f /usr/share/java/liblayout-0.2.9.jar; then
13153 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
13154 elif test -f /usr/share/java/liblayout.jar; then
13155 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
13157 AC_MSG_ERROR(liblayout.jar replacement not found.)
13159 elif ! test -f $LIBLAYOUT_JAR; then
13160 AC_MSG_ERROR(liblayout.jar not found.)
13163 if test -z $LIBLOADER_JAR; then
13164 if test -f /usr/share/java/libloader-1.0.0.jar; then
13165 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
13166 elif test -f /usr/share/java/libloader.jar; then
13167 LIBLOADER_JAR=/usr/share/java/libloader.jar
13169 AC_MSG_ERROR(libloader.jar replacement not found.)
13171 elif ! test -f $LIBLOADER_JAR; then
13172 AC_MSG_ERROR(libloader.jar not found.)
13175 if test -z $LIBFORMULA_JAR; then
13176 if test -f /usr/share/java/libformula-0.2.0.jar; then
13177 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
13178 elif test -f /usr/share/java/libformula.jar; then
13179 LIBFORMULA_JAR=/usr/share/java/libformula.jar
13181 AC_MSG_ERROR(libformula.jar replacement not found.)
13183 elif ! test -f $LIBFORMULA_JAR; then
13184 AC_MSG_ERROR(libformula.jar not found.)
13187 if test -z $LIBREPOSITORY_JAR; then
13188 if test -f /usr/share/java/librepository-1.0.0.jar; then
13189 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
13190 elif test -f /usr/share/java/librepository.jar; then
13191 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
13193 AC_MSG_ERROR(librepository.jar replacement not found.)
13195 elif ! test -f $LIBREPOSITORY_JAR; then
13196 AC_MSG_ERROR(librepository.jar not found.)
13199 if test -z $LIBFONTS_JAR; then
13200 if test -f /usr/share/java/libfonts-1.0.0.jar; then
13201 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
13202 elif test -f /usr/share/java/libfonts.jar; then
13203 LIBFONTS_JAR=/usr/share/java/libfonts.jar
13205 AC_MSG_ERROR(libfonts.jar replacement not found.)
13207 elif ! test -f $LIBFONTS_JAR; then
13208 AC_MSG_ERROR(libfonts.jar not found.)
13211 if test -z $LIBSERIALIZER_JAR; then
13212 if test -f /usr/share/java/libserializer-1.0.0.jar; then
13213 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
13214 elif test -f /usr/share/java/libserializer.jar; then
13215 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
13217 AC_MSG_ERROR(libserializer.jar replacement not found.)
13219 elif ! test -f $LIBSERIALIZER_JAR; then
13220 AC_MSG_ERROR(libserializer.jar not found.)
13223 if test -z $LIBBASE_JAR; then
13224 if test -f /usr/share/java/libbase-1.0.0.jar; then
13225 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
13226 elif test -f /usr/share/java/libbase.jar; then
13227 LIBBASE_JAR=/usr/share/java/libbase.jar
13229 AC_MSG_ERROR(libbase.jar replacement not found.)
13231 elif ! test -f $LIBBASE_JAR; then
13232 AC_MSG_ERROR(libbase.jar not found.)
13236 AC_MSG_RESULT([internal])
13237 SYSTEM_JFREEREPORT=
13238 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
13241 BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
13243 AC_MSG_RESULT([no])
13244 ENABLE_REPORTBUILDER=
13245 SYSTEM_JFREEREPORT=
13247 AC_SUBST(ENABLE_REPORTBUILDER)
13248 AC_SUBST(SYSTEM_JFREEREPORT)
13250 AC_SUBST(LIBXML_JAR)
13251 AC_SUBST(FLUTE_JAR)
13252 AC_SUBST(JFREEREPORT_JAR)
13253 AC_SUBST(LIBBASE_JAR)
13254 AC_SUBST(LIBLAYOUT_JAR)
13255 AC_SUBST(LIBLOADER_JAR)
13256 AC_SUBST(LIBFORMULA_JAR)
13257 AC_SUBST(LIBREPOSITORY_JAR)
13258 AC_SUBST(LIBFONTS_JAR)
13259 AC_SUBST(LIBSERIALIZER_JAR)
13261 # scripting provider for BeanShell?
13262 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
13263 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
13264 AC_MSG_RESULT([yes])
13265 ENABLE_SCRIPTING_BEANSHELL=TRUE
13267 dnl ===================================================================
13268 dnl Check for system beanshell
13269 dnl ===================================================================
13270 AC_MSG_CHECKING([which beanshell to use])
13271 if test "$with_system_beanshell" = "yes"; then
13272 AC_MSG_RESULT([external])
13274 if test -z $BSH_JAR; then
13275 BSH_JAR=/usr/share/java/bsh.jar
13277 if ! test -f $BSH_JAR; then
13278 AC_MSG_ERROR(bsh.jar not found.)
13281 AC_MSG_RESULT([internal])
13283 BUILD_TYPE="$BUILD_TYPE BSH"
13286 AC_MSG_RESULT([no])
13287 ENABLE_SCRIPTING_BEANSHELL=
13288 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
13290 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
13291 AC_SUBST(SYSTEM_BSH)
13294 # scripting provider for JavaScript?
13295 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
13296 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
13297 AC_MSG_RESULT([yes])
13298 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
13300 dnl ===================================================================
13301 dnl Check for system rhino
13302 dnl ===================================================================
13303 AC_MSG_CHECKING([which rhino to use])
13304 if test "$with_system_rhino" = "yes"; then
13305 AC_MSG_RESULT([external])
13307 if test -z $RHINO_JAR; then
13308 RHINO_JAR=/usr/share/java/js.jar
13310 if ! test -f $RHINO_JAR; then
13311 AC_MSG_ERROR(js.jar not found.)
13314 AC_MSG_RESULT([internal])
13316 BUILD_TYPE="$BUILD_TYPE RHINO"
13320 AC_MSG_RESULT([no])
13321 ENABLE_SCRIPTING_JAVASCRIPT=
13322 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
13324 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
13325 AC_SUBST(SYSTEM_RHINO)
13326 AC_SUBST(RHINO_JAR)
13328 # This is only used in Qt5/Qt6/KF5/KF6 checks to determine if /usr/lib64
13329 # paths should be added to library search path. So let's put all 64-bit
13332 case "$host_cpu" in
13333 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el | loongarch64 | riscv64)
13334 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
13335 supports_multilib="yes"
13342 dnl ===================================================================
13343 dnl QT5 Integration
13344 dnl ===================================================================
13348 QT5_GOBJECT_CFLAGS=""
13349 QT5_GOBJECT_LIBS=""
13350 QT5_HAVE_GOBJECT=""
13351 QT5_PLATFORMS_SRCDIR=""
13352 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
13353 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
13354 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
13356 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
13357 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
13359 if test -n "$supports_multilib"; then
13360 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
13363 qt5_test_include="QtWidgets/qapplication.h"
13364 if test "$_os" = "Emscripten"; then
13365 qt5_test_library="libQt5Widgets.a"
13367 qt5_test_library="libQt5Widgets.so"
13370 dnl Check for qmake5
13371 if test -n "$QT5DIR"; then
13372 AC_PATH_PROG(QMAKE5, [qmake], no, [$QT5DIR/bin])
13374 AC_PATH_PROGS(QMAKE5, [qmake-qt5 qmake], no)
13376 if test "$QMAKE5" = "no"; then
13377 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13379 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
13380 if test -z "$qmake5_test_ver"; then
13381 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13383 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
13384 qt5_minimal_minor="15"
13385 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
13386 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
13388 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
13392 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
13393 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
13394 qt5_platformsdir="`$QMAKE5 -query QT_INSTALL_PLUGINS`/platforms"
13395 QT5_PLATFORMS_SRCDIR="$qt5_platformsdir"
13397 AC_MSG_CHECKING([for Qt5 headers])
13399 for inc_dir in $qt5_incdirs; do
13400 if test -r "$inc_dir/$qt5_test_include"; then
13401 qt5_incdir="$inc_dir"
13405 AC_MSG_RESULT([$qt5_incdir])
13406 if test "x$qt5_incdir" = "xno"; then
13407 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13409 # check for scenario: qt5-qtbase-devel-*.86_64 installed but host is i686
13410 AC_LANG_PUSH([C++])
13411 save_CPPFLAGS=$CPPFLAGS
13412 CPPFLAGS="${CPPFLAGS} -I${qt5_incdir}"
13413 AC_CHECK_HEADER(QtCore/qconfig.h, [],
13414 [AC_MSG_ERROR(qconfig.h header not found.)], [])
13415 CPPFLAGS=$save_CPPFLAGS
13418 AC_MSG_CHECKING([for Qt5 libraries])
13420 for lib_dir in $qt5_libdirs; do
13421 if test -r "$lib_dir/$qt5_test_library"; then
13422 qt5_libdir="$lib_dir"
13426 AC_MSG_RESULT([$qt5_libdir])
13427 if test "x$qt5_libdir" = "xno"; then
13428 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13431 if test "$_os" = "Emscripten"; then
13432 if test ! -f "$QT5_PLATFORMS_SRCDIR"/wasm_shell.html ; then
13433 QT5_PLATFORMS_SRCDIR="${QT5_PLATFORMS_SRCDIR/plugins/src\/plugins}/wasm"
13435 if test ! -f "${qt5_platformsdir}"/libqwasm.a -o ! -f "$QT5_PLATFORMS_SRCDIR"/wasm_shell.html; then
13436 AC_MSG_ERROR([No Qt5 WASM QPA plugin found in ${qt5_platformsdir} or ${QT5_PLATFORMS_SRCDIR}])
13439 EMSDK_LLVM_NM="$(em-config LLVM_ROOT)"/llvm-nm
13440 if ! test -x "$EMSDK_LLVM_NM"; then
13441 AC_MSG_ERROR([Missing llvm-nm expected to be found at "$EMSDK_LLVM_NM".])
13443 if test ! -f "${qt5_libdir}"/libQt5Gui.a; then
13444 AC_MSG_ERROR([No Qt5 WASM libQt5Gui.a in ${qt5_libdir}])
13446 QT5_WASM_SJLJ="`${EMSDK_LLVM_NM} "${qt5_libdir}"/libQt5Gui.a 2>/dev/null | $GREP emscripten_longjmp`"
13447 if test -n "$QT5_WASM_SJLJ"; then
13448 AC_MSG_ERROR(['emscripten_longjmp' symbol found in libQt5Gui.a (missing '-s SUPPORT_LONGJMP=wasm'). See static/README.wasm.md.])
13452 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
13453 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13454 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
13455 if test "$_os" = "Emscripten"; then
13456 QT5_LIBS="$QT5_LIBS -lqtpcre2 -lQt5EventDispatcherSupport -lQt5FontDatabaseSupport -L${qt5_platformsdir} -lqwasm"
13459 if test "$USING_X11" = TRUE; then
13460 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
13461 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
13462 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
13464 AC_DEFINE(QT5_USING_X11)
13467 dnl Check for Meta Object Compiler
13469 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH])
13470 if test "$MOC5" = "no"; then
13471 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
13472 the root of your Qt installation by exporting QT5DIR before running "configure".])
13475 if test "$test_gstreamer_1_0" = yes; then
13476 PKG_CHECK_MODULES(QT5_GOBJECT,[gobject-2.0], [
13478 AC_DEFINE(QT5_HAVE_GOBJECT)
13480 AC_MSG_WARN([[No GObject found, can't use QWidget GStreamer sink on wayland!]])
13484 AC_SUBST(QT5_CFLAGS)
13487 AC_SUBST(QT5_GOBJECT_CFLAGS)
13488 AC_SUBST(QT5_GOBJECT_LIBS)
13489 AC_SUBST(QT5_HAVE_GOBJECT)
13490 AC_SUBST(QT5_PLATFORMS_SRCDIR)
13492 dnl ===================================================================
13493 dnl QT6 Integration
13494 dnl ===================================================================
13498 QT6_PLATFORMS_SRCDIR=""
13499 ENABLE_QT6_MULTIMEDIA=""
13500 if test \( "$test_kf6" = "yes" -a "$ENABLE_KF6" = "TRUE" \) -o \
13501 \( "$test_qt6" = "yes" -a "$ENABLE_QT6" = "TRUE" \)
13503 qt6_incdirs="$QT6INC /usr/include/qt6 /usr/include $x_includes"
13504 qt6_libdirs="$QT6LIB /usr/lib/qt6 /usr/lib $x_libraries"
13506 if test -n "$supports_multilib"; then
13507 qt6_libdirs="$qt6_libdirs /usr/lib64/qt6 /usr/lib64/qt /usr/lib64"
13510 qt6_test_include="QtWidgets/qapplication.h"
13511 if test "$_os" = "Emscripten"; then
13512 qt6_test_library="libQt6Widgets.a"
13514 qt6_test_library="libQt6Widgets.so"
13517 dnl Check for qmake6
13518 if test -n "$QT6DIR"; then
13519 AC_PATH_PROG(QMAKE6, [qmake], no, [$QT6DIR/bin])
13521 AC_PATH_PROGS(QMAKE6, [qmake-qt6 qmake6 qmake], no)
13523 if test "$QMAKE6" = "no"; then
13524 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13526 qmake6_test_ver="`$QMAKE6 -v 2>&1 | $SED -n -e 's/^Using Qt version \(6\.[[0-9.]]\+\).*$/\1/p'`"
13527 if test -z "$qmake6_test_ver"; then
13528 AC_MSG_ERROR([Wrong qmake for Qt6 found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13530 AC_MSG_NOTICE([Detected Qt6 version: $qmake6_test_ver])
13533 qt6_incdirs="`$QMAKE6 -query QT_INSTALL_HEADERS` $qt6_incdirs"
13534 qt6_libdirs="`$QMAKE6 -query QT_INSTALL_LIBS` $qt6_libdirs"
13535 qt6_platformsdir="`$QMAKE6 -query QT_INSTALL_PLUGINS`/platforms"
13536 QT6_PLATFORMS_SRCDIR="$qt6_platformsdir"
13538 AC_MSG_CHECKING([for Qt6 headers])
13540 for inc_dir in $qt6_incdirs; do
13541 if test -r "$inc_dir/$qt6_test_include"; then
13542 qt6_incdir="$inc_dir"
13546 AC_MSG_RESULT([$qt6_incdir])
13547 if test "x$qt6_incdir" = "xno"; then
13548 AC_MSG_ERROR([Qt6 headers not found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13550 # check for scenario: qt6-qtbase-devel-*.86_64 installed but host is i686
13551 AC_LANG_PUSH([C++])
13552 save_CPPFLAGS=$CPPFLAGS
13553 CPPFLAGS="${CPPFLAGS} -I${qt6_incdir}"
13554 AC_CHECK_HEADER(QtCore/qconfig.h, [],
13555 [AC_MSG_ERROR(qconfig.h header not found.)], [])
13556 CPPFLAGS=$save_CPPFLAGS
13559 AC_MSG_CHECKING([for Qt6 libraries])
13561 for lib_dir in $qt6_libdirs; do
13562 if test -r "$lib_dir/$qt6_test_library"; then
13563 qt6_libdir="$lib_dir"
13567 AC_MSG_RESULT([$qt6_libdir])
13568 if test "x$qt6_libdir" = "xno"; then
13569 AC_MSG_ERROR([Qt6 libraries not found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13572 if test "$_os" = "Emscripten"; then
13573 if test ! -f "$QT6_PLATFORMS_SRCDIR"/wasm_shell.html ; then
13574 QT6_PLATFORMS_SRCDIR="${QT6_PLATFORMS_SRCDIR/plugins/src\/plugins}/wasm"
13576 if test ! -f "${qt6_platformsdir}"/libqwasm.a -o ! -f "$QT6_PLATFORMS_SRCDIR"/wasm_shell.html; then
13577 AC_MSG_ERROR([No Qt6 WASM QPA plugin found in ${qt6_platformsdir} or ${QT6_PLATFORMS_SRCDIR}])
13581 QT6_CFLAGS="-I$qt6_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
13582 QT6_CFLAGS=$(printf '%s' "$QT6_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13583 QT6_LIBS="-L$qt6_libdir -lQt6Core -lQt6Gui -lQt6Widgets -lQt6Network"
13584 if test "$_os" = "Emscripten"; then
13585 QT6_LIBS="$QT6_LIBS -lQt6BundledPcre2 -lQt6BundledZLIB -L${qt6_platformsdir} -lqwasm -sGL_ENABLE_GET_PROC_ADDRESS"
13587 if ! test "$enable_qt6_multimedia" = "no"; then
13588 if ! test -r "$qt6_incdir/QtMultimediaWidgets/QVideoWidget"; then
13589 AC_MSG_ERROR([Qt 6 QMultimedia not found.])
13592 ENABLE_QT6_MULTIMEDIA=TRUE
13593 QT6_LIBS="$QT6_LIBS -lQt6Multimedia -lQt6MultimediaWidgets"
13597 if test "$USING_X11" = TRUE; then
13598 PKG_CHECK_MODULES(QT6_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for key modifier handling in X11.])])
13599 QT6_CFLAGS="$QT6_CFLAGS $QT6_XCB_CFLAGS"
13600 QT6_LIBS="$QT6_LIBS $QT6_XCB_LIBS"
13602 AC_DEFINE(QT6_USING_X11)
13605 dnl Check for Meta Object Compiler
13607 for lib_dir in $qt6_libdirs; do
13608 if test -z "$qt6_libexec_dirs"; then
13609 qt6_libexec_dirs="$lib_dir/libexec"
13611 qt6_libexec_dirs="$qt6_libexec_dirs:$lib_dir/libexec"
13614 AC_PATH_PROGS( MOC6, [moc-qt6 moc], no, [`dirname $qt6_libdir`/libexec:$QT6DIR/libexec:$qt6_libexec_dirs:`echo $qt6_libdirs | $SED -e 's/ /:/g'`:$PATH])
13615 if test "$MOC6" = "no"; then
13616 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
13617 the root of your Qt installation by exporting QT6DIR before running "configure".])
13619 moc6_test_ver="`$MOC6 -v 2>&1 | $SED -n -e 's/^moc \(6.*\)/\1/p'`"
13620 if test -z "$moc6_test_ver"; then
13621 AC_MSG_ERROR([Wrong moc for Qt6 found.])
13623 AC_MSG_NOTICE([Detected moc version: $moc_test_ver])
13626 AC_SUBST(QT6_CFLAGS)
13629 AC_SUBST(QT6_PLATFORMS_SRCDIR)
13630 AC_SUBST(ENABLE_QT6_MULTIMEDIA)
13632 dnl ===================================================================
13633 dnl KF5 Integration
13634 dnl ===================================================================
13638 KF5_CONFIG="kf5-config"
13639 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
13640 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
13642 if test "$OS" = "HAIKU"; then
13643 haiku_arch="`echo $RTL_ARCH | tr X x`"
13644 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
13645 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
13648 kf5_incdirs="$KF5INC /usr/include $kf5_haiku_incdirs $x_includes"
13649 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
13650 if test -n "$supports_multilib"; then
13651 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
13654 kf5_test_include="KF5/KIOFileWidgets/KFileWidget"
13655 kf5_test_library="libKF5KIOFileWidgets.so"
13656 kf5_libdirs="$qt5_libdir $kf5_libdirs"
13658 dnl kf5 KDE4 support compatibility installed
13659 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
13660 if test "$KF5_CONFIG" != "no"; then
13661 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
13662 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
13665 dnl Check for KF5 headers
13666 AC_MSG_CHECKING([for KF5 headers])
13668 for kf5_check in $kf5_incdirs; do
13669 if test -r "$kf5_check/$kf5_test_include"; then
13670 kf5_incdir="$kf5_check/KF5"
13674 AC_MSG_RESULT([$kf5_incdir])
13675 if test "x$kf5_incdir" = "xno"; then
13676 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
13679 dnl Check for KF5 libraries
13680 AC_MSG_CHECKING([for KF5 libraries])
13682 for kf5_check in $kf5_libdirs; do
13683 if test -r "$kf5_check/$kf5_test_library"; then
13684 kf5_libdir="$kf5_check"
13689 AC_MSG_RESULT([$kf5_libdir])
13690 if test "x$kf5_libdir" = "xno"; then
13691 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
13694 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"
13695 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
13696 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13698 if test "$USING_X11" = TRUE; then
13699 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
13702 AC_LANG_PUSH([C++])
13703 save_CXXFLAGS=$CXXFLAGS
13704 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
13705 AC_MSG_CHECKING([whether KDE is >= 5.0])
13706 AC_RUN_IFELSE([AC_LANG_SOURCE([[
13707 #include <kcoreaddons_version.h>
13709 int main(int argc, char **argv) {
13710 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
13713 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
13714 CXXFLAGS=$save_CXXFLAGS
13717 AC_SUBST(KF5_CFLAGS)
13720 dnl ===================================================================
13721 dnl KF6 Integration
13722 dnl ===================================================================
13726 if test \( "$test_kf6" = "yes" -a "$ENABLE_KF6" = "TRUE" \)
13728 if test "$OS" = "HAIKU"; then
13729 haiku_arch="`echo $RTL_ARCH | tr X x`"
13730 kf6_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
13731 kf6_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
13734 kf6_incdirs="$KF6INC /usr/include $kf6_haiku_incdirs $x_includes"
13735 kf6_libdirs="$KF6LIB /usr/lib /usr/lib/kf6 /usr/lib/kf6/devel $kf6_haiku_libdirs $x_libraries"
13736 if test -n "$supports_multilib"; then
13737 kf6_libdirs="$kf6_libdirs /usr/lib64 /usr/lib64/kf6 /usr/lib64/kf6/devel"
13740 kf6_test_include="KF6/KIOFileWidgets/KFileWidget"
13741 kf6_test_library="libKF6KIOFileWidgets.so"
13742 kf6_libdirs="$qt6_libdir $kf6_libdirs"
13744 dnl Check for KF6 headers
13745 AC_MSG_CHECKING([for KF6 headers])
13747 for kf6_check in $kf6_incdirs; do
13748 if test -r "$kf6_check/$kf6_test_include"; then
13749 kf6_incdir="$kf6_check/KF6"
13753 AC_MSG_RESULT([$kf6_incdir])
13754 if test "x$kf6_incdir" = "xno"; then
13755 AC_MSG_ERROR([KF6 headers not found. Please specify the root of your KF6 installation by exporting KF6DIR before running "configure".])
13758 dnl Check for KF6 libraries
13759 AC_MSG_CHECKING([for KF6 libraries])
13761 for kf6_check in $kf6_libdirs; do
13762 if test -r "$kf6_check/$kf6_test_library"; then
13763 kf6_libdir="$kf6_check"
13768 AC_MSG_RESULT([$kf6_libdir])
13769 if test "x$kf6_libdir" = "xno"; then
13770 AC_MSG_ERROR([KF6 libraries not found. Please specify the root of your KF6 installation by exporting KF6DIR before running "configure".])
13773 KF6_CFLAGS="-I$kf6_incdir -I$kf6_incdir/KCoreAddons -I$kf6_incdir/KI18n -I$kf6_incdir/KConfig -I$kf6_incdir/KConfigCore -I$kf6_incdir/KWindowSystem -I$kf6_incdir/KIO -I$kf6_incdir/KIOCore -I$kf6_incdir/KIOWidgets -I$kf6_incdir/KIOFileWidgets -I$qt6_incdir -I$qt6_incdir/QtCore -I$qt6_incdir/QtGui -I$qt6_incdir/QtWidgets -I$qt6_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
13774 KF6_LIBS="-L$kf6_libdir -lKF6CoreAddons -lKF6I18n -lKF6ConfigCore -lKF6WindowSystem -lKF6KIOCore -lKF6KIOWidgets -lKF6KIOFileWidgets -L$qt6_libdir -lQt6Core -lQt6Gui -lQt6Widgets -lQt6Network"
13775 KF6_CFLAGS=$(printf '%s' "$KF6_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13777 AC_LANG_PUSH([C++])
13778 save_CXXFLAGS=$CXXFLAGS
13779 CXXFLAGS="$CXXFLAGS $KF6_CFLAGS"
13780 dnl KF6 development version as of 2023-06 uses version number 5.240
13781 AC_MSG_CHECKING([whether KDE is >= 5.240])
13782 AC_RUN_IFELSE([AC_LANG_SOURCE([[
13783 #include <kcoreaddons_version.h>
13785 int main(int argc, char **argv) {
13786 if (KCOREADDONS_VERSION_MAJOR == 6 || (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 240)) return 0;
13789 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
13790 CXXFLAGS=$save_CXXFLAGS
13793 AC_SUBST(KF6_CFLAGS)
13796 if test "$enable_qt6_multimedia" = "yes" -a "$ENABLE_QT6" != "TRUE"; then
13797 AC_MSG_ERROR([--enable-qt6-multimedia requires --enable-qt6 or --enable-kf6])
13800 dnl ===================================================================
13801 dnl Test whether to include Evolution 2 support
13802 dnl ===================================================================
13803 AC_MSG_CHECKING([whether to enable evolution 2 support])
13804 if test "$enable_evolution2" = yes; then
13805 AC_MSG_RESULT([yes])
13806 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
13807 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13808 FilterLibs "${GOBJECT_LIBS}"
13809 GOBJECT_LIBS="${filteredlibs}"
13810 ENABLE_EVOAB2="TRUE"
13812 AC_MSG_RESULT([no])
13814 AC_SUBST(ENABLE_EVOAB2)
13815 AC_SUBST(GOBJECT_CFLAGS)
13816 AC_SUBST(GOBJECT_LIBS)
13818 dnl ===================================================================
13819 dnl Test which themes to include
13820 dnl ===================================================================
13821 AC_MSG_CHECKING([which themes to include])
13822 # if none given use default subset of available themes
13823 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
13824 with_theme="breeze breeze_dark breeze_dark_svg breeze_svg colibre colibre_svg colibre_dark colibre_dark_svg elementary elementary_svg karasa_jaga karasa_jaga_svg sifr sifr_svg sifr_dark sifr_dark_svg sukapura sukapura_dark sukapura_dark_svg sukapura_svg"
13828 if test "x$with_theme" != "xno"; then
13829 for theme in $with_theme; do
13831 breeze|breeze_dark|breeze_dark_svg|breeze_svg|colibre|colibre_svg|colibre_dark|colibre_dark_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg|sifr|sifr_svg|sifr_dark|sifr_dark_svg|sukapura|sukapura_dark|sukapura_dark_svg|sukapura_svg) WITH_THEMES="${WITH_THEMES:+$WITH_THEMES }$theme" ;;
13832 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
13836 AC_MSG_RESULT([$WITH_THEMES])
13837 AC_SUBST([WITH_THEMES])
13839 ###############################################################################
13840 # Extensions checking
13841 ###############################################################################
13842 AC_MSG_CHECKING([for extensions integration])
13843 if test "x$enable_extension_integration" != "xno"; then
13844 WITH_EXTENSION_INTEGRATION=TRUE
13845 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
13846 AC_MSG_RESULT([yes, use integration])
13848 WITH_EXTENSION_INTEGRATION=
13849 AC_MSG_RESULT([no, do not integrate])
13851 AC_SUBST(WITH_EXTENSION_INTEGRATION)
13853 dnl Should any extra extensions be included?
13854 dnl There are standalone tests for each of these below.
13855 WITH_EXTRA_EXTENSIONS=
13856 AC_SUBST([WITH_EXTRA_EXTENSIONS])
13858 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
13859 if test "x$with_java" != "xno"; then
13860 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
13863 AC_MSG_CHECKING([whether to build opens___.ttf])
13864 if test "$enable_build_opensymbol" = "yes"; then
13865 AC_MSG_RESULT([yes])
13866 AC_PATH_PROG(FONTFORGE, fontforge)
13867 if test -z "$FONTFORGE"; then
13868 AC_MSG_ERROR([fontforge not installed])
13871 AC_MSG_RESULT([no])
13872 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
13874 AC_SUBST(FONTFORGE)
13876 dnl ===================================================================
13877 dnl Test whether to include fonts
13878 dnl ===================================================================
13879 AC_MSG_CHECKING([whether to include third-party fonts])
13880 if test "$with_fonts" != "no"; then
13881 AC_MSG_RESULT([yes])
13883 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
13884 AC_DEFINE(HAVE_MORE_FONTS)
13886 AC_MSG_RESULT([no])
13888 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
13890 AC_SUBST(WITH_FONTS)
13893 dnl ===================================================================
13894 dnl Test whether to enable online update service
13895 dnl ===================================================================
13896 AC_MSG_CHECKING([whether to enable online update])
13897 ENABLE_ONLINE_UPDATE=
13898 if test "$enable_online_update" = ""; then
13899 AC_MSG_RESULT([no])
13901 if test "$enable_online_update" = "mar"; then
13902 AC_MSG_ERROR([--enable-online-update=mar is deprecated, use --enable-online-update-mar instead])
13903 elif test "$enable_online_update" = "yes"; then
13904 if test "$enable_curl" != "yes"; then
13905 AC_MSG_ERROR([--disable-online-update must be used when --disable-curl is used])
13907 AC_MSG_RESULT([yes])
13908 ENABLE_ONLINE_UPDATE="TRUE"
13910 AC_MSG_RESULT([no])
13913 AC_SUBST(ENABLE_ONLINE_UPDATE)
13916 dnl ===================================================================
13917 dnl Test whether to enable mar online update service
13918 dnl ===================================================================
13919 AC_MSG_CHECKING([whether to enable mar online update])
13920 ENABLE_ONLINE_UPDATE_MAR=
13921 if test "$enable_online_update_mar" = yes; then
13922 AC_MSG_RESULT([yes])
13923 BUILD_TYPE="$BUILD_TYPE ONLINEUPDATE"
13924 ENABLE_ONLINE_UPDATE_MAR="TRUE"
13925 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
13927 AC_MSG_RESULT([no])
13929 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
13931 AC_MSG_CHECKING([for mar online update baseurl])
13932 ONLINEUPDATE_MAR_BASEURL=$with_online_update_mar_baseurl
13933 if test -n "$ONLINEUPDATE_MAR_BASEURL"; then
13934 AC_MSG_RESULT([yes])
13936 AC_MSG_RESULT([no])
13938 AC_SUBST(ONLINEUPDATE_MAR_BASEURL)
13940 AC_MSG_CHECKING([for mar online update certificateder])
13941 ONLINEUPDATE_MAR_CERTIFICATEDER=$with_online_update_mar_certificateder
13942 if test -n "$ONLINEUPDATE_MAR_CERTIFICATEDER"; then
13943 AC_MSG_RESULT([yes])
13945 AC_MSG_RESULT([no])
13947 AC_SUBST(ONLINEUPDATE_MAR_CERTIFICATEDER)
13949 AC_MSG_CHECKING([for mar online update certificatename])
13950 ONLINEUPDATE_MAR_CERTIFICATENAME=$with_online_update_mar_certificatename
13951 if test -n "$ONLINEUPDATE_MAR_CERTIFICATENAME"; then
13952 AC_MSG_RESULT([yes])
13954 AC_MSG_RESULT([no])
13956 AC_SUBST(ONLINEUPDATE_MAR_CERTIFICATENAME)
13958 AC_MSG_CHECKING([for mar online update certificatepath])
13959 ONLINEUPDATE_MAR_CERTIFICATEPATH=$with_online_update_mar_certificatepath
13960 if test -n "$ONLINEUPDATE_MAR_CERTIFICATEPATH"; then
13961 AC_MSG_RESULT([yes])
13963 AC_MSG_RESULT([no])
13965 AC_SUBST(ONLINEUPDATE_MAR_CERTIFICATEPATH)
13968 PRIVACY_POLICY_URL="$with_privacy_policy_url"
13969 if test "$ENABLE_ONLINE_UPDATE" = TRUE -o "$ENABLE_BREAKPAD" = "TRUE"; then
13970 if test "x$with_privacy_policy_url" = "xundefined"; then
13971 AC_MSG_FAILURE([online update or breakpad/crashreporting are enabled, but no --with-privacy-policy-url=... was provided])
13974 AC_SUBST(PRIVACY_POLICY_URL)
13975 dnl ===================================================================
13976 dnl Test whether we need bzip2
13977 dnl ===================================================================
13979 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE" -o "$enable_python" = internal; then
13980 AC_MSG_CHECKING([whether to use system bzip2])
13981 if test "$with_system_bzip2" = yes; then
13983 AC_MSG_RESULT([yes])
13984 PKG_CHECK_MODULES(BZIP2, bzip2)
13985 FilterLibs "${BZIP2_LIBS}"
13986 BZIP2_LIBS="${filteredlibs}"
13988 AC_MSG_RESULT([no])
13989 BUILD_TYPE="$BUILD_TYPE BZIP2"
13992 AC_SUBST(SYSTEM_BZIP2)
13993 AC_SUBST(BZIP2_CFLAGS)
13994 AC_SUBST(BZIP2_LIBS)
13996 dnl ===================================================================
13997 dnl Test whether to enable extension update
13998 dnl ===================================================================
13999 AC_MSG_CHECKING([whether to enable extension update])
14000 ENABLE_EXTENSION_UPDATE=
14001 if test "x$enable_extension_update" = "xno"; then
14002 AC_MSG_RESULT([no])
14004 AC_MSG_RESULT([yes])
14005 ENABLE_EXTENSION_UPDATE="TRUE"
14006 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
14007 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
14009 AC_SUBST(ENABLE_EXTENSION_UPDATE)
14012 dnl ===================================================================
14013 dnl Test whether to create MSI with LIMITUI=1 (silent install)
14014 dnl ===================================================================
14015 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
14016 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
14017 AC_MSG_RESULT([no])
14020 AC_MSG_RESULT([yes])
14021 ENABLE_SILENT_MSI=TRUE
14022 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
14024 AC_SUBST(ENABLE_SILENT_MSI)
14026 dnl ===================================================================
14027 dnl Check for WiX tools.
14028 dnl ===================================================================
14029 if test "$enable_wix" = "" -o "enable_wix" = "no"; then
14030 AC_MSG_RESULT([no])
14033 AC_MSG_RESULT([yes])
14034 # FIXME: this should do proper detection, but the path is currently
14035 # hardcoded in msicreator/createmsi.py
14036 if ! test -x "/cygdrive/c/Program Files (x86)/WiX Toolset v3.11/bin/candle"; then
14037 AC_MSG_ERROR([WiX requested but WiX toolset v3.11 not found at the expected location])
14041 AC_SUBST(ENABLE_WIX)
14043 AC_MSG_CHECKING([whether and how to use Xinerama])
14044 if test "$USING_X11" = TRUE; then
14045 if test "$x_libraries" = "default_x_libraries"; then
14046 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
14047 if test "x$XINERAMALIB" = x; then
14048 XINERAMALIB="/usr/lib"
14051 XINERAMALIB="$x_libraries"
14053 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
14054 # we have both versions, let the user decide but use the dynamic one
14057 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
14058 XINERAMA_LINK=dynamic
14060 XINERAMA_LINK=static
14062 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
14063 # we have only the dynamic version
14065 XINERAMA_LINK=dynamic
14066 elif test -e "$XINERAMALIB/libXinerama.a"; then
14068 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
14070 XINERAMA_LINK=static
14080 if test "$USE_XINERAMA" = "TRUE"; then
14081 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
14082 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
14083 [AC_MSG_ERROR(Xinerama header not found.)], [])
14084 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
14085 if test "x$XEXTLIB" = x; then
14086 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
14088 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
14089 if test "$_os" = "FreeBSD"; then
14090 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
14092 if test "$_os" = "Linux"; then
14093 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
14095 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
14096 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
14098 AC_MSG_ERROR([libXinerama not found or wrong architecture.])
14103 AC_MSG_RESULT([no])
14105 AC_SUBST(XINERAMA_LINK)
14107 AC_MSG_CHECKING([whether to use non-standard RGBA32 cairo pixel order])
14108 if test -z "$enable_cairo_rgba" -a "$_os" = "Android"; then
14109 enable_cairo_rgba=yes
14111 if test "$enable_cairo_rgba" = yes; then
14112 AC_DEFINE(ENABLE_CAIRO_RGBA)
14113 ENABLE_CAIRO_RGBA=TRUE
14114 AC_MSG_RESULT([yes])
14117 AC_MSG_RESULT([no])
14119 AC_SUBST(ENABLE_CAIRO_RGBA)
14121 dnl ===================================================================
14122 dnl Test whether to build cairo or rely on the system version
14123 dnl ===================================================================
14125 if test "$test_cairo" = "yes"; then
14126 AC_MSG_CHECKING([whether to use the system cairo])
14128 : ${with_system_cairo:=$with_system_libs}
14129 if test "$with_system_cairo" = "yes" -a "$enable_cairo_rgba" != "yes"; then
14131 AC_MSG_RESULT([yes])
14133 PKG_CHECK_MODULES( CAIRO, cairo >= 1.12.0 )
14134 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
14135 FilterLibs "${CAIRO_LIBS}"
14136 CAIRO_LIBS="${filteredlibs}"
14138 if test "$test_xrender" = "yes"; then
14139 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
14141 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
14142 #ifdef PictStandardA8
14146 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
14151 AC_MSG_RESULT([no])
14152 BUILD_TYPE="$BUILD_TYPE CAIRO"
14155 if test "$enable_cairo_canvas" != no; then
14156 AC_DEFINE(ENABLE_CAIRO_CANVAS)
14157 ENABLE_CAIRO_CANVAS=TRUE
14161 AC_SUBST(CAIRO_CFLAGS)
14162 AC_SUBST(CAIRO_LIBS)
14163 AC_SUBST(ENABLE_CAIRO_CANVAS)
14164 AC_SUBST(SYSTEM_CAIRO)
14166 dnl ===================================================================
14167 dnl Test whether to use avahi
14168 dnl ===================================================================
14169 if test "$_os" = "WINNT"; then
14170 # Windows uses bundled mDNSResponder
14171 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
14172 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
14173 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
14174 [ENABLE_AVAHI="TRUE"])
14175 AC_DEFINE(HAVE_FEATURE_AVAHI)
14176 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
14177 FilterLibs "${AVAHI_LIBS}"
14178 AVAHI_LIBS="${filteredlibs}"
14181 AC_SUBST(ENABLE_AVAHI)
14182 AC_SUBST(AVAHI_CFLAGS)
14183 AC_SUBST(AVAHI_LIBS)
14185 dnl ===================================================================
14186 dnl Test whether to use MSVC /analyze
14187 dnl ===================================================================
14188 ENABLE_MSVC_ANALYZE=
14189 AC_MSG_CHECKING([whether to use MSVC /analyze])
14190 if test -n "$enable_msvc_analyze" -a "$enable_msvc_analyze" != "no"; then
14191 if test "$_os" = "WINNT"; then
14192 ENABLE_MSVC_ANALYZE=Yes
14193 AC_MSG_RESULT([yes])
14195 AC_MSG_ERROR([--enable-msvc-analyze is only supported on Windows])
14198 AC_MSG_RESULT([no])
14201 AC_SUBST(ENABLE_MSVC_ANALYZE)
14203 dnl ===================================================================
14204 dnl Test whether to use liblangtag
14205 dnl ===================================================================
14207 AC_MSG_CHECKING([whether to use system liblangtag])
14208 if test "$with_system_liblangtag" = yes; then
14209 SYSTEM_LIBLANGTAG=TRUE
14210 AC_MSG_RESULT([yes])
14211 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
14212 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
14213 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
14214 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
14215 FilterLibs "${LIBLANGTAG_LIBS}"
14216 LIBLANGTAG_LIBS="${filteredlibs}"
14219 AC_MSG_RESULT([no])
14220 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
14221 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
14222 if test "$COM" = "MSC"; then
14223 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
14225 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
14228 AC_SUBST(SYSTEM_LIBLANGTAG)
14229 AC_SUBST(LIBLANGTAG_CFLAGS)
14230 AC_SUBST(LIBLANGTAG_LIBS)
14232 dnl ===================================================================
14233 dnl Test whether to build libpng or rely on the system version
14234 dnl ===================================================================
14236 LIBPNG_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/libpng"
14237 LIBPNG_LIBS_internal='-L$(gb_StaticLibrary_WORKDIR) -llibpng'
14238 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng])
14240 dnl ===================================================================
14241 dnl Test whether to build libtiff or rely on the system version
14242 dnl ===================================================================
14244 libo_CHECK_SYSTEM_MODULE([libtiff],[LIBTIFF],[libtiff-4])
14246 dnl ===================================================================
14247 dnl Test whether to build libwebp or rely on the system version
14248 dnl ===================================================================
14250 libo_CHECK_SYSTEM_MODULE([libwebp],[LIBWEBP],[libwebp])
14252 dnl ===================================================================
14253 dnl Check for runtime JVM search path
14254 dnl ===================================================================
14255 if test "$ENABLE_JAVA" != ""; then
14256 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
14257 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
14258 AC_MSG_RESULT([yes])
14259 if ! test -d "$with_jvm_path"; then
14260 AC_MSG_ERROR(["$with_jvm_path" not a directory])
14262 if ! test -d "$with_jvm_path"jvm; then
14263 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
14265 JVM_ONE_PATH_CHECK="$with_jvm_path"
14266 AC_SUBST(JVM_ONE_PATH_CHECK)
14268 AC_MSG_RESULT([no])
14272 dnl ===================================================================
14273 dnl Test for the presence of Ant and that it works
14274 dnl ===================================================================
14276 # java takes the encoding from LC_ALL, and since autoconf forces it to C it
14277 # breaks filename decoding, so for the ant section, set it to LANG
14279 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE" -a "$cross_compiling" != "yes"; then
14280 ANT_HOME=; export ANT_HOME
14281 WITH_ANT_HOME=; export WITH_ANT_HOME
14282 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
14283 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
14284 if test "$_os" = "WINNT"; then
14285 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
14287 with_ant_home="$LODE_HOME/opt/ant"
14289 elif test -x "$LODE_HOME/opt/bin/ant" ; then
14290 with_ant_home="$LODE_HOME/opt/ant"
14293 if test -z "$with_ant_home"; then
14294 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
14296 if test "$_os" = "WINNT"; then
14297 # AC_PATH_PROGS needs unix path
14298 PathFormat "$with_ant_home"
14299 with_ant_home="$formatted_path_unix"
14301 AbsolutePath "$with_ant_home"
14302 with_ant_home=$absolute_path
14303 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
14304 WITH_ANT_HOME=$with_ant_home
14305 ANT_HOME=$with_ant_home
14308 if test -z "$ANT"; then
14309 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
14311 # resolve relative or absolute symlink
14312 while test -h "$ANT"; do
14314 a_basename=`basename "$ANT"`
14315 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
14316 cd "`dirname "$ANT"`"
14317 cd "`dirname "$a_script"`"
14318 ANT="`pwd`"/"`basename "$a_script"`"
14322 AC_MSG_CHECKING([if $ANT works])
14323 mkdir -p conftest.dir
14326 cat > conftest.java << EOF
14327 public class conftest {
14328 int testmethod(int a, int b) {
14334 cat > conftest.xml << EOF
14335 <project name="conftest" default="conftest">
14336 <target name="conftest">
14337 <javac srcdir="." includes="conftest.java">
14343 if test -n "$WSL_ONLY_AS_HELPER"; then
14344 # need to set it directly, since ant only tries java, not java.exe from JAVA_HOME
14345 export JAVACMD="$JAVAINTERPRETER"
14346 # similarly it doesn't expect to be called from wsl, so it uses the wsl-realm path when
14347 # building the classpath, but we need the windows-style one for the windows-java
14348 PathFormat "$ANT_HOME"
14349 export LOCALCLASSPATH=";$formatted_path/lib/ant-launcher.jar"
14351 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
14352 if test $? = 0 -a -f ./conftest.class; then
14353 AC_MSG_RESULT([Ant works])
14354 if test -z "$WITH_ANT_HOME"; then
14355 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
14356 if test -z "$ANT_HOME"; then
14357 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
14360 ANT_HOME="$WITH_ANT_HOME"
14363 echo "configure: Ant test failed" >&5
14364 cat conftest.java >&5
14365 cat conftest.xml >&5
14366 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
14369 rm -fr conftest.dir
14371 if test -z "$ANT_HOME"; then
14372 ANT_HOME="NO_ANT_HOME"
14374 PathFormat "$ANT_HOME"
14375 ANT_HOME="$formatted_path_unix"
14377 ANT="$formatted_path_unix"
14380 dnl Checking for ant.jar
14381 if test "$ANT_HOME" != "NO_ANT_HOME"; then
14382 AC_MSG_CHECKING([Ant lib directory])
14383 if test -f $ANT_HOME/lib/ant.jar; then
14384 ANT_LIB="$ANT_HOME/lib"
14386 if test -f $ANT_HOME/ant.jar; then
14387 ANT_LIB="$ANT_HOME"
14389 if test -f /usr/share/java/ant.jar; then
14390 ANT_LIB=/usr/share/java
14392 if test -f /usr/share/ant-core/lib/ant.jar; then
14393 ANT_LIB=/usr/share/ant-core/lib
14395 if test -f $ANT_HOME/lib/ant/ant.jar; then
14396 ANT_LIB="$ANT_HOME/lib/ant"
14398 if test -f /usr/share/lib/ant/ant.jar; then
14399 ANT_LIB=/usr/share/lib/ant
14401 AC_MSG_ERROR([Ant libraries not found!])
14408 PathFormat "$ANT_LIB"
14409 ANT_LIB="$formatted_path"
14410 AC_MSG_RESULT([Ant lib directory found.])
14414 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
14416 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
14417 ant_version=`"$ANT" -version | $AWK '$3 == "version" { print $4; }'`
14418 ant_version_major=`echo $ant_version | cut -d. -f1`
14419 ant_version_minor=`echo $ant_version | cut -d. -f2`
14420 echo "configure: ant_version $ant_version " >&5
14421 echo "configure: ant_version_major $ant_version_major " >&5
14422 echo "configure: ant_version_minor $ant_version_minor " >&5
14423 if test "$ant_version_major" -ge "2"; then
14424 AC_MSG_RESULT([yes, $ant_version])
14425 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
14426 AC_MSG_RESULT([yes, $ant_version])
14428 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
14431 rm -f conftest* core core.* *.core
14439 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no" -a "$cross_compiling" != "yes"; then
14440 AC_MSG_CHECKING([for JUnit 4])
14441 if test "$with_junit" = "yes"; then
14442 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
14443 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
14444 elif test -e /usr/share/java/junit4.jar; then
14445 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
14447 if test -e /usr/share/lib/java/junit.jar; then
14448 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
14450 OOO_JUNIT_JAR=/usr/share/java/junit.jar
14454 OOO_JUNIT_JAR=$with_junit
14456 if test "$_os" = "WINNT"; then
14457 PathFormat "$OOO_JUNIT_JAR"
14458 OOO_JUNIT_JAR="$formatted_path"
14460 printf 'import org.junit.Before;' > conftest.java
14461 if $JAVACOMPILER -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
14462 AC_MSG_RESULT([$OOO_JUNIT_JAR])
14465 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
14466 specify its pathname via --with-junit=..., or disable it via --without-junit])
14468 rm -f conftest.class conftest.java
14469 if test $OOO_JUNIT_JAR != ""; then
14470 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
14473 AC_MSG_CHECKING([for included Hamcrest])
14474 printf 'import org.hamcrest.BaseDescription;' > conftest.java
14475 if $JAVACOMPILER -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
14476 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
14478 AC_MSG_RESULT([Not included])
14479 AC_MSG_CHECKING([for standalone hamcrest jar.])
14480 if test "$with_hamcrest" = "yes"; then
14481 if test -e /usr/share/lib/java/hamcrest.jar; then
14482 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
14483 elif test -e /usr/share/java/hamcrest/core.jar; then
14484 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
14485 elif test -e /usr/share/java/hamcrest/hamcrest.jar; then
14486 HAMCREST_JAR=/usr/share/java/hamcrest/hamcrest.jar
14488 HAMCREST_JAR=/usr/share/java/hamcrest.jar
14491 HAMCREST_JAR=$with_hamcrest
14493 if test "$_os" = "WINNT"; then
14494 PathFormat "$HAMCREST_JAR"
14495 HAMCREST_JAR="$formatted_path"
14497 if $JAVACOMPILER -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
14498 AC_MSG_RESULT([$HAMCREST_JAR])
14500 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),
14501 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
14504 rm -f conftest.class conftest.java
14506 AC_SUBST(OOO_JUNIT_JAR)
14507 AC_SUBST(HAMCREST_JAR)
14508 # set back LC_ALL to C after the java related tests...
14514 # check for wget and curl
14519 if test "$enable_fetch_external" != "no"; then
14521 CURL=`command -v curl`
14523 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
14525 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
14526 if test $? -eq 0; then
14532 if test -z "$WGET" -a -z "$CURL"; then
14533 AC_MSG_ERROR([neither wget nor curl found!])
14542 # check for sha256sum
14546 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
14547 eval "$i -a 256 --version" > /dev/null 2>&1
14549 if test $ret -eq 0; then
14550 SHA256SUM="$i -a 256"
14555 if test -z "$SHA256SUM"; then
14556 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
14557 eval "$i --version" > /dev/null 2>&1
14559 if test $ret -eq 0; then
14566 if test -z "$SHA256SUM"; then
14567 AC_MSG_ERROR([no sha256sum found!])
14570 AC_SUBST(SHA256SUM)
14572 dnl ===================================================================
14573 dnl Dealing with l10n options
14574 dnl ===================================================================
14575 AC_MSG_CHECKING([which languages to be built])
14576 # get list of all languages
14577 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
14578 # we want en-US at the beginning
14579 ALL_LANGS=$($GNUMAKE SRC_ROOT=$SRC_ROOT WITH_LANG="$with_lang" ENABLE_RELEASE_BUILD="$ENABLE_RELEASE_BUILD" -sr -f - <<'EOF' | tr -d '\r'
14580 include $(SRC_ROOT)/solenv/inc/langlist.mk
14582 $(info en-US $(filter-out en-US,$(sort $(completelangiso))))
14586 # check the configured localizations
14587 WITH_LANG="$with_lang"
14589 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
14590 # (Norwegian is "nb" and "nn".)
14591 if test "$WITH_LANG" = "no"; then
14595 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
14596 AC_MSG_RESULT([en-US])
14598 AC_MSG_RESULT([$WITH_LANG])
14599 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
14600 if test -z "$MSGFMT"; then
14601 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
14602 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
14603 elif test -x "/opt/lo/bin/msgfmt"; then
14604 MSGFMT="/opt/lo/bin/msgfmt"
14606 AC_CHECK_PROGS(MSGFMT, [msgfmt])
14607 if test -z "$MSGFMT"; then
14608 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
14612 if test -z "$MSGUNIQ"; then
14613 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
14614 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
14615 elif test -x "/opt/lo/bin/msguniq"; then
14616 MSGUNIQ="/opt/lo/bin/msguniq"
14618 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
14619 if test -z "$MSGUNIQ"; then
14620 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
14627 # check that the list is valid
14628 for lang in $WITH_LANG; do
14629 test "$lang" = "ALL" && continue
14630 # need to check for the exact string, so add space before and after the list of all languages
14631 for vl in $ALL_LANGS; do
14632 if test "$vl" = "$lang"; then
14636 if test "$vl" != "$lang"; then
14637 # if you're reading this - you prolly quoted your languages remove the quotes ...
14638 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
14641 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
14642 echo $WITH_LANG | grep -q en-US
14643 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
14645 # list with substituted ALL
14646 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
14647 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
14648 test "$WITH_LANG" = "en-US" && WITH_LANG=
14649 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
14650 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
14651 ALL_LANGS=`echo $ALL_LANGS qtz`
14653 AC_SUBST(ALL_LANGS)
14654 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
14655 AC_SUBST(WITH_LANG)
14656 AC_SUBST(WITH_LANG_LIST)
14657 AC_SUBST(GIT_NEEDED_SUBMODULES)
14659 WITH_POOR_HELP_LOCALIZATIONS=
14660 if test -d "$SRC_ROOT/translations/source"; then
14661 for l in `ls -1 $SRC_ROOT/translations/source`; do
14662 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
14663 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
14667 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
14669 if test -n "$with_locales" -a "$with_locales" != ALL; then
14670 WITH_LOCALES="$with_locales"
14672 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
14673 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
14674 # config_host/config_locales.h.in
14675 for locale in $WITH_LOCALES; do
14678 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
14682 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
14685 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
14690 AC_DEFINE(WITH_LOCALE_ALL)
14692 AC_SUBST(WITH_LOCALES)
14694 dnl git submodule update --reference
14695 dnl ===================================================================
14696 if test -n "${GIT_REFERENCE_SRC}"; then
14697 for repo in ${GIT_NEEDED_SUBMODULES}; do
14698 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
14699 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
14703 AC_SUBST(GIT_REFERENCE_SRC)
14705 dnl git submodules linked dirs
14706 dnl ===================================================================
14707 if test -n "${GIT_LINK_SRC}"; then
14708 for repo in ${GIT_NEEDED_SUBMODULES}; do
14709 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
14710 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
14714 AC_SUBST(GIT_LINK_SRC)
14717 dnl ===================================================================
14718 AC_MSG_CHECKING([for alternative branding images directory])
14719 # initialize mapped arrays
14720 BRAND_INTRO_IMAGES="intro.png intro-highres.png"
14721 brand_files="$BRAND_INTRO_IMAGES logo.svg logo_inverted.svg logo-sc.svg logo-sc_inverted.svg about.svg"
14723 if test -z "$with_branding" -o "$with_branding" = "no"; then
14724 AC_MSG_RESULT([none])
14725 DEFAULT_BRAND_IMAGES="$brand_files"
14727 if ! test -d $with_branding ; then
14728 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
14730 AC_MSG_RESULT([$with_branding])
14731 CUSTOM_BRAND_DIR="$with_branding"
14732 for lfile in $brand_files
14734 if ! test -f $with_branding/$lfile ; then
14735 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
14736 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
14738 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
14741 check_for_progress="yes"
14744 AC_SUBST([BRAND_INTRO_IMAGES])
14745 AC_SUBST([CUSTOM_BRAND_DIR])
14746 AC_SUBST([CUSTOM_BRAND_IMAGES])
14747 AC_SUBST([DEFAULT_BRAND_IMAGES])
14750 AC_MSG_CHECKING([for 'intro' progress settings])
14754 PROGRESSFRAMECOLOR=
14756 PROGRESSTEXTBASELINE=
14758 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
14759 source "$with_branding/progress.conf"
14760 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
14762 AC_MSG_RESULT([none])
14765 AC_SUBST(PROGRESSBARCOLOR)
14766 AC_SUBST(PROGRESSSIZE)
14767 AC_SUBST(PROGRESSPOSITION)
14768 AC_SUBST(PROGRESSFRAMECOLOR)
14769 AC_SUBST(PROGRESSTEXTCOLOR)
14770 AC_SUBST(PROGRESSTEXTBASELINE)
14773 dnl ===================================================================
14774 dnl Custom build version
14775 dnl ===================================================================
14776 AC_MSG_CHECKING([for extra build ID])
14777 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
14778 EXTRA_BUILDID="$with_extra_buildid"
14780 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
14781 if test -n "$EXTRA_BUILDID" ; then
14782 AC_MSG_RESULT([$EXTRA_BUILDID])
14784 AC_MSG_RESULT([not set])
14786 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
14789 AC_MSG_CHECKING([for vendor])
14790 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
14791 OOO_VENDOR="$USERNAME"
14793 if test -z "$OOO_VENDOR"; then
14797 if test -z "$OOO_VENDOR"; then
14798 OOO_VENDOR="`id -u -n`"
14801 AC_MSG_RESULT([not set, using $OOO_VENDOR])
14803 OOO_VENDOR="$with_vendor"
14804 AC_MSG_RESULT([$OOO_VENDOR])
14806 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
14807 AC_SUBST(OOO_VENDOR)
14809 if test "$_os" = "Android" ; then
14810 ANDROID_PACKAGE_NAME=
14811 AC_MSG_CHECKING([for Android package name])
14812 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
14813 if test -n "$ENABLE_DEBUG"; then
14814 # Default to the package name that makes ndk-gdb happy.
14815 ANDROID_PACKAGE_NAME="org.libreoffice"
14817 ANDROID_PACKAGE_NAME="org.example.libreoffice"
14820 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
14822 ANDROID_PACKAGE_NAME="$with_android_package_name"
14823 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
14825 AC_SUBST(ANDROID_PACKAGE_NAME)
14828 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
14829 if test "$with_compat_oowrappers" = "yes"; then
14830 WITH_COMPAT_OOWRAPPERS=TRUE
14833 WITH_COMPAT_OOWRAPPERS=
14836 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
14838 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
14839 AC_MSG_CHECKING([for install dirname])
14840 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
14841 INSTALLDIRNAME="$with_install_dirname"
14843 AC_MSG_RESULT([$INSTALLDIRNAME])
14844 AC_SUBST(INSTALLDIRNAME)
14846 AC_MSG_CHECKING([for prefix])
14847 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14848 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
14849 PREFIXDIR="$prefix"
14850 AC_MSG_RESULT([$PREFIXDIR])
14851 AC_SUBST(PREFIXDIR)
14853 LIBDIR=[$(eval echo $(eval echo $libdir))]
14856 DATADIR=[$(eval echo $(eval echo $datadir))]
14859 MANDIR=[$(eval echo $(eval echo $mandir))]
14862 DOCDIR=[$(eval echo $(eval echo $docdir))]
14865 BINDIR=[$(eval echo $(eval echo $bindir))]
14868 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
14869 AC_SUBST(INSTALLDIR)
14871 TESTINSTALLDIR="${BUILDDIR}/test-install"
14872 AC_SUBST(TESTINSTALLDIR)
14875 # ===================================================================
14876 # OAuth2 id and secrets
14877 # ===================================================================
14879 AC_MSG_CHECKING([for Google Drive client id and secret])
14880 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
14881 AC_MSG_RESULT([not set])
14882 GDRIVE_CLIENT_ID="\"\""
14883 GDRIVE_CLIENT_SECRET="\"\""
14885 AC_MSG_RESULT([set])
14886 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
14887 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
14889 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
14890 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
14892 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
14893 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
14894 AC_MSG_RESULT([not set])
14895 ALFRESCO_CLOUD_CLIENT_ID="\"\""
14896 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
14898 AC_MSG_RESULT([set])
14899 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
14900 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
14902 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
14903 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
14905 AC_MSG_CHECKING([for OneDrive client id and secret])
14906 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
14907 AC_MSG_RESULT([not set])
14908 ONEDRIVE_CLIENT_ID="\"\""
14909 ONEDRIVE_CLIENT_SECRET="\"\""
14911 AC_MSG_RESULT([set])
14912 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
14913 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
14915 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
14916 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
14919 dnl ===================================================================
14920 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
14921 dnl --enable-dependency-tracking configure option
14922 dnl ===================================================================
14923 AC_MSG_CHECKING([whether to enable dependency tracking])
14924 if test "$enable_dependency_tracking" = "no"; then
14926 AC_MSG_RESULT([no])
14928 AC_MSG_RESULT([yes])
14932 dnl ===================================================================
14933 dnl Number of CPUs to use during the build
14934 dnl ===================================================================
14935 AC_MSG_CHECKING([for number of processors to use])
14936 # plain --with-parallelism is just the default
14937 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
14938 if test "$with_parallelism" = "no"; then
14941 PARALLELISM=$with_parallelism
14944 if test "$enable_icecream" = "yes"; then
14949 Darwin|FreeBSD|NetBSD|OpenBSD)
14950 PARALLELISM=`sysctl -n hw.ncpu`
14954 PARALLELISM=`getconf _NPROCESSORS_ONLN`
14956 # what else than above does profit here *and* has /proc?
14958 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
14962 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
14963 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
14967 if test $PARALLELISM -eq 0; then
14968 AC_MSG_RESULT([explicit make -j option needed])
14970 AC_MSG_RESULT([$PARALLELISM])
14972 AC_SUBST(PARALLELISM)
14975 # Set up ILIB for MSVC build
14978 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
14980 if test -n "$JAVA_HOME"; then
14981 ILIB="$ILIB;$JAVA_HOME/lib"
14984 PathFormat "${COMPATH}/lib/$WIN_HOST_ARCH"
14985 ILIB="$ILIB;$formatted_path"
14986 ILIB1="$ILIB1 -LIBPATH:$formatted_path"
14987 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
14988 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
14989 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
14990 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
14991 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
14993 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/$WIN_HOST_ARCH"
14994 ucrtlibpath_formatted=$formatted_path
14995 ILIB="$ILIB;$ucrtlibpath_formatted"
14996 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
14997 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
14998 PathFormat "$DOTNET_FRAMEWORK_HOME/lib"
14999 ILIB="$ILIB;$formatted_path"
15001 PathFormat "$DOTNET_FRAMEWORK_HOME/Lib/um/$WIN_HOST_ARCH"
15002 ILIB="$ILIB;$formatted_path"
15005 if test "$cross_compiling" != "yes"; then
15006 ILIB_FOR_BUILD="$ILIB"
15010 AC_SUBST(ILIB_FOR_BUILD)
15012 AC_MSG_CHECKING([whether $CXX_BASE supports a working C++20 consteval])
15013 dnl ...that does not suffer from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994> "Missing code
15014 dnl from consteval constructor initializing const variable",
15015 dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98752> "wrong 'error: ‘this’ is not a constant
15016 dnl expression' with consteval constructor", <https://bugs.llvm.org/show_bug.cgi?id=50063> "code
15017 dnl using consteval: 'clang/lib/CodeGen/Address.h:38: llvm::Value*
15018 dnl clang::CodeGen::Address::getPointer() const: Assertion `isValid()' failed.'" (which should be
15019 dnl fixed since Clang 14), <https://developercommunity.visualstudio.com/t/1581879> "Bogus error
15020 dnl C7595 with consteval constructor in ternary expression (/std:c++latest)" (which appears to be
15021 dnl fixed at least in Visual Studio Community 2022 Preview 17.9.0 Preview 5.0),
15022 dnl <https://github.com/llvm/llvm-project/issues/54612> "C++20, consteval, anonymous union:
15023 dnl llvm/lib/IR/Instructions.cpp:1491: void llvm::StoreInst::AssertOK(): Assertion
15024 dnl `cast<PointerType>(getOperand(1)->getType())->isOpaqueOrPointeeTypeMatches(getOperand(0)->getType())
15025 dnl && "Ptr must be a pointer to Val type!"' failed." (which should be fixed since Clang 17), or
15026 dnl <https://developercommunity.visualstudio.com/t/Bogus-error-C2440-with-consteval-constru/10579616>
15027 dnl "Bogus error C2440 with consteval constructor (/std:c++20)":
15028 have_cpp_consteval=
15029 AC_LANG_PUSH([C++])
15031 if test "$COM" = MSC && test "$COM_IS_CLANG" != TRUE; then
15032 CXX="env LIB=$ILIB $CXX"
15034 save_CXXFLAGS=$CXXFLAGS
15035 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
15036 AC_RUN_IFELSE([AC_LANG_PROGRAM([
15038 consteval S() { i = 1; }
15045 consteval S1(int n): a(n) {}
15061 struct S4 { consteval S4() = default; };
15062 void f4(bool b) { b ? S4() : S4(); }
15065 consteval S5() { c = 0; }
15066 char * f() { return &c; }
15072 auto s5 = S5().f();
15075 consteval S6(char const (&lit)[[2]]) {
15076 buf[[0]] = lit[[0]];
15077 buf[[1]] = lit[[1]];
15084 void f6() { S6("a"); }
15086 return (s.i == 1) ? 0 : 1;
15088 have_cpp_consteval=1
15089 AC_MSG_RESULT([yes])
15090 ], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([assumed no (cross compiling)])])
15092 CXXFLAGS=$save_CXXFLAGS
15094 if test -n "$have_cpp_consteval" && test "$COM_IS_CLANG" = TRUE && test -n "$BUILDING_PCH_WITH_OBJ"
15096 AC_MSG_CHECKING([whether $CXX_BASE has working consteval in combination with PCH])
15097 dnl ...that does not suffer from <https://github.com/llvm/llvm-project/issues/81745> "undefined
15098 dnl reference to consteval constructor exported from module" (which also affects PCH, see
15099 dnl <https://lists.freedesktop.org/archives/libreoffice/2024-February/091564.html> "Our Clang
15100 dnl --enable-pch setup is known broken"):
15101 printf 'export module M;\nexport struct S1 { consteval S1(int) {} };' >conftest.cppm
15102 $CXX $CXXFLAGS $CXXFLAGS_CXX11 --precompile conftest.cppm
15104 AC_LANG_PUSH([C++])
15105 save_CXXFLAGS=$CXXFLAGS
15106 save_LDFLAGS=$LDFLAGS
15107 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
15108 LDFLAGS="$LDFLAGS -fmodule-file=M=conftest.pcm conftest.pcm"
15109 AC_LINK_IFELSE([AC_LANG_PROGRAM([
15112 struct S2 { S1 s = 0; };
15115 AC_MSG_RESULT([yes])
15117 have_cpp_consteval=
15118 AC_MSG_RESULT([no])])
15119 CXXFLAGS=$save_CXXFLAGS
15120 LDFLAGS=$save_LDFLAGS
15124 if test -n "$have_cpp_consteval"; then
15125 AC_DEFINE([HAVE_CPP_CONSTEVAL],[1])
15128 AC_MSG_CHECKING([whether $CXX_BASE supports a working C++20 std::strong_order])
15129 dnl ...which is known to not be implemented in libc++ prior to
15130 dnl <https://github.com/llvm/llvm-project/commit/d8380ad977e94498e170b06449c81f1fc27da7b5> "[libc++]
15131 dnl [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order" in LLVM 14:
15132 AC_LANG_PUSH([C++])
15134 if test "$COM" = MSC && test "$COM_IS_CLANG" != TRUE; then
15135 CXX="env LIB=$ILIB $CXX"
15137 save_CXXFLAGS=$CXXFLAGS
15138 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
15139 AC_LINK_IFELSE([AC_LANG_PROGRAM([
15142 (void) (std::strong_order(1.0, 2.0) < 0);
15144 AC_DEFINE([HAVE_CPP_STRONG_ORDER],[1])
15145 AC_MSG_RESULT([yes])
15146 ], [AC_MSG_RESULT([no])])
15148 CXXFLAGS=$save_CXXFLAGS
15151 # ===================================================================
15152 # Creating bigger shared library to link against
15153 # ===================================================================
15154 AC_MSG_CHECKING([whether to create huge library])
15158 if test $_os = iOS -o $_os = Android; then
15159 # Never any point in mergelibs for these as we build just static
15160 # libraries anyway...
15161 enable_mergelibs=no
15164 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
15165 if test "$enable_mergelibs" = "more"; then
15167 MERGELIBS_MORE="TRUE"
15168 AC_MSG_RESULT([yes (more)])
15169 AC_DEFINE(ENABLE_MERGELIBS)
15170 AC_DEFINE(ENABLE_MERGELIBS_MORE)
15171 elif test "$enable_mergelibs" = "yes" -o "$enable_mergelibs" = ""; then
15173 AC_MSG_RESULT([yes])
15174 AC_DEFINE(ENABLE_MERGELIBS)
15176 AC_MSG_ERROR([unknown value --enable-mergelibs=$enable_mergelibs])
15179 AC_MSG_RESULT([no])
15181 AC_SUBST([MERGELIBS])
15182 AC_SUBST([MERGELIBS_MORE])
15184 dnl ===================================================================
15185 dnl icerun is a wrapper that stops us spawning tens of processes
15186 dnl locally - for tools that can't be executed on the compile cluster
15187 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
15188 dnl ===================================================================
15189 AC_MSG_CHECKING([whether to use icerun wrapper])
15191 if test "$enable_icecream" = "yes" && command -v icerun >/dev/null ; then
15192 ICECREAM_RUN=icerun
15193 AC_MSG_RESULT([yes])
15195 AC_MSG_RESULT([no])
15197 AC_SUBST(ICECREAM_RUN)
15199 dnl ===================================================================
15200 dnl Setup the ICECC_VERSION for the build the same way it was set for
15201 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
15202 dnl ===================================================================
15203 x_ICECC_VERSION=[\#]
15204 if test -n "$ICECC_VERSION" ; then
15207 AC_SUBST(x_ICECC_VERSION)
15208 AC_SUBST(ICECC_VERSION)
15210 dnl ===================================================================
15212 AC_MSG_CHECKING([MPL subset])
15216 if test "$enable_mpl_subset" = "yes"; then
15220 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
15222 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
15225 if test "$warn_report" = "true"; then
15226 mpl_error_string="$mpl_error_string$newline Need to --disable-report-builder - extended database report builder."
15228 if test "x$enable_postgresql_sdbc" != "xno"; then
15229 mpl_error_string="$mpl_error_string$newline Need to --disable-postgresql-sdbc - the PostgreSQL database backend."
15231 if test "$enable_lotuswordpro" = "yes"; then
15232 mpl_error_string="$mpl_error_string$newline Need to --disable-lotuswordpro - a Lotus Word Pro file format import filter."
15234 if test -n "$ENABLE_POPPLER"; then
15235 if test "x$SYSTEM_POPPLER" = "x"; then
15236 mpl_error_string="$mpl_error_string$newline Need to disable PDF import via poppler (--disable-poppler) or use system library."
15239 # cf. m4/libo_check_extension.m4
15240 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
15241 mpl_error_string="$mpl_error_string$newline Need to disable extra extensions enabled using --enable-ext-XXXX."
15245 for theme in $WITH_THEMES; do
15247 breeze|breeze_dark|breeze_dark_svg|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg) #denylist of icon themes under GPL or LGPL
15248 denied_themes="${denied_themes:+$denied_themes }$theme" ;;
15250 filtered_themes="${filtered_themes:+$filtered_themes }$theme" ;;
15253 if test "x$denied_themes" != "x"; then
15254 if test "x$filtered_themes" == "x"; then
15255 filtered_themes="colibre"
15257 mpl_error_string="$mpl_error_string$newline Need to disable icon themes: $denied_themes, use --with-theme=$filtered_themes."
15260 ENABLE_OPENGL_TRANSITIONS=
15262 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
15263 mpl_error_string="$mpl_error_string$newline Need to --disable-lpsolve - calc linear programming solver."
15266 if test "x$mpl_error_string" != "x"; then
15267 AC_MSG_ERROR([$mpl_error_string])
15272 AC_DEFINE(MPL_HAVE_SUBSET)
15273 AC_MSG_RESULT([only])
15275 AC_MSG_RESULT([no restrictions])
15277 AC_SUBST(MPL_SUBSET)
15280 dnl ===================================================================
15282 AC_MSG_CHECKING([formula logger])
15283 ENABLE_FORMULA_LOGGER=
15285 if test "x$enable_formula_logger" = "xyes"; then
15286 AC_MSG_RESULT([yes])
15287 AC_DEFINE(ENABLE_FORMULA_LOGGER)
15288 ENABLE_FORMULA_LOGGER=TRUE
15289 elif test -n "$ENABLE_DBGUTIL" ; then
15290 AC_MSG_RESULT([yes])
15291 AC_DEFINE(ENABLE_FORMULA_LOGGER)
15292 ENABLE_FORMULA_LOGGER=TRUE
15294 AC_MSG_RESULT([no])
15297 AC_SUBST(ENABLE_FORMULA_LOGGER)
15299 dnl ===================================================================
15300 dnl Checking for active Antivirus software.
15301 dnl ===================================================================
15303 if test $_os = WINNT -a -f "$SRC_ROOT/antivirusDetection.vbs" ; then
15304 AC_MSG_CHECKING([for active Antivirus software])
15305 PathFormat "$SRC_ROOT/antivirusDetection.vbs"
15306 ANTIVIRUS_LIST=`cscript.exe //Nologo ${formatted_path}`
15307 if [ [ "$ANTIVIRUS_LIST" != "NULL" ] ]; then
15308 if [ [ "$ANTIVIRUS_LIST" != "NOT_FOUND" ] ]; then
15309 AC_MSG_RESULT([found])
15310 EICAR_STRING='X5O!P%@AP@<:@4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
15311 echo $EICAR_STRING > $SRC_ROOT/eicar
15312 EICAR_TEMP_FILE_CONTENTS=`cat $SRC_ROOT/eicar`
15314 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
15315 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
15317 echo $EICAR_STRING > $BUILDDIR/eicar
15318 EICAR_TEMP_FILE_CONTENTS=`cat $BUILDDIR/eicar`
15320 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
15321 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
15323 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"
15325 AC_MSG_RESULT([not found])
15328 AC_MSG_RESULT([n/a])
15332 dnl ===================================================================
15334 AC_MSG_CHECKING([for coredumpctl support])
15335 if test -z "$with_coredumpctl" && test $_os != Linux; then
15336 with_coredumpctl=no
15338 if test "$with_coredumpctl" = no; then
15341 AC_PATH_PROG(COREDUMPCTL, coredumpctl)
15342 AC_PATH_PROG(JQ, jq)
15343 AC_PATH_PROG(SYSTEMD_ESCAPE, systemd-escape)
15344 AC_PATH_PROG(SYSTEMD_RUN, systemd-run)
15345 if test -z "$COREDUMPCTL" || test -z "$JQ" || test -z "$SYSTEMD_ESCAPE" \
15346 || test -z "$SYSTEMD_RUN"
15348 if test -z "$with_coredumpctl"; then
15351 if test -z "$COREDUMPCTL"; then
15352 AC_MSG_ERROR([coredumpctl not found])
15354 if test -z "$JQ"; then
15355 AC_MSG_ERROR([jq not found])
15357 if test -z "$SYSTEMD_ESCAPE"; then
15358 AC_MSG_ERROR([systemd-escape not found])
15360 if test -z "$SYSTEMD_RUN"; then
15361 AC_MSG_ERROR([systemd-run not found])
15365 WITH_COREDUMPCTL=TRUE
15368 if test -z "$WITH_COREDUMPCTL"; then
15369 AC_MSG_RESULT([no])
15371 AC_MSG_RESULT([yes])
15373 AC_SUBST(COREDUMPCTL)
15375 AC_SUBST(SYSTEMD_ESCAPE)
15376 AC_SUBST(SYSTEMD_RUN)
15377 AC_SUBST(WITH_COREDUMPCTL)
15379 dnl ===================================================================
15380 dnl Checking whether to use a keep-awake helper
15381 dnl ===================================================================
15383 AC_MSG_CHECKING([whether to keep the system awake/prevent it from going into sleep/standby])
15384 if test -z "$with_keep_awake" -o "$with_keep_awake" = "no"; then
15385 AC_MSG_RESULT([no])
15386 elif test "$with_keep_awake" = "yes"; then
15387 AC_MSG_RESULT([yes (autodetect)])
15388 AC_MSG_CHECKING([for a suitable keep-awake command])
15389 if test "$_os" = "WINNT"; then
15390 PathFormat "$(perl.exe -e 'print $ENV{"PROGRAMFILES"}')"
15391 if test -f "$formatted_path_unix/PowerToys/PowerToys.Awake.exe"; then
15392 AC_MSG_RESULT([using "Awake"])
15393 # need to pass the windows-PID to awake, so get the PGID of the shell first to get
15394 # make's PID and then use that to get the windows-PID.
15395 # lots of quoting for both make ($$) as well as configure ('"'"') make that command
15396 # much scarier looking than it actually is. Using make's shell instead of subshells in
15397 # the recipe to keep the command that's echoed by make short.
15398 KEEP_AWAKE_CMD=$formatted_path/PowerToys/PowerToys.Awake.exe' --display-on False --pid $(shell ps | awk '"'"'/^\s+'"'"'$$(ps | awk '"'"'/^\s+'"'"'$$$$'"'"'\s+/{print $$3}'"'"')'"'"'\s+/{print $$4}'"'"') &'
15400 AC_MSG_ERROR(["Awake" not found - install Microsoft PowerToys or specify a custom command])
15402 elif test "$_os" = "Darwin"; then
15403 AC_MSG_RESULT([using "caffeinate"])
15404 KEEP_AWAKE_CMD="caffeinate"
15406 AC_MSG_ERROR([no default available for $_os, please specify manually])
15409 AC_MSG_RESULT([yes (custom command: $with_keep_awake)])
15411 AC_SUBST(KEEP_AWAKE_CMD)
15413 dnl ===================================================================
15414 dnl Setting up the environment.
15415 dnl ===================================================================
15416 AC_MSG_NOTICE([setting up the build environment variables...])
15420 if test "$build_os" = "cygwin" -o "$build_os" = wsl -o -n "$WSL_ONLY_AS_HELPER"; then
15421 if test -d "$COMPATH_unix/atlmfc/lib/spectre"; then
15422 ATL_LIB="$COMPATH/atlmfc/lib/spectre"
15423 ATL_INCLUDE="$COMPATH/atlmfc/include"
15424 elif test -d "$COMPATH_unix/atlmfc/lib"; then
15425 ATL_LIB="$COMPATH/atlmfc/lib"
15426 ATL_INCLUDE="$COMPATH/atlmfc/include"
15428 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
15429 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
15431 ATL_LIB="$ATL_LIB/$WIN_HOST_ARCH"
15432 ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
15433 ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
15436 if test "$build_os" = "cygwin"; then
15437 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
15438 PathFormat "/usr/bin/find.exe"
15439 FIND="$formatted_path"
15440 PathFormat "/usr/bin/sort.exe"
15441 SORT="$formatted_path"
15442 PathFormat "/usr/bin/grep.exe"
15443 WIN_GREP="$formatted_path"
15444 PathFormat "/usr/bin/ls.exe"
15445 WIN_LS="$formatted_path"
15446 PathFormat "/usr/bin/touch.exe"
15447 WIN_TOUCH="$formatted_path"
15453 AC_SUBST(ATL_INCLUDE)
15459 AC_SUBST(WIN_TOUCH)
15461 AC_SUBST(BUILD_TYPE)
15466 PERL="$formatted_path"
15469 if test -n "$TMPDIR"; then
15470 TEMP_DIRECTORY="$TMPDIR"
15471 if test -n "$WSL_ONLY_AS_HELPER"; then
15472 TEMP_DIRECTORY=$(wslpath -m "$TEMP_DIRECTORY")
15475 TEMP_DIRECTORY="/tmp"
15477 CYGWIN_BASH="C:/cygwin64/bin/bash.exe"
15478 if test "$build_os" = "cygwin"; then
15479 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
15480 CYGWIN_BASH=`cygpath -m /usr/bin/bash`
15482 AC_SUBST(TEMP_DIRECTORY)
15483 AC_SUBST(CYGWIN_BASH)
15485 # setup the PATH for the environment
15486 if test -n "$LO_PATH_FOR_BUILD"; then
15487 LO_PATH="$LO_PATH_FOR_BUILD"
15490 pathmunge "$MSVC_HOST_PATH" "before"
15498 dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
15499 if test "$ENABLE_JAVA" != ""; then
15500 pathmunge "$JAVA_HOME/bin" "after"
15505 # Win32 make needs native paths
15506 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
15507 LO_PATH=`cygpath -p -m "$PATH"`
15509 if test "$WIN_BUILD_ARCH" = "x64"; then
15510 # needed for msi packaging
15511 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
15513 if test "$WIN_BUILD_ARCH" = "arm64"; then
15514 # needed for msi packaging - as of 10.0.22621 SDK no arm64 ones yet
15515 # the x86 ones probably would work just as well...
15516 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/arm" "before"
15518 # .NET 4.6 and higher don't have bin directory
15519 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
15520 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
15522 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
15523 pathmunge "$CSC_PATH" "before"
15524 pathmunge "$MIDL_PATH" "before"
15525 pathmunge "$AL_PATH" "before"
15526 pathmunge "$MSVC_MULTI_PATH" "before"
15527 pathmunge "$MSVC_BUILD_PATH" "before"
15528 if test -n "$MSBUILD_PATH" ; then
15529 pathmunge "$MSBUILD_PATH" "before"
15531 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/$WIN_BUILD_ARCH" "before"
15532 if test "$ENABLE_JAVA" != ""; then
15533 if test -d "$JAVA_HOME/jre/bin/client"; then
15534 pathmunge "$JAVA_HOME/jre/bin/client" "before"
15536 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
15537 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
15539 pathmunge "$JAVA_HOME/bin" "before"
15541 pathmunge "$MSVC_HOST_PATH" "before"
15545 pathmunge "/usr/css/bin" "before"
15546 if test "$ENABLE_JAVA" != ""; then
15547 pathmunge "$JAVA_HOME/bin" "after"
15555 # Allow to pass LO_ELFCHECK_ALLOWLIST from autogen.input to bin/check-elf-dynamic-objects:
15556 if test "$LO_ELFCHECK_ALLOWLIST" = x || test "${LO_ELFCHECK_ALLOWLIST-x}" != x; then
15557 x_LO_ELFCHECK_ALLOWLIST=
15559 x_LO_ELFCHECK_ALLOWLIST=[\#]
15561 AC_SUBST(x_LO_ELFCHECK_ALLOWLIST)
15562 AC_SUBST(LO_ELFCHECK_ALLOWLIST)
15566 # Generate a configuration sha256 we can use for deps
15567 if test -f config_host.mk; then
15568 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
15570 if test -f config_host_lang.mk; then
15571 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
15574 CFLAGS=$my_original_CFLAGS
15575 CXXFLAGS=$my_original_CXXFLAGS
15576 CPPFLAGS=$my_original_CPPFLAGS
15578 AC_CONFIG_LINKS([include:include])
15580 if test -n "$WSL_ONLY_AS_HELPER"; then
15581 # while we configure in linux, we actually compile in "cygwin" (close enough at least)
15583 PathFormat "$SRC_ROOT"
15584 SRC_ROOT="$formatted_path"
15585 PathFormat "$BUILDDIR"
15586 BUILDDIR="$formatted_path"
15587 # git-bash has (gnu) tar, curl and sha256sum
15591 SHA256SUM="sha256sum.exe"
15592 # TODO: maybe switch to strawberry-perl right away?
15593 # only openssl seems to actually require it (for Pod/Usage.pm and maybe more)
15595 # use flex, gperf and nasm from wsl-container
15596 # if using absolute path, would need to use double-leading slash for the msys path mangling
15599 # some externals (libebook) check for it with AC_PATH_PROGS, and that only accepts overrides
15600 # with an absolute path/requires the value to begin with a slash
15601 GPERF="/c/Windows/system32/$WSL gperf"
15602 # append strawberry tools dir to PATH (for e.g. windres, ar)
15603 LO_PATH="$LO_PATH:$STRAWBERRY_TOOLS"
15604 # temp-dir needs to be in windows realm, hardcode for now
15605 if test "$TEMP_DIRECTORY" = /tmp; then
15607 TEMP_DIRECTORY="$BUILDDIR/tmp"
15611 # Keep in sync with list of files far up, at AC_MSG_CHECKING([for
15612 # BUILD platform configuration] - otherwise breaks cross building
15614 config_host_lang.mk
15616 bin/bffvalidator.sh
15617 bin/odfvalidator.sh
15619 instsetoo_native/util/openoffice.lst
15620 sysui/desktop/macosx/Info.plist
15621 hardened_runtime.xcent:sysui/desktop/macosx/hardened_runtime.xcent.in
15622 lo.xcent:sysui/desktop/macosx/lo.xcent.in
15623 vs-code.code-workspace.template:.vscode/vs-code-template.code-workspace.in])
15624 # map unix-style mount dirs to windows directories: /mnt/c/foobar -> C:/foobar
15625 # easier to do it in a postprocessing command than to modify every single variable
15626 AC_CONFIG_FILES([config_host.mk], [
15627 if test -n "$WSL_ONLY_AS_HELPER"; then
15628 sed -i -e 's#/mnt/\([[:alpha:]]\)/#\u\1:/#g' config_host.mk
15629 fi], [WSL_ONLY_AS_HELPER=$WSL_ONLY_AS_HELPER])
15631 AC_CONFIG_HEADERS([config_host/config_atspi.h])
15632 AC_CONFIG_HEADERS([config_host/config_buildconfig.h])
15633 AC_CONFIG_HEADERS([config_host/config_buildid.h])
15634 AC_CONFIG_HEADERS([config_host/config_box2d.h])
15635 AC_CONFIG_HEADERS([config_host/config_clang.h])
15636 AC_CONFIG_HEADERS([config_host/config_cpdb.h])
15637 AC_CONFIG_HEADERS([config_host/config_crypto.h])
15638 AC_CONFIG_HEADERS([config_host/config_dconf.h])
15639 AC_CONFIG_HEADERS([config_host/config_eot.h])
15640 AC_CONFIG_HEADERS([config_host/config_extensions.h])
15641 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
15642 AC_CONFIG_HEADERS([config_host/config_cairo_rgba.h])
15643 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
15644 AC_CONFIG_HEADERS([config_host/config_dbus.h])
15645 AC_CONFIG_HEADERS([config_host/config_features.h])
15646 AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
15647 AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
15648 AC_CONFIG_HEADERS([config_host/config_firebird.h])
15649 AC_CONFIG_HEADERS([config_host/config_folders.h])
15650 AC_CONFIG_HEADERS([config_host/config_fonts.h])
15651 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
15652 AC_CONFIG_HEADERS([config_host/config_gio.h])
15653 AC_CONFIG_HEADERS([config_host/config_global.h])
15654 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
15655 AC_CONFIG_HEADERS([config_host/config_java.h])
15656 AC_CONFIG_HEADERS([config_host/config_langs.h])
15657 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
15658 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
15659 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
15660 AC_CONFIG_HEADERS([config_host/config_locales.h])
15661 AC_CONFIG_HEADERS([config_host/config_mpl.h])
15662 AC_CONFIG_HEADERS([config_host/config_oox.h])
15663 AC_CONFIG_HEADERS([config_host/config_options.h])
15664 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
15665 AC_CONFIG_HEADERS([config_host/config_zxing.h])
15666 AC_CONFIG_HEADERS([config_host/config_skia.h])
15667 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
15668 AC_CONFIG_HEADERS([config_host/config_validation.h])
15669 AC_CONFIG_HEADERS([config_host/config_vendor.h])
15670 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
15671 AC_CONFIG_HEADERS([config_host/config_version.h])
15672 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
15673 AC_CONFIG_HEADERS([config_host/config_poppler.h])
15674 AC_CONFIG_HEADERS([config_host/config_python.h])
15675 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
15676 AC_CONFIG_HEADERS([config_host/config_wasm_strip.h])
15677 AC_CONFIG_HEADERS([solenv/lockfile/autoconf.h])
15680 if test "$CROSS_COMPILING" = TRUE; then
15681 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
15684 # touch the config timestamp file
15685 if test ! -f config_host.mk.stamp; then
15686 echo > config_host.mk.stamp
15687 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
15688 echo "Host Configuration unchanged - avoiding scp2 stamp update"
15690 echo > config_host.mk.stamp
15693 # touch the config lang timestamp file
15694 if test ! -f config_host_lang.mk.stamp; then
15695 echo > config_host_lang.mk.stamp
15696 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
15697 echo "Language Configuration unchanged - avoiding scp2 stamp update"
15699 echo > config_host_lang.mk.stamp
15703 if test \( "$STALE_MAKE" = "TRUE" \) \
15704 -a "$build_os" = "cygwin"; then
15707 ****************************************************************************
15709 Your make version is known to be horribly slow, and hard to debug
15710 problems with. To get a reasonably functional make please do:
15712 to install a pre-compiled binary make for Win32
15714 mkdir -p /opt/lo/bin
15716 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
15717 cp make-4.2.1-msvc.exe make
15720 to install from source:
15721 place yourself in a working directory of you choice.
15723 git clone git://git.savannah.gnu.org/make.git
15725 [go to Start menu, open "Visual Studio 2019" or "Visual Studio 2022", and then click "x86 Native Tools Command Prompt" or "x64 Native Tools Command Prompt"]
15726 set PATH=%PATH%;C:\Cygwin\bin
15727 [or Cygwin64, if that is what you have]
15728 cd path-to-make-repo-you-cloned-above
15729 build_w32.bat --without-guile
15731 should result in a WinRel/gnumake.exe.
15732 Copy it to the Cygwin /opt/lo/bin directory as make.exe
15734 Then re-run autogen.sh
15736 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
15737 Alternatively, you can install the 'new' make where ever you want and make sure that `command -v make` finds it.
15744 ****************************************************************************
15746 To show information on various make targets and make flags, run:
15749 To just build, run:
15754 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
15756 After the build has finished successfully, you can immediately run what you built using the command:
15759 if test $_os = Darwin; then
15760 echo open instdir/$PRODUCTNAME_WITHOUT_SPACES.app
15762 echo instdir/program/soffice
15766 If you want to run the unit tests, run:
15772 if test -s "$WARNINGS_FILE_FOR_BUILD"; then
15773 echo "BUILD / cross-toolset config, repeated ($WARNINGS_FILE_FOR_BUILD)"
15774 cat "$WARNINGS_FILE_FOR_BUILD"
15778 if test -s "$WARNINGS_FILE"; then
15779 echo "HOST config ($WARNINGS_FILE)"
15780 cat "$WARNINGS_FILE"
15783 # Remove unneeded emconfigure artifacts
15784 rm -f a.out a.wasm a.out.js a.out.wasm
15786 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: