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],[24.8.0.1.0+],[],[],[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_cups+set}" = set || test_cups="$using_x11"
1221 test "${test_dbus+set}" = set || test_dbus="$using_x11"
1222 test "${test_gen+set}" = set || test_gen="$using_x11"
1223 test "${test_gstreamer_1_0+set}" = set || test_gstreamer_1_0="$using_x11"
1224 test "${test_gtk3+set}" = set || test_gtk3="$using_x11"
1225 test "${test_gtk4+set}" = set || test_gtk4="$using_x11"
1226 test "${test_kf5+set}" = set || test_kf5="$using_x11"
1227 test "${test_kf6+set}" = set || test_kf6="$using_x11"
1228 # don't handle test_qt5, so it can disable test_kf5 later
1229 test "${test_qt6+set}" = set || test_qt6="$using_x11"
1230 test "${test_randr+set}" = set || test_randr="$using_x11"
1231 test "${test_xrender+set}" = set || test_xrender="$using_x11"
1232 test "${using_headless_plugin+set}" = set || using_headless_plugin="$using_freetype_fontconfig"
1234 test "${test_gtk3_kde5+set}" != set -a "$test_kf5" = yes -a "$test_gtk3" = yes && test_gtk3_kde5="yes"
1235 # Make sure fontconfig and freetype test both either system or not
1236 test "${test_system_fontconfig+set}" != set -a "${test_system_freetype+set}" = set && test_system_fontconfig="$test_system_freetype"
1237 test "${test_system_freetype+set}" != set -a "${test_system_fontconfig+set}" = set && test_system_freetype="$test_system_fontconfig"
1239 # convenience / platform overriding "fixes"
1241 test "$test_kf5" = yes -a "$test_qt5" = no && test_kf5=no
1242 test "$test_kf5" = yes && test_qt5=yes
1243 test "$test_gtk3" != yes && enable_gtk3=no
1244 test "$test_gtk3" != yes -o "$test_kf5" != yes && test_gtk3_kde5=no
1245 test "$using_freetype_fontconfig" = no && using_headless_plugin=no
1246 test "$using_freetype_fontconfig" = yes && test_cairo=yes
1248 # Keep in sync with the above $using_x11 depending test default list
1254 test_gstreamer_1_0=no
1266 test "$using_x11" = yes && USING_X11=TRUE
1268 if test "$using_freetype_fontconfig" = yes; then
1269 AC_DEFINE(USE_HEADLESS_CODE)
1270 USE_HEADLESS_CODE=TRUE
1271 if test "$using_headless_plugin" = yes; then
1272 AC_DEFINE(ENABLE_HEADLESS)
1273 ENABLE_HEADLESS=TRUE
1280 AC_SUBST(ENABLE_HEADLESS)
1281 AC_SUBST(USE_HEADLESS_CODE)
1283 AC_MSG_NOTICE([VCL platform has a usable dynamic loading API: $usable_dlapi])
1284 AC_MSG_NOTICE([VCL platform uses freetype+fontconfig: $using_freetype_fontconfig])
1285 AC_MSG_NOTICE([VCL platform uses headless plugin: $using_headless_plugin])
1286 AC_MSG_NOTICE([VCL platform uses X11: $using_x11])
1288 # ===================================================================
1290 # End initial platform setup
1292 # ===================================================================
1294 if test "$_os" = "Android" ; then
1295 # Verify that the NDK and SDK options are proper
1296 if test -z "$with_android_ndk"; then
1297 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
1298 elif test ! -f "$ANDROID_NDK_DIR/meta/abis.json"; then
1299 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
1302 if test -z "$ANDROID_SDK_DIR"; then
1303 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
1304 elif test ! -d "$ANDROID_SDK_DIR/platforms"; then
1305 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
1309 AC_SUBST(SDKDIRNAME)
1311 AC_SUBST(PTHREAD_CFLAGS)
1312 AC_SUBST(PTHREAD_LIBS)
1314 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
1315 # By default use the ones specified by our build system,
1316 # but explicit override is possible.
1317 AC_MSG_CHECKING(for explicit AFLAGS)
1318 if test -n "$AFLAGS"; then
1319 AC_MSG_RESULT([$AFLAGS])
1325 AC_MSG_CHECKING(for explicit CFLAGS)
1326 if test -n "$CFLAGS"; then
1327 AC_MSG_RESULT([$CFLAGS])
1333 AC_MSG_CHECKING(for explicit CXXFLAGS)
1334 if test -n "$CXXFLAGS"; then
1335 AC_MSG_RESULT([$CXXFLAGS])
1341 AC_MSG_CHECKING(for explicit OBJCFLAGS)
1342 if test -n "$OBJCFLAGS"; then
1343 AC_MSG_RESULT([$OBJCFLAGS])
1349 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
1350 if test -n "$OBJCXXFLAGS"; then
1351 AC_MSG_RESULT([$OBJCXXFLAGS])
1357 AC_MSG_CHECKING(for explicit LDFLAGS)
1358 if test -n "$LDFLAGS"; then
1359 AC_MSG_RESULT([$LDFLAGS])
1369 AC_SUBST(OBJCXXFLAGS)
1373 AC_SUBST(x_CXXFLAGS)
1374 AC_SUBST(x_OBJCFLAGS)
1375 AC_SUBST(x_OBJCXXFLAGS)
1378 dnl These are potentially set for MSVC, in the code checking for UCRT below:
1379 my_original_CFLAGS=$CFLAGS
1380 my_original_CXXFLAGS=$CXXFLAGS
1381 my_original_CPPFLAGS=$CPPFLAGS
1383 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
1384 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
1385 dnl AC_PROG_CC internally.
1386 if test "$_os" != "WINNT"; then
1387 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that (and avoid -O2 during AC_PROG_CC,
1388 # Clang 12.0.1 occasionally SEGVs on some of the test invocations during AC_PROG_CC with -O2):
1393 if test -z "$CC_BASE"; then
1394 CC_BASE=`first_arg_basename "$CC"`
1398 if test "$_os" != "WINNT"; then
1399 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
1403 AC_SUBST(ENDIANNESS)
1405 if test "$usable_dlapi" != no; then
1406 AC_DEFINE([HAVE_DLAPI])
1407 if test "$test_unix_dlapi" != no; then
1409 AC_SEARCH_LIBS([dlsym], [dl],
1410 [case "$ac_cv_search_dlsym" in -l*) UNIX_DLAPI_LIBS="$ac_cv_search_dlsym";; esac],
1411 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
1413 AC_DEFINE([HAVE_UNIX_DLAPI])
1416 AC_SUBST(UNIX_DLAPI_LIBS)
1418 # Check for a (GNU) backtrace implementation
1419 AC_ARG_VAR([BACKTRACE_CFLAGS], [Compiler flags needed to use backtrace(3)])
1420 AC_ARG_VAR([BACKTRACE_LIBS], [Linker flags needed to use backtrace(3)])
1421 AS_IF([test "x$BACKTRACE_LIBS$BACKTRACE_CFLAGS" = x], [
1423 AC_SEARCH_LIBS([backtrace], [libexecinfo],
1424 [case "$ac_cv_search_backtrace" in -l*) BACKTRACE_LIBS="$ac_cv_search_backtrace";; esac],
1425 [PKG_CHECK_MODULES([BACKTRACE], [libexecinfo], [ac_cv_search_backtrace=], [:])])
1428 AS_IF([test "x$ac_cv_search_backtrace" != xno ], [
1429 AC_DEFINE([HAVE_FEATURE_BACKTRACE])
1432 dnl ===================================================================
1433 dnl Sanity checks for Emscripten SDK setup
1434 dnl ===================================================================
1436 EMSCRIPTEN_MIN_MAJOR=3
1437 EMSCRIPTEN_MIN_MINOR=1
1438 EMSCRIPTEN_MIN_TINY=3
1439 EMSCRIPTEN_MIN_VERSION="${EMSCRIPTEN_MIN_MAJOR}.${EMSCRIPTEN_MIN_MINOR}.${EMSCRIPTEN_MIN_TINY}"
1441 if test "$_os" = "Emscripten"; then
1442 AC_MSG_CHECKING([if Emscripten is at least $EMSCRIPTEN_MIN_VERSION])
1443 if test -z "$EMSCRIPTEN_VERSION_H"; then
1444 AS_IF([test -z "$EMSDK"],
1445 [AC_MSG_ERROR([No \$EMSDK environment variable.])])
1446 EMSCRIPTEN_VERSION_H=$EMSDK/upstream/emscripten/cache/sysroot/include/emscripten/version.h
1448 if test -f "$EMSCRIPTEN_VERSION_H"; then
1449 EMSCRIPTEN_MAJOR=$($GREP __EMSCRIPTEN_major__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_major__ //p')
1450 EMSCRIPTEN_MINOR=$($GREP __EMSCRIPTEN_minor__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_minor__ //p')
1451 EMSCRIPTEN_TINY=$($GREP __EMSCRIPTEN_tiny__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_tiny__ //p')
1453 EMSCRIPTEN_DEFINES=$(echo | emcc -dM -E - | $GREP __EMSCRIPTEN_)
1454 EMSCRIPTEN_MAJOR=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 's/.*__EMSCRIPTEN_major__ //p')
1455 EMSCRIPTEN_MINOR=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 's/.*__EMSCRIPTEN_minor__ //p')
1456 EMSCRIPTEN_TINY=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 's/.*__EMSCRIPTEN_tiny__ //p')
1459 EMSCRIPTEN_VERSION="${EMSCRIPTEN_MAJOR}.${EMSCRIPTEN_MINOR}.${EMSCRIPTEN_TINY}"
1461 check_semantic_version_three_prefixed EMSCRIPTEN MIN
1462 if test $? -eq 0; then
1463 AC_MSG_RESULT([yes ($EMSCRIPTEN_VERSION)])
1465 AC_MSG_ERROR([no, found $EMSCRIPTEN_VERSION])
1469 if ! command -v emconfigure >/dev/null 2>&1; then
1470 AC_MSG_WARN([emconfigure must be in your \$PATH])
1473 if test -z "$EMMAKEN_JUST_CONFIGURE"; then
1474 AC_MSG_WARN(["\$EMMAKEN_JUST_CONFIGURE wasn't set by emconfigure. Prefix configure or use autogen.sh])
1477 EMSDK_FILE_PACKAGER="$(em-config EMSCRIPTEN_ROOT)"/tools/file_packager
1478 if ! test -x "$EMSDK_FILE_PACKAGER"; then
1479 AC_MSG_WARN([No file_packager found in $(em-config EMSCRIPTEN_ROOT)/tools/file_packager.])
1482 if test $EMSCRIPTEN_ERROR -ne 0; then
1483 AC_MSG_ERROR(["Please fix your EMSDK setup to build with Emscripten!"])
1486 dnl Some build-side things are conditional on "EMSCRIPTEN in BUILD_TYPE_FOR_HOST":
1487 BUILD_TYPE="$BUILD_TYPE EMSCRIPTEN"
1489 AC_SUBST(EMSDK_FILE_PACKAGER)
1490 AC_SUBST(EMSCRIPTEN_EXTRA_SOFFICE_POST_JS)
1492 ###############################################################################
1493 # Extensions switches --enable/--disable
1494 ###############################################################################
1495 # By default these should be enabled unless having extra dependencies.
1496 # If there is extra dependency over configure options then the enable should
1497 # be automagic based on whether the requiring feature is enabled or not.
1498 # All this options change anything only with --enable-extension-integration.
1500 # The name of this option and its help string makes it sound as if
1501 # extensions are built anyway, just not integrated in the installer,
1502 # if you use --disable-extension-integration. Is that really the
1505 AC_ARG_ENABLE(ios-simulator,
1506 AS_HELP_STRING([--enable-ios-simulator],
1507 [build for iOS simulator])
1510 libo_FUZZ_ARG_ENABLE(extension-integration,
1511 AS_HELP_STRING([--disable-extension-integration],
1512 [Disable integration of the built extensions in the installer of the
1513 product. Use this switch to disable the integration.])
1516 AC_ARG_ENABLE(avmedia,
1517 AS_HELP_STRING([--disable-avmedia],
1518 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.]),
1519 ,test "${enable_avmedia+set}" = set || enable_avmedia=yes)
1521 AC_ARG_ENABLE(database-connectivity,
1522 AS_HELP_STRING([--disable-database-connectivity],
1523 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
1526 # This doesn't mean not building (or "integrating") extensions
1527 # (although it probably should; i.e. it should imply
1528 # --disable-extension-integration I guess), it means not supporting
1529 # any extension mechanism at all
1530 libo_FUZZ_ARG_ENABLE(extensions,
1531 AS_HELP_STRING([--disable-extensions],
1532 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1535 AC_ARG_ENABLE(scripting,
1536 AS_HELP_STRING([--disable-scripting],
1537 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.]),
1538 ,test "${enable_scripting+set}" = set || enable_scripting=yes)
1540 # This is mainly for Android and iOS, but could potentially be used in some
1541 # special case otherwise, too, so factored out as a separate setting
1543 AC_ARG_ENABLE(dynamic-loading,
1544 AS_HELP_STRING([--disable-dynamic-loading],
1545 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1548 libo_FUZZ_ARG_ENABLE(report-builder,
1549 AS_HELP_STRING([--disable-report-builder],
1550 [Disable the Report Builder.])
1553 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1554 AS_HELP_STRING([--enable-ext-wiki-publisher],
1555 [Enable the Wiki Publisher extension.])
1558 libo_FUZZ_ARG_ENABLE(lpsolve,
1559 AS_HELP_STRING([--disable-lpsolve],
1560 [Disable compilation of the lp solve solver ])
1562 libo_FUZZ_ARG_ENABLE(coinmp,
1563 AS_HELP_STRING([--disable-coinmp],
1564 [Disable compilation of the CoinMP solver ])
1567 libo_FUZZ_ARG_ENABLE(pdfimport,
1568 AS_HELP_STRING([--disable-pdfimport],
1569 [Disable building the PDF import feature.])
1572 libo_FUZZ_ARG_ENABLE(pdfium,
1573 AS_HELP_STRING([--disable-pdfium],
1574 [Disable building PDFium. Results in insecure PDF signature verification.])
1577 libo_FUZZ_ARG_ENABLE(skia,
1578 AS_HELP_STRING([--disable-skia],
1579 [Disable building Skia. Use --enable-skia=debug to build without optimizations.])
1582 ###############################################################################
1584 dnl ---------- *** ----------
1586 libo_FUZZ_ARG_ENABLE(mergelibs,
1587 AS_HELP_STRING([--enable-mergelibs=yes/no/more],
1588 [Merge several of the smaller libraries into one big "merged" library.
1589 The "more" option will link even more of the smaller libraries.
1590 "more" not appropriate for distros which split up LibreOffice into multiple packages.
1591 It is only appropriate for situations where all of LO is delivered in a single install/package. ])
1594 libo_FUZZ_ARG_ENABLE(breakpad,
1595 AS_HELP_STRING([--enable-breakpad],
1596 [Enables breakpad for crash reporting.])
1599 libo_FUZZ_ARG_ENABLE(crashdump,
1600 AS_HELP_STRING([--disable-crashdump],
1601 [Disable dump.ini and dump-file, when --enable-breakpad])
1604 AC_ARG_ENABLE(fetch-external,
1605 AS_HELP_STRING([--disable-fetch-external],
1606 [Disables fetching external tarballs from web sources.])
1609 AC_ARG_ENABLE(fuzzers,
1610 AS_HELP_STRING([--enable-fuzzers],
1611 [Enables building libfuzzer targets for fuzz testing.])
1614 libo_FUZZ_ARG_ENABLE(pch,
1615 AS_HELP_STRING([--enable-pch=<yes/no/system/base/normal/full>],
1616 [Enables precompiled header support for C++. Forced default on Windows/VC build.
1617 Using 'system' will include only external headers, 'base' will add also headers
1618 from base modules, 'normal' will also add all headers except from the module built,
1619 'full' will use all suitable headers even from a module itself.])
1622 libo_FUZZ_ARG_ENABLE(epm,
1623 AS_HELP_STRING([--enable-epm],
1624 [LibreOffice includes self-packaging code, that requires epm, however epm is
1625 useless for large scale package building.])
1628 libo_FUZZ_ARG_ENABLE(odk,
1629 AS_HELP_STRING([--enable-odk],
1630 [Enable building the Office Development Kit, the part that extensions need to build against])
1633 AC_ARG_ENABLE(mpl-subset,
1634 AS_HELP_STRING([--enable-mpl-subset],
1635 [Don't compile any pieces which are not MPL or more liberally licensed])
1638 libo_FUZZ_ARG_ENABLE(evolution2,
1639 AS_HELP_STRING([--enable-evolution2],
1640 [Allows the built-in evolution 2 addressbook connectivity build to be
1644 AC_ARG_ENABLE(avahi,
1645 AS_HELP_STRING([--enable-avahi],
1646 [Determines whether to use Avahi to advertise Impress to remote controls.])
1649 libo_FUZZ_ARG_ENABLE(werror,
1650 AS_HELP_STRING([--enable-werror],
1651 [Turn warnings to errors. (Has no effect in modules where the treating
1652 of warnings as errors is disabled explicitly.)]),
1655 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1656 AS_HELP_STRING([--enable-assert-always-abort],
1657 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1660 libo_FUZZ_ARG_ENABLE(dbgutil,
1661 AS_HELP_STRING([--enable-dbgutil],
1662 [Provide debugging support from --enable-debug and include additional debugging
1663 utilities such as object counting or more expensive checks.
1664 This is the recommended option for developers.
1665 Note that this makes the build ABI incompatible, it is not possible to mix object
1666 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1668 libo_FUZZ_ARG_ENABLE(debug,
1669 AS_HELP_STRING([--enable-debug],
1670 [Include debugging information, disable compiler optimization and inlining plus
1671 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1673 libo_FUZZ_ARG_ENABLE(split-debug,
1674 AS_HELP_STRING([--disable-split-debug],
1675 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1676 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1678 libo_FUZZ_ARG_ENABLE(gdb-index,
1679 AS_HELP_STRING([--disable-gdb-index],
1680 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1681 The feature requires a linker that supports the --gdb-index option.]))
1683 libo_FUZZ_ARG_ENABLE(sal-log,
1684 AS_HELP_STRING([--enable-sal-log],
1685 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1687 libo_FUZZ_ARG_ENABLE(symbols,
1688 AS_HELP_STRING([--enable-symbols],
1689 [Generate debug information.
1690 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1691 otherwise. It is possible to explicitly specify gbuild build targets
1692 (where 'all' means everything, '-' prepended means to not enable, '/' appended means
1693 everything in the directory; there is no ordering, more specific overrides
1694 more general, and disabling takes precedence).
1695 Example: --enable-symbols="all -sw/ -Library_sc".]))
1697 libo_FUZZ_ARG_ENABLE(optimized,
1698 AS_HELP_STRING([--enable-optimized=<yes/no/debug>],
1699 [Whether to compile with optimization flags.
1700 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1701 otherwise. Using 'debug' will try to use only optimizations that should
1702 not interfere with debugging. For Emscripten we default to optimized (-O1)
1703 debug build, as otherwise binaries become too large.]))
1705 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1706 AS_HELP_STRING([--disable-runtime-optimizations],
1707 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1708 JVM JIT) that are known to interact badly with certain dynamic analysis
1709 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1710 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1711 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1713 AC_ARG_WITH(valgrind,
1714 AS_HELP_STRING([--with-valgrind],
1715 [Make availability of Valgrind headers a hard requirement.]))
1717 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1718 AS_HELP_STRING([--enable-compiler-plugins],
1719 [Enable compiler plugins that will perform additional checks during
1720 building. Enabled automatically by --enable-dbgutil.
1721 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1722 COMPILER_PLUGINS_DEBUG=
1723 if test "$enable_compiler_plugins" = debug; then
1724 enable_compiler_plugins=yes
1725 COMPILER_PLUGINS_DEBUG=TRUE
1728 libo_FUZZ_ARG_ENABLE(compiler-plugins-analyzer-pch,
1729 AS_HELP_STRING([--disable-compiler-plugins-analyzer-pch],
1730 [Disable use of precompiled headers when running the Clang compiler plugin analyzer. Not
1731 relevant in the --disable-compiler-plugins case.]))
1733 libo_FUZZ_ARG_ENABLE(ooenv,
1734 AS_HELP_STRING([--enable-ooenv],
1735 [Enable ooenv for the instdir installation.]))
1738 AS_HELP_STRING([--enable-lto],
1739 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1740 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1743 AC_ARG_ENABLE(python,
1744 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1745 [Enables or disables Python support at run-time.
1746 Also specifies what Python to use at build-time.
1747 'fully-internal' even forces the internal version for uses of Python
1749 On macOS the only choices are
1750 'internal' (default) or 'fully-internal'. Otherwise the default is 'auto'.
1753 libo_FUZZ_ARG_ENABLE(gtk3,
1754 AS_HELP_STRING([--disable-gtk3],
1755 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1756 ,test "${test_gtk3}" = no -o "${enable_gtk3+set}" = set || enable_gtk3=yes)
1759 AS_HELP_STRING([--enable-gtk4],
1760 [Determines whether to use Gtk+ 4.0 vclplug on platforms where Gtk+ 4.0 is available.]))
1762 AC_ARG_ENABLE(atspi-tests,
1763 AS_HELP_STRING([--disable-atspi-tests],
1764 [Determines whether to enable AT-SPI2 tests for the GTK3 vclplug.]))
1766 AC_ARG_ENABLE(introspection,
1767 AS_HELP_STRING([--enable-introspection],
1768 [Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
1769 Linux distributions.)]))
1771 AC_ARG_ENABLE(split-app-modules,
1772 AS_HELP_STRING([--enable-split-app-modules],
1773 [Split file lists for app modules, e.g. base, calc.
1774 Has effect only with make distro-pack-install]),
1777 AC_ARG_ENABLE(split-opt-features,
1778 AS_HELP_STRING([--enable-split-opt-features],
1779 [Split file lists for some optional features, e.g. pyuno, testtool.
1780 Has effect only with make distro-pack-install]),
1783 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1784 AS_HELP_STRING([--disable-cairo-canvas],
1785 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1788 libo_FUZZ_ARG_ENABLE(dbus,
1789 AS_HELP_STRING([--disable-dbus],
1790 [Determines whether to enable features that depend on dbus.
1791 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1792 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1794 libo_FUZZ_ARG_ENABLE(sdremote,
1795 AS_HELP_STRING([--disable-sdremote],
1796 [Determines whether to enable Impress remote control (i.e. the server component).]),
1797 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1799 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1800 AS_HELP_STRING([--disable-sdremote-bluetooth],
1801 [Determines whether to build sdremote with bluetooth support.
1802 Requires dbus on Linux.]))
1804 libo_FUZZ_ARG_ENABLE(gio,
1805 AS_HELP_STRING([--disable-gio],
1806 [Determines whether to use the GIO support.]),
1807 ,test "${enable_gio+set}" = set || enable_gio=yes)
1810 AS_HELP_STRING([--enable-qt5],
1811 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1816 AS_HELP_STRING([--enable-qt6],
1817 [Determines whether to use Qt6 vclplug on platforms where Qt6 is
1821 AC_ARG_ENABLE(qt6-multimedia,
1822 AS_HELP_STRING([--disable-qt6-multimedia],
1823 [Determines whether to enable media playback using QtMultimedia when using the qt6/kf6 VCL plugins.]))
1826 AS_HELP_STRING([--enable-kf5],
1827 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1828 KF5 are available.]),
1832 AS_HELP_STRING([--enable-kf6],
1833 [Determines whether to use KF6 vclplug on platforms where Qt6 and
1834 KF6 are available.]),
1838 AC_ARG_ENABLE(gtk3_kde5,
1839 AS_HELP_STRING([--enable-gtk3-kde5],
1840 [Determines whether to use Gtk3 vclplug with KF5 file dialogs on
1841 platforms where Gtk3, Qt5 and Plasma is available.]),
1845 AS_HELP_STRING([--enable-gen],
1846 [To select the gen backend in case of --disable-dynamic-loading.
1847 Per default auto-enabled when X11 is used.]),
1848 ,test "${test_gen}" = no -o "${enable_gen+set}" = set || enable_gen=yes)
1851 AS_HELP_STRING([--disable-gui],
1852 [Disable use of X11 or Wayland to reduce dependencies (e.g. for building LibreOfficeKit).]),
1855 libo_FUZZ_ARG_ENABLE(randr,
1856 AS_HELP_STRING([--disable-randr],
1857 [Disable RandR support in the vcl project.]),
1858 ,test "${enable_randr+set}" = set || enable_randr=yes)
1860 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1861 AS_HELP_STRING([--disable-gstreamer-1-0],
1862 [Disable building with the gstreamer 1.0 avmedia backend.]),
1863 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1865 libo_FUZZ_ARG_ENABLE([eot],
1866 [AS_HELP_STRING([--enable-eot],
1867 [Enable support for Embedded OpenType fonts.])],
1868 ,test "${enable_eot+set}" = set || enable_eot=no)
1870 libo_FUZZ_ARG_ENABLE(cve-tests,
1871 AS_HELP_STRING([--disable-cve-tests],
1872 [Prevent CVE tests to be executed]),
1875 AC_ARG_ENABLE(build-opensymbol,
1876 AS_HELP_STRING([--enable-build-opensymbol],
1877 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1878 fontforge installed.]),
1881 AC_ARG_ENABLE(dependency-tracking,
1882 AS_HELP_STRING([--enable-dependency-tracking],
1883 [Do not reject slow dependency extractors.])[
1884 --disable-dependency-tracking
1885 Disables generation of dependency information.
1886 Speed up one-time builds.],
1889 AC_ARG_ENABLE(icecream,
1890 AS_HELP_STRING([--enable-icecream],
1891 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1892 It defaults to /opt/icecream for the location of the icecream gcc/g++
1893 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1897 AS_HELP_STRING([--enable-ld=<linker>],
1898 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1899 By default tries to use the best linker possible, use --disable-ld to use the default linker.
1900 If <linker> contains any ':', the part before the first ':' is used as the value of
1901 -fuse-ld, while the part after the first ':' is used as the value of --ld-path (which is
1902 needed for Clang 12).]),
1905 libo_FUZZ_ARG_ENABLE(cups,
1906 AS_HELP_STRING([--disable-cups],
1907 [Do not build cups support.])
1910 AC_ARG_ENABLE(ccache,
1911 AS_HELP_STRING([--disable-ccache],
1912 [Do not try to use ccache automatically.
1913 By default we will try to detect if ccache is available; in that case if
1914 CC/CXX are not yet set, and --enable-icecream is not given, we
1915 attempt to use ccache. --disable-ccache disables ccache completely.
1916 Additionally ccache's depend mode is enabled if possible,
1917 use --enable-ccache=nodepend to enable ccache without depend mode.
1921 AC_ARG_ENABLE(z7-debug,
1922 AS_HELP_STRING([--enable-z7-debug],
1923 [Makes the MSVC compiler use -Z7 for debugging instead of the default -Zi. Using this option takes
1924 more disk spaces but allows to use ccache. Final PDB files are created even with this option enabled.
1925 Enabled by default if ccache is detected.]))
1927 libo_FUZZ_ARG_ENABLE(online-update,
1928 AS_HELP_STRING([--enable-online-update],
1929 [Enable the online update service that will check for new versions of
1930 LibreOffice. Disabled by default. Requires --with-privacy-policy-url to be set.]),
1933 libo_FUZZ_ARG_ENABLE(online-update-mar,
1934 AS_HELP_STRING([--enable-online-update-mar],
1935 [Enable the experimental Mozilla-like online update service that will
1936 check for new versions of LibreOffice. Disabled by default.]),
1939 libo_FUZZ_ARG_WITH(online-update-mar-baseurl,
1940 AS_HELP_STRING([--with-online-update-mar-baseurl=...],
1941 [Set the base URL value for --enable-online-update-mar.
1942 (Can be left off for debug purposes, even if that may render the feature
1946 libo_FUZZ_ARG_WITH(online-update-mar-certificateder,
1947 AS_HELP_STRING([--with-online-update-mar-certificateder=...],
1948 [Set the certificate DER value for --enable-online-update-mar.
1949 (Can be left off for debug purposes, even if that may render the feature
1953 libo_FUZZ_ARG_WITH(online-update-mar-certificatename,
1954 AS_HELP_STRING([--with-online-update-mar-certificatename=...],
1955 [Set the certificate name value for --enable-online-update-mar.
1956 (Can be left off for debug purposes, even if that may render the feature
1960 libo_FUZZ_ARG_WITH(online-update-mar-certificatepath,
1961 AS_HELP_STRING([--with-online-update-mar-certificatepath=...],
1962 [Set the certificate path value for --enable-online-update-mar.
1963 (Can be left off for debug purposes, even if that may render the feature
1967 libo_FUZZ_ARG_ENABLE(extension-update,
1968 AS_HELP_STRING([--disable-extension-update],
1969 [Disable possibility to update installed extensions.]),
1972 libo_FUZZ_ARG_ENABLE(release-build,
1973 AS_HELP_STRING([--enable-release-build],
1974 [Enable release build. Note that the "release build" choice is orthogonal to
1975 whether symbols are present, debug info is generated, or optimization
1977 See https://wiki.documentfoundation.org/Development/DevBuild]),
1980 libo_FUZZ_ARG_ENABLE(hardening-flags,
1981 AS_HELP_STRING([--enable-hardening-flags],
1982 [Enable automatically using hardening compiler flags. Distros typically
1983 instead use their default configuration via CXXFLAGS, etc. But this provides a
1984 convenient set of default hardening flags for non-distros]),
1987 AC_ARG_ENABLE(windows-build-signing,
1988 AS_HELP_STRING([--enable-windows-build-signing],
1989 [Enable signing of windows binaries (*.exe, *.dll)]),
1992 AC_ARG_ENABLE(silent-msi,
1993 AS_HELP_STRING([--enable-silent-msi],
1994 [Enable MSI with LIMITUI=1 (silent install).]),
1998 AS_HELP_STRING([--enable-wix],
1999 [Build Windows installer using WiX.]),
2002 AC_ARG_ENABLE(macosx-code-signing,
2003 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
2004 [Sign executables, dylibs, frameworks and the app bundle. If you
2005 don't provide an identity the first suitable certificate
2006 in your keychain is used.]),
2009 AC_ARG_ENABLE(macosx-package-signing,
2010 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
2011 [Create a .pkg suitable for uploading to the Mac App Store and sign
2012 it. If you don't provide an identity the first suitable certificate
2013 in your keychain is used.]),
2016 AC_ARG_ENABLE(macosx-sandbox,
2017 AS_HELP_STRING([--enable-macosx-sandbox],
2018 [Make the app bundle run in a sandbox. Requires code signing.
2019 Is required by apps distributed in the Mac App Store, and implies
2020 adherence to App Store rules.]),
2023 AC_ARG_WITH(macosx-bundle-identifier,
2024 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
2025 [Define the macOS bundle identifier. Default is the somewhat weird
2026 org.libreoffice.script ("script", huh?).]),
2027 ,with_macosx_bundle_identifier=org.libreoffice.script)
2029 AC_ARG_WITH(macosx-provisioning-profile,
2030 AS_HELP_STRING([--with-macosx-provisioning-profile=/path/to/mac.provisionprofile],
2031 [Specify the path to a provisioning profile to use]),
2034 AC_ARG_WITH(product-name,
2035 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
2036 [Define the product name. Default is AC_PACKAGE_NAME.]),
2037 ,with_product_name=$PRODUCTNAME)
2039 libo_FUZZ_ARG_ENABLE(community-flavor,
2040 AS_HELP_STRING([--disable-community-flavor],
2041 [Disable the Community branding.]),
2044 AC_ARG_WITH(package-version,
2045 AS_HELP_STRING([--with-package-version='3.1.4.5'],
2046 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
2049 libo_FUZZ_ARG_ENABLE(readonly-installset,
2050 AS_HELP_STRING([--enable-readonly-installset],
2051 [Prevents any attempts by LibreOffice to write into its installation. That means
2052 at least that no "system-wide" extensions can be added. Partly experimental work in
2053 progress, probably not fully implemented. Always enabled for macOS.]),
2056 libo_FUZZ_ARG_ENABLE(mariadb-sdbc,
2057 AS_HELP_STRING([--disable-mariadb-sdbc],
2058 [Disable the build of the MariaDB/MySQL-SDBC driver.])
2061 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
2062 AS_HELP_STRING([--disable-postgresql-sdbc],
2063 [Disable the build of the PostgreSQL-SDBC driver.])
2066 libo_FUZZ_ARG_ENABLE(lotuswordpro,
2067 AS_HELP_STRING([--disable-lotuswordpro],
2068 [Disable the build of the Lotus Word Pro filter.]),
2069 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
2071 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
2072 AS_HELP_STRING([--disable-firebird-sdbc],
2073 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
2074 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
2076 AC_ARG_ENABLE(bogus-pkg-config,
2077 AS_HELP_STRING([--enable-bogus-pkg-config],
2078 [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.]),
2081 AC_ARG_ENABLE(openssl,
2082 AS_HELP_STRING([--disable-openssl],
2083 [Disable using libssl/libcrypto from OpenSSL. If disabled,
2084 components will use NSS. Work in progress,
2085 use only if you are hacking on it.]),
2086 ,enable_openssl=yes)
2088 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
2089 AS_HELP_STRING([--enable-cipher-openssl-backend],
2090 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
2091 Requires --enable-openssl.]))
2094 AS_HELP_STRING([--disable-nss],
2095 [Disable using NSS. If disabled,
2096 components will use openssl. Work in progress,
2097 use only if you are hacking on it.]),
2100 AC_ARG_ENABLE(library-bin-tar,
2101 AS_HELP_STRING([--enable-library-bin-tar],
2102 [Enable the building and reused of tarball of binary build for some 'external' libraries.
2103 Some libraries can save their build result in a tarball
2104 stored in TARFILE_LOCATION. That binary tarball is
2105 uniquely identified by the source tarball,
2106 the content of the config_host.mk file and the content
2107 of the top-level directory in core for that library
2108 If this option is enabled, then if such a tarfile exist, it will be untarred
2109 instead of the source tarfile, and the build step will be skipped for that
2111 If a proper tarfile does not exist, then the normal source-based
2112 build is done for that library and a proper binary tarfile is created
2113 for the next time.]),
2116 AC_ARG_ENABLE(dconf,
2117 AS_HELP_STRING([--disable-dconf],
2118 [Disable the dconf configuration backend (enabled by default where
2121 libo_FUZZ_ARG_ENABLE(formula-logger,
2123 [--enable-formula-logger],
2124 [Enable formula logger for logging formula calculation flow in Calc.]
2129 AS_HELP_STRING([--disable-ldap],
2130 [Disable LDAP support.]),
2133 AC_ARG_ENABLE(opencl,
2134 AS_HELP_STRING([--disable-opencl],
2135 [Disable OpenCL support.]),
2138 libo_FUZZ_ARG_ENABLE(librelogo,
2139 AS_HELP_STRING([--disable-librelogo],
2140 [Do not build LibreLogo.]),
2141 ,enable_librelogo=yes)
2143 AC_ARG_ENABLE(wasm-strip,
2144 AS_HELP_STRING([--enable-wasm-strip],
2145 [Strip the static build like for WASM/emscripten platform.]),
2148 AC_ARG_WITH(main-module,
2149 AS_HELP_STRING([--with-main-module=<writer/calc>],
2150 [Specify which main module to build for wasm.
2151 Default value is 'writer'.]),
2154 AC_ARG_ENABLE(xmlhelp,
2155 AS_HELP_STRING([--disable-xmlhelp],
2156 [Disable XML help support]),
2157 ,enable_xmlhelp=yes)
2159 AC_ARG_ENABLE(customtarget-components,
2160 AS_HELP_STRING([--enable-customtarget-components],
2161 [Generates the static UNO object constructor mapping from the build.]))
2163 dnl ===================================================================
2164 dnl Optional Packages (--with/without-)
2165 dnl ===================================================================
2167 AC_ARG_WITH(gcc-home,
2168 AS_HELP_STRING([--with-gcc-home],
2169 [Specify the location of gcc/g++ manually. This can be used in conjunction
2170 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
2171 non-default path.]),
2174 AC_ARG_WITH(gnu-patch,
2175 AS_HELP_STRING([--with-gnu-patch],
2176 [Specify location of GNU patch on Solaris or FreeBSD.]),
2179 AC_ARG_WITH(build-platform-configure-options,
2180 AS_HELP_STRING([--with-build-platform-configure-options],
2181 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
2185 AS_HELP_STRING([--with-gnu-cp],
2186 [Specify location of GNU cp on Solaris or FreeBSD.]),
2189 AC_ARG_WITH(external-tar,
2190 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
2191 [Specify an absolute path of where to find (and store) tarfiles.]),
2192 TARFILE_LOCATION=$withval ,
2195 AC_ARG_WITH(referenced-git,
2196 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
2197 [Specify another checkout directory to reference. This makes use of
2198 git submodule update --reference, and saves a lot of diskspace
2199 when having multiple trees side-by-side.]),
2200 GIT_REFERENCE_SRC=$withval ,
2203 AC_ARG_WITH(linked-git,
2204 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
2205 [Specify a directory where the repositories of submodules are located.
2206 This uses a method similar to git-new-workdir to get submodules.]),
2207 GIT_LINK_SRC=$withval ,
2210 AC_ARG_WITH(galleries,
2211 AS_HELP_STRING([--with-galleries],
2212 [Specify how galleries should be built. It is possible either to
2213 build these internally from source ("build"),
2214 or to disable them ("no")]),
2217 AC_ARG_WITH(templates,
2218 AS_HELP_STRING([--with-templates],
2219 [Specify we build with or without template files. It is possible either to
2220 build with templates ("yes"),
2221 or to disable them ("no")]),
2225 AS_HELP_STRING([--with-theme="theme1 theme2..."],
2226 [Choose which themes to include. By default those themes with an '*' are included.
2227 Possible choices: *breeze, *breeze_dark, *breeze_dark_svg, *breeze_svg,
2228 *colibre, *colibre_svg, *colibre_dark, *colibre_dark_svg,
2229 *elementary, *elementary_svg,
2230 *karasa_jaga, *karasa_jaga_svg,
2231 *sifr, *sifr_dark, *sifr_dark_svg, *sifr_svg,
2232 *sukapura, *sukapura_dark, *sukapura_dark_svg, *sukapura_svg.]),
2235 libo_FUZZ_ARG_WITH(helppack-integration,
2236 AS_HELP_STRING([--without-helppack-integration],
2237 [It will not integrate the helppacks to the installer
2238 of the product. Please use this switch to use the online help
2239 or separate help packages.]),
2242 libo_FUZZ_ARG_WITH(fonts,
2243 AS_HELP_STRING([--without-fonts],
2244 [LibreOffice includes some third-party fonts to provide a reliable basis for
2245 help content, templates, samples, etc. When these fonts are already
2246 known to be available on the system then you should use this option.]),
2250 AS_HELP_STRING([--with-epm],
2251 [Decides which epm to use. Default is to use the one from the system if
2252 one is built. When either this is not there or you say =internal epm
2256 AC_ARG_WITH(package-format,
2257 AS_HELP_STRING([--with-package-format],
2258 [Specify package format(s) for LibreOffice installation sets. The
2259 implicit --without-package-format leads to no installation sets being
2260 generated. Possible values: archive, bsd, deb, dmg,
2261 installed, msi, pkg, and rpm.
2262 Example: --with-package-format='deb rpm']),
2266 AS_HELP_STRING([--with-tls],
2267 [Decides which TLS/SSL and cryptographic implementations to use for
2268 LibreOffice's code. Default is to use NSS although OpenSSL is also
2269 possible. Notice that selecting NSS restricts the usage of OpenSSL
2270 in LO's code but selecting OpenSSL doesn't restrict by now the
2271 usage of NSS in LO's code. Possible values: openssl, nss.
2272 Example: --with-tls="nss"]),
2275 AC_ARG_WITH(system-libs,
2276 AS_HELP_STRING([--with-system-libs],
2277 [Use libraries already on system -- enables all --with-system-* flags.]),
2280 AC_ARG_WITH(system-bzip2,
2281 AS_HELP_STRING([--with-system-bzip2],
2282 [Use bzip2 already on system. Used when --enable-online-update-mar
2283 or --enable-python=internal]),,
2284 [with_system_bzip2="$with_system_libs"])
2286 AC_ARG_WITH(system-headers,
2287 AS_HELP_STRING([--with-system-headers],
2288 [Use headers already on system -- enables all --with-system-* flags for
2289 external packages whose headers are the only entities used i.e.
2290 boost/odbc/sane-header(s).]),,
2291 [with_system_headers="$with_system_libs"])
2293 AC_ARG_WITH(system-jars,
2294 AS_HELP_STRING([--without-system-jars],
2295 [When building with --with-system-libs, also the needed jars are expected
2296 on the system. Use this to disable that]),,
2297 [with_system_jars="$with_system_libs"])
2299 AC_ARG_WITH(system-cairo,
2300 AS_HELP_STRING([--with-system-cairo],
2301 [Use cairo libraries already on system. Happens automatically for
2302 (implicit) --enable-gtk3.]))
2304 AC_ARG_WITH(system-epoxy,
2305 AS_HELP_STRING([--with-system-epoxy],
2306 [Use epoxy libraries already on system. Happens automatically for
2307 (implicit) --enable-gtk3.]),,
2308 [with_system_epoxy="$with_system_libs"])
2310 AC_ARG_WITH(myspell-dicts,
2311 AS_HELP_STRING([--with-myspell-dicts],
2312 [Adds myspell dictionaries to the LibreOffice installation set]),
2315 AC_ARG_WITH(system-dicts,
2316 AS_HELP_STRING([--without-system-dicts],
2317 [Do not use dictionaries from system paths.]),
2320 AC_ARG_WITH(external-dict-dir,
2321 AS_HELP_STRING([--with-external-dict-dir],
2322 [Specify external dictionary dir.]),
2325 AC_ARG_WITH(external-hyph-dir,
2326 AS_HELP_STRING([--with-external-hyph-dir],
2327 [Specify external hyphenation pattern dir.]),
2330 AC_ARG_WITH(external-thes-dir,
2331 AS_HELP_STRING([--with-external-thes-dir],
2332 [Specify external thesaurus dir.]),
2335 AC_ARG_WITH(system-zlib,
2336 AS_HELP_STRING([--with-system-zlib],
2337 [Use zlib already on system.]),,
2338 [with_system_zlib=auto])
2340 AC_ARG_WITH(system-jpeg,
2341 AS_HELP_STRING([--with-system-jpeg],
2342 [Use jpeg already on system.]),,
2343 [with_system_jpeg="$with_system_libs"])
2345 AC_ARG_WITH(system-expat,
2346 AS_HELP_STRING([--with-system-expat],
2347 [Use expat already on system.]),,
2348 [with_system_expat="$with_system_libs"])
2350 AC_ARG_WITH(system-libxml,
2351 AS_HELP_STRING([--with-system-libxml],
2352 [Use libxml/libxslt already on system.]),,
2353 [with_system_libxml=auto])
2355 AC_ARG_WITH(system-openldap,
2356 AS_HELP_STRING([--with-system-openldap],
2357 [Use the OpenLDAP LDAP SDK already on system.]),,
2358 [with_system_openldap="$with_system_libs"])
2360 libo_FUZZ_ARG_ENABLE(poppler,
2361 AS_HELP_STRING([--disable-poppler],
2362 [Disable building Poppler.])
2365 AC_ARG_WITH(system-poppler,
2366 AS_HELP_STRING([--with-system-poppler],
2367 [Use system poppler (only needed for PDF import).]),,
2368 [with_system_poppler="$with_system_libs"])
2370 AC_ARG_WITH(system-abseil,
2371 AS_HELP_STRING([--with-system-abseil],
2372 [Use the abseil libraries already on system.]),,
2373 [with_system_abseil="$with_system_libs"])
2375 AC_ARG_WITH(system-openjpeg,
2376 AS_HELP_STRING([--with-system-openjpeg],
2377 [Use the OpenJPEG library already on system.]),,
2378 [with_system_openjpeg="$with_system_libs"])
2380 libo_FUZZ_ARG_ENABLE(gpgmepp,
2381 AS_HELP_STRING([--disable-gpgmepp],
2382 [Disable building gpgmepp. Do not use in normal cases unless you want to fix potential problems it causes.])
2385 AC_ARG_WITH(system-gpgmepp,
2386 AS_HELP_STRING([--with-system-gpgmepp],
2387 [Use gpgmepp already on system]),,
2388 [with_system_gpgmepp="$with_system_libs"])
2390 AC_ARG_WITH(system-mariadb,
2391 AS_HELP_STRING([--with-system-mariadb],
2392 [Use MariaDB/MySQL libraries already on system.]),,
2393 [with_system_mariadb="$with_system_libs"])
2395 AC_ARG_ENABLE(bundle-mariadb,
2396 AS_HELP_STRING([--enable-bundle-mariadb],
2397 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
2400 AC_ARG_WITH(system-postgresql,
2401 AS_HELP_STRING([--with-system-postgresql],
2402 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
2403 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
2404 [with_system_postgresql="$with_system_libs"])
2406 AC_ARG_WITH(libpq-path,
2407 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
2408 [Use this PostgreSQL C interface (libpq) installation for building
2409 the PostgreSQL-SDBC extension.]),
2412 AC_ARG_WITH(system-firebird,
2413 AS_HELP_STRING([--with-system-firebird],
2414 [Use Firebird libraries already on system, for building the Firebird-SDBC
2415 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
2416 [with_system_firebird="$with_system_libs"])
2418 AC_ARG_WITH(system-libtommath,
2419 AS_HELP_STRING([--with-system-libtommath],
2420 [Use libtommath already on system]),,
2421 [with_system_libtommath="$with_system_libs"])
2423 AC_ARG_WITH(system-hsqldb,
2424 AS_HELP_STRING([--with-system-hsqldb],
2425 [Use hsqldb already on system.]))
2427 AC_ARG_WITH(hsqldb-jar,
2428 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
2429 [Specify path to jarfile manually.]),
2430 HSQLDB_JAR=$withval)
2432 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
2433 AS_HELP_STRING([--disable-scripting-beanshell],
2434 [Disable support for scripts in BeanShell.]),
2438 AC_ARG_WITH(system-beanshell,
2439 AS_HELP_STRING([--with-system-beanshell],
2440 [Use beanshell already on system.]),,
2441 [with_system_beanshell="$with_system_jars"])
2443 AC_ARG_WITH(beanshell-jar,
2444 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
2445 [Specify path to jarfile manually.]),
2448 libo_FUZZ_ARG_ENABLE(scripting-javascript,
2449 AS_HELP_STRING([--disable-scripting-javascript],
2450 [Disable support for scripts in JavaScript.]),
2454 AC_ARG_WITH(system-rhino,
2455 AS_HELP_STRING([--with-system-rhino],
2456 [Use rhino already on system.]),,
2457 [with_system_rhino="$with_system_jars"])
2459 AC_ARG_WITH(rhino-jar,
2460 AS_HELP_STRING([--with-rhino-jar=JARFILE],
2461 [Specify path to jarfile manually.]),
2464 AC_ARG_WITH(system-jfreereport,
2465 AS_HELP_STRING([--with-system-jfreereport],
2466 [Use JFreeReport already on system.]),,
2467 [with_system_jfreereport="$with_system_jars"])
2469 AC_ARG_WITH(sac-jar,
2470 AS_HELP_STRING([--with-sac-jar=JARFILE],
2471 [Specify path to jarfile manually.]),
2474 AC_ARG_WITH(libxml-jar,
2475 AS_HELP_STRING([--with-libxml-jar=JARFILE],
2476 [Specify path to jarfile manually.]),
2477 LIBXML_JAR=$withval)
2479 AC_ARG_WITH(flute-jar,
2480 AS_HELP_STRING([--with-flute-jar=JARFILE],
2481 [Specify path to jarfile manually.]),
2484 AC_ARG_WITH(jfreereport-jar,
2485 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
2486 [Specify path to jarfile manually.]),
2487 JFREEREPORT_JAR=$withval)
2489 AC_ARG_WITH(liblayout-jar,
2490 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
2491 [Specify path to jarfile manually.]),
2492 LIBLAYOUT_JAR=$withval)
2494 AC_ARG_WITH(libloader-jar,
2495 AS_HELP_STRING([--with-libloader-jar=JARFILE],
2496 [Specify path to jarfile manually.]),
2497 LIBLOADER_JAR=$withval)
2499 AC_ARG_WITH(libformula-jar,
2500 AS_HELP_STRING([--with-libformula-jar=JARFILE],
2501 [Specify path to jarfile manually.]),
2502 LIBFORMULA_JAR=$withval)
2504 AC_ARG_WITH(librepository-jar,
2505 AS_HELP_STRING([--with-librepository-jar=JARFILE],
2506 [Specify path to jarfile manually.]),
2507 LIBREPOSITORY_JAR=$withval)
2509 AC_ARG_WITH(libfonts-jar,
2510 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
2511 [Specify path to jarfile manually.]),
2512 LIBFONTS_JAR=$withval)
2514 AC_ARG_WITH(libserializer-jar,
2515 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
2516 [Specify path to jarfile manually.]),
2517 LIBSERIALIZER_JAR=$withval)
2519 AC_ARG_WITH(libbase-jar,
2520 AS_HELP_STRING([--with-libbase-jar=JARFILE],
2521 [Specify path to jarfile manually.]),
2522 LIBBASE_JAR=$withval)
2524 AC_ARG_WITH(system-odbc,
2525 AS_HELP_STRING([--with-system-odbc],
2526 [Use the odbc headers already on system.]),,
2527 [with_system_odbc="auto"])
2529 AC_ARG_WITH(system-sane,
2530 AS_HELP_STRING([--with-system-sane],
2531 [Use sane.h already on system.]),,
2532 [with_system_sane="$with_system_headers"])
2534 AC_ARG_WITH(system-bluez,
2535 AS_HELP_STRING([--with-system-bluez],
2536 [Use bluetooth.h already on system.]),,
2537 [with_system_bluez="$with_system_headers"])
2539 AC_ARG_WITH(system-boost,
2540 AS_HELP_STRING([--with-system-boost],
2541 [Use boost already on system.]),,
2542 [with_system_boost="$with_system_headers"])
2544 AC_ARG_WITH(system-dragonbox,
2545 AS_HELP_STRING([--with-system-dragonbox],
2546 [Use dragonbox already on system.]),,
2547 [with_system_dragonbox="$with_system_headers"])
2549 AC_ARG_WITH(system-frozen,
2550 AS_HELP_STRING([--with-system-frozen],
2551 [Use frozen already on system.]),,
2552 [with_system_frozen="$with_system_headers"])
2554 AC_ARG_WITH(system-libfixmath,
2555 AS_HELP_STRING([--with-system-libfixmath],
2556 [Use libfixmath already on system.]),,
2557 [with_system_libfixmath="$with_system_libs"])
2559 AC_ARG_WITH(system-glm,
2560 AS_HELP_STRING([--with-system-glm],
2561 [Use glm already on system.]),,
2562 [with_system_glm="$with_system_headers"])
2564 AC_ARG_WITH(system-hunspell,
2565 AS_HELP_STRING([--with-system-hunspell],
2566 [Use libhunspell already on system.]),,
2567 [with_system_hunspell="$with_system_libs"])
2569 libo_FUZZ_ARG_ENABLE(cairo-rgba,
2570 AS_HELP_STRING([--enable-cairo-rgba],
2571 [Use RGBA order, instead of default BRGA. Not possible with --with-system-cairo]))
2573 libo_FUZZ_ARG_ENABLE(zxing,
2574 AS_HELP_STRING([--disable-zxing],
2575 [Disable use of zxing external library.]))
2577 AC_ARG_WITH(system-zxing,
2578 AS_HELP_STRING([--with-system-zxing],
2579 [Use libzxing already on system.]),,
2580 [with_system_zxing="$with_system_libs"])
2582 AC_ARG_WITH(system-zxcvbn,
2583 AS_HELP_STRING([--with-system-zxcvbn],
2584 [Use libzxcvbn already on system.]),,
2585 [with_system_zxcvbn="$with_system_libs"])
2587 AC_ARG_WITH(system-box2d,
2588 AS_HELP_STRING([--with-system-box2d],
2589 [Use box2d already on system.]),,
2590 [with_system_box2d="$with_system_libs"])
2592 AC_ARG_WITH(system-mythes,
2593 AS_HELP_STRING([--with-system-mythes],
2594 [Use mythes already on system.]),,
2595 [with_system_mythes="$with_system_libs"])
2597 AC_ARG_WITH(system-altlinuxhyph,
2598 AS_HELP_STRING([--with-system-altlinuxhyph],
2599 [Use ALTLinuxhyph already on system.]),,
2600 [with_system_altlinuxhyph="$with_system_libs"])
2602 AC_ARG_WITH(system-lpsolve,
2603 AS_HELP_STRING([--with-system-lpsolve],
2604 [Use lpsolve already on system.]),,
2605 [with_system_lpsolve="$with_system_libs"])
2607 AC_ARG_WITH(system-coinmp,
2608 AS_HELP_STRING([--with-system-coinmp],
2609 [Use CoinMP already on system.]),,
2610 [with_system_coinmp="$with_system_libs"])
2612 AC_ARG_WITH(system-liblangtag,
2613 AS_HELP_STRING([--with-system-liblangtag],
2614 [Use liblangtag library already on system.]),,
2615 [with_system_liblangtag="$with_system_libs"])
2617 AC_ARG_WITH(system-lockfile,
2618 AS_HELP_STRING([--with-system-lockfile[=file]],
2619 [Detect a system lockfile program or use the \$file argument.]))
2622 AS_HELP_STRING([--without-webdav],
2623 [Disable WebDAV support in the UCB.]))
2625 AC_ARG_WITH(linker-hash-style,
2626 AS_HELP_STRING([--with-linker-hash-style],
2627 [Use linker with --hash-style=<style> when linking shared objects.
2628 Possible values: "sysv", "gnu", "both". The default value is "gnu"
2629 if supported on the build system, and "sysv" otherwise.]))
2631 AC_ARG_WITH(jdk-home,
2632 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
2633 [If you have installed JDK 8 or later on your system please supply the
2634 path here. Note that this is not the location of the java command but the
2635 location of the entire distribution. In case of cross-compiling, this
2636 is the JDK of the host os. Use --with-build-platform-configure-options
2637 to point to a different build platform JDK.]),
2641 AS_HELP_STRING([--with-help],
2642 [Enable the build of help. There is a special parameter "common" that
2643 can be used to bundle only the common part, .e.g help-specific icons.
2644 This is useful when you build the helpcontent separately.])
2646 Usage: --with-help build the old local help
2647 --without-help no local help (default)
2648 --with-help=html build the new HTML local help
2649 --with-help=online build the new HTML online help
2653 AC_ARG_WITH(omindex,
2654 AS_HELP_STRING([--with-omindex],
2655 [Enable the support of xapian-omega index for online help.])
2657 Usage: --with-omindex=server prepare the pages for omindex
2658 but let xapian-omega be built in server.
2659 --with-omindex=noxap do not prepare online pages
2664 libo_FUZZ_ARG_WITH(java,
2665 AS_HELP_STRING([--with-java=<java command>],
2666 [Specify the name of the Java interpreter command. Typically "java"
2667 which is the default.
2669 To build without support for Java components, applets, accessibility
2670 or the XML filters written in Java, use --without-java or --with-java=no.]),
2671 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2672 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
2675 AC_ARG_WITH(jvm-path,
2676 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
2677 [Use a specific JVM search path at runtime.
2678 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2681 AC_ARG_WITH(ant-home,
2682 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2683 [If you have installed Apache Ant on your system, please supply the path here.
2684 Note that this is not the location of the Ant binary but the location
2685 of the entire distribution.]),
2688 AC_ARG_WITH(symbol-config,
2689 AS_HELP_STRING([--with-symbol-config],
2690 [Configuration for the crashreport symbol upload]),
2692 [with_symbol_config=no])
2694 AC_ARG_WITH(export-validation,
2695 AS_HELP_STRING([--without-export-validation],
2696 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2697 ,with_export_validation=auto)
2699 AC_ARG_WITH(bffvalidator,
2700 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2701 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2702 Requires installed Microsoft Office Binary File Format Validator.
2703 Note: export-validation (--with-export-validation) is required to be turned on.
2704 See https://web.archive.org/web/20200804155745/https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2705 ,with_bffvalidator=no)
2707 libo_FUZZ_ARG_WITH(junit,
2708 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2709 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2710 --without-junit disables those tests. Not relevant in the --without-java case.]),
2713 AC_ARG_WITH(hamcrest,
2714 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2715 [Specifies the hamcrest jar file to use for JUnit-based tests.
2716 --without-junit disables those tests. Not relevant in the --without-java case.]),
2719 AC_ARG_WITH(perl-home,
2720 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2721 [If you have installed Perl 5 Distribution, on your system, please
2722 supply the path here. Note that this is not the location of the Perl
2723 binary but the location of the entire distribution.]),
2726 libo_FUZZ_ARG_WITH(doxygen,
2728 [--with-doxygen=<absolute path to doxygen executable>],
2729 [Specifies the doxygen executable to use when generating ODK C/C++
2730 documentation. --without-doxygen disables generation of ODK C/C++
2731 documentation. Not relevant in the --disable-odk case.]),
2734 AC_ARG_WITH(visual-studio,
2735 AS_HELP_STRING([--with-visual-studio=<2019/2022/2022preview>],
2736 [Specify which Visual Studio version to use in case several are
2737 installed. Currently 2019 (default) and 2022 are supported.]),
2740 AC_ARG_WITH(windows-sdk,
2741 AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10.0>],
2742 [Specify which Windows SDK, or "Windows Kit", version to use
2743 in case the one that came with the selected Visual Studio
2744 is not what you want for some reason. Note that not all compiler/SDK
2745 combinations are supported. The intent is that this option should not
2750 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2751 [Use this option to build LibreOffice with additional UI language support.
2752 English (US) is always included by default.
2753 Separate multiple languages with space.
2754 For all languages, use --with-lang=ALL.]),
2757 AC_ARG_WITH(locales,
2758 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2759 [Use this option to limit the locale information built in.
2760 Separate multiple locales with space.
2761 Very experimental and might well break stuff.
2762 Just a desperate measure to shrink code and data size.
2763 By default all the locales available is included.
2764 Just works with --disable-dynloading. Defaults to "ALL".
2765 This option is completely unrelated to --with-lang.])
2767 Affects also our character encoding conversion
2768 tables for encodings mainly targeted for a
2769 particular locale, like EUC-CN and EUC-TW for
2770 zh, ISO-2022-JP for ja.
2772 Affects also our add-on break iterator data for
2775 For the default, all locales, don't use this switch at all.
2776 Specifying just the language part of a locale means all matching
2777 locales will be included.
2781 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2782 #Â and also by Mariadb/Mysql and libcurl since LibO 24.8
2783 libo_FUZZ_ARG_WITH(krb5,
2784 AS_HELP_STRING([--with-krb5],
2785 [Enable MIT Kerberos 5 support in modules that support it.
2786 By default automatically enabled on platforms
2787 where a good system Kerberos 5 is available.]),
2790 libo_FUZZ_ARG_WITH(gssapi,
2791 AS_HELP_STRING([--with-gssapi],
2792 [Enable GSSAPI support in modules that support it.
2793 By default automatically enabled on platforms
2794 where a good system GSSAPI is available.]),
2797 libo_FUZZ_ARG_WITH(lxml,
2798 AS_HELP_STRING([--without-lxml],
2799 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2800 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2801 report widget classes and ids.]),
2804 libo_FUZZ_ARG_WITH(latest-c++,
2805 AS_HELP_STRING([--with-latest-c++],
2806 [Try to enable the latest features of the C++ compiler, even if they are not yet part of a
2807 published standard. This option is ignored when CXXFLAGS_CXX11 is set explicitly.]),,
2808 [with_latest_c__=no])
2810 AC_ARG_WITH(gtk3-build,
2811 AS_HELP_STRING([--with-gtk3-build=<absolute path to GTK3 build>],
2812 [(Windows-only) In order to build GtkTiledViewer on Windows, pass the path
2813 to a GTK3 build, like '--with-gtk3-build=C:/gtk-build/gtk/x64/release'.]))
2815 AC_ARG_WITH(keep-awake,
2816 AS_HELP_STRING([--with-keep-awake],
2817 [command to prefix make with in order to prevent the system from going to sleep/suspend
2819 If no command is specified, defaults to using Awake (from Microsoft PowerToys) on Windows
2820 and caffeinate on macOS]))
2822 dnl ===================================================================
2824 dnl ===================================================================
2826 AC_ARG_WITH(branding,
2827 AS_HELP_STRING([--with-branding=/path/to/images],
2828 [Use given path to retrieve branding images set.])
2830 Search for intro.png about.svg and logo.svg.
2831 If any is missing, default ones will be used instead.
2833 Search also progress.conf for progress
2834 settings on intro screen :
2836 PROGRESSBARCOLOR="255,255,255" Set color of
2837 progress bar. Comma separated RGB decimal values.
2838 PROGRESSSIZE="407,6" Set size of progress bar.
2839 Comma separated decimal values (width, height).
2840 PROGRESSPOSITION="61,317" Set position of progress
2841 bar from left,top. Comma separated decimal values.
2842 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2843 bar frame. Comma separated RGB decimal values.
2844 PROGRESSTEXTCOLOR="0,0,0" Set color of progress
2845 bar text. Comma separated RGB decimal values.
2846 PROGRESSTEXTBASELINE="287" Set vertical position of
2847 progress bar text from top. Decimal value.
2849 Default values will be used if not found.
2854 AC_ARG_WITH(extra-buildid,
2855 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2856 [Show addition build identification in about dialog.]),
2861 AS_HELP_STRING([--with-vendor="John the Builder"],
2862 [Set vendor of the build.]),
2865 AC_ARG_WITH(privacy-policy-url,
2866 AS_HELP_STRING([--with-privacy-policy-url="https://yourdomain/privacy-policy"],
2867 [The URL to your privacy policy (needed when
2868 enabling online-update or crashreporting via breakpad)]),
2869 [if test "x$with_privacy_policy_url" = "xyes"; then
2870 AC_MSG_FAILURE([you need to specify an argument when using --with-privacy-policy-url])
2871 elif test "x$with_privacy_policy_url" = "xno"; then
2872 with_privacy_policy_url="undefined"
2874 ,[with_privacy_policy_url="undefined"])
2876 AC_ARG_WITH(android-package-name,
2877 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2878 [Set Android package name of the build.]),
2881 AC_ARG_WITH(compat-oowrappers,
2882 AS_HELP_STRING([--with-compat-oowrappers],
2883 [Install oo* wrappers in parallel with
2884 lo* ones to keep backward compatibility.
2885 Has effect only with make distro-pack-install]),
2888 AC_ARG_WITH(os-version,
2889 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2890 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2893 AC_ARG_WITH(parallelism,
2894 AS_HELP_STRING([--with-parallelism],
2895 [Number of jobs to run simultaneously during build. Parallel builds can
2896 save a lot of time on multi-cpu machines. Defaults to the number of
2897 CPUs on the machine, unless you configure --enable-icecream - then to
2901 AC_ARG_WITH(all-tarballs,
2902 AS_HELP_STRING([--with-all-tarballs],
2903 [Download all external tarballs unconditionally]))
2905 AC_ARG_WITH(gdrive-client-id,
2906 AS_HELP_STRING([--with-gdrive-client-id],
2907 [Provides the client id of the application for OAuth2 authentication
2908 on Google Drive. If either this or --with-gdrive-client-secret is
2909 empty, the feature will be disabled]),
2912 AC_ARG_WITH(gdrive-client-secret,
2913 AS_HELP_STRING([--with-gdrive-client-secret],
2914 [Provides the client secret of the application for OAuth2
2915 authentication on Google Drive. If either this or
2916 --with-gdrive-client-id is empty, the feature will be disabled]),
2919 AC_ARG_WITH(alfresco-cloud-client-id,
2920 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2921 [Provides the client id of the application for OAuth2 authentication
2922 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2923 empty, the feature will be disabled]),
2926 AC_ARG_WITH(alfresco-cloud-client-secret,
2927 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2928 [Provides the client secret of the application for OAuth2
2929 authentication on Alfresco Cloud. If either this or
2930 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2933 AC_ARG_WITH(onedrive-client-id,
2934 AS_HELP_STRING([--with-onedrive-client-id],
2935 [Provides the client id of the application for OAuth2 authentication
2936 on OneDrive. If either this or --with-onedrive-client-secret is
2937 empty, the feature will be disabled]),
2940 AC_ARG_WITH(onedrive-client-secret,
2941 AS_HELP_STRING([--with-onedrive-client-secret],
2942 [Provides the client secret of the application for OAuth2
2943 authentication on OneDrive. If either this or
2944 --with-onedrive-client-id is empty, the feature will be disabled]),
2947 dnl Check for coredumpctl support to present information about crashing test processes:
2948 AC_ARG_WITH(coredumpctl,
2949 AS_HELP_STRING([--with-coredumpctl],
2950 [Use coredumpctl (together with systemd-run) to retrieve core dumps of crashing test
2953 AC_ARG_WITH(buildconfig-recorded,
2954 AS_HELP_STRING([--with-buildconfig-recorded],
2955 [Put build config into version info reported by LOK. Incompatible with reproducible builds.]),
2958 AC_MSG_CHECKING([whether to record build config])
2959 if test -z "$with_buildconfig_recorded"; then
2960 with_buildconfig_recorded=no
2962 if test "$with_buildconfig_recorded" = no; then
2965 AC_MSG_RESULT([yes])
2966 # replace backslashes, to get a valid c++ string
2967 config_args=$(echo $ac_configure_args | tr '\\' '/')
2968 AC_DEFINE_UNQUOTED([BUILDCONFIG],[["$config_args"]],[Options passed to configure script])
2969 AC_DEFINE([BUILDCONFIG_RECORDED],[1],[Options passed to configure script])
2972 dnl ===================================================================
2973 dnl Do we want to use pre-build binary tarball for recompile
2974 dnl ===================================================================
2976 if test "$enable_library_bin_tar" = "yes" ; then
2977 USE_LIBRARY_BIN_TAR=TRUE
2979 USE_LIBRARY_BIN_TAR=
2981 AC_SUBST(USE_LIBRARY_BIN_TAR)
2983 dnl ===================================================================
2984 dnl Test whether build target is Release Build
2985 dnl ===================================================================
2986 AC_MSG_CHECKING([whether build target is Release Build])
2987 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2989 ENABLE_RELEASE_BUILD=
2990 dnl Pu the value on one line as make (at least on macOS) seems to ignore
2991 dnl the newlines and then complains about spaces.
2992 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/>'
2994 AC_MSG_RESULT([yes])
2995 ENABLE_RELEASE_BUILD=TRUE
2996 GET_TASK_ALLOW_ENTITLEMENT=
2998 AC_SUBST(ENABLE_RELEASE_BUILD)
2999 AC_SUBST(GET_TASK_ALLOW_ENTITLEMENT)
3001 dnl ===================================================================
3002 dnl Test whether build should auto use hardening compiler flags
3003 dnl ===================================================================
3004 AC_MSG_CHECKING([whether build should auto use hardening compiler flags])
3005 if test "$enable_hardening_flags" = "" -o "$enable_hardening_flags" = "no"; then
3007 ENABLE_HARDENING_FLAGS=
3009 AC_MSG_RESULT([yes])
3010 ENABLE_HARDENING_FLAGS=TRUE
3012 AC_SUBST(ENABLE_HARDENING_FLAGS)
3014 AC_MSG_CHECKING([whether to build a Community flavor])
3015 if test -z "$enable_community_flavor" -o "$enable_community_flavor" = "yes"; then
3016 AC_DEFINE(HAVE_FEATURE_COMMUNITY_FLAVOR)
3017 AC_MSG_RESULT([yes])
3022 dnl ===================================================================
3023 dnl Test whether to sign Windows Build
3024 dnl ===================================================================
3025 AC_MSG_CHECKING([whether to sign windows build])
3026 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
3027 AC_MSG_RESULT([yes])
3028 WINDOWS_BUILD_SIGNING="TRUE"
3031 WINDOWS_BUILD_SIGNING="FALSE"
3033 AC_SUBST(WINDOWS_BUILD_SIGNING)
3035 dnl ===================================================================
3036 dnl MacOSX build and runtime environment options
3037 dnl ===================================================================
3039 AC_ARG_WITH(macosx-version-min-required,
3040 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
3041 [set the minimum OS version needed to run the built LibreOffice])
3043 e. g.: --with-macosx-version-min-required=10.15
3047 dnl ===================================================================
3048 dnl Check for incompatible options set by fuzzing, and reset those
3049 dnl automatically to working combinations
3050 dnl ===================================================================
3052 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
3053 "$enable_dbus" != "$enable_avahi"; then
3054 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
3055 enable_avahi=$enable_dbus
3060 if ! echo "$LO_PATH" | $EGREP -q "(^|${P_SEP})$1($|${P_SEP})"; then
3061 LO_PATH="${LO_PATH:+$LO_PATH$P_SEP}$1"
3065 add_lopath_before ()
3070 for dir in $LO_PATH ; do
3071 if test "$dir" != "$1" ; then
3072 path_cleanup=${path_cleanup:+$path_cleanup$P_SEP}$dir
3075 LO_PATH="$1${path_cleanup:+$P_SEP$path_cleanup}"
3078 dnl ===================================================================
3079 dnl check for required programs (grep, awk, sed, bash)
3080 dnl ===================================================================
3085 if test -n "$1"; then
3086 if test "$build_os" = "cygwin"; then
3087 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
3089 new_path=`cygpath -sm "$formatted_path"`
3092 new_path=`cygpath -u "$formatted_path"`
3097 if test "$2" = "after"; then
3098 add_lopath_after "$new_path"
3100 add_lopath_before "$new_path"
3106 AC_PATH_PROG( AWK, $AWK)
3107 if test -z "$AWK"; then
3108 AC_MSG_ERROR([install awk to run this script])
3111 AC_PATH_PROG(BASH, bash)
3112 if test -z "$BASH"; then
3113 AC_MSG_ERROR([bash not found in \$PATH])
3117 # prefer parallel compression tools, if available
3118 AC_PATH_PROG(COMPRESSIONTOOL, pigz)
3119 if test -z "$COMPRESSIONTOOL"; then
3120 AC_PATH_PROG(COMPRESSIONTOOL, gzip)
3121 if test -z "$COMPRESSIONTOOL"; then
3122 AC_MSG_ERROR([gzip not found in \$PATH])
3125 AC_SUBST(COMPRESSIONTOOL)
3127 AC_MSG_CHECKING([for GNU or BSD tar])
3128 for a in $GNUTAR gtar gnutar tar bsdtar /usr/sfw/bin/gtar; do
3129 $a --version 2> /dev/null | grep -E "GNU|bsdtar" 2>&1 > /dev/null
3130 if test $? -eq 0; then
3135 AC_MSG_RESULT($GNUTAR)
3136 if test -z "$GNUTAR"; then
3137 AC_MSG_ERROR([not found. install GNU or BSD tar.])
3141 AC_MSG_CHECKING([for tar's option to strip components])
3142 $GNUTAR --help 2> /dev/null | grep -E "bsdtar|strip-components" 2>&1 >/dev/null
3143 if test $? -eq 0; then
3144 STRIP_COMPONENTS="--strip-components"
3146 $GNUTAR --help 2> /dev/null | grep -E "strip-path" 2>&1 >/dev/null
3147 if test $? -eq 0; then
3148 STRIP_COMPONENTS="--strip-path"
3150 STRIP_COMPONENTS="unsupported"
3153 AC_MSG_RESULT($STRIP_COMPONENTS)
3154 if test x$STRIP_COMPONENTS = xunsupported; then
3155 AC_MSG_ERROR([you need a tar that is able to strip components.])
3157 AC_SUBST(STRIP_COMPONENTS)
3159 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
3160 dnl desktop OSes from "mobile" ones.
3162 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
3163 dnl In other words, that when building for an OS that is not a
3164 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
3166 dnl Note the direction of the implication; there is no assumption that
3167 dnl cross-compiling would imply a non-desktop OS.
3169 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
3170 BUILD_TYPE="$BUILD_TYPE DESKTOP"
3171 AC_DEFINE(HAVE_FEATURE_DESKTOP)
3172 if test "$_os" != Emscripten; then
3173 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
3177 # explicitly doesn't include enable_gtk3=no and enable_qt5=yes, so it should
3178 # also work with the default gtk3 plugin.
3179 if test "$enable_wasm_strip" = "yes"; then
3184 test "$_os" = Emscripten && enable_curl=no
3185 enable_database_connectivity=no
3188 test "${enable_dynamic_loading+set}" = set -o "$_os" != Emscripten || enable_dynamic_loading=no
3189 enable_extension_integration=no
3190 enable_extensions=no
3191 enable_extension_update=no
3195 enable_lotuswordpro=no
3199 enable_online_update=no
3203 enable_report_builder=no
3205 enable_sdremote_bluetooth=no
3215 test_libpagemaker=no
3225 test "${with_fonts+set}" = set || with_fonts=yes
3226 test "${with_locales+set}" = set || with_locales=en
3228 AC_DEFINE(ENABLE_WASM_STRIP_ACCESSIBILITY)
3229 AC_DEFINE(ENABLE_WASM_STRIP_WRITER)
3230 AC_DEFINE(ENABLE_WASM_STRIP_CALC)
3231 AC_DEFINE(ENABLE_WASM_STRIP_CANVAS)
3232 # AC_DEFINE(ENABLE_WASM_STRIP_CHART)
3233 AC_DEFINE(ENABLE_WASM_STRIP_DBACCESS)
3234 AC_DEFINE(ENABLE_WASM_STRIP_EPUB)
3235 AC_DEFINE(ENABLE_WASM_STRIP_EXTRA)
3236 AC_DEFINE(ENABLE_WASM_STRIP_GUESSLANG)
3237 # AC_DEFINE(ENABLE_WASM_STRIP_HUNSPELL)
3238 AC_DEFINE(ENABLE_WASM_STRIP_LANGUAGETOOL)
3239 AC_DEFINE(ENABLE_WASM_STRIP_PINGUSER)
3240 AC_DEFINE(ENABLE_WASM_STRIP_PREMULTIPLY)
3241 AC_DEFINE(ENABLE_WASM_STRIP_RECENT)
3242 AC_DEFINE(ENABLE_WASM_STRIP_RECOVERYUI)
3243 AC_DEFINE(ENABLE_WASM_STRIP_SPLASH)
3244 AC_DEFINE(ENABLE_WASM_STRIP_SWEXPORTS)
3245 AC_DEFINE(ENABLE_WASM_STRIP_SCEXPORTS)
3248 # Whether to build "avmedia" functionality or not.
3250 if test "$enable_avmedia" = yes; then
3251 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
3252 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
3254 test_gstreamer_1_0=no
3257 # Decide whether to build database connectivity stuff (including Base) or not.
3258 if test "$enable_database_connectivity" != no; then
3259 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
3260 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
3262 if test "$_os" = iOS; then
3263 AC_MSG_ERROR([Presumly can't disable DB connectivity on iOS.])
3265 disable_database_connectivity_dependencies
3268 if test -z "$enable_extensions"; then
3269 # For iOS and Android Viewer, disable extensions unless specifically overridden with --enable-extensions.
3270 if test $_os != iOS && test $_os != Android -o "$ENABLE_ANDROID_LOK" = TRUE ; then
3271 enable_extensions=yes
3275 DISABLE_SCRIPTING=''
3276 if test "$enable_scripting" = yes; then
3277 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
3278 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
3280 DISABLE_SCRIPTING='TRUE'
3281 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
3284 if test $_os = iOS -o $_os = Android -o $_os = Emscripten; then
3285 # Disable dynamic_loading always for iOS and Android
3286 enable_dynamic_loading=no
3287 elif test -z "$enable_dynamic_loading"; then
3288 # Otherwise enable it unless specifically disabled
3289 enable_dynamic_loading=yes
3292 DISABLE_DYNLOADING=''
3293 if test "$enable_dynamic_loading" = yes; then
3294 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
3296 DISABLE_DYNLOADING='TRUE'
3297 if test $_os != iOS -a $_os != Android; then
3298 enable_database_connectivity=no
3306 AC_SUBST(DISABLE_DYNLOADING)
3308 ENABLE_CUSTOMTARGET_COMPONENTS=
3309 if test "$enable_customtarget_components" = yes -a "$DISABLE_DYNLOADING" = TRUE; then
3310 ENABLE_CUSTOMTARGET_COMPONENTS=TRUE
3311 if test -n "$with_locales" -a "$with_locales" != en -a "$with_locales" != ALL; then
3312 AC_MSG_ERROR([Currently just --with-locales=all or en is supported with --enable-customtarget-components])
3315 AC_SUBST(ENABLE_CUSTOMTARGET_COMPONENTS)
3317 if test "$enable_extensions" = yes; then
3318 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
3319 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
3321 enable_extension_integration=no
3322 enable_extension_update=no
3325 # remember SYSBASE value
3328 dnl ===================================================================
3329 dnl Sort out various gallery compilation options
3330 dnl ===================================================================
3331 WITH_GALLERY_BUILD=TRUE
3332 AC_MSG_CHECKING([how to build and package galleries])
3333 if test -n "${with_galleries}"; then
3334 if test "$with_galleries" = "build"; then
3335 if test "$enable_database_connectivity" = no; then
3336 AC_MSG_ERROR([DB connectivity is needed for gengal / svx])
3338 AC_MSG_RESULT([build from source images internally])
3339 elif test "$with_galleries" = "no"; then
3341 AC_MSG_RESULT([disable non-internal gallery build])
3343 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
3346 if test $_os != iOS -a $_os != Android; then
3347 AC_MSG_RESULT([internal src images for desktop])
3350 AC_MSG_RESULT([disable src image build])
3353 AC_SUBST(WITH_GALLERY_BUILD)
3355 dnl ===================================================================
3356 dnl Sort out various templates compilation options
3357 dnl ===================================================================
3359 AC_MSG_CHECKING([build with or without template files])
3360 if test -n "${with_templates}"; then
3361 if test "$with_templates" = "yes"; then
3362 AC_MSG_RESULT([enable all templates])
3363 elif test "$with_templates" = "no"; then
3365 AC_MSG_RESULT([disable non-internal templates])
3367 AC_MSG_ERROR([unknown value --with-templates=$with_templates])
3370 if test $_os != iOS -a $_os != Android -a $_os != Emscripten; then
3371 AC_MSG_RESULT([enable all templates])
3374 AC_MSG_RESULT([disable non-internal templates])
3377 AC_SUBST(WITH_TEMPLATES)
3379 dnl ===================================================================
3380 dnl Checks if ccache is available
3381 dnl ===================================================================
3383 if test "$enable_ccache" = "no"; then
3385 elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
3386 case "%$CC%$CXX%" in
3387 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
3388 # assume that's good then
3389 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
3390 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
3391 CCACHE_DEPEND_MODE=1
3394 # try to use our own ccache if it is available and CCACHE was not already defined
3395 if test -z "$CCACHE"; then
3396 if test "$_os" = "WINNT"; then
3397 ccache_ext=.exe # e.g. openssl build needs ccache.exe, not just ccache
3399 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/ccache$ccache_ext" ; then
3400 CCACHE="$LODE_HOME/opt/bin/ccache$ccache_ext"
3401 elif test -x "/opt/lo/bin/ccache$ccache_ext"; then
3402 CCACHE="/opt/lo/bin/ccache$ccache_ext"
3405 AC_PATH_PROG([CCACHE],[ccache],[not found])
3406 if test "$CCACHE" != "not found" -a "$_os" = "WINNT"; then
3407 CCACHE=`win_short_path_for_make "$CCACHE"`
3408 # check that it has MSVC support (it should recognize it in CCACHE_COMPILERTYPE)
3410 AC_MSG_CHECKING([whether $CCACHE has MSVC support])
3411 CCACHE_COMPILERTYPE=cl CCACHE_LOGFILE=conftest.txt $CCACHE echo >/dev/null 2>/dev/null
3412 if grep -q 'Config: (environment) compiler_type = cl' conftest.txt; then
3420 if test "$CCACHE" = "not found" -a "$_os" = "WINNT"; then
3421 # on windows/VC perhaps sccache is around?
3422 case "%$CC%$CXX%" in
3423 # If $CC and/or $CXX already contain "sccache" (possibly suffixed with some version number etc),
3424 # assume that's good then
3425 *%sccache[[-_' ']]*|*/sccache[[-_' ']]*)
3426 AC_MSG_NOTICE([sccache seems to be included in a pre-defined CC and/or CXX])
3427 CCACHE_DEPEND_MODE=1
3431 # for sharing code below, reuse CCACHE env var
3432 AC_PATH_PROG([CCACHE],[sccache],[not found])
3433 if test "$CCACHE" != "not found"; then
3434 CCACHE=`win_short_path_for_make "$CCACHE"`
3436 CCACHE_DEPEND_MODE=1
3441 if test "$CCACHE" = "not found"; then
3444 if test -n "$CCACHE" -a -z "$SCCACHE"; then
3445 CCACHE_DEPEND_MODE=1
3446 # Need to check for ccache version: otherwise prevents
3447 # caching of the results (like "-x objective-c++" for Mac)
3448 if test $_os = Darwin -o $_os = iOS; then
3449 # Check ccache version
3450 AC_MSG_CHECKING([whether version of ccache is suitable])
3451 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
3452 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3453 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
3454 AC_MSG_RESULT([yes, $CCACHE_VERSION])
3456 AC_MSG_RESULT([no, $CCACHE_VERSION])
3462 if test "$enable_ccache" = yes && test -z "$CCACHE"; then
3463 AC_MSG_ERROR([No suitable ccache found])
3470 if test "$enable_ccache" = "nodepend"; then
3471 CCACHE_DEPEND_MODE=""
3473 AC_SUBST(CCACHE_DEPEND_MODE)
3475 # sccache defaults are good enough
3476 if test "$CCACHE" != "" -a -z "$SCCACHE"; then
3477 # e.g. (/home/rene/.config/ccache/ccache.conf) max_size = 20.0G
3478 # or (...) max_size = 20.0 G
3479 # -p works with both 4.2 and 4.4
3480 ccache_size_msg=$([$CCACHE -p | $AWK /max_size/'{ print $4 $5 }' | sed -e 's/\.[0-9]*//'])
3481 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
3482 if test "$ccache_size" = ""; then
3483 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
3484 if test "$ccache_size" = ""; then
3487 # we could not determine the size or it was less than 1GB -> disable auto-ccache
3488 if test $ccache_size -lt 1024; then
3490 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
3491 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
3493 # warn that ccache may be too small for debug build
3494 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
3495 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
3498 if test $ccache_size -lt 5; then
3499 #warn that ccache may be too small for debug build
3500 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
3501 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
3507 if test "$enable_z7_debug" != no; then
3508 if test "$enable_z7_debug" = yes -o -n "$CCACHE"; then
3509 ENABLE_Z7_DEBUG=TRUE
3512 AC_MSG_WARN([ccache will not work with --disable-z7-debug])
3513 add_warning "ccache will not work with --disable-z7-debug"
3515 AC_SUBST(ENABLE_Z7_DEBUG)
3517 dnl ===================================================================
3518 dnl Checks for C compiler,
3519 dnl The check for the C++ compiler is later on.
3520 dnl ===================================================================
3521 if test "$_os" != "WINNT"; then
3523 AC_MSG_CHECKING([gcc home])
3524 if test -z "$with_gcc_home"; then
3525 if test "$enable_icecream" = "yes"; then
3526 if test -d "/usr/lib/icecc/bin"; then
3527 GCC_HOME="/usr/lib/icecc/"
3528 elif test -d "/usr/libexec/icecc/bin"; then
3529 GCC_HOME="/usr/libexec/icecc/"
3530 elif test -d "/opt/icecream/bin"; then
3531 GCC_HOME="/opt/icecream/"
3533 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
3537 GCC_HOME=`command -v gcc | $SED -e s,/bin/gcc,,`
3538 GCC_HOME_SET="false"
3541 GCC_HOME="$with_gcc_home"
3543 AC_MSG_RESULT($GCC_HOME)
3546 if test "$GCC_HOME_SET" = "true"; then
3547 if test -z "$CC"; then
3548 CC="$GCC_HOME/bin/gcc"
3551 if test -z "$CXX"; then
3552 CXX="$GCC_HOME/bin/g++"
3558 COMPATH=`dirname "$CC"`
3559 if test "$COMPATH" = "."; then
3560 AC_PATH_PROGS(COMPATH, $CC)
3561 dnl double square bracket to get single because of M4 quote...
3562 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
3564 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
3566 dnl ===================================================================
3568 dnl ===================================================================
3569 AC_MSG_CHECKING([whether to build with Java support])
3570 javacompiler="javac"
3572 if test "$with_java" != "no"; then
3573 if test "$DISABLE_SCRIPTING" = TRUE; then
3574 AC_MSG_RESULT([no, overridden by --disable-scripting])
3578 AC_MSG_RESULT([yes])
3580 AC_DEFINE(HAVE_FEATURE_JAVA)
3587 AC_SUBST(ENABLE_JAVA)
3589 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
3591 dnl ENABLE_JAVA="" indicate no Java support at all
3593 dnl ===================================================================
3594 dnl Check macOS SDK and compiler
3595 dnl ===================================================================
3597 if test $_os = Darwin; then
3599 # The SDK in the currently selected Xcode should be found.
3601 AC_MSG_CHECKING([what macOS SDK to use])
3602 # XCode only ships with a single SDK for a while now, and using older SDKs alongside is not
3603 # really supported anymore, instead you'd use different copies of Xcode, each with their own
3604 # SDK, and thus xcrun will pick the SDK that matches the currently selected Xcode version
3605 # also restricting the SDK version to "known good" versions doesn't seem necessary anymore, the
3606 # problems that existed in the PPC days with target versions not being respected or random
3607 # failures seems to be a thing of the past or rather: limiting either the Xcode version or the
3608 # SDK version is enough, no need to do both...
3609 MACOSX_SDK_PATH=`xcrun --sdk macosx --show-sdk-path 2> /dev/null`
3610 if test ! -d "$MACOSX_SDK_PATH"; then
3611 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
3613 macosx_sdk=`xcodebuild -version -sdk "$MACOSX_SDK_PATH" SDKVersion`
3614 MACOSX_SDK_BUILD_VERSION=$(xcodebuild -version -sdk "$MACOSX_SDK_PATH" ProductBuildVersion)
3615 # format changed between 10.9 and 10.10 - up to 10.9 it was just four digits (1090), starting
3616 # with macOS 10.10 it was switched to account for x.y.z with six digits, 10.10 is 101000,
3618 # we don't target the lower versions anymore, so it doesn't matter that we don't generate the
3619 # correct version in case such an old SDK is specified, it will be rejected later anyway
3620 MACOSX_SDK_VERSION=$(echo $macosx_sdk | $AWK -F. '{ print $1*10000+$2*100+$3 }')
3621 if test $MACOSX_SDK_VERSION -lt 101500; then
3622 AC_MSG_ERROR([macOS SDK $macosx_sdk is not supported, lowest supported version is 10.15])
3624 if test "$host_cpu" = arm64 -a $MACOSX_SDK_VERSION -lt 110000; then
3625 AC_MSG_ERROR([macOS SDK $macosx_sdk is not supported for Apple Silicon (need at least 11.0)])
3627 AC_MSG_RESULT([macOS SDK $macosx_sdk at $MACOSX_SDK_PATH])
3629 AC_MSG_CHECKING([what minimum version of macOS to require])
3630 if test "$with_macosx_version_min_required" = "" ; then
3631 if test "$host_cpu" = x86_64; then
3632 with_macosx_version_min_required="10.15";
3634 with_macosx_version_min_required="11.0";
3637 # see same notes about MACOSX_SDK_VERSION above
3638 MAC_OS_X_VERSION_MIN_REQUIRED=$(echo $with_macosx_version_min_required | $AWK -F. '{ print $1*10000+$2*100+$3 }')
3639 if test $MAC_OS_X_VERSION_MIN_REQUIRED -lt 101500; then
3640 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, minimum supported version is 10.15])
3642 AC_MSG_RESULT([$with_macosx_version_min_required])
3644 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macos-with-sdk])
3645 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MACOSX_SDK_VERSION; then
3646 AC_MSG_ERROR([the version minimum required ($with_macosx_version_min_required) cannot be greater than the sdk level ($macosx_sdk)])
3648 AC_MSG_RESULT([yes])
3651 # export this so that "xcrun" invocations later return matching values
3652 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
3653 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
3654 export DEVELOPER_DIR
3655 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
3656 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
3658 AC_MSG_CHECKING([whether Xcode is new enough])
3659 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
3660 my_xcode_ver2=${my_xcode_ver1#Xcode }
3661 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
3662 if test "$my_xcode_ver3" -ge 1205; then
3663 AC_MSG_RESULT([yes ($my_xcode_ver2)])
3664 if test $MAC_OS_X_VERSION_MIN_REQUIRED -lt 120000; then
3665 if test "$my_xcode_ver3" -eq 1500; then
3666 dnl the bug was aleady fixed on 15.1 and 15.2 still has the same OS requirements as 15.0
3667 dnl in other words all affected users could update to a working Xcode version
3668 AC_MSG_WARN([Use a current version of XCode or bump the minimum deployment target])
3669 AC_MSG_WARN([[see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking]])
3670 AC_MSG_ERROR([Xcode 15.0 has a bug in the new linker that causes runtime crashes on macOS 11 - aborting])
3674 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 12.5])
3677 my_xcode_ver1=$(xcrun xcodebuild -version | tail -n 1)
3678 MACOSX_XCODE_BUILD_VERSION=${my_xcode_ver1#Build version }
3680 LIBTOOL=/usr/bin/libtool
3681 INSTALL_NAME_TOOL=install_name_tool
3682 if test -z "$save_CC"; then
3683 stdlib=-stdlib=libc++
3685 AC_MSG_CHECKING([what C compiler to use])
3686 CC="`xcrun -find clang`"
3687 CC_BASE=`first_arg_basename "$CC"`
3688 if test "$host_cpu" = x86_64; then
3689 CC+=" -target x86_64-apple-macos"
3691 CC+=" -target arm64-apple-macos"
3693 CC+=" -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
3694 AC_MSG_RESULT([$CC])
3696 AC_MSG_CHECKING([what C++ compiler to use])
3697 CXX="`xcrun -find clang++`"
3698 CXX_BASE=`first_arg_basename "$CXX"`
3699 if test "$host_cpu" = x86_64; then
3700 CXX+=" -target x86_64-apple-macos"
3702 CXX+=" -target arm64-apple-macos"
3704 CXX+=" $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
3705 AC_MSG_RESULT([$CXX])
3707 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3710 STRIP=`xcrun -find strip`
3711 LIBTOOL=`xcrun -find libtool`
3712 RANLIB=`xcrun -find ranlib`
3715 AC_MSG_CHECKING([whether to do code signing])
3717 if test -z "$enable_macosx_code_signing" -o "$enable_macosx_code_signing" == "no" ; then
3720 if test "$enable_macosx_code_signing" = yes; then
3721 # By default use the first suitable certificate (?).
3723 # https://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
3724 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
3725 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
3726 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
3727 # "Developer ID Application" one.
3728 identity="Developer ID Application:"
3730 identity=$enable_macosx_code_signing
3732 identity=`security find-identity -p codesigning -v 2>/dev/null | $AWK "/$identity/{print \\$2; exit}"`
3733 if test -n "$identity"; then
3734 MACOSX_CODESIGNING_IDENTITY=$identity
3735 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3736 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
3738 AC_MSG_ERROR([cannot determine identity to use])
3742 AC_MSG_CHECKING([whether to create a Mac App Store package])
3744 if test -z "$enable_macosx_package_signing" || test "$enable_macosx_package_signing" == no; then
3746 elif test -z "$MACOSX_CODESIGNING_IDENTITY"; then
3747 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
3749 if test "$enable_macosx_package_signing" = yes; then
3750 # By default use the first suitable certificate.
3751 # It should be a "3rd Party Mac Developer Installer" one
3752 identity="3rd Party Mac Developer Installer:"
3754 identity=$enable_macosx_package_signing
3756 identity=`security find-identity -v 2>/dev/null | $AWK "/$identity/ {print \\$2; exit}"`
3757 if test -n "$identity"; then
3758 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
3759 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3760 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3762 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
3766 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
3767 AC_MSG_ERROR([You should not use the same identity for code and package signing])
3770 AC_MSG_CHECKING([whether to sandbox the application])
3772 if test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3773 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
3774 elif test "$enable_macosx_sandbox" = yes; then
3775 ENABLE_MACOSX_SANDBOX=TRUE
3776 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3777 AC_MSG_RESULT([yes])
3782 AC_MSG_CHECKING([what macOS app bundle identifier to use])
3783 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3784 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3786 if test -n "$with_macosx_provisioning_profile" ; then
3787 if test ! -f "$with_macosx_provisioning_profile"; then
3788 AC_MSG_ERROR([provisioning profile not found at $with_macosx_provisioning_profile])
3790 MACOSX_PROVISIONING_PROFILE=$with_macosx_provisioning_profile
3791 MACOSX_PROVISIONING_INFO=$([security cms -D -i "$MACOSX_PROVISIONING_PROFILE" | \
3792 xmllint --xpath "//key[.='com.apple.application-identifier' or .='com.apple.developer.team-identifier'] \
3793 | //key[.='com.apple.application-identifier' or .='com.apple.developer.team-identifier']/following-sibling::string[1]" - | \
3794 sed -e 's#><#>\n\t<#g' -e 's#^#\t#'])
3798 AC_SUBST(MACOSX_SDK_PATH)
3799 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3800 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3801 AC_SUBST(INSTALL_NAME_TOOL)
3802 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
3803 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3804 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3805 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3806 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3807 AC_SUBST(MACOSX_PROVISIONING_INFO)
3808 AC_SUBST(MACOSX_PROVISIONING_PROFILE)
3809 AC_SUBST(MACOSX_SDK_BUILD_VERSION)
3810 AC_SUBST(MACOSX_XCODE_BUILD_VERSION)
3812 dnl ===================================================================
3813 dnl Check iOS SDK and compiler
3814 dnl ===================================================================
3816 if test $_os = iOS; then
3817 AC_MSG_CHECKING([what iOS SDK to use])
3819 if test "$enable_ios_simulator" = "yes"; then
3820 platformlc=iphonesimulator
3821 versionmin=-mios-simulator-version-min=14.5
3824 versionmin=-miphoneos-version-min=14.5
3827 sysroot=`xcrun --sdk $platformlc --show-sdk-path`
3829 if ! test -d "$sysroot"; then
3830 AC_MSG_ERROR([Could not find iOS SDK $sysroot])
3833 AC_MSG_RESULT($sysroot)
3835 stdlib="-stdlib=libc++"
3837 AC_MSG_CHECKING([what C compiler to use])
3838 CC="`xcrun -find clang`"
3839 CC_BASE=`first_arg_basename "$CC"`
3840 CC+=" -arch $host_cpu_for_clang -isysroot $sysroot $versionmin"
3841 AC_MSG_RESULT([$CC])
3843 AC_MSG_CHECKING([what C++ compiler to use])
3844 CXX="`xcrun -find clang++`"
3845 CXX_BASE=`first_arg_basename "$CXX"`
3846 CXX+=" -arch $host_cpu_for_clang $stdlib -isysroot $sysroot $versionmin"
3847 AC_MSG_RESULT([$CXX])
3849 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3852 STRIP=`xcrun -find strip`
3853 LIBTOOL=`xcrun -find libtool`
3854 RANLIB=`xcrun -find ranlib`
3857 AC_MSG_CHECKING([whether to treat the installation as read-only])
3859 if test $_os = Darwin; then
3860 enable_readonly_installset=yes
3861 elif test "$enable_extensions" != yes; then
3862 enable_readonly_installset=yes
3864 if test "$enable_readonly_installset" = yes; then
3865 AC_MSG_RESULT([yes])
3866 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3871 dnl ===================================================================
3872 dnl Structure of install set
3873 dnl ===================================================================
3875 if test $_os = Darwin; then
3876 LIBO_BIN_FOLDER=MacOS
3877 LIBO_ETC_FOLDER=Resources
3878 LIBO_LIBEXEC_FOLDER=MacOS
3879 LIBO_LIB_FOLDER=Frameworks
3880 LIBO_LIB_PYUNO_FOLDER=Resources
3881 LIBO_SHARE_FOLDER=Resources
3882 LIBO_SHARE_HELP_FOLDER=Resources/help
3883 LIBO_SHARE_JAVA_FOLDER=Resources/java
3884 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3885 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3886 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3887 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3888 LIBO_URE_BIN_FOLDER=MacOS
3889 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3890 LIBO_URE_LIB_FOLDER=Frameworks
3891 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3892 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3893 elif test $_os = WINNT; then
3894 LIBO_BIN_FOLDER=program
3895 LIBO_ETC_FOLDER=program
3896 LIBO_LIBEXEC_FOLDER=program
3897 LIBO_LIB_FOLDER=program
3898 LIBO_LIB_PYUNO_FOLDER=program
3899 LIBO_SHARE_FOLDER=share
3900 LIBO_SHARE_HELP_FOLDER=help
3901 LIBO_SHARE_JAVA_FOLDER=program/classes
3902 LIBO_SHARE_PRESETS_FOLDER=presets
3903 LIBO_SHARE_READMES_FOLDER=readmes
3904 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3905 LIBO_SHARE_SHELL_FOLDER=program/shell
3906 LIBO_URE_BIN_FOLDER=program
3907 LIBO_URE_ETC_FOLDER=program
3908 LIBO_URE_LIB_FOLDER=program
3909 LIBO_URE_MISC_FOLDER=program
3910 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3912 LIBO_BIN_FOLDER=program
3913 LIBO_ETC_FOLDER=program
3914 LIBO_LIBEXEC_FOLDER=program
3915 LIBO_LIB_FOLDER=program
3916 LIBO_LIB_PYUNO_FOLDER=program
3917 LIBO_SHARE_FOLDER=share
3918 LIBO_SHARE_HELP_FOLDER=help
3919 LIBO_SHARE_JAVA_FOLDER=program/classes
3920 LIBO_SHARE_PRESETS_FOLDER=presets
3921 LIBO_SHARE_READMES_FOLDER=readmes
3922 if test "$enable_fuzzers" != yes; then
3923 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3925 LIBO_SHARE_RESOURCE_FOLDER=resource
3927 LIBO_SHARE_SHELL_FOLDER=program/shell
3928 LIBO_URE_BIN_FOLDER=program
3929 LIBO_URE_ETC_FOLDER=program
3930 LIBO_URE_LIB_FOLDER=program
3931 LIBO_URE_MISC_FOLDER=program
3932 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3934 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3935 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3936 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3937 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3938 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3939 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3940 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3941 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3942 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3943 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3944 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3945 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3946 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3947 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3948 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3949 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3951 # Not all of them needed in config_host.mk, add more if need arises
3952 AC_SUBST(LIBO_BIN_FOLDER)
3953 AC_SUBST(LIBO_ETC_FOLDER)
3954 AC_SUBST(LIBO_LIB_FOLDER)
3955 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3956 AC_SUBST(LIBO_SHARE_FOLDER)
3957 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3958 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3959 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3960 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3961 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3962 AC_SUBST(LIBO_URE_BIN_FOLDER)
3963 AC_SUBST(LIBO_URE_ETC_FOLDER)
3964 AC_SUBST(LIBO_URE_LIB_FOLDER)
3965 AC_SUBST(LIBO_URE_MISC_FOLDER)
3966 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3968 dnl ===================================================================
3969 dnl Windows specific tests and stuff
3970 dnl ===================================================================
3974 # Return value: $regvalue
3977 if test "$build_os" = "wsl"; then
3978 regvalue=$($WSL_LO_HELPER --read-registry $1 "$2/$3" 2>/dev/null)
3980 elif test -n "$WSL_ONLY_AS_HELPER"; then
3981 regvalue=$(reg.exe query "$(echo $2 | tr '/' '\\')" /v "$3" /reg:$1 |sed -ne "s|\s*$3.*REG_SZ\s*\(.*\)[\s\r]*$|\1|p")
3985 local _regentry="/proc/registry${1}/${2}/${3}"
3986 if test -f "$_regentry"; then
3987 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3988 # Registry keys read via /proc/registry* are always \0 terminated!
3989 local _regvalue=$(tr -d '\0' < "$_regentry")
3990 if test $? -eq 0; then
3996 # Get a value from the 32-bit side of the Registry
3999 reg_get_value "32" "$1" "$2"
4002 # Get a value from the 64-bit side of the Registry
4005 reg_get_value "64" "$1" "$2"
4010 # Return value: $reglist
4013 if test "$build_os" = "wsl"; then
4014 reglist=$($WSL_LO_HELPER --list-registry $1 "$2" 2>/dev/null | tr -d '\r')
4018 reglist=$(ls "/proc/registry${1}/${2}")
4021 # List values from the 32-bit side of the Registry
4022 reg_list_values_32()
4024 reg_list_values "32" "$1"
4027 # List values from the 64-bit side of the Registry
4028 reg_list_values_64()
4030 reg_list_values "64" "$1"
4038 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4047 PLATFORMID=windows_x86_64
4049 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4051 WIN_MULTI_ARCH="x86"
4057 PLATFORMID=windows_x86
4060 WIN_OTHER_ARCH="x64"
4065 PLATFORMID=windows_aarch64
4067 SCPDEFS="$SCPDEFS -DWINDOWS_AARCH64"
4068 WIN_HOST_ARCH="arm64"
4073 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4077 case "$build_cpu" in
4078 x86_64) WIN_BUILD_ARCH="x64" ;;
4079 i*86) WIN_BUILD_ARCH="x86" ;;
4080 aarch64) WIN_BUILD_ARCH="arm64" ;;
4082 AC_MSG_ERROR([Unsupported build_cpu $build_cpu for host_os $host_os])
4086 SCPDEFS="$SCPDEFS -D_MSC_VER"
4090 # multi-arch is an arch, which can execute on the host (x86 on x64), while
4091 # other-arch won't, but wouldn't break the build (x64 on x86).
4092 if test -n "$WIN_MULTI_ARCH" -a -n "$WIN_OTHER_ARCH"; then
4093 AC_MSG_ERROR([Broken configure.ac file: can't have set \$WIN_MULTI_ARCH and $WIN_OTHER_ARCH])
4097 if test "$build_cpu" != "$host_cpu" -o "$DISABLE_DYNLOADING" = TRUE; then
4098 # To allow building Windows multi-arch releases without cross-tooling
4099 if test "$DISABLE_DYNLOADING" = TRUE -o \( -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH" \); then
4100 cross_compiling="yes"
4104 if test "$cross_compiling" = "yes"; then
4105 export CROSS_COMPILING=TRUE
4106 if test "$enable_dynamic_loading" != yes -a "$enable_wasm_strip" = yes; then
4107 ENABLE_WASM_STRIP=TRUE
4109 if test "$_os" = "Emscripten"; then
4110 if test "$with_main_module" = "calc"; then
4111 ENABLE_WASM_STRIP_WRITER=TRUE
4112 elif test "$with_main_module" = "writer"; then
4113 ENABLE_WASM_STRIP_CALC=TRUE
4118 BUILD_TYPE="$BUILD_TYPE NATIVE"
4120 AC_SUBST(CROSS_COMPILING)
4121 AC_SUBST(ENABLE_WASM_STRIP)
4122 AC_SUBST(ENABLE_WASM_STRIP_WRITER)
4123 AC_SUBST(ENABLE_WASM_STRIP_CALC)
4125 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
4126 # NOTE: must _not_ be used for bundled external libraries!
4128 if test "$GCC" = "yes"; then
4129 AC_MSG_CHECKING( for -isystem )
4131 CFLAGS="$CFLAGS -isystem /usr/include -Werror"
4132 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
4134 if test -n "$ISYSTEM"; then
4140 if test -z "$ISYSTEM"; then
4141 # fall back to using -I
4146 dnl ===================================================================
4147 dnl Check which Visual Studio compiler is used
4148 dnl ===================================================================
4150 map_vs_year_to_version()
4152 # Return value: $vsversion
4164 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
4168 vs_versions_to_check()
4170 # Args: $1 (optional) : versions to check, in the order of preference
4171 # Return value: $vsversions
4175 if test -n "$1"; then
4176 map_vs_year_to_version "$1"
4177 vsversions=$vsversion
4179 # Default version is 2019
4184 win_get_env_from_vsdevcmdbat()
4186 local WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
4187 printf '@set VSCMD_SKIP_SENDTELEMETRY=1\r\n' > $WRAPPERBATCHFILEPATH
4188 PathFormat "$VC_PRODUCT_DIR"
4189 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$formatted_path" >> $WRAPPERBATCHFILEPATH
4190 # use 'echo.%ENV%' syntax (instead of 'echo %ENV%') to avoid outputting "ECHO is off." in case when ENV is empty or a space
4191 printf '@setlocal\r\n@echo.%%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
4193 if test "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
4194 result=$(cd /mnt/c && cmd.exe /c $(wslpath -w $WRAPPERBATCHFILEPATH) | tr -d '\r')
4196 chmod +x $WRAPPERBATCHFILEPATH
4197 result=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
4199 rm -f $WRAPPERBATCHFILEPATH
4200 printf '%s' "$result"
4205 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0" "InstallationFolder"
4206 if test -n "$regvalue"; then
4207 PathFormat "$regvalue"
4208 UCRTSDKDIR=$formatted_path_unix
4209 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0" "ProductVersion"
4210 if test -n "$regvalue"; then
4211 UCRTVERSION="$regvalue".0
4215 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
4219 if test -z "$UCRTSDKDIR"; then
4220 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
4221 ide_env_file="${ide_env_dir}VsDevCmd.bat"
4222 if test -f "$ide_env_file"; then
4223 PathFormat "$(win_get_env_from_vsdevcmdbat UniversalCRTSdkDir)"
4224 UCRTSDKDIR=$formatted_path_unix
4225 UCRTVERSION=$(win_get_env_from_vsdevcmdbat UCRTVersion)
4226 dnl Hack needed at least by tml:
4227 if test "$UCRTVERSION" = 10.0.15063.0 \
4228 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
4229 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
4231 UCRTVERSION=10.0.14393.0
4234 AC_MSG_ERROR([No UCRT found])
4242 # Args: $1 (optional) : The VS version year
4243 # Return values: $vctest, $vcyear, $vctoolset, $vcnumwithdot, $vcbuildnumber
4245 unset vctest vctoolset vcnumwithdot vcbuildnumber
4247 vs_versions_to_check "$1"
4248 if test "$build_os" = wsl; then
4249 vswhere="$PROGRAMFILESX86"
4250 if test -z "$vswhere"; then
4251 vswhere="c:\\Program Files (x86)"
4253 elif test -n "$WSL_ONLY_AS_HELPER"; then
4254 vswhere="$(perl.exe -e 'print $ENV{"ProgramFiles(x86)"}')"
4256 vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
4258 vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
4259 PathFormat "$vswhere"
4260 vswhere=$formatted_path_unix
4261 for ver in $vsversions; do
4262 vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr ${ver%%.*} + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
4263 if test -z "$vswhereoutput"; then
4264 vswhereoutput=`$vswhere -prerelease -version "@<:@ $ver , $(expr ${ver%%.*} + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
4266 # Fall back to all MS products (this includes VC++ Build Tools)
4267 if ! test -n "$vswhereoutput"; then
4268 AC_MSG_CHECKING([VC++ Build Tools and similar])
4269 vswhereoutput=`$vswhere -products \* -version "@<:@ $ver , $(expr ${ver%%.*} + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
4271 if test -n "$vswhereoutput"; then
4272 PathFormat "$vswhereoutput"
4273 vctest=$formatted_path_unix
4278 if test -n "$vctest"; then
4280 if test "${vcnumwithdot%%.*}" = "$vcnumwithdot"; then
4281 vcnumwithdot=$vcnumwithdot.0
4283 case "$vcnumwithdot" in
4293 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
4300 AC_MSG_CHECKING([$1 compiler])
4302 CL_EXE_PATH="$2/cl.exe"
4304 if test ! -f "$CL_EXE_PATH"; then
4305 if test "$1" = "multi-arch"; then
4306 AC_MSG_WARN([no compiler (cl.exe) in $2])
4309 AC_MSG_ERROR([no compiler (cl.exe) in $2])
4313 dnl ===========================================================
4314 dnl Check for the corresponding mspdb*.dll
4315 dnl ===========================================================
4317 # MSVC 15.0 has libraries from 14.0?
4320 if test ! -e "$2/mspdb${mspdbnum}.dll"; then
4321 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $2, Visual Studio installation broken?])
4324 # The compiles has to find its shared libraries
4326 TEMP_PATH=`cygpath -d "$2"`
4327 PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
4329 if ! "$CL_EXE_PATH" -? </dev/null >/dev/null 2>&1; then
4330 AC_MSG_ERROR([no compiler (cl.exe) in $2])
4335 AC_MSG_RESULT([$CL_EXE_PATH])
4341 if test "$_os" = "WINNT"; then
4342 AC_MSG_CHECKING([Visual C++])
4343 find_msvc "$with_visual_studio"
4344 if test -z "$vctest"; then
4345 if test -n "$with_visual_studio"; then
4346 AC_MSG_ERROR([no Visual Studio $with_visual_studio installation found])
4348 AC_MSG_ERROR([no Visual Studio installation found])
4353 VC_PRODUCT_DIR="$vctest/VC"
4354 COMPATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber"
4356 # $WIN_OTHER_ARCH is a hack to test the x64 compiler on x86, even if it's not multi-arch
4357 if test -n "$WIN_MULTI_ARCH" -o -n "$WIN_OTHER_ARCH"; then
4358 MSVC_MULTI_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/${WIN_MULTI_ARCH}${WIN_OTHER_ARCH}"
4359 test_cl_exe "multi-arch" "$MSVC_MULTI_PATH"
4360 if test $? -ne 0; then
4366 if test "$WIN_BUILD_ARCH" = "$WIN_HOST_ARCH"; then
4367 MSVC_BUILD_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_BUILD_ARCH"
4368 test_cl_exe "build" "$MSVC_BUILD_PATH"
4371 if test "$WIN_BUILD_ARCH" != "$WIN_HOST_ARCH"; then
4372 MSVC_HOST_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_HOST_ARCH"
4373 test_cl_exe "host" "$MSVC_HOST_PATH"
4375 MSVC_HOST_PATH="$MSVC_BUILD_PATH"
4378 AC_MSG_CHECKING([for short pathname of VC product directory])
4379 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
4380 AC_MSG_RESULT([$VC_PRODUCT_DIR])
4385 AC_MSG_CHECKING([for UCRT location])
4387 # find_ucrt errors out if it doesn't find it
4388 AC_MSG_RESULT([$UCRTSDKDIR ($UCRTVERSION)])
4389 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
4390 ucrtincpath_formatted=$formatted_path
4391 # SOLARINC is used for external modules and must be set too.
4392 # And no, it's not sufficient to set SOLARINC only, as configure
4393 # itself doesn't honour it.
4394 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
4395 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
4396 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
4397 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
4399 AC_SUBST(UCRTSDKDIR)
4400 AC_SUBST(UCRTVERSION)
4402 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
4403 # Find the proper version of MSBuild.exe to use based on the VS version
4404 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot MSBuildOverrideTasksPath
4405 if test -z "$regvalue" ; then
4406 if test "$WIN_BUILD_ARCH" != "x64"; then
4407 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
4409 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
4412 if test -d "$regvalue" ; then
4413 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
4414 AC_MSG_RESULT([$regvalue])
4416 AC_MSG_ERROR([MSBuild.exe location not found])
4419 # Find the version of devenv.exe
4420 PathFormat "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe"
4421 DEVENV="$formatted_path"
4422 DEVENV_unix="$formatted_path_unix"
4423 if test ! -e "$DEVENV_unix"; then
4424 AC_MSG_WARN([No devenv.exe found - this is expected for VC++ Build Tools])
4427 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
4428 dnl needed when building CLR code:
4429 if test -z "$MSVC_CXX"; then
4430 # This gives us a posix path with 8.3 filename restrictions
4431 MSVC_CXX=`win_short_path_for_make "$MSVC_HOST_PATH/cl.exe"`
4434 if test -z "$CC"; then
4436 CC_BASE=`first_arg_basename "$CC"`
4438 if test -z "$CXX"; then
4440 CXX_BASE=`first_arg_basename "$CXX"`
4443 if test -n "$CC"; then
4444 # Remove /cl.exe from CC case insensitive
4445 AC_MSG_NOTICE([found Visual C++ $vcyear])
4447 PathFormat "$COMPATH"
4448 COMPATH="$formatted_path"
4449 COMPATH_unix="$formatted_path_unix"
4450 CPPFLAGS="$CPPFLAGS -I$COMPATH/Include"
4453 VCTOOLSET=$vctoolset
4455 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
4456 # are always "better", we list them in reverse chronological order.
4458 case "$vcnumwithdot" in
4459 16.0 | 17.0 | 17.11)
4460 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
4464 # The expectation is that --with-windows-sdk should not need to be used
4465 if test -n "$with_windows_sdk"; then
4466 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
4467 *" "$with_windows_sdk" "*)
4468 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
4471 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $vcyear])
4476 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
4481 AC_MSG_ERROR([Visual C++ not found after all, huh])
4484 # ERROR if VS version < 16.5
4485 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.5])
4486 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4487 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
4488 // between Visual Studio versions and _MSC_VER:
4492 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
4494 # WARN if VS version < 16.10
4495 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2019 version 16.10])
4496 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4500 ]])],[vs2019_recommended_version=yes],[vs2019_recommended_version=no])
4502 if test $vs2019_recommended_version = yes; then
4503 AC_MSG_RESULT([yes])
4506 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."
4509 # Check for 64-bit (cross-)compiler to use to build the 64-bit
4510 # version of the Explorer extension (and maybe other small
4511 # bits, too) needed when installing a 32-bit LibreOffice on a
4512 # 64-bit OS. The 64-bit Explorer extension is a feature that
4513 # has been present since long in OOo. Don't confuse it with
4514 # building LibreOffice itself as 64-bit code.
4519 if test "$WIN_HOST_ARCH" = "x86" -a -n "$WIN_OTHER_ARCH"; then
4520 AC_MSG_CHECKING([for the libraries to build the 64-bit Explorer extensions])
4521 if test -f "$COMPATH/atlmfc/lib/x64/atls.lib" -o \
4522 -f "$COMPATH/atlmfc/lib/spectre/x64/atls.lib"
4525 CXX_X64_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
4526 AC_MSG_RESULT([found])
4528 AC_MSG_RESULT([not found])
4529 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
4531 elif test "$WIN_HOST_ARCH" = "x64"; then
4536 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
4537 AC_SUBST(CXX_X64_BINARY)
4539 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
4540 # needed to support TWAIN scan on both 32- and 64-bit systems
4542 case "$WIN_HOST_ARCH" in
4544 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
4545 if test -n "$CXX_X86_BINARY"; then
4547 AC_MSG_RESULT([preset])
4548 elif test -n "$WIN_MULTI_ARCH"; then
4550 CXX_X86_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
4551 AC_MSG_RESULT([found])
4553 AC_MSG_RESULT([not found])
4554 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
4559 CXX_X86_BINARY=$MSVC_CXX
4563 AC_SUBST(CXX_X86_BINARY)
4571 AC_MSG_CHECKING([whether the compiler is actually Clang])
4572 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4578 [AC_MSG_RESULT([yes])
4580 [AC_MSG_RESULT([no])])
4581 AC_SUBST(COM_IS_CLANG)
4584 if test "$COM_IS_CLANG" = TRUE; then
4585 AC_MSG_CHECKING([whether Clang is new enough])
4586 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
4587 #if !defined __apple_build_version__
4591 [my_apple_clang=yes],[my_apple_clang=])
4592 if test "$my_apple_clang" = yes; then
4593 AC_MSG_RESULT([assumed yes (Apple Clang)])
4594 elif test "$_os" = Emscripten; then
4595 AC_MSG_RESULT([assumed yes (Emscripten Clang)])
4597 if test "$_os" = WINNT; then
4598 dnl In which case, assume clang-cl:
4603 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC $my_args - | sed 's/ //g'`
4604 CLANG_FULL_VERSION=`echo __clang_version__ | $CC $my_args -`
4605 CLANGVER=`echo $clang_version \
4606 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
4607 if test "$CLANGVER" -ge 120000; then
4608 AC_MSG_RESULT([yes ($clang_version)])
4610 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 12])
4612 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
4613 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
4617 SHOWINCLUDES_PREFIX=
4618 if test "$_os" = WINNT; then
4619 dnl We need to guess the prefix of the -showIncludes output, it can be
4621 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
4622 echo "#include <stdlib.h>" > conftest.c
4623 SHOWINCLUDES_PREFIX=`VSLANG=1033 $CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
4624 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
4625 rm -f conftest.c conftest.obj
4626 if test -z "$SHOWINCLUDES_PREFIX"; then
4627 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
4629 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
4632 AC_SUBST(SHOWINCLUDES_PREFIX)
4635 # prefix C with ccache if needed
4637 if test "$CCACHE" != ""; then
4638 AC_MSG_CHECKING([whether $CC_BASE is already ccached])
4642 CFLAGS="$CFLAGS --ccache-skip -O2"
4643 # msvc does not fail on unknown options, check stdout
4644 if test "$COM" = MSC; then
4645 CFLAGS="$CFLAGS -nologo"
4647 save_ac_c_werror_flag=$ac_c_werror_flag
4648 ac_c_werror_flag=yes
4649 dnl an empty program will do, we're checking the compiler flags
4650 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
4651 [use_ccache=yes], [use_ccache=no])
4653 ac_c_werror_flag=$save_ac_c_werror_flag
4654 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
4655 AC_MSG_RESULT([yes])
4658 CC_BASE="ccache $CC_BASE"
4664 # ===================================================================
4665 # check various GCC options that Clang does not support now but maybe
4666 # will somewhen in the future, check them even for GCC, so that the
4668 # ===================================================================
4671 if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
4672 AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
4674 CFLAGS="$CFLAGS -Werror -ggdb2"
4675 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
4677 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
4678 AC_MSG_RESULT([yes])
4683 if test "$host_cpu" = "m68k"; then
4684 AC_MSG_CHECKING([whether $CC_BASE supports -mlong-jump-table-offsets])
4686 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
4687 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
4689 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
4690 AC_MSG_RESULT([yes])
4696 AC_SUBST(HAVE_GCC_GGDB2)
4698 dnl ===================================================================
4699 dnl Test the gcc version
4700 dnl ===================================================================
4701 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
4702 AC_MSG_CHECKING([the GCC version])
4703 _gcc_version=`$CC -dumpfullversion`
4704 gcc_full_version=$(printf '%s' "$_gcc_version" | \
4705 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
4706 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
4708 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
4710 if test "$gcc_full_version" -lt 120000; then
4711 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 12])
4714 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
4715 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
4716 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
4717 # (which reports itself as GCC 4.2.1).
4720 AC_SUBST(GCC_VERSION)
4722 dnl Set the ENABLE_DBGUTIL variable
4723 dnl ===================================================================
4724 AC_MSG_CHECKING([whether to build with additional debug utilities])
4725 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
4726 ENABLE_DBGUTIL="TRUE"
4727 # this is an extra var so it can have different default on different MSVC
4728 # versions (in case there are version specific problems with it)
4729 MSVC_USE_DEBUG_RUNTIME="TRUE"
4731 AC_MSG_RESULT([yes])
4732 # cppunit and graphite expose STL in public headers
4733 if test "$with_system_cppunit" = "yes"; then
4734 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
4736 with_system_cppunit=no
4738 if test "$with_system_graphite" = "yes"; then
4739 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
4741 with_system_graphite=no
4743 if test "$with_system_orcus" = "yes"; then
4744 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
4746 with_system_orcus=no
4748 if test "$with_system_libcmis" = "yes"; then
4749 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
4751 with_system_libcmis=no
4753 if test "$with_system_hunspell" = "yes"; then
4754 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
4756 with_system_hunspell=no
4758 if test "$with_system_gpgmepp" = "yes"; then
4759 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
4761 with_system_gpgmepp=no
4763 if test "$with_system_zxing" = "yes"; then
4764 AC_MSG_ERROR([--with-system-zxing conflicts with --enable-dbgutil])
4766 with_system_zxing=no
4768 if test "$with_system_poppler" = "yes"; then
4769 AC_MSG_ERROR([--with-system-poppler conflicts with --enable-dbgutil])
4771 with_system_poppler=no
4773 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
4774 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
4775 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
4776 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
4777 # of those two is using the system variant:
4778 if test "$with_system_libnumbertext" = "yes"; then
4779 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
4781 with_system_libnumbertext=no
4783 if test "$with_system_libwps" = "yes"; then
4784 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
4786 with_system_libwps=no
4790 MSVC_USE_DEBUG_RUNTIME=""
4793 AC_SUBST(ENABLE_DBGUTIL)
4794 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
4796 dnl Set the ENABLE_DEBUG variable.
4797 dnl ===================================================================
4798 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
4799 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
4801 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
4802 if test -z "$libo_fuzzed_enable_debug"; then
4803 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
4805 AC_MSG_NOTICE([Resetting --enable-debug=yes])
4810 AC_MSG_CHECKING([whether to do a debug build])
4811 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
4813 if test -n "$ENABLE_DBGUTIL" ; then
4814 AC_MSG_RESULT([yes (dbgutil)])
4816 AC_MSG_RESULT([yes])
4822 AC_SUBST(ENABLE_DEBUG)
4824 dnl ===================================================================
4825 dnl Select the linker to use (gold/lld/ld.bfd/mold).
4826 dnl This is done only after compiler checks (need to know if Clang is
4827 dnl used, for different defaults) and after checking if a debug build
4828 dnl is wanted (non-debug builds get the default linker if not explicitly
4829 dnl specified otherwise).
4830 dnl All checks for linker features/options should come after this.
4831 dnl ===================================================================
4834 use_ld=-fuse-ld=${1%%:*}
4836 if test "$use_ld_path" != "$1"; then
4837 if test "$COM_IS_CLANG" = TRUE; then
4838 if test "$CLANGVER" -ge 120000; then
4839 use_ld="${use_ld} --ld-path=${use_ld_path}"
4841 use_ld="-fuse-ld=${use_ld_path}"
4844 # I tried to use gcc's '-B<path>' and a directory + symlink setup in
4845 # $BUILDDIR, but libtool always filtered-out that option, so gcc wouldn't
4846 # pickup the alternative linker, when called by libtool for linking.
4847 # For mold, one can use LD_PRELOAD=/usr/lib/mold/mold-wrapper.so instead.
4848 AC_MSG_ERROR([A linker path is just supported with clang, because of libtool's -B filtering!])
4851 use_ld_fail_if_error=$2
4853 AC_MSG_CHECKING([for $use_ld linker support])
4854 use_ld_ldflags_save="$LDFLAGS"
4855 LDFLAGS="$LDFLAGS $use_ld"
4856 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4859 printf ("hello world\n");
4860 ])], USE_LD=$use_ld, [])
4861 if test -n "$USE_LD"; then
4862 AC_MSG_RESULT( yes )
4865 if test -n "$use_ld_fail_if_error"; then
4871 if test -n "$use_ld_ok"; then
4872 dnl keep the value of LDFLAGS
4875 LDFLAGS="$use_ld_ldflags_save"
4879 if test "$enable_ld" != "no"; then
4880 if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
4881 if test -n "$enable_ld"; then
4882 check_use_ld "$enable_ld" fail_if_error
4883 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4884 dnl non-debug builds default to the default linker
4886 elif test -n "$COM_IS_CLANG"; then
4888 if test $? -ne 0; then
4890 if test $? -ne 0; then
4895 # For gcc first try gold, new versions also support lld/mold.
4897 if test $? -ne 0; then
4899 if test $? -ne 0; then
4904 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
4906 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD|^mold)')
4907 if test -z "$ld_used"; then
4910 AC_MSG_CHECKING([for linker that is used])
4911 AC_MSG_RESULT([$ld_used])
4912 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4913 if echo "$ld_used" | grep -q "^GNU ld"; then
4914 AC_MSG_WARN([The default GNU linker is slow, consider using LLD, mold or the GNU gold linker.])
4915 add_warning "The default GNU linker is slow, consider using LLD, mold or the GNU gold linker."
4919 if test "$enable_ld" = "yes"; then
4920 AC_MSG_ERROR([--enable-ld not supported])
4927 HAVE_LD_BSYMBOLIC_FUNCTIONS=
4928 if test "$GCC" = "yes" -a "$_os" != Emscripten ; then
4929 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
4930 bsymbolic_functions_ldflags_save=$LDFLAGS
4931 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
4932 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4935 printf ("hello world\n");
4936 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
4937 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
4938 AC_MSG_RESULT( found )
4940 AC_MSG_RESULT( not found )
4942 LDFLAGS=$bsymbolic_functions_ldflags_save
4944 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
4947 if test "$GCC" = "yes"; then
4948 for flag in "--gc-sections" "-dead_strip"; do
4949 AC_MSG_CHECKING([for $flag linker support])
4950 ldflags_save=$LDFLAGS
4951 LDFLAGS="$LDFLAGS -Wl,$flag"
4952 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4955 printf ("hello world\n");
4957 LD_GC_SECTIONS="-Wl,$flag"
4958 AC_MSG_RESULT( found )
4960 AC_MSG_RESULT( not found )
4962 LDFLAGS=$ldflags_save
4963 if test -n "$LD_GC_SECTIONS"; then
4968 AC_SUBST(LD_GC_SECTIONS)
4970 HAVE_EXTERNAL_DWARF=
4971 if test "$enable_split_debug" != no; then
4973 if test -n "$ENABLE_LTO"; then
4974 : # Inherently incompatible, since no debug info is created while compiling, GCC complains.
4975 elif test "$enable_split_debug" = yes; then
4977 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
4978 elif test "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4981 if test -n "$use_split_debug"; then
4982 if test "$_os" = "Emscripten"; then
4983 TEST_CC_FLAG=-gsplit-dwarf -gpubnames
4985 TEST_CC_FLAG=-gsplit-dwarf
4987 AC_MSG_CHECKING([whether $CC_BASE supports $TEST_CC_FLAG])
4989 CFLAGS="$CFLAGS -Werror $TEST_CC_FLAG"
4990 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_EXTERNAL_DWARF=TRUE ],[])
4992 if test "$HAVE_EXTERNAL_DWARF" = "TRUE"; then
4993 AC_MSG_RESULT([yes])
4995 if test "$enable_split_debug" = yes; then
5002 if test -z "$HAVE_EXTERNAL_DWARF" -a "$test_split_debug" = "yes" -a -n "$use_split_debug"; then
5003 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
5004 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
5007 AC_SUBST(HAVE_EXTERNAL_DWARF)
5009 HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=
5010 AC_MSG_CHECKING([whether $CC_BASE supports -Xclang -debug-info-kind=constructor])
5012 CFLAGS="$CFLAGS -Werror -Xclang -debug-info-kind=constructor"
5013 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=TRUE ],[])
5015 if test "$HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR" = "TRUE"; then
5016 AC_MSG_RESULT([yes])
5020 AC_SUBST(HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR)
5023 if test "$enable_gdb_index" != "no"; then
5024 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
5025 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
5026 AC_MSG_CHECKING([whether $CC_BASE supports -ggnu-pubnames])
5028 CFLAGS="$CFLAGS -Werror -g -ggnu-pubnames"
5030 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
5031 if test "$have_ggnu_pubnames" != "TRUE"; then
5032 if test "$enable_gdb_index" = "yes"; then
5033 AC_MSG_ERROR([no, --enable-gdb-index not supported])
5038 AC_MSG_RESULT( yes )
5039 AC_MSG_CHECKING([whether $CC_BASE supports -Wl,--gdb-index])
5040 ldflags_save=$LDFLAGS
5041 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
5042 AC_LINK_IFELSE([AC_LANG_PROGRAM([
5045 printf ("hello world\n");
5046 ])], ENABLE_GDB_INDEX=TRUE, [])
5047 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
5048 AC_MSG_RESULT( yes )
5050 if test "$enable_gdb_index" = "yes"; then
5056 LDFLAGS=$ldflags_save
5060 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
5061 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
5062 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
5065 AC_SUBST(ENABLE_GDB_INDEX)
5067 if test -z "$enable_sal_log" && test "$ENABLE_DEBUG" = TRUE; then
5070 if test "$enable_sal_log" = yes; then
5073 AC_SUBST(ENABLE_SAL_LOG)
5075 dnl Check for enable symbols option
5076 dnl ===================================================================
5077 AC_MSG_CHECKING([whether to generate debug information])
5078 if test -z "$enable_symbols"; then
5079 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
5085 if test "$enable_symbols" = yes; then
5086 ENABLE_SYMBOLS_FOR=all
5087 AC_MSG_RESULT([yes])
5088 elif test "$enable_symbols" = no; then
5092 # Selective debuginfo.
5093 ENABLE_SYMBOLS_FOR="$enable_symbols"
5094 AC_MSG_RESULT([for "$enable_symbols"])
5096 AC_SUBST(ENABLE_SYMBOLS_FOR)
5098 if test -n "$with_android_ndk" -a \( -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_SYMBOLS_FOR" = "all"; then
5099 # Building on Android with full symbols: without enough memory the linker never finishes currently.
5100 AC_MSG_CHECKING([whether enough memory is available for linking])
5101 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
5102 # Check for 15GB, as Linux reports a bit less than the physical memory size.
5103 if test -n "$mem_size" -a $mem_size -lt 15728640; then
5104 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
5106 AC_MSG_RESULT([yes])
5111 ENABLE_OPTIMIZED_DEBUG=
5112 AC_MSG_CHECKING([whether to compile with optimization flags])
5113 if test -z "$enable_optimized"; then
5114 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
5117 enable_optimized=yes
5120 if test "$enable_optimized" = yes; then
5121 ENABLE_OPTIMIZED=TRUE
5122 AC_MSG_RESULT([yes])
5123 elif test "$enable_optimized" = debug; then
5124 ENABLE_OPTIMIZED_DEBUG=TRUE
5125 AC_MSG_RESULT([yes (debug)])
5127 if test "$GCC" = "yes" -a "$_os" != "Emscripten"; then
5128 AC_MSG_CHECKING([whether $CC_BASE supports -Og])
5130 CFLAGS="$CFLAGS -Werror -Og"
5131 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_OG=TRUE ],[])
5133 if test "$HAVE_GCC_OG" = "TRUE"; then
5134 AC_MSG_RESULT([yes])
5139 if test -z "$HAVE_GCC_OG" -a "$_os" != "Emscripten"; then
5140 AC_MSG_ERROR([The compiler does not support optimizations suitable for debugging.])
5145 AC_SUBST(ENABLE_OPTIMIZED)
5146 AC_SUBST(ENABLE_OPTIMIZED_DEBUG)
5149 # determine CPUNAME, OS, ...
5165 if test "$enable_ios_simulator" = "yes"; then
5170 PLATFORMID=macosx_aarch64
5174 if test "$enable_ios_simulator" = "yes"; then
5179 PLATFORMID=macosx_x86_64
5182 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5195 if test "$enable_ios_simulator" = "yes"; then
5196 AC_MSG_ERROR([iOS simulator is only available in macOS not iOS])
5200 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5205 PLATFORMID=ios_arm64
5218 PLATFORMID=dragonfly_x86
5223 PLATFORMID=dragonfly_x86_64
5226 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5240 PLATFORMID=freebsd_aarch64
5246 PLATFORMID=freebsd_x86
5251 PLATFORMID=freebsd_x86_64
5256 PLATFORMID=freebsd_powerpc64
5261 PLATFORMID=freebsd_powerpc
5264 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5280 PLATFORMID=haiku_x86
5285 PLATFORMID=haiku_x86_64
5288 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5304 PLATFORMID=kfreebsd_x86
5309 PLATFORMID=kfreebsd_x86_64
5312 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5317 linux-gnu*|linux-musl*)
5327 PLATFORMID=linux_aarch64
5329 EPM_FLAGS="-a arm64"
5334 PLATFORMID=linux_alpha
5340 PLATFORMID=linux_arm_eabi
5344 PLATFORMID=linux_arm_oabi
5352 PLATFORMID=linux_hppa
5357 PLATFORMID=linux_x86
5362 PLATFORMID=linux_ia64
5368 PLATFORMID=linux_mips_eb
5373 EPM_FLAGS="-a mips64"
5374 PLATFORMID=linux_mips64_eb
5379 EPM_FLAGS="-a mips64el"
5380 PLATFORMID=linux_mips64_el
5385 EPM_FLAGS="-a mipsel"
5386 PLATFORMID=linux_mips_el
5391 EPM_FLAGS="-a riscv64"
5392 PLATFORMID=linux_riscv64
5397 PLATFORMID=linux_m68k
5402 PLATFORMID=linux_powerpc
5407 PLATFORMID=linux_powerpc64
5411 RTL_ARCH=PowerPC_64_LE
5412 PLATFORMID=linux_powerpc64_le
5417 PLATFORMID=linux_sparc
5422 PLATFORMID=linux_sparc64
5427 PLATFORMID=linux_s390x
5432 PLATFORMID=linux_x86_64
5436 RTL_ARCH=LOONGARCH64
5437 PLATFORMID=linux_loongarch64
5440 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5456 PLATFORMID=android_arm_eabi
5461 PLATFORMID=android_aarch64
5466 PLATFORMID=android_x86
5471 PLATFORMID=android_x86_64
5474 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5489 PLATFORMID=netbsd_x86
5494 PLATFORMID=netbsd_powerpc
5499 PLATFORMID=netbsd_sparc
5504 PLATFORMID=netbsd_x86_64
5507 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5522 PLATFORMID=openbsd_x86
5527 PLATFORMID=openbsd_x86_64
5530 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5533 SOLARINC="$SOLARINC -I/usr/local/include"
5546 PLATFORMID=solaris_x86
5551 PLATFORMID=solaris_sparc
5556 PLATFORMID=solaris_sparc64
5559 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5562 SOLARINC="$SOLARINC -I/usr/local/include"
5575 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
5580 PLATFORMID=linux_x86
5584 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
5589 if test "$enable_gui" = "no"; then
5590 if test "$using_x11" != yes; then
5591 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
5597 AC_DEFINE(HAVE_FEATURE_UI)
5599 AC_SUBST(DISABLE_GUI)
5601 if test "$with_x" = "no"; then
5605 if test -z "$USING_X11" -a "$enable_qt5" = "yes" -a "$enable_gen" = "yes"; then
5606 AC_MSG_ERROR([Can't select gen VCL plugin, if --without-x is used!])
5609 if test "$using_x11" = yes; then
5610 if test "$USING_X11" = TRUE; then
5611 AC_DEFINE(USING_X11)
5614 if test "$DISABLE_DYNLOADING" = TRUE; then
5620 if test "$USING_X11" = TRUE; then
5621 AC_MSG_ERROR([Platform doesn't support X11 (\$using_x11), but \$USING_X11 is set!])
5625 WORKDIR="${BUILDDIR}/workdir"
5626 INSTDIR="${BUILDDIR}/instdir"
5627 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
5628 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
5636 AC_SUBST([INSTROOT])
5637 AC_SUBST([INSTROOTBASE])
5641 AC_SUBST(PLATFORMID)
5642 AC_SUBST(WINDOWS_X64)
5643 AC_DEFINE_UNQUOTED(SDKDIR, "$INSTDIR/$SDKDIRNAME")
5644 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
5646 if test "$OS" = WNT -a "$COM" = MSC; then
5648 INTEL) CPPU_ENV=msci ;;
5649 X86_64) CPPU_ENV=mscx ;;
5650 AARCH64) CPPU_ENV=msca ;;
5652 AC_MSG_ERROR([Unknown \$CPUNAME '$CPUNAME' for $OS / $COM"])
5660 dnl ===================================================================
5661 dnl Test which package format to use
5662 dnl ===================================================================
5663 AC_MSG_CHECKING([which package format to use])
5664 if test -n "$with_package_format" -a "$with_package_format" != no; then
5665 for i in $with_package_format; do
5667 bsd | deb | pkg | rpm | archive | dmg | installed | msi)
5670 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
5671 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
5672 deb - Debian software distribution
5673 pkg - Solaris software distribution
5674 rpm - RedHat software distribution
5676 LibreOffice additionally supports:
5677 archive - .tar.gz or .zip
5679 installed - installation tree
5685 # fakeroot is needed to ensure correct file ownerships/permissions
5686 # inside deb packages and tar archives created on Linux and Solaris.
5687 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
5688 AC_PATH_PROG(FAKEROOT, fakeroot, no)
5689 if test "$FAKEROOT" = "no"; then
5691 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
5694 PKGFORMAT="$with_package_format"
5695 AC_MSG_RESULT([$PKGFORMAT])
5698 AC_MSG_RESULT([none])
5702 dnl ===================================================================
5703 dnl handle help related options
5705 dnl If you change help related options, please update README.help
5706 dnl ===================================================================
5713 AC_MSG_CHECKING([which help to build])
5714 if test -n "$with_help" -a "$with_help" != "no"; then
5715 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5716 BUILD_TYPE="$BUILD_TYPE HELP"
5717 case "$with_help" in
5719 ENABLE_HTMLHELP=TRUE
5721 SCPDEFS="$SCPDEFS -DWITH_HELPPACKS"
5722 AC_MSG_RESULT([HTML (local)])
5725 ENABLE_HTMLHELP=TRUE
5727 AC_MSG_RESULT([HTML (online)])
5731 SCPDEFS="$SCPDEFS -DWITH_HELPPACKS"
5732 AC_MSG_RESULT([XML (local)])
5735 AC_MSG_ERROR([Unknown --with-help=$with_help])
5742 AC_MSG_CHECKING([if we need to build the help index tooling])
5743 if test \( "$with_help" = yes -o "$enable_extension_integration" != no \) -a -z "$DISABLE_DYNLOADING"; then
5744 BUILD_TYPE="$BUILD_TYPE HELPTOOLS"
5746 AC_MSG_RESULT([yes])
5751 AC_MSG_CHECKING([whether to enable xapian-omega support for online help])
5752 if test -n "$with_omindex" -a "$with_omindex" != "no"; then
5753 if test "$HELP_ONLINE" != TRUE; then
5754 AC_MSG_ERROR([Can't build xapian-omega index without --help=online])
5756 case "$with_omindex" in
5758 HELP_OMINDEX_PAGE=TRUE
5759 AC_MSG_RESULT([SERVER])
5762 AC_MSG_RESULT([NOXAP])
5765 AC_MSG_ERROR([Unknown --with-omindex=$with_omindex])
5772 AC_MSG_CHECKING([whether to include the XML-help support])
5773 if test "$enable_xmlhelp" = yes; then
5774 BUILD_TYPE="$BUILD_TYPE XMLHELP"
5776 AC_DEFINE(HAVE_FEATURE_XMLHELP)
5777 AC_MSG_RESULT([yes])
5779 if test "$with_help" = yes; then
5780 add_warning "Building the XML help, but LO with disabled xmlhelp support. Generated help can't be accessed from this LO build!"
5785 dnl Test whether to integrate helppacks into the product's installer
5786 AC_MSG_CHECKING([for helppack integration])
5787 if test -z "$WITH_HELPPACKS" -o "$with_helppack_integration" = no; then
5788 AC_MSG_RESULT([no integration])
5790 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
5791 AC_MSG_RESULT([integration])
5794 AC_SUBST([ENABLE_HTMLHELP])
5795 AC_SUBST([HELP_OMINDEX_PAGE])
5796 AC_SUBST([HELP_ONLINE])
5797 # WITH_HELPPACKS is used only in configure
5799 dnl ===================================================================
5800 dnl Set up a different compiler to produce tools to run on the build
5801 dnl machine when doing cross-compilation
5802 dnl ===================================================================
5804 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
5805 m4_pattern_allow([PKG_CONFIG_LIBDIR])
5806 if test "$cross_compiling" = "yes"; then
5807 AC_MSG_CHECKING([for BUILD platform configuration])
5809 rm -rf CONF-FOR-BUILD config_build.mk
5810 mkdir CONF-FOR-BUILD
5811 # Here must be listed all files needed when running the configure script. In particular, also
5812 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
5813 # keep them in the same order as there.
5814 (cd $SRC_ROOT && tar cf - \
5816 bin/get_config_variables \
5817 solenv/bin/getcompver.awk \
5818 solenv/inc/langlist.mk \
5821 config_host_lang.mk.in \
5823 bin/bffvalidator.sh.in \
5824 bin/odfvalidator.sh.in \
5825 bin/officeotron.sh.in \
5826 instsetoo_native/util/openoffice.lst.in \
5828 sysui/desktop/macosx/Info.plist.in \
5829 sysui/desktop/macosx/hardened_runtime.xcent.in \
5830 sysui/desktop/macosx/lo.xcent.in \
5831 .vscode/vs-code-template.code-workspace.in \
5832 solenv/lockfile/autoconf.h.in \
5834 | (cd CONF-FOR-BUILD && tar xf -)
5835 cp configure CONF-FOR-BUILD
5836 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
5838 unset COM USING_X11 OS CPUNAME
5839 unset CC CXX SYSBASE CFLAGS
5840 unset AR LD NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
5841 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
5842 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
5843 unset PKG_CONFIG_LIBDIR PKG_CONFIG_PATH
5844 if test -n "$CC_FOR_BUILD"; then
5845 export CC="$CC_FOR_BUILD"
5846 CC_BASE=`first_arg_basename "$CC"`
5848 if test -n "$CXX_FOR_BUILD"; then
5849 export CXX="$CXX_FOR_BUILD"
5850 CXX_BASE=`first_arg_basename "$CXX"`
5852 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
5855 # Handle host configuration, which affects the cross-toolset too
5857 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
5858 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
5859 test "$with_junit" = "no" && sub_conf_opts="$sub_conf_opts --without-junit"
5860 # While we don't need scripting support, we don't have a PYTHON_FOR_BUILD Java equivalent, so must enable scripting for Java
5861 if test -n "$ENABLE_JAVA"; then
5864 # Hack for Android - the build doesn't need a host JDK, so just forward to build for convenience
5865 test -n "$with_jdk_home" && sub_conf_opts="$sub_conf_opts --with-jdk-home=$with_jdk_home"
5868 if test -z "$with_jdk_home"; then
5869 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.])
5874 sub_conf_opts="$sub_conf_opts --without-java"
5876 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
5877 test "$with_galleries" = "no" -o -z "$WITH_GALLERY_BUILD" && sub_conf_opts="$sub_conf_opts --with-galleries=no --disable-database-connectivity"
5878 test "$with_templates" = "no" -o -z "$WITH_TEMPLATES" && sub_conf_opts="$sub_conf_opts --with-templates=no"
5879 test -n "$with_help" -a "$with_help" != "no" && sub_conf_opts="$sub_conf_opts --with-help=$with_help"
5880 test "$enable_extensions" = yes || sub_conf_opts="$sub_conf_opts --disable-extensions"
5881 test "${enable_ld+set}" = set -a "$build_cpu" = "$host_cpu" && sub_conf_opts="$sub_conf_opts --enable-ld=${enable_ld}"
5882 test "${enable_pch+set}" = set && sub_conf_opts="$sub_conf_opts --enable-pch=${enable_pch}"
5883 test "$enable_wasm_strip" = "yes" && sub_conf_opts="$sub_conf_opts --enable-wasm-strip"
5884 test "${with_system_lockfile+set}" = set && sub_conf_opts="$sub_conf_opts --with-system-lockfile=${with_system_lockfile}"
5885 test "${enable_fuzzers}" = yes && sub_conf_opts="$sub_conf_opts --without-system-libxml"
5886 if test "$_os" = "Emscripten"; then
5887 sub_conf_opts="$sub_conf_opts --without-system-libxml --without-system-fontconfig --without-system-freetype --without-system-zlib"
5888 if test "${with_main_module+set}" = set; then
5889 sub_conf_opts="$sub_conf_opts --with-main-module=${with_main_module}"
5891 sub_conf_opts="$sub_conf_opts --with-main-module=writer"
5894 # windows uses full-internal python and that in turn relies on openssl, so also enable openssl
5895 # when cross-compiling for aarch64, overriding the defaults below
5896 test "${PLATFORMID}" = "windows_aarch64" && sub_conf_opts="$sub_conf_opts --enable-openssl --with-tls=openssl"
5898 # Don't bother having configure look for stuff not needed for the build platform anyway
5899 # WARNING: any option with an argument containing spaces must be handled separately (see --with-theme)
5900 sub_conf_defaults=" \
5901 --build="$build_alias" \
5902 --disable-cairo-canvas \
5904 --disable-customtarget-components \
5905 --disable-firebird-sdbc \
5907 --disable-gstreamer-1-0 \
5911 --disable-mariadb-sdbc \
5913 --disable-online-update \
5916 --disable-pdfimport \
5917 --disable-postgresql-sdbc \
5920 --enable-dynamic-loading \
5921 --enable-icecream="$enable_icecream" \
5928 # single quotes added for better readability in case of spaces
5929 echo " Running CONF-FOR-BUILD/configure" \
5930 $sub_conf_defaults \
5931 --with-parallelism="'$with_parallelism'" \
5932 --with-theme="'$with_theme'" \
5933 --with-vendor="'$with_vendor'" \
5935 $with_build_platform_configure_options \
5939 $sub_conf_defaults \
5940 --with-parallelism="$with_parallelism" \
5941 --with-theme="$with_theme" \
5942 "--with-vendor=$with_vendor" \
5944 $with_build_platform_configure_options \
5946 2>&1 | sed -e 's/^/ /'
5947 if test [${PIPESTATUS[0]}] -ne 0; then
5948 AC_MSG_ERROR([Running the configure script for BUILD side failed, see CONF-FOR-BUILD/config.log])
5951 # filter permitted build targets
5952 PERMITTED_BUILD_TARGETS="
5992 # converts BUILD_TYPE and PERMITTED_BUILD_TARGETS into non-whitespace,
5993 # newlined lists, to use grep as a filter
5994 PERMITTED_BUILD_TARGETS=$(echo "$PERMITTED_BUILD_TARGETS" | sed -e '/^ *$/d' -e 's/ *//')
5995 BUILD_TARGETS="$(sed -n -e '/^export BUILD_TYPE=/ s/.*=//p' config_host.mk | tr ' ' '\n')"
5996 BUILD_TARGETS="$(echo "$BUILD_TARGETS" | grep -F "$PERMITTED_BUILD_TARGETS" | tr '\n' ' ')"
5997 sed -i -e "s/ BUILD_TYPE=.*$/ BUILD_TYPE=$BUILD_TARGETS/" config_host.mk
5999 cp config_host.mk ../config_build.mk
6000 cp config_host_lang.mk ../config_build_lang.mk
6001 mv config.log ../config.Build.log
6002 mkdir -p ../config_build
6003 mv config_host/*.h ../config_build
6004 test -f "$WARNINGS_FILE" && mv "$WARNINGS_FILE" "../$WARNINGS_FILE_FOR_BUILD"
6006 # all these will get a _FOR_BUILD postfix
6007 DIRECT_FOR_BUILD_SETTINGS="
6015 JDK_SECURITYMANAGER_DISALLOWED
6019 LIBO_URE_MISC_FOLDER
6025 # these overwrite host config with build config
6026 OVERWRITING_SETTINGS="
6041 # these need some special handling
6042 EXTRA_HANDLED_SETTINGS="
6049 . ./bin/get_config_variables $DIRECT_FOR_BUILD_SETTINGS $OVERWRITING_SETTINGS $EXTRA_HANDLED_SETTINGS
6053 line=`echo "LO_PATH_FOR_BUILD='${BUILD_PATH}'" | sed -e 's,/CONF-FOR-BUILD,,g'`
6054 echo "$line" >>build-config
6056 for V in $DIRECT_FOR_BUILD_SETTINGS; do
6058 VV=`eval "echo $VV"`
6059 if test -n "$VV"; then
6060 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
6061 echo "$line" >>build-config
6065 for V in $OVERWRITING_SETTINGS; do
6067 VV=`eval "echo $VV"`
6068 if test -n "$VV"; then
6069 line=${V}='${'${V}:-$VV'}'
6070 echo "$line" >>build-config
6074 for V in INSTDIR INSTROOT WORKDIR; do
6076 VV=`eval "echo $VV"`
6077 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
6078 if test -n "$VV"; then
6079 line="${V}_FOR_BUILD='$VV'"
6080 echo "$line" >>build-config
6085 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([setup/configure for BUILD side failed, see CONF-FOR-BUILD/config.log])
6086 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])
6087 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
6088 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
6090 eval `cat CONF-FOR-BUILD/build-config`
6092 AC_MSG_RESULT([checking for BUILD platform configuration... done])
6094 rm -rf CONF-FOR-BUILD
6098 CPPU_ENV_FOR_BUILD="$CPPU_ENV"
6099 CXX_FOR_BUILD="$CXX"
6100 INSTDIR_FOR_BUILD="$INSTDIR"
6101 INSTROOT_FOR_BUILD="$INSTROOT"
6102 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
6103 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
6104 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
6105 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
6106 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
6107 WORKDIR_FOR_BUILD="$WORKDIR"
6109 AC_SUBST(OS_FOR_BUILD)
6110 AC_SUBST(INSTDIR_FOR_BUILD)
6111 AC_SUBST(INSTROOT_FOR_BUILD)
6112 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
6113 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
6114 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
6115 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
6116 AC_SUBST(SDKDIRNAME_FOR_BUILD)
6117 AC_SUBST(WORKDIR_FOR_BUILD)
6118 AC_SUBST(CC_FOR_BUILD)
6119 AC_SUBST(CXX_FOR_BUILD)
6120 AC_SUBST(CPPU_ENV_FOR_BUILD)
6122 dnl ===================================================================
6123 dnl Check for lockfile deps
6124 dnl ===================================================================
6125 if test -z "$CROSS_COMPILING"; then
6126 test -n "$LOCKFILE" -a "${with_system_lockfile+set}" != set && with_system_lockfile="$LOCKFILE"
6127 test "${with_system_lockfile+set}" = set || with_system_lockfile=no
6128 AC_MSG_CHECKING([which lockfile binary to use])
6129 case "$with_system_lockfile" in
6131 AC_MSG_RESULT([external])
6132 AC_PATH_PROGS([LOCKFILE],[dotlockfile lockfile])
6135 AC_MSG_RESULT([internal])
6138 if test -x "$with_system_lockfile"; then
6139 LOCKFILE="$with_system_lockfile"
6141 AC_MSG_ERROR(['$with_system_lockfile' is not executable.])
6143 AC_MSG_RESULT([$with_system_lockfile])
6148 if test -n "$LOCKFILE" -a "$DISABLE_DYNLOADING" = TRUE; then
6149 add_warning "The default system lockfile has increasing poll intervals up to 60s, so linking executables may be delayed."
6152 AC_CHECK_HEADERS([getopt.h paths.h sys/param.h])
6153 AC_CHECK_FUNCS([utime utimes])
6156 dnl ===================================================================
6157 dnl Check for syslog header
6158 dnl ===================================================================
6159 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
6161 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
6162 dnl ===================================================================
6163 AC_MSG_CHECKING([whether to turn warnings to errors])
6164 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
6165 ENABLE_WERROR="TRUE"
6166 PYTHONWARNINGS="error"
6167 AC_MSG_RESULT([yes])
6169 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
6170 ENABLE_WERROR="TRUE"
6171 PYTHONWARNINGS="error"
6172 AC_MSG_RESULT([yes])
6177 AC_SUBST(ENABLE_WERROR)
6178 AC_SUBST(PYTHONWARNINGS)
6180 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
6181 dnl ===================================================================
6182 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
6183 if test -z "$enable_assert_always_abort"; then
6184 if test "$ENABLE_DEBUG" = TRUE; then
6185 enable_assert_always_abort=yes
6187 enable_assert_always_abort=no
6190 if test "$enable_assert_always_abort" = "yes"; then
6191 ASSERT_ALWAYS_ABORT="TRUE"
6192 AC_MSG_RESULT([yes])
6194 ASSERT_ALWAYS_ABORT="FALSE"
6197 AC_SUBST(ASSERT_ALWAYS_ABORT)
6199 # Determine whether to use ooenv for the instdir installation
6200 # ===================================================================
6201 if test $_os != "WINNT" -a $_os != "Darwin"; then
6202 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
6203 if test -z "$enable_ooenv"; then
6204 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
6210 if test "$enable_ooenv" = "no"; then
6214 AC_MSG_RESULT([yes])
6217 AC_SUBST(ENABLE_OOENV)
6219 if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; then
6220 if test "$enable_qt5" = "no"; then
6221 AC_MSG_ERROR([KF5 support depends on QT5, so it conflicts with --disable-qt5])
6227 if test "$test_kf6" = "yes" -a "$enable_kf6" = "yes"; then
6228 if test "$enable_qt6" = "no"; then
6229 AC_MSG_ERROR([KF6 support depends on QT6, so it conflicts with --disable-qt6])
6236 AC_MSG_CHECKING([whether to build the pagein binaries for oosplash])
6237 if test "${enable_pagein}" != no -a -z "$DISABLE_DYNLOADING"; then
6238 AC_MSG_RESULT([yes])
6240 AC_DEFINE(HAVE_FEATURE_PAGEIN)
6244 AC_SUBST(ENABLE_PAGEIN)
6246 dnl ===================================================================
6247 dnl check for cups support
6248 dnl ===================================================================
6250 AC_MSG_CHECKING([whether to enable CUPS support])
6251 if test "$test_cups" = yes -a "$enable_cups" != no; then
6253 AC_MSG_RESULT([yes])
6255 AC_MSG_CHECKING([whether cups support is present])
6256 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
6257 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
6258 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
6259 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
6265 AC_SUBST(ENABLE_CUPS)
6267 libo_CHECK_SYSTEM_MODULE([fontconfig],[FONTCONFIG],[fontconfig >= 2.12.0],,system,TRUE)
6269 dnl whether to find & fetch external tarballs?
6270 dnl ===================================================================
6271 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
6272 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6273 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
6275 TARFILE_LOCATION="$LODE_HOME/ext_tar"
6278 if test -z "$TARFILE_LOCATION"; then
6279 if test -d "$SRC_ROOT/src" ; then
6280 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
6281 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
6283 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
6285 AbsolutePath "$TARFILE_LOCATION"
6286 PathFormat "${absolute_path}"
6287 TARFILE_LOCATION="${formatted_path_unix}"
6289 PathFormat "$TARFILE_LOCATION"
6290 TARFILE_LOCATION_NATIVE="$formatted_path"
6291 AC_SUBST(TARFILE_LOCATION)
6292 AC_SUBST(TARFILE_LOCATION_NATIVE)
6294 AC_MSG_CHECKING([whether we want to fetch tarballs])
6295 if test "$enable_fetch_external" != "no"; then
6296 if test "$with_all_tarballs" = "yes"; then
6297 AC_MSG_RESULT([yes, all of them])
6298 DO_FETCH_TARBALLS="ALL"
6300 AC_MSG_RESULT([yes, if we use them])
6301 DO_FETCH_TARBALLS="TRUE"
6307 AC_SUBST(DO_FETCH_TARBALLS)
6309 dnl Test whether to include MySpell dictionaries
6310 dnl ===================================================================
6311 AC_MSG_CHECKING([whether to include MySpell dictionaries])
6312 if test "$with_myspell_dicts" = "yes"; then
6313 AC_MSG_RESULT([yes])
6314 WITH_MYSPELL_DICTS=TRUE
6315 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
6316 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
6321 AC_SUBST(WITH_MYSPELL_DICTS)
6323 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
6324 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
6325 if test "$with_system_dicts" = yes; then
6326 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
6328 with_system_dicts=no
6331 AC_MSG_CHECKING([whether to use dicts from external paths])
6332 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
6333 AC_MSG_RESULT([yes])
6335 AC_MSG_CHECKING([for spelling dictionary directory])
6336 if test -n "$with_external_dict_dir"; then
6337 DICT_SYSTEM_DIR=file://$with_external_dict_dir
6339 DICT_SYSTEM_DIR=file:///usr/share/hunspell
6340 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
6341 DICT_SYSTEM_DIR=file:///usr/share/myspell
6344 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
6345 AC_MSG_CHECKING([for hyphenation patterns directory])
6346 if test -n "$with_external_hyph_dir"; then
6347 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
6349 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
6351 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
6352 AC_MSG_CHECKING([for thesaurus directory])
6353 if test -n "$with_external_thes_dir"; then
6354 THES_SYSTEM_DIR=file://$with_external_thes_dir
6356 THES_SYSTEM_DIR=file:///usr/share/mythes
6358 AC_MSG_RESULT([$THES_SYSTEM_DIR])
6363 AC_SUBST(SYSTEM_DICTS)
6364 AC_SUBST(DICT_SYSTEM_DIR)
6365 AC_SUBST(HYPH_SYSTEM_DIR)
6366 AC_SUBST(THES_SYSTEM_DIR)
6368 dnl ===================================================================
6369 dnl Precompiled headers.
6371 AC_MSG_CHECKING([whether to enable pch feature])
6372 if test -z "$enable_pch"; then
6373 if test "$_os" = "WINNT"; then
6374 # Enabled by default on Windows.
6376 # never use sccache on auto-enabled PCH builds, except if requested explicitly
6377 if test -z "$enable_ccache" -a "$SCCACHE"; then
6384 if test "$enable_pch" != no -a "$_os" = Emscripten; then
6385 AC_MSG_ERROR([PCH currently isn't supported for Emscripten with native EH (nEH) because of missing Sj/Lj support with nEH in clang.])
6387 if test "$enable_pch" != "no" -a "$_os" != "WINNT" -a "$GCC" != "yes" ; then
6388 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
6390 if test "$enable_pch" = "system"; then
6392 AC_MSG_RESULT([yes (system headers)])
6393 elif test "$enable_pch" = "base"; then
6395 AC_MSG_RESULT([yes (system and base headers)])
6396 elif test "$enable_pch" = "normal"; then
6398 AC_MSG_RESULT([yes (normal)])
6399 elif test "$enable_pch" = "full"; then
6401 AC_MSG_RESULT([yes (full)])
6402 elif test "$enable_pch" = "yes"; then
6403 # Pick a suitable default.
6404 if test "$GCC" = "yes"; then
6405 # With Clang and GCC higher levels do not seem to make a noticeable improvement,
6406 # while making the PCHs larger and rebuilds more likely.
6408 AC_MSG_RESULT([yes (system and base headers)])
6410 # With MSVC the highest level makes a significant difference,
6411 # and it was the default when there used to be no PCH levels.
6413 AC_MSG_RESULT([yes (full)])
6415 elif test "$enable_pch" = "no"; then
6418 AC_MSG_ERROR([Unknown value for --enable-pch])
6420 AC_SUBST(ENABLE_PCH)
6421 # ccache 3.7.1 and older do not properly detect/handle -include .gch in CCACHE_DEPEND mode
6422 if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_IS_CLANG" != "TRUE"; then
6423 AC_PATH_PROG([CCACHE_BIN],[ccache],[not found])
6424 if test "$CCACHE_BIN" != "not found"; then
6425 AC_MSG_CHECKING([ccache version])
6426 CCACHE_VERSION=`"$CCACHE_BIN" -V | "$AWK" '/^ccache version/{print $3}'`
6427 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6428 AC_MSG_RESULT([$CCACHE_VERSION])
6429 AC_MSG_CHECKING([whether ccache depend mode works properly with GCC PCH])
6430 if test "$CCACHE_NUMVER" -gt "030701"; then
6431 AC_MSG_RESULT([yes])
6433 AC_MSG_RESULT([no (not newer than 3.7.1)])
6439 PCH_INSTANTIATE_TEMPLATES=
6440 if test -n "$ENABLE_PCH"; then
6441 AC_MSG_CHECKING([whether $CC supports -fpch-instantiate-templates])
6443 CFLAGS="$CFLAGS -Werror -fpch-instantiate-templates"
6444 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_INSTANTIATE_TEMPLATES="-fpch-instantiate-templates" ],[])
6446 if test -n "$PCH_INSTANTIATE_TEMPLATES"; then
6452 AC_SUBST(PCH_INSTANTIATE_TEMPLATES)
6454 BUILDING_PCH_WITH_OBJ=
6455 if test -n "$ENABLE_PCH"; then
6456 AC_MSG_CHECKING([whether $CC supports -Xclang -building-pch-with-obj])
6458 CFLAGS="$CFLAGS -Werror -Xclang -building-pch-with-obj"
6459 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ BUILDING_PCH_WITH_OBJ="-Xclang -building-pch-with-obj" ],[])
6461 if test -n "$BUILDING_PCH_WITH_OBJ"; then
6467 AC_SUBST(BUILDING_PCH_WITH_OBJ)
6472 if test "$COM" = MSC; then
6473 fpch_prefix="-Xclang "
6475 if test -n "$BUILDING_PCH_WITH_OBJ"; then
6476 AC_MSG_CHECKING([whether $CC supports ${fpch_prefix}-fpch-codegen])
6478 CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fpch-codegen"
6479 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
6480 [ PCH_CODEGEN="${fpch_prefix}-fpch-codegen" ],[])
6482 CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fno-pch-codegen"
6483 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
6484 [ PCH_NO_CODEGEN="${fpch_prefix}-fno-pch-codegen" ],[])
6486 if test -n "$PCH_CODEGEN"; then
6492 AC_SUBST(PCH_CODEGEN)
6493 AC_SUBST(PCH_NO_CODEGEN)
6495 if test -n "$BUILDING_PCH_WITH_OBJ"; then
6496 AC_MSG_CHECKING([whether $CC supports ${fpch_prefix}-fpch-debuginfo])
6498 CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fpch-debuginfo"
6499 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_DEBUGINFO="${fpch_prefix}-fpch-debuginfo" ],[])
6501 if test -n "$PCH_DEBUGINFO"; then
6507 AC_SUBST(PCH_DEBUGINFO)
6511 AC_MSG_CHECKING([the GNU Make version])
6512 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
6513 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6514 if test "$_make_longver" -ge "040000"; then
6515 AC_MSG_RESULT([$GNUMAKE $_make_version])
6517 AC_MSG_ERROR([failed ($GNUMAKE version >= 4.0 needed)])
6520 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
6522 if test "$_make_ver_check" = ""; then
6526 HAVE_LD_HASH_STYLE=FALSE
6527 WITH_LINKER_HASH_STYLE=
6528 AC_MSG_CHECKING([for --hash-style gcc linker support])
6529 if test "$GCC" = "yes"; then
6530 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
6531 hash_styles="gnu sysv"
6532 elif test "$with_linker_hash_style" = "no"; then
6535 hash_styles="$with_linker_hash_style"
6538 for hash_style in $hash_styles; do
6539 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
6540 hash_style_ldflags_save=$LDFLAGS
6541 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
6543 AC_RUN_IFELSE([AC_LANG_PROGRAM(
6550 HAVE_LD_HASH_STYLE=TRUE
6551 WITH_LINKER_HASH_STYLE=$hash_style
6553 [HAVE_LD_HASH_STYLE=FALSE],
6554 [HAVE_LD_HASH_STYLE=FALSE])
6555 LDFLAGS=$hash_style_ldflags_save
6558 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
6559 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
6563 LDFLAGS=$hash_style_ldflags_save
6567 AC_SUBST(HAVE_LD_HASH_STYLE)
6568 AC_SUBST(WITH_LINKER_HASH_STYLE)
6570 dnl ===================================================================
6571 dnl Check whether there's a Perl version available.
6572 dnl ===================================================================
6573 if test -z "$with_perl_home"; then
6574 AC_PATH_PROG(PERL, perl)
6576 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
6577 _perl_path="$with_perl_home/bin/perl"
6578 if test -x "$_perl_path"; then
6581 AC_MSG_ERROR([$_perl_path not found])
6585 dnl ===================================================================
6586 dnl Testing for Perl version 5 or greater.
6587 dnl $] is the Perl version variable, it is returned as an integer
6588 dnl ===================================================================
6589 if test "$PERL"; then
6590 AC_MSG_CHECKING([the Perl version])
6591 ${PERL} -e "exit($]);"
6593 if test "$_perl_version" -lt 5; then
6594 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
6596 AC_MSG_RESULT([Perl $_perl_version])
6598 AC_MSG_ERROR([Perl not found, install Perl 5])
6601 dnl ===================================================================
6602 dnl Testing for required Perl modules
6603 dnl ===================================================================
6605 AC_MSG_CHECKING([for required Perl modules])
6606 perl_use_string="use Cwd ; use Digest::MD5"
6607 if test "$_os" = "WINNT"; then
6608 if test -n "$PKGFORMAT"; then
6609 for i in $PKGFORMAT; do
6612 # for getting fonts versions to use in MSI
6613 perl_use_string="$perl_use_string ; use Font::TTF::Font"
6619 if test "$with_system_hsqldb" = "yes"; then
6620 perl_use_string="$perl_use_string ; use Archive::Zip"
6622 if test "$enable_openssl" = "yes" -a "$with_system_openssl" != "yes"; then
6623 # OpenSSL needs that to build
6624 perl_use_string="$perl_use_string ; use FindBin"
6626 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
6627 AC_MSG_RESULT([all modules found])
6629 AC_MSG_RESULT([failed to find some modules])
6630 # Find out which modules are missing.
6631 for i in $perl_use_string; do
6632 if test "$i" != "use" -a "$i" != ";"; then
6633 if ! $PERL -e "use $i;">/dev/null 2>&1; then
6634 missing_perl_modules="$missing_perl_modules $i"
6639 The missing Perl modules are: $missing_perl_modules
6640 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
6643 dnl ===================================================================
6644 dnl Check for pkg-config
6645 dnl ===================================================================
6646 if test "$_os" != "WINNT"; then
6649 AC_SUBST(PKG_CONFIG)
6650 AC_SUBST(PKG_CONFIG_PATH)
6651 AC_SUBST(PKG_CONFIG_LIBDIR)
6653 if test "$_os" != "WINNT"; then
6655 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
6656 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
6657 # explicitly. Or put /path/to/compiler in PATH yourself.
6660 if test "$COM_IS_CLANG" = "TRUE"; then
6663 AC_CHECK_TOOLS(AR,$toolprefix-ar ar)
6664 AC_CHECK_TOOLS(NM,$toolprefix-nm nm)
6665 AC_CHECK_TOOLS(RANLIB,$toolprefix-ranlib ranlib)
6666 AC_CHECK_TOOLS(OBJDUMP,$toolprefix-objdump objdump)
6667 AC_CHECK_TOOLS(READELF,$toolprefix-readelf readelf)
6668 AC_CHECK_TOOLS(STRIP,$toolprefix-strip strip)
6677 dnl ===================================================================
6678 dnl pkg-config checks on macOS
6679 dnl ===================================================================
6681 if test $_os = Darwin; then
6682 AC_MSG_CHECKING([for bogus pkg-config])
6683 if test -n "$PKG_CONFIG"; then
6684 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
6685 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
6687 if test "$enable_bogus_pkg_config" = "yes"; then
6688 AC_MSG_RESULT([yes, user-approved from unknown origin.])
6690 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.])
6694 AC_MSG_RESULT([no, good])
6700 # Return value: $csctest
6704 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client" "InstallPath"
6705 if test -n "$regvalue"; then
6713 # Return value: $altest
6717 # We need this check to detect 4.6.1 or above.
6718 for ver in 4.8.1 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
6719 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools" "InstallationFolder"
6720 PathFormat "$regvalue"
6721 if test -n "$regvalue" -a \( -f "$formatted_path_unix/al.exe" -o -f "$formatted_path_unix/bin/al.exe" \); then
6727 reg_list_values_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows"
6728 for x in $reglist; do
6729 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools" "InstallationFolder"
6730 PathFormat "$regvalue"
6731 if test -n "$regvalue" -a \( -f "$formatted_path_unix/al.exe" -o -f "$formatted_path_unix/bin/al.exe" \); then
6742 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
6743 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver" "KitsInstallationFolder"
6744 if test -n "$regvalue"; then
6749 AC_MSG_ERROR([The Windows NET SDK (minimum 4.6) not found, check the installation])
6752 find_winsdk_version()
6754 # Args: $1 : SDK version as in "8.0", "8.1A" etc
6755 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
6757 unset winsdktest winsdkbinsubdir winsdklibsubdir
6761 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots" "KitsRoot"
6762 if test -n "$regvalue"; then
6763 winsdktest=$regvalue
6764 winsdklibsubdir=win8
6769 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots" "KitsRoot81"
6770 if test -n "$regvalue"; then
6771 winsdktest=$regvalue
6772 winsdklibsubdir=winv6.3
6777 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}" "InstallationFolder"
6778 if test -n "$regvalue"; then
6779 winsdktest=$regvalue
6780 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}" "ProductVersion"
6781 if test -n "$regvalue"; then
6782 winsdkbinsubdir="$regvalue".0
6783 winsdklibsubdir=$winsdkbinsubdir
6784 local tmppath="$winsdktest\\Include\\$winsdklibsubdir"
6785 PathFormat "$tmppath"
6786 local tmppath_unix=$formatted_path_unix
6787 # test exist the SDK path
6788 if test ! -d "$tmppath_unix"; then
6789 AC_MSG_ERROR([The Windows SDK not found, check the installation])
6800 # Return value: From find_winsdk_version
6804 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
6805 find_winsdk_version $ver
6806 if test -n "$winsdktest"; then
6814 # Return value: $msmdir
6817 AC_MSG_CHECKING([for MSVC $version merge modules directory])
6818 local my_msm_file="Microsoft_VC${version}_CRT_x86.msm"
6821 echo "$as_me:$LINENO: searching for $my_msm_file" >&5
6825 16.0 | 17.0 | 17.11)
6826 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
6827 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
6828 echo "$as_me:$LINENO: looking for $my_msm_dir${my_msm_file}])" >&5
6829 if test -e "$my_msm_dir${my_msm_file}"; then
6836 if test -n "$msmdir"; then
6837 msmdir=`cygpath -m "$msmdir"`
6838 AC_MSG_RESULT([$msmdir])
6840 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
6841 AC_MSG_FAILURE([not found])
6843 AC_MSG_WARN([not found (check config.log)])
6844 add_warning "MSM ${my_msm_file} not found"
6849 find_msvc_x64_dlls()
6851 # Return value: $msvcdllpath, $msvcdlls
6853 AC_MSG_CHECKING([for MSVC x64 DLL path])
6855 dnl Order crtver in increasing order. Then check the directories returned by
6856 dnl ls in an inner loop; assuming they are also ordered in increasing order,
6857 dnl the result will be the highest CRT version found in the highest directory.
6859 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
6861 16.0 | 17.0 | 17.11)
6862 for crtver in 141 142 143; do
6863 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
6864 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT" >&5
6865 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT"; then
6866 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT"
6872 AC_MSG_RESULT([$msvcdllpath])
6873 AC_MSG_CHECKING([for MSVC x64 DLLs])
6874 msvcdlls="msvcp140.dll vcruntime140.dll"
6875 for dll in $msvcdlls; do
6876 if ! test -f "$msvcdllpath/$dll"; then
6877 AC_MSG_FAILURE([missing $dll])
6880 AC_MSG_RESULT([found all ($msvcdlls)])
6883 dnl =========================================
6884 dnl Check for the Windows SDK.
6885 dnl =========================================
6886 if test "$_os" = "WINNT"; then
6887 AC_MSG_CHECKING([for Windows SDK])
6888 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
6890 WINDOWS_SDK_HOME=$winsdktest
6892 # normalize if found
6893 if test -n "$WINDOWS_SDK_HOME"; then
6894 PathFormat "$WINDOWS_SDK_HOME"
6895 WINDOWS_SDK_HOME=$formatted_path_unix
6898 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
6899 # The variable also contains the Windows SDK version
6900 echo $WINDOWS_SDK_LIB_SUBDIR
6901 IFS='.' read -r SDK_v1 SDK_v2 SDK_v3 SDK_v4 <<< "$WINDOWS_SDK_LIB_SUBDIR"
6902 # Assuming maximum of 5 digits for each part and ignoring last part
6903 SDK_NORMALIZED_VER=$((SDK_v1 * 10000000000 + SDK_v2 * 100000 + SDK_v3))
6904 # 10.0.20348.0 is the minimum required version
6905 if test "$SDK_NORMALIZED_VER" -lt 100000020348; then
6906 AC_MSG_ERROR([You need Windows SDK greater than or equal 10.0.20348.0])
6910 if test -n "$WINDOWS_SDK_HOME"; then
6911 # Remove a possible trailing backslash
6912 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
6914 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
6915 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
6916 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
6917 have_windows_sdk_headers=yes
6918 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
6919 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
6920 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
6921 have_windows_sdk_headers=yes
6922 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
6923 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
6924 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
6925 have_windows_sdk_headers=yes
6927 have_windows_sdk_headers=no
6930 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
6931 have_windows_sdk_libs=yes
6932 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/user32.lib"; then
6933 have_windows_sdk_libs=yes
6935 have_windows_sdk_libs=no
6938 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
6939 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
6940 the Windows SDK are installed.])
6944 if test -z "$WINDOWS_SDK_HOME"; then
6945 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
6946 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
6947 WINDOWS_SDK_VERSION=80
6948 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
6949 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
6950 WINDOWS_SDK_VERSION=81
6951 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
6952 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
6953 WINDOWS_SDK_VERSION=10
6954 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
6956 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
6958 PathFormat "$WINDOWS_SDK_HOME"
6959 WINDOWS_SDK_HOME="$formatted_path"
6960 WINDOWS_SDK_HOME_unix="$formatted_path_unix"
6961 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
6962 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
6963 if test -d "$WINDOWS_SDK_HOME_unix/include/um"; then
6964 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
6965 elif test -d "$WINDOWS_SDK_HOME_unix/Include/$winsdklibsubdir/um"; then
6966 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
6970 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
6971 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
6972 dnl but not in v8.0), so allow this to be overridden with a
6973 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
6974 dnl and configuration error if no WiLangId.vbs is found would arguably be
6975 dnl better, but I do not know under which conditions exactly it is needed by
6977 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
6978 WINDOWS_SDK_WILANGID_unix=$WINDOWS_SDK_HOME_unix/Samples/sysmgmt/msi/scripts/WiLangId.vbs
6979 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6980 WINDOWS_SDK_WILANGID_unix="${WINDOWS_SDK_HOME_unix}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WIN_BUILD_ARCH}/WiLangId.vbs"
6982 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6983 WINDOWS_SDK_WILANGID_unix=$WINDOWS_SDK_HOME_unix/bin/$WIN_BUILD_ARCH/WiLangId.vbs
6985 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6986 WINDOWS_SDK_WILANGID_unix="C:/Program Files (x86)/Windows Kits/8.1/bin/$WIN_BUILD_ARCH/WiLangId.vbs"
6988 PathFormat "$WINDOWS_SDK_WILANGID_unix"
6989 WINDOWS_SDK_WILANGID="$formatted_path"
6991 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
6992 if test -n "$with_package_format" -a "$with_package_format" != no; then
6993 for i in "$with_package_format"; do
6994 if test "$i" = "msi"; then
6995 if ! test -e "$WINDOWS_SDK_WILANGID_unix" ; then
6996 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
7003 AC_SUBST(WINDOWS_SDK_HOME)
7004 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
7005 AC_SUBST(WINDOWS_SDK_VERSION)
7006 AC_SUBST(WINDOWS_SDK_WILANGID)
7008 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
7009 dnl Check midl.exe; this being the first check for a tool in the SDK bin
7010 dnl dir, it also determines that dir's path w/o an arch segment if any,
7011 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
7012 AC_MSG_CHECKING([for midl.exe])
7015 PathFormat "$winsdktest"
7016 winsdktest_unix="$formatted_path_unix"
7018 if test -n "$winsdkbinsubdir" \
7019 -a -f "$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/midl.exe"
7021 MIDL_PATH=$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH
7022 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME_unix/Bin/$winsdkbinsubdir
7023 elif test -f "$winsdktest_unix/Bin/$WIN_BUILD_ARCH/midl.exe"; then
7024 MIDL_PATH=$winsdktest_unix/Bin/$WIN_BUILD_ARCH
7025 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME_unix/Bin
7026 elif test -f "$winsdktest_unix/Bin/midl.exe"; then
7027 MIDL_PATH=$winsdktest_unix/Bin
7028 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME_unix/Bin
7030 PathFormat "$MIDL_PATH"
7031 if test ! -f "$formatted_path_unix/midl.exe"; then
7032 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WIN_BUILD_ARCH, Windows SDK installation broken?])
7034 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
7037 # Convert to posix path with 8.3 filename restrictions ( No spaces )
7038 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
7040 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
7041 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
7042 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
7043 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
7044 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
7045 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
7046 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
7047 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
7048 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
7049 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
7050 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
7051 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
7053 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
7057 AC_MSG_CHECKING([for csc.exe])
7059 PathFormat "$csctest"
7060 csctest_unix="$formatted_path_unix"
7061 if test -f "$csctest_unix/csc.exe"; then
7064 if test ! -f "$csctest_unix/csc.exe"; then
7065 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
7067 AC_MSG_RESULT([$CSC_PATH/csc.exe])
7070 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
7073 AC_MSG_CHECKING([for al.exe])
7074 if test -n "$winsdkbinsubdir" \
7075 -a -f "$winsdktest_unix/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/al.exe"
7077 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH"
7078 elif test -f "$winsdktest_unix/Bin/$WIN_BUILD_ARCH/al.exe"; then
7079 AL_PATH="$winsdktest/Bin/$WIN_BUILD_ARCH"
7080 elif test -f "$winsdktest_unix/Bin/al.exe"; then
7081 AL_PATH="$winsdktest/Bin"
7084 if test -z "$AL_PATH"; then
7086 PathFormat "$altest"
7087 altest_unix="$formatted_path_unix"
7088 if test -f "$altest_unix/bin/al.exe"; then
7089 AL_PATH="$altest/bin"
7090 elif test -f "$altest_unix/al.exe"; then
7094 PathFormat "$AL_PATH"
7095 if test ! -f "$formatted_path_unix/al.exe"; then
7096 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
7098 AC_MSG_RESULT([$AL_PATH/al.exe])
7101 AL_PATH=`win_short_path_for_make "$AL_PATH"`
7103 dnl Check mscoree.lib / .NET Framework dir
7104 AC_MSG_CHECKING(.NET Framework)
7106 PathFormat "$frametest"
7107 frametest="$formatted_path_unix"
7108 if test -f "$frametest/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
7109 DOTNET_FRAMEWORK_HOME="$frametest"
7111 if test -f "$winsdktest_unix/lib/mscoree.lib" -o -f "$winsdktest_unix/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib"; then
7112 DOTNET_FRAMEWORK_HOME="$winsdktest"
7115 PathFormat "$DOTNET_FRAMEWORK_HOME"
7116 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
7117 AC_MSG_ERROR([mscoree.lib not found])
7119 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
7121 PathFormat "$MIDL_PATH"
7122 MIDL_PATH="$formatted_path"
7124 PathFormat "$AL_PATH"
7125 AL_PATH="$formatted_path"
7127 PathFormat "$DOTNET_FRAMEWORK_HOME"
7128 DOTNET_FRAMEWORK_HOME="$formatted_path"
7130 PathFormat "$CSC_PATH"
7131 CSC_PATH="$formatted_path"
7134 dnl ===================================================================
7135 dnl Testing for C++ compiler and version...
7136 dnl ===================================================================
7138 if test "$_os" != "WINNT"; then
7139 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that (and avoid -O2 during AC_PROG_CXX,
7140 # see AC_PROG_CC above):
7141 save_CXXFLAGS=$CXXFLAGS
7144 CXXFLAGS=$save_CXXFLAGS
7145 if test -z "$CXX_BASE"; then
7146 CXX_BASE=`first_arg_basename "$CXX"`
7150 dnl check for GNU C++ compiler version
7151 if test "$GXX" = "yes" -a -z "$COM_IS_CLANG"; then
7152 AC_MSG_CHECKING([the GNU C++ compiler version])
7154 _gpp_version=`$CXX -dumpversion`
7155 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
7157 if test "$_gpp_majmin" -lt "700"; then
7158 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 7.0 to build LibreOffice, you have $_gpp_version.])
7160 AC_MSG_RESULT([ok (g++ $_gpp_version)])
7163 dnl see https://issuetracker.google.com/issues/36962819
7167 AC_MSG_CHECKING([whether $CXX_BASE is broken with boost.thread])
7168 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
7169 #include <bits/c++config.h>]],[[
7170 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
7171 && !defined(_GLIBCXX__PTHREADS) \
7172 && !defined(_GLIBCXX_HAS_GTHREADS)
7175 ]])],[AC_MSG_RESULT([yes])
7176 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
7178 if test $glibcxx_threads = yes; then
7179 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
7182 AC_SUBST(BOOST_CXXFLAGS)
7185 # prefx CXX with ccache if needed
7187 if test "$CCACHE" != ""; then
7188 AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
7190 save_CXXFLAGS=$CXXFLAGS
7191 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
7192 # msvc does not fail on unknown options, check stdout
7193 if test "$COM" = MSC; then
7194 CXXFLAGS="$CXXFLAGS -nologo"
7196 save_ac_cxx_werror_flag=$ac_cxx_werror_flag
7197 ac_cxx_werror_flag=yes
7198 dnl an empty program will do, we're checking the compiler flags
7199 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
7200 [use_ccache=yes], [use_ccache=no])
7201 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
7202 AC_MSG_RESULT([yes])
7205 CXX_BASE="ccache $CXX_BASE"
7208 CXXFLAGS=$save_CXXFLAGS
7209 ac_cxx_werror_flag=$save_ac_cxx_werror_flag
7213 dnl ===================================================================
7214 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
7215 dnl ===================================================================
7217 if test "$_os" != "WINNT"; then
7220 dnl Check whether there's a C pre-processor.
7225 dnl ===================================================================
7226 dnl Find integral type sizes and alignments
7227 dnl ===================================================================
7229 if test "$_os" != "WINNT"; then
7231 AC_CHECK_SIZEOF(long)
7232 AC_CHECK_SIZEOF(short)
7233 AC_CHECK_SIZEOF(int)
7234 AC_CHECK_SIZEOF(long long)
7235 AC_CHECK_SIZEOF(double)
7236 AC_CHECK_SIZEOF(void*)
7237 AC_CHECK_SIZEOF(size_t)
7239 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
7240 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
7241 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
7242 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
7243 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
7244 SIZEOF_SIZE_T=$ac_cv_sizeof_size_t
7246 dnl Allow build without AC_CHECK_ALIGNOF, grrr
7247 m4_pattern_allow([AC_CHECK_ALIGNOF])
7248 m4_ifdef([AC_CHECK_ALIGNOF],
7250 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
7251 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
7252 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
7253 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
7256 case "$_os-$host_cpu" in
7258 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
7259 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
7260 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
7261 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
7264 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
7265 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
7266 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
7267 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
7270 if test -z "$ac_cv_alignof_short" -o \
7271 -z "$ac_cv_alignof_int" -o \
7272 -z "$ac_cv_alignof_long" -o \
7273 -z "$ac_cv_alignof_double"; then
7274 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.])
7280 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
7281 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
7282 if test $ac_cv_sizeof_long -eq 8; then
7283 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
7284 elif test $ac_cv_sizeof_double -eq 8; then
7285 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
7287 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
7290 dnl Check for large file support
7292 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
7293 LFS_CFLAGS="$ac_cv_sys_largefile_opts"
7294 elif test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
7295 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
7297 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
7298 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
7302 SAL_TYPES_SIZEOFSHORT=2
7303 SAL_TYPES_SIZEOFINT=4
7304 SAL_TYPES_SIZEOFLONG=4
7305 SAL_TYPES_SIZEOFLONGLONG=8
7306 if test $WIN_HOST_BITS -eq 32; then
7307 SAL_TYPES_SIZEOFPOINTER=4
7310 SAL_TYPES_SIZEOFPOINTER=8
7313 SAL_TYPES_ALIGNMENT2=2
7314 SAL_TYPES_ALIGNMENT4=4
7315 SAL_TYPES_ALIGNMENT8=8
7318 AC_SUBST(LFS_CFLAGS)
7319 AC_SUBST(SIZEOF_SIZE_T)
7321 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
7322 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
7323 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
7324 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
7325 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
7326 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
7327 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
7328 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
7330 dnl Calc jumbo sheets (1m+ rows) depend on 64 bit tools::Long .
7331 AC_MSG_CHECKING([whether jumbo sheets are supported])
7332 if test "$_os" != "WINNT"; then
7333 if test $SAL_TYPES_SIZEOFLONG -gt 4; then
7334 AC_MSG_RESULT([yes])
7335 ENABLE_JUMBO_SHEETS=TRUE
7336 AC_DEFINE(HAVE_FEATURE_JUMBO_SHEETS)
7341 if test $WIN_HOST_BITS -gt 32; then
7342 # 64bit windows is special-cased for tools::Long because long is 32bit
7343 AC_MSG_RESULT([yes])
7344 ENABLE_JUMBO_SHEETS=TRUE
7345 AC_DEFINE(HAVE_FEATURE_JUMBO_SHEETS)
7350 AC_SUBST(ENABLE_JUMBO_SHEETS)
7352 dnl ===================================================================
7353 dnl Check whether to enable runtime optimizations
7354 dnl ===================================================================
7355 ENABLE_RUNTIME_OPTIMIZATIONS=
7356 AC_MSG_CHECKING([whether to enable runtime optimizations])
7357 if test -z "$enable_runtime_optimizations"; then
7361 enable_runtime_optimizations=no
7367 if test "$enable_runtime_optimizations" != no; then
7368 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
7369 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
7370 AC_MSG_RESULT([yes])
7374 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
7376 dnl ===================================================================
7377 dnl Check if valgrind headers are available
7378 dnl ===================================================================
7380 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
7381 prev_cppflags=$CPPFLAGS
7382 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
7383 # or where does it come from?
7384 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
7385 AC_CHECK_HEADER([valgrind/valgrind.h],
7386 [ENABLE_VALGRIND=TRUE])
7387 CPPFLAGS=$prev_cppflags
7389 AC_SUBST([ENABLE_VALGRIND])
7390 if test -z "$ENABLE_VALGRIND"; then
7391 if test "$with_valgrind" = yes; then
7392 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
7396 AC_SUBST([VALGRIND_CFLAGS])
7399 dnl ===================================================================
7400 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
7401 dnl ===================================================================
7403 # We need at least the sys/sdt.h include header.
7404 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
7405 if test "$SDT_H_FOUND" = "TRUE"; then
7406 # Found sys/sdt.h header, now make sure the c++ compiler works.
7407 # Old g++ versions had problems with probes in constructors/destructors.
7408 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
7410 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
7411 #include <sys/sdt.h>
7419 ProbeClass(int& v, const char *n) : ref(v), name(n)
7421 DTRACE_PROBE2(_test_, cons, name, ref);
7424 void method(int min)
7426 DTRACE_PROBE3(_test_, meth, name, ref, min);
7432 DTRACE_PROBE2(_test_, dest, name, ref);
7437 DTRACE_PROBE1(_test_, call, i);
7438 ProbeClass inst = ProbeClass(i, "call");
7440 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
7441 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
7444 AC_CONFIG_HEADERS([config_host/config_probes.h])
7446 dnl ===================================================================
7448 dnl ===================================================================
7449 HAVE_GCC_STACK_CLASH_PROTECTION=
7451 HARDENING_OPT_CFLAGS=
7452 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
7453 AC_MSG_CHECKING([whether $CC_BASE supports -grecord-gcc-switches])
7455 CFLAGS="$CFLAGS -Werror -grecord-gcc-switches"
7457 [AC_LANG_PROGRAM(, [[return 0;]])],
7458 [AC_MSG_RESULT([yes]); HARDENING_CFLAGS="$HARDENING_CFLAGS -grecord-gcc-switches"],
7459 [AC_MSG_RESULT([no])])
7462 AC_MSG_CHECKING([whether $CC_BASE supports -D_FORTIFY_SOURCE=2])
7464 CFLAGS="$CFLAGS -Werror -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2"
7465 if test "$ENABLE_OPTIMIZED" = TRUE; then
7466 CFLAGS="$CFLAGS -O2"
7469 [AC_LANG_PROGRAM([[#include <string.h>]], [[return 0;]])],
7470 [AC_MSG_RESULT([yes]); HARDENING_OPT_CFLAGS="$HARDENING_OPT_CFLAGS -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2"],
7471 [AC_MSG_RESULT([no])])
7474 AC_MSG_CHECKING([whether $CC_BASE supports -D_GLIBCXX_ASSERTIONS])
7476 CFLAGS="$CFLAGS -Werror -Wp,-D_GLIBCXX_ASSERTIONS"
7478 [AC_LANG_PROGRAM(, [[return 0;]])],
7479 [AC_MSG_RESULT([yes]); HARDENING_CFLAGS="$HARDENING_CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"],
7480 [AC_MSG_RESULT([no])])
7483 AC_MSG_CHECKING([whether $CC_BASE supports -fstack-clash-protection])
7485 CFLAGS="$CFLAGS -Werror -fstack-clash-protection"
7487 [AC_LANG_PROGRAM(, [[return 0;]])],
7488 [AC_MSG_RESULT([yes]); HAVE_GCC_STACK_CLASH_PROTECTION=TRUE; HARDENING_CFLAGS="$HARDENING_CFLAGS -fstack-clash-protection"],
7489 [AC_MSG_RESULT([no])])
7492 AC_MSG_CHECKING([whether $CC_BASE supports -fcf-protection])
7494 CFLAGS="$CFLAGS -Werror -fcf-protection"
7496 [AC_LANG_PROGRAM(, [[return 0;]])],
7497 [AC_MSG_RESULT([yes]); HARDENING_CFLAGS="$HARDENING_CFLAGS -fcf-protection"],
7498 [AC_MSG_RESULT([no])])
7501 AC_MSG_CHECKING([whether $CC_BASE supports -mno-avx])
7503 CFLAGS="$CFLAGS -Werror -mno-avx"
7504 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
7506 if test "$HAVE_GCC_AVX" = "TRUE"; then
7507 AC_MSG_RESULT([yes])
7512 AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
7513 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
7515 if (__sync_add_and_fetch(&v, 1) != 1 ||
7516 __sync_sub_and_fetch(&v, 1) != 0)
7518 __sync_synchronize();
7519 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
7523 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
7524 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
7525 AC_MSG_RESULT([yes])
7526 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
7531 AC_MSG_CHECKING([whether $CXX_BASE defines __base_class_type_info in cxxabi.h])
7533 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7536 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
7538 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
7539 AC_MSG_RESULT([yes])
7540 ], [AC_MSG_RESULT([no])])
7543 AC_MSG_CHECKING([whether $CXX_BASE defines __class_type_info in cxxabi.h])
7545 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7548 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
7550 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
7551 AC_MSG_RESULT([yes])
7552 ], [AC_MSG_RESULT([no])])
7555 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_allocate_exception in cxxabi.h])
7557 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7559 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
7561 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
7562 AC_MSG_RESULT([yes])
7563 ], [AC_MSG_RESULT([no])])
7566 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_eh_globals in cxxabi.h])
7568 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7571 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
7573 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
7574 AC_MSG_RESULT([yes])
7575 ], [AC_MSG_RESULT([no])])
7578 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exception in cxxabi.h])
7580 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7583 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exception); }
7585 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTION],[1])
7586 AC_MSG_RESULT([yes])
7587 ], [AC_MSG_RESULT([no])])
7590 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_get_globals in cxxabi.h])
7592 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7594 void * f() { return __cxxabiv1::__cxa_get_globals(); }
7596 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
7597 AC_MSG_RESULT([yes])
7598 ], [AC_MSG_RESULT([no])])
7601 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_current_exception_type in cxxabi.h])
7603 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7605 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
7607 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
7608 AC_MSG_RESULT([yes])
7609 ], [AC_MSG_RESULT([no])])
7612 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_throw in cxxabi.h])
7614 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7616 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
7618 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
7619 AC_MSG_RESULT([yes])
7620 ], [AC_MSG_RESULT([no])])
7623 AC_MSG_CHECKING([whether $CXX_BASE defines __si_class_type_info in cxxabi.h])
7625 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7628 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
7630 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
7631 AC_MSG_RESULT([yes])
7632 ], [AC_MSG_RESULT([no])])
7635 AC_MSG_CHECKING([whether $CXX_BASE defines __vmi_class_type_info in cxxabi.h])
7637 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7640 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
7642 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
7643 AC_MSG_RESULT([yes])
7644 ], [AC_MSG_RESULT([no])])
7648 AC_SUBST(HAVE_GCC_AVX)
7649 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
7650 AC_SUBST(HAVE_GCC_STACK_CLASH_PROTECTION)
7651 AC_SUBST(HARDENING_CFLAGS)
7652 AC_SUBST(HARDENING_OPT_CFLAGS)
7654 dnl ===================================================================
7655 dnl Identify the C++ library
7656 dnl ===================================================================
7658 AC_MSG_CHECKING([what the C++ library is])
7662 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7668 [CPP_LIBRARY=GLIBCXX
7669 cpp_library_name="GNU libstdc++"
7672 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7674 #ifndef _LIBCPP_VERSION
7679 cpp_library_name="LLVM libc++"
7680 AC_DEFINE([HAVE_LIBCPP])
7683 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7690 cpp_library_name="Microsoft"
7692 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
7693 AC_MSG_RESULT([$cpp_library_name])
7695 AC_SUBST([HAVE_LIBSTDCPP])
7696 AC_SUBST([HAVE_LIBCPP])
7698 if test -z "${LIBCPP_DEBUG+x}" -a -z "$CROSS_COMPILING" -a -n "$HAVE_LIBCPP" -a -n "$ENABLE_DBGUTIL"
7700 # Libc++ has two levels of debug mode, assertions mode enabled with -D_LIBCPP_DEBUG=0,
7701 # and actual debug mode enabled with -D_LIBCPP_DEBUG=1 (and starting with LLVM15
7702 # assertions mode will be separate and controlled by -D_LIBCPP_ENABLE_ASSERTIONS=1,
7703 # although there will be backwards compatibility).
7704 # Debug mode is supported by libc++ only if built for it, e.g. Mac libc++ isn't,
7705 # and there would be undefined references to debug functions.
7706 # Moreover std::to_string() has a bug (https://reviews.llvm.org/D125184).
7707 # So check if debug mode can be used and disable or downgrade it to assertions
7709 AC_MSG_CHECKING([if libc++ has a usable debug mode])
7712 AC_LINK_IFELSE([AC_LANG_SOURCE([[
7713 #define _LIBCPP_DEBUG 0 // only assertions
7721 ]])], [libcpp_debug_links=1])
7722 if test -n "$libcpp_debug_links"; then
7723 # we can use at least assertions, check if debug mode works
7724 AC_RUN_IFELSE([AC_LANG_SOURCE([[
7725 #define _LIBCPP_DEBUG 1 // debug mode
7728 int foo(const std::vector<int>& v) { return *v.begin(); }
7733 std::string s = "xxxxxxxxxxxxxxxxxxxxxxxxx" + std::to_string(10);
7734 return (foo(v) + s.size()) != 0 ? 0 : 1;
7738 LIBCPP_DEBUG=-D_LIBCPP_DEBUG=1
7740 [AC_MSG_RESULT(no, using only assertions)
7741 LIBCPP_DEBUG=-D_LIBCPP_DEBUG=0
7749 AC_SUBST([LIBCPP_DEBUG])
7751 dnl ===================================================================
7753 dnl ===================================================================
7754 AC_PATH_PROG(GPERF, gperf)
7755 if test -z "$GPERF"; then
7756 AC_MSG_ERROR([gperf not found but needed. Install it.])
7758 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
7759 GPERF=`cygpath -m $GPERF`
7761 AC_MSG_CHECKING([whether gperf is new enough])
7762 my_gperf_ver1=$($GPERF --version | head -n 1)
7763 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
7764 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
7765 if test "$my_gperf_ver3" -ge 301; then
7766 AC_MSG_RESULT([yes ($my_gperf_ver2)])
7768 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
7772 dnl ===================================================================
7773 dnl Check for system libcmis
7774 dnl ===================================================================
7775 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.6 >= 0.6.1],enabled)
7777 dnl ===================================================================
7779 dnl ===================================================================
7781 if test -z "${CXXFLAGS_CXX11+x}"; then
7782 AC_MSG_CHECKING([whether $CXX_BASE supports C++20])
7783 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
7784 if test "$with_latest_c__" = yes; then
7785 CXXFLAGS_CXX11=-std:c++latest
7787 CXXFLAGS_CXX11=-std:c++20
7789 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -permissive- -Zc:__cplusplus,preprocessor"
7790 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
7791 my_flags='-std=c++20 -std=c++2a'
7792 if test "$with_latest_c__" = yes; then
7793 my_flags="-std=c++26 -std=c++2c -std=c++23 -std=c++2b $my_flags"
7795 for flag in $my_flags; do
7796 if test "$COM" = MSC; then
7797 flag="-Xclang $flag"
7799 save_CXXFLAGS=$CXXFLAGS
7800 CXXFLAGS="$CXXFLAGS $flag -Werror"
7802 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7803 #include <algorithm>
7804 #include <functional>
7807 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
7808 std::sort(v.begin(), v.end(), fn);
7810 ]])],[CXXFLAGS_CXX11=$flag])
7812 CXXFLAGS=$save_CXXFLAGS
7813 if test -n "$CXXFLAGS_CXX11"; then
7818 if test -n "$CXXFLAGS_CXX11"; then
7819 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
7824 AC_SUBST(CXXFLAGS_CXX11)
7826 if test "$GCC" = "yes"; then
7827 save_CXXFLAGS=$CXXFLAGS
7828 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7830 CXXFLAGS=$save_CXXFLAGS
7831 AC_SUBST(ATOMIC_LIB)
7834 AC_MSG_CHECKING([whether $CXX_BASE supports C++11 without Language Defect 757])
7835 save_CXXFLAGS=$CXXFLAGS
7836 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7839 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
7842 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
7858 a thinga[]={{0,0}, {1,1}};
7859 b thingb[]={{0,0}, {1,1}};
7860 size_t i = sizeof(sal_n_array_size(thinga));
7861 size_t j = sizeof(sal_n_array_size(thingb));
7862 return !(i != 0 && j != 0);
7864 ], [ AC_MSG_RESULT(yes) ],
7865 [ AC_MSG_ERROR(no)])
7867 CXXFLAGS=$save_CXXFLAGS
7869 HAVE_GCC_FNO_SIZED_DEALLOCATION=
7870 if test "$GCC" = yes; then
7871 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
7873 save_CXXFLAGS=$CXXFLAGS
7874 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
7875 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
7876 CXXFLAGS=$save_CXXFLAGS
7878 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
7879 AC_MSG_RESULT([yes])
7884 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
7886 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a constinit sorted vectors])
7888 save_CXXFLAGS=$CXXFLAGS
7889 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7890 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7891 #include <algorithm>
7892 #include <initializer_list>
7894 template<typename T> class S {
7898 constexpr S(std::initializer_list<T> i): v_(i) { std::sort(v_.begin(), v_.end()); }
7900 constinit S<int> s{3, 2, 1};
7902 AC_DEFINE([HAVE_CPP_CONSTINIT_SORTED_VECTOR],[1])
7903 AC_MSG_RESULT([yes])
7904 ], [AC_MSG_RESULT([no])])
7905 CXXFLAGS=$save_CXXFLAGS
7908 AC_MSG_CHECKING([whether $CXX_BASE implements C++ DR P1155R3])
7910 save_CXXFLAGS=$CXXFLAGS
7911 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7912 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7913 struct S1 { S1(S1 &&); };
7915 S1 f(S2 s) { return s; }
7917 AC_DEFINE([HAVE_P1155R3],[1])
7918 AC_MSG_RESULT([yes])
7919 ], [AC_MSG_RESULT([no])])
7920 CXXFLAGS=$save_CXXFLAGS
7923 AC_MSG_CHECKING([whether $CXX_BASE supports C++20 std::atomic_ref])
7924 HAVE_CXX20_ATOMIC_REF=
7926 save_CXXFLAGS=$CXXFLAGS
7927 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
7928 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
7931 std::atomic_ref<int> y(x);
7933 HAVE_CXX20_ATOMIC_REF=TRUE
7934 AC_MSG_RESULT([yes])
7935 ], [AC_MSG_RESULT([no])])
7936 CXXFLAGS=$save_CXXFLAGS
7938 AC_SUBST([HAVE_CXX20_ATOMIC_REF])
7940 dnl Supported since GCC 9 and Clang 10 (which each also started to support -Wdeprecated-copy, but
7941 dnl which is included in -Wextra anyway):
7942 HAVE_WDEPRECATED_COPY_DTOR=
7943 if test "$GCC" = yes; then
7944 AC_MSG_CHECKING([whether $CXX_BASE supports -Wdeprecated-copy-dtor])
7946 save_CXXFLAGS=$CXXFLAGS
7947 CXXFLAGS="$CXXFLAGS -Werror -Wdeprecated-copy-dtor"
7948 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
7949 HAVE_WDEPRECATED_COPY_DTOR=TRUE
7950 AC_MSG_RESULT([yes])
7951 ], [AC_MSG_RESULT([no])])
7952 CXXFLAGS=$save_CXXFLAGS
7955 AC_SUBST([HAVE_WDEPRECATED_COPY_DTOR])
7957 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
7958 dnl uninitialized warning for code like
7961 dnl boost::optional<OString> * g(bool b) {
7962 dnl boost::optional<OString> o;
7964 dnl return new boost::optional<OString>(o);
7967 dnl (as is e.g. present, in a slightly more elaborate form, in
7968 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
7969 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
7970 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
7971 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
7972 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=maybe-uninitialized])
7974 save_CXXFLAGS=$CXXFLAGS
7975 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
7976 if test "$ENABLE_OPTIMIZED" = TRUE; then
7977 CXXFLAGS="$CXXFLAGS -O2"
7979 CXXFLAGS="$CXXFLAGS -O0"
7981 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
7990 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
7991 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
7997 char stg[sizeof (S1)];
8005 ]])], [AC_MSG_RESULT([no])], [
8006 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
8007 AC_MSG_RESULT([yes])
8009 CXXFLAGS=$save_CXXFLAGS
8012 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
8014 dnl Check for <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87296#c5> "[8/9/10/11 Regression]
8015 dnl -Wstringop-overflow false positive due to using MEM_REF type of &MEM" (fixed in GCC 11), which
8016 dnl hits us e.g. with GCC 10 and --enable-optimized at
8018 dnl In file included from include/rtl/string.hxx:49,
8019 dnl from include/rtl/ustring.hxx:43,
8020 dnl from include/osl/file.hxx:35,
8021 dnl from include/codemaker/global.hxx:28,
8022 dnl from include/codemaker/options.hxx:23,
8023 dnl from codemaker/source/commoncpp/commoncpp.cxx:24:
8024 dnl In function ‘char* rtl::addDataHelper(char*, const char*, std::size_t)’,
8025 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,
8026 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,
8027 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,
8028 dnl inlined from ‘rtl::OString codemaker::cpp::scopedCppName(const rtl::OString&, bool)’ at codemaker/source/commoncpp/commoncpp.cxx:53:55:
8029 dnl include/rtl/stringconcat.hxx:78:15: error: writing 2 bytes into a region of size 1 [-Werror=stringop-overflow=]
8030 dnl 78 | memcpy( buffer, data, length );
8031 dnl | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
8032 HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=
8033 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
8034 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=stringop-overflow=])
8036 save_CXXFLAGS=$CXXFLAGS
8037 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wstringop-overflow"
8038 if test "$ENABLE_OPTIMIZED" = TRUE; then
8039 CXXFLAGS="$CXXFLAGS -O2"
8041 CXXFLAGS="$CXXFLAGS -O0"
8043 dnl Test code taken from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87296#c0>:
8044 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
8045 void fill(char const * begin, char const * end, char c);
8051 fill(c.ids, c.ids + sizeof(c.ids), '\0');
8052 __builtin_strncpy(c.username, "root", sizeof(c.username));
8054 ]])], [AC_MSG_RESULT([no])], [
8055 HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW=TRUE
8056 AC_MSG_RESULT([yes])
8058 CXXFLAGS=$save_CXXFLAGS
8061 AC_SUBST([HAVE_BROKEN_GCC_WSTRINGOP_OVERFLOW])
8063 HAVE_DLLEXPORTINLINES=
8064 if test "$_os" = "WINNT"; then
8065 AC_MSG_CHECKING([whether $CXX_BASE supports -Zc:dllexportInlines-])
8067 save_CXXFLAGS=$CXXFLAGS
8068 CXXFLAGS="$CXXFLAGS -Werror -Zc:dllexportInlines-"
8069 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
8070 HAVE_DLLEXPORTINLINES=TRUE
8071 AC_MSG_RESULT([yes])
8072 ], [AC_MSG_RESULT([no])])
8073 CXXFLAGS=$save_CXXFLAGS
8076 AC_SUBST([HAVE_DLLEXPORTINLINES])
8078 dnl ===================================================================
8079 dnl CPU Intrinsics support - SSE, AVX
8080 dnl ===================================================================
8082 CXXFLAGS_INTRINSICS_SSE2=
8083 CXXFLAGS_INTRINSICS_SSSE3=
8084 CXXFLAGS_INTRINSICS_SSE41=
8085 CXXFLAGS_INTRINSICS_SSE42=
8086 CXXFLAGS_INTRINSICS_AVX=
8087 CXXFLAGS_INTRINSICS_AVX2=
8088 CXXFLAGS_INTRINSICS_AVX512=
8089 CXXFLAGS_INTRINSICS_AVX512F=
8090 CXXFLAGS_INTRINSICS_F16C=
8091 CXXFLAGS_INTRINSICS_FMA=
8093 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
8094 # GCC, Clang or Clang-cl (clang-cl + MSVC's -arch options don't work well together)
8101 flag_avx512="-mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd"
8102 flag_avx512f=-mavx512f
8106 # With MSVC using -arch is in fact not necessary for being able
8107 # to use CPU intrinsics, code using AVX512F intrinsics will compile
8108 # even if compiled with -arch:AVX, the -arch option really only affects
8109 # instructions generated for C/C++ code.
8110 # So use the matching same (or lower) -arch options, but only in order
8111 # to generate the best matching instructions for the C++ code surrounding
8113 # SSE2 is the default for x86/x64, so no need to specify the option.
8115 # No specific options for these, use the next lower.
8116 flag_ssse3="$flag_sse2"
8117 flag_sse41="$flag_sse2"
8118 flag_sse42="$flag_sse2"
8120 flag_avx2=-arch:AVX2
8121 flag_avx512=-arch:AVX512
8122 # Using -arch:AVX512 would enable more than just AVX512F, so use only AVX2.
8123 flag_avx512f=-arch:AVX2
8124 # No MSVC options for these.
8125 flag_f16c="$flag_sse2"
8126 flag_fma="$flag_sse2"
8129 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
8131 save_CXXFLAGS=$CXXFLAGS
8132 CXXFLAGS="$CXXFLAGS $flag_sse2"
8133 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8134 #include <emmintrin.h>
8136 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8137 c = _mm_xor_si128 (a, b);
8141 [can_compile_sse2=yes],
8142 [can_compile_sse2=no])
8144 CXXFLAGS=$save_CXXFLAGS
8145 AC_MSG_RESULT([${can_compile_sse2}])
8146 if test "${can_compile_sse2}" = "yes" ; then
8147 CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
8150 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
8152 save_CXXFLAGS=$CXXFLAGS
8153 CXXFLAGS="$CXXFLAGS $flag_ssse3"
8154 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8155 #include <tmmintrin.h>
8157 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8158 c = _mm_maddubs_epi16 (a, b);
8162 [can_compile_ssse3=yes],
8163 [can_compile_ssse3=no])
8165 CXXFLAGS=$save_CXXFLAGS
8166 AC_MSG_RESULT([${can_compile_ssse3}])
8167 if test "${can_compile_ssse3}" = "yes" ; then
8168 CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
8171 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
8173 save_CXXFLAGS=$CXXFLAGS
8174 CXXFLAGS="$CXXFLAGS $flag_sse41"
8175 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8176 #include <smmintrin.h>
8178 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8179 c = _mm_cmpeq_epi64 (a, b);
8183 [can_compile_sse41=yes],
8184 [can_compile_sse41=no])
8186 CXXFLAGS=$save_CXXFLAGS
8187 AC_MSG_RESULT([${can_compile_sse41}])
8188 if test "${can_compile_sse41}" = "yes" ; then
8189 CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
8192 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
8194 save_CXXFLAGS=$CXXFLAGS
8195 CXXFLAGS="$CXXFLAGS $flag_sse42"
8196 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8197 #include <nmmintrin.h>
8199 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
8200 c = _mm_cmpgt_epi64 (a, b);
8204 [can_compile_sse42=yes],
8205 [can_compile_sse42=no])
8207 CXXFLAGS=$save_CXXFLAGS
8208 AC_MSG_RESULT([${can_compile_sse42}])
8209 if test "${can_compile_sse42}" = "yes" ; then
8210 CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
8213 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
8215 save_CXXFLAGS=$CXXFLAGS
8216 CXXFLAGS="$CXXFLAGS $flag_avx"
8217 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8218 #include <immintrin.h>
8220 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
8221 c = _mm256_xor_ps(a, b);
8225 [can_compile_avx=yes],
8226 [can_compile_avx=no])
8228 CXXFLAGS=$save_CXXFLAGS
8229 AC_MSG_RESULT([${can_compile_avx}])
8230 if test "${can_compile_avx}" = "yes" ; then
8231 CXXFLAGS_INTRINSICS_AVX="$flag_avx"
8234 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
8236 save_CXXFLAGS=$CXXFLAGS
8237 CXXFLAGS="$CXXFLAGS $flag_avx2"
8238 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8239 #include <immintrin.h>
8241 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
8242 c = _mm256_maddubs_epi16(a, b);
8246 [can_compile_avx2=yes],
8247 [can_compile_avx2=no])
8249 CXXFLAGS=$save_CXXFLAGS
8250 AC_MSG_RESULT([${can_compile_avx2}])
8251 if test "${can_compile_avx2}" = "yes" ; then
8252 CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
8255 AC_MSG_CHECKING([whether $CXX can compile AVX512 intrinsics])
8257 save_CXXFLAGS=$CXXFLAGS
8258 CXXFLAGS="$CXXFLAGS $flag_avx512"
8259 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8260 #include <immintrin.h>
8262 __m512i a = _mm512_loadu_si512(0);
8263 __m512d v1 = _mm512_load_pd(0);
8264 // https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=gcc/config/i386/avx512fintrin.h;h=23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2
8265 __m512d v2 = _mm512_abs_pd(v1);
8269 [can_compile_avx512=yes],
8270 [can_compile_avx512=no])
8272 CXXFLAGS=$save_CXXFLAGS
8273 AC_MSG_RESULT([${can_compile_avx512}])
8274 if test "${can_compile_avx512}" = "yes" ; then
8275 CXXFLAGS_INTRINSICS_AVX512="$flag_avx512"
8276 CXXFLAGS_INTRINSICS_AVX512F="$flag_avx512f"
8279 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
8281 save_CXXFLAGS=$CXXFLAGS
8282 CXXFLAGS="$CXXFLAGS $flag_f16c"
8283 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8284 #include <immintrin.h>
8286 __m128i a = _mm_set1_epi32 (0);
8288 c = _mm_cvtph_ps(a);
8292 [can_compile_f16c=yes],
8293 [can_compile_f16c=no])
8295 CXXFLAGS=$save_CXXFLAGS
8296 AC_MSG_RESULT([${can_compile_f16c}])
8297 if test "${can_compile_f16c}" = "yes" ; then
8298 CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
8301 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
8303 save_CXXFLAGS=$CXXFLAGS
8304 CXXFLAGS="$CXXFLAGS $flag_fma"
8305 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
8306 #include <immintrin.h>
8308 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
8309 d = _mm256_fmadd_ps(a, b, c);
8313 [can_compile_fma=yes],
8314 [can_compile_fma=no])
8316 CXXFLAGS=$save_CXXFLAGS
8317 AC_MSG_RESULT([${can_compile_fma}])
8318 if test "${can_compile_fma}" = "yes" ; then
8319 CXXFLAGS_INTRINSICS_FMA="$flag_fma"
8322 AC_SUBST([CXXFLAGS_INTRINSICS_SSE2])
8323 AC_SUBST([CXXFLAGS_INTRINSICS_SSSE3])
8324 AC_SUBST([CXXFLAGS_INTRINSICS_SSE41])
8325 AC_SUBST([CXXFLAGS_INTRINSICS_SSE42])
8326 AC_SUBST([CXXFLAGS_INTRINSICS_AVX])
8327 AC_SUBST([CXXFLAGS_INTRINSICS_AVX2])
8328 AC_SUBST([CXXFLAGS_INTRINSICS_AVX512])
8329 AC_SUBST([CXXFLAGS_INTRINSICS_AVX512F])
8330 AC_SUBST([CXXFLAGS_INTRINSICS_F16C])
8331 AC_SUBST([CXXFLAGS_INTRINSICS_FMA])
8333 dnl ===================================================================
8334 dnl system stl sanity tests
8335 dnl ===================================================================
8336 if test "$_os" != "WINNT"; then
8340 save_CPPFLAGS="$CPPFLAGS"
8341 if test -n "$MACOSX_SDK_PATH"; then
8342 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
8345 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
8347 if test "$CPP_LIBRARY" = GLIBCXX; then
8348 dnl gcc#19664, gcc#22482, rhbz#162935
8349 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
8350 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
8351 AC_MSG_RESULT([$stlvisok])
8352 if test "$stlvisok" = "no"; then
8353 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
8357 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
8358 # when we don't make any dynamic libraries?
8359 if test "$DISABLE_DYNLOADING" = ""; then
8360 AC_MSG_CHECKING([if $CXX_BASE is -fvisibility-inlines-hidden safe (Clang bug 11250)])
8361 cat > conftestlib1.cc <<_ACEOF
8362 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
8363 struct S2: S1<int> { virtual ~S2(); };
8366 cat > conftestlib2.cc <<_ACEOF
8367 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
8368 struct S2: S1<int> { virtual ~S2(); };
8369 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
8371 gccvisinlineshiddenok=yes
8372 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
8373 gccvisinlineshiddenok=no
8375 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
8376 dnl known to not work with -z defs (unsetting which makes the test
8378 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
8379 if test "$COM_IS_CLANG" = TRUE; then
8380 for i in $CXX $CXXFLAGS; do
8383 my_linkflagsnoundefs=
8389 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
8390 gccvisinlineshiddenok=no
8395 AC_MSG_RESULT([$gccvisinlineshiddenok])
8396 if test "$gccvisinlineshiddenok" = "no"; then
8397 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
8401 AC_MSG_CHECKING([if $CXX_BASE has a visibility bug with class-level attributes (GCC bug 26905)])
8402 cat >visibility.cxx <<_ACEOF
8403 #pragma GCC visibility push(hidden)
8404 struct __attribute__ ((visibility ("default"))) TestStruct {
8407 __attribute__ ((visibility ("default"))) void TestFunc() {
8411 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
8416 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
8419 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
8431 rm -f visibility.s visibility.cxx
8433 AC_MSG_RESULT([$gccvisbroken])
8434 if test "$gccvisbroken" = "yes"; then
8435 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
8438 CPPFLAGS="$save_CPPFLAGS"
8440 AC_MSG_CHECKING([if CET endbranch is recognized])
8441 cat > endbr.s <<_ACEOF
8444 HAVE_ASM_END_BRANCH_INS_SUPPORT=
8445 if $CXX -c endbr.s -o endbr.o >/dev/null 2>&5; then
8446 AC_MSG_RESULT([yes])
8447 HAVE_ASM_END_BRANCH_INS_SUPPORT=TRUE
8451 rm -f endbr.s endbr.o
8452 AC_SUBST(HAVE_ASM_END_BRANCH_INS_SUPPORT)
8457 dnl ===================================================================
8459 dnl ===================================================================
8461 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
8462 if test "$GCC" = "yes"; then
8463 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-enforce-eh-specs])
8465 save_CXXFLAGS=$CXXFLAGS
8466 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
8467 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
8468 CXXFLAGS=$save_CXXFLAGS
8470 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
8471 AC_MSG_RESULT([yes])
8476 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
8478 dnl ===================================================================
8479 dnl Compiler plugins
8480 dnl ===================================================================
8483 # currently only Clang
8485 if test "$COM_IS_CLANG" != "TRUE"; then
8486 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
8487 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
8488 enable_compiler_plugins=no
8492 COMPILER_PLUGINS_COM_IS_CLANG=
8493 if test "$COM_IS_CLANG" = "TRUE"; then
8494 if test -n "$enable_compiler_plugins"; then
8495 compiler_plugins="$enable_compiler_plugins"
8496 elif test -n "$ENABLE_DBGUTIL"; then
8497 compiler_plugins=test
8501 if test "$compiler_plugins" != no -a "$my_apple_clang" != yes; then
8502 if test "$CLANGVER" -lt 120001; then
8503 if test "$compiler_plugins" = yes; then
8505 [Clang $CLANGVER is too old to build compiler plugins; need >= 12.0.1.])
8511 if test "$compiler_plugins" != "no"; then
8512 dnl The prefix where Clang resides, override to where Clang resides if
8513 dnl using a source build:
8514 if test -z "$CLANGDIR"; then
8515 CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $(printf '%s\n' $CXX | grep clang | head -n 1)))))
8517 # Assume Clang is self-built, but allow overriding COMPILER_PLUGINS_CXX to the compiler Clang was built with.
8518 if test -z "$COMPILER_PLUGINS_CXX"; then
8519 COMPILER_PLUGINS_CXX=[$(echo $CXX | sed -e 's/-fsanitize=[^ ]*//g')]
8521 clangbindir=$CLANGDIR/bin
8522 if test "$build_os" = "cygwin"; then
8523 clangbindir=$(cygpath -u "$clangbindir")
8525 AC_PATH_PROG(LLVM_CONFIG, llvm-config,[],"$clangbindir" $PATH)
8526 if test -n "$LLVM_CONFIG"; then
8527 COMPILER_PLUGINS_CXXFLAGS=$($LLVM_CONFIG --cxxflags)
8528 COMPILER_PLUGINS_LINKFLAGS=$($LLVM_CONFIG --ldflags --libs --system-libs | tr '\n' ' ')
8529 if test -z "$CLANGLIBDIR"; then
8530 CLANGLIBDIR=$($LLVM_CONFIG --libdir)
8532 # Try if clang is built from source (in which case its includes are not together with llvm includes).
8533 # src-root is [llvm-toplevel-src-dir]/llvm, clang is [llvm-toplevel-src-dir]/clang
8534 if $LLVM_CONFIG --src-root >/dev/null 2>&1; then
8535 clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
8536 if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d "$clangsrcdir/clang/include"; then
8537 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangsrcdir/clang/include"
8540 # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
8541 clangobjdir=$($LLVM_CONFIG --obj-root)
8542 if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
8543 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
8546 AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
8550 save_CPPFLAGS=$CPPFLAGS
8551 save_CXXFLAGS=$CXXFLAGS
8552 save_LDFLAGS=$LDFLAGS
8554 CXX=$COMPILER_PLUGINS_CXX
8555 CXXCPP="$COMPILER_PLUGINS_CXX -E"
8556 CPPFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
8557 CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
8558 AC_CHECK_HEADER(clang/Basic/SourceLocation.h,
8559 [COMPILER_PLUGINS=TRUE],
8561 if test "$compiler_plugins" = "yes"; then
8562 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
8564 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
8565 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
8568 dnl TODO: Windows doesn't use LO_CLANG_SHARED_PLUGINS for now, see corresponding TODO
8569 dnl comment in compilerplugins/Makefile-clang.mk:
8570 if test -n "$COMPILER_PLUGINS" && test "$_os" != "WINNT"; then
8572 AC_MSG_CHECKING([for clang libraries to use])
8573 if test -z "$CLANGTOOLLIBS"; then
8574 LIBS="-lclang-cpp $COMPILER_PLUGINS_LINKFLAGS"
8576 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
8577 [[ clang::FullSourceLoc().dump(); ]])
8578 ],[CLANGTOOLLIBS="$LIBS"],[])
8580 dnl If the above check for the combined -lclang-cpp failed, fall back to a hand-curated
8581 dnl list of individual -lclang* (but note that that list can become outdated over time,
8582 dnl see e.g. the since-reverted 5078591de9a0e65ca560a4f1913e90dfe95f66bf "CLANGTOOLLIBS
8583 dnl needs to include -lclangSupport now"):
8584 if test -z "$CLANGTOOLLIBS"; then
8585 LIBS="-lclangTooling -lclangFrontend -lclangDriver -lclangParse -lclangSema -lclangEdit \
8586 -lclangAnalysis -lclangAST -lclangLex -lclangSerialization -lclangBasic $COMPILER_PLUGINS_LINKFLAGS"
8588 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
8589 [[ clang::FullSourceLoc().dump(); ]])
8590 ],[CLANGTOOLLIBS="$LIBS"],[])
8592 AC_MSG_RESULT([$CLANGTOOLLIBS])
8593 if test -z "$CLANGTOOLLIBS"; then
8594 if test "$compiler_plugins" = "yes"; then
8595 AC_MSG_ERROR([Cannot find Clang libraries to build compiler plugins.])
8597 AC_MSG_WARN([Cannot find Clang libraries to build compiler plugins, plugins disabled])
8598 add_warning "Cannot find Clang libraries to build compiler plugins, plugins disabled."
8602 if test -n "$COMPILER_PLUGINS"; then
8603 if test -z "$CLANGSYSINCLUDE"; then
8604 if test -n "$LLVM_CONFIG"; then
8605 # Path to the clang system headers (no idea if there's a better way to get it).
8606 CLANGSYSINCLUDE=$($LLVM_CONFIG --libdir)/clang/$($LLVM_CONFIG --version | sed 's/git\|svn//')/include
8613 CPPFLAGS=$save_CPPFLAGS
8614 CXXFLAGS=$save_CXXFLAGS
8615 LDFLAGS=$save_LDFLAGS
8619 AC_MSG_CHECKING([whether the compiler for building compilerplugins is actually Clang])
8620 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
8626 [AC_MSG_RESULT([yes])
8627 COMPILER_PLUGINS_COM_IS_CLANG=TRUE],
8628 [AC_MSG_RESULT([no])])
8629 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
8632 if test "$enable_compiler_plugins" = "yes"; then
8633 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
8636 COMPILER_PLUGINS_ANALYZER_PCH=
8637 if test "$enable_compiler_plugins_analyzer_pch" != no; then
8638 COMPILER_PLUGINS_ANALYZER_PCH=TRUE
8640 AC_SUBST(COMPILER_PLUGINS)
8641 AC_SUBST(COMPILER_PLUGINS_ANALYZER_PCH)
8642 AC_SUBST(COMPILER_PLUGINS_COM_IS_CLANG)
8643 AC_SUBST(COMPILER_PLUGINS_CXX)
8644 AC_SUBST(COMPILER_PLUGINS_CXXFLAGS)
8645 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
8646 AC_SUBST(COMPILER_PLUGINS_DEBUG)
8647 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
8649 AC_SUBST(CLANGLIBDIR)
8650 AC_SUBST(CLANGTOOLLIBS)
8651 AC_SUBST(CLANGSYSINCLUDE)
8653 # Plugin to help linker.
8654 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
8655 # This makes --enable-lto build with clang work.
8658 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
8659 AC_SUBST(HAVE_POSIX_FALLOCATE)
8661 JITC_PROCESSOR_TYPE=""
8662 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
8663 # IBMs JDK needs this...
8664 JITC_PROCESSOR_TYPE=6
8665 export JITC_PROCESSOR_TYPE
8667 AC_SUBST([JITC_PROCESSOR_TYPE])
8669 # Misc Windows Stuff
8670 AC_ARG_WITH(ucrt-dir,
8671 AS_HELP_STRING([--with-ucrt-dir],
8672 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
8673 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
8674 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
8675 Windows6.1-KB2999226-x64.msu
8676 Windows6.1-KB2999226-x86.msu
8677 Windows8.1-KB2999226-x64.msu
8678 Windows8.1-KB2999226-x86.msu
8679 Windows8-RT-KB2999226-x64.msu
8680 Windows8-RT-KB2999226-x86.msu
8681 A zip archive including those files is available from Microsoft site:
8682 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
8685 UCRT_REDISTDIR="$with_ucrt_dir"
8686 if test $_os = "WINNT"; then
8688 MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
8689 MSVC_DLLS="$msvcdlls"
8690 if echo "$msvcdllpath" | grep -q "VC143.CRT$"; then
8692 elif echo "$msvcdllpath" | grep -q "VC142.CRT$"; then
8694 elif echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
8697 for i in $PKGFORMAT; do
8698 if test "$i" = msi; then
8699 find_msms "$with_redist"
8700 if test -n "$msmdir"; then
8701 MSM_PATH=`win_short_path_for_make "$msmdir"`
8702 SCPDEFS="$SCPDEFS -DWITH_VC_REDIST=$with_redist"
8708 if test "$UCRT_REDISTDIR" = "no"; then
8709 dnl explicitly disabled
8712 PathFormat "$UCRT_REDISTDIR"
8713 UCRT_REDISTDIR="$formatted_path"
8714 UCRT_REDISTDIR_unix="$formatted_path_unix"
8715 if ! test -f "$UCRT_REDISTDIR_unix/Windows6.1-KB2999226-x64.msu" -a \
8716 -f "$UCRT_REDISTDIR_unix/Windows6.1-KB2999226-x86.msu" -a \
8717 -f "$UCRT_REDISTDIR_unix/Windows8.1-KB2999226-x64.msu" -a \
8718 -f "$UCRT_REDISTDIR_unix/Windows8.1-KB2999226-x86.msu" -a \
8719 -f "$UCRT_REDISTDIR_unix/Windows8-RT-KB2999226-x64.msu" -a \
8720 -f "$UCRT_REDISTDIR_unix/Windows8-RT-KB2999226-x86.msu"; then
8722 if test -n "$PKGFORMAT"; then
8723 for i in $PKGFORMAT; do
8726 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
8727 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
8736 AC_SUBST(UCRT_REDISTDIR)
8737 AC_SUBST(MSVC_DLL_PATH)
8742 dnl ===================================================================
8744 dnl ===================================================================
8745 if test "$ENABLE_JAVA" != ""; then
8747 # Windows-specific tests
8748 if test "$build_os" = "cygwin" -o -n "$WSL_ONLY_AS_HELPER"; then
8749 if test -z "$with_jdk_home"; then
8750 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
8751 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
8752 reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK" "CurrentVersion"
8753 if test -n "$regvalue"; then
8755 reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver" "JavaHome"
8756 with_jdk_home=$regvalue
8758 howfound="found automatically"
8760 howfound="you passed"
8762 PathFormat "$with_jdk_home"
8763 with_jdk_home="$formatted_path_unix"
8765 if ! test -f "$with_jdk_home/lib/jvm.lib" -a -f "$with_jdk_home/bin/java.exe"; then
8766 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])
8768 with_java="java.exe"
8769 javacompiler="javac.exe"
8770 javadoc="javadoc.exe"
8773 # 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.
8774 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
8775 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
8776 with_jdk_home=`/usr/libexec/java_home`
8779 JAVA_HOME=; export JAVA_HOME
8780 if test -z "$with_jdk_home"; then
8781 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
8783 _java_path="$with_jdk_home/bin/$with_java"
8784 dnl Check if there is a Java interpreter at all.
8785 if test -x "$_java_path"; then
8786 JAVAINTERPRETER=$_java_path
8788 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
8792 dnl Check that the JDK found is correct architecture (at least 2 reasons to
8793 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
8794 dnl loaded by java to run JunitTests:
8795 if test "$build_os" = "cygwin" -a "$cross_compiling" != "yes"; then
8796 shortjdkhome=`cygpath -d "$with_jdk_home"`
8797 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
8798 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
8799 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
8800 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
8801 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
8802 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
8805 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
8806 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
8808 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
8809 elif test "$cross_compiling" != "yes"; then
8811 AARCH64|AXP|X86_64|IA64|POWERPC64|S390X|SPARC64|MIPS64|RISCV64|LOONGARCH64)
8812 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
8813 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
8814 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
8817 *) # assumption: everything else 32-bit
8818 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
8819 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
8820 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
8827 dnl ===================================================================
8829 dnl ===================================================================
8831 # Whether all the complexity here actually is needed any more or not, no idea.
8833 JDK_SECURITYMANAGER_DISALLOWED=
8835 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8837 AC_MSG_CHECKING([the installed JDK])
8838 if test -n "$JAVAINTERPRETER"; then
8839 dnl java -version sends output to stderr!
8840 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
8841 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8842 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
8843 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8844 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
8845 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8846 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
8847 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
8851 dnl Sun JDK specific tests
8852 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
8853 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
8855 if test "$_jdk_ver" -lt 10800; then
8856 AC_MSG_ERROR([JDK is too old, you need at least 8 ($_jdk_ver < 10800)])
8858 dnl TODO: Presumably, the Security Manager will not merely be disallowed, but be
8859 dnl completely removed in some Java version > 18 (see
8860 dnl <https://openjdk.java.net/jeps/411> "Deprecate the Security Manager for Removal"):
8861 if test "$_jdk_ver" -ge 180000; then
8862 JDK_SECURITYMANAGER_DISALLOWED=TRUE
8865 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
8866 if test "$_os" = "WINNT"; then
8867 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
8869 AC_MSG_RESULT([found $JAVA_HOME (JDK $_jdk)])
8871 dnl Check whether the build Java supports modules
8872 if test "$_jdk_ver" -ge 90000; then
8875 AC_MSG_WARN([Modular jars will not be built. They need at least Java 9 ($_jdk_ver < 90000)])
8876 add_warning "Modular jars will not be built. They need at least Java 9 ($_jdk_ver < 90000)"
8879 # set to limit VM usage for JunitTests
8881 # set to limit VM usage for javac
8882 JAVACFLAGS=-J-Xmx128M
8885 AC_MSG_ERROR([Java not found. You need at least JDK 8])
8888 if test -z "$ENABLE_JAVA"; then
8892 elif test "$cross_compiling" = "yes"; then
8893 # Just assume compatibility of build and host JDK
8895 JAVAIFLAGS=$JAVAIFLAGS_FOR_BUILD
8899 dnl ===================================================================
8900 dnl Checks for javac
8901 dnl ===================================================================
8902 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8903 : ${JAVA_SOURCE_VER=8}
8904 : ${JAVA_TARGET_VER=8}
8905 if test -z "$with_jdk_home"; then
8906 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
8908 _javac_path="$with_jdk_home/bin/$javacompiler"
8909 dnl Check if there is a Java compiler at all.
8910 if test -x "$_javac_path"; then
8911 JAVACOMPILER=$_javac_path
8914 if test -z "$JAVACOMPILER"; then
8915 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
8917 if test "$build_os" = "cygwin"; then
8918 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
8919 JAVACOMPILER="${JAVACOMPILER}.exe"
8921 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
8925 dnl ===================================================================
8926 dnl Checks for javadoc
8927 dnl ===================================================================
8928 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
8929 if test -z "$with_jdk_home"; then
8930 AC_PATH_PROG(JAVADOC, $javadoc)
8932 _javadoc_path="$with_jdk_home/bin/$javadoc"
8933 dnl Check if there is a javadoc at all.
8934 if test -x "$_javadoc_path"; then
8935 JAVADOC=$_javadoc_path
8937 AC_PATH_PROG(JAVADOC, $javadoc)
8940 if test -z "$JAVADOC"; then
8941 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
8943 if test "$build_os" = "cygwin"; then
8944 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
8945 JAVADOC="${JAVADOC}.exe"
8947 JAVADOC=`win_short_path_for_make "$JAVADOC"`
8950 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
8951 JAVADOCISGJDOC="yes"
8955 AC_SUBST(JAVADOCISGJDOC)
8957 if test "$ENABLE_JAVA" != "" -a \( "$cross_compiling" != "yes" -o -n "$with_jdk_home" \); then
8958 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
8959 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
8960 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
8961 # try to recover first by looking whether we have an alternative
8962 # system as in Debian or newer SuSEs where following /usr/bin/javac
8963 # over /etc/alternatives/javac leads to the right bindir where we
8964 # just need to strip a bit away to get a valid JAVA_HOME
8965 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
8966 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
8967 # maybe only one level of symlink (e.g. on Mac)
8968 JAVA_HOME=$(readlink $JAVACOMPILER)
8969 if test "$(dirname $JAVA_HOME)" = "."; then
8970 # we've got no path to trim back
8975 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
8976 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
8977 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
8978 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
8980 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it...
8981 if test "$JAVA_HOME" != "/usr"; then
8982 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
8983 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
8984 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
8985 dnl Tiger already returns a JDK path...
8986 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
8988 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
8989 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
8990 dnl that checks which version to run
8991 if test -f "$JAVA_HOME"; then
8992 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
8997 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
8999 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
9000 if test -z "$JAVA_HOME"; then
9001 if test "x$with_jdk_home" = "x"; then
9002 cat > findhome.java <<_ACEOF
9003 [import java.io.File;
9007 public static void main(String args[])
9009 String jrelocation = System.getProperty("java.home");
9010 File jre = new File(jrelocation);
9011 System.out.println(jre.getParent());
9015 AC_MSG_CHECKING([if javac works])
9016 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
9017 AC_TRY_EVAL(javac_cmd)
9018 if test $? = 0 -a -f ./findhome.class; then
9019 AC_MSG_RESULT([javac works])
9021 echo "configure: javac test failed" >&5
9022 cat findhome.java >&5
9023 AC_MSG_ERROR([javac does not work - java projects will not build!])
9025 AC_MSG_CHECKING([if gij knows its java.home])
9026 JAVA_HOME=`$JAVAINTERPRETER findhome`
9027 if test $? = 0 -a "$JAVA_HOME" != ""; then
9028 AC_MSG_RESULT([$JAVA_HOME])
9030 echo "configure: java test failed" >&5
9031 cat findhome.java >&5
9032 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
9034 # clean-up after ourselves
9035 rm -f ./findhome.java ./findhome.class
9037 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
9041 # now check if $JAVA_HOME is really valid
9042 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
9043 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
9044 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
9045 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
9046 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
9047 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
9048 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
9049 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
9052 PathFormat "$JAVA_HOME"
9053 JAVA_HOME="$formatted_path_unix"
9056 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
9059 AC_MSG_CHECKING([for JAWT lib])
9060 if test "$_os" = WINNT; then
9061 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
9066 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
9067 JAVA_ARCH=$my_java_arch
9082 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
9083 JAVA_ARCH=$my_java_arch
9086 my_java_arch=sparcv9
9092 my_java_arch=$host_cpu
9095 # This is where JDK9 puts the library
9096 if test -e "$JAVA_HOME/lib/libjawt.so"; then
9097 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
9099 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
9101 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
9103 AC_MSG_RESULT([$JAWTLIB])
9107 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
9111 JAVAINC="-I$JAVA_HOME/include/win32"
9112 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
9116 if test -d "$JAVA_HOME/include/darwin"; then
9117 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
9119 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
9124 JAVAINC="-I$JAVA_HOME/include"
9125 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9129 JAVAINC="-I$JAVA_HOME/include"
9130 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
9131 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
9132 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
9133 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9137 JAVAINC="-I$JAVA_HOME/include"
9138 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
9139 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9143 JAVAINC="-I$JAVA_HOME/include"
9144 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
9145 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9149 JAVAINC="-I$JAVA_HOME/include"
9150 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
9151 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9155 JAVAINC="-I$JAVA_HOME/include"
9156 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
9157 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9161 JAVAINC="-I$JAVA_HOME/include"
9162 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
9163 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
9167 SOLARINC="$SOLARINC $JAVAINC"
9169 if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then
9170 JAVA_HOME_FOR_BUILD=$JAVA_HOME
9171 JAVAIFLAGS_FOR_BUILD=$JAVAIFLAGS
9173 JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD=$JDK_SECURITYMANAGER_DISALLOWED
9176 AC_SUBST(JAVACFLAGS)
9177 AC_SUBST(JAVACOMPILER)
9178 AC_SUBST(JAVAINTERPRETER)
9179 AC_SUBST(JAVAIFLAGS)
9180 AC_SUBST(JAVAIFLAGS_FOR_BUILD)
9182 AC_SUBST(JAVA_HOME_FOR_BUILD)
9184 AC_SUBST(JDK_FOR_BUILD)
9185 AC_SUBST(JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD)
9186 AC_SUBST(JAVA_SOURCE_VER)
9187 AC_SUBST(JAVA_TARGET_VER)
9188 AC_SUBST(MODULAR_JAVA)
9191 dnl ===================================================================
9192 dnl Export file validation
9193 dnl ===================================================================
9194 AC_MSG_CHECKING([whether to enable export file validation])
9195 if test "$with_export_validation" != "no"; then
9196 if test -z "$ENABLE_JAVA"; then
9197 if test "$with_export_validation" = "yes"; then
9198 AC_MSG_ERROR([requested, but Java is disabled])
9200 AC_MSG_RESULT([no, as Java is disabled])
9202 elif ! test -d "${SRC_ROOT}/schema"; then
9203 if test "$with_export_validation" = "yes"; then
9204 AC_MSG_ERROR([requested, but schema directory is missing (it is excluded from tarballs)])
9206 AC_MSG_RESULT([no, schema directory is missing (it is excluded from tarballs)])
9209 AC_MSG_RESULT([yes])
9210 AC_DEFINE(HAVE_EXPORT_VALIDATION)
9212 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
9213 if test -z "$ODFVALIDATOR"; then
9214 # remember to download the ODF toolkit with validator later
9215 AC_MSG_NOTICE([no odfvalidator found, will download it])
9216 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
9217 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
9219 # and fetch name of odfvalidator jar name from download.lst
9220 ODFVALIDATOR_JAR=`$SED -n -e "s/^ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
9221 AC_SUBST(ODFVALIDATOR_JAR)
9223 if test -z "$ODFVALIDATOR_JAR"; then
9224 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
9227 if test "$build_os" = "cygwin"; then
9228 # In case of Cygwin it will be executed from Windows,
9229 # so we need to run bash and absolute path to validator
9230 # so instead of "odfvalidator" it will be
9231 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
9232 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
9234 ODFVALIDATOR="sh $ODFVALIDATOR"
9236 AC_SUBST(ODFVALIDATOR)
9239 AC_PATH_PROGS(OFFICEOTRON, officeotron)
9240 if test -z "$OFFICEOTRON"; then
9241 # remember to download the officeotron with validator later
9242 AC_MSG_NOTICE([no officeotron found, will download it])
9243 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
9244 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
9246 # and fetch name of officeotron jar name from download.lst
9247 OFFICEOTRON_JAR=`$SED -n -e "s/^OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
9248 AC_SUBST(OFFICEOTRON_JAR)
9250 if test -z "$OFFICEOTRON_JAR"; then
9251 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
9254 # check version of existing officeotron
9255 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
9256 if test 0"$OFFICEOTRON_VER" -lt 704; then
9257 AC_MSG_ERROR([officeotron too old])
9260 if test "$build_os" = "cygwin"; then
9261 # In case of Cygwin it will be executed from Windows,
9262 # so we need to run bash and absolute path to validator
9263 # so instead of "odfvalidator" it will be
9264 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
9265 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
9267 OFFICEOTRON="sh $OFFICEOTRON"
9270 AC_SUBST(OFFICEOTRON)
9275 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
9276 if test "$with_bffvalidator" != "no"; then
9277 AC_DEFINE(HAVE_BFFVALIDATOR)
9279 if test "$with_export_validation" = "no"; then
9280 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
9283 if test "$with_bffvalidator" = "yes"; then
9284 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
9286 BFFVALIDATOR="$with_bffvalidator"
9289 if test "$build_os" = "cygwin"; then
9290 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
9291 AC_MSG_RESULT($BFFVALIDATOR)
9293 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
9295 elif test -n "$BFFVALIDATOR"; then
9296 # We are not in Cygwin but need to run Windows binary with wine
9297 AC_PATH_PROGS(WINE, wine)
9299 # so swap in a shell wrapper that converts paths transparently
9300 BFFVALIDATOR_EXE="$BFFVALIDATOR"
9301 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
9302 AC_SUBST(BFFVALIDATOR_EXE)
9303 AC_MSG_RESULT($BFFVALIDATOR)
9305 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
9307 AC_SUBST(BFFVALIDATOR)
9312 dnl ===================================================================
9313 dnl Check for epm (not needed for Windows)
9314 dnl ===================================================================
9315 AC_MSG_CHECKING([whether to enable EPM for packing])
9316 if test "$enable_epm" = "yes"; then
9317 AC_MSG_RESULT([yes])
9318 if test "$_os" != "WINNT"; then
9319 if test $_os = Darwin; then
9321 elif test -n "$with_epm"; then
9324 AC_PATH_PROG(EPM, epm, no)
9326 if test "$EPM" = "no" -o "$EPM" = "internal"; then
9327 AC_MSG_NOTICE([EPM will be built.])
9328 BUILD_TYPE="$BUILD_TYPE EPM"
9329 EPM=${WORKDIR}/UnpackedTarball/epm/epm
9331 # Gentoo has some epm which is something different...
9332 AC_MSG_CHECKING([whether the found epm is the right epm])
9333 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
9334 AC_MSG_RESULT([yes])
9336 AC_MSG_ERROR([no. Install ESP Package Manager (https://jimjag.github.io/epm/) and/or specify the path to the right epm])
9338 AC_MSG_CHECKING([epm version])
9339 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
9340 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
9341 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
9342 AC_MSG_RESULT([OK, >= 3.7])
9344 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
9345 AC_MSG_ERROR([Install ESP Package Manager (https://jimjag.github.io/epm/) and/or specify the path to the right epm])
9350 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
9351 AC_MSG_CHECKING([for rpm])
9352 for a in "$RPM" rpmbuild rpm; do
9353 $a --usage >/dev/null 2> /dev/null
9354 if test $? -eq 0; then
9358 $a --version >/dev/null 2> /dev/null
9359 if test $? -eq 0; then
9365 if test -z "$RPM"; then
9366 AC_MSG_ERROR([not found])
9367 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
9368 RPM_PATH=`command -v $RPM`
9369 AC_MSG_RESULT([$RPM_PATH])
9370 SCPDEFS="$SCPDEFS -DWITH_RPM"
9372 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
9375 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
9376 AC_PATH_PROG(DPKG, dpkg, no)
9377 if test "$DPKG" = "no"; then
9378 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
9381 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
9382 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
9383 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
9384 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
9385 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
9386 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
9387 AC_MSG_RESULT([yes])
9390 if echo "$PKGFORMAT" | $GREP -q rpm; then
9392 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
9393 add_warning "the rpms will need to be installed with --nodeps"
9397 AC_MSG_WARN([the ${_pt}s will not be relocatable])
9398 add_warning "the ${_pt}s will not be relocatable"
9399 AC_MSG_WARN([if you want to make sure installation without --nodeps and
9400 relocation will work, you need to patch your epm with the
9401 patch in epm/epm-3.7.patch or build with
9402 --with-epm=internal which will build a suitable epm])
9407 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
9408 AC_PATH_PROG(PKGMK, pkgmk, no)
9409 if test "$PKGMK" = "no"; then
9410 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
9417 for i in $PKGFORMAT; do
9419 bsd | deb | pkg | rpm | native | portable)
9421 [--with-package-format='$PKGFORMAT' requires --enable-epm])
9431 if test "$enable_lotuswordpro" = "yes"; then
9434 AC_SUBST(ENABLE_LWP)
9436 dnl ===================================================================
9437 dnl Check for building ODK
9438 dnl ===================================================================
9439 AC_MSG_CHECKING([whether to build the ODK])
9440 if test "$enable_odk" = yes; then
9441 if test "$DISABLE_DYNLOADING" = TRUE; then
9442 AC_MSG_ERROR([can't build ODK for --disable-dynamic-loading builds])
9444 AC_MSG_RESULT([yes])
9445 BUILD_TYPE="$BUILD_TYPE ODK"
9450 if test "$enable_odk" != yes; then
9453 if test "$with_doxygen" = no; then
9454 AC_MSG_CHECKING([for doxygen])
9458 if test "$with_doxygen" = yes; then
9459 AC_PATH_PROG([DOXYGEN], [doxygen])
9460 if test -z "$DOXYGEN"; then
9461 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
9463 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
9464 if ! dot -V 2>/dev/null; then
9465 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
9469 AC_MSG_CHECKING([for doxygen])
9470 PathFormat "$with_doxygen"
9471 DOXYGEN="$formatted_path_unix"
9472 AC_MSG_RESULT([$formatted_path])
9474 if test -n "$DOXYGEN"; then
9475 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
9476 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
9477 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
9478 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
9481 if test -n "$WSL_ONLY_AS_HELPER"; then
9482 dnl what really should be tested is whether it is doxygen from windows-realm
9483 dnl i.e. one that runs on the windows-side and deals with windows-pathnames
9484 dnl using doxygen from wsl container would be possible, but there's a performance
9485 dnl penalty when accessing the files outside the container
9486 AC_MSG_CHECKING([whether doxygen is a windows executable])
9487 if $(file "$DOXYGEN" | grep -q "PE32"); then
9488 AC_MSG_RESULT([yes])
9491 AC_MSG_ERROR([please provide a path to a windows version of doxygen or use --without-doxygen])
9498 dnl ==================================================================
9500 dnl ==================================================================
9501 AC_MSG_CHECKING([whether to enable fuzzers])
9502 if test "$enable_fuzzers" != yes; then
9505 if test -z $LIB_FUZZING_ENGINE; then
9506 AC_MSG_ERROR(['LIB_FUZZING_ENGINE' must be set when using --enable-fuzzers. Examples include '-fsanitize=fuzzer'.])
9508 AC_MSG_RESULT([yes])
9509 ENABLE_FUZZERS="TRUE"
9510 AC_DEFINE([ENABLE_FUZZERS],1)
9511 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9513 AC_SUBST(LIB_FUZZING_ENGINE)
9515 dnl ===================================================================
9516 dnl Check for system zlib
9517 dnl ===================================================================
9518 if test "$with_system_zlib" = "auto"; then
9521 with_system_zlib="$with_system_libs"
9524 if test "$enable_fuzzers" != "yes"; then
9525 with_system_zlib=yes
9533 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
9534 dnl and has no pkg-config for it at least on some tinderboxes,
9535 dnl so leaving that out for now
9536 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
9537 AC_MSG_CHECKING([which zlib to use])
9538 if test "$with_system_zlib" = "yes"; then
9539 AC_MSG_RESULT([external])
9541 AC_CHECK_HEADER(zlib.h, [],
9542 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
9543 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
9544 [AC_MSG_ERROR(zlib not found or functional)], [])
9546 AC_MSG_RESULT([internal])
9548 BUILD_TYPE="$BUILD_TYPE ZLIB"
9549 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
9550 if test "$COM" = "MSC"; then
9551 ZLIB_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/zlib.lib"
9553 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
9556 AC_SUBST(ZLIB_CFLAGS)
9558 AC_SUBST(SYSTEM_ZLIB)
9560 dnl ===================================================================
9561 dnl Check for system jpeg
9562 dnl ===================================================================
9563 AC_MSG_CHECKING([which libjpeg to use])
9564 if test "$with_system_jpeg" = "yes"; then
9565 AC_MSG_RESULT([external])
9567 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
9568 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
9569 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
9570 [AC_MSG_ERROR(jpeg library not found or functional)], [])
9573 AC_MSG_RESULT([internal, libjpeg-turbo])
9574 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
9577 x86_64 | amd64 | i*86 | x86 | ia32)
9578 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
9579 if test -z "$NASM" -a "$build_os" = "cygwin"; then
9580 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
9581 NASM="$LODE_HOME/opt/bin/nasm"
9582 elif test -x "/opt/lo/bin/nasm"; then
9583 NASM="/opt/lo/bin/nasm"
9587 if test -n "$NASM"; then
9588 AC_MSG_CHECKING([for object file format of host system])
9590 cygwin* | mingw* | pw32* | wsl*)
9600 msdosdjgpp* | go32*)
9603 os2-emx*) # not tested
9604 objfmt='MSOMF' # obj
9606 linux*coff* | linux*oldld*)
9622 kfreebsd* | freebsd* | netbsd* | openbsd*)
9623 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
9636 solaris* | sunos* | sysv* | sco*)
9646 darwin* | rhapsody* | nextstep* | openstep* | macos*)
9661 AC_MSG_RESULT([$objfmt])
9662 if test "$objfmt" = 'ELF ?'; then
9664 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
9667 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
9669 MSOMF) NAFLAGS='-fobj -DOBJ32 -DPIC';;
9670 Win32-COFF) NAFLAGS='-fwin32 -DWIN32 -DPIC';;
9671 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__ -DPIC';;
9672 COFF) NAFLAGS='-fcoff -DCOFF -DPIC';;
9673 a.out) NAFLAGS='-faout -DAOUT -DPIC';;
9674 BSD-a.out) NAFLAGS='-faoutb -DAOUT -DPIC';;
9675 ELF) NAFLAGS='-felf -DELF -DPIC';;
9676 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__ -DPIC';;
9677 RDF) NAFLAGS='-frdf -DRDF -DPIC';;
9678 Mach-O) NAFLAGS='-fmacho -DMACHO -DPIC';;
9679 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__ -DPIC';;
9681 AC_MSG_RESULT([$NAFLAGS])
9683 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
9684 cat > conftest.asm << EOF
9685 [%line __oline__ "configure"
9693 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
9694 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
9697 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
9698 cat conftest.asm >&AS_MESSAGE_LOG_FD
9701 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
9707 if test -z "$NASM"; then
9709 ****************************************************************************
9710 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
9714 if test "$build_os" = "cygwin"; then
9716 install a pre-compiled binary for Win32
9718 mkdir -p /opt/lo/bin
9720 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
9723 or get and install one from https://www.nasm.us/
9725 Then re-run autogen.sh
9727 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
9728 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`command -v nasm\` finds it.
9733 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/main/BUILDING.md
9737 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
9738 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
9746 AC_SUBST(LIBJPEG_CFLAGS)
9747 AC_SUBST(LIBJPEG_LIBS)
9748 AC_SUBST(SYSTEM_LIBJPEG)
9750 dnl ===================================================================
9751 dnl Check for system clucene
9752 dnl ===================================================================
9753 libo_CHECK_SYSTEM_MODULE([clucene],[CLUCENE],[libclucene-core])
9754 if test "$SYSTEM_CLUCENE" = TRUE; then
9756 save_CXXFLAGS=$CXXFLAGS
9757 save_CPPFLAGS=$CPPFLAGS
9758 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
9759 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
9760 dnl https://sourceforge.net/p/clucene/bugs/200/
9761 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
9762 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
9763 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
9764 CXXFLAGS=$save_CXXFLAGS
9765 CPPFLAGS=$save_CPPFLAGS
9767 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
9770 dnl ===================================================================
9771 dnl Check for system expat
9772 dnl ===================================================================
9773 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
9775 dnl ===================================================================
9776 dnl Check for system xmlsec
9777 dnl ===================================================================
9778 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.35])
9780 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
9781 if test "$enable_eot" = "yes"; then
9783 AC_DEFINE([ENABLE_EOT])
9784 AC_MSG_RESULT([yes])
9786 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
9791 AC_SUBST([ENABLE_EOT])
9793 dnl ===================================================================
9794 dnl Check for DLP libs
9795 dnl ===================================================================
9796 REVENGE_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/librevenge/inc"
9797 AS_IF([test "$COM" = "MSC"],
9798 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
9799 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
9801 REVENGE_LIBS_internal="-L${librevenge_libdir} -lrevenge-0.0"
9802 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1])
9804 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
9806 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
9808 WPD_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/libwpd/inc"
9809 AS_IF([test "$COM" = "MSC"],
9810 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
9811 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
9813 WPD_LIBS_internal="-L${libwpd_libdir} -lwpd-0.10"
9814 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10])
9816 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
9818 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
9819 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.14])
9821 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
9823 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
9825 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
9827 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.21])
9828 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.21])
9830 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
9831 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.10])
9833 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
9835 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
9836 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
9838 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
9840 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
9842 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
9844 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
9846 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
9847 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.7])
9849 dnl ===================================================================
9850 dnl Check for system lcms2
9851 dnl ===================================================================
9852 if test "$with_system_lcms2" != "yes"; then
9855 LCMS2_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/lcms2/include"
9856 LCMS2_LIBS_internal="-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"
9857 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2])
9858 if test "$GCC" = "yes"; then
9859 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
9861 if test "$COM" = "MSC"; then # override the above
9862 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
9865 dnl ===================================================================
9866 dnl Check for system cppunit
9867 dnl ===================================================================
9868 if test "$_os" != "Android" ; then
9869 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
9872 dnl ===================================================================
9873 dnl Check whether freetype is available
9875 dnl FreeType has 3 different kinds of versions
9876 dnl * release, like 2.4.10
9877 dnl * libtool, like 13.0.7 (this what pkg-config returns)
9879 dnl FreeType's docs/VERSION.DLL provides a table mapping between the three
9882 dnl When the minimal version is at least 2.8.1, remove Skia's check down below.
9883 dnl ===================================================================
9884 FREETYPE_CFLAGS_internal="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
9885 if test "x$ac_config_site_64bit_host" = xYES; then
9886 FREETYPE_LIBS_internal="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
9888 FREETYPE_LIBS_internal="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
9890 libo_CHECK_SYSTEM_MODULE([freetype],[FREETYPE],[freetype2 >= 9.9.3],,system,TRUE)
9892 # ===================================================================
9893 # Check for system libxslt
9894 # to prevent incompatibilities between internal libxml2 and external libxslt,
9895 # or vice versa, use with_system_libxml here
9896 # ===================================================================
9897 if test "$with_system_libxml" = "auto"; then
9900 with_system_libxml="$with_system_libs"
9903 with_system_libxml=no
9906 if test "$enable_fuzzers" != "yes"; then
9907 with_system_libxml=yes
9909 with_system_libxml=no
9915 AC_MSG_CHECKING([which libxslt to use])
9916 if test "$with_system_libxml" = "yes"; then
9917 AC_MSG_RESULT([external])
9919 if test "$_os" = "Darwin"; then
9920 dnl make sure to use SDK path
9921 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
9922 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
9924 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
9925 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
9927 PKG_CHECK_MODULES(LIBXSLT, libxslt)
9928 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9929 FilterLibs "${LIBXSLT_LIBS}"
9930 LIBXSLT_LIBS="${filteredlibs}"
9931 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
9932 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9933 FilterLibs "${LIBEXSLT_LIBS}"
9934 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
9937 dnl Check for xsltproc
9938 AC_PATH_PROG(XSLTPROC, xsltproc, no)
9939 if test "$XSLTPROC" = "no"; then
9940 AC_MSG_ERROR([xsltproc is required])
9943 AC_MSG_RESULT([internal])
9945 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
9947 AC_SUBST(SYSTEM_LIBXSLT)
9948 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
9949 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
9951 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
9953 AC_SUBST(LIBEXSLT_CFLAGS)
9954 AC_SUBST(LIBEXSLT_LIBS)
9955 AC_SUBST(LIBXSLT_CFLAGS)
9956 AC_SUBST(LIBXSLT_LIBS)
9959 # ===================================================================
9960 # Check for system libxml
9961 # ===================================================================
9962 AC_MSG_CHECKING([which libxml to use])
9963 if test "$with_system_libxml" = "yes"; then
9964 AC_MSG_RESULT([external])
9966 if test "$_os" = "Darwin"; then
9967 dnl make sure to use SDK path
9968 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
9970 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
9971 elif test $_os = iOS; then
9972 dnl make sure to use SDK path
9973 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
9974 LIBXML_CFLAGS="-I$usr/include/libxml2"
9975 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
9977 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
9978 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9979 FilterLibs "${LIBXML_LIBS}"
9980 LIBXML_LIBS="${filteredlibs}"
9983 dnl Check for xmllint
9984 AC_PATH_PROG(XMLLINT, xmllint, no)
9985 if test "$XMLLINT" = "no"; then
9986 AC_MSG_ERROR([xmllint is required])
9989 AC_MSG_RESULT([internal])
9991 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
9992 if test "$COM" = "MSC"; then
9993 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9995 if test "$COM" = "MSC"; then
9996 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
9998 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
9999 if test "$DISABLE_DYNLOADING" = TRUE; then
10000 LIBXML_LIBS="$LIBXML_LIBS -lm"
10003 BUILD_TYPE="$BUILD_TYPE LIBXML2"
10005 AC_SUBST(SYSTEM_LIBXML)
10006 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
10007 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
10009 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
10010 AC_SUBST(LIBXML_CFLAGS)
10011 AC_SUBST(LIBXML_LIBS)
10014 # =====================================================================
10015 # Checking for a Python interpreter with version >= 3.3.
10016 # Optionally user can pass an option to configure, i. e.
10017 # ./configure PYTHON=/usr/bin/python
10018 # =====================================================================
10019 if test $_os = Darwin -a "$enable_python" != no -a "$enable_python" != fully-internal -a "$enable_python" != internal -a "$enable_python" != system; then
10020 # Only allowed choices for macOS are 'no', 'internal' (default), and 'fully-internal'
10021 # unless PYTHON is defined as above which allows 'system'
10022 enable_python=internal
10024 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
10025 if test -n "$PYTHON"; then
10026 PYTHON_FOR_BUILD=$PYTHON
10028 # This allows a lack of system python with no error, we use internal one in that case.
10029 AM_PATH_PYTHON([3.3],, [:])
10030 # Clean PYTHON_VERSION checked below if cross-compiling
10032 if test "$PYTHON" != ":"; then
10033 PYTHON_FOR_BUILD=$PYTHON
10038 # Checks for Python to use for Pyuno
10039 AC_MSG_CHECKING([which Python to use for Pyuno])
10040 case "$enable_python" in
10042 if test -z "$PYTHON_FOR_BUILD" -a "$cross_compiling" != yes; then
10043 # Python is required to build LibreOffice. In theory we could separate the build-time Python
10044 # requirement from the choice whether to include Python stuff in the installer, but why
10046 AC_MSG_ERROR([Python is required at build time.])
10049 AC_MSG_RESULT([none])
10052 if test "$DISABLE_SCRIPTING" = TRUE; then
10053 if test -z "$PYTHON_FOR_BUILD" -a "$cross_compiling" != yes; then
10054 AC_MSG_ERROR([Python support can't be disabled without cross-compiling or a system python.])
10056 AC_MSG_RESULT([none, overridden by --disable-scripting])
10058 elif test $build_os = cygwin -o $build_os = wsl; then
10059 dnl When building on Windows we don't attempt to use any installed
10060 dnl "system" Python.
10061 AC_MSG_RESULT([fully internal])
10062 enable_python=internal
10063 elif test "$cross_compiling" = yes; then
10064 AC_MSG_RESULT([system])
10065 enable_python=system
10067 # Unset variables set by the above AM_PATH_PYTHON so that
10068 # we actually do check anew.
10070 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
10071 AM_PATH_PYTHON([3.3],, [:])
10072 AC_MSG_CHECKING([which Python to use for Pyuno])
10073 if test "$PYTHON" = ":"; then
10074 if test -z "$PYTHON_FOR_BUILD"; then
10075 AC_MSG_RESULT([fully internal])
10077 AC_MSG_RESULT([internal])
10079 enable_python=internal
10081 AC_MSG_RESULT([system])
10082 enable_python=system
10087 AC_MSG_RESULT([internal])
10090 AC_MSG_RESULT([fully internal])
10091 enable_python=internal
10094 AC_MSG_RESULT([system])
10095 if test "$_os" = Darwin -a -z "$PYTHON"; then
10096 AC_MSG_ERROR([--enable-python=system doesn't work on macOS because the version provided is obsolete])
10100 AC_MSG_ERROR([Incorrect --enable-python option])
10104 if test $enable_python != no; then
10105 BUILD_TYPE="$BUILD_TYPE PYUNO"
10108 if test $enable_python = system; then
10109 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
10110 # Fallback: Accept these in the environment, or as set above
10113 elif test "$cross_compiling" != yes; then
10114 # Unset variables set by the above AM_PATH_PYTHON so that
10115 # we actually do check anew.
10116 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
10117 # This causes an error if no python command is found
10118 AM_PATH_PYTHON([3.3])
10119 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
10120 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
10121 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
10122 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
10123 if test -z "$PKG_CONFIG"; then
10124 PYTHON_CFLAGS="-I$python_include"
10125 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
10126 elif $PKG_CONFIG --exists python-$python_version-embed; then
10127 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
10128 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
10129 elif $PKG_CONFIG --exists python-$python_version; then
10130 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
10131 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
10133 PYTHON_CFLAGS="-I$python_include"
10134 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
10136 FilterLibs "${PYTHON_LIBS}"
10137 PYTHON_LIBS="${filteredlibs}"
10139 dnl How to find out the cross-compilation Python installation path?
10140 AC_MSG_CHECKING([for python version])
10141 AS_IF([test -n "$PYTHON_VERSION"],
10142 [AC_MSG_RESULT([$PYTHON_VERSION])],
10143 [AC_MSG_RESULT([not found])
10144 AC_MSG_ERROR([no usable python found])])
10145 test -n "$PYTHON_CFLAGS" && break
10148 dnl Check if the headers really work
10149 save_CPPFLAGS="$CPPFLAGS"
10150 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
10151 AC_CHECK_HEADER(Python.h)
10152 CPPFLAGS="$save_CPPFLAGS"
10154 # let the PYTHON_FOR_BUILD match the same python installation that
10155 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
10156 # better for PythonTests.
10157 PYTHON_FOR_BUILD=$PYTHON
10160 if test "$with_lxml" != no; then
10161 if test -z "$PYTHON_FOR_BUILD"; then
10164 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
10167 if test "$cross_compiling" != yes ; then
10168 BUILD_TYPE="$BUILD_TYPE LXML"
10173 AC_MSG_CHECKING([for python lxml])
10174 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
10175 AC_MSG_RESULT([yes])
10179 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
10182 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
10183 if test -n ${SYSTEM_LIBXSLT} -o -n ${SYSTEM_LIBXML}; then
10184 AC_MSG_RESULT([no, and no system libxml/libxslt, gla11y will only report widget classes and ids])
10186 BUILD_TYPE="$BUILD_TYPE LXML"
10187 AC_MSG_RESULT([no, using internal lxml])
10190 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
10198 if test \( "$cross_compiling" = yes -a -z "$PYTHON_FOR_BUILD" \) -o "$enable_python" = internal; then
10200 PYTHON_VERSION_MAJOR=3
10201 PYTHON_VERSION_MINOR=9
10202 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.19
10203 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
10204 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
10206 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
10208 # Embedded Python dies without Home set
10209 if test "$HOME" = ""; then
10214 dnl By now enable_python should be "system", "internal" or "no"
10215 case $enable_python in
10219 if test "x$ac_cv_header_Python_h" != "xyes"; then
10220 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
10224 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
10225 AC_MSG_CHECKING([for correct python library version])
10226 AC_RUN_IFELSE([AC_LANG_SOURCE([[
10227 #include <Python.h>
10229 int main(int argc, char **argv) {
10230 if ((PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
10233 ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3])],[AC_MSG_RESULT([skipped; cross-compiling])])
10236 dnl FIXME Check if the Python library can be linked with, too?
10240 BUILD_TYPE="$BUILD_TYPE PYTHON"
10241 if test "$OS" = LINUX -o "$OS" = WNT ; then
10242 BUILD_TYPE="$BUILD_TYPE LIBFFI"
10246 DISABLE_PYTHON=TRUE
10250 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
10254 AC_SUBST(DISABLE_PYTHON)
10255 AC_SUBST(SYSTEM_PYTHON)
10256 AC_SUBST(PYTHON_CFLAGS)
10257 AC_SUBST(PYTHON_FOR_BUILD)
10258 AC_SUBST(PYTHON_LIBS)
10259 AC_SUBST(PYTHON_VERSION)
10260 AC_SUBST(PYTHON_VERSION_MAJOR)
10261 AC_SUBST(PYTHON_VERSION_MINOR)
10263 AC_MSG_CHECKING([whether to build LibreLogo])
10264 case "$enable_python" in
10266 AC_MSG_RESULT([no; Python disabled])
10269 if test "${enable_librelogo}" = "no"; then
10270 AC_MSG_RESULT([no])
10272 AC_MSG_RESULT([yes])
10273 BUILD_TYPE="${BUILD_TYPE} LIBRELOGO"
10274 AC_DEFINE([ENABLE_LIBRELOGO],1)
10278 AC_SUBST(ENABLE_LIBRELOGO)
10284 AC_MSG_CHECKING([whether to build the MariaDB/MySQL SDBC driver])
10285 if test "x$enable_mariadb_sdbc" != "xno" -a "$enable_mpl_subset" != "yes"; then
10286 ENABLE_MARIADBC=TRUE
10287 AC_MSG_RESULT([yes])
10288 BUILD_TYPE="$BUILD_TYPE MARIADBC"
10290 AC_MSG_RESULT([no])
10292 AC_SUBST(ENABLE_MARIADBC)
10293 AC_SUBST(MARIADBC_MAJOR)
10294 AC_SUBST(MARIADBC_MINOR)
10295 AC_SUBST(MARIADBC_MICRO)
10297 if test "$ENABLE_MARIADBC" = "TRUE"; then
10298 dnl ===================================================================
10299 dnl Check for system MariaDB
10300 dnl ===================================================================
10302 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
10303 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
10306 AC_MSG_CHECKING([which MariaDB to use])
10307 if test "$with_system_mariadb" = "yes"; then
10308 AC_MSG_RESULT([external])
10309 SYSTEM_MARIADB_CONNECTOR_C=TRUE
10310 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
10311 if test -z "$MARIADBCONFIG"; then
10312 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
10313 if test -z "$MARIADBCONFIG"; then
10314 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
10315 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
10318 AC_MSG_CHECKING([MariaDB version])
10319 MARIADB_VERSION=`$MARIADBCONFIG --version`
10320 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
10321 if test "$MARIADB_MAJOR" -ge "5"; then
10322 AC_MSG_RESULT([OK])
10324 AC_MSG_ERROR([too old, use 5.0.x or later])
10326 AC_MSG_CHECKING([for MariaDB Client library])
10327 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
10328 if test "$COM_IS_CLANG" = TRUE; then
10329 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
10331 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
10332 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
10333 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
10335 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
10336 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
10337 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
10338 | sed -e 's|/lib64/|/lib/|')
10340 FilterLibs "${MARIADB_LIBS}"
10341 MARIADB_LIBS="${filteredlibs}"
10342 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
10343 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
10344 if test "$enable_bundle_mariadb" = "yes"; then
10345 AC_MSG_RESULT([yes])
10346 BUNDLE_MARIADB_CONNECTOR_C=TRUE
10347 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
10349 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
10351 /g' | grep -E '(mysqlclient|mariadb)')
10352 if test "$_os" = "Darwin"; then
10353 LIBMARIADB=${LIBMARIADB}.dylib
10354 if test "$with_gssapi" != "no"; then
10357 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10358 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10362 elif test "$_os" = "WINNT"; then
10363 LIBMARIADB=${LIBMARIADB}.dll
10365 LIBMARIADB=${LIBMARIADB}.so
10366 if test "$with_gssapi" != "no"; then
10369 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10370 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10375 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
10376 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
10377 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
10378 AC_MSG_RESULT([found.])
10379 PathFormat "$LIBMARIADB_PATH"
10380 LIBMARIADB_PATH="$formatted_path"
10382 AC_MSG_ERROR([not found.])
10385 AC_MSG_RESULT([no])
10386 BUNDLE_MARIADB_CONNECTOR_C=
10389 AC_MSG_RESULT([internal])
10390 SYSTEM_MARIADB_CONNECTOR_C=
10391 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
10392 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
10393 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
10396 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
10397 AC_SUBST(MARIADB_CFLAGS)
10398 AC_SUBST(MARIADB_LIBS)
10399 AC_SUBST(LIBMARIADB)
10400 AC_SUBST(LIBMARIADB_PATH)
10401 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
10404 dnl ===================================================================
10405 dnl Check for system hsqldb
10406 dnl ===================================================================
10407 if test "$with_java" != "no" -a "$cross_compiling" != "yes"; then
10408 AC_MSG_CHECKING([which hsqldb to use])
10409 if test "$with_system_hsqldb" = "yes"; then
10410 AC_MSG_RESULT([external])
10412 if test -z $HSQLDB_JAR; then
10413 HSQLDB_JAR=/usr/share/java/hsqldb.jar
10415 if ! test -f $HSQLDB_JAR; then
10416 AC_MSG_ERROR(hsqldb.jar not found.)
10418 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
10422 my $file = "$ENV{'HSQLDB_JAR'}";
10423 my $zip = Archive::Zip->new( $file );
10424 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
10425 if ( $mf =~ m/Specification-Version: 1.8.*/ )
10427 push @l, split(/\n/, $mf);
10428 foreach my $line (@l)
10430 if ($line =~ m/Specification-Version:/)
10432 ($t, $version) = split (/:/,$line);
10433 $version =~ s/^\s//;
10434 ($a, $b, $c, $d) = split (/\./,$version);
10435 if ($c == "0" && $d > "8")
10450 AC_MSG_RESULT([yes])
10452 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
10455 AC_MSG_RESULT([internal])
10457 BUILD_TYPE="$BUILD_TYPE HSQLDB"
10461 if test "$with_java" != "no" -a -z "$HSQLDB_JAR"; then
10462 BUILD_TYPE="$BUILD_TYPE HSQLDB"
10465 AC_SUBST(SYSTEM_HSQLDB)
10466 AC_SUBST(HSQLDB_JAR)
10468 dnl ===================================================================
10469 dnl Check for PostgreSQL stuff
10470 dnl ===================================================================
10471 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
10472 if test "x$enable_postgresql_sdbc" != "xno"; then
10473 AC_MSG_RESULT([yes])
10474 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
10476 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
10477 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
10479 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
10480 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
10483 postgres_interface=""
10484 if test "$with_system_postgresql" = "yes"; then
10485 postgres_interface="external PostgreSQL"
10486 SYSTEM_POSTGRESQL=TRUE
10487 if test "$_os" = Darwin; then
10489 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
10490 pg_supp_path="$P_SEP$d$pg_supp_path"
10493 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
10494 if test -n "$PGCONFIG"; then
10495 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
10496 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
10498 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
10499 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
10500 POSTGRESQL_LIB=$POSTGRESQL_LIBS
10502 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
10505 FilterLibs "${POSTGRESQL_LIB}"
10506 POSTGRESQL_LIB="${filteredlibs}"
10508 # if/when anything else than PostgreSQL uses Kerberos,
10509 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
10514 # macOS has system MIT Kerberos 5 since 10.4
10515 if test "$with_krb5" != "no"; then
10518 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
10519 # that the libraries where these functions are located on macOS will change, is it?
10520 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10521 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
10524 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10525 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
10526 KRB5_LIBS="$KRB5_LIBS $LIBS"
10529 if test "$with_gssapi" != "no"; then
10532 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10533 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10539 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
10540 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
10543 Linux|GNU|*BSD|DragonFly)
10544 if test "$with_krb5" != "no"; then
10547 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10548 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
10551 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10552 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
10553 KRB5_LIBS="$KRB5_LIBS $LIBS"
10556 if test "$with_gssapi" != "no"; then
10559 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10560 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10566 if test "$with_krb5" = "yes"; then
10569 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10570 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
10573 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
10574 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
10575 KRB5_LIBS="$KRB5_LIBS $LIBS"
10578 if test "$with_gssapi" = "yes"; then
10581 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10582 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10588 if test -n "$with_libpq_path"; then
10589 SYSTEM_POSTGRESQL=TRUE
10590 postgres_interface="external libpq"
10591 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
10592 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
10595 postgres_interface="internal"
10597 POSTGRESQL_INC="%OVERRIDE_ME%"
10598 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
10602 AC_MSG_CHECKING([PostgreSQL C interface])
10603 AC_MSG_RESULT([$postgres_interface])
10605 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
10606 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
10607 save_CFLAGS=$CFLAGS
10608 save_CPPFLAGS=$CPPFLAGS
10610 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
10611 LIBS="${LIBS} ${POSTGRESQL_LIB}"
10612 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
10613 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
10614 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
10615 CFLAGS=$save_CFLAGS
10616 CPPFLAGS=$save_CPPFLAGS
10619 BUILD_POSTGRESQL_SDBC=TRUE
10621 AC_MSG_RESULT([no])
10623 AC_SUBST(WITH_KRB5)
10624 AC_SUBST(WITH_GSSAPI)
10625 AC_SUBST(GSSAPI_LIBS)
10626 AC_SUBST(KRB5_LIBS)
10627 AC_SUBST(BUILD_POSTGRESQL_SDBC)
10628 AC_SUBST(SYSTEM_POSTGRESQL)
10629 AC_SUBST(POSTGRESQL_INC)
10630 AC_SUBST(POSTGRESQL_LIB)
10632 dnl ===================================================================
10633 dnl Check for Firebird stuff
10634 dnl ===================================================================
10635 ENABLE_FIREBIRD_SDBC=
10636 if test "$enable_firebird_sdbc" = "yes" ; then
10637 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
10639 dnl ===================================================================
10640 dnl Check for system Firebird
10641 dnl ===================================================================
10642 AC_MSG_CHECKING([which Firebird to use])
10643 if test "$with_system_firebird" = "yes"; then
10644 AC_MSG_RESULT([external])
10645 SYSTEM_FIREBIRD=TRUE
10646 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
10647 if test -z "$FIREBIRDCONFIG"; then
10648 AC_MSG_NOTICE([No fb_config -- using pkg-config])
10649 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
10650 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
10652 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
10654 AC_MSG_NOTICE([fb_config found])
10655 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
10656 AC_MSG_CHECKING([for Firebird Client library])
10657 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
10658 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
10659 FilterLibs "${FIREBIRD_LIBS}"
10660 FIREBIRD_LIBS="${filteredlibs}"
10662 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
10663 AC_MSG_CHECKING([Firebird version])
10664 if test -n "${FIREBIRD_VERSION}"; then
10665 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
10666 if test "$FIREBIRD_MAJOR" -ge "3"; then
10667 AC_MSG_RESULT([OK])
10669 AC_MSG_ERROR([Ensure firebird >= 3 is installed])
10672 save_CFLAGS="${CFLAGS}"
10673 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
10674 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
10675 #if defined(FB_API_VER) && FB_API_VER == 30
10676 int fb_api_is_30(void) { return 0; }
10678 #error "Wrong Firebird API version"
10679 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
10680 CFLAGS="$save_CFLAGS"
10682 ENABLE_FIREBIRD_SDBC=TRUE
10683 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
10684 elif test "$enable_database_connectivity" = no; then
10685 AC_MSG_RESULT([none])
10686 elif test "$cross_compiling" = "yes"; then
10687 AC_MSG_RESULT([none])
10689 dnl Embedded Firebird has version 3.0
10690 dnl We need libatomic_ops for any non X86/X64 system
10691 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
10692 dnl ===================================================================
10693 dnl Check for system libatomic_ops
10694 dnl ===================================================================
10695 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[LIBATOMIC_OPS],[atomic_ops >= 0.7.2])
10696 if test "$with_system_libatomic_ops" = "yes"; then
10697 SYSTEM_LIBATOMIC_OPS=TRUE
10698 AC_CHECK_HEADERS(atomic_ops.h, [],
10699 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
10701 SYSTEM_LIBATOMIC_OPS=
10702 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
10703 LIBATOMIC_OPS_LIBS="-latomic_ops"
10704 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
10708 AC_MSG_RESULT([internal])
10710 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
10711 FIREBIRD_LIBS="-lfbclient"
10713 if test "$with_system_libtommath" = "yes"; then
10714 SYSTEM_LIBTOMMATH=TRUE
10715 dnl check for tommath presence
10717 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
10718 AC_CHECK_LIB(tommath, mp_init, LIBTOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
10722 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
10723 LIBTOMMATH_LIBS="-ltommath"
10724 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
10727 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
10728 ENABLE_FIREBIRD_SDBC=TRUE
10729 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
10732 AC_SUBST(ENABLE_FIREBIRD_SDBC)
10733 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
10734 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
10735 AC_SUBST(LIBATOMIC_OPS_LIBS)
10736 AC_SUBST(SYSTEM_FIREBIRD)
10737 AC_SUBST(FIREBIRD_CFLAGS)
10738 AC_SUBST(FIREBIRD_LIBS)
10739 AC_SUBST(SYSTEM_LIBTOMMATH)
10740 AC_SUBST(LIBTOMMATH_CFLAGS)
10741 AC_SUBST(LIBTOMMATH_LIBS)
10743 dnl ===================================================================
10744 dnl Check for system curl
10745 dnl ===================================================================
10746 libo_CHECK_SYSTEM_MODULE([curl],[CURL],[libcurl >= 7.68.0],enabled)
10748 if test "$enable_curl" = "yes" -a "$with_system_curl" != "yes" -a "$with_gssapi" != "no"; then
10749 if test "$_os" != "WINNT"; then
10752 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
10753 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
10759 dnl ===================================================================
10760 dnl Check for system boost
10761 dnl ===================================================================
10762 AC_MSG_CHECKING([which boost to use])
10763 if test "$with_system_boost" = "yes"; then
10764 AC_MSG_RESULT([external])
10766 AX_BOOST_BASE([1.69],,[AC_MSG_ERROR([no suitable Boost found])])
10768 AX_BOOST_FILESYSTEM
10771 AC_LANG_PUSH([C++])
10772 save_CXXFLAGS=$CXXFLAGS
10773 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
10774 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
10775 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
10776 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
10777 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
10778 CXXFLAGS=$save_CXXFLAGS
10780 # this is in m4/ax_boost_base.m4
10781 FilterLibs "${BOOST_LDFLAGS}"
10782 BOOST_LDFLAGS="${filteredlibs}"
10784 AC_MSG_RESULT([internal])
10785 BUILD_TYPE="$BUILD_TYPE BOOST"
10787 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
10788 # use warning-suppressing wrapper headers
10789 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
10791 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
10794 AC_SUBST(SYSTEM_BOOST)
10796 dnl ===================================================================
10797 dnl Check for system mdds
10798 dnl ===================================================================
10799 MDDS_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/mdds/include"
10800 libo_CHECK_SYSTEM_MODULE([mdds],[MDDS],[mdds-2.1 >= 2.1.0])
10802 dnl ===================================================================
10803 dnl Check for system dragonbox
10804 dnl ===================================================================
10805 AC_MSG_CHECKING([which dragonbox to use])
10806 if test "$with_system_dragonbox" = "yes"; then
10807 AC_MSG_RESULT([external])
10808 SYSTEM_DRAGONBOX=TRUE
10809 AC_LANG_PUSH([C++])
10810 save_CPPFLAGS=$CPPFLAGS
10811 # This is where upstream installs to, unfortunately no .pc or so...
10812 DRAGONBOX_CFLAGS=-I/usr/include/dragonbox-1.1.3
10813 CPPFLAGS="$CPPFLAGS $DRAGONBOX_CFLAGS"
10814 AC_CHECK_HEADER([dragonbox/dragonbox.h], [],
10815 [AC_MSG_ERROR([dragonbox/dragonbox.h not found. install dragonbox])], [])
10817 CPPFLAGS=$save_CPPFLAGS
10819 AC_MSG_RESULT([internal])
10820 BUILD_TYPE="$BUILD_TYPE DRAGONBOX"
10823 AC_SUBST([SYSTEM_DRAGONBOX])
10824 AC_SUBST([DRAGONBOX_CFLAGS])
10826 dnl ===================================================================
10827 dnl Check for system frozen
10828 dnl ===================================================================
10829 AC_MSG_CHECKING([which frozen to use])
10830 if test "$with_system_frozen" = "yes"; then
10831 AC_MSG_RESULT([external])
10833 AC_LANG_PUSH([C++])
10834 save_CPPFLAGS=$CPPFLAGS
10835 AC_CHECK_HEADER([frozen/unordered_map.h], [],
10836 [AC_MSG_ERROR([frozen/unordered_map.h not found. install frozen headers])], [])
10838 CPPFLAGS=$save_CPPFLAGS
10840 AC_MSG_RESULT([internal])
10841 BUILD_TYPE="$BUILD_TYPE FROZEN"
10844 AC_SUBST([SYSTEM_FROZEN])
10845 AC_SUBST([FROZEN_CFLAGS])
10847 dnl ===================================================================
10848 dnl Check for system libfixmath
10849 dnl ===================================================================
10850 AC_MSG_CHECKING([which libfixmath to use])
10851 if test "$with_system_libfixmath" = "yes"; then
10852 AC_MSG_RESULT([external])
10853 SYSTEM_LIBFIXMATH=TRUE
10854 AC_LANG_PUSH([C++])
10855 AC_CHECK_HEADER([libfixmath/fix16.hpp], [],
10856 [AC_MSG_ERROR([libfixmath/fix16.hpp not found. install libfixmath])], [])
10857 AC_CHECK_LIB([libfixmath], [fix16_mul], [LIBFIXMATH_LIBS=-llibfixmath],
10858 [AC_CHECK_LIB([fixmath], [fix16_mul], [LIBFIXMATH_LIBS=-lfixmath],
10859 [AC_MSG_ERROR(libfixmath lib not found or functional)])])
10862 AC_MSG_RESULT([internal])
10866 AC_SUBST([SYSTEM_LIBFIXMATH])
10867 AC_SUBST([LIBFIXMATH_LIBS])
10869 dnl ===================================================================
10870 dnl Check for system glm
10871 dnl ===================================================================
10872 AC_MSG_CHECKING([which glm to use])
10873 if test "$with_system_glm" = "yes"; then
10874 AC_MSG_RESULT([external])
10876 AC_LANG_PUSH([C++])
10877 AC_CHECK_HEADER([glm/glm.hpp], [],
10878 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
10881 AC_MSG_RESULT([internal])
10882 BUILD_TYPE="$BUILD_TYPE GLM"
10884 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
10886 AC_SUBST([GLM_CFLAGS])
10887 AC_SUBST([SYSTEM_GLM])
10889 dnl ===================================================================
10890 dnl Check for system odbc
10891 dnl ===================================================================
10892 AC_MSG_CHECKING([which odbc headers to use])
10893 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
10894 AC_MSG_RESULT([external])
10895 SYSTEM_ODBC_HEADERS=TRUE
10897 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
10898 save_CPPFLAGS=$CPPFLAGS
10900 PathFormat "$winsdktest"
10901 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"
10902 AC_CHECK_HEADER(sqlext.h, [],
10903 [AC_MSG_ERROR(odbc not found. install odbc)],
10904 [#include <windows.h>])
10905 CPPFLAGS=$save_CPPFLAGS
10907 AC_CHECK_HEADER(sqlext.h, [],
10908 [AC_MSG_ERROR(odbc not found. install odbc)],[])
10910 elif test "$enable_database_connectivity" = no; then
10911 AC_MSG_RESULT([none])
10913 AC_MSG_RESULT([internal])
10914 SYSTEM_ODBC_HEADERS=
10916 AC_SUBST(SYSTEM_ODBC_HEADERS)
10918 dnl ===================================================================
10919 dnl Check for system NSS
10920 dnl ===================================================================
10921 if test "$enable_fuzzers" != "yes" -a "$enable_nss" = "yes"; then
10922 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8],,system-if-linux)
10923 AC_DEFINE(HAVE_FEATURE_NSS)
10925 elif test $_os != iOS -a "$enable_openssl" != "no"; then
10928 AC_SUBST(ENABLE_NSS)
10930 dnl ===================================================================
10931 dnl Enable LDAP support
10932 dnl ===================================================================
10934 if test "$test_openldap" = yes; then
10935 AC_MSG_CHECKING([whether to enable LDAP support])
10936 if test "$enable_ldap" = yes -a \( "$enable_openssl" = yes -o "$with_system_openldap" = yes \); then
10937 AC_MSG_RESULT([yes])
10940 if test "$enable_ldap" != "yes"; then
10941 AC_MSG_RESULT([no])
10943 AC_MSG_RESULT([no (needs OPENSSL or system openldap)])
10947 dnl ===================================================================
10948 dnl Check for system openldap
10949 dnl ===================================================================
10951 if test "$ENABLE_LDAP" = TRUE; then
10952 AC_MSG_CHECKING([which openldap library to use])
10953 if test "$with_system_openldap" = yes; then
10954 AC_MSG_RESULT([external])
10955 SYSTEM_OPENLDAP=TRUE
10956 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
10957 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
10958 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
10960 AC_MSG_RESULT([internal])
10961 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
10966 AC_SUBST(ENABLE_LDAP)
10967 AC_SUBST(SYSTEM_OPENLDAP)
10969 dnl ===================================================================
10970 dnl Check for TLS/SSL and cryptographic implementation to use
10971 dnl ===================================================================
10972 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
10973 if test -n "$with_tls"; then
10976 AC_DEFINE(USE_TLS_OPENSSL)
10978 AC_MSG_RESULT([$TLS])
10980 if test "$enable_openssl" != "yes"; then
10981 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
10984 # warn that OpenSSL has been selected but not all TLS code has this option
10985 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS])
10986 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS"
10989 AC_DEFINE(USE_TLS_NSS)
10991 AC_MSG_RESULT([$TLS])
10994 AC_MSG_RESULT([none])
10995 AC_MSG_WARN([Skipping TLS/SSL])
10999 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
11001 nss - Mozilla's Network Security Services (NSS)
11006 # default to using NSS, it results in smaller oox lib
11007 AC_DEFINE(USE_TLS_NSS)
11009 AC_MSG_RESULT([$TLS])
11013 dnl ===================================================================
11014 dnl Check for system sane
11015 dnl ===================================================================
11016 AC_MSG_CHECKING([which sane header to use])
11017 if test "$with_system_sane" = "yes"; then
11018 AC_MSG_RESULT([external])
11019 AC_CHECK_HEADER(sane/sane.h, [],
11020 [AC_MSG_ERROR(sane not found. install sane)], [])
11022 AC_MSG_RESULT([internal])
11023 BUILD_TYPE="$BUILD_TYPE SANE"
11026 dnl ===================================================================
11027 dnl Check for system icu
11028 dnl ===================================================================
11031 ICU_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
11032 ICU_LIBS_internal="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
11033 libo_CHECK_SYSTEM_MODULE([icu],[ICU],[icu-i18n >= 66])
11034 if test "$SYSTEM_ICU" = TRUE; then
11035 AC_LANG_PUSH([C++])
11036 AC_MSG_CHECKING([for unicode/rbbi.h])
11037 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([icu headers not found])])
11040 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
11041 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
11042 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
11044 if test "$CROSS_COMPILING" != TRUE; then
11045 # using the system icu tools can lead to version confusion, use the
11046 # ones from the build environment when cross-compiling
11047 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
11048 if test -z "$SYSTEM_GENBRK"; then
11049 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
11051 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
11052 if test -z "$SYSTEM_GENCCODE"; then
11053 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
11055 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
11056 if test -z "$SYSTEM_GENCMN"; then
11057 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
11062 AC_SUBST(SYSTEM_GENBRK)
11063 AC_SUBST(SYSTEM_GENCCODE)
11064 AC_SUBST(SYSTEM_GENCMN)
11065 AC_SUBST(ICU_MAJOR)
11066 AC_SUBST(ICU_MINOR)
11068 dnl ==================================================================
11070 dnl ==================================================================
11071 if test "$enable_curl" = "yes"; then
11072 AC_DEFINE([HAVE_FEATURE_CURL])
11075 dnl ==================================================================
11077 dnl ==================================================================
11078 DEFAULT_CRASHDUMP_VALUE="true"
11079 AC_MSG_CHECKING([whether to enable breakpad])
11080 if test "$enable_breakpad" != yes; then
11081 AC_MSG_RESULT([no])
11083 if test "$enable_curl" != "yes"; then
11084 AC_MSG_ERROR([--disable-breakpad must be used when --disable-curl is used])
11086 AC_MSG_RESULT([yes])
11087 ENABLE_BREAKPAD="TRUE"
11088 AC_DEFINE(ENABLE_BREAKPAD)
11089 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
11090 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
11092 AC_MSG_CHECKING([for disable crash dump])
11093 if test "$enable_crashdump" = no; then
11094 DEFAULT_CRASHDUMP_VALUE="false"
11095 AC_MSG_RESULT([yes])
11097 AC_MSG_RESULT([no])
11100 AC_MSG_CHECKING([for crashreport config])
11101 if test "$with_symbol_config" = "no"; then
11102 BREAKPAD_SYMBOL_CONFIG="invalid"
11103 AC_MSG_RESULT([no])
11105 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
11106 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
11107 AC_MSG_RESULT([yes])
11109 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
11111 AC_SUBST(ENABLE_BREAKPAD)
11112 AC_SUBST(DEFAULT_CRASHDUMP_VALUE)
11114 dnl ==================================================================
11116 dnl ==================================================================
11117 if test "$enable_libcmis" = "yes"; then
11118 if test "$enable_curl" != "yes"; then
11119 AC_MSG_ERROR([--disable-libcmis must be used when --disable-curl is used])
11123 dnl ===================================================================
11125 dnl ===================================================================
11126 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.18 >= 0.19.1])
11127 if test "$with_system_orcus" != "yes"; then
11128 if test "$SYSTEM_BOOST" = "TRUE"; then
11129 dnl Link with Boost.System
11130 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
11131 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
11132 dnl in documentation has no effect.
11136 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
11137 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
11138 AC_SUBST([BOOST_SYSTEM_LIB])
11139 AC_SUBST(SYSTEM_LIBORCUS)
11141 dnl ===================================================================
11143 dnl ===================================================================
11144 harfbuzz_required_version=5.1.0
11146 GRAPHITE_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"
11147 HARFBUZZ_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/harfbuzz/src"
11150 GRAPHITE_LIBS_internal="${WORKDIR}/LinkTarget/StaticLibrary/libgraphite.a"
11151 HARFBUZZ_LIBS_internal="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.a"
11154 GRAPHITE_LIBS_internal="-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"
11155 HARFBUZZ_LIBS_internal="-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"
11158 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3])
11159 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= $harfbuzz_required_version])
11161 if test "$COM" = "MSC"; then # override the above
11162 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
11163 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
11166 if test "$with_system_harfbuzz" = "yes"; then
11167 if test "$with_system_graphite" = "no"; then
11168 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
11170 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
11172 save_CFLAGS="$CFLAGS"
11173 LIBS="$LIBS $HARFBUZZ_LIBS"
11174 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
11175 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
11177 CFLAGS="$save_CFLAGS"
11179 if test "$with_system_graphite" = "yes"; then
11180 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
11184 if test "$USING_X11" = TRUE; then
11187 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
11189 if test -z "$x_includes"; then
11190 x_includes="default_x_includes"
11192 if test -z "$x_libraries"; then
11193 x_libraries="default_x_libraries"
11195 CFLAGS="$CFLAGS $X_CFLAGS"
11196 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
11197 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
11199 x_includes="no_x_includes"
11200 x_libraries="no_x_libraries"
11203 if test "$USING_X11" = TRUE; then
11204 dnl ===================================================================
11205 dnl Check for extension headers
11206 dnl ===================================================================
11207 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
11208 [#include <X11/extensions/shape.h>])
11210 # vcl needs ICE and SM
11211 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
11212 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
11213 [AC_MSG_ERROR(ICE library not found)])
11214 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
11215 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
11216 [AC_MSG_ERROR(SM library not found)])
11219 if test "$USING_X11" = TRUE -a "$ENABLE_JAVA" != ""; then
11220 # bean/native/unix/com_sun_star_comp_beans_LocalOfficeWindow.c needs Xt
11221 AC_CHECK_HEADERS(X11/Intrinsic.h,[],[AC_MSG_ERROR([libXt headers not found])])
11224 dnl ===================================================================
11225 dnl Check for system Xrender
11226 dnl ===================================================================
11227 AC_MSG_CHECKING([whether to use Xrender])
11228 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
11229 AC_MSG_RESULT([yes])
11230 PKG_CHECK_MODULES(XRENDER, xrender)
11231 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11232 FilterLibs "${XRENDER_LIBS}"
11233 XRENDER_LIBS="${filteredlibs}"
11234 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
11235 [AC_MSG_ERROR(libXrender not found or functional)], [])
11236 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
11237 [AC_MSG_ERROR(Xrender not found. install X)], [])
11239 AC_MSG_RESULT([no])
11241 AC_SUBST(XRENDER_CFLAGS)
11242 AC_SUBST(XRENDER_LIBS)
11244 dnl ===================================================================
11245 dnl Check for XRandr
11246 dnl ===================================================================
11247 AC_MSG_CHECKING([whether to enable RandR support])
11248 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
11249 AC_MSG_RESULT([yes])
11250 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
11251 if test "$ENABLE_RANDR" != "TRUE"; then
11252 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
11253 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
11255 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
11256 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
11257 XRANDR_LIBS="-lXrandr "
11258 ENABLE_RANDR="TRUE"
11260 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11261 FilterLibs "${XRANDR_LIBS}"
11262 XRANDR_LIBS="${filteredlibs}"
11265 AC_MSG_RESULT([no])
11267 AC_SUBST(XRANDR_CFLAGS)
11268 AC_SUBST(XRANDR_LIBS)
11269 AC_SUBST(ENABLE_RANDR)
11271 if test -z "$with_webdav"; then
11272 with_webdav=$test_webdav
11275 AC_MSG_CHECKING([for WebDAV support])
11276 case "$with_webdav" in
11278 AC_MSG_RESULT([no])
11282 AC_MSG_RESULT([yes])
11283 # curl is already mandatory (almost) and checked elsewhere
11284 if test "$enable_curl" = "no"; then
11285 AC_MSG_ERROR(["--without-webdav must be used when --disable-curl is used"])
11290 AC_SUBST(WITH_WEBDAV)
11292 dnl ===================================================================
11293 dnl Check for disabling cve_tests
11294 dnl ===================================================================
11295 AC_MSG_CHECKING([whether to execute CVE tests])
11296 if test "$enable_cve_tests" = "no"; then
11297 AC_MSG_RESULT([no])
11298 DISABLE_CVE_TESTS=TRUE
11299 AC_SUBST(DISABLE_CVE_TESTS)
11301 AC_MSG_RESULT([yes])
11304 dnl ===================================================================
11305 dnl Check for system openssl
11306 dnl ===================================================================
11308 AC_MSG_CHECKING([whether to disable OpenSSL usage])
11309 if test "$enable_openssl" = "yes"; then
11310 AC_MSG_RESULT([no])
11311 ENABLE_OPENSSL=TRUE
11312 if test "$_os" = Darwin ; then
11313 # OpenSSL is deprecated when building for 10.7 or later.
11315 # https://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
11316 # https://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
11318 with_system_openssl=no
11319 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
11320 elif test "$_os" = "FreeBSD" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
11321 && test "$with_system_openssl" != "no"; then
11322 with_system_openssl=yes
11323 SYSTEM_OPENSSL=TRUE
11325 OPENSSL_LIBS="-lssl -lcrypto"
11327 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
11328 if test -n "${SYSTEM_OPENSSL}"; then
11329 AC_DEFINE([SYSTEM_OPENSSL])
11332 if test "$with_system_openssl" = "yes"; then
11333 AC_MSG_CHECKING([whether openssl supports SHA512])
11335 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
11336 SHA512_CTX context;
11337 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
11341 AC_MSG_RESULT([yes])
11343 # warn that although OpenSSL is disabled, system libraries may depend on it
11344 AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
11345 add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
11348 AC_SUBST([ENABLE_OPENSSL])
11350 if test "$enable_cipher_openssl_backend" = yes && test "$ENABLE_OPENSSL" != TRUE; then
11351 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
11352 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
11353 enable_cipher_openssl_backend=no
11355 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
11358 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
11359 ENABLE_CIPHER_OPENSSL_BACKEND=
11360 if test "$enable_cipher_openssl_backend" = yes; then
11361 AC_MSG_RESULT([yes])
11362 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
11364 AC_MSG_RESULT([no])
11366 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
11368 dnl ===================================================================
11369 dnl Select the crypto backends used by LO
11370 dnl ===================================================================
11372 if test "$build_crypto" = yes; then
11373 if test "$OS" = WNT; then
11374 BUILD_TYPE="$BUILD_TYPE CRYPTO_MSCAPI"
11375 AC_DEFINE([USE_CRYPTO_MSCAPI])
11376 elif test "$ENABLE_NSS" = TRUE; then
11377 BUILD_TYPE="$BUILD_TYPE CRYPTO_NSS"
11378 AC_DEFINE([USE_CRYPTO_NSS])
11382 ARGON2_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/argon2/include"
11383 if test "$COM" = "MSC"; then
11384 ARGON2_LIBS_internal="${WORKDIR}/UnpackedTarball/argon2/vs2015/build/Argon2OptDll.lib"
11386 ARGON2_LIBS_internal="${WORKDIR}/UnpackedTarball/argon2/libargon2.a"
11388 libo_CHECK_SYSTEM_MODULE([argon2],[ARGON2],[libargon2])
11390 dnl ===================================================================
11391 dnl Check for system redland
11392 dnl ===================================================================
11393 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
11394 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
11395 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
11396 if test "$with_system_redland" = "yes"; then
11397 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
11398 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
11404 AC_SUBST(RAPTOR_MAJOR)
11405 AC_SUBST(RASQAL_MAJOR)
11406 AC_SUBST(REDLAND_MAJOR)
11408 dnl ===================================================================
11409 dnl Check for system hunspell
11410 dnl ===================================================================
11411 AC_MSG_CHECKING([which libhunspell to use])
11412 if test "$with_system_hunspell" = "yes"; then
11413 AC_MSG_RESULT([external])
11414 SYSTEM_HUNSPELL=TRUE
11415 AC_LANG_PUSH([C++])
11416 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
11417 if test "$HUNSPELL_PC" != "TRUE"; then
11418 AC_CHECK_HEADER(hunspell.hxx, [],
11420 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
11421 [AC_MSG_ERROR(hunspell headers not found.)], [])
11423 AC_CHECK_LIB([hunspell], [main], [:],
11424 [ AC_MSG_ERROR(hunspell library not found.) ], [])
11425 HUNSPELL_LIBS=-lhunspell
11428 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11429 FilterLibs "${HUNSPELL_LIBS}"
11430 HUNSPELL_LIBS="${filteredlibs}"
11432 AC_MSG_RESULT([internal])
11434 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
11435 if test "$COM" = "MSC"; then
11436 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
11438 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
11440 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
11442 AC_SUBST(SYSTEM_HUNSPELL)
11443 AC_SUBST(HUNSPELL_CFLAGS)
11444 AC_SUBST(HUNSPELL_LIBS)
11446 dnl ===================================================================
11447 dnl Check for system zxcvbn
11448 dnl ===================================================================
11449 AC_MSG_CHECKING([which zxcvbn to use])
11450 if test "$with_system_zxcvbn" = "yes"; then
11451 AC_MSG_RESULT([external])
11453 AC_CHECK_HEADER(zxcvbn.h, [],
11454 [ AC_MSG_ERROR(zxcvbn headers not found.)], [])
11455 AC_CHECK_LIB(zxcvbn, ZxcvbnMatch, [],
11456 [ AC_MSG_ERROR(zxcvbn library not found.)], [])
11458 AC_MSG_RESULT([internal])
11459 BUILD_TYPE="$BUILD_TYPE ZXCVBN"
11462 AC_SUBST(SYSTEM_ZXCVBN)
11464 dnl ===================================================================
11465 dnl Check for system zxing
11466 dnl ===================================================================
11467 AC_MSG_CHECKING([whether to use zxing])
11468 if test "$enable_zxing" = "no"; then
11469 AC_MSG_RESULT([no])
11473 AC_MSG_RESULT([yes])
11475 AC_MSG_CHECKING([which libzxing to use])
11476 if test "$with_system_zxing" = "yes"; then
11477 AC_MSG_RESULT([external])
11480 AC_LANG_PUSH([C++])
11481 save_CXXFLAGS=$CXXFLAGS
11484 for i in $CPLUS_INCLUDE_PATH /usr/include; do
11485 dnl Reset IFS as soon as possible, to avoid unexpected side effects (and the
11486 dnl "/usr/include" fallback makes sure we get here at least once; resetting rather than
11487 dnl unsetting follows the advice at <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;
11488 dnl a=commitdiff;h=e51c9919f2cf70185b7916ac040bc0bbfd0f743b> "Add recommendation on (not)
11489 dnl unsetting IFS."):
11491 dnl TODO: GCC and Clang treat empty paths in CPLUS_INCLUDE_PATH like ".", but we simply
11492 dnl ignore them here:
11493 if test -z "$i"; then
11496 dnl TODO: White space in $i would cause problems:
11497 CXXFLAGS="$save_CXXFLAGS ${CXXFLAGS_CXX11} -I$i/ZXing"
11498 AC_CHECK_HEADER(MultiFormatWriter.h, [ZXING_CFLAGS=-I$i/ZXing; break],
11499 [unset ac_cv_header_MultiFormatWriter_h], [#include <stdexcept>])
11501 CXXFLAGS=$save_CXXFLAGS
11502 if test -z "$ZXING_CFLAGS"; then
11503 AC_MSG_ERROR(zxing headers not found.)
11505 AC_CHECK_LIB([ZXing], [main], [ZXING_LIBS=-lZXing],
11506 [ AC_CHECK_LIB([ZXingCore], [main], [ZXING_LIBS=-lZXingCore],
11507 [ AC_MSG_ERROR(zxing C++ library not found.) ])], [])
11509 ZXING_CFLAGS=$(printf '%s' "$ZXING_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11510 FilterLibs "${ZXING_LIBS}"
11511 ZXING_LIBS="${filteredlibs}"
11513 AC_MSG_RESULT([internal])
11515 BUILD_TYPE="$BUILD_TYPE ZXING"
11516 ZXING_CFLAGS="-I${WORKDIR}/UnpackedTarball/zxing/core/src"
11518 if test "$ENABLE_ZXING" = TRUE; then
11519 AC_DEFINE(ENABLE_ZXING)
11521 AC_MSG_CHECKING([whether zxing::tosvg function is available])
11522 AC_LANG_PUSH([C++])
11523 save_CXXFLAGS=$CXXFLAGS
11524 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 $ZXING_CFLAGS"
11525 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
11526 #include <BitMatrix.h>
11527 #include <BitMatrixIO.h>
11529 ZXing::BitMatrix matrix(1, 1);
11530 matrix.set(0, 0, true);
11531 ZXing::ToSVG(matrix);
11535 AC_DEFINE([HAVE_ZXING_TOSVG],[1])
11536 AC_MSG_RESULT([yes])
11537 ], [AC_MSG_RESULT([no])])
11538 CXXFLAGS=$save_CXXFLAGS
11540 AC_SUBST(HAVE_ZXING_TOSVG)
11542 AC_SUBST(SYSTEM_ZXING)
11543 AC_SUBST(ENABLE_ZXING)
11544 AC_SUBST(ZXING_CFLAGS)
11545 AC_SUBST(ZXING_LIBS)
11547 dnl ===================================================================
11548 dnl Check for system box2d
11549 dnl ===================================================================
11550 AC_MSG_CHECKING([which box2d to use])
11551 if test "$with_system_box2d" = "yes"; then
11552 AC_MSG_RESULT([external])
11554 AC_LANG_PUSH([C++])
11555 AC_CHECK_HEADER(box2d/box2d.h, [BOX2D_H_FOUND='TRUE'],
11556 [BOX2D_H_FOUND='FALSE'])
11557 if test "$BOX2D_H_FOUND" = "TRUE"; then # 2.4.0+
11559 AC_DEFINE(BOX2D_HEADER,<box2d/box2d.h>)
11561 # fail this. there's no other alternative to check when we are here.
11562 AC_CHECK_HEADER([Box2D/Box2D.h], [],
11563 [AC_MSG_ERROR(box2d headers not found.)])
11565 AC_DEFINE(BOX2D_HEADER,<Box2D/Box2D.h>)
11567 AC_CHECK_LIB([$_BOX2D_LIB], [main], [:],
11568 [ AC_MSG_ERROR(box2d library not found.) ], [])
11569 BOX2D_LIBS=-l$_BOX2D_LIB
11571 BOX2D_CFLAGS=$(printf '%s' "$BOX2D_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11572 FilterLibs "${BOX2D_LIBS}"
11573 BOX2D_LIBS="${filteredlibs}"
11575 AC_MSG_RESULT([internal])
11577 BUILD_TYPE="$BUILD_TYPE BOX2D"
11579 AC_SUBST(SYSTEM_BOX2D)
11580 AC_SUBST(BOX2D_CFLAGS)
11581 AC_SUBST(BOX2D_LIBS)
11583 dnl ===================================================================
11584 dnl Checking for altlinuxhyph
11585 dnl ===================================================================
11586 AC_MSG_CHECKING([which altlinuxhyph to use])
11587 if test "$with_system_altlinuxhyph" = "yes"; then
11588 AC_MSG_RESULT([external])
11590 AC_CHECK_HEADER(hyphen.h, [],
11591 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
11592 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
11593 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
11594 [#include <hyphen.h>])
11595 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
11596 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
11597 if test -z "$HYPHEN_LIB"; then
11598 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
11599 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
11601 if test -z "$HYPHEN_LIB"; then
11602 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
11603 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
11606 AC_MSG_RESULT([internal])
11608 BUILD_TYPE="$BUILD_TYPE HYPHEN"
11609 if test "$COM" = "MSC"; then
11610 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
11612 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
11615 AC_SUBST(SYSTEM_HYPH)
11616 AC_SUBST(HYPHEN_LIB)
11618 dnl ===================================================================
11619 dnl Checking for mythes
11620 dnl ===================================================================
11621 AC_MSG_CHECKING([which mythes to use])
11622 if test "$with_system_mythes" = "yes"; then
11623 AC_MSG_RESULT([external])
11625 AC_LANG_PUSH([C++])
11626 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
11627 if test "$MYTHES_PKGCONFIG" = "no"; then
11628 AC_CHECK_HEADER(mythes.hxx, [],
11629 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
11630 AC_CHECK_LIB([mythes-1.2], [main], [:],
11631 [ MYTHES_FOUND=no], [])
11632 if test "$MYTHES_FOUND" = "no"; then
11633 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
11634 [ MYTHES_FOUND=no], [])
11636 if test "$MYTHES_FOUND" = "no"; then
11637 AC_MSG_ERROR([mythes library not found!.])
11641 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11642 FilterLibs "${MYTHES_LIBS}"
11643 MYTHES_LIBS="${filteredlibs}"
11645 AC_MSG_RESULT([internal])
11647 BUILD_TYPE="$BUILD_TYPE MYTHES"
11648 if test "$COM" = "MSC"; then
11649 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
11651 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
11654 AC_SUBST(SYSTEM_MYTHES)
11655 AC_SUBST(MYTHES_CFLAGS)
11656 AC_SUBST(MYTHES_LIBS)
11658 dnl ===================================================================
11659 dnl How should we build the linear programming solver ?
11660 dnl ===================================================================
11663 AC_MSG_CHECKING([whether to build with CoinMP])
11664 if test "$enable_coinmp" != "no"; then
11666 AC_MSG_RESULT([yes])
11667 if test "$with_system_coinmp" = "yes"; then
11669 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
11670 FilterLibs "${COINMP_LIBS}"
11671 COINMP_LIBS="${filteredlibs}"
11673 BUILD_TYPE="$BUILD_TYPE COINMP"
11676 AC_MSG_RESULT([no])
11678 AC_SUBST(ENABLE_COINMP)
11679 AC_SUBST(SYSTEM_COINMP)
11680 AC_SUBST(COINMP_CFLAGS)
11681 AC_SUBST(COINMP_LIBS)
11684 AC_MSG_CHECKING([whether to build with lpsolve])
11685 if test "$enable_lpsolve" != "no"; then
11686 ENABLE_LPSOLVE=TRUE
11687 AC_MSG_RESULT([yes])
11689 AC_MSG_RESULT([no])
11691 AC_SUBST(ENABLE_LPSOLVE)
11693 if test "$ENABLE_LPSOLVE" = TRUE; then
11694 AC_MSG_CHECKING([which lpsolve to use])
11695 if test "$with_system_lpsolve" = "yes"; then
11696 AC_MSG_RESULT([external])
11697 SYSTEM_LPSOLVE=TRUE
11698 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
11699 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
11701 # some systems need this. Like Ubuntu...
11702 AC_CHECK_LIB(m, floor)
11703 AC_CHECK_LIB(dl, dlopen)
11704 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
11705 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
11708 AC_MSG_RESULT([internal])
11710 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
11713 AC_SUBST(SYSTEM_LPSOLVE)
11715 dnl ===================================================================
11716 dnl Checking for libexttextcat
11717 dnl ===================================================================
11718 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
11719 if test "$with_system_libexttextcat" = "yes"; then
11720 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
11722 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
11724 dnl ===================================================================
11725 dnl Checking for libnumbertext
11726 dnl ===================================================================
11727 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.6])
11728 if test "$with_system_libnumbertext" = "yes"; then
11729 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
11730 SYSTEM_LIBNUMBERTEXT=YES
11732 SYSTEM_LIBNUMBERTEXT=
11734 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
11735 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
11737 dnl ***************************************
11738 dnl testing libc version for Linux...
11739 dnl ***************************************
11740 if test "$_os" = "Linux"; then
11741 AC_MSG_CHECKING([whether the libc is recent enough])
11742 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11743 #include <features.h>
11744 #if defined(__GNU_LIBRARY__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
11745 #error glibc >= 2.1 is required
11747 ]])],, [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, upgrade libc])])
11750 dnl =========================================
11751 dnl Check for uuidgen
11752 dnl =========================================
11753 if test "$_os" = "WINNT"; then
11754 # we must use the uuidgen from the Windows SDK, which will be in the LO_PATH, but isn't in
11755 # the PATH for AC_PATH_PROG. It is already tested above in the WINDOWS_SDK_HOME check.
11756 UUIDGEN=uuidgen.exe
11759 AC_PATH_PROG([UUIDGEN], [uuidgen])
11760 if test -z "$UUIDGEN"; then
11761 AC_MSG_WARN([uuid is needed for building installation sets])
11765 dnl ***************************************
11766 dnl Checking for bison and flex
11767 dnl ***************************************
11768 AC_PATH_PROG(BISON, bison)
11769 if test -z "$BISON"; then
11770 AC_MSG_ERROR([no bison found in \$PATH, install it])
11772 AC_MSG_CHECKING([the bison version])
11773 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
11774 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
11775 dnl Accept newer than 2.0; for --enable-compiler-plugins at least 2.3 is known to be bad and
11778 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]
11779 dnl typedef union YYSTYPE
11782 dnl while at least 3.4.1 is know to be good:
11783 if test "$COMPILER_PLUGINS" = TRUE; then
11784 if test "$_bison_longver" -lt 2004; then
11785 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.4+ for --enable-compiler-plugins)])
11788 if test "$_bison_longver" -lt 2000; then
11789 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
11795 AC_PATH_PROG(FLEX, flex)
11796 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11797 FLEX=`cygpath -m $FLEX`
11799 if test -z "$FLEX"; then
11800 AC_MSG_ERROR([no flex found in \$PATH, install it])
11802 AC_MSG_CHECKING([the flex version])
11803 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
11804 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
11805 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
11810 AC_PATH_PROG(DIFF, diff)
11811 if test -z "$DIFF"; then
11812 AC_MSG_ERROR(["diff" not found in \$PATH, install it])
11816 AC_PATH_PROG(UNIQ, uniq)
11817 if test -z "$UNIQ"; then
11818 AC_MSG_ERROR(["uniq" not found in \$PATH, install it])
11822 dnl ***************************************
11823 dnl Checking for patch
11824 dnl ***************************************
11825 AC_PATH_PROG(PATCH, patch)
11826 if test -z "$PATCH"; then
11827 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
11830 dnl On Solaris or macOS, check if --with-gnu-patch was used
11831 if test "$_os" = "SunOS" -o "$_os" = "Darwin" -o "$_os" = "FreeBSD"; then
11832 if test -z "$with_gnu_patch"; then
11835 if test -x "$with_gnu_patch"; then
11836 GNUPATCH=$with_gnu_patch
11838 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
11842 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
11843 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
11844 AC_MSG_RESULT([yes])
11846 if $GNUPATCH --version | grep "2\.0-.*-Apple" >/dev/null 2>/dev/null; then
11847 AC_MSG_RESULT([no, but accepted (Apple patch)])
11848 add_warning "patch utility is not GNU patch. Apple's patch should work OK, but it might experience issues where GNU patch doesn't."
11850 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
11857 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11858 GNUPATCH=`cygpath -m $GNUPATCH`
11861 dnl We also need to check for --with-gnu-cp
11863 if test -z "$with_gnu_cp"; then
11864 # check the place where the good stuff is hidden on Solaris...
11865 if test -x /usr/gnu/bin/cp; then
11866 GNUCP=/usr/gnu/bin/cp
11868 AC_PATH_PROGS(GNUCP, gnucp cp)
11870 if test -z $GNUCP; then
11871 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
11874 if test -x "$with_gnu_cp"; then
11877 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
11881 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
11882 GNUCP=`cygpath -m $GNUCP`
11885 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
11886 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
11887 AC_MSG_RESULT([yes])
11888 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
11889 AC_MSG_RESULT([yes])
11891 case "$build_os" in
11892 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*)
11895 AC_MSG_RESULT([no gnucp found - using the system's cp command])
11898 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
11907 dnl ***************************************
11908 dnl testing assembler path
11909 dnl ***************************************
11911 if test "$_os" = "WINNT"; then
11912 case "$WIN_HOST_ARCH" in
11913 x86) assembler=ml.exe ;;
11914 x64) assembler=ml64.exe ;;
11915 arm64) assembler=armasm64.exe ;;
11918 AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
11919 if test -f "$MSVC_HOST_PATH/$assembler"; then
11920 ML_EXE=`win_short_path_for_make "$MSVC_HOST_PATH/$assembler"`
11921 AC_MSG_RESULT([$ML_EXE])
11923 AC_MSG_ERROR([not found in $MSVC_HOST_PATH])
11929 dnl ===================================================================
11930 dnl We need zip and unzip
11931 dnl ===================================================================
11932 AC_PATH_PROG(ZIP, zip)
11933 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
11934 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
11935 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],,)
11938 AC_PATH_PROG(UNZIP, unzip)
11939 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
11941 dnl ===================================================================
11942 dnl Zip must be a specific type for different build types.
11943 dnl ===================================================================
11944 if test $build_os = cygwin; then
11945 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
11946 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
11950 dnl ===================================================================
11951 dnl We need touch with -h option support.
11952 dnl ===================================================================
11953 AC_PATH_PROG(TOUCH, touch)
11954 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
11955 touch "$WARNINGS_FILE"
11956 if ! "$TOUCH" -h "$WARNINGS_FILE" 2>/dev/null > /dev/null; then
11957 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],,)
11960 dnl ===================================================================
11961 dnl Check for system epoxy
11962 dnl ===================================================================
11963 EPOXY_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/epoxy/include"
11964 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2])
11966 dnl ===================================================================
11967 dnl Show which vclplugs will be built.
11968 dnl ===================================================================
11971 libo_ENABLE_VCLPLUG([gen])
11972 libo_ENABLE_VCLPLUG([gtk3])
11973 libo_ENABLE_VCLPLUG([gtk3_kde5])
11974 libo_ENABLE_VCLPLUG([gtk4])
11975 libo_ENABLE_VCLPLUG([kf5])
11976 libo_ENABLE_VCLPLUG([kf6])
11977 libo_ENABLE_VCLPLUG([qt5])
11978 libo_ENABLE_VCLPLUG([qt6])
11980 if test "$_os" = "WINNT"; then
11982 elif test "$_os" = "Darwin"; then
11984 elif test "$_os" = "iOS"; then
11986 elif test "$_os" = Android; then
11990 build_vcl_plugins="$R"
11991 if test -z "$build_vcl_plugins"; then
11992 build_vcl_plugins=" none"
11994 AC_MSG_NOTICE([VCLplugs to be built:${build_vcl_plugins}])
11996 AC_SUBST([VCL_PLUGIN_INFO])
11998 if test "$DISABLE_DYNLOADING" = TRUE -a -z "$DISABLE_GUI" -a \( -z "$R" -o $(echo "$R" | wc -w) -ne 1 \); then
11999 AC_MSG_ERROR([Can't build --disable-dynamic-loading without --disable-gui and a single VCL plugin"])
12002 dnl ===================================================================
12003 dnl Check for GTK libraries
12004 dnl ===================================================================
12008 ENABLE_GTKTILEDVIEWER=""
12009 if test "$test_gtk3" = yes -a "x$enable_gtk3" = "xyes" -o "x$enable_gtk3_kde5" = "xyes"; then
12010 if test "$with_system_cairo" = no; then
12011 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.'
12013 : ${with_system_cairo:=yes}
12014 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)
12015 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12016 GTK3_CFLAGS="$GTK3_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
12017 FilterLibs "${GTK3_LIBS}"
12018 GTK3_LIBS="${filteredlibs}"
12020 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
12021 if test "$with_system_epoxy" != "yes"; then
12022 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
12023 AC_CHECK_HEADER(EGL/eglplatform.h, [],
12024 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
12026 elif test -n "$with_gtk3_build" -a "$OS" = "WNT"; then
12027 PathFormat "${with_gtk3_build}/lib/pkgconfig"
12028 if test "$build_os" = "cygwin"; then
12029 dnl cygwin's pkg-config does not recognize "C:/..."-style paths, only "/cygdrive/c/..."
12030 formatted_path_unix=`cygpath -au "$formatted_path_unix"`
12033 PKG_CONFIG_PATH="$formatted_path_unix"; export PKG_CONFIG_PATH
12034 PKG_CHECK_MODULES(GTK3, cairo gdk-3.0 gio-2.0 glib-2.0 gobject-2.0 gtk+-3.0)
12035 GTK3_CFLAGS="$GTK3_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
12036 FilterLibs "${GTK3_LIBS}"
12037 GTK3_LIBS="${filteredlibs}"
12038 ENABLE_GTKTILEDVIEWER="yes"
12040 AC_SUBST(GTK3_LIBS)
12041 AC_SUBST(GTK3_CFLAGS)
12042 AC_SUBST(ENABLE_GTKTILEDVIEWER)
12046 if test "$test_gtk4" = yes -a "x$enable_gtk4" = "xyes"; then
12047 if test "$with_system_cairo" = no; then
12048 add_warning 'Non-system cairo combined with gtk4 is assumed to cause trouble; proceed at your own risk.'
12050 : ${with_system_cairo:=yes}
12051 PKG_CHECK_MODULES(GTK4, gtk4 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo atk)
12052 GTK4_CFLAGS=$(printf '%s' "$GTK4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12053 GTK4_CFLAGS="$GTK4_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
12054 FilterLibs "${GTK4_LIBS}"
12055 GTK4_LIBS="${filteredlibs}"
12057 dnl We require egl only for the gtk4 plugin. Otherwise we use glx.
12058 if test "$with_system_epoxy" != "yes"; then
12059 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
12060 AC_CHECK_HEADER(EGL/eglplatform.h, [],
12061 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
12064 AC_SUBST(GTK4_LIBS)
12065 AC_SUBST(GTK4_CFLAGS)
12067 if test "$enable_introspection" = yes; then
12068 if test "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
12069 GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
12071 AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
12075 # AT-SPI2 tests require gtk3, xvfb-run, dbus-launch and atspi-2
12076 if ! test "$ENABLE_GTK3" = TRUE; then
12077 if test "$enable_atspi_tests" = yes; then
12078 AC_MSG_ERROR([--enable-atspi-tests requires --enable-gtk3])
12080 enable_atspi_tests=no
12082 if ! test "$enable_atspi_tests" = no; then
12083 AC_PATH_PROGS([XVFB_RUN], [xvfb-run], no)
12084 if ! test "$XVFB_RUN" = no; then
12085 dnl make sure the found xvfb-run actually works
12086 AC_MSG_CHECKING([whether $XVFB_RUN works...])
12087 if $XVFB_RUN --auto-servernum true >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
12088 AC_MSG_RESULT([yes])
12090 AC_MSG_RESULT([no])
12094 if test "$XVFB_RUN" = no; then
12095 if test "$enable_atspi_tests" = yes; then
12096 AC_MSG_ERROR([xvfb-run required by --enable-atspi-tests not found])
12098 enable_atspi_tests=no
12101 if ! test "$enable_atspi_tests" = no; then
12102 AC_PATH_PROGS([DBUS_LAUNCH], [dbus-launch], no)
12103 if test "$DBUS_LAUNCH" = no; then
12104 if test "$enable_atspi_tests" = yes; then
12105 AC_MSG_ERROR([dbus-launch required by --enable-atspi-tests not found])
12107 enable_atspi_tests=no
12110 if ! test "$enable_atspi_tests" = no; then
12111 PKG_CHECK_MODULES([ATSPI2], [atspi-2 gobject-2.0],,
12112 [if test "$enable_atspi_tests" = yes; then
12113 AC_MSG_ERROR([$ATSPI2_PKG_ERRORS])
12115 enable_atspi_tests=no
12118 if ! test "x$enable_atspi_tests" = xno; then
12119 PKG_CHECK_MODULES([ATSPI2_2_32], [atspi-2 >= 2.32],
12120 [have_atspi_scroll_to=1],
12121 [have_atspi_scroll_to=0])
12122 AC_DEFINE_UNQUOTED([HAVE_ATSPI2_SCROLL_TO], [$have_atspi_scroll_to],
12123 [Whether AT-SPI2 has the scrollTo API])
12125 ENABLE_ATSPI_TESTS=
12126 test "$enable_atspi_tests" = no || ENABLE_ATSPI_TESTS=TRUE
12127 AC_SUBST([ENABLE_ATSPI_TESTS])
12129 dnl ===================================================================
12130 dnl check for dbus support
12131 dnl ===================================================================
12135 DBUS_GLIB_CFLAGS=""
12139 if test "$enable_dbus" = "no"; then
12143 AC_MSG_CHECKING([whether to enable DBUS support])
12144 if test "$test_dbus" = "yes"; then
12146 AC_MSG_RESULT([yes])
12147 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
12148 AC_DEFINE(ENABLE_DBUS)
12149 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12150 FilterLibs "${DBUS_LIBS}"
12151 DBUS_LIBS="${filteredlibs}"
12153 # Glib is needed for BluetoothServer
12154 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
12155 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
12157 DBUS_HAVE_GLIB="TRUE"
12158 AC_DEFINE(DBUS_HAVE_GLIB,1)
12160 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
12163 AC_MSG_RESULT([no])
12166 AC_SUBST(ENABLE_DBUS)
12167 AC_SUBST(DBUS_CFLAGS)
12168 AC_SUBST(DBUS_LIBS)
12169 AC_SUBST(DBUS_GLIB_CFLAGS)
12170 AC_SUBST(DBUS_GLIB_LIBS)
12171 AC_SUBST(DBUS_HAVE_GLIB)
12173 AC_MSG_CHECKING([whether to enable Impress remote control])
12174 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
12175 AC_MSG_RESULT([yes])
12176 ENABLE_SDREMOTE=TRUE
12177 SDREMOTE_ENTITLEMENT=" <key>com.apple.security.network.server</key>
12179 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
12181 if test $OS = MACOSX && test "$MACOSX_SDK_VERSION" -ge 101500; then
12182 # The Bluetooth code doesn't compile with macOS SDK 10.15
12183 if test "$enable_sdremote_bluetooth" = yes; then
12184 AC_MSG_ERROR([macOS SDK $macosx_sdk does not currently support --enable-sdremote-bluetooth])
12186 add_warning "not building the bluetooth part of the sdremote - used api was removed from macOS SDK 10.15"
12187 enable_sdremote_bluetooth=no
12189 # If not explicitly enabled or disabled, default
12190 if test -z "$enable_sdremote_bluetooth"; then
12193 # Default to yes for these
12194 enable_sdremote_bluetooth=yes
12198 enable_sdremote_bluetooth=no
12202 # $enable_sdremote_bluetooth is guaranteed non-empty now
12204 if test "$enable_sdremote_bluetooth" != "no"; then
12205 if test "$OS" = "LINUX"; then
12206 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
12207 AC_MSG_RESULT([yes])
12208 ENABLE_SDREMOTE_BLUETOOTH=TRUE
12209 dnl ===================================================================
12210 dnl Check for system bluez
12211 dnl ===================================================================
12212 AC_MSG_CHECKING([which Bluetooth header to use])
12213 if test "$with_system_bluez" = "yes"; then
12214 AC_MSG_RESULT([external])
12215 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
12216 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
12219 AC_MSG_RESULT([internal])
12223 AC_MSG_RESULT([no, dbus disabled])
12224 ENABLE_SDREMOTE_BLUETOOTH=
12228 AC_MSG_RESULT([yes])
12229 ENABLE_SDREMOTE_BLUETOOTH=TRUE
12231 SDREMOTE_ENTITLEMENT="$SDREMOTE_ENTITLEMENT
12232 <key>com.apple.security.device.bluetooth</key>
12236 AC_MSG_RESULT([no])
12237 ENABLE_SDREMOTE_BLUETOOTH=
12243 AC_MSG_RESULT([no])
12245 AC_SUBST(ENABLE_SDREMOTE)
12246 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
12247 AC_SUBST(SDREMOTE_ENTITLEMENT)
12248 AC_SUBST(SYSTEM_BLUEZ)
12250 dnl ===================================================================
12251 dnl Check whether to enable GIO support
12252 dnl ===================================================================
12253 if test "$ENABLE_GTK4" = "TRUE" -o "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
12254 AC_MSG_CHECKING([whether to enable GIO support])
12255 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
12256 dnl Need at least 2.26 for the dbus support.
12257 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
12258 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
12259 if test "$ENABLE_GIO" = "TRUE"; then
12260 AC_DEFINE(ENABLE_GIO)
12261 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12262 FilterLibs "${GIO_LIBS}"
12263 GIO_LIBS="${filteredlibs}"
12266 AC_MSG_RESULT([no])
12269 AC_SUBST(ENABLE_GIO)
12270 AC_SUBST(GIO_CFLAGS)
12274 dnl ===================================================================
12276 SPLIT_APP_MODULES=""
12277 if test "$enable_split_app_modules" = "yes"; then
12278 SPLIT_APP_MODULES="TRUE"
12280 AC_SUBST(SPLIT_APP_MODULES)
12282 SPLIT_OPT_FEATURES=""
12283 if test "$enable_split_opt_features" = "yes"; then
12284 SPLIT_OPT_FEATURES="TRUE"
12286 AC_SUBST(SPLIT_OPT_FEATURES)
12288 dnl ===================================================================
12289 dnl Check whether the GStreamer libraries are available.
12290 dnl ===================================================================
12292 ENABLE_GSTREAMER_1_0=""
12294 if test "$test_gstreamer_1_0" = yes; then
12296 AC_MSG_CHECKING([whether to enable the GStreamer 1.0 avmedia backend])
12297 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
12298 ENABLE_GSTREAMER_1_0="TRUE"
12299 AC_MSG_RESULT([yes])
12300 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
12301 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12302 FilterLibs "${GSTREAMER_1_0_LIBS}"
12303 GSTREAMER_1_0_LIBS="${filteredlibs}"
12304 AC_DEFINE(ENABLE_GSTREAMER_1_0)
12306 AC_MSG_RESULT([no])
12309 AC_SUBST(GSTREAMER_1_0_CFLAGS)
12310 AC_SUBST(GSTREAMER_1_0_LIBS)
12311 AC_SUBST(ENABLE_GSTREAMER_1_0)
12313 ENABLE_OPENGL_TRANSITIONS=
12314 ENABLE_OPENGL_CANVAS=
12315 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
12317 elif test "$_os" = "Darwin"; then
12318 # We use frameworks on macOS, no need for detail checks
12319 ENABLE_OPENGL_TRANSITIONS=TRUE
12320 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
12321 ENABLE_OPENGL_CANVAS=TRUE
12322 elif test $_os = WINNT; then
12323 ENABLE_OPENGL_TRANSITIONS=TRUE
12324 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
12325 ENABLE_OPENGL_CANVAS=TRUE
12327 if test "$USING_X11" = TRUE; then
12328 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
12329 ENABLE_OPENGL_TRANSITIONS=TRUE
12330 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
12331 ENABLE_OPENGL_CANVAS=TRUE
12335 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
12336 AC_SUBST(ENABLE_OPENGL_CANVAS)
12338 dnl =================================================
12339 dnl Check whether to build with OpenCL support.
12340 dnl =================================================
12342 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE" -a "$enable_opencl" = "yes"; then
12343 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
12344 # platform (optional at run-time, used through clew).
12345 BUILD_TYPE="$BUILD_TYPE OPENCL"
12346 AC_DEFINE(HAVE_FEATURE_OPENCL)
12349 dnl =================================================
12350 dnl Check whether to build with dconf support.
12351 dnl =================================================
12353 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
12354 PKG_CHECK_MODULES([DCONF], [dconf >= 0.40.0], [], [
12355 if test "$enable_dconf" = yes; then
12356 AC_MSG_ERROR([dconf not found])
12361 AC_MSG_CHECKING([whether to enable dconf])
12362 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
12366 AC_MSG_RESULT([no])
12369 AC_DEFINE(ENABLE_DCONF)
12370 AC_MSG_RESULT([yes])
12372 AC_SUBST([DCONF_CFLAGS])
12373 AC_SUBST([DCONF_LIBS])
12374 AC_SUBST([ENABLE_DCONF])
12377 AC_MSG_CHECKING([whether to build the PDF import feature])
12379 if test -z "$enable_pdfimport" -o "$enable_pdfimport" = yes; then
12380 AC_MSG_RESULT([yes])
12381 ENABLE_PDFIMPORT=TRUE
12382 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
12384 AC_MSG_RESULT([no])
12388 AC_MSG_CHECKING([whether to build PDFium])
12390 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_pdfium" = yes; then
12391 AC_MSG_RESULT([yes])
12393 BUILD_TYPE="$BUILD_TYPE PDFIUM"
12395 AC_MSG_RESULT([no])
12397 AC_SUBST(ENABLE_PDFIUM)
12399 if test "$ENABLE_PDFIUM" = "TRUE"; then
12400 AC_MSG_CHECKING([which OpenJPEG library to use])
12401 if test "$with_system_openjpeg" = "yes"; then
12402 SYSTEM_OPENJPEG2=TRUE
12403 AC_MSG_RESULT([external])
12404 PKG_CHECK_MODULES( OPENJPEG2, libopenjp2 )
12405 OPENJPEG2_CFLAGS=$(printf '%s' "$OPENJPEG2_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12406 FilterLibs "${OPENJPEG2_LIBS}"
12407 OPENJPEG2_LIBS="${filteredlibs}"
12409 SYSTEM_OPENJPEG2=FALSE
12410 AC_MSG_RESULT([internal])
12413 AC_MSG_CHECKING([which Abseil library to use])
12414 if test "$with_system_abseil" = "yes"; then
12415 AC_MSG_RESULT([external])
12417 AC_LANG_PUSH([C++])
12418 PKG_CHECK_MODULES(ABSEIL, absl_bad_optional_access absl_bad_variant_access absl_inlined_vector )
12420 ABSEIL_CFLAGS=$(printf '%s' "$ABSEIL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12421 FilterLibs "${ABSEIL_LIBS}"
12422 ABSEIL_LIBS="${filteredlibs}"
12424 AC_MSG_RESULT([internal])
12427 AC_SUBST(SYSTEM_OPENJPEG2)
12428 AC_SUBST(SYSTEM_ABSEIL)
12429 AC_SUBST(ABSEIL_CFLAGS)
12430 AC_SUBST(ABSEIL_LIBS)
12432 dnl ===================================================================
12433 dnl Check for poppler
12434 dnl ===================================================================
12436 AC_MSG_CHECKING([whether to build Poppler])
12437 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" = "TRUE" -a $_os != Android \) -o "$enable_poppler" = yes; then
12438 AC_MSG_RESULT([yes])
12439 ENABLE_POPPLER=TRUE
12440 AC_DEFINE(HAVE_FEATURE_POPPLER)
12442 AC_MSG_RESULT([no])
12444 AC_SUBST(ENABLE_POPPLER)
12446 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
12447 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
12450 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" = "TRUE" -o "$ENABLE_PDFIUM" = "TRUE" \); then
12451 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
12454 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
12455 dnl ===================================================================
12456 dnl Check for system poppler
12457 dnl ===================================================================
12458 AC_MSG_CHECKING([which PDF import poppler to use])
12459 if test "$with_system_poppler" = "yes"; then
12460 AC_MSG_RESULT([external])
12461 SYSTEM_POPPLER=TRUE
12462 PKG_CHECK_MODULES(POPPLER,[poppler >= 0.14 poppler-cpp])
12463 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12464 FilterLibs "${POPPLER_LIBS}"
12465 POPPLER_LIBS="${filteredlibs}"
12467 AC_MSG_RESULT([internal])
12469 BUILD_TYPE="$BUILD_TYPE POPPLER"
12471 AC_DEFINE([ENABLE_PDFIMPORT],1)
12473 AC_SUBST(ENABLE_PDFIMPORT)
12474 AC_SUBST(SYSTEM_POPPLER)
12475 AC_SUBST(POPPLER_CFLAGS)
12476 AC_SUBST(POPPLER_LIBS)
12480 if test "$enable_skia" != "no" -a "$build_skia" = "yes" -a -z "$DISABLE_GUI"; then
12481 # Skia now requires at least freetype2 >= 2.8.1, which is less that what LO requires as system freetype.
12482 if test "$SYSTEM_FREETYPE" = TRUE; then
12483 PKG_CHECK_EXISTS(freetype2 >= 21.0.15, # 21.0.15 = 2.8.1
12484 [skia_freetype_ok=yes],
12485 [skia_freetype_ok=no])
12486 else # internal is ok
12487 skia_freetype_ok=yes
12489 AC_MSG_CHECKING([whether to build Skia])
12490 if test "$skia_freetype_ok" = "yes"; then
12491 if test "$enable_skia" = "debug"; then
12492 AC_MSG_RESULT([yes (debug)])
12493 ENABLE_SKIA_DEBUG=TRUE
12495 AC_MSG_RESULT([yes])
12499 if test "$ENDIANNESS" = "big" && test "$ENABLE_SKIA" = "TRUE"; then
12500 AC_MSG_ERROR([skia doesn't work/isn't supported upstream on big-endian. Use --disable-skia])
12503 AC_DEFINE(HAVE_FEATURE_SKIA)
12504 BUILD_TYPE="$BUILD_TYPE SKIA"
12506 if test "$OS" = "MACOSX"; then
12507 AC_DEFINE(SK_GANESH,1)
12508 AC_DEFINE(SK_METAL,1)
12512 AC_DEFINE(SK_GANESH,1)
12513 AC_DEFINE(SK_VULKAN,1)
12518 AC_MSG_RESULT([no (freetype too old)])
12519 add_warning "freetype version is too old for Skia library, at least 2.8.1 required, Skia support disabled"
12523 AC_MSG_CHECKING([whether to build Skia])
12524 AC_MSG_RESULT([no])
12526 AC_SUBST(ENABLE_SKIA)
12527 AC_SUBST(ENABLE_SKIA_DEBUG)
12529 LO_CLANG_CXXFLAGS_INTRINSICS_SSE2=
12530 LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3=
12531 LO_CLANG_CXXFLAGS_INTRINSICS_SSE41=
12532 LO_CLANG_CXXFLAGS_INTRINSICS_SSE42=
12533 LO_CLANG_CXXFLAGS_INTRINSICS_AVX=
12534 LO_CLANG_CXXFLAGS_INTRINSICS_AVX2=
12535 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512=
12536 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F=
12537 LO_CLANG_CXXFLAGS_INTRINSICS_F16C=
12538 LO_CLANG_CXXFLAGS_INTRINSICS_FMA=
12540 HAVE_LO_CLANG_DLLEXPORTINLINES=
12542 if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE; then
12543 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
12544 AC_MSG_CHECKING([for Clang])
12545 AC_MSG_RESULT([$LO_CLANG_CC / $LO_CLANG_CXX])
12547 if test "$_os" = "WINNT"; then
12548 AC_MSG_CHECKING([for clang-cl])
12549 if test -x "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"; then
12550 LO_CLANG_CC=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"`
12551 elif test -n "$PROGRAMFILES" -a -x "$(cygpath -u "$PROGRAMFILES/LLVM/bin/clang-cl.exe")"; then
12552 LO_CLANG_CC=`win_short_path_for_make "$PROGRAMFILES/LLVM/bin/clang-cl.exe"`
12553 elif test -x "$(cygpath -u "c:/Program Files/LLVM/bin/clang-cl.exe")"; then
12554 LO_CLANG_CC=`win_short_path_for_make "c:/Program Files/LLVM/bin/clang-cl.exe"`
12556 if test -n "$LO_CLANG_CC"; then
12557 dnl explicitly set -m32/-m64
12558 LO_CLANG_CC="$LO_CLANG_CC -m$WIN_HOST_BITS"
12559 LO_CLANG_CXX="$LO_CLANG_CC"
12560 AC_MSG_RESULT([$LO_CLANG_CC])
12562 AC_MSG_RESULT([no])
12565 AC_MSG_CHECKING([the dependency generation prefix (clang.exe -showIncludes)])
12566 echo "#include <stdlib.h>" > conftest.c
12567 LO_CLANG_SHOWINCLUDES_PREFIX=`VSLANG=1033 $LO_CLANG_CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
12568 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
12569 rm -f conftest.c conftest.obj
12570 if test -z "$LO_CLANG_SHOWINCLUDES_PREFIX"; then
12571 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
12573 AC_MSG_RESULT(["$LO_CLANG_SHOWINCLUDES_PREFIX"])
12576 AC_CHECK_PROG(LO_CLANG_CC,clang,clang,[])
12577 AC_CHECK_PROG(LO_CLANG_CXX,clang++,clang++,[])
12580 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
12581 clang2_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $LO_CLANG_CC -E - | tail -1 | sed 's/ //g'`
12582 LO_CLANG_VERSION=`echo "$clang2_version" | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
12583 if test "$LO_CLANG_VERSION" -lt 50002; then
12584 AC_MSG_WARN(["$clang2_version" is too old or unrecognized, must be at least Clang 5.0.2])
12589 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX" -a "$_os" = "WINNT"; then
12591 CXX="$LO_CLANG_CXX"
12592 AC_MSG_CHECKING([whether $CXX supports -Zc:dllexportInlines-])
12593 AC_LANG_PUSH([C++])
12594 save_CXXFLAGS=$CXXFLAGS
12595 CXXFLAGS="$CXXFLAGS -Werror -Zc:dllexportInlines-"
12596 AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
12597 HAVE_LO_CLANG_DLLEXPORTINLINES=TRUE
12598 AC_MSG_RESULT([yes])
12599 ], [AC_MSG_RESULT([no])])
12600 CXXFLAGS=$save_CXXFLAGS
12603 if test -z "$HAVE_LO_CLANG_DLLEXPORTINLINES"; then
12604 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.])
12607 if test -z "$LO_CLANG_CC" -o -z "$LO_CLANG_CXX"; then
12608 # Skia is the default on Windows and Mac, so hard-require Clang.
12609 # Elsewhere it's used just by the 'gen' VCL backend which is rarely used.
12610 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
12611 AC_MSG_ERROR([Clang compiler not found. The Skia library needs to be built using Clang, or use --disable-skia.])
12613 AC_MSG_WARN([Clang compiler not found.])
12618 CXX="$LO_CLANG_CXX"
12619 # copy&paste (and adjust) of intrinsics checks, since MSVC's -arch doesn't work well for Clang-cl
12622 flag_sse41=-msse4.1
12623 flag_sse42=-msse4.2
12626 flag_avx512="-mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd"
12627 flag_avx512f=-mavx512f
12631 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
12632 AC_LANG_PUSH([C++])
12633 save_CXXFLAGS=$CXXFLAGS
12634 CXXFLAGS="$CXXFLAGS $flag_sse2"
12635 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12636 #include <emmintrin.h>
12638 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12639 c = _mm_xor_si128 (a, b);
12643 [can_compile_sse2=yes],
12644 [can_compile_sse2=no])
12646 CXXFLAGS=$save_CXXFLAGS
12647 AC_MSG_RESULT([${can_compile_sse2}])
12648 if test "${can_compile_sse2}" = "yes" ; then
12649 LO_CLANG_CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
12652 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
12653 AC_LANG_PUSH([C++])
12654 save_CXXFLAGS=$CXXFLAGS
12655 CXXFLAGS="$CXXFLAGS $flag_ssse3"
12656 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12657 #include <tmmintrin.h>
12659 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12660 c = _mm_maddubs_epi16 (a, b);
12664 [can_compile_ssse3=yes],
12665 [can_compile_ssse3=no])
12667 CXXFLAGS=$save_CXXFLAGS
12668 AC_MSG_RESULT([${can_compile_ssse3}])
12669 if test "${can_compile_ssse3}" = "yes" ; then
12670 LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
12673 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
12674 AC_LANG_PUSH([C++])
12675 save_CXXFLAGS=$CXXFLAGS
12676 CXXFLAGS="$CXXFLAGS $flag_sse41"
12677 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12678 #include <smmintrin.h>
12680 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12681 c = _mm_cmpeq_epi64 (a, b);
12685 [can_compile_sse41=yes],
12686 [can_compile_sse41=no])
12688 CXXFLAGS=$save_CXXFLAGS
12689 AC_MSG_RESULT([${can_compile_sse41}])
12690 if test "${can_compile_sse41}" = "yes" ; then
12691 LO_CLANG_CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
12694 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
12695 AC_LANG_PUSH([C++])
12696 save_CXXFLAGS=$CXXFLAGS
12697 CXXFLAGS="$CXXFLAGS $flag_sse42"
12698 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12699 #include <nmmintrin.h>
12701 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
12702 c = _mm_cmpgt_epi64 (a, b);
12706 [can_compile_sse42=yes],
12707 [can_compile_sse42=no])
12709 CXXFLAGS=$save_CXXFLAGS
12710 AC_MSG_RESULT([${can_compile_sse42}])
12711 if test "${can_compile_sse42}" = "yes" ; then
12712 LO_CLANG_CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
12715 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
12716 AC_LANG_PUSH([C++])
12717 save_CXXFLAGS=$CXXFLAGS
12718 CXXFLAGS="$CXXFLAGS $flag_avx"
12719 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12720 #include <immintrin.h>
12722 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
12723 c = _mm256_xor_ps(a, b);
12727 [can_compile_avx=yes],
12728 [can_compile_avx=no])
12730 CXXFLAGS=$save_CXXFLAGS
12731 AC_MSG_RESULT([${can_compile_avx}])
12732 if test "${can_compile_avx}" = "yes" ; then
12733 LO_CLANG_CXXFLAGS_INTRINSICS_AVX="$flag_avx"
12736 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
12737 AC_LANG_PUSH([C++])
12738 save_CXXFLAGS=$CXXFLAGS
12739 CXXFLAGS="$CXXFLAGS $flag_avx2"
12740 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12741 #include <immintrin.h>
12743 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
12744 c = _mm256_maddubs_epi16(a, b);
12748 [can_compile_avx2=yes],
12749 [can_compile_avx2=no])
12751 CXXFLAGS=$save_CXXFLAGS
12752 AC_MSG_RESULT([${can_compile_avx2}])
12753 if test "${can_compile_avx2}" = "yes" ; then
12754 LO_CLANG_CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
12757 AC_MSG_CHECKING([whether $CXX can compile AVX512 intrinsics])
12758 AC_LANG_PUSH([C++])
12759 save_CXXFLAGS=$CXXFLAGS
12760 CXXFLAGS="$CXXFLAGS $flag_avx512"
12761 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12762 #include <immintrin.h>
12764 __m512i a = _mm512_loadu_si512(0);
12765 __m512d v1 = _mm512_load_pd(0);
12766 // https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=gcc/config/i386/avx512fintrin.h;h=23bce99cbe7016a04e14c2163ed3fe6a5a64f4e2
12767 __m512d v2 = _mm512_abs_pd(v1);
12771 [can_compile_avx512=yes],
12772 [can_compile_avx512=no])
12774 CXXFLAGS=$save_CXXFLAGS
12775 AC_MSG_RESULT([${can_compile_avx512}])
12776 if test "${can_compile_avx512}" = "yes" ; then
12777 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512="$flag_avx512"
12778 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F="$flag_avx512f"
12781 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
12782 AC_LANG_PUSH([C++])
12783 save_CXXFLAGS=$CXXFLAGS
12784 CXXFLAGS="$CXXFLAGS $flag_f16c"
12785 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12786 #include <immintrin.h>
12788 __m128i a = _mm_set1_epi32 (0);
12790 c = _mm_cvtph_ps(a);
12794 [can_compile_f16c=yes],
12795 [can_compile_f16c=no])
12797 CXXFLAGS=$save_CXXFLAGS
12798 AC_MSG_RESULT([${can_compile_f16c}])
12799 if test "${can_compile_f16c}" = "yes" ; then
12800 LO_CLANG_CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
12803 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
12804 AC_LANG_PUSH([C++])
12805 save_CXXFLAGS=$CXXFLAGS
12806 CXXFLAGS="$CXXFLAGS $flag_fma"
12807 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
12808 #include <immintrin.h>
12810 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
12811 d = _mm256_fmadd_ps(a, b, c);
12815 [can_compile_fma=yes],
12816 [can_compile_fma=no])
12818 CXXFLAGS=$save_CXXFLAGS
12819 AC_MSG_RESULT([${can_compile_fma}])
12820 if test "${can_compile_fma}" = "yes" ; then
12821 LO_CLANG_CXXFLAGS_INTRINSICS_FMA="$flag_fma"
12828 # prefix LO_CLANG_CC/LO_CLANG_CXX with ccache if needed
12830 if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
12831 AC_MSG_CHECKING([whether $LO_CLANG_CC is already ccached])
12835 save_CFLAGS=$CFLAGS
12836 CFLAGS="$CFLAGS --ccache-skip -O2 -Werror"
12837 dnl an empty program will do, we're checking the compiler flags
12838 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
12839 [use_ccache=yes], [use_ccache=no])
12840 CFLAGS=$save_CFLAGS
12842 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
12843 AC_MSG_RESULT([yes])
12845 LO_CLANG_CC="$CCACHE $LO_CLANG_CC"
12846 AC_MSG_RESULT([no])
12850 AC_MSG_CHECKING([whether $LO_CLANG_CXX is already ccached])
12851 AC_LANG_PUSH([C++])
12853 CXX="$LO_CLANG_CXX"
12854 save_CXXFLAGS=$CXXFLAGS
12855 CXXFLAGS="$CXXFLAGS --ccache-skip -O2 -Werror"
12856 dnl an empty program will do, we're checking the compiler flags
12857 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
12858 [use_ccache=yes], [use_ccache=no])
12859 if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
12860 AC_MSG_RESULT([yes])
12862 LO_CLANG_CXX="$CCACHE $LO_CLANG_CXX"
12863 AC_MSG_RESULT([no])
12865 CXXFLAGS=$save_CXXFLAGS
12870 AC_SUBST(LO_CLANG_CC)
12871 AC_SUBST(LO_CLANG_CXX)
12872 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE2)
12873 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3)
12874 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE41)
12875 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE42)
12876 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX)
12877 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX2)
12878 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512)
12879 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512F)
12880 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_F16C)
12881 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_FMA)
12882 AC_SUBST(LO_CLANG_SHOWINCLUDES_PREFIX)
12883 AC_SUBST(LO_CLANG_VERSION)
12884 AC_SUBST(CLANG_USE_LD)
12885 AC_SUBST([HAVE_LO_CLANG_DLLEXPORTINLINES])
12889 AC_MSG_CHECKING([whether to enable gpgmepp])
12890 if test "$enable_gpgmepp" = no; then
12891 AC_MSG_RESULT([no])
12892 elif test "$enable_mpl_subset" = "yes"; then
12893 AC_MSG_RESULT([no (MPL only)])
12894 elif test "$enable_fuzzers" = "yes"; then
12895 AC_MSG_RESULT([no (oss-fuzz)])
12896 elif test \( \( "$_os" = "Linux" -o "$_os" = "Darwin" \) -a "$ENABLE_NSS" = TRUE \) -o "$_os" = "WINNT" ; then
12897 AC_MSG_RESULT([yes])
12898 dnl ===================================================================
12899 dnl Check for system gpgme
12900 dnl ===================================================================
12901 AC_MSG_CHECKING([which gpgmepp to use])
12902 if test "$with_system_gpgmepp" = "yes"; then
12903 AC_MSG_RESULT([external])
12904 SYSTEM_GPGMEPP=TRUE
12906 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
12907 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
12908 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp >= 1.14 development package])], [])
12909 AC_CHECK_HEADER(gpgme.h, [],
12910 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
12911 AC_CHECK_LIB(gpgmepp, main, [],
12912 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
12913 GPGMEPP_LIBS=-lgpgmepp
12915 AC_MSG_RESULT([internal])
12916 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
12918 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
12919 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
12920 if test "$_os" != "WINNT"; then
12921 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
12922 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
12925 ENABLE_GPGMEPP=TRUE
12926 AC_DEFINE([HAVE_FEATURE_GPGME])
12927 AC_PATH_PROG(GPG, gpg)
12928 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
12929 # so let's exclude that manually for the moment
12930 if test -n "$GPG" -a "$_os" != "WINNT"; then
12931 # make sure we not only have a working gpgme, but a full working
12932 # gpg installation to run OpenPGP signature verification
12933 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
12935 if test "$_os" = "Linux"; then
12937 AC_MSG_CHECKING([for /run/user/$uid])
12938 if test -d /run/user/$uid; then
12939 AC_MSG_RESULT([yes])
12940 AC_PATH_PROG(GPGCONF, gpgconf)
12942 # Older versions of gpgconf are not working as expected, since
12943 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
12944 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
12945 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
12946 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
12947 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
12948 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
12949 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
12950 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
12951 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
12952 if $GPGCONF --dump-options > /dev/null ; then
12953 if $GPGCONF --dump-options | grep -q create-socketdir ; then
12954 AC_MSG_RESULT([yes])
12955 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
12956 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
12958 AC_MSG_RESULT([no])
12961 AC_MSG_RESULT([no. missing or broken gpgconf?])
12964 AC_MSG_RESULT([no, $GPGCONF_VERSION])
12967 AC_MSG_RESULT([no])
12971 AC_MSG_RESULT([no (unsupported OS or missing NSS)])
12973 AC_SUBST(ENABLE_GPGMEPP)
12974 AC_SUBST(SYSTEM_GPGMEPP)
12975 AC_SUBST(GPG_ERROR_CFLAGS)
12976 AC_SUBST(GPG_ERROR_LIBS)
12977 AC_SUBST(LIBASSUAN_CFLAGS)
12978 AC_SUBST(LIBASSUAN_LIBS)
12979 AC_SUBST(GPGMEPP_CFLAGS)
12980 AC_SUBST(GPGMEPP_LIBS)
12982 AC_MSG_CHECKING([whether to build Java Websocket for the UNO remote websocket client])
12983 if test "$with_java" != "no"; then
12984 AC_MSG_RESULT([yes])
12985 ENABLE_JAVA_WEBSOCKET=TRUE
12986 BUILD_TYPE="$BUILD_TYPE JAVA_WEBSOCKET"
12989 AC_MSG_RESULT([no])
12990 ENABLE_JAVA_WEBSOCKET=
12992 AC_SUBST(ENABLE_JAVA_WEBSOCKET)
12994 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
12995 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
12996 AC_MSG_RESULT([yes])
12997 ENABLE_MEDIAWIKI=TRUE
12998 BUILD_TYPE="$BUILD_TYPE XSLTML"
12999 if test "x$with_java" = "xno"; then
13000 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
13003 AC_MSG_RESULT([no])
13005 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
13007 AC_SUBST(ENABLE_MEDIAWIKI)
13009 AC_MSG_CHECKING([whether to build the Report Builder])
13010 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
13011 AC_MSG_RESULT([yes])
13012 ENABLE_REPORTBUILDER=TRUE
13013 AC_MSG_CHECKING([which jfreereport libs to use])
13014 if test "$with_system_jfreereport" = "yes"; then
13015 SYSTEM_JFREEREPORT=TRUE
13016 AC_MSG_RESULT([external])
13017 if test -z $SAC_JAR; then
13018 SAC_JAR=/usr/share/java/sac.jar
13020 if ! test -f $SAC_JAR; then
13021 AC_MSG_ERROR(sac.jar not found.)
13024 if test -z $LIBXML_JAR; then
13025 if test -f /usr/share/java/libxml-1.0.0.jar; then
13026 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
13027 elif test -f /usr/share/java/libxml.jar; then
13028 LIBXML_JAR=/usr/share/java/libxml.jar
13030 AC_MSG_ERROR(libxml.jar replacement not found.)
13032 elif ! test -f $LIBXML_JAR; then
13033 AC_MSG_ERROR(libxml.jar not found.)
13036 if test -z $FLUTE_JAR; then
13037 if test -f /usr/share/java/flute-1.3.0.jar; then
13038 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
13039 elif test -f /usr/share/java/flute.jar; then
13040 FLUTE_JAR=/usr/share/java/flute.jar
13042 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
13044 elif ! test -f $FLUTE_JAR; then
13045 AC_MSG_ERROR(flute-1.3.0.jar not found.)
13048 if test -z $JFREEREPORT_JAR; then
13049 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
13050 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
13051 elif test -f /usr/share/java/flow-engine.jar; then
13052 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
13054 AC_MSG_ERROR(jfreereport.jar replacement not found.)
13056 elif ! test -f $JFREEREPORT_JAR; then
13057 AC_MSG_ERROR(jfreereport.jar not found.)
13060 if test -z $LIBLAYOUT_JAR; then
13061 if test -f /usr/share/java/liblayout-0.2.9.jar; then
13062 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
13063 elif test -f /usr/share/java/liblayout.jar; then
13064 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
13066 AC_MSG_ERROR(liblayout.jar replacement not found.)
13068 elif ! test -f $LIBLAYOUT_JAR; then
13069 AC_MSG_ERROR(liblayout.jar not found.)
13072 if test -z $LIBLOADER_JAR; then
13073 if test -f /usr/share/java/libloader-1.0.0.jar; then
13074 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
13075 elif test -f /usr/share/java/libloader.jar; then
13076 LIBLOADER_JAR=/usr/share/java/libloader.jar
13078 AC_MSG_ERROR(libloader.jar replacement not found.)
13080 elif ! test -f $LIBLOADER_JAR; then
13081 AC_MSG_ERROR(libloader.jar not found.)
13084 if test -z $LIBFORMULA_JAR; then
13085 if test -f /usr/share/java/libformula-0.2.0.jar; then
13086 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
13087 elif test -f /usr/share/java/libformula.jar; then
13088 LIBFORMULA_JAR=/usr/share/java/libformula.jar
13090 AC_MSG_ERROR(libformula.jar replacement not found.)
13092 elif ! test -f $LIBFORMULA_JAR; then
13093 AC_MSG_ERROR(libformula.jar not found.)
13096 if test -z $LIBREPOSITORY_JAR; then
13097 if test -f /usr/share/java/librepository-1.0.0.jar; then
13098 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
13099 elif test -f /usr/share/java/librepository.jar; then
13100 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
13102 AC_MSG_ERROR(librepository.jar replacement not found.)
13104 elif ! test -f $LIBREPOSITORY_JAR; then
13105 AC_MSG_ERROR(librepository.jar not found.)
13108 if test -z $LIBFONTS_JAR; then
13109 if test -f /usr/share/java/libfonts-1.0.0.jar; then
13110 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
13111 elif test -f /usr/share/java/libfonts.jar; then
13112 LIBFONTS_JAR=/usr/share/java/libfonts.jar
13114 AC_MSG_ERROR(libfonts.jar replacement not found.)
13116 elif ! test -f $LIBFONTS_JAR; then
13117 AC_MSG_ERROR(libfonts.jar not found.)
13120 if test -z $LIBSERIALIZER_JAR; then
13121 if test -f /usr/share/java/libserializer-1.0.0.jar; then
13122 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
13123 elif test -f /usr/share/java/libserializer.jar; then
13124 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
13126 AC_MSG_ERROR(libserializer.jar replacement not found.)
13128 elif ! test -f $LIBSERIALIZER_JAR; then
13129 AC_MSG_ERROR(libserializer.jar not found.)
13132 if test -z $LIBBASE_JAR; then
13133 if test -f /usr/share/java/libbase-1.0.0.jar; then
13134 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
13135 elif test -f /usr/share/java/libbase.jar; then
13136 LIBBASE_JAR=/usr/share/java/libbase.jar
13138 AC_MSG_ERROR(libbase.jar replacement not found.)
13140 elif ! test -f $LIBBASE_JAR; then
13141 AC_MSG_ERROR(libbase.jar not found.)
13145 AC_MSG_RESULT([internal])
13146 SYSTEM_JFREEREPORT=
13147 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
13150 BUILD_TYPE="$BUILD_TYPE REPORTBUILDER"
13152 AC_MSG_RESULT([no])
13153 ENABLE_REPORTBUILDER=
13154 SYSTEM_JFREEREPORT=
13156 AC_SUBST(ENABLE_REPORTBUILDER)
13157 AC_SUBST(SYSTEM_JFREEREPORT)
13159 AC_SUBST(LIBXML_JAR)
13160 AC_SUBST(FLUTE_JAR)
13161 AC_SUBST(JFREEREPORT_JAR)
13162 AC_SUBST(LIBBASE_JAR)
13163 AC_SUBST(LIBLAYOUT_JAR)
13164 AC_SUBST(LIBLOADER_JAR)
13165 AC_SUBST(LIBFORMULA_JAR)
13166 AC_SUBST(LIBREPOSITORY_JAR)
13167 AC_SUBST(LIBFONTS_JAR)
13168 AC_SUBST(LIBSERIALIZER_JAR)
13170 # scripting provider for BeanShell?
13171 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
13172 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
13173 AC_MSG_RESULT([yes])
13174 ENABLE_SCRIPTING_BEANSHELL=TRUE
13176 dnl ===================================================================
13177 dnl Check for system beanshell
13178 dnl ===================================================================
13179 AC_MSG_CHECKING([which beanshell to use])
13180 if test "$with_system_beanshell" = "yes"; then
13181 AC_MSG_RESULT([external])
13183 if test -z $BSH_JAR; then
13184 BSH_JAR=/usr/share/java/bsh.jar
13186 if ! test -f $BSH_JAR; then
13187 AC_MSG_ERROR(bsh.jar not found.)
13190 AC_MSG_RESULT([internal])
13192 BUILD_TYPE="$BUILD_TYPE BSH"
13195 AC_MSG_RESULT([no])
13196 ENABLE_SCRIPTING_BEANSHELL=
13197 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
13199 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
13200 AC_SUBST(SYSTEM_BSH)
13203 # scripting provider for JavaScript?
13204 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
13205 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
13206 AC_MSG_RESULT([yes])
13207 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
13209 dnl ===================================================================
13210 dnl Check for system rhino
13211 dnl ===================================================================
13212 AC_MSG_CHECKING([which rhino to use])
13213 if test "$with_system_rhino" = "yes"; then
13214 AC_MSG_RESULT([external])
13216 if test -z $RHINO_JAR; then
13217 RHINO_JAR=/usr/share/java/js.jar
13219 if ! test -f $RHINO_JAR; then
13220 AC_MSG_ERROR(js.jar not found.)
13223 AC_MSG_RESULT([internal])
13225 BUILD_TYPE="$BUILD_TYPE RHINO"
13229 AC_MSG_RESULT([no])
13230 ENABLE_SCRIPTING_JAVASCRIPT=
13231 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
13233 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
13234 AC_SUBST(SYSTEM_RHINO)
13235 AC_SUBST(RHINO_JAR)
13237 # This is only used in Qt5/Qt6/KF5/KF6 checks to determine if /usr/lib64
13238 # paths should be added to library search path. So lets put all 64-bit
13241 case "$host_cpu" in
13242 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el | loongarch64 | riscv64)
13243 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
13244 supports_multilib="yes"
13251 dnl ===================================================================
13252 dnl QT5 Integration
13253 dnl ===================================================================
13257 QT5_GOBJECT_CFLAGS=""
13258 QT5_GOBJECT_LIBS=""
13259 QT5_HAVE_GOBJECT=""
13260 QT5_PLATFORMS_SRCDIR=""
13261 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
13262 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
13263 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
13265 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
13266 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
13268 if test -n "$supports_multilib"; then
13269 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
13272 qt5_test_include="QtWidgets/qapplication.h"
13273 if test "$_os" = "Emscripten"; then
13274 qt5_test_library="libQt5Widgets.a"
13276 qt5_test_library="libQt5Widgets.so"
13279 dnl Check for qmake5
13280 if test -n "$QT5DIR"; then
13281 AC_PATH_PROG(QMAKE5, [qmake], no, [$QT5DIR/bin])
13283 AC_PATH_PROGS(QMAKE5, [qmake-qt5 qmake], no)
13285 if test "$QMAKE5" = "no"; then
13286 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13288 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
13289 if test -z "$qmake5_test_ver"; then
13290 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13292 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
13293 qt5_minimal_minor="15"
13294 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
13295 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
13297 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
13301 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
13302 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
13303 qt5_platformsdir="`$QMAKE5 -query QT_INSTALL_PLUGINS`/platforms"
13304 QT5_PLATFORMS_SRCDIR="$qt5_platformsdir"
13306 AC_MSG_CHECKING([for Qt5 headers])
13308 for inc_dir in $qt5_incdirs; do
13309 if test -r "$inc_dir/$qt5_test_include"; then
13310 qt5_incdir="$inc_dir"
13314 AC_MSG_RESULT([$qt5_incdir])
13315 if test "x$qt5_incdir" = "xno"; then
13316 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13318 # check for scenario: qt5-qtbase-devel-*.86_64 installed but host is i686
13319 AC_LANG_PUSH([C++])
13320 save_CPPFLAGS=$CPPFLAGS
13321 CPPFLAGS="${CPPFLAGS} -I${qt5_incdir}"
13322 AC_CHECK_HEADER(QtCore/qconfig.h, [],
13323 [AC_MSG_ERROR(qconfig.h header not found.)], [])
13324 CPPFLAGS=$save_CPPFLAGS
13327 AC_MSG_CHECKING([for Qt5 libraries])
13329 for lib_dir in $qt5_libdirs; do
13330 if test -r "$lib_dir/$qt5_test_library"; then
13331 qt5_libdir="$lib_dir"
13335 AC_MSG_RESULT([$qt5_libdir])
13336 if test "x$qt5_libdir" = "xno"; then
13337 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
13340 if test "$_os" = "Emscripten"; then
13341 if test ! -f "$QT5_PLATFORMS_SRCDIR"/wasm_shell.html ; then
13342 QT5_PLATFORMS_SRCDIR="${QT5_PLATFORMS_SRCDIR/plugins/src\/plugins}/wasm"
13344 if test ! -f "${qt5_platformsdir}"/libqwasm.a -o ! -f "$QT5_PLATFORMS_SRCDIR"/wasm_shell.html; then
13345 AC_MSG_ERROR([No Qt5 WASM QPA plugin found in ${qt5_platformsdir} or ${QT5_PLATFORMS_SRCDIR}])
13348 EMSDK_LLVM_NM="$(em-config LLVM_ROOT)"/llvm-nm
13349 if ! test -x "$EMSDK_LLVM_NM"; then
13350 AC_MSG_ERROR([Missing llvm-nm expected to be found at "$EMSDK_LLVM_NM".])
13352 if test ! -f "${qt5_libdir}"/libQt5Gui.a; then
13353 AC_MSG_ERROR([No Qt5 WASM libQt5Gui.a in ${qt5_libdir}])
13355 QT5_WASM_SJLJ="`${EMSDK_LLVM_NM} "${qt5_libdir}"/libQt5Gui.a 2>/dev/null | $GREP emscripten_longjmp`"
13356 if test -n "$QT5_WASM_SJLJ"; then
13357 AC_MSG_ERROR(['emscripten_longjmp' symbol found in libQt5Gui.a (missing '-s SUPPORT_LONGJMP=wasm'). See static/README.wasm.md.])
13361 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
13362 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13363 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
13364 if test "$_os" = "Emscripten"; then
13365 QT5_LIBS="$QT5_LIBS -lqtpcre2 -lQt5EventDispatcherSupport -lQt5FontDatabaseSupport -L${qt5_platformsdir} -lqwasm"
13368 if test "$USING_X11" = TRUE; then
13369 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
13370 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
13371 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
13373 AC_DEFINE(QT5_USING_X11)
13376 dnl Check for Meta Object Compiler
13378 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH])
13379 if test "$MOC5" = "no"; then
13380 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
13381 the root of your Qt installation by exporting QT5DIR before running "configure".])
13384 if test "$test_gstreamer_1_0" = yes; then
13385 PKG_CHECK_MODULES(QT5_GOBJECT,[gobject-2.0], [
13387 AC_DEFINE(QT5_HAVE_GOBJECT)
13389 AC_MSG_WARN([[No GObject found, can't use QWidget GStreamer sink on wayland!]])
13393 AC_SUBST(QT5_CFLAGS)
13396 AC_SUBST(QT5_GOBJECT_CFLAGS)
13397 AC_SUBST(QT5_GOBJECT_LIBS)
13398 AC_SUBST(QT5_HAVE_GOBJECT)
13399 AC_SUBST(QT5_PLATFORMS_SRCDIR)
13401 dnl ===================================================================
13402 dnl QT6 Integration
13403 dnl ===================================================================
13407 QT6_PLATFORMS_SRCDIR=""
13408 ENABLE_QT6_MULTIMEDIA=""
13409 if test \( "$test_kf6" = "yes" -a "$ENABLE_KF6" = "TRUE" \) -o \
13410 \( "$test_qt6" = "yes" -a "$ENABLE_QT6" = "TRUE" \)
13412 qt6_incdirs="$QT6INC /usr/include/qt6 /usr/include $x_includes"
13413 qt6_libdirs="$QT6LIB /usr/lib/qt6 /usr/lib $x_libraries"
13415 if test -n "$supports_multilib"; then
13416 qt6_libdirs="$qt6_libdirs /usr/lib64/qt6 /usr/lib64/qt /usr/lib64"
13419 qt6_test_include="QtWidgets/qapplication.h"
13420 if test "$_os" = "Emscripten"; then
13421 qt6_test_library="libQt6Widgets.a"
13423 qt6_test_library="libQt6Widgets.so"
13426 dnl Check for qmake6
13427 if test -n "$QT6DIR"; then
13428 AC_PATH_PROG(QMAKE6, [qmake], no, [$QT6DIR/bin])
13430 AC_PATH_PROGS(QMAKE6, [qmake-qt6 qmake6 qmake], no)
13432 if test "$QMAKE6" = "no"; then
13433 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13435 qmake6_test_ver="`$QMAKE6 -v 2>&1 | $SED -n -e 's/^Using Qt version \(6\.[[0-9.]]\+\).*$/\1/p'`"
13436 if test -z "$qmake6_test_ver"; then
13437 AC_MSG_ERROR([Wrong qmake for Qt6 found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13439 AC_MSG_NOTICE([Detected Qt6 version: $qmake6_test_ver])
13442 qt6_incdirs="`$QMAKE6 -query QT_INSTALL_HEADERS` $qt6_incdirs"
13443 qt6_libdirs="`$QMAKE6 -query QT_INSTALL_LIBS` $qt6_libdirs"
13444 qt6_platformsdir="`$QMAKE6 -query QT_INSTALL_PLUGINS`/platforms"
13445 QT6_PLATFORMS_SRCDIR="$qt6_platformsdir"
13447 AC_MSG_CHECKING([for Qt6 headers])
13449 for inc_dir in $qt6_incdirs; do
13450 if test -r "$inc_dir/$qt6_test_include"; then
13451 qt6_incdir="$inc_dir"
13455 AC_MSG_RESULT([$qt6_incdir])
13456 if test "x$qt6_incdir" = "xno"; then
13457 AC_MSG_ERROR([Qt6 headers not found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13459 # check for scenario: qt6-qtbase-devel-*.86_64 installed but host is i686
13460 AC_LANG_PUSH([C++])
13461 save_CPPFLAGS=$CPPFLAGS
13462 CPPFLAGS="${CPPFLAGS} -I${qt6_incdir}"
13463 AC_CHECK_HEADER(QtCore/qconfig.h, [],
13464 [AC_MSG_ERROR(qconfig.h header not found.)], [])
13465 CPPFLAGS=$save_CPPFLAGS
13468 AC_MSG_CHECKING([for Qt6 libraries])
13470 for lib_dir in $qt6_libdirs; do
13471 if test -r "$lib_dir/$qt6_test_library"; then
13472 qt6_libdir="$lib_dir"
13476 AC_MSG_RESULT([$qt6_libdir])
13477 if test "x$qt6_libdir" = "xno"; then
13478 AC_MSG_ERROR([Qt6 libraries not found. Please specify the root of your Qt6 installation by exporting QT6DIR before running "configure".])
13481 if test "$_os" = "Emscripten"; then
13482 if test ! -f "$QT6_PLATFORMS_SRCDIR"/wasm_shell.html ; then
13483 QT6_PLATFORMS_SRCDIR="${QT6_PLATFORMS_SRCDIR/plugins/src\/plugins}/wasm"
13485 if test ! -f "${qt6_platformsdir}"/libqwasm.a -o ! -f "$QT6_PLATFORMS_SRCDIR"/wasm_shell.html; then
13486 AC_MSG_ERROR([No Qt6 WASM QPA plugin found in ${qt6_platformsdir} or ${QT6_PLATFORMS_SRCDIR}])
13490 QT6_CFLAGS="-I$qt6_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
13491 QT6_CFLAGS=$(printf '%s' "$QT6_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13492 QT6_LIBS="-L$qt6_libdir -lQt6Core -lQt6Gui -lQt6Widgets -lQt6Network"
13493 if test "$_os" = "Emscripten"; then
13494 QT6_LIBS="$QT6_LIBS -lQt6BundledPcre2 -lQt6BundledZLIB -L${qt6_platformsdir} -lqwasm -sGL_ENABLE_GET_PROC_ADDRESS"
13496 if ! test "$enable_qt6_multimedia" = "no"; then
13497 if ! test -r "$qt6_incdir/QtMultimediaWidgets/QVideoWidget"; then
13498 AC_MSG_ERROR([Qt 6 QMultimedia not found.])
13501 ENABLE_QT6_MULTIMEDIA=TRUE
13502 QT6_LIBS="$QT6_LIBS -lQt6Multimedia -lQt6MultimediaWidgets"
13506 if test "$USING_X11" = TRUE; then
13507 PKG_CHECK_MODULES(QT6_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for key modifier handling in X11.])])
13508 QT6_CFLAGS="$QT6_CFLAGS $QT6_XCB_CFLAGS"
13509 QT6_LIBS="$QT6_LIBS $QT6_XCB_LIBS"
13511 AC_DEFINE(QT6_USING_X11)
13514 dnl Check for Meta Object Compiler
13516 for lib_dir in $qt6_libdirs; do
13517 if test -z "$qt6_libexec_dirs"; then
13518 qt6_libexec_dirs="$lib_dir/libexec"
13520 qt6_libexec_dirs="$qt6_libexec_dirs:$lib_dir/libexec"
13523 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])
13524 if test "$MOC6" = "no"; then
13525 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
13526 the root of your Qt installation by exporting QT6DIR before running "configure".])
13528 moc6_test_ver="`$MOC6 -v 2>&1 | $SED -n -e 's/^moc \(6.*\)/\1/p'`"
13529 if test -z "$moc6_test_ver"; then
13530 AC_MSG_ERROR([Wrong moc for Qt6 found.])
13532 AC_MSG_NOTICE([Detected moc version: $moc_test_ver])
13535 AC_SUBST(QT6_CFLAGS)
13538 AC_SUBST(QT6_PLATFORMS_SRCDIR)
13539 AC_SUBST(ENABLE_QT6_MULTIMEDIA)
13541 dnl ===================================================================
13542 dnl KF5 Integration
13543 dnl ===================================================================
13547 KF5_CONFIG="kf5-config"
13548 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
13549 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
13551 if test "$OS" = "HAIKU"; then
13552 haiku_arch="`echo $RTL_ARCH | tr X x`"
13553 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
13554 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
13557 kf5_incdirs="$KF5INC /usr/include $kf5_haiku_incdirs $x_includes"
13558 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
13559 if test -n "$supports_multilib"; then
13560 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
13563 kf5_test_include="KF5/KIOFileWidgets/KFileWidget"
13564 kf5_test_library="libKF5KIOFileWidgets.so"
13565 kf5_libdirs="$qt5_libdir $kf5_libdirs"
13567 dnl kf5 KDE4 support compatibility installed
13568 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
13569 if test "$KF5_CONFIG" != "no"; then
13570 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
13571 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
13574 dnl Check for KF5 headers
13575 AC_MSG_CHECKING([for KF5 headers])
13577 for kf5_check in $kf5_incdirs; do
13578 if test -r "$kf5_check/$kf5_test_include"; then
13579 kf5_incdir="$kf5_check/KF5"
13583 AC_MSG_RESULT([$kf5_incdir])
13584 if test "x$kf5_incdir" = "xno"; then
13585 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
13588 dnl Check for KF5 libraries
13589 AC_MSG_CHECKING([for KF5 libraries])
13591 for kf5_check in $kf5_libdirs; do
13592 if test -r "$kf5_check/$kf5_test_library"; then
13593 kf5_libdir="$kf5_check"
13598 AC_MSG_RESULT([$kf5_libdir])
13599 if test "x$kf5_libdir" = "xno"; then
13600 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
13603 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"
13604 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
13605 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13607 if test "$USING_X11" = TRUE; then
13608 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
13611 AC_LANG_PUSH([C++])
13612 save_CXXFLAGS=$CXXFLAGS
13613 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
13614 AC_MSG_CHECKING([whether KDE is >= 5.0])
13615 AC_RUN_IFELSE([AC_LANG_SOURCE([[
13616 #include <kcoreaddons_version.h>
13618 int main(int argc, char **argv) {
13619 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
13622 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
13623 CXXFLAGS=$save_CXXFLAGS
13626 AC_SUBST(KF5_CFLAGS)
13629 dnl ===================================================================
13630 dnl KF6 Integration
13631 dnl ===================================================================
13635 if test \( "$test_kf6" = "yes" -a "$ENABLE_KF6" = "TRUE" \)
13637 if test "$OS" = "HAIKU"; then
13638 haiku_arch="`echo $RTL_ARCH | tr X x`"
13639 kf6_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
13640 kf6_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
13643 kf6_incdirs="$KF6INC /usr/include $kf6_haiku_incdirs $x_includes"
13644 kf6_libdirs="$KF6LIB /usr/lib /usr/lib/kf6 /usr/lib/kf6/devel $kf6_haiku_libdirs $x_libraries"
13645 if test -n "$supports_multilib"; then
13646 kf6_libdirs="$kf6_libdirs /usr/lib64 /usr/lib64/kf6 /usr/lib64/kf6/devel"
13649 kf6_test_include="KF6/KIOFileWidgets/KFileWidget"
13650 kf6_test_library="libKF6KIOFileWidgets.so"
13651 kf6_libdirs="$qt6_libdir $kf6_libdirs"
13653 dnl Check for KF6 headers
13654 AC_MSG_CHECKING([for KF6 headers])
13656 for kf6_check in $kf6_incdirs; do
13657 if test -r "$kf6_check/$kf6_test_include"; then
13658 kf6_incdir="$kf6_check/KF6"
13662 AC_MSG_RESULT([$kf6_incdir])
13663 if test "x$kf6_incdir" = "xno"; then
13664 AC_MSG_ERROR([KF6 headers not found. Please specify the root of your KF6 installation by exporting KF6DIR before running "configure".])
13667 dnl Check for KF6 libraries
13668 AC_MSG_CHECKING([for KF6 libraries])
13670 for kf6_check in $kf6_libdirs; do
13671 if test -r "$kf6_check/$kf6_test_library"; then
13672 kf6_libdir="$kf6_check"
13677 AC_MSG_RESULT([$kf6_libdir])
13678 if test "x$kf6_libdir" = "xno"; then
13679 AC_MSG_ERROR([KF6 libraries not found. Please specify the root of your KF6 installation by exporting KF6DIR before running "configure".])
13682 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"
13683 KF6_LIBS="-L$kf6_libdir -lKF6CoreAddons -lKF6I18n -lKF6ConfigCore -lKF6WindowSystem -lKF6KIOCore -lKF6KIOWidgets -lKF6KIOFileWidgets -L$qt6_libdir -lQt6Core -lQt6Gui -lQt6Widgets -lQt6Network"
13684 KF6_CFLAGS=$(printf '%s' "$KF6_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13686 AC_LANG_PUSH([C++])
13687 save_CXXFLAGS=$CXXFLAGS
13688 CXXFLAGS="$CXXFLAGS $KF6_CFLAGS"
13689 dnl KF6 development version as of 2023-06 uses version number 5.240
13690 AC_MSG_CHECKING([whether KDE is >= 5.240])
13691 AC_RUN_IFELSE([AC_LANG_SOURCE([[
13692 #include <kcoreaddons_version.h>
13694 int main(int argc, char **argv) {
13695 if (KCOREADDONS_VERSION_MAJOR == 6 || (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 240)) return 0;
13698 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
13699 CXXFLAGS=$save_CXXFLAGS
13702 AC_SUBST(KF6_CFLAGS)
13705 if test "$enable_qt6_multimedia" = "yes" -a "$ENABLE_QT6" != "TRUE"; then
13706 AC_MSG_ERROR([--enable-qt6-multimedia requires --enable-qt6 or --enable-kf6])
13709 dnl ===================================================================
13710 dnl Test whether to include Evolution 2 support
13711 dnl ===================================================================
13712 AC_MSG_CHECKING([whether to enable evolution 2 support])
13713 if test "$enable_evolution2" = yes; then
13714 AC_MSG_RESULT([yes])
13715 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
13716 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
13717 FilterLibs "${GOBJECT_LIBS}"
13718 GOBJECT_LIBS="${filteredlibs}"
13719 ENABLE_EVOAB2="TRUE"
13721 AC_MSG_RESULT([no])
13723 AC_SUBST(ENABLE_EVOAB2)
13724 AC_SUBST(GOBJECT_CFLAGS)
13725 AC_SUBST(GOBJECT_LIBS)
13727 dnl ===================================================================
13728 dnl Test which themes to include
13729 dnl ===================================================================
13730 AC_MSG_CHECKING([which themes to include])
13731 # if none given use default subset of available themes
13732 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
13733 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"
13737 if test "x$with_theme" != "xno"; then
13738 for theme in $with_theme; do
13740 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" ;;
13741 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
13745 AC_MSG_RESULT([$WITH_THEMES])
13746 AC_SUBST([WITH_THEMES])
13748 ###############################################################################
13749 # Extensions checking
13750 ###############################################################################
13751 AC_MSG_CHECKING([for extensions integration])
13752 if test "x$enable_extension_integration" != "xno"; then
13753 WITH_EXTENSION_INTEGRATION=TRUE
13754 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
13755 AC_MSG_RESULT([yes, use integration])
13757 WITH_EXTENSION_INTEGRATION=
13758 AC_MSG_RESULT([no, do not integrate])
13760 AC_SUBST(WITH_EXTENSION_INTEGRATION)
13762 dnl Should any extra extensions be included?
13763 dnl There are standalone tests for each of these below.
13764 WITH_EXTRA_EXTENSIONS=
13765 AC_SUBST([WITH_EXTRA_EXTENSIONS])
13767 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
13768 if test "x$with_java" != "xno"; then
13769 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
13772 AC_MSG_CHECKING([whether to build opens___.ttf])
13773 if test "$enable_build_opensymbol" = "yes"; then
13774 AC_MSG_RESULT([yes])
13775 AC_PATH_PROG(FONTFORGE, fontforge)
13776 if test -z "$FONTFORGE"; then
13777 AC_MSG_ERROR([fontforge not installed])
13780 AC_MSG_RESULT([no])
13781 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
13783 AC_SUBST(FONTFORGE)
13785 dnl ===================================================================
13786 dnl Test whether to include fonts
13787 dnl ===================================================================
13788 AC_MSG_CHECKING([whether to include third-party fonts])
13789 if test "$with_fonts" != "no"; then
13790 AC_MSG_RESULT([yes])
13792 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
13793 AC_DEFINE(HAVE_MORE_FONTS)
13795 AC_MSG_RESULT([no])
13797 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
13799 AC_SUBST(WITH_FONTS)
13802 dnl ===================================================================
13803 dnl Test whether to enable online update service
13804 dnl ===================================================================
13805 AC_MSG_CHECKING([whether to enable online update])
13806 ENABLE_ONLINE_UPDATE=
13807 if test "$enable_online_update" = ""; then
13808 AC_MSG_RESULT([no])
13810 if test "$enable_online_update" = "mar"; then
13811 AC_MSG_ERROR([--enable-online-update=mar is deprecated, use --enable-online-update-mar instead])
13812 elif test "$enable_online_update" = "yes"; then
13813 if test "$enable_curl" != "yes"; then
13814 AC_MSG_ERROR([--disable-online-update must be used when --disable-curl is used])
13816 AC_MSG_RESULT([yes])
13817 ENABLE_ONLINE_UPDATE="TRUE"
13819 AC_MSG_RESULT([no])
13822 AC_SUBST(ENABLE_ONLINE_UPDATE)
13825 dnl ===================================================================
13826 dnl Test whether to enable mar online update service
13827 dnl ===================================================================
13828 AC_MSG_CHECKING([whether to enable mar online update])
13829 ENABLE_ONLINE_UPDATE_MAR=
13830 if test "$enable_online_update_mar" = yes; then
13831 AC_MSG_RESULT([yes])
13832 BUILD_TYPE="$BUILD_TYPE ONLINEUPDATE"
13833 ENABLE_ONLINE_UPDATE_MAR="TRUE"
13834 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
13836 AC_MSG_RESULT([no])
13838 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
13840 AC_MSG_CHECKING([for mar online update baseurl])
13841 ONLINEUPDATE_MAR_BASEURL=$with_online_update_mar_baseurl
13842 if test -n "$ONLINEUPDATE_MAR_BASEURL"; then
13843 AC_MSG_RESULT([yes])
13845 AC_MSG_RESULT([no])
13847 AC_SUBST(ONLINEUPDATE_MAR_BASEURL)
13849 AC_MSG_CHECKING([for mar online update certificateder])
13850 ONLINEUPDATE_MAR_CERTIFICATEDER=$with_online_update_mar_certificateder
13851 if test -n "$ONLINEUPDATE_MAR_CERTIFICATEDER"; then
13852 AC_MSG_RESULT([yes])
13854 AC_MSG_RESULT([no])
13856 AC_SUBST(ONLINEUPDATE_MAR_CERTIFICATEDER)
13858 AC_MSG_CHECKING([for mar online update certificatename])
13859 ONLINEUPDATE_MAR_CERTIFICATENAME=$with_online_update_mar_certificatename
13860 if test -n "$ONLINEUPDATE_MAR_CERTIFICATENAME"; then
13861 AC_MSG_RESULT([yes])
13863 AC_MSG_RESULT([no])
13865 AC_SUBST(ONLINEUPDATE_MAR_CERTIFICATENAME)
13867 AC_MSG_CHECKING([for mar online update certificatepath])
13868 ONLINEUPDATE_MAR_CERTIFICATEPATH=$with_online_update_mar_certificatepath
13869 if test -n "$ONLINEUPDATE_MAR_CERTIFICATEPATH"; then
13870 AC_MSG_RESULT([yes])
13872 AC_MSG_RESULT([no])
13874 AC_SUBST(ONLINEUPDATE_MAR_CERTIFICATEPATH)
13877 PRIVACY_POLICY_URL="$with_privacy_policy_url"
13878 if test "$ENABLE_ONLINE_UPDATE" = TRUE -o "$ENABLE_BREAKPAD" = "TRUE"; then
13879 if test "x$with_privacy_policy_url" = "xundefined"; then
13880 AC_MSG_FAILURE([online update or breakpad/crashreporting are enabled, but no --with-privacy-policy-url=... was provided])
13883 AC_SUBST(PRIVACY_POLICY_URL)
13884 dnl ===================================================================
13885 dnl Test whether we need bzip2
13886 dnl ===================================================================
13888 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE" -o "$enable_python" = internal; then
13889 AC_MSG_CHECKING([whether to use system bzip2])
13890 if test "$with_system_bzip2" = yes; then
13892 AC_MSG_RESULT([yes])
13893 PKG_CHECK_MODULES(BZIP2, bzip2)
13894 FilterLibs "${BZIP2_LIBS}"
13895 BZIP2_LIBS="${filteredlibs}"
13897 AC_MSG_RESULT([no])
13898 BUILD_TYPE="$BUILD_TYPE BZIP2"
13901 AC_SUBST(SYSTEM_BZIP2)
13902 AC_SUBST(BZIP2_CFLAGS)
13903 AC_SUBST(BZIP2_LIBS)
13905 dnl ===================================================================
13906 dnl Test whether to enable extension update
13907 dnl ===================================================================
13908 AC_MSG_CHECKING([whether to enable extension update])
13909 ENABLE_EXTENSION_UPDATE=
13910 if test "x$enable_extension_update" = "xno"; then
13911 AC_MSG_RESULT([no])
13913 AC_MSG_RESULT([yes])
13914 ENABLE_EXTENSION_UPDATE="TRUE"
13915 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
13916 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
13918 AC_SUBST(ENABLE_EXTENSION_UPDATE)
13921 dnl ===================================================================
13922 dnl Test whether to create MSI with LIMITUI=1 (silent install)
13923 dnl ===================================================================
13924 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
13925 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
13926 AC_MSG_RESULT([no])
13929 AC_MSG_RESULT([yes])
13930 ENABLE_SILENT_MSI=TRUE
13931 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
13933 AC_SUBST(ENABLE_SILENT_MSI)
13935 dnl ===================================================================
13936 dnl Check for WiX tools.
13937 dnl ===================================================================
13938 if test "$enable_wix" = "" -o "enable_wix" = "no"; then
13939 AC_MSG_RESULT([no])
13942 AC_MSG_RESULT([yes])
13943 # FIXME: this should do proper detection, but the path is currently
13944 # hardcoded in msicreator/createmsi.py
13945 if ! test -x "/cygdrive/c/Program Files (x86)/WiX Toolset v3.11/bin/candle"; then
13946 AC_MSG_ERROR([WiX requested but WiX toolset v3.11 not found at the expected location])
13950 AC_SUBST(ENABLE_WIX)
13952 AC_MSG_CHECKING([whether and how to use Xinerama])
13953 if test "$USING_X11" = TRUE; then
13954 if test "$x_libraries" = "default_x_libraries"; then
13955 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
13956 if test "x$XINERAMALIB" = x; then
13957 XINERAMALIB="/usr/lib"
13960 XINERAMALIB="$x_libraries"
13962 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
13963 # we have both versions, let the user decide but use the dynamic one
13966 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
13967 XINERAMA_LINK=dynamic
13969 XINERAMA_LINK=static
13971 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
13972 # we have only the dynamic version
13974 XINERAMA_LINK=dynamic
13975 elif test -e "$XINERAMALIB/libXinerama.a"; then
13977 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
13979 XINERAMA_LINK=static
13989 if test "$USE_XINERAMA" = "TRUE"; then
13990 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
13991 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
13992 [AC_MSG_ERROR(Xinerama header not found.)], [])
13993 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
13994 if test "x$XEXTLIB" = x; then
13995 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
13997 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
13998 if test "$_os" = "FreeBSD"; then
13999 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
14001 if test "$_os" = "Linux"; then
14002 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
14004 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
14005 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
14007 AC_MSG_ERROR([libXinerama not found or wrong architecture.])
14012 AC_MSG_RESULT([no])
14014 AC_SUBST(XINERAMA_LINK)
14016 AC_MSG_CHECKING([whether to use non-standard RGBA32 cairo pixel order])
14017 if test -z "$enable_cairo_rgba" -a "$_os" = "Android"; then
14018 enable_cairo_rgba=yes
14020 if test "$enable_cairo_rgba" = yes; then
14021 AC_DEFINE(ENABLE_CAIRO_RGBA)
14022 ENABLE_CAIRO_RGBA=TRUE
14023 AC_MSG_RESULT([yes])
14026 AC_MSG_RESULT([no])
14028 AC_SUBST(ENABLE_CAIRO_RGBA)
14030 dnl ===================================================================
14031 dnl Test whether to build cairo or rely on the system version
14032 dnl ===================================================================
14034 if test "$test_cairo" = "yes"; then
14035 AC_MSG_CHECKING([whether to use the system cairo])
14037 : ${with_system_cairo:=$with_system_libs}
14038 if test "$with_system_cairo" = "yes" -a "$enable_cairo_rgba" != "yes"; then
14040 AC_MSG_RESULT([yes])
14042 PKG_CHECK_MODULES( CAIRO, cairo >= 1.12.0 )
14043 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
14044 FilterLibs "${CAIRO_LIBS}"
14045 CAIRO_LIBS="${filteredlibs}"
14047 if test "$test_xrender" = "yes"; then
14048 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
14050 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
14051 #ifdef PictStandardA8
14055 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
14060 AC_MSG_RESULT([no])
14061 BUILD_TYPE="$BUILD_TYPE CAIRO"
14064 if test "$enable_cairo_canvas" != no; then
14065 AC_DEFINE(ENABLE_CAIRO_CANVAS)
14066 ENABLE_CAIRO_CANVAS=TRUE
14070 AC_SUBST(CAIRO_CFLAGS)
14071 AC_SUBST(CAIRO_LIBS)
14072 AC_SUBST(ENABLE_CAIRO_CANVAS)
14073 AC_SUBST(SYSTEM_CAIRO)
14075 dnl ===================================================================
14076 dnl Test whether to use avahi
14077 dnl ===================================================================
14078 if test "$_os" = "WINNT"; then
14079 # Windows uses bundled mDNSResponder
14080 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
14081 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
14082 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
14083 [ENABLE_AVAHI="TRUE"])
14084 AC_DEFINE(HAVE_FEATURE_AVAHI)
14085 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
14086 FilterLibs "${AVAHI_LIBS}"
14087 AVAHI_LIBS="${filteredlibs}"
14090 AC_SUBST(ENABLE_AVAHI)
14091 AC_SUBST(AVAHI_CFLAGS)
14092 AC_SUBST(AVAHI_LIBS)
14094 dnl ===================================================================
14095 dnl Test whether to use liblangtag
14096 dnl ===================================================================
14098 AC_MSG_CHECKING([whether to use system liblangtag])
14099 if test "$with_system_liblangtag" = yes; then
14100 SYSTEM_LIBLANGTAG=TRUE
14101 AC_MSG_RESULT([yes])
14102 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
14103 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
14104 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
14105 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
14106 FilterLibs "${LIBLANGTAG_LIBS}"
14107 LIBLANGTAG_LIBS="${filteredlibs}"
14110 AC_MSG_RESULT([no])
14111 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
14112 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
14113 if test "$COM" = "MSC"; then
14114 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
14116 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
14119 AC_SUBST(SYSTEM_LIBLANGTAG)
14120 AC_SUBST(LIBLANGTAG_CFLAGS)
14121 AC_SUBST(LIBLANGTAG_LIBS)
14123 dnl ===================================================================
14124 dnl Test whether to build libpng or rely on the system version
14125 dnl ===================================================================
14127 LIBPNG_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/libpng"
14128 LIBPNG_LIBS_internal="-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"
14129 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng])
14131 dnl ===================================================================
14132 dnl Test whether to build libtiff or rely on the system version
14133 dnl ===================================================================
14135 libo_CHECK_SYSTEM_MODULE([libtiff],[LIBTIFF],[libtiff-4])
14137 dnl ===================================================================
14138 dnl Test whether to build libwebp or rely on the system version
14139 dnl ===================================================================
14141 libo_CHECK_SYSTEM_MODULE([libwebp],[LIBWEBP],[libwebp])
14143 dnl ===================================================================
14144 dnl Check for runtime JVM search path
14145 dnl ===================================================================
14146 if test "$ENABLE_JAVA" != ""; then
14147 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
14148 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
14149 AC_MSG_RESULT([yes])
14150 if ! test -d "$with_jvm_path"; then
14151 AC_MSG_ERROR(["$with_jvm_path" not a directory])
14153 if ! test -d "$with_jvm_path"jvm; then
14154 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
14156 JVM_ONE_PATH_CHECK="$with_jvm_path"
14157 AC_SUBST(JVM_ONE_PATH_CHECK)
14159 AC_MSG_RESULT([no])
14163 dnl ===================================================================
14164 dnl Test for the presence of Ant and that it works
14165 dnl ===================================================================
14167 # java takes the encoding from LC_ALL, and since autoconf forces it to C it
14168 # breaks filename decoding, so for the ant section, set it to LANG
14170 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE" -a "$cross_compiling" != "yes"; then
14171 ANT_HOME=; export ANT_HOME
14172 WITH_ANT_HOME=; export WITH_ANT_HOME
14173 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
14174 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
14175 if test "$_os" = "WINNT"; then
14176 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
14178 with_ant_home="$LODE_HOME/opt/ant"
14180 elif test -x "$LODE_HOME/opt/bin/ant" ; then
14181 with_ant_home="$LODE_HOME/opt/ant"
14184 if test -z "$with_ant_home"; then
14185 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
14187 if test "$_os" = "WINNT"; then
14188 # AC_PATH_PROGS needs unix path
14189 PathFormat "$with_ant_home"
14190 with_ant_home="$formatted_path_unix"
14192 AbsolutePath "$with_ant_home"
14193 with_ant_home=$absolute_path
14194 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
14195 WITH_ANT_HOME=$with_ant_home
14196 ANT_HOME=$with_ant_home
14199 if test -z "$ANT"; then
14200 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
14202 # resolve relative or absolute symlink
14203 while test -h "$ANT"; do
14205 a_basename=`basename "$ANT"`
14206 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
14207 cd "`dirname "$ANT"`"
14208 cd "`dirname "$a_script"`"
14209 ANT="`pwd`"/"`basename "$a_script"`"
14213 AC_MSG_CHECKING([if $ANT works])
14214 mkdir -p conftest.dir
14217 cat > conftest.java << EOF
14218 public class conftest {
14219 int testmethod(int a, int b) {
14225 cat > conftest.xml << EOF
14226 <project name="conftest" default="conftest">
14227 <target name="conftest">
14228 <javac srcdir="." includes="conftest.java">
14234 if test -n "$WSL_ONLY_AS_HELPER"; then
14235 # need to set it directly, since ant only tries java, not java.exe from JAVA_HOME
14236 export JAVACMD="$JAVAINTERPRETER"
14237 # similarly it doesn't expect to be called from wsl, so it uses the wsl-realm path when
14238 # building the classpath, but we need the windows-style one for the windows-java
14239 PathFormat "$ANT_HOME"
14240 export LOCALCLASSPATH=";$formatted_path/lib/ant-launcher.jar"
14242 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
14243 if test $? = 0 -a -f ./conftest.class; then
14244 AC_MSG_RESULT([Ant works])
14245 if test -z "$WITH_ANT_HOME"; then
14246 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
14247 if test -z "$ANT_HOME"; then
14248 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
14251 ANT_HOME="$WITH_ANT_HOME"
14254 echo "configure: Ant test failed" >&5
14255 cat conftest.java >&5
14256 cat conftest.xml >&5
14257 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
14260 rm -fr conftest.dir
14262 if test -z "$ANT_HOME"; then
14263 ANT_HOME="NO_ANT_HOME"
14265 PathFormat "$ANT_HOME"
14266 ANT_HOME="$formatted_path_unix"
14268 ANT="$formatted_path_unix"
14271 dnl Checking for ant.jar
14272 if test "$ANT_HOME" != "NO_ANT_HOME"; then
14273 AC_MSG_CHECKING([Ant lib directory])
14274 if test -f $ANT_HOME/lib/ant.jar; then
14275 ANT_LIB="$ANT_HOME/lib"
14277 if test -f $ANT_HOME/ant.jar; then
14278 ANT_LIB="$ANT_HOME"
14280 if test -f /usr/share/java/ant.jar; then
14281 ANT_LIB=/usr/share/java
14283 if test -f /usr/share/ant-core/lib/ant.jar; then
14284 ANT_LIB=/usr/share/ant-core/lib
14286 if test -f $ANT_HOME/lib/ant/ant.jar; then
14287 ANT_LIB="$ANT_HOME/lib/ant"
14289 if test -f /usr/share/lib/ant/ant.jar; then
14290 ANT_LIB=/usr/share/lib/ant
14292 AC_MSG_ERROR([Ant libraries not found!])
14299 PathFormat "$ANT_LIB"
14300 ANT_LIB="$formatted_path"
14301 AC_MSG_RESULT([Ant lib directory found.])
14305 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
14307 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
14308 ant_version=`"$ANT" -version | $AWK '$3 == "version" { print $4; }'`
14309 ant_version_major=`echo $ant_version | cut -d. -f1`
14310 ant_version_minor=`echo $ant_version | cut -d. -f2`
14311 echo "configure: ant_version $ant_version " >&5
14312 echo "configure: ant_version_major $ant_version_major " >&5
14313 echo "configure: ant_version_minor $ant_version_minor " >&5
14314 if test "$ant_version_major" -ge "2"; then
14315 AC_MSG_RESULT([yes, $ant_version])
14316 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
14317 AC_MSG_RESULT([yes, $ant_version])
14319 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
14322 rm -f conftest* core core.* *.core
14330 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no" -a "$cross_compiling" != "yes"; then
14331 AC_MSG_CHECKING([for JUnit 4])
14332 if test "$with_junit" = "yes"; then
14333 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
14334 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
14335 elif test -e /usr/share/java/junit4.jar; then
14336 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
14338 if test -e /usr/share/lib/java/junit.jar; then
14339 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
14341 OOO_JUNIT_JAR=/usr/share/java/junit.jar
14345 OOO_JUNIT_JAR=$with_junit
14347 if test "$_os" = "WINNT"; then
14348 PathFormat "$OOO_JUNIT_JAR"
14349 OOO_JUNIT_JAR="$formatted_path"
14351 printf 'import org.junit.Before;' > conftest.java
14352 if $JAVACOMPILER -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
14353 AC_MSG_RESULT([$OOO_JUNIT_JAR])
14356 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
14357 specify its pathname via --with-junit=..., or disable it via --without-junit])
14359 rm -f conftest.class conftest.java
14360 if test $OOO_JUNIT_JAR != ""; then
14361 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
14364 AC_MSG_CHECKING([for included Hamcrest])
14365 printf 'import org.hamcrest.BaseDescription;' > conftest.java
14366 if $JAVACOMPILER -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
14367 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
14369 AC_MSG_RESULT([Not included])
14370 AC_MSG_CHECKING([for standalone hamcrest jar.])
14371 if test "$with_hamcrest" = "yes"; then
14372 if test -e /usr/share/lib/java/hamcrest.jar; then
14373 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
14374 elif test -e /usr/share/java/hamcrest/core.jar; then
14375 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
14376 elif test -e /usr/share/java/hamcrest/hamcrest.jar; then
14377 HAMCREST_JAR=/usr/share/java/hamcrest/hamcrest.jar
14379 HAMCREST_JAR=/usr/share/java/hamcrest.jar
14382 HAMCREST_JAR=$with_hamcrest
14384 if test "$_os" = "WINNT"; then
14385 PathFormat "$HAMCREST_JAR"
14386 HAMCREST_JAR="$formatted_path"
14388 if $JAVACOMPILER -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
14389 AC_MSG_RESULT([$HAMCREST_JAR])
14391 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),
14392 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
14395 rm -f conftest.class conftest.java
14397 AC_SUBST(OOO_JUNIT_JAR)
14398 AC_SUBST(HAMCREST_JAR)
14399 # set back LC_ALL to C after the java related tests...
14405 # check for wget and curl
14410 if test "$enable_fetch_external" != "no"; then
14412 CURL=`command -v curl`
14414 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
14416 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
14417 if test $? -eq 0; then
14423 if test -z "$WGET" -a -z "$CURL"; then
14424 AC_MSG_ERROR([neither wget nor curl found!])
14433 # check for sha256sum
14437 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
14438 eval "$i -a 256 --version" > /dev/null 2>&1
14440 if test $ret -eq 0; then
14441 SHA256SUM="$i -a 256"
14446 if test -z "$SHA256SUM"; then
14447 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
14448 eval "$i --version" > /dev/null 2>&1
14450 if test $ret -eq 0; then
14457 if test -z "$SHA256SUM"; then
14458 AC_MSG_ERROR([no sha256sum found!])
14461 AC_SUBST(SHA256SUM)
14463 dnl ===================================================================
14464 dnl Dealing with l10n options
14465 dnl ===================================================================
14466 AC_MSG_CHECKING([which languages to be built])
14467 # get list of all languages
14468 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
14469 # we want en-US at the beginning
14470 ALL_LANGS=$($GNUMAKE SRC_ROOT=$SRC_ROOT WITH_LANG="$with_lang" ENABLE_RELEASE_BUILD="$ENABLE_RELEASE_BUILD" -sr -f - <<'EOF' | tr -d '\r'
14471 include $(SRC_ROOT)/solenv/inc/langlist.mk
14473 $(info en-US $(filter-out en-US,$(sort $(completelangiso))))
14477 # check the configured localizations
14478 WITH_LANG="$with_lang"
14480 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
14481 # (Norwegian is "nb" and "nn".)
14482 if test "$WITH_LANG" = "no"; then
14486 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
14487 AC_MSG_RESULT([en-US])
14489 AC_MSG_RESULT([$WITH_LANG])
14490 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
14491 if test -z "$MSGFMT"; then
14492 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
14493 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
14494 elif test -x "/opt/lo/bin/msgfmt"; then
14495 MSGFMT="/opt/lo/bin/msgfmt"
14497 AC_CHECK_PROGS(MSGFMT, [msgfmt])
14498 if test -z "$MSGFMT"; then
14499 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
14503 if test -z "$MSGUNIQ"; then
14504 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
14505 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
14506 elif test -x "/opt/lo/bin/msguniq"; then
14507 MSGUNIQ="/opt/lo/bin/msguniq"
14509 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
14510 if test -z "$MSGUNIQ"; then
14511 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
14518 # check that the list is valid
14519 for lang in $WITH_LANG; do
14520 test "$lang" = "ALL" && continue
14521 # need to check for the exact string, so add space before and after the list of all languages
14522 for vl in $ALL_LANGS; do
14523 if test "$vl" = "$lang"; then
14527 if test "$vl" != "$lang"; then
14528 # if you're reading this - you prolly quoted your languages remove the quotes ...
14529 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
14532 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
14533 echo $WITH_LANG | grep -q en-US
14534 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
14536 # list with substituted ALL
14537 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
14538 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
14539 test "$WITH_LANG" = "en-US" && WITH_LANG=
14540 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
14541 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
14542 ALL_LANGS=`echo $ALL_LANGS qtz`
14544 AC_SUBST(ALL_LANGS)
14545 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
14546 AC_SUBST(WITH_LANG)
14547 AC_SUBST(WITH_LANG_LIST)
14548 AC_SUBST(GIT_NEEDED_SUBMODULES)
14550 WITH_POOR_HELP_LOCALIZATIONS=
14551 if test -d "$SRC_ROOT/translations/source"; then
14552 for l in `ls -1 $SRC_ROOT/translations/source`; do
14553 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
14554 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
14558 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
14560 if test -n "$with_locales" -a "$with_locales" != ALL; then
14561 WITH_LOCALES="$with_locales"
14563 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
14564 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
14565 # config_host/config_locales.h.in
14566 for locale in $WITH_LOCALES; do
14569 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
14573 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
14576 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
14581 AC_DEFINE(WITH_LOCALE_ALL)
14583 AC_SUBST(WITH_LOCALES)
14585 dnl git submodule update --reference
14586 dnl ===================================================================
14587 if test -n "${GIT_REFERENCE_SRC}"; then
14588 for repo in ${GIT_NEEDED_SUBMODULES}; do
14589 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
14590 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
14594 AC_SUBST(GIT_REFERENCE_SRC)
14596 dnl git submodules linked dirs
14597 dnl ===================================================================
14598 if test -n "${GIT_LINK_SRC}"; then
14599 for repo in ${GIT_NEEDED_SUBMODULES}; do
14600 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
14601 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
14605 AC_SUBST(GIT_LINK_SRC)
14608 dnl ===================================================================
14609 AC_MSG_CHECKING([for alternative branding images directory])
14610 # initialize mapped arrays
14611 BRAND_INTRO_IMAGES="intro.png intro-highres.png"
14612 brand_files="$BRAND_INTRO_IMAGES logo.svg logo_inverted.svg logo-sc.svg logo-sc_inverted.svg about.svg"
14614 if test -z "$with_branding" -o "$with_branding" = "no"; then
14615 AC_MSG_RESULT([none])
14616 DEFAULT_BRAND_IMAGES="$brand_files"
14618 if ! test -d $with_branding ; then
14619 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
14621 AC_MSG_RESULT([$with_branding])
14622 CUSTOM_BRAND_DIR="$with_branding"
14623 for lfile in $brand_files
14625 if ! test -f $with_branding/$lfile ; then
14626 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
14627 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
14629 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
14632 check_for_progress="yes"
14635 AC_SUBST([BRAND_INTRO_IMAGES])
14636 AC_SUBST([CUSTOM_BRAND_DIR])
14637 AC_SUBST([CUSTOM_BRAND_IMAGES])
14638 AC_SUBST([DEFAULT_BRAND_IMAGES])
14641 AC_MSG_CHECKING([for 'intro' progress settings])
14645 PROGRESSFRAMECOLOR=
14647 PROGRESSTEXTBASELINE=
14649 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
14650 source "$with_branding/progress.conf"
14651 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
14653 AC_MSG_RESULT([none])
14656 AC_SUBST(PROGRESSBARCOLOR)
14657 AC_SUBST(PROGRESSSIZE)
14658 AC_SUBST(PROGRESSPOSITION)
14659 AC_SUBST(PROGRESSFRAMECOLOR)
14660 AC_SUBST(PROGRESSTEXTCOLOR)
14661 AC_SUBST(PROGRESSTEXTBASELINE)
14664 dnl ===================================================================
14665 dnl Custom build version
14666 dnl ===================================================================
14667 AC_MSG_CHECKING([for extra build ID])
14668 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
14669 EXTRA_BUILDID="$with_extra_buildid"
14671 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
14672 if test -n "$EXTRA_BUILDID" ; then
14673 AC_MSG_RESULT([$EXTRA_BUILDID])
14675 AC_MSG_RESULT([not set])
14677 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
14680 AC_MSG_CHECKING([for vendor])
14681 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
14682 OOO_VENDOR="$USERNAME"
14684 if test -z "$OOO_VENDOR"; then
14688 if test -z "$OOO_VENDOR"; then
14689 OOO_VENDOR="`id -u -n`"
14692 AC_MSG_RESULT([not set, using $OOO_VENDOR])
14694 OOO_VENDOR="$with_vendor"
14695 AC_MSG_RESULT([$OOO_VENDOR])
14697 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
14698 AC_SUBST(OOO_VENDOR)
14700 if test "$_os" = "Android" ; then
14701 ANDROID_PACKAGE_NAME=
14702 AC_MSG_CHECKING([for Android package name])
14703 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
14704 if test -n "$ENABLE_DEBUG"; then
14705 # Default to the package name that makes ndk-gdb happy.
14706 ANDROID_PACKAGE_NAME="org.libreoffice"
14708 ANDROID_PACKAGE_NAME="org.example.libreoffice"
14711 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
14713 ANDROID_PACKAGE_NAME="$with_android_package_name"
14714 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
14716 AC_SUBST(ANDROID_PACKAGE_NAME)
14719 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
14720 if test "$with_compat_oowrappers" = "yes"; then
14721 WITH_COMPAT_OOWRAPPERS=TRUE
14724 WITH_COMPAT_OOWRAPPERS=
14727 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
14729 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
14730 AC_MSG_CHECKING([for install dirname])
14731 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
14732 INSTALLDIRNAME="$with_install_dirname"
14734 AC_MSG_RESULT([$INSTALLDIRNAME])
14735 AC_SUBST(INSTALLDIRNAME)
14737 AC_MSG_CHECKING([for prefix])
14738 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14739 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
14740 PREFIXDIR="$prefix"
14741 AC_MSG_RESULT([$PREFIXDIR])
14742 AC_SUBST(PREFIXDIR)
14744 LIBDIR=[$(eval echo $(eval echo $libdir))]
14747 DATADIR=[$(eval echo $(eval echo $datadir))]
14750 MANDIR=[$(eval echo $(eval echo $mandir))]
14753 DOCDIR=[$(eval echo $(eval echo $docdir))]
14756 BINDIR=[$(eval echo $(eval echo $bindir))]
14759 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
14760 AC_SUBST(INSTALLDIR)
14762 TESTINSTALLDIR="${BUILDDIR}/test-install"
14763 AC_SUBST(TESTINSTALLDIR)
14766 # ===================================================================
14767 # OAuth2 id and secrets
14768 # ===================================================================
14770 AC_MSG_CHECKING([for Google Drive client id and secret])
14771 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
14772 AC_MSG_RESULT([not set])
14773 GDRIVE_CLIENT_ID="\"\""
14774 GDRIVE_CLIENT_SECRET="\"\""
14776 AC_MSG_RESULT([set])
14777 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
14778 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
14780 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
14781 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
14783 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
14784 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
14785 AC_MSG_RESULT([not set])
14786 ALFRESCO_CLOUD_CLIENT_ID="\"\""
14787 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
14789 AC_MSG_RESULT([set])
14790 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
14791 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
14793 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
14794 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
14796 AC_MSG_CHECKING([for OneDrive client id and secret])
14797 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
14798 AC_MSG_RESULT([not set])
14799 ONEDRIVE_CLIENT_ID="\"\""
14800 ONEDRIVE_CLIENT_SECRET="\"\""
14802 AC_MSG_RESULT([set])
14803 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
14804 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
14806 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
14807 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
14810 dnl ===================================================================
14811 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
14812 dnl --enable-dependency-tracking configure option
14813 dnl ===================================================================
14814 AC_MSG_CHECKING([whether to enable dependency tracking])
14815 if test "$enable_dependency_tracking" = "no"; then
14817 AC_MSG_RESULT([no])
14819 AC_MSG_RESULT([yes])
14823 dnl ===================================================================
14824 dnl Number of CPUs to use during the build
14825 dnl ===================================================================
14826 AC_MSG_CHECKING([for number of processors to use])
14827 # plain --with-parallelism is just the default
14828 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
14829 if test "$with_parallelism" = "no"; then
14832 PARALLELISM=$with_parallelism
14835 if test "$enable_icecream" = "yes"; then
14840 Darwin|FreeBSD|NetBSD|OpenBSD)
14841 PARALLELISM=`sysctl -n hw.ncpu`
14845 PARALLELISM=`getconf _NPROCESSORS_ONLN`
14847 # what else than above does profit here *and* has /proc?
14849 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
14853 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
14854 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
14858 if test $PARALLELISM -eq 0; then
14859 AC_MSG_RESULT([explicit make -j option needed])
14861 AC_MSG_RESULT([$PARALLELISM])
14863 AC_SUBST(PARALLELISM)
14866 # Set up ILIB for MSVC build
14869 if test "$build_os" = "cygwin" -o "$build_os" = "wsl" -o -n "$WSL_ONLY_AS_HELPER"; then
14871 if test -n "$JAVA_HOME"; then
14872 ILIB="$ILIB;$JAVA_HOME/lib"
14875 PathFormat "${COMPATH}/lib/$WIN_HOST_ARCH"
14876 ILIB="$ILIB;$formatted_path"
14877 ILIB1="$ILIB1 -LIBPATH:$formatted_path"
14878 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
14879 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
14880 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
14881 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
14882 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
14884 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/$WIN_HOST_ARCH"
14885 ucrtlibpath_formatted=$formatted_path
14886 ILIB="$ILIB;$ucrtlibpath_formatted"
14887 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
14888 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
14889 PathFormat "$DOTNET_FRAMEWORK_HOME/lib"
14890 ILIB="$ILIB;$formatted_path"
14892 PathFormat "$DOTNET_FRAMEWORK_HOME/Lib/um/$WIN_HOST_ARCH"
14893 ILIB="$ILIB;$formatted_path"
14896 if test "$cross_compiling" != "yes"; then
14897 ILIB_FOR_BUILD="$ILIB"
14901 AC_SUBST(ILIB_FOR_BUILD)
14903 AC_MSG_CHECKING([whether $CXX_BASE supports a working C++20 consteval])
14904 dnl ...that does not suffer from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96994> "Missing code
14905 dnl from consteval constructor initializing const variable",
14906 dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98752> "wrong 'error: ‘this’ is not a constant
14907 dnl expression' with consteval constructor", <https://bugs.llvm.org/show_bug.cgi?id=50063> "code
14908 dnl using consteval: 'clang/lib/CodeGen/Address.h:38: llvm::Value*
14909 dnl clang::CodeGen::Address::getPointer() const: Assertion `isValid()' failed.'" (which should be
14910 dnl fixed since Clang 14), <https://developercommunity.visualstudio.com/t/1581879> "Bogus error
14911 dnl C7595 with consteval constructor in ternary expression (/std:c++latest)" (which appears to be
14912 dnl fixed at least in Visual Studio Community 2022 Preview 17.9.0 Preview 5.0),
14913 dnl <https://github.com/llvm/llvm-project/issues/54612> "C++20, consteval, anonymous union:
14914 dnl llvm/lib/IR/Instructions.cpp:1491: void llvm::StoreInst::AssertOK(): Assertion
14915 dnl `cast<PointerType>(getOperand(1)->getType())->isOpaqueOrPointeeTypeMatches(getOperand(0)->getType())
14916 dnl && "Ptr must be a pointer to Val type!"' failed." (which should be fixed since Clang 17), or
14917 dnl <https://developercommunity.visualstudio.com/t/Bogus-error-C2440-with-consteval-constru/10579616>
14918 dnl "Bogus error C2440 with consteval constructor (/std:c++20)":
14919 have_cpp_consteval=
14920 AC_LANG_PUSH([C++])
14922 if test "$COM" = MSC && test "$COM_IS_CLANG" != TRUE; then
14923 CXX="env LIB=$ILIB $CXX"
14925 save_CXXFLAGS=$CXXFLAGS
14926 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
14927 AC_RUN_IFELSE([AC_LANG_PROGRAM([
14929 consteval S() { i = 1; }
14936 consteval S1(int n): a(n) {}
14952 struct S4 { consteval S4() = default; };
14953 void f4(bool b) { b ? S4() : S4(); }
14956 consteval S5() { c = 0; }
14957 char * f() { return &c; }
14963 auto s5 = S5().f();
14966 consteval S6(char const (&lit)[[2]]) {
14967 buf[[0]] = lit[[0]];
14968 buf[[1]] = lit[[1]];
14975 void f6() { S6("a"); }
14977 return (s.i == 1) ? 0 : 1;
14979 have_cpp_consteval=1
14980 AC_MSG_RESULT([yes])
14981 ], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([assumed no (cross compiling)])])
14983 CXXFLAGS=$save_CXXFLAGS
14985 if test -n "$have_cpp_consteval" && test "$COM_IS_CLANG" = TRUE && test -n "$BUILDING_PCH_WITH_OBJ"
14987 AC_MSG_CHECKING([whether $CXX_BASE has working consteval in combination with PCH])
14988 dnl ...that does not suffer from <https://github.com/llvm/llvm-project/issues/81745> "undefined
14989 dnl reference to consteval constructor exported from module" (which also affects PCH, see
14990 dnl <https://lists.freedesktop.org/archives/libreoffice/2024-February/091564.html> "Our Clang
14991 dnl --enable-pch setup is known broken"):
14992 printf 'export module M;\nexport struct S1 { consteval S1(int) {} };' >conftest.cppm
14993 $CXX $CXXFLAGS $CXXFLAGS_CXX11 --precompile conftest.cppm
14995 AC_LANG_PUSH([C++])
14996 save_CXXFLAGS=$CXXFLAGS
14997 save_LDFLAGS=$LDFLAGS
14998 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
14999 LDFLAGS="$LDFLAGS -fmodule-file=M=conftest.pcm conftest.pcm"
15000 AC_LINK_IFELSE([AC_LANG_PROGRAM([
15003 struct S2 { S1 s = 0; };
15006 AC_MSG_RESULT([yes])
15008 have_cpp_consteval=
15009 AC_MSG_RESULT([no])])
15010 CXXFLAGS=$save_CXXFLAGS
15011 LDFLAGS=$save_LDFLAGS
15015 if test -n "$have_cpp_consteval"; then
15016 AC_DEFINE([HAVE_CPP_CONSTEVAL],[1])
15019 AC_MSG_CHECKING([whether $CXX_BASE supports a working C++20 std::strong_order])
15020 dnl ...which is known to not be implemented in libc++ prior to
15021 dnl <https://github.com/llvm/llvm-project/commit/d8380ad977e94498e170b06449c81f1fc27da7b5> "[libc++]
15022 dnl [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order" in LLVM 14:
15023 AC_LANG_PUSH([C++])
15025 if test "$COM" = MSC && test "$COM_IS_CLANG" != TRUE; then
15026 CXX="env LIB=$ILIB $CXX"
15028 save_CXXFLAGS=$CXXFLAGS
15029 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
15030 AC_LINK_IFELSE([AC_LANG_PROGRAM([
15033 (void) (std::strong_order(1.0, 2.0) < 0);
15035 AC_DEFINE([HAVE_CPP_STRONG_ORDER],[1])
15036 AC_MSG_RESULT([yes])
15037 ], [AC_MSG_RESULT([no])])
15039 CXXFLAGS=$save_CXXFLAGS
15042 # ===================================================================
15043 # Creating bigger shared library to link against
15044 # ===================================================================
15045 AC_MSG_CHECKING([whether to create huge library])
15049 if test $_os = iOS -o $_os = Android; then
15050 # Never any point in mergelibs for these as we build just static
15051 # libraries anyway...
15052 enable_mergelibs=no
15055 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
15056 if test "$enable_mergelibs" = "more"; then
15058 MERGELIBS_MORE="TRUE"
15059 AC_MSG_RESULT([yes (more)])
15060 AC_DEFINE(ENABLE_MERGELIBS)
15061 AC_DEFINE(ENABLE_MERGELIBS_MORE)
15062 elif test "$enable_mergelibs" = "yes" -o "$enable_mergelibs" = ""; then
15064 AC_MSG_RESULT([yes])
15065 AC_DEFINE(ENABLE_MERGELIBS)
15067 AC_MSG_ERROR([unknown value --enable-mergelibs=$enable_mergelibs])
15070 AC_MSG_RESULT([no])
15072 AC_SUBST([MERGELIBS])
15073 AC_SUBST([MERGELIBS_MORE])
15075 dnl ===================================================================
15076 dnl icerun is a wrapper that stops us spawning tens of processes
15077 dnl locally - for tools that can't be executed on the compile cluster
15078 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
15079 dnl ===================================================================
15080 AC_MSG_CHECKING([whether to use icerun wrapper])
15082 if test "$enable_icecream" = "yes" && command -v icerun >/dev/null ; then
15083 ICECREAM_RUN=icerun
15084 AC_MSG_RESULT([yes])
15086 AC_MSG_RESULT([no])
15088 AC_SUBST(ICECREAM_RUN)
15090 dnl ===================================================================
15091 dnl Setup the ICECC_VERSION for the build the same way it was set for
15092 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
15093 dnl ===================================================================
15094 x_ICECC_VERSION=[\#]
15095 if test -n "$ICECC_VERSION" ; then
15098 AC_SUBST(x_ICECC_VERSION)
15099 AC_SUBST(ICECC_VERSION)
15101 dnl ===================================================================
15103 AC_MSG_CHECKING([MPL subset])
15107 if test "$enable_mpl_subset" = "yes"; then
15111 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
15113 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
15116 if test "$warn_report" = "true"; then
15117 mpl_error_string="$mpl_error_string$newline Need to --disable-report-builder - extended database report builder."
15119 if test "x$enable_postgresql_sdbc" != "xno"; then
15120 mpl_error_string="$mpl_error_string$newline Need to --disable-postgresql-sdbc - the PostgreSQL database backend."
15122 if test "$enable_lotuswordpro" = "yes"; then
15123 mpl_error_string="$mpl_error_string$newline Need to --disable-lotuswordpro - a Lotus Word Pro file format import filter."
15125 if test -n "$ENABLE_POPPLER"; then
15126 if test "x$SYSTEM_POPPLER" = "x"; then
15127 mpl_error_string="$mpl_error_string$newline Need to disable PDF import via poppler (--disable-poppler) or use system library."
15130 # cf. m4/libo_check_extension.m4
15131 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
15132 mpl_error_string="$mpl_error_string$newline Need to disable extra extensions enabled using --enable-ext-XXXX."
15136 for theme in $WITH_THEMES; do
15138 breeze|breeze_dark|breeze_dark_svg|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg) #denylist of icon themes under GPL or LGPL
15139 denied_themes="${denied_themes:+$denied_themes }$theme" ;;
15141 filtered_themes="${filtered_themes:+$filtered_themes }$theme" ;;
15144 if test "x$denied_themes" != "x"; then
15145 if test "x$filtered_themes" == "x"; then
15146 filtered_themes="colibre"
15148 mpl_error_string="$mpl_error_string$newline Need to disable icon themes: $denied_themes, use --with-theme=$filtered_themes."
15151 ENABLE_OPENGL_TRANSITIONS=
15153 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
15154 mpl_error_string="$mpl_error_string$newline Need to --disable-lpsolve - calc linear programming solver."
15157 if test "x$mpl_error_string" != "x"; then
15158 AC_MSG_ERROR([$mpl_error_string])
15163 AC_DEFINE(MPL_HAVE_SUBSET)
15164 AC_MSG_RESULT([only])
15166 AC_MSG_RESULT([no restrictions])
15168 AC_SUBST(MPL_SUBSET)
15171 dnl ===================================================================
15173 AC_MSG_CHECKING([formula logger])
15174 ENABLE_FORMULA_LOGGER=
15176 if test "x$enable_formula_logger" = "xyes"; then
15177 AC_MSG_RESULT([yes])
15178 AC_DEFINE(ENABLE_FORMULA_LOGGER)
15179 ENABLE_FORMULA_LOGGER=TRUE
15180 elif test -n "$ENABLE_DBGUTIL" ; then
15181 AC_MSG_RESULT([yes])
15182 AC_DEFINE(ENABLE_FORMULA_LOGGER)
15183 ENABLE_FORMULA_LOGGER=TRUE
15185 AC_MSG_RESULT([no])
15188 AC_SUBST(ENABLE_FORMULA_LOGGER)
15190 dnl ===================================================================
15191 dnl Checking for active Antivirus software.
15192 dnl ===================================================================
15194 if test $_os = WINNT -a -f "$SRC_ROOT/antivirusDetection.vbs" ; then
15195 AC_MSG_CHECKING([for active Antivirus software])
15196 PathFormat "$SRC_ROOT/antivirusDetection.vbs"
15197 ANTIVIRUS_LIST=`cscript.exe //Nologo ${formatted_path}`
15198 if [ [ "$ANTIVIRUS_LIST" != "NULL" ] ]; then
15199 if [ [ "$ANTIVIRUS_LIST" != "NOT_FOUND" ] ]; then
15200 AC_MSG_RESULT([found])
15201 EICAR_STRING='X5O!P%@AP@<:@4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'
15202 echo $EICAR_STRING > $SRC_ROOT/eicar
15203 EICAR_TEMP_FILE_CONTENTS=`cat $SRC_ROOT/eicar`
15205 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
15206 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
15208 echo $EICAR_STRING > $BUILDDIR/eicar
15209 EICAR_TEMP_FILE_CONTENTS=`cat $BUILDDIR/eicar`
15211 if [ [ "$EICAR_STRING" != "$EICAR_TEMP_FILE_CONTENTS" ] ]; then
15212 AC_MSG_ERROR([Exclude the build and source directories associated with LibreOffice in the following Antivirus software: $ANTIVIRUS_LIST])
15214 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"
15216 AC_MSG_RESULT([not found])
15219 AC_MSG_RESULT([n/a])
15223 dnl ===================================================================
15225 AC_MSG_CHECKING([for coredumpctl support])
15226 if test -z "$with_coredumpctl" && test $_os != Linux; then
15227 with_coredumpctl=no
15229 if test "$with_coredumpctl" = no; then
15232 AC_PATH_PROG(COREDUMPCTL, coredumpctl)
15233 AC_PATH_PROG(JQ, jq)
15234 AC_PATH_PROG(SYSTEMD_ESCAPE, systemd-escape)
15235 AC_PATH_PROG(SYSTEMD_RUN, systemd-run)
15236 if test -z "$COREDUMPCTL" || test -z "$JQ" || test -z "$SYSTEMD_ESCAPE" \
15237 || test -z "$SYSTEMD_RUN"
15239 if test -z "$with_coredumpctl"; then
15242 if test -z "$COREDUMPCTL"; then
15243 AC_MSG_ERROR([coredumpctl not found])
15245 if test -z "$JQ"; then
15246 AC_MSG_ERROR([jq not found])
15248 if test -z "$SYSTEMD_ESCAPE"; then
15249 AC_MSG_ERROR([systemd-escape not found])
15251 if test -z "$SYSTEMD_RUN"; then
15252 AC_MSG_ERROR([systemd-run not found])
15256 WITH_COREDUMPCTL=TRUE
15259 if test -z "$WITH_COREDUMPCTL"; then
15260 AC_MSG_RESULT([no])
15262 AC_MSG_RESULT([yes])
15264 AC_SUBST(COREDUMPCTL)
15266 AC_SUBST(SYSTEMD_ESCAPE)
15267 AC_SUBST(SYSTEMD_RUN)
15268 AC_SUBST(WITH_COREDUMPCTL)
15270 dnl ===================================================================
15271 dnl Checking whether to use a keep-awake helper
15272 dnl ===================================================================
15274 AC_MSG_CHECKING([whether to keep the system awake/prevent it from going into sleep/standby])
15275 if test -z "$with_keep_awake" -o "$with_keep_awake" = "no"; then
15276 AC_MSG_RESULT([no])
15277 elif test "$with_keep_awake" = "yes"; then
15278 AC_MSG_RESULT([yes (autodetect)])
15279 AC_MSG_CHECKING([for a suitable keep-awake command])
15280 if test "$_os" = "WINNT"; then
15281 PathFormat "$(perl.exe -e 'print $ENV{"PROGRAMFILES"}')"
15282 if test -f "$formatted_path_unix/PowerToys/PowerToys.Awake.exe"; then
15283 AC_MSG_RESULT([using "Awake"])
15284 # need to pass the windows-PID to awake, so get the PGID of the shell first to get
15285 # make's PID and then use that to get the windows-PID.
15286 # lots of quoting for both make ($$) as well as configure ('"'"') make that command
15287 # much scarier looking than it actually is. Using make's shell instead of subshells in
15288 # the recipe to keep the command that's echoed by make short.
15289 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}'"'"') &'
15291 AC_MSG_ERROR(["Awake" not found - install Microsoft PowerToys or specify a custom command])
15293 elif test "$_os" = "Darwin"; then
15294 AC_MSG_RESULT([using "caffeinate"])
15295 KEEP_AWAKE_CMD="caffeinate"
15297 AC_MSG_ERROR([no default available for $_os, please specify manually])
15300 AC_MSG_RESULT([yes (custom command: $with_keep_awake)])
15302 AC_SUBST(KEEP_AWAKE_CMD)
15304 dnl ===================================================================
15305 dnl Setting up the environment.
15306 dnl ===================================================================
15307 AC_MSG_NOTICE([setting up the build environment variables...])
15311 if test "$build_os" = "cygwin" -o "$build_os" = wsl -o -n "$WSL_ONLY_AS_HELPER"; then
15312 if test -d "$COMPATH_unix/atlmfc/lib/spectre"; then
15313 ATL_LIB="$COMPATH/atlmfc/lib/spectre"
15314 ATL_INCLUDE="$COMPATH/atlmfc/include"
15315 elif test -d "$COMPATH_unix/atlmfc/lib"; then
15316 ATL_LIB="$COMPATH/atlmfc/lib"
15317 ATL_INCLUDE="$COMPATH/atlmfc/include"
15319 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
15320 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
15322 ATL_LIB="$ATL_LIB/$WIN_HOST_ARCH"
15323 ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
15324 ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
15327 if test "$build_os" = "cygwin"; then
15328 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
15329 PathFormat "/usr/bin/find.exe"
15330 FIND="$formatted_path"
15331 PathFormat "/usr/bin/sort.exe"
15332 SORT="$formatted_path"
15333 PathFormat "/usr/bin/grep.exe"
15334 WIN_GREP="$formatted_path"
15335 PathFormat "/usr/bin/ls.exe"
15336 WIN_LS="$formatted_path"
15337 PathFormat "/usr/bin/touch.exe"
15338 WIN_TOUCH="$formatted_path"
15344 AC_SUBST(ATL_INCLUDE)
15350 AC_SUBST(WIN_TOUCH)
15352 AC_SUBST(BUILD_TYPE)
15357 PERL="$formatted_path"
15360 if test -n "$TMPDIR"; then
15361 TEMP_DIRECTORY="$TMPDIR"
15362 if test -n "$WSL_ONLY_AS_HELPER"; then
15363 TEMP_DIRECTORY=$(wslpath -m "$TEMP_DIRECTORY")
15366 TEMP_DIRECTORY="/tmp"
15368 CYGWIN_BASH="C:/cygwin64/bin/bash.exe"
15369 if test "$build_os" = "cygwin"; then
15370 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
15371 CYGWIN_BASH=`cygpath -m /usr/bin/bash`
15373 AC_SUBST(TEMP_DIRECTORY)
15374 AC_SUBST(CYGWIN_BASH)
15376 # setup the PATH for the environment
15377 if test -n "$LO_PATH_FOR_BUILD"; then
15378 LO_PATH="$LO_PATH_FOR_BUILD"
15381 pathmunge "$MSVC_HOST_PATH" "before"
15389 dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
15390 if test "$ENABLE_JAVA" != ""; then
15391 pathmunge "$JAVA_HOME/bin" "after"
15396 # Win32 make needs native paths
15397 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
15398 LO_PATH=`cygpath -p -m "$PATH"`
15400 if test "$WIN_BUILD_ARCH" = "x64"; then
15401 # needed for msi packaging
15402 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
15404 if test "$WIN_BUILD_ARCH" = "arm64"; then
15405 # needed for msi packaging - as of 10.0.22621 SDK no arm64 ones yet
15406 # the x86 ones probably would work just as well...
15407 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/arm" "before"
15409 # .NET 4.6 and higher don't have bin directory
15410 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
15411 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
15413 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
15414 pathmunge "$CSC_PATH" "before"
15415 pathmunge "$MIDL_PATH" "before"
15416 pathmunge "$AL_PATH" "before"
15417 pathmunge "$MSVC_MULTI_PATH" "before"
15418 pathmunge "$MSVC_BUILD_PATH" "before"
15419 if test -n "$MSBUILD_PATH" ; then
15420 pathmunge "$MSBUILD_PATH" "before"
15422 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/$WIN_BUILD_ARCH" "before"
15423 if test "$ENABLE_JAVA" != ""; then
15424 if test -d "$JAVA_HOME/jre/bin/client"; then
15425 pathmunge "$JAVA_HOME/jre/bin/client" "before"
15427 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
15428 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
15430 pathmunge "$JAVA_HOME/bin" "before"
15432 pathmunge "$MSVC_HOST_PATH" "before"
15436 pathmunge "/usr/css/bin" "before"
15437 if test "$ENABLE_JAVA" != ""; then
15438 pathmunge "$JAVA_HOME/bin" "after"
15446 # Allow to pass LO_ELFCHECK_ALLOWLIST from autogen.input to bin/check-elf-dynamic-objects:
15447 if test "$LO_ELFCHECK_ALLOWLIST" = x || test "${LO_ELFCHECK_ALLOWLIST-x}" != x; then
15448 x_LO_ELFCHECK_ALLOWLIST=
15450 x_LO_ELFCHECK_ALLOWLIST=[\#]
15452 AC_SUBST(x_LO_ELFCHECK_ALLOWLIST)
15453 AC_SUBST(LO_ELFCHECK_ALLOWLIST)
15457 # Generate a configuration sha256 we can use for deps
15458 if test -f config_host.mk; then
15459 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
15461 if test -f config_host_lang.mk; then
15462 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
15465 CFLAGS=$my_original_CFLAGS
15466 CXXFLAGS=$my_original_CXXFLAGS
15467 CPPFLAGS=$my_original_CPPFLAGS
15469 AC_CONFIG_LINKS([include:include])
15471 if test -n "$WSL_ONLY_AS_HELPER"; then
15472 # while we configure in linux, we actually compile in "cygwin" (close enough at least)
15474 PathFormat "$SRC_ROOT"
15475 SRC_ROOT="$formatted_path"
15476 PathFormat "$BUILDDIR"
15477 BUILDDIR="$formatted_path"
15478 # git-bash has (gnu) tar, curl and sha256sum
15482 SHA256SUM="sha256sum.exe"
15483 # TODO: maybe switch to strawberry-perl right away?
15484 # only openssl seems to actually require it (for Pod/Usage.pm and maybe more)
15486 # use flex, gperf and nasm from wsl-container
15487 # if using absolute path, would need to use double-leading slash for the msys path mangling
15490 # some externals (libebook) check for it with AC_PATH_PROGS, and that only accepts overrides
15491 # with an absolute path/requires the value to begin with a slash
15492 GPERF="/c/Windows/system32/$WSL gperf"
15493 # append strawberry tools dir to PATH (for e.g. windres, ar)
15494 LO_PATH="$LO_PATH:$STRAWBERRY_TOOLS"
15495 # temp-dir needs to be in windows realm, hardcode for now
15496 if test "$TEMP_DIRECTORY" = /tmp; then
15498 TEMP_DIRECTORY="$BUILDDIR/tmp"
15502 # Keep in sync with list of files far up, at AC_MSG_CHECKING([for
15503 # BUILD platform configuration] - otherwise breaks cross building
15505 config_host_lang.mk
15507 bin/bffvalidator.sh
15508 bin/odfvalidator.sh
15510 instsetoo_native/util/openoffice.lst
15511 sysui/desktop/macosx/Info.plist
15512 hardened_runtime.xcent:sysui/desktop/macosx/hardened_runtime.xcent.in
15513 lo.xcent:sysui/desktop/macosx/lo.xcent.in
15514 vs-code.code-workspace.template:.vscode/vs-code-template.code-workspace.in])
15515 # map unix-style mount dirs to windows directories: /mnt/c/foobar -> C:/foobar
15516 # easier to do it in a postprocessing command than to modify every single variable
15517 AC_CONFIG_FILES([config_host.mk], [
15518 if test -n "$WSL_ONLY_AS_HELPER"; then
15519 sed -i -e 's#/mnt/\([[:alpha:]]\)/#\u\1:/#g' config_host.mk
15520 fi], [WSL_ONLY_AS_HELPER=$WSL_ONLY_AS_HELPER])
15522 AC_CONFIG_HEADERS([config_host/config_atspi.h])
15523 AC_CONFIG_HEADERS([config_host/config_buildconfig.h])
15524 AC_CONFIG_HEADERS([config_host/config_buildid.h])
15525 AC_CONFIG_HEADERS([config_host/config_box2d.h])
15526 AC_CONFIG_HEADERS([config_host/config_clang.h])
15527 AC_CONFIG_HEADERS([config_host/config_crypto.h])
15528 AC_CONFIG_HEADERS([config_host/config_dconf.h])
15529 AC_CONFIG_HEADERS([config_host/config_eot.h])
15530 AC_CONFIG_HEADERS([config_host/config_extensions.h])
15531 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
15532 AC_CONFIG_HEADERS([config_host/config_cairo_rgba.h])
15533 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
15534 AC_CONFIG_HEADERS([config_host/config_dbus.h])
15535 AC_CONFIG_HEADERS([config_host/config_features.h])
15536 AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
15537 AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
15538 AC_CONFIG_HEADERS([config_host/config_firebird.h])
15539 AC_CONFIG_HEADERS([config_host/config_folders.h])
15540 AC_CONFIG_HEADERS([config_host/config_fonts.h])
15541 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
15542 AC_CONFIG_HEADERS([config_host/config_gio.h])
15543 AC_CONFIG_HEADERS([config_host/config_global.h])
15544 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
15545 AC_CONFIG_HEADERS([config_host/config_java.h])
15546 AC_CONFIG_HEADERS([config_host/config_langs.h])
15547 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
15548 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
15549 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
15550 AC_CONFIG_HEADERS([config_host/config_locales.h])
15551 AC_CONFIG_HEADERS([config_host/config_mpl.h])
15552 AC_CONFIG_HEADERS([config_host/config_oox.h])
15553 AC_CONFIG_HEADERS([config_host/config_options.h])
15554 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
15555 AC_CONFIG_HEADERS([config_host/config_zxing.h])
15556 AC_CONFIG_HEADERS([config_host/config_skia.h])
15557 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
15558 AC_CONFIG_HEADERS([config_host/config_validation.h])
15559 AC_CONFIG_HEADERS([config_host/config_vendor.h])
15560 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
15561 AC_CONFIG_HEADERS([config_host/config_version.h])
15562 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
15563 AC_CONFIG_HEADERS([config_host/config_poppler.h])
15564 AC_CONFIG_HEADERS([config_host/config_python.h])
15565 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
15566 AC_CONFIG_HEADERS([config_host/config_wasm_strip.h])
15567 AC_CONFIG_HEADERS([solenv/lockfile/autoconf.h])
15570 if test "$CROSS_COMPILING" = TRUE; then
15571 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
15574 # touch the config timestamp file
15575 if test ! -f config_host.mk.stamp; then
15576 echo > config_host.mk.stamp
15577 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
15578 echo "Host Configuration unchanged - avoiding scp2 stamp update"
15580 echo > config_host.mk.stamp
15583 # touch the config lang timestamp file
15584 if test ! -f config_host_lang.mk.stamp; then
15585 echo > config_host_lang.mk.stamp
15586 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
15587 echo "Language Configuration unchanged - avoiding scp2 stamp update"
15589 echo > config_host_lang.mk.stamp
15593 if test \( "$STALE_MAKE" = "TRUE" \) \
15594 -a "$build_os" = "cygwin"; then
15597 ****************************************************************************
15599 Your make version is known to be horribly slow, and hard to debug
15600 problems with. To get a reasonably functional make please do:
15602 to install a pre-compiled binary make for Win32
15604 mkdir -p /opt/lo/bin
15606 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
15607 cp make-4.2.1-msvc.exe make
15610 to install from source:
15611 place yourself in a working directory of you choice.
15613 git clone git://git.savannah.gnu.org/make.git
15615 [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"]
15616 set PATH=%PATH%;C:\Cygwin\bin
15617 [or Cygwin64, if that is what you have]
15618 cd path-to-make-repo-you-cloned-above
15619 build_w32.bat --without-guile
15621 should result in a WinRel/gnumake.exe.
15622 Copy it to the Cygwin /opt/lo/bin directory as make.exe
15624 Then re-run autogen.sh
15626 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
15627 Alternatively, you can install the 'new' make where ever you want and make sure that `command -v make` finds it.
15634 ****************************************************************************
15636 To show information on various make targets and make flags, run:
15639 To just build, run:
15644 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
15646 After the build has finished successfully, you can immediately run what you built using the command:
15649 if test $_os = Darwin; then
15650 echo open instdir/$PRODUCTNAME_WITHOUT_SPACES.app
15652 echo instdir/program/soffice
15656 If you want to run the unit tests, run:
15662 if test -s "$WARNINGS_FILE_FOR_BUILD"; then
15663 echo "BUILD / cross-toolset config, repeated ($WARNINGS_FILE_FOR_BUILD)"
15664 cat "$WARNINGS_FILE_FOR_BUILD"
15668 if test -s "$WARNINGS_FILE"; then
15669 echo "HOST config ($WARNINGS_FILE)"
15670 cat "$WARNINGS_FILE"
15673 # Remove unneeded emconfigure artifacts
15674 rm -f a.out a.wasm a.out.js a.out.wasm
15676 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: