1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
2 dnl configure.ac serves as input for the GNU autoconf package
3 dnl in order to create a configure script.
5 # The version number in the second argument to AC_INIT should be four numbers separated by
6 # periods. Some parts of the code requires the first one to be less than 128 and the others to be less
7 # than 256. The four numbers can optionally be followed by a period and a free-form string containing
8 # no spaces or periods, like "frobozz-mumble-42" or "alpha0". If the free-form string ends with one or
9 # several non-alphanumeric characters, those are split off and used only for the
10 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
12 AC_INIT([LibreOffice],[6.5.0.0.alpha0+],[],[],[http://documentfoundation.org/])
14 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed
15 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard
16 dnl so check for the version of autoconf that is actually used to create the configure script
18 m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.68]), -1,
19 [AC_MSG_ERROR([at least autoconf version 2.68 is needed (you can use AUTOCONF environment variable to point to a suitable one)])])
21 if test -n "$BUILD_TYPE"; then
22 AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
36 CC_BASE=`first_arg_basename "$CC"`
37 CXX_BASE=`first_arg_basename "$CXX"`
41 GIT_NEEDED_SUBMODULES=""
42 LO_PATH= # used by path_munge to construct a PATH variable
49 # let's start with Fedora's paths for now
50 -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
51 # ignore it: on UNIXoids it is searched by default anyway
52 # but if it's given explicitly then it may override other paths
53 # (on macOS it would be an error to use it instead of SDK)
56 filteredlibs="$filteredlibs $f"
65 if test "$build_os" = "cygwin"; then
67 # spaces,parentheses,brackets,braces are problematic in pathname
69 case "$formatted_path" in
70 *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
74 if test "$pf_conv_to_dos" = "yes"; then
75 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
76 formatted_path=`cygpath -sm "$formatted_path"`
78 formatted_path=`cygpath -d "$formatted_path"`
80 if test $? -ne 0; then
81 AC_MSG_ERROR([path conversion failed for "$1".])
84 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
85 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
86 if test "$fp_count_slash$fp_count_colon" != "00"; then
87 if test "$fp_count_colon" = "0"; then
88 new_formatted_path=`realpath "$formatted_path"`
89 if test $? -ne 0; then
90 AC_MSG_WARN([realpath failed for "$1", not necessarily a problem.])
92 formatted_path="$new_formatted_path"
95 formatted_path=`cygpath -m "$formatted_path"`
96 if test $? -ne 0; then
97 AC_MSG_ERROR([path conversion failed for "$1".])
100 fp_count_space=`echo "$formatted_path" | $GREP -c "[ ]"`
101 if test "$fp_count_space" != "0"; then
102 AC_MSG_ERROR([converted path "$formatted_path" still contains spaces. Short filenames (8.3 filenames) support was disabled on this system?])
109 # There appears to be no simple and portable method to get an absolute and
110 # canonical path, so we try creating the directory if does not exist and
111 # utilizing the shell and pwd.
114 test ! -e "$rel" && mkdir -p "$rel"
115 if test -d "$rel" ; then
116 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
117 absolute_path="$(pwd)"
120 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
128 if test "$have_WARNINGS" = "no"; then
129 echo "*************************************" > warn
131 if which tput >/dev/null && test "`tput colors 2>/dev/null || echo 0`" -ge 8; then
132 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
133 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
135 COLORWARN="* WARNING :"
138 echo "$COLORWARN $@" >> warn
141 dnl Some Mac User have the bad habit of letting a lot of crap
142 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
143 dnl that confuse the build.
144 dnl For the ones that use LODE, let's be nice and protect them
149 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
150 dnl a common but nevertheless necessary thing that may be in a fancy
151 dnl path location is git, so make sure we have it
152 mac_git_path=`which git 2>/dev/null`
153 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
154 mac_path="$mac_path:`dirname $mac_git_path`"
156 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
157 dnl path location is gpg, so make sure we find it
158 mac_gpg_path=`which gpg 2>/dev/null`
159 if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
160 mac_path="$mac_path:`dirname $mac_gpg_path`"
168 echo "********************************************************************"
170 echo "* Running ${PACKAGE_NAME} build configuration."
172 echo "********************************************************************"
175 dnl ===================================================================
176 dnl checks build and host OSes
177 dnl do this before argument processing to allow for platform dependent defaults
178 dnl ===================================================================
181 AC_MSG_CHECKING([for product name])
182 PRODUCTNAME="AC_PACKAGE_NAME"
183 if test -n "$with_product_name" -a "$with_product_name" != no; then
184 PRODUCTNAME="$with_product_name"
186 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
187 PRODUCTNAME="${PRODUCTNAME}Dev"
189 AC_MSG_RESULT([$PRODUCTNAME])
190 AC_SUBST(PRODUCTNAME)
191 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
192 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
194 dnl ===================================================================
195 dnl Our version is defined by the AC_INIT() at the top of this script.
196 dnl ===================================================================
198 AC_MSG_CHECKING([for package version])
199 if test -n "$with_package_version" -a "$with_package_version" != no; then
200 PACKAGE_VERSION="$with_package_version"
202 AC_MSG_RESULT([$PACKAGE_VERSION])
204 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
206 LIBO_VERSION_MAJOR=$1
207 LIBO_VERSION_MINOR=$2
208 LIBO_VERSION_MICRO=$3
209 LIBO_VERSION_PATCH=$4
211 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
212 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
213 # no way to encode that into an integer in general.
214 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
216 LIBO_VERSION_SUFFIX=$5
217 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
218 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
219 # they get undoubled before actually passed to sed.
220 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
221 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
222 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
223 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
225 AC_SUBST(LIBO_VERSION_MAJOR)
226 AC_SUBST(LIBO_VERSION_MINOR)
227 AC_SUBST(LIBO_VERSION_MICRO)
228 AC_SUBST(LIBO_VERSION_PATCH)
229 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
230 AC_SUBST(LIBO_VERSION_SUFFIX)
231 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
233 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
234 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
235 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
236 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
238 LIBO_THIS_YEAR=`date +%Y`
239 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
241 dnl ===================================================================
243 dnl ===================================================================
244 AC_MSG_CHECKING([for product version])
245 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
246 AC_MSG_RESULT([$PRODUCTVERSION])
247 AC_SUBST(PRODUCTVERSION)
250 # AC_PROG_EGREP doesn't set GREP on all systems as well
251 AC_PATH_PROG(GREP, grep)
259 dnl ======================================
260 dnl Required GObject introspection version
261 dnl ======================================
262 INTROSPECTION_REQUIRED_VERSION=1.32.0
264 dnl ===================================================================
265 dnl Search all the common names for GNU Make
266 dnl ===================================================================
267 AC_MSG_CHECKING([for GNU Make])
269 # try to use our own make if it is available and GNUMAKE was not already defined
270 if test -z "$GNUMAKE"; then
271 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
272 GNUMAKE="$LODE_HOME/opt/bin/make"
273 elif test -x "/opt/lo/bin/make"; then
274 GNUMAKE="/opt/lo/bin/make"
279 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
280 if test -n "$a"; then
281 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
282 if test $? -eq 0; then
283 if test "$build_os" = "cygwin"; then
284 if test -n "$($a -v | grep 'Built for Windows')" ; then
285 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
286 GNUMAKE_WIN_NATIVE="TRUE"
297 AC_MSG_RESULT($GNUMAKE)
298 if test -z "$GNUMAKE"; then
299 AC_MSG_ERROR([not found. install GNU Make.])
301 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
302 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
306 win_short_path_for_make()
308 local_short_path="$1"
309 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
310 cygpath -sm "$local_short_path"
312 cygpath -u "$(cygpath -d "$local_short_path")"
317 if test "$build_os" = "cygwin"; then
318 PathFormat "$SRC_ROOT"
319 SRC_ROOT="$formatted_path"
320 PathFormat "$BUILDDIR"
321 BUILDDIR="$formatted_path"
323 AC_MSG_CHECKING(for explicit COMSPEC)
324 if test -z "$COMSPEC"; then
325 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
327 AC_MSG_RESULT([found: $COMSPEC])
334 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
335 AC_DEFINE_UNQUOTED(SRC_ROOT,"$SRC_ROOT")
336 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
338 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
339 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
342 # need sed in os checks...
343 AC_PATH_PROGS(SED, sed)
344 if test -z "$SED"; then
345 AC_MSG_ERROR([install sed to run this script])
348 # Set the ENABLE_LTO variable
349 # ===================================================================
350 AC_MSG_CHECKING([whether to use link-time optimization])
351 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
354 AC_DEFINE(STATIC_LINKING)
361 AC_ARG_ENABLE(fuzz-options,
362 AS_HELP_STRING([--enable-fuzz-options],
363 [Randomly enable or disable each of those configurable options
364 that are supposed to be freely selectable without interdependencies,
365 or where bad interaction from interdependencies is automatically avoided.])
368 dnl ===================================================================
369 dnl When building for Android, --with-android-ndk,
370 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
372 dnl ===================================================================
374 AC_ARG_WITH(android-ndk,
375 AS_HELP_STRING([--with-android-ndk],
376 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
379 AC_ARG_WITH(android-ndk-toolchain-version,
380 AS_HELP_STRING([--with-android-ndk-toolchain-version],
381 [Specify which toolchain version to use, of those present in the
382 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
383 with_android_ndk_toolchain_version=clang5.0)
385 AC_ARG_WITH(android-sdk,
386 AS_HELP_STRING([--with-android-sdk],
387 [Specify location of the Android SDK. Mandatory when building for Android.]),
390 AC_ARG_WITH(android-api-level,
391 AS_HELP_STRING([--with-android-api-level],
392 [Specify the API level when building for Android. Defaults to 16 for ARM and x86 and to 21 for ARM64 and x86-64]),
396 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
397 with_android_ndk="$SRC_ROOT/external/android-ndk"
399 if test -n "$with_android_ndk"; then
400 eval ANDROID_NDK_HOME=$with_android_ndk
402 # Set up a lot of pre-canned defaults
404 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
405 if test ! -f $ANDROID_NDK_HOME/source.properties; then
406 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
408 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
410 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
412 if test -z "$ANDROID_NDK_VERSION"; then
413 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
415 case $ANDROID_NDK_VERSION in
417 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
419 11.1.*|12.1.*|13.1.*|14.1.*)
420 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
422 16.*|17.*|18.*|19.*|20.*)
425 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk.])
426 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 16.* til 20.* have been used successfully. Proceed at your own risk."
431 if test -n "$with_android_api_level" ; then
432 ANDROID_API_LEVEL="$with_android_api_level"
435 android_cpu=$host_cpu
436 if test $host_cpu = arm; then
437 android_platform_prefix=arm-linux-androideabi
438 android_gnu_prefix=$android_platform_prefix
439 LLVM_TRIPLE=armv7a-linux-androideabi
440 ANDROID_APP_ABI=armeabi-v7a
441 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
442 elif test $host_cpu = aarch64; then
443 android_platform_prefix=aarch64-linux-android
444 android_gnu_prefix=$android_platform_prefix
445 LLVM_TRIPLE=$android_platform_prefix
446 # minimum android version that supports aarch64
447 if test "$ANDROID_API_LEVEL" -lt "21" ; then
450 ANDROID_APP_ABI=arm64-v8a
451 elif test $host_cpu = x86_64; then
452 android_platform_prefix=x86_64-linux-android
453 android_gnu_prefix=$android_platform_prefix
454 LLVM_TRIPLE=$android_platform_prefix
455 # minimum android version that supports x86_64
457 ANDROID_APP_ABI=x86_64
459 # host_cpu is something like "i386" or "i686" I guess, NDK uses
460 # "x86" in some contexts
462 android_platform_prefix=$android_cpu
463 android_gnu_prefix=i686-linux-android
464 LLVM_TRIPLE=$android_gnu_prefix
468 case "$with_android_ndk_toolchain_version" in
470 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
473 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
476 AC_MSG_NOTICE([using the Android API level... $ANDROID_API_LEVEL])
478 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
479 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
480 # manage to link the (app-specific) single huge .so that is built for the app in
481 # android/source/ if there is debug information in a significant part of the object files.
482 # (A 64-bit ld.gold grows too much over 10 gigabytes of virtual space when linking such a .so if
483 # all objects have been built with debug information.)
486 android_HOST_TAG=linux-x86_64
489 android_HOST_TAG=darwin-x86_64
492 AC_MSG_ERROR([We only support building for Android from Linux or macOS])
493 # ndk would also support windows and windows-x86_64
496 android_TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$android_HOST_TAG
497 ANDROID_COMPILER_BIN=$android_TOOLCHAIN/bin
498 dnl TODO: NSS build uses it...
499 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION/prebuilt/$android_HOST_TAG
500 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
502 test -z "$AR" && AR=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ar
503 test -z "$NM" && NM=$ANDROID_COMPILER_BIN/$android_gnu_prefix-nm
504 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-objdump
505 test -z "$RANLIB" && RANLIB=$ANDROID_COMPILER_BIN/$android_gnu_prefix-ranlib
506 test -z "$STRIP" && STRIP=$ANDROID_COMPILER_BIN/$android_gnu_prefix-strip
508 ANDROIDCFLAGS="$ANDROIDCFLAGS -target ${LLVM_TRIPLE}${ANDROID_API_LEVEL}"
509 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes -ffunction-sections -fdata-sections -Qunused-arguments"
510 if test "$ENABLE_LTO" = TRUE; then
511 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
512 # $CC and $CXX when building external libraries
513 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
516 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -stdlib=libc++"
518 if test -z "$CC"; then
519 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
522 if test -z "$CXX"; then
523 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
527 # remember to download the ownCloud Android library later
528 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
530 AC_SUBST(ANDROID_NDK_HOME)
531 AC_SUBST(ANDROID_APP_ABI)
532 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
534 dnl ===================================================================
535 dnl --with-android-sdk
536 dnl ===================================================================
538 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
539 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
541 if test -n "$with_android_sdk"; then
542 eval ANDROID_SDK_HOME=$with_android_sdk
543 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
545 AC_SUBST(ANDROID_SDK_HOME)
547 AC_ARG_ENABLE([android-lok],
548 AS_HELP_STRING([--enable-android-lok],
549 [The Android app from the android/ subdir needs several tweaks all
550 over the place that break the LOK when used in the Online-based
551 Android app. This switch indicates that the intent of this build is
552 actually the Online-based, non-modified LOK.])
555 if test -n "$ANDROID_NDK_HOME" ; then
556 if test "$enable_android_lok" = yes; then
557 ENABLE_ANDROID_LOK=TRUE
558 AC_DEFINE(HAVE_FEATURE_ANDROID_LOK)
559 AC_MSG_NOTICE([building the Android version... for the Online-based Android app])
561 AC_MSG_NOTICE([building the Android version... for the app from the android/ subdir])
564 AC_SUBST([ENABLE_ANDROID_LOK])
566 libo_FUZZ_ARG_ENABLE([android-editing],
567 AS_HELP_STRING([--enable-android-editing],
568 [Enable the experimental editing feature on Android.])
570 ENABLE_ANDROID_EDITING=
571 if test "$enable_android_editing" = yes; then
572 ENABLE_ANDROID_EDITING=TRUE
574 AC_SUBST([ENABLE_ANDROID_EDITING])
576 dnl ===================================================================
577 dnl The following is a list of supported systems.
578 dnl Sequential to keep the logic very simple
579 dnl These values may be checked and reset later.
580 dnl ===================================================================
581 #defaults unless the os test overrides this:
591 # Default values, as such probably valid just for Linux, set
592 # differently below just for Mac OSX, but at least better than
593 # hardcoding these as we used to do. Much of this is duplicated also
594 # in solenv for old build system and for gbuild, ideally we should
595 # perhaps define stuff like this only here in configure.ac?
597 LINKFLAGSSHL="-shared"
601 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
604 INSTROOTCONTENTSUFFIX=
610 build_gstreamer_1_0=yes
615 dnl ===========================================================
616 dnl Check whether we're using Solaris 10 - SPARC or Intel.
617 dnl ===========================================================
618 AC_MSG_CHECKING([the Solaris operating system release])
619 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
620 if test "$_os_release" -lt "10"; then
621 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
623 AC_MSG_RESULT([ok ($_os_release)])
626 dnl Check whether we're using a SPARC or i386 processor
627 AC_MSG_CHECKING([the processor type])
628 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
629 AC_MSG_RESULT([ok ($host_cpu)])
631 AC_MSG_ERROR([only SPARC and i386 processors are supported])
635 linux-gnu*|k*bsd*-gnu*)
636 build_gstreamer_1_0=yes
642 if test "$enable_fuzzers" != yes; then
648 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
661 # When building on Windows normally with MSVC under Cygwin,
662 # configure thinks that the host platform (the platform the
663 # built code will run on) is Cygwin, even if it obviously is
664 # Windows, which in Autoconf terminology is called
665 # "mingw32". (Which is misleading as MinGW is the name of the
666 # tool-chain, not an operating system.)
668 # Somewhat confusing, yes. But this configure script doesn't
669 # look at $host etc that much, it mostly uses its own $_os
670 # variable, set here in this case statement.
685 darwin*) # macOS or iOS
691 if test -n "$LODE_HOME" ; then
693 AC_MSG_NOTICE([sanitized the PATH to $PATH])
695 if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
699 enable_mpl_subset=yes
700 enable_lotuswordpro=no
703 enable_postgresql_sdbc=no
704 enable_extension_integration=no
705 enable_report_builder=no
707 if test "$enable_ios_simulator" = "yes"; then
708 host=x86_64-apple-darwin
712 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
713 INSTROOTCONTENTSUFFIX=/Contents
714 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
716 # See comment above the case "$host_os"
717 LINKFLAGSSHL="-dynamiclib -single_module"
724 # -undefined error is the default
729 build_gstreamer_1_0=yes
734 AC_MSG_CHECKING([the FreeBSD operating system release])
735 if test -n "$with_os_version"; then
736 OSVERSION="$with_os_version"
738 OSVERSION=`/sbin/sysctl -n kern.osreldate`
740 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
741 AC_MSG_CHECKING([which thread library to use])
742 if test "$OSVERSION" -lt "500016"; then
743 PTHREAD_CFLAGS="-D_THREAD_SAFE"
744 PTHREAD_LIBS="-pthread"
745 elif test "$OSVERSION" -lt "502102"; then
746 PTHREAD_CFLAGS="-D_THREAD_SAFE"
750 PTHREAD_LIBS="-pthread"
752 AC_MSG_RESULT([$PTHREAD_LIBS])
757 build_gstreamer_1_0=yes
762 PTHREAD_LIBS="-pthread -lpthread"
769 PTHREAD_LIBS=-pthread
775 PTHREAD_CFLAGS="-D_THREAD_SAFE"
776 PTHREAD_LIBS="-pthread"
781 build_gstreamer_1_0=yes
786 PTHREAD_LIBS="-pthread"
791 build_gstreamer_1_0=no
792 enable_lotuswordpro=no
793 enable_mpl_subset=yes
796 enable_report_builder=no
798 enable_postgresql_sdbc=no
811 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
812 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
822 enable_gstreamer_1_0=no
827 enable_postgresql_sdbc=no
828 enable_firebird_sdbc=no
833 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
837 if test "$_os" = "Android" ; then
838 # Verify that the NDK and SDK options are proper
839 if test -z "$with_android_ndk"; then
840 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
841 elif test ! -f "$ANDROID_NDK_HOME/meta/abis.json"; then
842 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
845 if test -z "$ANDROID_SDK_HOME"; then
846 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
847 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
848 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
851 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
852 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
853 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
854 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
855 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
856 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
857 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
858 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
860 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
861 AC_MSG_WARN([android support repository not found - install with
862 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
863 to allow the build to download the specified version of the android support libraries])
864 add_warning "android support repository not found - install with"
865 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
866 add_warning "to allow the build to download the specified version of the android support libraries"
870 if test "$_os" = "AIX"; then
871 AC_PATH_PROG(GAWK, gawk)
872 if test -z "$GAWK"; then
873 AC_MSG_ERROR([gawk not found in \$PATH])
879 AC_SUBST(PTHREAD_CFLAGS)
880 AC_SUBST(PTHREAD_LIBS)
882 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
883 # By default use the ones specified by our build system,
884 # but explicit override is possible.
885 AC_MSG_CHECKING(for explicit AFLAGS)
886 if test -n "$AFLAGS"; then
887 AC_MSG_RESULT([$AFLAGS])
893 AC_MSG_CHECKING(for explicit CFLAGS)
894 if test -n "$CFLAGS"; then
895 AC_MSG_RESULT([$CFLAGS])
901 AC_MSG_CHECKING(for explicit CXXFLAGS)
902 if test -n "$CXXFLAGS"; then
903 AC_MSG_RESULT([$CXXFLAGS])
909 AC_MSG_CHECKING(for explicit OBJCFLAGS)
910 if test -n "$OBJCFLAGS"; then
911 AC_MSG_RESULT([$OBJCFLAGS])
917 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
918 if test -n "$OBJCXXFLAGS"; then
919 AC_MSG_RESULT([$OBJCXXFLAGS])
925 AC_MSG_CHECKING(for explicit LDFLAGS)
926 if test -n "$LDFLAGS"; then
927 AC_MSG_RESULT([$LDFLAGS])
937 AC_SUBST(OBJCXXFLAGS)
942 AC_SUBST(x_OBJCFLAGS)
943 AC_SUBST(x_OBJCXXFLAGS)
946 dnl These are potentially set for MSVC, in the code checking for UCRT below:
947 my_original_CFLAGS=$CFLAGS
948 my_original_CXXFLAGS=$CXXFLAGS
949 my_original_CPPFLAGS=$CPPFLAGS
951 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
952 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
953 dnl AC_PROG_CC internally.
954 if test "$_os" != "WINNT"; then
955 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
959 if test -z "$CC_BASE"; then
960 CC_BASE=`first_arg_basename "$CC"`
964 if test "$_os" != "WINNT"; then
965 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
971 if test $_os != "WINNT"; then
973 AC_SEARCH_LIBS([dlsym], [dl],
974 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
975 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
978 AC_SUBST(DLOPEN_LIBS)
980 AC_ARG_ENABLE(ios-simulator,
981 AS_HELP_STRING([--enable-ios-simulator],
982 [build i386 or x86_64 for ios simulator])
985 AC_ARG_ENABLE(ios-libreofficelight-app,
986 AS_HELP_STRING([--enable-ios-libreofficelight-app],
987 [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
988 (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
989 and also that its actual build (in Xcode) requires some obvious modifications to the project.])
992 ENABLE_IOS_LIBREOFFICELIGHT_APP=
993 if test "$enable_ios_libreofficelight_app" = yes; then
994 ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
996 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
998 ###############################################################################
999 # Extensions switches --enable/--disable
1000 ###############################################################################
1001 # By default these should be enabled unless having extra dependencies.
1002 # If there is extra dependency over configure options then the enable should
1003 # be automagic based on whether the requiring feature is enabled or not.
1004 # All this options change anything only with --enable-extension-integration.
1006 # The name of this option and its help string makes it sound as if
1007 # extensions are built anyway, just not integrated in the installer,
1008 # if you use --disable-extension-integration. Is that really the
1011 libo_FUZZ_ARG_ENABLE(extension-integration,
1012 AS_HELP_STRING([--disable-extension-integration],
1013 [Disable integration of the built extensions in the installer of the
1014 product. Use this switch to disable the integration.])
1017 AC_ARG_ENABLE(avmedia,
1018 AS_HELP_STRING([--disable-avmedia],
1019 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
1022 AC_ARG_ENABLE(database-connectivity,
1023 AS_HELP_STRING([--disable-database-connectivity],
1024 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
1027 # This doesn't mean not building (or "integrating") extensions
1028 # (although it probably should; i.e. it should imply
1029 # --disable-extension-integration I guess), it means not supporting
1030 # any extension mechanism at all
1031 libo_FUZZ_ARG_ENABLE(extensions,
1032 AS_HELP_STRING([--disable-extensions],
1033 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1036 AC_ARG_ENABLE(scripting,
1037 AS_HELP_STRING([--disable-scripting],
1038 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1041 # This is mainly for Android and iOS, but could potentially be used in some
1042 # special case otherwise, too, so factored out as a separate setting
1044 AC_ARG_ENABLE(dynamic-loading,
1045 AS_HELP_STRING([--disable-dynamic-loading],
1046 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1049 libo_FUZZ_ARG_ENABLE(report-builder,
1050 AS_HELP_STRING([--disable-report-builder],
1051 [Disable the Report Builder.])
1054 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1055 AS_HELP_STRING([--enable-ext-wiki-publisher],
1056 [Enable the Wiki Publisher extension.])
1059 libo_FUZZ_ARG_ENABLE(lpsolve,
1060 AS_HELP_STRING([--disable-lpsolve],
1061 [Disable compilation of the lp solve solver ])
1063 libo_FUZZ_ARG_ENABLE(coinmp,
1064 AS_HELP_STRING([--disable-coinmp],
1065 [Disable compilation of the CoinMP solver ])
1068 libo_FUZZ_ARG_ENABLE(pdfimport,
1069 AS_HELP_STRING([--disable-pdfimport],
1070 [Disable building the PDF import feature.])
1073 libo_FUZZ_ARG_ENABLE(pdfium,
1074 AS_HELP_STRING([--disable-pdfium],
1075 [Disable building PDFium.])
1078 libo_FUZZ_ARG_ENABLE(skia,
1079 AS_HELP_STRING([--disable-skia],
1080 [Disable building Skia.])
1083 ###############################################################################
1085 dnl ---------- *** ----------
1087 libo_FUZZ_ARG_ENABLE(mergelibs,
1088 AS_HELP_STRING([--enable-mergelibs],
1089 [Merge several of the smaller libraries into one big, "merged", one.])
1092 libo_FUZZ_ARG_ENABLE(breakpad,
1093 AS_HELP_STRING([--enable-breakpad],
1094 [Enables breakpad for crash reporting.])
1097 libo_FUZZ_ARG_ENABLE(crashdump,
1098 AS_HELP_STRING([--disable-crashdump],
1099 [Disable dump.ini and dump-file, when --enable-breakpad])
1102 AC_ARG_ENABLE(fetch-external,
1103 AS_HELP_STRING([--disable-fetch-external],
1104 [Disables fetching external tarballs from web sources.])
1107 AC_ARG_ENABLE(fuzzers,
1108 AS_HELP_STRING([--enable-fuzzers],
1109 [Enables building libfuzzer targets for fuzz testing.])
1112 libo_FUZZ_ARG_ENABLE(pch,
1113 AS_HELP_STRING([--enable-pch=<yes/no/system/base/normal/full>],
1114 [Enables precompiled header support for C++. Forced default on Windows/VC build.
1115 Using 'system' will include only external headers, 'base' will add also headers
1116 from base modules, 'normal' will also add all headers except from the module built,
1117 'full' will use all suitable headers even from a module itself.])
1120 libo_FUZZ_ARG_ENABLE(epm,
1121 AS_HELP_STRING([--enable-epm],
1122 [LibreOffice includes self-packaging code, that requires epm, however epm is
1123 useless for large scale package building.])
1126 libo_FUZZ_ARG_ENABLE(odk,
1127 AS_HELP_STRING([--disable-odk],
1128 [LibreOffice includes an ODK, office development kit which some packagers may
1129 wish to build without.])
1132 AC_ARG_ENABLE(mpl-subset,
1133 AS_HELP_STRING([--enable-mpl-subset],
1134 [Don't compile any pieces which are not MPL or more liberally licensed])
1137 libo_FUZZ_ARG_ENABLE(evolution2,
1138 AS_HELP_STRING([--enable-evolution2],
1139 [Allows the built-in evolution 2 addressbook connectivity build to be
1143 AC_ARG_ENABLE(avahi,
1144 AS_HELP_STRING([--enable-avahi],
1145 [Determines whether to use Avahi to advertise Impress to remote controls.])
1148 libo_FUZZ_ARG_ENABLE(werror,
1149 AS_HELP_STRING([--enable-werror],
1150 [Turn warnings to errors. (Has no effect in modules where the treating
1151 of warnings as errors is disabled explicitly.)]),
1154 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1155 AS_HELP_STRING([--enable-assert-always-abort],
1156 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1159 libo_FUZZ_ARG_ENABLE(dbgutil,
1160 AS_HELP_STRING([--enable-dbgutil],
1161 [Provide debugging support from --enable-debug and include additional debugging
1162 utilities such as object counting or more expensive checks.
1163 This is the recommended option for developers.
1164 Note that this makes the build ABI incompatible, it is not possible to mix object
1165 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1167 libo_FUZZ_ARG_ENABLE(debug,
1168 AS_HELP_STRING([--enable-debug],
1169 [Include debugging information, disable compiler optimization and inlining plus
1170 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1172 libo_FUZZ_ARG_ENABLE(split-debug,
1173 AS_HELP_STRING([--disable-split-debug],
1174 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1175 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1177 libo_FUZZ_ARG_ENABLE(gdb-index,
1178 AS_HELP_STRING([--disable-gdb-index],
1179 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1180 The feature requires the gold or lld linker.]))
1182 libo_FUZZ_ARG_ENABLE(sal-log,
1183 AS_HELP_STRING([--enable-sal-log],
1184 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1186 libo_FUZZ_ARG_ENABLE(symbols,
1187 AS_HELP_STRING([--enable-symbols],
1188 [Generate debug information.
1189 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1190 otherwise. It is possible to explicitly specify gbuild build targets
1191 (where 'all' means everything, '-' prepended means to not enable, '/' appended means
1192 everything in the directory; there is no ordering, more specific overrides
1193 more general, and disabling takes precedence).
1194 Example: --enable-symbols="all -sw/ -Library_sc".]))
1196 libo_FUZZ_ARG_ENABLE(optimized,
1197 AS_HELP_STRING([--disable-optimized],
1198 [Whether to compile with optimization flags.
1199 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1202 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1203 AS_HELP_STRING([--disable-runtime-optimizations],
1204 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1205 JVM JIT) that are known to interact badly with certain dynamic analysis
1206 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1207 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1208 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1210 AC_ARG_WITH(valgrind,
1211 AS_HELP_STRING([--with-valgrind],
1212 [Make availability of Valgrind headers a hard requirement.]))
1214 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1215 AS_HELP_STRING([--enable-compiler-plugins],
1216 [Enable compiler plugins that will perform additional checks during
1217 building. Enabled automatically by --enable-dbgutil.
1218 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1219 COMPILER_PLUGINS_DEBUG=
1220 if test "$enable_compiler_plugins" = debug; then
1221 enable_compiler_plugins=yes
1222 COMPILER_PLUGINS_DEBUG=TRUE
1225 libo_FUZZ_ARG_ENABLE(ooenv,
1226 AS_HELP_STRING([--disable-ooenv],
1227 [Disable ooenv for the instdir installation.]))
1229 libo_FUZZ_ARG_ENABLE(libnumbertext,
1230 AS_HELP_STRING([--disable-libnumbertext],
1231 [Disable use of numbertext external library.]))
1234 AS_HELP_STRING([--enable-lto],
1235 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1236 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1237 linker. For MSVC, this option is broken at the moment. This is experimental work
1238 in progress that shouldn't be used unless you are working on it.)]))
1240 AC_ARG_ENABLE(python,
1241 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1242 [Enables or disables Python support at run-time.
1243 Also specifies what Python to use. 'auto' is the default.
1244 'fully-internal' even forces the internal version for uses of Python
1245 during the build.]))
1247 libo_FUZZ_ARG_ENABLE(gtk3,
1248 AS_HELP_STRING([--disable-gtk3],
1249 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1250 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1252 AC_ARG_ENABLE(introspection,
1253 AS_HELP_STRING([--enable-introspection],
1254 [Generate files for GObject introspection. Requires --enable-gtk3. (Typically used by
1255 Linux distributions.)]))
1257 AC_ARG_ENABLE(split-app-modules,
1258 AS_HELP_STRING([--enable-split-app-modules],
1259 [Split file lists for app modules, e.g. base, calc.
1260 Has effect only with make distro-pack-install]),
1263 AC_ARG_ENABLE(split-opt-features,
1264 AS_HELP_STRING([--enable-split-opt-features],
1265 [Split file lists for some optional features, e.g. pyuno, testtool.
1266 Has effect only with make distro-pack-install]),
1269 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1270 AS_HELP_STRING([--disable-cairo-canvas],
1271 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1274 libo_FUZZ_ARG_ENABLE(dbus,
1275 AS_HELP_STRING([--disable-dbus],
1276 [Determines whether to enable features that depend on dbus.
1277 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1278 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1280 libo_FUZZ_ARG_ENABLE(sdremote,
1281 AS_HELP_STRING([--disable-sdremote],
1282 [Determines whether to enable Impress remote control (i.e. the server component).]),
1283 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1285 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1286 AS_HELP_STRING([--disable-sdremote-bluetooth],
1287 [Determines whether to build sdremote with bluetooth support.
1288 Requires dbus on Linux.]))
1290 libo_FUZZ_ARG_ENABLE(gio,
1291 AS_HELP_STRING([--disable-gio],
1292 [Determines whether to use the GIO support.]),
1293 ,test "${enable_gio+set}" = set || enable_gio=yes)
1296 AS_HELP_STRING([--enable-qt5],
1297 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1302 AS_HELP_STRING([--enable-kf5],
1303 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1304 KF5 are available.]),
1308 AS_HELP_STRING([--enable-kde5],
1309 [Compatibility switch for the kde5 => kf5 rename. Use --enable-kf5!])
1312 AC_ARG_ENABLE(gtk3_kde5,
1313 AS_HELP_STRING([--enable-gtk3-kde5],
1314 [Determines whether to use Gtk3 vclplug with KF5 file dialogs on
1315 platforms where Gtk3, Qt5 and Plasma is available.]),
1319 AS_HELP_STRING([--disable-gui],
1320 [Disable use of X11 or Wayland to reduce dependencies (e.g. for building LibreOfficeKit).]),
1323 libo_FUZZ_ARG_ENABLE(randr,
1324 AS_HELP_STRING([--disable-randr],
1325 [Disable RandR support in the vcl project.]),
1326 ,test "${enable_randr+set}" = set || enable_randr=yes)
1328 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1329 AS_HELP_STRING([--disable-gstreamer-1-0],
1330 [Disable building with the gstreamer 1.0 avmedia backend.]),
1331 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1333 libo_FUZZ_ARG_ENABLE(vlc,
1334 AS_HELP_STRING([--enable-vlc],
1335 [Enable building with the (experimental) VLC avmedia backend.]),
1336 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1338 libo_FUZZ_ARG_ENABLE(neon,
1339 AS_HELP_STRING([--disable-neon],
1340 [Disable neon and the compilation of webdav binding.]),
1343 libo_FUZZ_ARG_ENABLE([eot],
1344 [AS_HELP_STRING([--enable-eot],
1345 [Enable support for Embedded OpenType fonts.])],
1346 ,test "${enable_eot+set}" = set || enable_eot=no)
1348 libo_FUZZ_ARG_ENABLE(cve-tests,
1349 AS_HELP_STRING([--disable-cve-tests],
1350 [Prevent CVE tests to be executed]),
1353 libo_FUZZ_ARG_ENABLE(chart-tests,
1354 AS_HELP_STRING([--enable-chart-tests],
1355 [Executes chart XShape tests. In a perfect world these tests would be
1356 stable and everyone could run them, in reality it is best to run them
1357 only on a few machines that are known to work and maintained by people
1358 who can judge if a test failure is a regression or not.]),
1361 AC_ARG_ENABLE(build-unowinreg,
1362 AS_HELP_STRING([--enable-build-unowinreg],
1363 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1364 compiler is needed on Linux.]),
1367 AC_ARG_ENABLE(build-opensymbol,
1368 AS_HELP_STRING([--enable-build-opensymbol],
1369 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1370 fontforge installed.]),
1373 AC_ARG_ENABLE(dependency-tracking,
1374 AS_HELP_STRING([--enable-dependency-tracking],
1375 [Do not reject slow dependency extractors.])[
1376 --disable-dependency-tracking
1377 Disables generation of dependency information.
1378 Speed up one-time builds.],
1381 AC_ARG_ENABLE(icecream,
1382 AS_HELP_STRING([--enable-icecream],
1383 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1384 It defaults to /opt/icecream for the location of the icecream gcc/g++
1385 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1389 AS_HELP_STRING([--enable-ld=<linker>],
1390 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1391 By default tries to use the best linker possible, use --disable-ld to use the default linker.]),
1394 libo_FUZZ_ARG_ENABLE(cups,
1395 AS_HELP_STRING([--disable-cups],
1396 [Do not build cups support.])
1399 AC_ARG_ENABLE(ccache,
1400 AS_HELP_STRING([--disable-ccache],
1401 [Do not try to use ccache automatically.
1402 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1403 CC/CXX are not yet set, and --enable-icecream is not given, we
1404 attempt to use ccache. --disable-ccache disables ccache completely.
1405 Additionally ccache's depend mode is enabled if possible,
1406 use --enable-ccache=nodepend to enable ccache without depend mode.
1410 AC_ARG_ENABLE(64-bit,
1411 AS_HELP_STRING([--enable-64-bit],
1412 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1413 At the moment meaningful only for Windows.]), ,)
1415 libo_FUZZ_ARG_ENABLE(online-update,
1416 AS_HELP_STRING([--enable-online-update],
1417 [Enable the online update service that will check for new versions of
1418 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1419 If the value is "mar", the experimental Mozilla-like update will be
1420 enabled instead of the traditional update mechanism.]),
1423 AC_ARG_WITH(update-config,
1424 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1425 [Path to the update config ini file]))
1427 libo_FUZZ_ARG_ENABLE(extension-update,
1428 AS_HELP_STRING([--disable-extension-update],
1429 [Disable possibility to update installed extensions.]),
1432 libo_FUZZ_ARG_ENABLE(release-build,
1433 AS_HELP_STRING([--enable-release-build],
1434 [Enable release build. Note that the "release build" choice is orthogonal to
1435 whether symbols are present, debug info is generated, or optimization
1437 See http://wiki.documentfoundation.org/Development/DevBuild]),
1440 AC_ARG_ENABLE(windows-build-signing,
1441 AS_HELP_STRING([--enable-windows-build-signing],
1442 [Enable signing of windows binaries (*.exe, *.dll)]),
1445 AC_ARG_ENABLE(silent-msi,
1446 AS_HELP_STRING([--enable-silent-msi],
1447 [Enable MSI with LIMITUI=1 (silent install).]),
1450 AC_ARG_ENABLE(macosx-code-signing,
1451 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1452 [Sign executables, dylibs, frameworks and the app bundle. If you
1453 don't provide an identity the first suitable certificate
1454 in your keychain is used.]),
1457 AC_ARG_ENABLE(macosx-package-signing,
1458 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1459 [Create a .pkg suitable for uploading to the Mac App Store and sign
1460 it. If you don't provide an identity the first suitable certificate
1461 in your keychain is used.]),
1464 AC_ARG_ENABLE(macosx-sandbox,
1465 AS_HELP_STRING([--enable-macosx-sandbox],
1466 [Make the app bundle run in a sandbox. Requires code signing.
1467 Is required by apps distributed in the Mac App Store, and implies
1468 adherence to App Store rules.]),
1471 AC_ARG_WITH(macosx-bundle-identifier,
1472 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1473 [Define the macOS bundle identifier. Default is the somewhat weird
1474 org.libreoffice.script ("script", huh?).]),
1475 ,with_macosx_bundle_identifier=org.libreoffice.script)
1477 AC_ARG_WITH(product-name,
1478 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1479 [Define the product name. Default is AC_PACKAGE_NAME.]),
1480 ,with_product_name=$PRODUCTNAME)
1482 AC_ARG_WITH(package-version,
1483 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1484 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1487 libo_FUZZ_ARG_ENABLE(readonly-installset,
1488 AS_HELP_STRING([--enable-readonly-installset],
1489 [Prevents any attempts by LibreOffice to write into its installation. That means
1490 at least that no "system-wide" extensions can be added. Partly experimental work in
1491 progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
1494 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1495 AS_HELP_STRING([--disable-postgresql-sdbc],
1496 [Disable the build of the PostgreSQL-SDBC driver.])
1499 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1500 AS_HELP_STRING([--disable-lotuswordpro],
1501 [Disable the build of the Lotus Word Pro filter.]),
1502 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1504 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1505 AS_HELP_STRING([--disable-firebird-sdbc],
1506 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1507 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1509 AC_ARG_ENABLE(bogus-pkg-config,
1510 AS_HELP_STRING([--enable-bogus-pkg-config],
1511 [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.]),
1514 AC_ARG_ENABLE(openssl,
1515 AS_HELP_STRING([--disable-openssl],
1516 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1517 components will either use GNUTLS or NSS. Work in progress,
1518 use only if you are hacking on it.]),
1519 ,enable_openssl=yes)
1521 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1522 AS_HELP_STRING([--enable-cipher-openssl-backend],
1523 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1524 Requires --enable-openssl.]))
1526 AC_ARG_ENABLE(library-bin-tar,
1527 AS_HELP_STRING([--enable-library-bin-tar],
1528 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1529 Some libraries can save their build result in a tarball
1530 stored in TARFILE_LOCATION. That binary tarball is
1531 uniquely identified by the source tarball,
1532 the content of the config_host.mk file and the content
1533 of the top-level directory in core for that library
1534 If this option is enabled, then if such a tarfile exist, it will be untarred
1535 instead of the source tarfile, and the build step will be skipped for that
1537 If a proper tarfile does not exist, then the normal source-based
1538 build is done for that library and a proper binary tarfile is created
1539 for the next time.]),
1542 AC_ARG_ENABLE(dconf,
1543 AS_HELP_STRING([--disable-dconf],
1544 [Disable the dconf configuration backend (enabled by default where
1547 libo_FUZZ_ARG_ENABLE(formula-logger,
1549 [--enable-formula-logger],
1550 [Enable formula logger for logging formula calculation flow in Calc.]
1555 AS_HELP_STRING([--disable-ldap],
1556 [Disable LDAP support.]),
1559 dnl ===================================================================
1560 dnl Optional Packages (--with/without-)
1561 dnl ===================================================================
1563 AC_ARG_WITH(gcc-home,
1564 AS_HELP_STRING([--with-gcc-home],
1565 [Specify the location of gcc/g++ manually. This can be used in conjunction
1566 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1567 non-default path.]),
1570 AC_ARG_WITH(gnu-patch,
1571 AS_HELP_STRING([--with-gnu-patch],
1572 [Specify location of GNU patch on Solaris or FreeBSD.]),
1575 AC_ARG_WITH(build-platform-configure-options,
1576 AS_HELP_STRING([--with-build-platform-configure-options],
1577 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1581 AS_HELP_STRING([--with-gnu-cp],
1582 [Specify location of GNU cp on Solaris or FreeBSD.]),
1585 AC_ARG_WITH(external-tar,
1586 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1587 [Specify an absolute path of where to find (and store) tarfiles.]),
1588 TARFILE_LOCATION=$withval ,
1591 AC_ARG_WITH(referenced-git,
1592 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1593 [Specify another checkout directory to reference. This makes use of
1594 git submodule update --reference, and saves a lot of diskspace
1595 when having multiple trees side-by-side.]),
1596 GIT_REFERENCE_SRC=$withval ,
1599 AC_ARG_WITH(linked-git,
1600 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1601 [Specify a directory where the repositories of submodules are located.
1602 This uses a method similar to git-new-workdir to get submodules.]),
1603 GIT_LINK_SRC=$withval ,
1606 AC_ARG_WITH(galleries,
1607 AS_HELP_STRING([--with-galleries],
1608 [Specify how galleries should be built. It is possible either to
1609 build these internally from source ("build"),
1610 or to disable them ("no")]),
1614 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1615 [Choose which themes to include. By default those themes with an '*' are included.
1616 Possible choices: *breeze, *breeze_dark, *breeze_svg, *colibre, *colibre_svg, *elementary,
1617 *elementary_svg, *karasa_jaga, *karasa_jaga_svg, *sifr, *sif_svg, *sifr_dark, *tango.]),
1620 libo_FUZZ_ARG_WITH(helppack-integration,
1621 AS_HELP_STRING([--without-helppack-integration],
1622 [It will not integrate the helppacks to the installer
1623 of the product. Please use this switch to use the online help
1624 or separate help packages.]),
1627 libo_FUZZ_ARG_WITH(fonts,
1628 AS_HELP_STRING([--without-fonts],
1629 [LibreOffice includes some third-party fonts to provide a reliable basis for
1630 help content, templates, samples, etc. When these fonts are already
1631 known to be available on the system then you should use this option.]),
1635 AS_HELP_STRING([--with-epm],
1636 [Decides which epm to use. Default is to use the one from the system if
1637 one is built. When either this is not there or you say =internal epm
1641 AC_ARG_WITH(package-format,
1642 AS_HELP_STRING([--with-package-format],
1643 [Specify package format(s) for LibreOffice installation sets. The
1644 implicit --without-package-format leads to no installation sets being
1645 generated. Possible values: aix, archive, bsd, deb, dmg,
1646 installed, msi, pkg, and rpm.
1647 Example: --with-package-format='deb rpm']),
1651 AS_HELP_STRING([--with-tls],
1652 [Decides which TLS/SSL and cryptographic implementations to use for
1653 LibreOffice's code. Notice that this doesn't apply for depending
1654 libraries like "neon", for example. Default is to use OpenSSL
1655 although NSS is also possible. Notice that selecting NSS restricts
1656 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1657 restrict by now the usage of NSS in LO's code. Possible values:
1658 openssl, nss. Example: --with-tls="nss"]),
1661 AC_ARG_WITH(system-libs,
1662 AS_HELP_STRING([--with-system-libs],
1663 [Use libraries already on system -- enables all --with-system-* flags.]),
1666 AC_ARG_WITH(system-bzip2,
1667 AS_HELP_STRING([--with-system-bzip2],
1668 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1669 [with_system_bzip2="$with_system_libs"])
1671 AC_ARG_WITH(system-headers,
1672 AS_HELP_STRING([--with-system-headers],
1673 [Use headers already on system -- enables all --with-system-* flags for
1674 external packages whose headers are the only entities used i.e.
1675 boost/odbc/sane-header(s).]),,
1676 [with_system_headers="$with_system_libs"])
1678 AC_ARG_WITH(system-jars,
1679 AS_HELP_STRING([--without-system-jars],
1680 [When building with --with-system-libs, also the needed jars are expected
1681 on the system. Use this to disable that]),,
1682 [with_system_jars="$with_system_libs"])
1684 AC_ARG_WITH(system-cairo,
1685 AS_HELP_STRING([--with-system-cairo],
1686 [Use cairo libraries already on system. Happens automatically for
1687 (implicit) --enable-gtk3.]))
1689 AC_ARG_WITH(system-epoxy,
1690 AS_HELP_STRING([--with-system-epoxy],
1691 [Use epoxy libraries already on system. Happens automatically for
1692 (implicit) --enable-gtk3.]),,
1693 [with_system_epoxy="$with_system_libs"])
1695 AC_ARG_WITH(myspell-dicts,
1696 AS_HELP_STRING([--with-myspell-dicts],
1697 [Adds myspell dictionaries to the LibreOffice installation set]),
1700 AC_ARG_WITH(system-dicts,
1701 AS_HELP_STRING([--without-system-dicts],
1702 [Do not use dictionaries from system paths.]),
1705 AC_ARG_WITH(external-dict-dir,
1706 AS_HELP_STRING([--with-external-dict-dir],
1707 [Specify external dictionary dir.]),
1710 AC_ARG_WITH(external-hyph-dir,
1711 AS_HELP_STRING([--with-external-hyph-dir],
1712 [Specify external hyphenation pattern dir.]),
1715 AC_ARG_WITH(external-thes-dir,
1716 AS_HELP_STRING([--with-external-thes-dir],
1717 [Specify external thesaurus dir.]),
1720 AC_ARG_WITH(system-zlib,
1721 AS_HELP_STRING([--with-system-zlib],
1722 [Use zlib already on system.]),,
1723 [with_system_zlib=auto])
1725 AC_ARG_WITH(system-jpeg,
1726 AS_HELP_STRING([--with-system-jpeg],
1727 [Use jpeg already on system.]),,
1728 [with_system_jpeg="$with_system_libs"])
1730 AC_ARG_WITH(system-clucene,
1731 AS_HELP_STRING([--with-system-clucene],
1732 [Use clucene already on system.]),,
1733 [with_system_clucene="$with_system_libs"])
1735 AC_ARG_WITH(system-expat,
1736 AS_HELP_STRING([--with-system-expat],
1737 [Use expat already on system.]),,
1738 [with_system_expat="$with_system_libs"])
1740 AC_ARG_WITH(system-libxml,
1741 AS_HELP_STRING([--with-system-libxml],
1742 [Use libxml/libxslt already on system.]),,
1743 [with_system_libxml=auto])
1745 AC_ARG_WITH(system-icu,
1746 AS_HELP_STRING([--with-system-icu],
1747 [Use icu already on system.]),,
1748 [with_system_icu="$with_system_libs"])
1750 AC_ARG_WITH(system-ucpp,
1751 AS_HELP_STRING([--with-system-ucpp],
1752 [Use ucpp already on system.]),,
1755 AC_ARG_WITH(system-openldap,
1756 AS_HELP_STRING([--with-system-openldap],
1757 [Use the OpenLDAP LDAP SDK already on system.]),,
1758 [with_system_openldap="$with_system_libs"])
1760 libo_FUZZ_ARG_ENABLE(poppler,
1761 AS_HELP_STRING([--disable-poppler],
1762 [Disable building Poppler.])
1765 AC_ARG_WITH(system-poppler,
1766 AS_HELP_STRING([--with-system-poppler],
1767 [Use system poppler (only needed for PDF import).]),,
1768 [with_system_poppler="$with_system_libs"])
1770 AC_ARG_WITH(system-gpgmepp,
1771 AS_HELP_STRING([--with-system-gpgmepp],
1772 [Use gpgmepp already on system]),,
1773 [with_system_gpgmepp="$with_system_libs"])
1775 AC_ARG_WITH(system-apache-commons,
1776 AS_HELP_STRING([--with-system-apache-commons],
1777 [Use Apache commons libraries already on system.]),,
1778 [with_system_apache_commons="$with_system_jars"])
1780 AC_ARG_WITH(system-mariadb,
1781 AS_HELP_STRING([--with-system-mariadb],
1782 [Use MariaDB/MySQL libraries already on system.]),,
1783 [with_system_mariadb="$with_system_libs"])
1785 AC_ARG_ENABLE(bundle-mariadb,
1786 AS_HELP_STRING([--enable-bundle-mariadb],
1787 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
1790 AC_ARG_WITH(system-postgresql,
1791 AS_HELP_STRING([--with-system-postgresql],
1792 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1793 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1794 [with_system_postgresql="$with_system_libs"])
1796 AC_ARG_WITH(libpq-path,
1797 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1798 [Use this PostgreSQL C interface (libpq) installation for building
1799 the PostgreSQL-SDBC extension.]),
1802 AC_ARG_WITH(system-firebird,
1803 AS_HELP_STRING([--with-system-firebird],
1804 [Use Firebird libraries already on system, for building the Firebird-SDBC
1805 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1806 [with_system_firebird="$with_system_libs"])
1808 AC_ARG_WITH(system-libtommath,
1809 AS_HELP_STRING([--with-system-libtommath],
1810 [Use libtommath already on system]),,
1811 [with_system_libtommath="$with_system_libs"])
1813 AC_ARG_WITH(system-hsqldb,
1814 AS_HELP_STRING([--with-system-hsqldb],
1815 [Use hsqldb already on system.]))
1817 AC_ARG_WITH(hsqldb-jar,
1818 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1819 [Specify path to jarfile manually.]),
1820 HSQLDB_JAR=$withval)
1822 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1823 AS_HELP_STRING([--disable-scripting-beanshell],
1824 [Disable support for scripts in BeanShell.]),
1828 AC_ARG_WITH(system-beanshell,
1829 AS_HELP_STRING([--with-system-beanshell],
1830 [Use beanshell already on system.]),,
1831 [with_system_beanshell="$with_system_jars"])
1833 AC_ARG_WITH(beanshell-jar,
1834 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1835 [Specify path to jarfile manually.]),
1838 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1839 AS_HELP_STRING([--disable-scripting-javascript],
1840 [Disable support for scripts in JavaScript.]),
1844 AC_ARG_WITH(system-rhino,
1845 AS_HELP_STRING([--with-system-rhino],
1846 [Use rhino already on system.]),,)
1847 # [with_system_rhino="$with_system_jars"])
1848 # Above is not used as we have different debug interface
1849 # patched into internal rhino. This code needs to be fixed
1850 # before we can enable it by default.
1852 AC_ARG_WITH(rhino-jar,
1853 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1854 [Specify path to jarfile manually.]),
1857 AC_ARG_WITH(commons-logging-jar,
1858 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1859 [Specify path to jarfile manually.]),
1860 COMMONS_LOGGING_JAR=$withval)
1862 AC_ARG_WITH(system-jfreereport,
1863 AS_HELP_STRING([--with-system-jfreereport],
1864 [Use JFreeReport already on system.]),,
1865 [with_system_jfreereport="$with_system_jars"])
1867 AC_ARG_WITH(sac-jar,
1868 AS_HELP_STRING([--with-sac-jar=JARFILE],
1869 [Specify path to jarfile manually.]),
1872 AC_ARG_WITH(libxml-jar,
1873 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1874 [Specify path to jarfile manually.]),
1875 LIBXML_JAR=$withval)
1877 AC_ARG_WITH(flute-jar,
1878 AS_HELP_STRING([--with-flute-jar=JARFILE],
1879 [Specify path to jarfile manually.]),
1882 AC_ARG_WITH(jfreereport-jar,
1883 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1884 [Specify path to jarfile manually.]),
1885 JFREEREPORT_JAR=$withval)
1887 AC_ARG_WITH(liblayout-jar,
1888 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1889 [Specify path to jarfile manually.]),
1890 LIBLAYOUT_JAR=$withval)
1892 AC_ARG_WITH(libloader-jar,
1893 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1894 [Specify path to jarfile manually.]),
1895 LIBLOADER_JAR=$withval)
1897 AC_ARG_WITH(libformula-jar,
1898 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1899 [Specify path to jarfile manually.]),
1900 LIBFORMULA_JAR=$withval)
1902 AC_ARG_WITH(librepository-jar,
1903 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1904 [Specify path to jarfile manually.]),
1905 LIBREPOSITORY_JAR=$withval)
1907 AC_ARG_WITH(libfonts-jar,
1908 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1909 [Specify path to jarfile manually.]),
1910 LIBFONTS_JAR=$withval)
1912 AC_ARG_WITH(libserializer-jar,
1913 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1914 [Specify path to jarfile manually.]),
1915 LIBSERIALIZER_JAR=$withval)
1917 AC_ARG_WITH(libbase-jar,
1918 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1919 [Specify path to jarfile manually.]),
1920 LIBBASE_JAR=$withval)
1922 AC_ARG_WITH(system-odbc,
1923 AS_HELP_STRING([--with-system-odbc],
1924 [Use the odbc headers already on system.]),,
1925 [with_system_odbc="auto"])
1927 AC_ARG_WITH(system-sane,
1928 AS_HELP_STRING([--with-system-sane],
1929 [Use sane.h already on system.]),,
1930 [with_system_sane="$with_system_headers"])
1932 AC_ARG_WITH(system-bluez,
1933 AS_HELP_STRING([--with-system-bluez],
1934 [Use bluetooth.h already on system.]),,
1935 [with_system_bluez="$with_system_headers"])
1937 AC_ARG_WITH(system-curl,
1938 AS_HELP_STRING([--with-system-curl],
1939 [Use curl already on system.]),,
1940 [with_system_curl=auto])
1942 AC_ARG_WITH(system-boost,
1943 AS_HELP_STRING([--with-system-boost],
1944 [Use boost already on system.]),,
1945 [with_system_boost="$with_system_headers"])
1947 AC_ARG_WITH(system-glm,
1948 AS_HELP_STRING([--with-system-glm],
1949 [Use glm already on system.]),,
1950 [with_system_glm="$with_system_headers"])
1952 AC_ARG_WITH(system-hunspell,
1953 AS_HELP_STRING([--with-system-hunspell],
1954 [Use libhunspell already on system.]),,
1955 [with_system_hunspell="$with_system_libs"])
1957 AC_ARG_WITH(system-qrcodegen,
1958 AS_HELP_STRING([--with-system-qrcodegen],
1959 [Use libqrcodegen already on system.]),,
1960 [with_system_qrcodegen="$with_system_libs"])
1962 AC_ARG_WITH(system-mythes,
1963 AS_HELP_STRING([--with-system-mythes],
1964 [Use mythes already on system.]),,
1965 [with_system_mythes="$with_system_libs"])
1967 AC_ARG_WITH(system-altlinuxhyph,
1968 AS_HELP_STRING([--with-system-altlinuxhyph],
1969 [Use ALTLinuxhyph already on system.]),,
1970 [with_system_altlinuxhyph="$with_system_libs"])
1972 AC_ARG_WITH(system-lpsolve,
1973 AS_HELP_STRING([--with-system-lpsolve],
1974 [Use lpsolve already on system.]),,
1975 [with_system_lpsolve="$with_system_libs"])
1977 AC_ARG_WITH(system-coinmp,
1978 AS_HELP_STRING([--with-system-coinmp],
1979 [Use CoinMP already on system.]),,
1980 [with_system_coinmp="$with_system_libs"])
1982 AC_ARG_WITH(system-liblangtag,
1983 AS_HELP_STRING([--with-system-liblangtag],
1984 [Use liblangtag library already on system.]),,
1985 [with_system_liblangtag="$with_system_libs"])
1988 AS_HELP_STRING([--with-webdav],
1989 [Specify which library to use for webdav implementation.
1990 Possible values: "neon", "serf", "no". The default value is "neon".
1991 Example: --with-webdav="serf"]),
1992 WITH_WEBDAV=$withval,
1995 AC_ARG_WITH(linker-hash-style,
1996 AS_HELP_STRING([--with-linker-hash-style],
1997 [Use linker with --hash-style=<style> when linking shared objects.
1998 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1999 if supported on the build system, and "sysv" otherwise.]))
2001 AC_ARG_WITH(jdk-home,
2002 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
2003 [If you have installed JDK 8 or later on your system please supply the
2004 path here. Note that this is not the location of the java command but the
2005 location of the entire distribution.]),
2009 AS_HELP_STRING([--with-help],
2010 [Enable the build of help. There is a special parameter "common" that
2011 can be used to bundle only the common part, .e.g help-specific icons.
2012 This is useful when you build the helpcontent separately.])
2014 Usage: --with-help build the old local help
2015 --without-help no local help (default)
2016 --with-help=html build the new HTML local help
2017 --with-help=online build the new HTML online help
2021 AC_ARG_WITH(omindex,
2022 AS_HELP_STRING([--with-omindex],
2023 [Enable the support of xapian-omega index for online help.])
2025 Usage: --with-omindex=server prepare the pages for omindex
2026 but let xapian-omega be built in server.
2027 --with-omindex=noxap do not prepare online pages
2032 libo_FUZZ_ARG_WITH(java,
2033 AS_HELP_STRING([--with-java=<java command>],
2034 [Specify the name of the Java interpreter command. Typically "java"
2035 which is the default.
2037 To build without support for Java components, applets, accessibility
2038 or the XML filters written in Java, use --without-java or --with-java=no.]),
2039 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2040 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
2043 AC_ARG_WITH(jvm-path,
2044 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
2045 [Use a specific JVM search path at runtime.
2046 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2049 AC_ARG_WITH(ant-home,
2050 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2051 [If you have installed Apache Ant on your system, please supply the path here.
2052 Note that this is not the location of the Ant binary but the location
2053 of the entire distribution.]),
2056 AC_ARG_WITH(symbol-config,
2057 AS_HELP_STRING([--with-symbol-config],
2058 [Configuration for the crashreport symbol upload]),
2060 [with_symbol_config=no])
2062 AC_ARG_WITH(export-validation,
2063 AS_HELP_STRING([--without-export-validation],
2064 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2065 ,with_export_validation=auto)
2067 AC_ARG_WITH(bffvalidator,
2068 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2069 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2070 Requires installed Microsoft Office Binary File Format Validator.
2071 Note: export-validation (--with-export-validation) is required to be turned on.
2072 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2073 ,with_bffvalidator=no)
2075 libo_FUZZ_ARG_WITH(junit,
2076 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2077 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2078 --without-junit disables those tests. Not relevant in the --without-java case.]),
2081 AC_ARG_WITH(hamcrest,
2082 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2083 [Specifies the hamcrest jar file to use for JUnit-based tests.
2084 --without-junit disables those tests. Not relevant in the --without-java case.]),
2087 AC_ARG_WITH(perl-home,
2088 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2089 [If you have installed Perl 5 Distribution, on your system, please
2090 supply the path here. Note that this is not the location of the Perl
2091 binary but the location of the entire distribution.]),
2094 libo_FUZZ_ARG_WITH(doxygen,
2096 [--with-doxygen=<absolute path to doxygen executable>],
2097 [Specifies the doxygen executable to use when generating ODK C/C++
2098 documentation. --without-doxygen disables generation of ODK C/C++
2099 documentation. Not relevant in the --disable-odk case.]),
2102 AC_ARG_WITH(visual-studio,
2103 AS_HELP_STRING([--with-visual-studio=<2017>],
2104 [Specify which Visual Studio version to use in case several are
2105 installed. Currently only 2017 is supported.]),
2108 AC_ARG_WITH(windows-sdk,
2109 AS_HELP_STRING([--with-windows-sdk=<8.0(A)/8.1(A)/10.0>],
2110 [Specify which Windows SDK, or "Windows Kit", version to use
2111 in case the one that came with the selected Visual Studio
2112 is not what you want for some reason. Note that not all compiler/SDK
2113 combinations are supported. The intent is that this option should not
2118 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2119 [Use this option to build LibreOffice with additional UI language support.
2120 English (US) is always included by default.
2121 Separate multiple languages with space.
2122 For all languages, use --with-lang=ALL.]),
2125 AC_ARG_WITH(locales,
2126 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2127 [Use this option to limit the locale information built in.
2128 Separate multiple locales with space.
2129 Very experimental and might well break stuff.
2130 Just a desperate measure to shrink code and data size.
2131 By default all the locales available is included.
2132 This option is completely unrelated to --with-lang.])
2134 Affects also our character encoding conversion
2135 tables for encodings mainly targeted for a
2136 particular locale, like EUC-CN and EUC-TW for
2137 zh, ISO-2022-JP for ja.
2139 Affects also our add-on break iterator data for
2142 For the default, all locales, don't use this switch at all.
2143 Specifying just the language part of a locale means all matching
2144 locales will be included.
2148 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2149 libo_FUZZ_ARG_WITH(krb5,
2150 AS_HELP_STRING([--with-krb5],
2151 [Enable MIT Kerberos 5 support in modules that support it.
2152 By default automatically enabled on platforms
2153 where a good system Kerberos 5 is available.]),
2156 libo_FUZZ_ARG_WITH(gssapi,
2157 AS_HELP_STRING([--with-gssapi],
2158 [Enable GSSAPI support in modules that support it.
2159 By default automatically enabled on platforms
2160 where a good system GSSAPI is available.]),
2164 AS_HELP_STRING([--with-iwyu],
2165 [Use given IWYU binary path to check unneeded includes instead of building.
2166 Use only if you are hacking on it.]),
2169 libo_FUZZ_ARG_WITH(lxml,
2170 AS_HELP_STRING([--without-lxml],
2171 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2172 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2173 report widget classes and ids.]),
2176 dnl ===================================================================
2178 dnl ===================================================================
2180 AC_ARG_WITH(branding,
2181 AS_HELP_STRING([--with-branding=/path/to/images],
2182 [Use given path to retrieve branding images set.])
2184 Search for intro.png about.svg and flat_logo.svg.
2185 If any is missing, default ones will be used instead.
2187 Search also progress.conf for progress
2188 settings on intro screen :
2190 PROGRESSBARCOLOR="255,255,255" Set color of
2191 progress bar. Comma separated RGB decimal values.
2192 PROGRESSSIZE="407,6" Set size of progress bar.
2193 Comma separated decimal values (width, height).
2194 PROGRESSPOSITION="61,317" Set position of progress
2195 bar from left,top. Comma separated decimal values.
2196 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2197 bar frame. Comma separated RGB decimal values.
2198 PROGRESSTEXTCOLOR="0,0,0" Set color of progress
2199 bar text. Comma separated RGB decimal values.
2200 PROGRESSTEXTBASELINE="287" Set vertical position of
2201 progress bar text from top. Decimal value.
2203 Default values will be used if not found.
2208 AC_ARG_WITH(extra-buildid,
2209 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2210 [Show addition build identification in about dialog.]),
2215 AS_HELP_STRING([--with-vendor="John the Builder"],
2216 [Set vendor of the build.]),
2219 AC_ARG_WITH(android-package-name,
2220 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2221 [Set Android package name of the build.]),
2224 AC_ARG_WITH(compat-oowrappers,
2225 AS_HELP_STRING([--with-compat-oowrappers],
2226 [Install oo* wrappers in parallel with
2227 lo* ones to keep backward compatibility.
2228 Has effect only with make distro-pack-install]),
2231 AC_ARG_WITH(os-version,
2232 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2233 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2236 AC_ARG_WITH(mingw-cross-compiler,
2237 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2238 [Specify the MinGW cross-compiler to use.
2239 When building on the ODK on Unix and building unowinreg.dll,
2240 specify the MinGW C++ cross-compiler.]),
2243 AC_ARG_WITH(idlc-cpp,
2244 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2245 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2248 AC_ARG_WITH(build-version,
2249 AS_HELP_STRING([--with-build-version="Built by Jim"],
2250 [Allows the builder to add a custom version tag that will appear in the
2251 Help/About box for QA purposes.]),
2252 with_build_version=$withval,
2255 AC_ARG_WITH(parallelism,
2256 AS_HELP_STRING([--with-parallelism],
2257 [Number of jobs to run simultaneously during build. Parallel builds can
2258 save a lot of time on multi-cpu machines. Defaults to the number of
2259 CPUs on the machine, unless you configure --enable-icecream - then to
2263 AC_ARG_WITH(all-tarballs,
2264 AS_HELP_STRING([--with-all-tarballs],
2265 [Download all external tarballs unconditionally]))
2267 AC_ARG_WITH(gdrive-client-id,
2268 AS_HELP_STRING([--with-gdrive-client-id],
2269 [Provides the client id of the application for OAuth2 authentication
2270 on Google Drive. If either this or --with-gdrive-client-secret is
2271 empty, the feature will be disabled]),
2274 AC_ARG_WITH(gdrive-client-secret,
2275 AS_HELP_STRING([--with-gdrive-client-secret],
2276 [Provides the client secret of the application for OAuth2
2277 authentication on Google Drive. If either this or
2278 --with-gdrive-client-id is empty, the feature will be disabled]),
2281 AC_ARG_WITH(alfresco-cloud-client-id,
2282 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2283 [Provides the client id of the application for OAuth2 authentication
2284 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2285 empty, the feature will be disabled]),
2288 AC_ARG_WITH(alfresco-cloud-client-secret,
2289 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2290 [Provides the client secret of the application for OAuth2
2291 authentication on Alfresco Cloud. If either this or
2292 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2295 AC_ARG_WITH(onedrive-client-id,
2296 AS_HELP_STRING([--with-onedrive-client-id],
2297 [Provides the client id of the application for OAuth2 authentication
2298 on OneDrive. If either this or --with-onedrive-client-secret is
2299 empty, the feature will be disabled]),
2302 AC_ARG_WITH(onedrive-client-secret,
2303 AS_HELP_STRING([--with-onedrive-client-secret],
2304 [Provides the client secret of the application for OAuth2
2305 authentication on OneDrive. If either this or
2306 --with-onedrive-client-id is empty, the feature will be disabled]),
2308 dnl ===================================================================
2309 dnl Do we want to use pre-build binary tarball for recompile
2310 dnl ===================================================================
2312 if test "$enable_library_bin_tar" = "yes" ; then
2313 USE_LIBRARY_BIN_TAR=TRUE
2315 USE_LIBRARY_BIN_TAR=
2317 AC_SUBST(USE_LIBRARY_BIN_TAR)
2319 dnl ===================================================================
2320 dnl Test whether build target is Release Build
2321 dnl ===================================================================
2322 AC_MSG_CHECKING([whether build target is Release Build])
2323 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2325 ENABLE_RELEASE_BUILD=
2327 AC_MSG_RESULT([yes])
2328 ENABLE_RELEASE_BUILD=TRUE
2330 AC_SUBST(ENABLE_RELEASE_BUILD)
2332 dnl ===================================================================
2333 dnl Test whether to sign Windows Build
2334 dnl ===================================================================
2335 AC_MSG_CHECKING([whether to sign windows build])
2336 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2337 AC_MSG_RESULT([yes])
2338 WINDOWS_BUILD_SIGNING="TRUE"
2341 WINDOWS_BUILD_SIGNING="FALSE"
2343 AC_SUBST(WINDOWS_BUILD_SIGNING)
2345 dnl ===================================================================
2346 dnl MacOSX build and runtime environment options
2347 dnl ===================================================================
2349 AC_ARG_WITH(macosx-sdk,
2350 AS_HELP_STRING([--with-macosx-sdk=<version>],
2351 [Prefer a specific SDK for building.])
2353 If the requested SDK is not available, a search for the oldest one will be done.
2354 With current Xcode versions, only the latest SDK is included, so this option is
2355 not terribly useful. It works fine to build with a new SDK and run the result
2358 e. g.: --with-macosx-sdk=10.10
2360 there are 3 options to control the MacOSX build:
2361 --with-macosx-sdk (referred as 'sdk' below)
2362 --with-macosx-version-min-required (referred as 'min' below)
2363 --with-macosx-version-max-allowed (referred as 'max' below)
2365 the connection between these value and the default they take is as follow:
2366 ( ? means not specified on the command line, s means the SDK version found,
2367 constraint: 8 <= x <= y <= z)
2369 ==========================================
2370 command line || config result
2371 ==========================================
2372 min | max | sdk || min | max | sdk |
2373 ? | ? | ? || 10.10 | 10.s | 10.s |
2374 ? | ? | 10.x || 10.10 | 10.x | 10.x |
2375 ? | 10.x | ? || 10.10 | 10.s | 10.s |
2376 ? | 10.x | 10.y || 10.10 | 10.x | 10.y |
2377 10.x | ? | ? || 10.x | 10.s | 10.s |
2378 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2379 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2380 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2383 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2384 for a detailed technical explanation of these variables
2386 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2390 AC_ARG_WITH(macosx-version-min-required,
2391 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2392 [set the minimum OS version needed to run the built LibreOffice])
2394 e. g.: --with-macos-version-min-required=10.10
2395 see --with-macosx-sdk for more info
2399 AC_ARG_WITH(macosx-version-max-allowed,
2400 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2401 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2403 e. g.: --with-macos-version-max-allowed=10.10
2404 see --with-macosx-sdk for more info
2409 dnl ===================================================================
2410 dnl options for stuff used during cross-compilation build
2411 dnl Not quite superseded by --with-build-platform-configure-options.
2412 dnl TODO: check, if the "force" option is still needed anywhere.
2413 dnl ===================================================================
2415 AC_ARG_WITH(system-icu-for-build,
2416 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2417 [Use icu already on system for build tools (cross-compilation only).]))
2420 dnl ===================================================================
2421 dnl Check for incompatible options set by fuzzing, and reset those
2422 dnl automatically to working combinations
2423 dnl ===================================================================
2425 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2426 "$enable_dbus" != "$enable_avahi"; then
2427 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2428 enable_avahi=$enable_dbus
2433 if ! echo "$LO_PATH" | $EGREP -q "(^|${P_SEP})$1($|${P_SEP})"; then
2434 LO_PATH="${LO_PATH:+$LO_PATH$P_SEP}$1"
2438 add_lopath_before ()
2443 for dir in $LO_PATH ; do
2444 if test "$dir" != "$1" ; then
2445 path_cleanup=${path_cleanup:+$path_cleanup$P_SEP}$dir
2448 LO_PATH="$1${path_cleanup:+$P_SEP$path_cleanup}"
2451 dnl ===================================================================
2452 dnl check for required programs (grep, awk, sed, bash)
2453 dnl ===================================================================
2457 if test -n "$1"; then
2458 if test "$build_os" = "cygwin"; then
2459 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2461 new_path=`cygpath -sm "$formatted_path"`
2464 new_path=`cygpath -u "$formatted_path"`
2469 if test "$2" = "after"; then
2470 add_lopath_after "$new_path"
2472 add_lopath_before "$new_path"
2479 AC_PATH_PROG( AWK, $AWK)
2480 if test -z "$AWK"; then
2481 AC_MSG_ERROR([install awk to run this script])
2484 AC_PATH_PROG(BASH, bash)
2485 if test -z "$BASH"; then
2486 AC_MSG_ERROR([bash not found in \$PATH])
2490 AC_MSG_CHECKING([for GNU or BSD tar])
2491 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2492 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2493 if test $? -eq 0; then
2498 AC_MSG_RESULT($GNUTAR)
2499 if test -z "$GNUTAR"; then
2500 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2504 AC_MSG_CHECKING([for tar's option to strip components])
2505 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2506 if test $? -eq 0; then
2507 STRIP_COMPONENTS="--strip-components"
2509 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2510 if test $? -eq 0; then
2511 STRIP_COMPONENTS="--strip-path"
2513 STRIP_COMPONENTS="unsupported"
2516 AC_MSG_RESULT($STRIP_COMPONENTS)
2517 if test x$STRIP_COMPONENTS = xunsupported; then
2518 AC_MSG_ERROR([you need a tar that is able to strip components.])
2520 AC_SUBST(STRIP_COMPONENTS)
2522 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2523 dnl desktop OSes from "mobile" ones.
2525 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2526 dnl In other words, that when building for an OS that is not a
2527 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2529 dnl Note the direction of the implication; there is no assumption that
2530 dnl cross-compiling would imply a non-desktop OS.
2532 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2533 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2534 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2535 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2538 # Whether to build "avmedia" functionality or not.
2540 if test -z "$enable_avmedia"; then
2544 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2545 if test "$enable_avmedia" = yes; then
2546 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2548 USE_AVMEDIA_DUMMY='TRUE'
2550 AC_SUBST(USE_AVMEDIA_DUMMY)
2552 # Decide whether to build database connectivity stuff (including
2553 # Base) or not. We probably don't want to on non-desktop OSes.
2554 if test -z "$enable_database_connectivity"; then
2555 # --disable-database-connectivity is unfinished work in progress
2556 # and the iOS test app doesn't link if we actually try to use it.
2557 # if test $_os != iOS -a $_os != Android; then
2558 if test $_os != iOS; then
2559 enable_database_connectivity=yes
2563 if test "$enable_database_connectivity" = yes; then
2564 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2565 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2568 if test -z "$enable_extensions"; then
2569 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2570 if test $_os != iOS -a $_os != Android; then
2571 enable_extensions=yes
2575 if test "$enable_extensions" = yes; then
2576 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2577 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2580 if test -z "$enable_scripting"; then
2581 # Disable scripting for iOS unless specifically overridden
2582 # with --enable-scripting.
2583 if test $_os != iOS; then
2584 enable_scripting=yes
2588 DISABLE_SCRIPTING=''
2589 if test "$enable_scripting" = yes; then
2590 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2591 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2593 DISABLE_SCRIPTING='TRUE'
2594 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2597 if test $_os = iOS -o $_os = Android; then
2598 # Disable dynamic_loading always for iOS and Android
2599 enable_dynamic_loading=no
2600 elif test -z "$enable_dynamic_loading"; then
2601 # Otherwise enable it unless specifically disabled
2602 enable_dynamic_loading=yes
2605 DISABLE_DYNLOADING=''
2606 if test "$enable_dynamic_loading" = yes; then
2607 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2609 DISABLE_DYNLOADING='TRUE'
2611 AC_SUBST(DISABLE_DYNLOADING)
2613 # remember SYSBASE value
2616 dnl ===================================================================
2617 dnl Sort out various gallery compilation options
2618 dnl ===================================================================
2619 AC_MSG_CHECKING([how to build and package galleries])
2620 if test -n "${with_galleries}"; then
2621 if test "$with_galleries" = "build"; then
2622 WITH_GALLERY_BUILD=TRUE
2623 AC_MSG_RESULT([build from source images internally])
2624 elif test "$with_galleries" = "no"; then
2626 AC_MSG_RESULT([disable non-internal gallery build])
2628 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2631 if test $_os != iOS -a $_os != Android; then
2632 WITH_GALLERY_BUILD=TRUE
2633 AC_MSG_RESULT([internal src images for desktop])
2636 AC_MSG_RESULT([disable src image build])
2639 AC_SUBST(WITH_GALLERY_BUILD)
2641 dnl ===================================================================
2642 dnl Checks if ccache is available
2643 dnl ===================================================================
2645 if test "$_os" = "WINNT"; then
2646 # on windows/VC build do not use ccache
2648 elif test "$enable_ccache" = "no"; then
2650 elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2651 case "%$CC%$CXX%" in
2652 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2653 # assume that's good then
2654 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2655 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2656 CCACHE_DEPEND_MODE=1
2659 AC_PATH_PROG([CCACHE],[ccache],[not found])
2660 if test "$CCACHE" = "not found"; then
2663 CCACHE_DEPEND_MODE=1
2664 # Need to check for ccache version: otherwise prevents
2665 # caching of the results (like "-x objective-c++" for Mac)
2666 if test $_os = Darwin -o $_os = iOS; then
2667 # Check ccache version
2668 AC_MSG_CHECKING([whether version of ccache is suitable])
2669 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2670 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2671 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2672 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2674 AC_MSG_RESULT([no, $CCACHE_VERSION])
2685 if test "$enable_ccache" = "nodepend"; then
2686 CCACHE_DEPEND_MODE=""
2688 AC_SUBST(CCACHE_DEPEND_MODE)
2690 if test "$CCACHE" != ""; then
2691 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2692 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2693 if test "$ccache_size" = ""; then
2694 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2695 if test "$ccache_size" = ""; then
2698 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2699 if test $ccache_size -lt 1024; then
2701 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2702 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2704 # warn that ccache may be too small for debug build
2705 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2706 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2709 if test $ccache_size -lt 5; then
2710 #warn that ccache may be too small for debug build
2711 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2712 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2717 dnl ===================================================================
2718 dnl Checks for C compiler,
2719 dnl The check for the C++ compiler is later on.
2720 dnl ===================================================================
2721 if test "$_os" != "WINNT"; then
2723 AC_MSG_CHECKING([gcc home])
2724 if test -z "$with_gcc_home"; then
2725 if test "$enable_icecream" = "yes"; then
2726 if test -d "/usr/lib/icecc/bin"; then
2727 GCC_HOME="/usr/lib/icecc/"
2728 elif test -d "/usr/libexec/icecc/bin"; then
2729 GCC_HOME="/usr/libexec/icecc/"
2730 elif test -d "/opt/icecream/bin"; then
2731 GCC_HOME="/opt/icecream/"
2733 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
2737 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2738 GCC_HOME_SET="false"
2741 GCC_HOME="$with_gcc_home"
2743 AC_MSG_RESULT($GCC_HOME)
2746 if test "$GCC_HOME_SET" = "true"; then
2747 if test -z "$CC"; then
2748 CC="$GCC_HOME/bin/gcc"
2751 if test -z "$CXX"; then
2752 CXX="$GCC_HOME/bin/g++"
2758 COMPATH=`dirname "$CC"`
2759 if test "$COMPATH" = "."; then
2760 AC_PATH_PROGS(COMPATH, $CC)
2761 dnl double square bracket to get single because of M4 quote...
2762 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2764 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2766 dnl ===================================================================
2768 dnl ===================================================================
2769 AC_MSG_CHECKING([whether to build with Java support])
2770 if test "$with_java" != "no"; then
2771 if test "$DISABLE_SCRIPTING" = TRUE; then
2772 AC_MSG_RESULT([no, overridden by --disable-scripting])
2776 AC_MSG_RESULT([yes])
2778 AC_DEFINE(HAVE_FEATURE_JAVA)
2785 AC_SUBST(ENABLE_JAVA)
2787 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2789 dnl ENABLE_JAVA="" indicate no Java support at all
2791 dnl ===================================================================
2792 dnl Check macOS SDK and compiler
2793 dnl ===================================================================
2795 if test $_os = Darwin; then
2797 # If no --with-macosx-sdk option is given, look for one
2799 # The intent is that for "most" Mac-based developers, a suitable
2800 # SDK will be found automatically without any configure options.
2802 # For developers with a current Xcode, the lowest-numbered SDK
2803 # higher than or equal to the minimum required should be found.
2805 AC_MSG_CHECKING([what macOS SDK to use])
2806 for _macosx_sdk in ${with_macosx_sdk-10.15 10.14 10.13 10.12}; do
2807 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2808 if test -d "$MACOSX_SDK_PATH"; then
2809 with_macosx_sdk="${_macosx_sdk}"
2812 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2813 if test -d "$MACOSX_SDK_PATH"; then
2814 with_macosx_sdk="${_macosx_sdk}"
2819 if test ! -d "$MACOSX_SDK_PATH"; then
2820 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
2823 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2825 case $with_macosx_sdk in
2827 MACOSX_SDK_VERSION=101200
2830 MACOSX_SDK_VERSION=101300
2833 MACOSX_SDK_VERSION=101400
2836 MACOSX_SDK_VERSION=101500
2839 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--15])
2843 if test "$with_macosx_version_min_required" = "" ; then
2844 with_macosx_version_min_required="10.10";
2847 if test "$with_macosx_version_max_allowed" = "" ; then
2848 with_macosx_version_max_allowed="$with_macosx_sdk"
2851 # export this so that "xcrun" invocations later return matching values
2852 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2853 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2854 export DEVELOPER_DIR
2855 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2856 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2858 AC_MSG_CHECKING([whether Xcode is new enough])
2859 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
2860 my_xcode_ver2=${my_xcode_ver1#Xcode }
2861 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
2862 if test "$my_xcode_ver3" -ge 903; then
2863 AC_MSG_RESULT([yes ($my_xcode_ver2)])
2865 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 9.3])
2868 case "$with_macosx_version_min_required" in
2870 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2873 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2876 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2879 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2882 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
2885 MAC_OS_X_VERSION_MIN_REQUIRED="101500"
2888 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--15])
2891 MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
2893 LIBTOOL=/usr/bin/libtool
2894 INSTALL_NAME_TOOL=install_name_tool
2895 if test -z "$save_CC"; then
2896 stdlib=-stdlib=libc++
2897 if test "$ENABLE_LTO" = TRUE; then
2901 AC_MSG_CHECKING([what C compiler to use])
2902 CC="`xcrun -find clang`"
2903 CC_BASE=`first_arg_basename "$CC"`
2904 CC+=" -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2905 AC_MSG_RESULT([$CC])
2907 AC_MSG_CHECKING([what C++ compiler to use])
2908 CXX="`xcrun -find clang++`"
2909 CXX_BASE=`first_arg_basename "$CXX"`
2910 CXX+=" -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2911 AC_MSG_RESULT([$CXX])
2913 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2916 STRIP=`xcrun -find strip`
2917 LIBTOOL=`xcrun -find libtool`
2918 RANLIB=`xcrun -find ranlib`
2921 case "$with_macosx_version_max_allowed" in
2923 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2926 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2929 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2932 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2935 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
2938 MAC_OS_X_VERSION_MAX_ALLOWED="101500"
2941 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--15])
2945 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2946 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2947 AC_MSG_ERROR([the version minimum required, $MAC_OS_X_VERSION_MIN_REQUIRED, must be <= the version maximum allowed, $MAC_OS_X_VERSION_MAX_ALLOWED])
2952 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2953 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2954 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2958 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2959 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2961 AC_MSG_CHECKING([whether to do code signing])
2963 if test "$enable_macosx_code_signing" = yes; then
2964 # By default use the first suitable certificate (?).
2966 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2967 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2968 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2969 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2970 # "Developer ID Application" one.
2972 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2973 if test -n "$identity"; then
2974 MACOSX_CODESIGNING_IDENTITY=$identity
2975 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2976 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2978 AC_MSG_ERROR([cannot determine identity to use])
2980 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2981 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2982 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2983 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2988 AC_MSG_CHECKING([whether to create a Mac App Store package])
2990 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2991 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2992 elif test "$enable_macosx_package_signing" = yes; then
2993 # By default use the first suitable certificate.
2994 # It should be a "3rd Party Mac Developer Installer" one
2996 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2997 if test -n "$identity"; then
2998 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2999 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3000 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3002 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
3004 elif test -n "$enable_macosx_package_signing"; then
3005 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
3006 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3007 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3012 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
3013 AC_MSG_ERROR([You should not use the same identity for code and package signing])
3016 AC_MSG_CHECKING([whether to sandbox the application])
3018 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3019 AC_MSG_ERROR([macOS sandboxing requires code signing])
3020 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3021 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
3022 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3023 ENABLE_MACOSX_SANDBOX=TRUE
3024 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3025 AC_MSG_RESULT([yes])
3030 AC_MSG_CHECKING([what macOS app bundle identifier to use])
3031 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3032 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3034 AC_SUBST(MACOSX_SDK_PATH)
3035 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3036 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3037 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
3038 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
3039 AC_SUBST(INSTALL_NAME_TOOL)
3040 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
3041 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3042 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3043 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3044 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3046 dnl ===================================================================
3047 dnl Check iOS SDK and compiler
3048 dnl ===================================================================
3050 if test $_os = iOS; then
3051 AC_MSG_CHECKING([what iOS SDK to use])
3052 current_sdk_ver=13.2
3053 older_sdk_vers="13.1 13.0 12.4 12.2"
3054 if test "$enable_ios_simulator" = "yes"; then
3055 platform=iPhoneSimulator
3056 versionmin=-mios-simulator-version-min=12.2
3059 versionmin=-miphoneos-version-min=12.2
3061 xcode_developer=`xcode-select -print-path`
3063 for sdkver in $current_sdk_ver $older_sdk_vers; do
3064 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3071 if test -z "$sysroot"; then
3072 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
3075 AC_MSG_RESULT($sysroot)
3077 # LTO is not really recommended for iOS builds,
3078 # the link time will be astronomical
3079 if test "$ENABLE_LTO" = TRUE; then
3083 stdlib="-stdlib=libc++"
3085 AC_MSG_CHECKING([what C compiler to use])
3086 CC="`xcrun -find clang`"
3087 CC_BASE=`first_arg_basename "$CC"`
3088 CC+=" -arch $host_cpu -isysroot $sysroot $lto $versionmin"
3089 AC_MSG_RESULT([$CC])
3091 AC_MSG_CHECKING([what C++ compiler to use])
3092 CXX="`xcrun -find clang++`"
3093 CXX_BASE=`first_arg_basename "$CXX"`
3094 CXX+=" -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
3095 AC_MSG_RESULT([$CXX])
3097 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3100 STRIP=`xcrun -find strip`
3101 LIBTOOL=`xcrun -find libtool`
3102 RANLIB=`xcrun -find ranlib`
3105 AC_MSG_CHECKING([whether to treat the installation as read-only])
3107 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3108 "$enable_extensions" != yes; then
3109 enable_readonly_installset=yes
3111 if test "$enable_readonly_installset" = yes; then
3112 AC_MSG_RESULT([yes])
3113 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3118 dnl ===================================================================
3119 dnl Structure of install set
3120 dnl ===================================================================
3122 if test $_os = Darwin; then
3123 LIBO_BIN_FOLDER=MacOS
3124 LIBO_ETC_FOLDER=Resources
3125 LIBO_LIBEXEC_FOLDER=MacOS
3126 LIBO_LIB_FOLDER=Frameworks
3127 LIBO_LIB_PYUNO_FOLDER=Resources
3128 LIBO_SHARE_FOLDER=Resources
3129 LIBO_SHARE_HELP_FOLDER=Resources/help
3130 LIBO_SHARE_JAVA_FOLDER=Resources/java
3131 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3132 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3133 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3134 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3135 LIBO_URE_BIN_FOLDER=MacOS
3136 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3137 LIBO_URE_LIB_FOLDER=Frameworks
3138 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3139 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3140 elif test $_os = WINNT; then
3141 LIBO_BIN_FOLDER=program
3142 LIBO_ETC_FOLDER=program
3143 LIBO_LIBEXEC_FOLDER=program
3144 LIBO_LIB_FOLDER=program
3145 LIBO_LIB_PYUNO_FOLDER=program
3146 LIBO_SHARE_FOLDER=share
3147 LIBO_SHARE_HELP_FOLDER=help
3148 LIBO_SHARE_JAVA_FOLDER=program/classes
3149 LIBO_SHARE_PRESETS_FOLDER=presets
3150 LIBO_SHARE_READMES_FOLDER=readmes
3151 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3152 LIBO_SHARE_SHELL_FOLDER=program/shell
3153 LIBO_URE_BIN_FOLDER=program
3154 LIBO_URE_ETC_FOLDER=program
3155 LIBO_URE_LIB_FOLDER=program
3156 LIBO_URE_MISC_FOLDER=program
3157 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3159 LIBO_BIN_FOLDER=program
3160 LIBO_ETC_FOLDER=program
3161 LIBO_LIBEXEC_FOLDER=program
3162 LIBO_LIB_FOLDER=program
3163 LIBO_LIB_PYUNO_FOLDER=program
3164 LIBO_SHARE_FOLDER=share
3165 LIBO_SHARE_HELP_FOLDER=help
3166 LIBO_SHARE_JAVA_FOLDER=program/classes
3167 LIBO_SHARE_PRESETS_FOLDER=presets
3168 LIBO_SHARE_READMES_FOLDER=readmes
3169 if test "$enable_fuzzers" != yes; then
3170 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3172 LIBO_SHARE_RESOURCE_FOLDER=resource
3174 LIBO_SHARE_SHELL_FOLDER=program/shell
3175 LIBO_URE_BIN_FOLDER=program
3176 LIBO_URE_ETC_FOLDER=program
3177 LIBO_URE_LIB_FOLDER=program
3178 LIBO_URE_MISC_FOLDER=program
3179 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3181 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3182 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3183 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3184 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3185 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3186 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3187 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3188 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3189 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3190 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3191 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3192 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3193 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3194 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3195 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3196 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3198 # Not all of them needed in config_host.mk, add more if need arises
3199 AC_SUBST(LIBO_BIN_FOLDER)
3200 AC_SUBST(LIBO_ETC_FOLDER)
3201 AC_SUBST(LIBO_LIB_FOLDER)
3202 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3203 AC_SUBST(LIBO_SHARE_FOLDER)
3204 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3205 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3206 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3207 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3208 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3209 AC_SUBST(LIBO_URE_BIN_FOLDER)
3210 AC_SUBST(LIBO_URE_ETC_FOLDER)
3211 AC_SUBST(LIBO_URE_LIB_FOLDER)
3212 AC_SUBST(LIBO_URE_MISC_FOLDER)
3213 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3215 dnl ===================================================================
3216 dnl Windows specific tests and stuff
3217 dnl ===================================================================
3221 # Return value: $regvalue
3224 local _regentry="/proc/registry${1}/${2}"
3225 if test -f "$_regentry"; then
3226 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3227 # Registry keys read via /proc/registry* are always \0 terminated!
3228 local _regvalue=$(tr -d '\0' < "$_regentry")
3229 if test $? -eq 0; then
3235 # Get a value from the 32-bit side of the Registry
3238 reg_get_value "32" "$1"
3241 # Get a value from the 64-bit side of the Registry
3244 reg_get_value "64" "$1"
3247 if test "$_os" = "WINNT"; then
3248 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3249 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3251 WINDOWS_SDK_ARCH="x86"
3253 AC_MSG_RESULT([yes])
3254 WINDOWS_SDK_ARCH="x64"
3258 if test "$_os" = "iOS"; then
3259 cross_compiling="yes"
3262 if test "$cross_compiling" = "yes"; then
3263 export CROSS_COMPILING=TRUE
3266 BUILD_TYPE="$BUILD_TYPE NATIVE"
3268 AC_SUBST(CROSS_COMPILING)
3270 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3271 # NOTE: must _not_ be used for bundled external libraries!
3273 if test "$GCC" = "yes"; then
3274 AC_MSG_CHECKING( for -isystem )
3276 CFLAGS="$CFLAGS -Werror"
3277 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3279 if test -n "$ISYSTEM"; then
3285 if test -z "$ISYSTEM"; then
3286 # fall back to using -I
3291 dnl ===================================================================
3292 dnl Check which Visual Studio compiler is used
3293 dnl ===================================================================
3295 map_vs_year_to_version()
3297 # Return value: $vsversion
3307 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3311 vs_versions_to_check()
3313 # Args: $1 (optional) : versions to check, in the order of preference
3314 # Return value: $vsversions
3318 if test -n "$1"; then
3319 map_vs_year_to_version "$1"
3320 vsversions=$vsversion
3322 # We accept only 2017
3327 win_get_env_from_vsvars32bat()
3329 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3330 # Also seems to be located in another directory under the same name: vsvars32.bat
3331 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3332 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3333 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3334 chmod +x $WRAPPERBATCHFILEPATH
3335 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3336 rm -f $WRAPPERBATCHFILEPATH
3337 printf '%s' "$_win_get_env_from_vsvars32bat"
3342 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3343 if test -n "$regvalue"; then
3344 PathFormat "$regvalue"
3345 UCRTSDKDIR=$formatted_path
3346 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3347 UCRTVERSION=$regvalue
3349 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3353 if test -z "$UCRTSDKDIR"; then
3354 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3355 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3356 if test -f "$ide_env_file"; then
3357 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3358 UCRTSDKDIR=$formatted_path
3359 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3360 dnl Hack needed at least by tml:
3361 if test "$UCRTVERSION" = 10.0.15063.0 \
3362 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3363 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3365 UCRTVERSION=10.0.14393.0
3368 AC_MSG_ERROR([No UCRT found])
3375 # Find Visual C++ 2017/2019
3376 # Args: $1 (optional) : The VS version year
3377 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3379 unset vctest vcnum vcnumwithdot vcbuildnumber
3381 vs_versions_to_check "$1"
3382 vswhere="$(perl -e 'print $ENV{"ProgramFiles(x86)"}')"
3383 vswhere+="\\Microsoft Visual Studio\\Installer\\vswhere.exe"
3384 PathFormat "$vswhere"
3385 vswhere=$formatted_path
3386 for ver in $vsversions; do
3387 vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
3388 if test -n "$vswhereoutput"; then
3389 PathFormat "$vswhereoutput"
3390 vctest=$formatted_path
3395 # This fallback is needed on *some* (but not all) VS 2017 installations, where vswhere turns up
3396 # with the empty list for unclear reason. The below hack does not work for VS 2019 anyway, so
3397 # should be removed when upgrading baseline.
3398 if ! test -n "$vctest"; then
3399 for ver in $vsversions; do
3400 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver.0/Setup/VC/ProductDir
3401 if test -n "$regvalue"; then
3405 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver.0
3406 if test -n "$regvalue"; then
3407 AC_MSG_RESULT([found: $regvalue])
3408 PathFormat "$regvalue"
3409 vctest=$formatted_path
3415 if test -n "$vctest"; then
3416 vcnumwithdot="$ver.0"
3417 case "$vcnumwithdot" in
3427 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3435 if test "$_os" = "WINNT"; then
3436 AC_MSG_CHECKING([Visual C++])
3437 find_msvc "$with_visual_studio"
3438 if test -z "$vctest"; then
3439 if test -n "$with_visual_studio"; then
3440 AC_MSG_ERROR([no Visual Studio $with_visual_studio installation found])
3442 AC_MSG_ERROR([no Visual Studio 2017 installation found])
3446 if test "$BITNESS_OVERRIDE" = ""; then
3447 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3448 VC_PRODUCT_DIR=$vctest/VC
3450 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86])
3453 if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3454 VC_PRODUCT_DIR=$vctest/VC
3456 AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64])
3459 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3461 AC_MSG_CHECKING([for short pathname of VC product directory])
3462 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3463 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3468 AC_MSG_CHECKING([for UCRT location])
3470 # find_ucrt errors out if it doesn't find it
3471 AC_MSG_RESULT([found])
3472 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3473 ucrtincpath_formatted=$formatted_path
3474 # SOLARINC is used for external modules and must be set too.
3475 # And no, it's not sufficient to set SOLARINC only, as configure
3476 # itself doesn't honour it.
3477 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3478 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3479 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3480 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3482 AC_SUBST(UCRTSDKDIR)
3483 AC_SUBST(UCRTVERSION)
3485 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3486 # Find the proper version of MSBuild.exe to use based on the VS version
3487 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3488 if test -n "$regvalue" ; then
3489 AC_MSG_RESULT([found: $regvalue])
3490 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3492 if test "$vcnumwithdot" = "16.0"; then
3493 if test "$BITNESS_OVERRIDE" = ""; then
3494 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
3496 regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
3499 if test "$BITNESS_OVERRIDE" = ""; then
3500 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3502 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3505 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3506 AC_MSG_RESULT([$regvalue])
3509 # Find the version of devenv.exe
3510 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3511 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3512 if test ! -e "$DEVENV"; then
3513 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3516 dnl ===========================================================
3517 dnl Check for the corresponding mspdb*.dll
3518 dnl ===========================================================
3524 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3525 VC_HOST_DIR="HostX64"
3526 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3528 VC_HOST_DIR="HostX86"
3529 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3532 if test "$BITNESS_OVERRIDE" = ""; then
3533 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
3535 CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
3538 # MSVC 15.0 has libraries from 14.0?
3541 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3542 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3545 dnl The path needs to be added before cl is called
3546 TEMP_PATH=`cygpath -d "$MSPDB_PATH"`
3547 PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
3549 AC_MSG_CHECKING([cl.exe])
3551 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3552 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3553 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3556 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3557 dnl needed when building CLR code:
3558 if test -z "$MSVC_CXX"; then
3559 if test -f "$CL_PATH/cl.exe"; then
3560 MSVC_CXX="$CL_PATH/cl.exe"
3563 # This gives us a posix path with 8.3 filename restrictions
3564 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3567 if test -z "$CC"; then
3569 CC_BASE=`first_arg_basename "$CC"`
3571 if test "$BITNESS_OVERRIDE" = ""; then
3572 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3573 MSVC_CXX="$MSVC_CXX -arch:SSE"
3575 if test -z "$CXX"; then
3577 CXX_BASE=`first_arg_basename "$CXX"`
3580 if test -n "$CC"; then
3581 # Remove /cl.exe from CC case insensitive
3582 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3583 if test "$BITNESS_OVERRIDE" = ""; then
3584 COMPATH="$VC_PRODUCT_DIR"
3586 if test -n "$VC_PRODUCT_DIR"; then
3587 COMPATH=$VC_PRODUCT_DIR
3590 if test "$BITNESS_OVERRIDE" = ""; then
3591 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3595 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3597 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3599 PathFormat "$COMPATH"
3600 COMPATH=`win_short_path_for_make "$formatted_path"`
3605 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3606 # are always "better", we list them in reverse chronological order.
3610 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
3614 # The expectation is that --with-windows-sdk should not need to be used
3615 if test -n "$with_windows_sdk"; then
3616 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3617 *" "$with_windows_sdk" "*)
3618 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3621 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3626 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3631 AC_MSG_ERROR([Visual C++ not found after all, huh])
3634 AC_MSG_CHECKING([$CC_BASE is at least Visual Studio 2017 version 15.7])
3635 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3636 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
3637 // between Visual Studio versions and _MSC_VER:
3641 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
3643 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3644 # version of the Explorer extension (and maybe other small
3645 # bits, too) needed when installing a 32-bit LibreOffice on a
3646 # 64-bit OS. The 64-bit Explorer extension is a feature that
3647 # has been present since long in OOo. Don't confuse it with
3648 # building LibreOffice itself as 64-bit code.
3653 if test "$BITNESS_OVERRIDE" = ""; then
3654 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3655 if test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib" || \
3656 test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/spectre/x64/atls.lib"; then
3657 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3659 CXX_X64_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe"`
3662 if test "$BUILD_X64" = TRUE; then
3663 AC_MSG_RESULT([found])
3665 AC_MSG_RESULT([not found])
3666 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3673 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3674 AC_SUBST(CXX_X64_BINARY)
3676 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
3677 # needed to support TWAIN scan on both 32- and 64-bit systems
3681 if test "$BITNESS_OVERRIDE" = "64"; then
3682 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
3683 if test -n "$CXX_X86_BINARY"; then
3685 AC_MSG_RESULT([preset])
3686 elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then
3688 CXX_X86_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe"`
3689 CXX_X86_BINARY+=" /arch:SSE"
3690 AC_MSG_RESULT([found])
3693 AC_MSG_RESULT([not found])
3694 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
3698 CXX_X86_BINARY=$MSVC_CXX
3701 AC_SUBST(CXX_X86_BINARY)
3710 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3711 AC_SUBST(UNOWINREG_DLL)
3714 AC_MSG_CHECKING([whether the compiler is actually Clang])
3715 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3721 [AC_MSG_RESULT([yes])
3723 [AC_MSG_RESULT([no])])
3724 AC_SUBST(COM_IS_CLANG)
3728 if test "$COM_IS_CLANG" = TRUE; then
3729 AC_MSG_CHECKING([whether Clang is new enough])
3730 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3731 #if !defined __apple_build_version__
3735 [my_apple_clang=yes],[my_apple_clang=])
3736 if test "$my_apple_clang" = yes; then
3737 AC_MSG_RESULT([assumed yes (Apple Clang)])
3739 if test "$_os" = WINNT; then
3740 dnl In which case, assume clang-cl:
3742 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3750 CC_PLAIN="$CC_PLAIN $i"
3757 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args - | sed 's/ //g'`
3758 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3759 CLANGVER=`echo $clang_version \
3760 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3761 if test "$CLANGVER" -ge 50002; then
3762 AC_MSG_RESULT([yes ($clang_version)])
3764 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
3766 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3767 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3771 SHOWINCLUDES_PREFIX=
3772 if test "$_os" = WINNT; then
3773 dnl We need to guess the prefix of the -showIncludes output, it can be
3775 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3776 echo "#include <stdlib.h>" > conftest.c
3777 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3778 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3779 rm -f conftest.c conftest.obj
3780 if test -z "$SHOWINCLUDES_PREFIX"; then
3781 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3783 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3786 AC_SUBST(SHOWINCLUDES_PREFIX)
3789 # prefix C with ccache if needed
3791 if test "$CCACHE" != ""; then
3792 AC_MSG_CHECKING([whether $CC_BASE is already ccached])
3796 CFLAGS="$CFLAGS --ccache-skip -O2"
3797 dnl an empty program will do, we're checking the compiler flags
3798 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3799 [use_ccache=yes], [use_ccache=no])
3800 if test $use_ccache = yes; then
3801 AC_MSG_RESULT([yes])
3804 CC_BASE="ccache $CC_BASE"
3811 # ===================================================================
3812 # check various GCC options that Clang does not support now but maybe
3813 # will somewhen in the future, check them even for GCC, so that the
3815 # ===================================================================
3818 if test "$GCC" = "yes"; then
3819 AC_MSG_CHECKING([whether $CC_BASE supports -ggdb2])
3821 CFLAGS="$CFLAGS -Werror -ggdb2"
3822 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3824 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3825 AC_MSG_RESULT([yes])
3830 if test "$host_cpu" = "m68k"; then
3831 AC_MSG_CHECKING([whether $CC_BASE supports -mlong-jump-table-offsets])
3833 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3834 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3836 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3837 AC_MSG_RESULT([yes])
3843 AC_SUBST(HAVE_GCC_GGDB2)
3845 dnl ===================================================================
3846 dnl Test the gcc version
3847 dnl ===================================================================
3848 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3849 AC_MSG_CHECKING([the GCC version])
3850 _gcc_version=`$CC -dumpversion`
3851 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3852 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3853 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3855 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3857 if test "$gcc_full_version" -lt 70000; then
3858 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 7.0.0])
3861 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3862 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3863 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3864 # (which reports itself as GCC 4.2.1).
3867 AC_SUBST(GCC_VERSION)
3869 dnl Set the ENABLE_DBGUTIL variable
3870 dnl ===================================================================
3871 AC_MSG_CHECKING([whether to build with additional debug utilities])
3872 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3873 ENABLE_DBGUTIL="TRUE"
3874 # this is an extra var so it can have different default on different MSVC
3875 # versions (in case there are version specific problems with it)
3876 MSVC_USE_DEBUG_RUNTIME="TRUE"
3878 AC_MSG_RESULT([yes])
3879 # cppunit and graphite expose STL in public headers
3880 if test "$with_system_cppunit" = "yes"; then
3881 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3883 with_system_cppunit=no
3885 if test "$with_system_graphite" = "yes"; then
3886 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3888 with_system_graphite=no
3890 if test "$with_system_orcus" = "yes"; then
3891 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3893 with_system_orcus=no
3895 if test "$with_system_libcmis" = "yes"; then
3896 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3898 with_system_libcmis=no
3900 if test "$with_system_hunspell" = "yes"; then
3901 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3903 with_system_hunspell=no
3905 if test "$with_system_gpgmepp" = "yes"; then
3906 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3908 with_system_gpgmepp=no
3910 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
3911 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
3912 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
3913 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
3914 # of those two is using the system variant:
3915 if test "$with_system_libnumbertext" = "yes"; then
3916 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
3918 with_system_libnumbertext=no
3920 if test "$with_system_libwps" = "yes"; then
3921 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
3923 with_system_libwps=no
3927 MSVC_USE_DEBUG_RUNTIME=""
3930 AC_SUBST(ENABLE_DBGUTIL)
3931 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3933 dnl Set the ENABLE_DEBUG variable.
3934 dnl ===================================================================
3935 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3936 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-symbols])
3938 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3939 if test -z "$libo_fuzzed_enable_debug"; then
3940 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3942 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3947 AC_MSG_CHECKING([whether to do a debug build])
3948 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3950 if test -n "$ENABLE_DBGUTIL" ; then
3951 AC_MSG_RESULT([yes (dbgutil)])
3953 AC_MSG_RESULT([yes])
3959 AC_SUBST(ENABLE_DEBUG)
3961 dnl ===================================================================
3962 dnl Select the linker to use (gold/lld/ld.bfd).
3963 dnl This is done only after compiler checks (need to know if Clang is
3964 dnl used, for different defaults) and after checking if a debug build
3965 dnl is wanted (non-debug builds get the default linker if not explicitly
3966 dnl specified otherwise).
3967 dnl All checks for linker features/options should come after this.
3968 dnl ===================================================================
3972 use_ld_fail_if_error=$2
3974 AC_MSG_CHECKING([for -fuse-ld=$use_ld linker support])
3975 use_ld_ldflags_save="$LDFLAGS"
3976 LDFLAGS="$LDFLAGS -fuse-ld=$use_ld"
3977 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3980 printf ("hello world\n");
3981 ])], USE_LD=$use_ld, [])
3982 if test -n "$USE_LD"; then
3983 AC_MSG_RESULT( yes )
3986 if test -n "$use_ld_fail_if_error"; then
3992 if test -n "$use_ld_ok"; then
3993 dnl keep the value of LDFLAGS
3996 LDFLAGS="$use_ld_ldflags_save"
4000 if test "$enable_ld" != "no"; then
4001 if test "$GCC" = "yes"; then
4002 if test -n "$enable_ld"; then
4003 check_use_ld "$enable_ld" fail_if_error
4004 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4005 dnl non-debug builds default to the default linker
4007 elif test -n "$COM_IS_CLANG"; then
4009 if test $? -ne 0; then
4013 # For gcc first try gold, new versions also support lld.
4015 if test $? -ne 0; then
4019 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
4021 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD)')
4022 if test -z "$ld_used"; then
4025 AC_MSG_CHECKING([for linker that is used])
4026 AC_MSG_RESULT([$ld_used])
4027 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4028 if echo "$ld_used" | grep -q "^GNU ld"; then
4029 AC_MSG_WARN([The default GNU linker is slow, consider using the LLD or the GNU gold linker.])
4030 add_warning "The default GNU linker is slow, consider using the LLD or the GNU gold linker."
4034 if test "$enable_ld" = "yes"; then
4035 AC_MSG_ERROR([--enable-ld not supported])
4041 HAVE_LD_BSYMBOLIC_FUNCTIONS=
4042 if test "$GCC" = "yes"; then
4043 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
4044 bsymbolic_functions_ldflags_save=$LDFLAGS
4045 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
4046 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4049 printf ("hello world\n");
4050 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
4051 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
4052 AC_MSG_RESULT( found )
4054 AC_MSG_RESULT( not found )
4056 LDFLAGS=$bsymbolic_functions_ldflags_save
4058 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
4062 if test "$enable_split_debug" != no; then
4063 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
4064 if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4065 AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
4067 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
4068 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
4070 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
4071 AC_MSG_RESULT([yes])
4073 if test "$enable_split_debug" = yes; then
4080 if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4081 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
4082 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
4085 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
4088 if test "$enable_gdb_index" != "no"; then
4089 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
4090 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -o -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4091 AC_MSG_CHECKING([whether $CC_BASE supports -ggnu-pubnames])
4093 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
4095 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
4096 if test "$have_ggnu_pubnames" != "TRUE"; then
4097 if test "$enable_gdb_index" = "yes"; then
4098 AC_MSG_ERROR( no, --enable-gdb-index not supported )
4103 AC_MSG_RESULT( yes )
4104 AC_MSG_CHECKING([whether $CC_BASE supports -Wl,--gdb-index])
4105 ldflags_save=$LDFLAGS
4106 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
4107 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4110 printf ("hello world\n");
4111 ])], ENABLE_GDB_INDEX=TRUE, [])
4112 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
4113 AC_MSG_RESULT( yes )
4115 if test "$enable_gdb_index" = "yes"; then
4121 LDFLAGS=$ldflags_save
4125 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4126 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
4127 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
4130 AC_SUBST(ENABLE_GDB_INDEX)
4132 if test "$enable_sal_log" = yes; then
4135 AC_SUBST(ENABLE_SAL_LOG)
4137 dnl Check for enable symbols option
4138 dnl ===================================================================
4139 AC_MSG_CHECKING([whether to generate debug information])
4140 if test -z "$enable_symbols"; then
4141 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4147 if test "$enable_symbols" = yes; then
4148 ENABLE_SYMBOLS_FOR=all
4149 AC_MSG_RESULT([yes])
4150 elif test "$enable_symbols" = no; then
4154 # Selective debuginfo.
4155 ENABLE_SYMBOLS_FOR="$enable_symbols"
4156 AC_MSG_RESULT([for "$enable_symbols"])
4158 AC_SUBST(ENABLE_SYMBOLS_FOR)
4160 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
4161 # Building on Android with full symbols: without enough memory the linker never finishes currently.
4162 AC_MSG_CHECKING([whether enough memory is available for linking])
4163 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
4164 # Check for 15GB, as Linux reports a bit less than the physical memory size.
4165 if test -n "$mem_size" -a $mem_size -lt 15728640; then
4166 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
4168 AC_MSG_RESULT([yes])
4172 AC_MSG_CHECKING([whether to compile with optimization flags])
4173 if test -z "$enable_optimized"; then
4174 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4177 enable_optimized=yes
4180 if test "$enable_optimized" != no; then
4181 ENABLE_OPTIMIZED=TRUE
4182 AC_MSG_RESULT([yes])
4187 AC_SUBST(ENABLE_OPTIMIZED)
4190 # determine CPUNAME, OS, ...
4191 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
4202 PLATFORMID=aix_powerpc
4211 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4218 if test "$BITNESS_OVERRIDE" = 64; then
4221 PLATFORMID=windows_x86_64
4223 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4227 PLATFORMID=windows_x86
4231 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4234 SCPDEFS="$SCPDEFS -D_MSC_VER"
4246 AC_MSG_ERROR([Can't build 32-bit code for iOS])
4251 if test "$enable_ios_simulator" = "yes"; then
4252 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
4256 PLATFORMID=ios_arm64
4260 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4263 if test "$enable_ios_simulator" = "yes"; then
4268 PLATFORMID=macosx_x86_64
4271 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4287 PLATFORMID=dragonfly_x86
4292 PLATFORMID=dragonfly_x86_64
4295 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4311 PLATFORMID=freebsd_x86
4316 PLATFORMID=freebsd_x86_64
4319 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4336 PLATFORMID=haiku_x86
4341 PLATFORMID=haiku_x86_64
4344 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4361 PLATFORMID=kfreebsd_x86
4366 PLATFORMID=kfreebsd_x86_64
4369 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4385 PLATFORMID=linux_aarch64
4391 PLATFORMID=linux_alpha
4397 PLATFORMID=linux_arm_eabi
4401 PLATFORMID=linux_arm_oabi
4409 PLATFORMID=linux_hppa
4414 PLATFORMID=linux_x86
4419 PLATFORMID=linux_ia64
4425 PLATFORMID=linux_mips_eb
4430 EPM_FLAGS="-a mips64"
4431 PLATFORMID=linux_mips64_eb
4436 EPM_FLAGS="-a mips64el"
4437 PLATFORMID=linux_mips64_el
4442 EPM_FLAGS="-a mipsel"
4443 PLATFORMID=linux_mips_el
4448 PLATFORMID=linux_m68k
4453 PLATFORMID=linux_powerpc
4458 PLATFORMID=linux_powerpc64
4462 RTL_ARCH=PowerPC_64_LE
4463 PLATFORMID=linux_powerpc64_le
4468 PLATFORMID=linux_sparc
4473 PLATFORMID=linux_sparc64
4478 PLATFORMID=linux_s390
4483 PLATFORMID=linux_s390x
4488 PLATFORMID=linux_x86_64
4491 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4508 PLATFORMID=android_arm_eabi
4513 PLATFORMID=android_aarch64
4518 PLATFORMID=android_x86
4523 PLATFORMID=android_x86_64
4526 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4542 PLATFORMID=netbsd_x86
4547 PLATFORMID=netbsd_powerpc
4552 PLATFORMID=netbsd_sparc
4557 PLATFORMID=netbsd_x86_64
4560 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4576 PLATFORMID=openbsd_x86
4581 PLATFORMID=openbsd_x86_64
4584 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4587 SOLARINC="$SOLARINC -I/usr/local/include"
4601 PLATFORMID=solaris_x86
4606 PLATFORMID=solaris_sparc
4611 PLATFORMID=solaris_sparc64
4614 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4617 SOLARINC="$SOLARINC -I/usr/local/include"
4621 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4625 if test "$with_x" = "no"; then
4626 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4630 if test "$enable_gui" = "no"; then
4631 if test "$USING_X11" != TRUE; then
4632 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4636 AC_DEFINE(HAVE_FEATURE_UI,0)
4639 AC_SUBST(DISABLE_GUI)
4641 WORKDIR="${BUILDDIR}/workdir"
4642 INSTDIR="${BUILDDIR}/instdir"
4643 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4644 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4645 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4653 AC_SUBST([INSTROOT])
4654 AC_SUBST([INSTROOTBASE])
4658 AC_SUBST(PLATFORMID)
4659 AC_SUBST(WINDOWS_X64)
4660 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4662 dnl ===================================================================
4663 dnl Test which package format to use
4664 dnl ===================================================================
4665 AC_MSG_CHECKING([which package format to use])
4666 if test -n "$with_package_format" -a "$with_package_format" != no; then
4667 for i in $with_package_format; do
4669 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4672 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4673 aix - AIX software distribution
4674 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4675 deb - Debian software distribution
4676 pkg - Solaris software distribution
4677 rpm - RedHat software distribution
4679 LibreOffice additionally supports:
4680 archive - .tar.gz or .zip
4682 installed - installation tree
4688 # fakeroot is needed to ensure correct file ownerships/permissions
4689 # inside deb packages and tar archives created on Linux and Solaris.
4690 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4691 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4692 if test "$FAKEROOT" = "no"; then
4694 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4697 PKGFORMAT="$with_package_format"
4698 AC_MSG_RESULT([$PKGFORMAT])
4701 AC_MSG_RESULT([none])
4705 dnl ===================================================================
4706 dnl Set up a different compiler to produce tools to run on the build
4707 dnl machine when doing cross-compilation
4708 dnl ===================================================================
4710 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4711 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4712 if test "$cross_compiling" = "yes"; then
4713 AC_MSG_CHECKING([for BUILD platform configuration])
4715 rm -rf CONF-FOR-BUILD config_build.mk
4716 mkdir CONF-FOR-BUILD
4717 # Here must be listed all files needed when running the configure script. In particular, also
4718 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4719 # keep them in the same order as there.
4720 (cd $SRC_ROOT && tar cf - \
4722 bin/get_config_variables \
4723 solenv/bin/getcompver.awk \
4724 solenv/inc/langlist.mk \
4727 config_host_lang.mk.in \
4729 bin/bffvalidator.sh.in \
4730 bin/odfvalidator.sh.in \
4731 bin/officeotron.sh.in \
4732 instsetoo_native/util/openoffice.lst.in \
4734 sysui/desktop/macosx/Info.plist.in) \
4735 | (cd CONF-FOR-BUILD && tar xf -)
4736 cp configure CONF-FOR-BUILD
4737 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4739 unset COM USING_X11 OS CPUNAME
4740 unset CC CXX SYSBASE CFLAGS
4741 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4742 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4743 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4744 if test -n "$CC_FOR_BUILD"; then
4745 export CC="$CC_FOR_BUILD"
4746 CC_BASE=`first_arg_basename "$CC"`
4748 if test -n "$CXX_FOR_BUILD"; then
4749 export CXX="$CXX_FOR_BUILD"
4750 CXX_BASE=`first_arg_basename "$CXX"`
4752 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4755 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4756 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4757 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4758 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4759 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4760 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4761 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4762 # Don't bother having configure look for stuff not needed for the build platform anyway
4765 --disable-gstreamer-1-0 \
4767 --disable-pdfimport \
4768 --disable-postgresql-sdbc \
4769 --with-parallelism="$with_parallelism" \
4774 2>&1 | sed -e 's/^/ /'
4775 test -f ./config_host.mk 2>/dev/null || exit
4776 cp config_host.mk ../config_build.mk
4777 cp config_host_lang.mk ../config_build_lang.mk
4778 mv config.log ../config.Build.log
4779 mkdir -p ../config_build
4780 mv config_host/*.h ../config_build
4781 . ./bin/get_config_variables CC CXX INSTDIR INSTROOT LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS PATH SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT WORKDIR
4783 for V in CC CXX LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT; do
4785 VV=`eval "echo $VV"`
4786 if test -n "$VV"; then
4787 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4788 echo "$line" >>build-config
4792 for V in INSTDIR INSTROOT WORKDIR; do
4794 VV=`eval "echo $VV"`
4795 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4796 if test -n "$VV"; then
4797 line="${V}_FOR_BUILD='$VV'"
4798 echo "$line" >>build-config
4802 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4803 echo "$line" >>build-config
4806 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4807 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])
4808 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4809 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4811 eval `cat CONF-FOR-BUILD/build-config`
4813 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4815 rm -rf CONF-FOR-BUILD
4819 CXX_FOR_BUILD="$CXX"
4820 INSTDIR_FOR_BUILD="$INSTDIR"
4821 INSTROOT_FOR_BUILD="$INSTROOT"
4822 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4823 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4824 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4825 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4826 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4827 WORKDIR_FOR_BUILD="$WORKDIR"
4829 AC_SUBST(OS_FOR_BUILD)
4830 AC_SUBST(INSTDIR_FOR_BUILD)
4831 AC_SUBST(INSTROOT_FOR_BUILD)
4832 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4833 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4834 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4835 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4836 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4837 AC_SUBST(WORKDIR_FOR_BUILD)
4839 dnl ===================================================================
4840 dnl Check for syslog header
4841 dnl ===================================================================
4842 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4844 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4845 dnl ===================================================================
4846 AC_MSG_CHECKING([whether to turn warnings to errors])
4847 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4848 ENABLE_WERROR="TRUE"
4849 AC_MSG_RESULT([yes])
4851 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4852 ENABLE_WERROR="TRUE"
4853 AC_MSG_RESULT([yes])
4858 AC_SUBST(ENABLE_WERROR)
4860 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4861 dnl ===================================================================
4862 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4863 if test -z "$enable_assert_always_abort"; then
4864 if test "$ENABLE_DEBUG" = TRUE; then
4865 enable_assert_always_abort=yes
4867 enable_assert_always_abort=no
4870 if test "$enable_assert_always_abort" = "yes"; then
4871 ASSERT_ALWAYS_ABORT="TRUE"
4872 AC_MSG_RESULT([yes])
4874 ASSERT_ALWAYS_ABORT="FALSE"
4877 AC_SUBST(ASSERT_ALWAYS_ABORT)
4879 # Determine whether to use ooenv for the instdir installation
4880 # ===================================================================
4881 if test $_os != "WINNT" -a $_os != "Darwin"; then
4882 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4883 if test "$enable_ooenv" = "no"; then
4887 AC_MSG_RESULT([yes])
4890 AC_SUBST(ENABLE_OOENV)
4892 if test "$USING_X11" != TRUE; then
4893 # be sure to do not mess with unneeded stuff
4898 build_gstreamer_1_0=no
4902 enable_cairo_canvas=no
4905 if test "$OS" = "HAIKU"; then
4906 enable_cairo_canvas=yes
4910 if test "$test_kf5" = "yes" -a "$enable_kde5" = "yes"; then
4911 AC_MSG_WARN([The kde5 VCL plugin was renamed to kf5. Please update your configuration to use --enable-kf5, as --enable-kde5 will be removed after the next major release!])
4912 add_warning "The kde5 VCL plugin was renamed to kf5. Please update your configuration to use --enable-kf5, as --enable-kde5 will be removed after the next major release!"
4916 if test "$test_kf5" = "yes"; then
4920 if test "$test_kf5" = "yes" -a "$enable_kf5" = "yes"; then
4921 if test "$enable_qt5" = "no"; then
4922 AC_MSG_ERROR([KF5 support depends on QT5, so it conflicts with --disable-qt5])
4928 dnl ===================================================================
4929 dnl check for cups support
4930 dnl ===================================================================
4933 if test "$enable_cups" = "no"; then
4937 AC_MSG_CHECKING([whether to enable CUPS support])
4938 if test "$test_cups" = "yes"; then
4940 AC_MSG_RESULT([yes])
4942 AC_MSG_CHECKING([whether cups support is present])
4943 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4944 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4945 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4946 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4953 AC_SUBST(ENABLE_CUPS)
4956 if test "$test_fontconfig" = "yes"; then
4957 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4958 SYSTEM_FONTCONFIG=TRUE
4959 FilterLibs "${FONTCONFIG_LIBS}"
4960 FONTCONFIG_LIBS="${filteredlibs}"
4962 AC_SUBST(FONTCONFIG_CFLAGS)
4963 AC_SUBST(FONTCONFIG_LIBS)
4964 AC_SUBST([SYSTEM_FONTCONFIG])
4966 dnl whether to find & fetch external tarballs?
4967 dnl ===================================================================
4968 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4969 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4970 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4972 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4975 if test -z "$TARFILE_LOCATION"; then
4976 if test -d "$SRC_ROOT/src" ; then
4977 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4978 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4980 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4982 AbsolutePath "$TARFILE_LOCATION"
4983 PathFormat "${absolute_path}"
4984 TARFILE_LOCATION="${formatted_path}"
4986 AC_SUBST(TARFILE_LOCATION)
4988 AC_MSG_CHECKING([whether we want to fetch tarballs])
4989 if test "$enable_fetch_external" != "no"; then
4990 if test "$with_all_tarballs" = "yes"; then
4991 AC_MSG_RESULT([yes, all of them])
4992 DO_FETCH_TARBALLS="ALL"
4994 AC_MSG_RESULT([yes, if we use them])
4995 DO_FETCH_TARBALLS="TRUE"
5001 AC_SUBST(DO_FETCH_TARBALLS)
5003 AC_MSG_CHECKING([whether to build help])
5004 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
5005 BUILD_TYPE="$BUILD_TYPE HELP"
5006 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5007 case "$with_help" in
5009 ENABLE_HTMLHELP=TRUE
5010 SCPDEFS="$SCPDEFS -DWITH_HELP"
5011 AC_MSG_RESULT([HTML])
5014 ENABLE_HTMLHELP=TRUE
5016 AC_MSG_RESULT([HTML])
5019 SCPDEFS="$SCPDEFS -DWITH_HELP"
5020 AC_MSG_RESULT([yes])
5023 AC_MSG_ERROR([Unknown --with-help=$with_help])
5029 AC_SUBST([ENABLE_HTMLHELP])
5030 AC_SUBST([HELP_ONLINE])
5032 AC_MSG_CHECKING([whether to enable xapian-omega support for help])
5033 if test -n "$with_omindex" -a "$with_omindex" != "no" -a $_os != iOS -a $_os != Android; then
5034 BUILD_TYPE="$BUILD_TYPE HELP"
5035 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
5036 case "$with_omindex" in
5038 ENABLE_HTMLHELP=TRUE
5040 HELP_OMINDEX_PAGE=TRUE
5041 AC_MSG_RESULT([SERVER])
5044 ENABLE_HTMLHELP=TRUE
5046 HELP_OMINDEX_PAGE=FALSE
5047 AC_MSG_RESULT([NOXAP])
5050 AC_MSG_ERROR([Unknown --with-omindex=$with_omindex])
5054 HELP_OMINDEX_PAGE=FALSE
5057 AC_SUBST([ENABLE_HTMLHELP])
5058 AC_SUBST([HELP_OMINDEX_PAGE])
5059 AC_SUBST([HELP_ONLINE])
5062 dnl Test whether to include MySpell dictionaries
5063 dnl ===================================================================
5064 AC_MSG_CHECKING([whether to include MySpell dictionaries])
5065 if test "$with_myspell_dicts" = "yes"; then
5066 AC_MSG_RESULT([yes])
5067 WITH_MYSPELL_DICTS=TRUE
5068 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
5069 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
5074 AC_SUBST(WITH_MYSPELL_DICTS)
5076 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
5077 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
5078 if test "$with_system_dicts" = yes; then
5079 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
5081 with_system_dicts=no
5084 AC_MSG_CHECKING([whether to use dicts from external paths])
5085 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
5086 AC_MSG_RESULT([yes])
5088 AC_MSG_CHECKING([for spelling dictionary directory])
5089 if test -n "$with_external_dict_dir"; then
5090 DICT_SYSTEM_DIR=file://$with_external_dict_dir
5092 DICT_SYSTEM_DIR=file:///usr/share/hunspell
5093 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
5094 DICT_SYSTEM_DIR=file:///usr/share/myspell
5097 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
5098 AC_MSG_CHECKING([for hyphenation patterns directory])
5099 if test -n "$with_external_hyph_dir"; then
5100 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
5102 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
5104 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
5105 AC_MSG_CHECKING([for thesaurus directory])
5106 if test -n "$with_external_thes_dir"; then
5107 THES_SYSTEM_DIR=file://$with_external_thes_dir
5109 THES_SYSTEM_DIR=file:///usr/share/mythes
5111 AC_MSG_RESULT([$THES_SYSTEM_DIR])
5116 AC_SUBST(SYSTEM_DICTS)
5117 AC_SUBST(DICT_SYSTEM_DIR)
5118 AC_SUBST(HYPH_SYSTEM_DIR)
5119 AC_SUBST(THES_SYSTEM_DIR)
5121 dnl ===================================================================
5122 dnl Precompiled headers.
5124 AC_MSG_CHECKING([whether to enable pch feature])
5125 if test -z "$enable_pch"; then
5126 if test "$_os" = "WINNT"; then
5127 # Enabled by default on Windows.
5133 if test "$enable_pch" != "no" -a "$_os" != "WINNT" -a "$GCC" != "yes" ; then
5134 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
5136 if test "$enable_pch" = "system"; then
5138 AC_MSG_RESULT([yes (system headers)])
5139 elif test "$enable_pch" = "base"; then
5141 AC_MSG_RESULT([yes (system and base headers)])
5142 elif test "$enable_pch" = "normal"; then
5144 AC_MSG_RESULT([yes (normal)])
5145 elif test "$enable_pch" = "full"; then
5147 AC_MSG_RESULT([yes (full)])
5148 elif test "$enable_pch" = "yes"; then
5149 # Pick a suitable default.
5150 if test "$GCC" = "yes"; then
5151 # With Clang and GCC higher levels do not seem to make a noticeable improvement,
5152 # while making the PCHs larger and rebuilds more likely.
5154 AC_MSG_RESULT([yes (system and base headers)])
5156 # With MSVC the highest level makes a significant difference,
5157 # and it was the default when there used to be no PCH levels.
5159 AC_MSG_RESULT([yes (full)])
5161 elif test "$enable_pch" = "no"; then
5164 AC_MSG_ERROR([Unknown value for --enable-pch])
5166 AC_SUBST(ENABLE_PCH)
5167 # ccache 3.7.1 and older do not properly detect/handle -include .gch in CCACHE_DEPEND mode
5168 if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_IS_CLANG" != "TRUE"; then
5169 AC_PATH_PROG([CCACHE_BIN],[ccache],[not found])
5170 if test "$CCACHE_BIN" != "not found"; then
5171 AC_MSG_CHECKING([ccache version])
5172 CCACHE_VERSION=`"$CCACHE_BIN" -V | "$AWK" '/^ccache version/{print $3}'`
5173 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5174 AC_MSG_RESULT([$CCACHE_VERSION])
5175 AC_MSG_CHECKING([whether ccache depend mode works properly with GCC PCH])
5176 if test "$CCACHE_NUMVER" -gt "030701"; then
5177 AC_MSG_RESULT([yes])
5179 AC_MSG_RESULT([no (not newer than 3.7.1)])
5187 AC_MSG_CHECKING([the GNU Make version])
5188 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5189 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5190 if test "$_make_longver" -ge "038200"; then
5191 AC_MSG_RESULT([$GNUMAKE $_make_version])
5193 elif test "$_make_longver" -ge "038100"; then
5194 if test "$build_os" = "cygwin"; then
5195 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
5197 AC_MSG_RESULT([$GNUMAKE $_make_version])
5199 dnl ===================================================================
5200 dnl Search all the common names for sha1sum
5201 dnl ===================================================================
5202 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
5203 if test -z "$SHA1SUM"; then
5204 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
5205 elif test "$SHA1SUM" = "openssl"; then
5206 SHA1SUM="openssl sha1"
5208 AC_MSG_CHECKING([for GNU Make bug 20033])
5209 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
5210 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
5211 A := \$(wildcard *.a)
5215 <TAB>@echo survived bug20033.
5219 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5232 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5233 <TAB>\$(call d1,\$(CHECKSUM)),\
5234 <TAB>\$(call d2,\$(CHECKSUM)))
5236 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5237 no_parallelism_make="YES"
5238 AC_MSG_RESULT([yes, disable parallelism])
5240 AC_MSG_RESULT([no, keep parallelism enabled])
5242 rm -rf $TESTGMAKEBUG20033
5244 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5247 # find if gnumake support file function
5248 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5249 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5250 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5251 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5253 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5254 \$(file >test.txt,Success )
5261 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5262 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5263 HAVE_GNUMAKE_FILE_FUNC=TRUE
5264 AC_MSG_RESULT([yes])
5268 rm -rf $TESTGMAKEFILEFUNC
5269 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5270 AC_SUBST(GNUMAKE_WIN_NATIVE)
5272 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5274 if test "$_make_ver_check" = ""; then
5278 HAVE_LD_HASH_STYLE=FALSE
5279 WITH_LINKER_HASH_STYLE=
5280 AC_MSG_CHECKING([for --hash-style gcc linker support])
5281 if test "$GCC" = "yes"; then
5282 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5283 hash_styles="gnu sysv"
5284 elif test "$with_linker_hash_style" = "no"; then
5287 hash_styles="$with_linker_hash_style"
5290 for hash_style in $hash_styles; do
5291 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5292 hash_style_ldflags_save=$LDFLAGS
5293 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5295 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5302 HAVE_LD_HASH_STYLE=TRUE
5303 WITH_LINKER_HASH_STYLE=$hash_style
5305 [HAVE_LD_HASH_STYLE=FALSE],
5306 [HAVE_LD_HASH_STYLE=FALSE])
5307 LDFLAGS=$hash_style_ldflags_save
5310 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5311 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5315 LDFLAGS=$hash_style_ldflags_save
5319 AC_SUBST(HAVE_LD_HASH_STYLE)
5320 AC_SUBST(WITH_LINKER_HASH_STYLE)
5322 dnl ===================================================================
5323 dnl Check whether there's a Perl version available.
5324 dnl ===================================================================
5325 if test -z "$with_perl_home"; then
5326 AC_PATH_PROG(PERL, perl)
5328 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5329 _perl_path="$with_perl_home/bin/perl"
5330 if test -x "$_perl_path"; then
5333 AC_MSG_ERROR([$_perl_path not found])
5337 dnl ===================================================================
5338 dnl Testing for Perl version 5 or greater.
5339 dnl $] is the Perl version variable, it is returned as an integer
5340 dnl ===================================================================
5341 if test "$PERL"; then
5342 AC_MSG_CHECKING([the Perl version])
5343 ${PERL} -e "exit($]);"
5345 if test "$_perl_version" -lt 5; then
5346 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
5348 AC_MSG_RESULT([Perl $_perl_version])
5350 AC_MSG_ERROR([Perl not found, install Perl 5])
5353 dnl ===================================================================
5354 dnl Testing for required Perl modules
5355 dnl ===================================================================
5357 AC_MSG_CHECKING([for required Perl modules])
5358 perl_use_string="use Cwd ; use Digest::MD5"
5359 if test "$_os" = "WINNT"; then
5360 if test -n "$PKGFORMAT"; then
5361 for i in $PKGFORMAT; do
5364 # for getting fonts versions to use in MSI
5365 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5371 if test "$with_system_hsqldb" = "yes"; then
5372 perl_use_string="$perl_use_string ; use Archive::Zip"
5374 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
5375 AC_MSG_RESULT([all modules found])
5377 AC_MSG_RESULT([failed to find some modules])
5378 # Find out which modules are missing.
5379 for i in $perl_use_string; do
5380 if test "$i" != "use" -a "$i" != ";"; then
5381 if ! $PERL -e "use $i;">/dev/null 2>&1; then
5382 missing_perl_modules="$missing_perl_modules $i"
5387 The missing Perl modules are: $missing_perl_modules
5388 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5391 dnl ===================================================================
5392 dnl Check for pkg-config
5393 dnl ===================================================================
5394 if test "$_os" != "WINNT"; then
5398 if test "$_os" != "WINNT"; then
5400 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5401 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5402 # explicitly. Or put /path/to/compiler in PATH yourself.
5404 # Use wrappers for LTO
5405 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5406 AC_CHECK_TOOL(AR,gcc-ar)
5407 AC_CHECK_TOOL(NM,gcc-nm)
5408 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5410 AC_CHECK_TOOL(AR,ar)
5411 AC_CHECK_TOOL(NM,nm)
5412 AC_CHECK_TOOL(RANLIB,ranlib)
5414 AC_CHECK_TOOL(OBJDUMP,objdump)
5415 AC_CHECK_TOOL(READELF,readelf)
5416 AC_CHECK_TOOL(STRIP,strip)
5417 if test "$_os" = "WINNT"; then
5418 AC_CHECK_TOOL(DLLTOOL,dlltool)
5419 AC_CHECK_TOOL(WINDRES,windres)
5426 AC_SUBST(PKG_CONFIG)
5432 dnl ===================================================================
5433 dnl pkg-config checks on macOS
5434 dnl ===================================================================
5436 if test $_os = Darwin; then
5437 AC_MSG_CHECKING([for bogus pkg-config])
5438 if test -n "$PKG_CONFIG"; then
5439 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5440 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5442 if test "$enable_bogus_pkg_config" = "yes"; then
5443 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5445 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.])
5449 AC_MSG_RESULT([no, good])
5455 # Return value: $csctest
5459 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5460 if test -n "$regvalue"; then
5468 # Return value: $altest
5472 # We need this check to detect 4.6.1 or above.
5473 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
5474 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5475 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5481 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5482 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5483 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5496 for ver in 4.8 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
5497 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5498 if test -n "$regvalue"; then
5505 find_winsdk_version()
5507 # Args: $1 : SDK version as in "8.0", "8.1A" etc
5508 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5510 unset winsdktest winsdkbinsubdir winsdklibsubdir
5514 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5515 if test -n "$regvalue"; then
5516 winsdktest=$regvalue
5517 winsdklibsubdir=win8
5522 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5523 if test -n "$regvalue"; then
5524 winsdktest=$regvalue
5525 winsdklibsubdir=winv6.3
5530 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5531 if test -n "$regvalue"; then
5532 winsdktest=$regvalue
5533 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5534 if test -n "$regvalue"; then
5535 winsdkbinsubdir="$regvalue".0
5536 winsdklibsubdir=$winsdkbinsubdir
5537 tmppath="$winsdktest\\Include\\$winsdklibsubdir"
5538 # test exist the SDK path
5539 if test -d "$tmppath"; then
5540 # when path is convertible to a short path then path is okay
5541 cygpath -d "$tmppath" >/dev/null 2>&1
5542 if test $? -ne 0; then
5543 AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
5546 AC_MSG_ERROR([The Windows SDK not found, check the installation])
5557 # Return value: From find_winsdk_version
5561 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5562 find_winsdk_version $ver
5563 if test -n "$winsdktest"; then
5571 AC_MSG_CHECKING([for MSVC merge modules directory])
5572 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5575 my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm ${my_msm_files}"
5578 for f in $my_msm_files; do
5579 echo "$as_me:$LINENO: searching for $f" >&5
5583 for ver in 14.0 15.0; do
5584 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5585 if test -n "$regvalue"; then
5586 for f in ${my_msm_files}; do
5587 if test -e "$regvalue/${f}"; then
5594 dnl Is the following fallback really necessary, or was it added in response
5595 dnl to never having started Visual Studio on a given machine, so the
5596 dnl registry keys checked above had presumably not yet been created?
5597 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5598 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5599 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5600 dnl expanding to "C:\Program Files\Common Files"), which would need
5601 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5602 dnl obtain its value from cygwin:
5603 if test -z "$msmdir"; then
5604 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5605 for f in ${my_msm_files}; do
5606 if test -e "$my_msm_dir/${f}"; then
5612 dnl Starting from MSVC 15.0, merge modules are located in different directory
5615 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5616 echo "$as_me:$LINENO: looking in $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])" >&5
5617 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5618 for f in ${my_msm_files}; do
5619 if test -e "$my_msm_dir/${f}"; then
5628 if test -n "$msmdir"; then
5629 msmdir=`cygpath -m "$msmdir"`
5630 AC_MSG_RESULT([$msmdir])
5632 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5633 AC_MSG_FAILURE([not found])
5635 AC_MSG_WARN([not found (check config.log)])
5636 add_warning "MSM none of ${my_msm_files} found"
5641 find_msvc_x64_dlls()
5643 AC_MSG_CHECKING([for MSVC x64 DLL path])
5644 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5647 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5648 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT" >&5
5649 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5650 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5653 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT" >&5
5654 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"; then
5655 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"
5658 echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC150.CRT" >&5
5659 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
5660 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
5666 AC_MSG_RESULT([$msvcdllpath])
5667 AC_MSG_CHECKING([for MSVC x64 DLLs])
5668 msvcdlls="msvcp140.dll vcruntime140.dll"
5669 for dll in $msvcdlls; do
5670 if ! test -f "$msvcdllpath/$dll"; then
5671 AC_MSG_FAILURE([missing $dll])
5674 AC_MSG_RESULT([found all ($msvcdlls)])
5677 dnl =========================================
5678 dnl Check for the Windows SDK.
5679 dnl =========================================
5680 if test "$_os" = "WINNT"; then
5681 AC_MSG_CHECKING([for Windows SDK])
5682 if test "$build_os" = "cygwin"; then
5684 WINDOWS_SDK_HOME=$winsdktest
5686 # normalize if found
5687 if test -n "$WINDOWS_SDK_HOME"; then
5688 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5689 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5692 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5695 if test -n "$WINDOWS_SDK_HOME"; then
5696 # Remove a possible trailing backslash
5697 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5699 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5700 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5701 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5702 have_windows_sdk_headers=yes
5703 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5704 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5705 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5706 have_windows_sdk_headers=yes
5707 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5708 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5709 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5710 have_windows_sdk_headers=yes
5712 have_windows_sdk_headers=no
5715 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5716 have_windows_sdk_libs=yes
5717 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5718 have_windows_sdk_libs=yes
5720 have_windows_sdk_libs=no
5723 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5724 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5725 the Windows SDK are installed.])
5729 if test -z "$WINDOWS_SDK_HOME"; then
5730 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5731 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5732 WINDOWS_SDK_VERSION=80
5733 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5734 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5735 WINDOWS_SDK_VERSION=81
5736 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5737 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5738 WINDOWS_SDK_VERSION=10
5739 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5741 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5743 PathFormat "$WINDOWS_SDK_HOME"
5744 WINDOWS_SDK_HOME="$formatted_path"
5745 if test "$build_os" = "cygwin"; then
5746 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5747 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5748 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5749 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5750 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5754 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5755 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5756 dnl but not in v8.0), so allow this to be overridden with a
5757 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5758 dnl and configuration error if no WiLangId.vbs is found would arguably be
5759 dnl better, but I do not know under which conditions exactly it is needed by
5761 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5762 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5763 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5764 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5766 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5767 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5769 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5770 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5773 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5774 if test -n "$with_package_format" -a "$with_package_format" != no; then
5775 for i in "$with_package_format"; do
5776 if test "$i" = "msi"; then
5777 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5778 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5785 AC_SUBST(WINDOWS_SDK_HOME)
5786 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5787 AC_SUBST(WINDOWS_SDK_VERSION)
5788 AC_SUBST(WINDOWS_SDK_WILANGID)
5790 if test "$build_os" = "cygwin"; then
5791 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5792 dnl dir, it also determines that dir's path w/o an arch segment if any,
5793 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5794 AC_MSG_CHECKING([for midl.exe])
5797 if test -n "$winsdkbinsubdir" \
5798 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5800 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5801 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5802 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5803 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5804 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5805 elif test -f "$winsdktest/Bin/midl.exe"; then
5806 MIDL_PATH=$winsdktest/Bin
5807 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5809 if test ! -f "$MIDL_PATH/midl.exe"; then
5810 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5812 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5815 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5816 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5818 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5819 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5820 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5821 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5822 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5823 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5824 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5825 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5826 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5827 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5828 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5829 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5831 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5835 AC_MSG_CHECKING([for csc.exe])
5837 if test -f "$csctest/csc.exe"; then
5840 if test ! -f "$CSC_PATH/csc.exe"; then
5841 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5843 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5846 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5849 AC_MSG_CHECKING([for al.exe])
5851 if test -n "$winsdkbinsubdir" \
5852 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5854 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5855 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5856 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5857 elif test -f "$winsdktest/Bin/al.exe"; then
5858 AL_PATH="$winsdktest/Bin"
5861 if test -z "$AL_PATH"; then
5863 if test -f "$altest/bin/al.exe"; then
5864 AL_PATH="$altest/bin"
5865 elif test -f "$altest/al.exe"; then
5869 if test ! -f "$AL_PATH/al.exe"; then
5870 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5872 AC_MSG_RESULT([$AL_PATH/al.exe])
5875 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5877 dnl Check mscoree.lib / .NET Framework dir
5878 AC_MSG_CHECKING(.NET Framework)
5880 PathFormat "$frametest"
5881 frametest="$formatted_path"
5882 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5883 DOTNET_FRAMEWORK_HOME="$frametest"
5886 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5887 DOTNET_FRAMEWORK_HOME="$winsdktest"
5890 if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5891 AC_MSG_ERROR([mscoree.lib not found])
5893 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5895 PathFormat "$MIDL_PATH"
5896 MIDL_PATH="$formatted_path"
5898 PathFormat "$AL_PATH"
5899 AL_PATH="$formatted_path"
5901 PathFormat "$DOTNET_FRAMEWORK_HOME"
5902 DOTNET_FRAMEWORK_HOME="$formatted_path"
5904 PathFormat "$CSC_PATH"
5905 CSC_PATH="$formatted_path"
5908 dnl ===================================================================
5909 dnl Check if stdc headers are available excluding MSVC.
5910 dnl ===================================================================
5911 if test "$_os" != "WINNT"; then
5915 dnl ===================================================================
5916 dnl Testing for C++ compiler and version...
5917 dnl ===================================================================
5919 if test "$_os" != "WINNT"; then
5920 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5921 save_CXXFLAGS=$CXXFLAGS
5923 CXXFLAGS=$save_CXXFLAGS
5924 if test -z "$CXX_BASE"; then
5925 CXX_BASE=`first_arg_basename "$CXX"`
5929 dnl check for GNU C++ compiler version
5930 if test "$GXX" = "yes" -a -z "$COM_IS_CLANG"; then
5931 AC_MSG_CHECKING([the GNU C++ compiler version])
5933 _gpp_version=`$CXX -dumpversion`
5934 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5936 if test "$_gpp_majmin" -lt "700"; then
5937 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 7.0 to build LibreOffice, you have $_gpp_version.])
5939 AC_MSG_RESULT([ok (g++ $_gpp_version)])
5942 dnl see https://code.google.com/p/android/issues/detail?id=41770
5946 AC_MSG_CHECKING([whether $CXX_BASE is broken with boost.thread])
5947 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5948 #include <bits/c++config.h>]],[[
5949 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5950 && !defined(_GLIBCXX__PTHREADS) \
5951 && !defined(_GLIBCXX_HAS_GTHREADS)
5954 ]])],[AC_MSG_RESULT([yes])
5955 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5957 if test $glibcxx_threads = yes; then
5958 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5961 AC_SUBST(BOOST_CXXFLAGS)
5964 # prefx CXX with ccache if needed
5966 if test "$CCACHE" != ""; then
5967 AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
5969 save_CXXFLAGS=$CXXFLAGS
5970 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5971 dnl an empty program will do, we're checking the compiler flags
5972 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5973 [use_ccache=yes], [use_ccache=no])
5974 if test $use_ccache = yes; then
5975 AC_MSG_RESULT([yes])
5978 CXX_BASE="ccache $CXX_BASE"
5981 CXXFLAGS=$save_CXXFLAGS
5985 dnl ===================================================================
5986 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5987 dnl ===================================================================
5989 if test "$_os" != "WINNT"; then
5992 dnl Check whether there's a C pre-processor.
5997 dnl ===================================================================
5998 dnl Find integral type sizes and alignments
5999 dnl ===================================================================
6001 if test "$_os" != "WINNT"; then
6003 if test "$_os" = "iOS"; then
6004 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
6006 ac_cv_sizeof_short=2
6008 ac_cv_sizeof_long_long=8
6009 ac_cv_sizeof_double=8
6010 ac_cv_sizeof_voidp=8
6012 AC_CHECK_SIZEOF(long)
6013 AC_CHECK_SIZEOF(short)
6014 AC_CHECK_SIZEOF(int)
6015 AC_CHECK_SIZEOF(long long)
6016 AC_CHECK_SIZEOF(double)
6017 AC_CHECK_SIZEOF(void*)
6020 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
6021 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
6022 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
6023 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
6024 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
6026 dnl Allow build without AC_CHECK_ALIGNOF, grrr
6027 m4_pattern_allow([AC_CHECK_ALIGNOF])
6028 m4_ifdef([AC_CHECK_ALIGNOF],
6030 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
6031 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
6032 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
6033 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
6036 case "$_os-$host_cpu" in
6038 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6039 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6040 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
6041 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
6044 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
6045 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
6046 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
6047 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
6050 if test -z "$ac_cv_alignof_short" -o \
6051 -z "$ac_cv_alignof_int" -o \
6052 -z "$ac_cv_alignof_long" -o \
6053 -z "$ac_cv_alignof_double"; then
6054 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.])
6060 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
6061 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
6062 if test $ac_cv_sizeof_long -eq 8; then
6063 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
6064 elif test $ac_cv_sizeof_double -eq 8; then
6065 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
6067 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
6070 dnl Check for large file support
6072 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
6073 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
6075 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
6076 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
6080 SAL_TYPES_SIZEOFSHORT=2
6081 SAL_TYPES_SIZEOFINT=4
6082 SAL_TYPES_SIZEOFLONG=4
6083 SAL_TYPES_SIZEOFLONGLONG=8
6084 if test "$BITNESS_OVERRIDE" = ""; then
6085 SAL_TYPES_SIZEOFPOINTER=4
6087 SAL_TYPES_SIZEOFPOINTER=8
6089 SAL_TYPES_ALIGNMENT2=2
6090 SAL_TYPES_ALIGNMENT4=4
6091 SAL_TYPES_ALIGNMENT8=8
6094 AC_SUBST(LFS_CFLAGS)
6096 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
6097 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
6098 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
6099 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
6100 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
6101 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
6102 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
6103 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
6105 dnl ===================================================================
6106 dnl Check whether to enable runtime optimizations
6107 dnl ===================================================================
6108 ENABLE_RUNTIME_OPTIMIZATIONS=
6109 AC_MSG_CHECKING([whether to enable runtime optimizations])
6110 if test -z "$enable_runtime_optimizations"; then
6114 enable_runtime_optimizations=no
6120 if test "$enable_runtime_optimizations" != no; then
6121 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
6122 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
6123 AC_MSG_RESULT([yes])
6127 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
6129 dnl ===================================================================
6130 dnl Check if valgrind headers are available
6131 dnl ===================================================================
6133 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
6134 prev_cppflags=$CPPFLAGS
6135 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
6136 # or where does it come from?
6137 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
6138 AC_CHECK_HEADER([valgrind/valgrind.h],
6139 [ENABLE_VALGRIND=TRUE])
6140 CPPFLAGS=$prev_cppflags
6142 AC_SUBST([ENABLE_VALGRIND])
6143 if test -z "$ENABLE_VALGRIND"; then
6144 if test "$with_valgrind" = yes; then
6145 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
6149 AC_SUBST([VALGRIND_CFLAGS])
6152 dnl ===================================================================
6153 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
6154 dnl ===================================================================
6156 # We need at least the sys/sdt.h include header.
6157 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
6158 if test "$SDT_H_FOUND" = "TRUE"; then
6159 # Found sys/sdt.h header, now make sure the c++ compiler works.
6160 # Old g++ versions had problems with probes in constructors/destructors.
6161 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
6163 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6164 #include <sys/sdt.h>
6172 ProbeClass(int& v, const char *n) : ref(v), name(n)
6174 DTRACE_PROBE2(_test_, cons, name, ref);
6177 void method(int min)
6179 DTRACE_PROBE3(_test_, meth, name, ref, min);
6185 DTRACE_PROBE2(_test_, dest, name, ref);
6190 DTRACE_PROBE1(_test_, call, i);
6191 ProbeClass inst = ProbeClass(i, "call");
6193 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
6194 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
6197 AC_CONFIG_HEADERS([config_host/config_probes.h])
6199 dnl ===================================================================
6201 dnl ===================================================================
6202 HAVE_GCC_STACK_CLASH_PROTECTION=
6203 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6204 AC_MSG_CHECKING([whether $CC_BASE supports -fstack-clash-protection])
6206 CFLAGS="$CFLAGS -fstack-clash-protection"
6208 [AC_LANG_PROGRAM(, [[return 0;]])],
6209 [AC_MSG_RESULT([yes]); HAVE_GCC_STACK_CLASH_PROTECTION=TRUE],
6210 [AC_MSG_RESULT([no])])
6213 AC_MSG_CHECKING([whether $CC_BASE supports -mno-avx])
6215 CFLAGS="$CFLAGS -Werror -mno-avx"
6216 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
6218 if test "$HAVE_GCC_AVX" = "TRUE"; then
6219 AC_MSG_RESULT([yes])
6224 AC_MSG_CHECKING([whether $CC_BASE supports atomic functions])
6225 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6227 if (__sync_add_and_fetch(&v, 1) != 1 ||
6228 __sync_sub_and_fetch(&v, 1) != 0)
6230 __sync_synchronize();
6231 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6235 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6236 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6237 AC_MSG_RESULT([yes])
6238 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6243 AC_MSG_CHECKING([whether $CC_BASE supports __builtin_ffs])
6244 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
6245 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
6246 AC_MSG_RESULT([yes])
6247 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
6252 AC_MSG_CHECKING([whether $CC_BASE supports __attribute__((deprecated(message)))])
6254 CFLAGS="$CFLAGS -Werror"
6255 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6256 __attribute__((deprecated("test"))) void f();
6258 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6259 AC_MSG_RESULT([yes])
6260 ], [AC_MSG_RESULT([no])])
6263 AC_MSG_CHECKING([whether $CXX_BASE defines __base_class_type_info in cxxabi.h])
6265 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6268 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
6270 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
6271 AC_MSG_RESULT([yes])
6272 ], [AC_MSG_RESULT([no])])
6275 AC_MSG_CHECKING([whether $CXX_BASE defines __class_type_info in cxxabi.h])
6277 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6280 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
6282 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
6283 AC_MSG_RESULT([yes])
6284 ], [AC_MSG_RESULT([no])])
6287 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_allocate_exception in cxxabi.h])
6289 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6291 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6293 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6294 AC_MSG_RESULT([yes])
6295 ], [AC_MSG_RESULT([no])])
6298 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_eh_globals in cxxabi.h])
6300 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6303 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6305 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6306 AC_MSG_RESULT([yes])
6307 ], [AC_MSG_RESULT([no])])
6310 AC_MSG_CHECKING([whether $CXX_BASE defines __cxa_exceptions in cxxabi.h])
6312 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6315 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6317 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6318 AC_MSG_RESULT([yes])
6319 ], [AC_MSG_RESULT([no])])
6322 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_get_globals in cxxabi.h])
6324 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6326 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6328 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6329 AC_MSG_RESULT([yes])
6330 ], [AC_MSG_RESULT([no])])
6333 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_current_exception_type in cxxabi.h])
6335 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6337 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6339 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6340 AC_MSG_RESULT([yes])
6341 ], [AC_MSG_RESULT([no])])
6344 AC_MSG_CHECKING([whether $CXX_BASE declares __cxa_throw in cxxabi.h])
6346 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6348 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6350 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6351 AC_MSG_RESULT([yes])
6352 ], [AC_MSG_RESULT([no])])
6355 AC_MSG_CHECKING([whether $CXX_BASE defines __si_class_type_info in cxxabi.h])
6357 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6360 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6362 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6363 AC_MSG_RESULT([yes])
6364 ], [AC_MSG_RESULT([no])])
6367 AC_MSG_CHECKING([whether $CXX_BASE defines __vmi_class_type_info in cxxabi.h])
6369 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6372 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6374 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6375 AC_MSG_RESULT([yes])
6376 ], [AC_MSG_RESULT([no])])
6379 dnl Available in GCC 4.9 and at least since Clang 3.4:
6380 AC_MSG_CHECKING([whether $CXX_BASE supports __attribute__((warn_unused))])
6382 save_CXXFLAGS=$CXXFLAGS
6383 CXXFLAGS="$CXXFLAGS -Werror"
6384 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6385 struct __attribute__((warn_unused)) dummy {};
6387 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6388 AC_MSG_RESULT([yes])
6389 ], [AC_MSG_RESULT([no])])
6390 CXXFLAGS=$save_CXXFLAGS
6394 AC_SUBST(HAVE_GCC_AVX)
6395 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6396 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6397 AC_SUBST(HAVE_GCC_STACK_CLASH_PROTECTION)
6399 dnl ===================================================================
6400 dnl Identify the C++ library
6401 dnl ===================================================================
6403 AC_MSG_CHECKING([what the C++ library is])
6405 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6411 [CPP_LIBRARY=GLIBCXX
6412 cpp_library_name="GNU libstdc++"
6414 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6416 #ifndef _LIBCPP_VERSION
6421 cpp_library_name="LLVM libc++"
6422 AC_DEFINE([HAVE_LIBCXX])
6424 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6431 cpp_library_name="Microsoft"
6433 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6434 AC_MSG_RESULT([$cpp_library_name])
6437 dnl ===================================================================
6439 dnl ===================================================================
6440 AC_PATH_PROG(GPERF, gperf)
6441 if test -z "$GPERF"; then
6442 AC_MSG_ERROR([gperf not found but needed. Install it.])
6444 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6445 GPERF=`cygpath -m $GPERF`
6447 AC_MSG_CHECKING([whether gperf is new enough])
6448 my_gperf_ver1=$($GPERF --version | head -n 1)
6449 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
6450 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
6451 if test "$my_gperf_ver3" -ge 301; then
6452 AC_MSG_RESULT([yes ($my_gperf_ver2)])
6454 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
6458 dnl ===================================================================
6459 dnl Check for system libcmis
6460 dnl ===================================================================
6461 # libcmis requires curl and we can't build curl for iOS
6462 if test $_os != iOS; then
6463 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.2])
6468 AC_SUBST(ENABLE_LIBCMIS)
6470 dnl ===================================================================
6472 dnl ===================================================================
6474 AC_MSG_CHECKING([whether $CXX_BASE supports C++17])
6476 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6477 CXXFLAGS_CXX11='-std:c++17 -Zc:__cplusplus'
6478 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6479 my_flags='-std=c++2a -std=c++17 -std=c++1z'
6480 for flag in $my_flags; do
6481 if test "$COM" = MSC; then
6482 flag="-Xclang $flag"
6484 save_CXXFLAGS=$CXXFLAGS
6485 CXXFLAGS="$CXXFLAGS $flag -Werror"
6486 if test "$SYSTEM_LIBCMIS" = TRUE; then
6487 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6490 dnl Clang 3.9 supports __float128 since
6491 dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
6492 dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
6493 dnl hacky workaround to be able to include <vector> (as is done in the main check whether
6494 dnl $flag is supported below, so check this first):
6496 my_float128hack_impl=-D__float128=void
6497 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6499 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6503 dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
6504 dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
6505 dnl is available during its build, but it's usually built using GCC, and so c++config.h
6506 dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
6507 dnl place where __float128 is used is in a template specialization, -D__float128=void
6508 dnl will avoid the problem there while still causing a problem if somebody actually uses
6509 dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
6510 dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
6511 dnl "fixed" with this hack):
6512 CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
6513 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6515 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6518 ],[my_float128hack=$my_float128hack_impl])
6520 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6521 #include <algorithm>
6522 #include <functional>
6525 #if defined SYSTEM_LIBCMIS
6526 // See ucb/source/ucp/cmis/auth_provider.hxx:
6527 #if !defined __clang__
6528 #pragma GCC diagnostic push
6529 #pragma GCC diagnostic ignored "-Wdeprecated"
6530 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6532 #include <libcmis/libcmis.hxx>
6533 #if !defined __clang__
6534 #pragma GCC diagnostic pop
6538 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6539 std::sort(v.begin(), v.end(), fn);
6541 ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
6543 CXXFLAGS=$save_CXXFLAGS
6544 if test -n "$CXXFLAGS_CXX11"; then
6549 if test -n "$CXXFLAGS_CXX11"; then
6550 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6554 AC_SUBST(CXXFLAGS_CXX11)
6556 if test "$GCC" = "yes"; then
6557 save_CXXFLAGS=$CXXFLAGS
6558 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6560 CXXFLAGS=$save_CXXFLAGS
6561 AC_SUBST(ATOMIC_LIB)
6564 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6565 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6566 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6567 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6568 dnl again towards 4.7.2:
6569 if test $CPP_LIBRARY = GLIBCXX; then
6570 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6572 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6574 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6575 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6576 // GCC 4.7.0: 20120322
6577 // GCC 4.7.1: 20120614
6578 // and using a range check is not possible as the mapping between
6579 // __GLIBCXX__ values and GCC versions is not monotonic
6584 ]])], [AC_MSG_RESULT(no, ok)],
6585 [AC_MSG_ERROR(yes)])
6589 AC_MSG_CHECKING([whether $CXX_BASE supports C++11 without Language Defect 757])
6590 save_CXXFLAGS=$CXXFLAGS
6591 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6594 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6597 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6613 a thinga[]={{0,0}, {1,1}};
6614 b thingb[]={{0,0}, {1,1}};
6615 size_t i = sizeof(sal_n_array_size(thinga));
6616 size_t j = sizeof(sal_n_array_size(thingb));
6617 return !(i != 0 && j != 0);
6619 ], [ AC_MSG_RESULT(yes) ],
6620 [ AC_MSG_ERROR(no)])
6622 CXXFLAGS=$save_CXXFLAGS
6624 dnl _Pragma support (may require C++11)
6625 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6626 AC_MSG_CHECKING([whether $CXX_BASE supports _Pragma operator])
6628 save_CXXFLAGS=$CXXFLAGS
6629 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6630 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6631 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6633 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6634 AC_MSG_RESULT([yes])
6635 ], [AC_MSG_RESULT([no])])
6637 CXXFLAGS=$save_CXXFLAGS
6640 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6641 if test "$GCC" = yes; then
6642 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-sized-deallocation])
6644 save_CXXFLAGS=$CXXFLAGS
6645 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6646 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6647 CXXFLAGS=$save_CXXFLAGS
6649 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6650 AC_MSG_RESULT([yes])
6655 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6657 AC_MSG_CHECKING([whether $CXX_BASE supports guaranteed copy elision])
6659 save_CXXFLAGS=$CXXFLAGS
6660 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6661 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6662 // At least VS 2017 15.8.1 defines __cpp_guaranteed_copy_elision as 201606L without actually
6664 #if !defined __cpp_guaranteed_copy_elision || (defined _MSC_VER && !defined __clang__)
6673 void f() { S c(copy()); }
6676 AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
6677 AC_MSG_RESULT([yes])
6678 ], [AC_MSG_RESULT([no])])
6679 CXXFLAGS=$save_CXXFLAGS
6682 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a constinit sorted vectors])
6684 save_CXXFLAGS=$CXXFLAGS
6685 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6686 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6687 #include <algorithm>
6688 #include <initializer_list>
6690 template<typename T> class S {
6694 constexpr S(std::initializer_list<T> i): v_(i) { std::sort(v_.begin(), v_.end()); }
6696 constinit S<int> s{3, 2, 1};
6698 AC_DEFINE([HAVE_CPP_CONSTINIT_SORTED_VECTOR],[1])
6699 AC_MSG_RESULT([yes])
6700 ], [AC_MSG_RESULT([no])])
6701 CXXFLAGS=$save_CXXFLAGS
6704 AC_MSG_CHECKING([whether $CXX_BASE supports C++2a <span> with unsigned size_type])
6706 save_CXXFLAGS=$CXXFLAGS
6707 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6708 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6710 #include <type_traits>
6711 // Don't check size_type directly, as it was called index_type before P1872R0:
6712 void f(std::span<int> s) { static_assert(std::is_unsigned_v<decltype(s.size())>); };
6714 AC_DEFINE([HAVE_CPP_SPAN],[1])
6715 AC_MSG_RESULT([yes])
6716 ], [AC_MSG_RESULT([no])])
6717 CXXFLAGS=$save_CXXFLAGS
6720 AC_MSG_CHECKING([whether $CXX_BASE has GCC bug 87150])
6722 save_CXXFLAGS=$CXXFLAGS
6723 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6724 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6725 struct S1 { S1(S1 &&); };
6727 S1 f(S2 s) { return s; }
6729 AC_DEFINE([HAVE_GCC_BUG_87150],[1])
6730 AC_MSG_RESULT([yes])
6731 ], [AC_MSG_RESULT([no])])
6732 CXXFLAGS=$save_CXXFLAGS
6735 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
6736 dnl uninitialized warning for code like
6739 dnl boost::optional<OString> * g(bool b) {
6740 dnl boost::optional<OString> o;
6742 dnl return new boost::optional<OString>(o);
6745 dnl (as is e.g. present, in a slightly more elaborate form, in
6746 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
6747 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
6748 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
6749 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
6750 AC_MSG_CHECKING([whether $CXX_BASE might report false -Werror=maybe-uninitialized])
6752 save_CXXFLAGS=$CXXFLAGS
6753 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
6754 if test "$ENABLE_OPTIMIZED" = TRUE; then
6755 CXXFLAGS="$CXXFLAGS -O2"
6757 CXXFLAGS="$CXXFLAGS -O0"
6759 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6768 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
6769 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
6775 char stg[sizeof (S1)];
6783 ]])], [AC_MSG_RESULT([no])], [
6784 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
6785 AC_MSG_RESULT([yes])
6787 CXXFLAGS=$save_CXXFLAGS
6790 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
6792 dnl ===================================================================
6793 dnl CPU Intrinsics support - SSE, AVX
6794 dnl ===================================================================
6796 CXXFLAGS_INTRINSICS_SSE2=
6797 CXXFLAGS_INTRINSICS_SSSE3=
6798 CXXFLAGS_INTRINSICS_SSE41=
6799 CXXFLAGS_INTRINSICS_SSE42=
6800 CXXFLAGS_INTRINSICS_AVX=
6801 CXXFLAGS_INTRINSICS_AVX2=
6802 CXXFLAGS_INTRINSICS_F16C=
6803 CXXFLAGS_INTRINSICS_FMA=
6805 if test "$GCC" = "yes"; then
6815 # https://docs.microsoft.com/en-us/cpp/build/reference/arch-x86
6816 # MSVC seems to differentiate only between SSE and SSE2, where in fact
6817 # SSE2 seems to be SSE2+.
6818 # Even if -arch:SSE2 is the default, set it explicitly, so that the variable
6819 # is not empty (and can be tested in gbuild), moreover we now default to SSE
6821 flag_sse2=-arch:SSE2
6822 flag_ssse3=-arch:SSE2
6823 flag_sse41=-arch:SSE2
6824 flag_sse42=-arch:SSE2
6826 flag_avx2=-arch:AVX2
6827 # These are part of -arch:AVX2
6828 flag_f16c=-arch:AVX2
6832 AC_MSG_CHECKING([whether $CXX can compile SSE2 intrinsics])
6834 save_CXXFLAGS=$CXXFLAGS
6835 CXXFLAGS="$CXXFLAGS $flag_sse2"
6836 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6837 #include <emmintrin.h>
6839 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6840 c = _mm_xor_si128 (a, b);
6844 [can_compile_sse2=yes],
6845 [can_compile_sse2=no])
6847 CXXFLAGS=$save_CXXFLAGS
6848 AC_MSG_RESULT([${can_compile_sse2}])
6849 if test "${can_compile_sse2}" = "yes" ; then
6850 CXXFLAGS_INTRINSICS_SSE2="$flag_sse2"
6853 AC_MSG_CHECKING([whether $CXX can compile SSSE3 intrinsics])
6855 save_CXXFLAGS=$CXXFLAGS
6856 CXXFLAGS="$CXXFLAGS $flag_ssse3"
6857 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6858 #include <tmmintrin.h>
6860 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6861 c = _mm_maddubs_epi16 (a, b);
6865 [can_compile_ssse3=yes],
6866 [can_compile_ssse3=no])
6868 CXXFLAGS=$save_CXXFLAGS
6869 AC_MSG_RESULT([${can_compile_ssse3}])
6870 if test "${can_compile_ssse3}" = "yes" ; then
6871 CXXFLAGS_INTRINSICS_SSSE3="$flag_ssse3"
6874 AC_MSG_CHECKING([whether $CXX can compile SSE4.1 intrinsics])
6876 save_CXXFLAGS=$CXXFLAGS
6877 CXXFLAGS="$CXXFLAGS $flag_sse41"
6878 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6879 #include <smmintrin.h>
6881 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6882 c = _mm_cmpeq_epi64 (a, b);
6886 [can_compile_sse41=yes],
6887 [can_compile_sse41=no])
6889 CXXFLAGS=$save_CXXFLAGS
6890 AC_MSG_RESULT([${can_compile_sse41}])
6891 if test "${can_compile_sse41}" = "yes" ; then
6892 CXXFLAGS_INTRINSICS_SSE41="$flag_sse41"
6895 AC_MSG_CHECKING([whether $CXX can compile SSE4.2 intrinsics])
6897 save_CXXFLAGS=$CXXFLAGS
6898 CXXFLAGS="$CXXFLAGS $flag_sse42"
6899 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6900 #include <nmmintrin.h>
6902 __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
6903 c = _mm_cmpgt_epi64 (a, b);
6907 [can_compile_sse42=yes],
6908 [can_compile_sse42=no])
6910 CXXFLAGS=$save_CXXFLAGS
6911 AC_MSG_RESULT([${can_compile_sse42}])
6912 if test "${can_compile_sse42}" = "yes" ; then
6913 CXXFLAGS_INTRINSICS_SSE42="$flag_sse42"
6916 AC_MSG_CHECKING([whether $CXX can compile AVX intrinsics])
6918 save_CXXFLAGS=$CXXFLAGS
6919 CXXFLAGS="$CXXFLAGS $flag_avx"
6920 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6921 #include <immintrin.h>
6923 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c;
6924 c = _mm256_xor_ps(a, b);
6928 [can_compile_avx=yes],
6929 [can_compile_avx=no])
6931 CXXFLAGS=$save_CXXFLAGS
6932 AC_MSG_RESULT([${can_compile_avx}])
6933 if test "${can_compile_avx}" = "yes" ; then
6934 CXXFLAGS_INTRINSICS_AVX="$flag_avx"
6937 AC_MSG_CHECKING([whether $CXX can compile AVX2 intrinsics])
6939 save_CXXFLAGS=$CXXFLAGS
6940 CXXFLAGS="$CXXFLAGS $flag_avx2"
6941 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6942 #include <immintrin.h>
6944 __m256i a = _mm256_set1_epi32 (0), b = _mm256_set1_epi32 (0), c;
6945 c = _mm256_maddubs_epi16(a, b);
6949 [can_compile_avx2=yes],
6950 [can_compile_avx2=no])
6952 CXXFLAGS=$save_CXXFLAGS
6953 AC_MSG_RESULT([${can_compile_avx2}])
6954 if test "${can_compile_avx2}" = "yes" ; then
6955 CXXFLAGS_INTRINSICS_AVX2="$flag_avx2"
6958 AC_MSG_CHECKING([whether $CXX can compile F16C intrinsics])
6960 save_CXXFLAGS=$CXXFLAGS
6961 CXXFLAGS="$CXXFLAGS $flag_f16c"
6962 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6963 #include <immintrin.h>
6965 __m128i a = _mm_set1_epi32 (0);
6967 c = _mm_cvtph_ps(a);
6971 [can_compile_f16c=yes],
6972 [can_compile_f16c=no])
6974 CXXFLAGS=$save_CXXFLAGS
6975 AC_MSG_RESULT([${can_compile_f16c}])
6976 if test "${can_compile_f16c}" = "yes" ; then
6977 CXXFLAGS_INTRINSICS_F16C="$flag_f16c"
6980 AC_MSG_CHECKING([whether $CXX can compile FMA intrinsics])
6982 save_CXXFLAGS=$CXXFLAGS
6983 CXXFLAGS="$CXXFLAGS $flag_fma"
6984 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6985 #include <immintrin.h>
6987 __m256 a = _mm256_set1_ps (0.0f), b = _mm256_set1_ps (0.0f), c = _mm256_set1_ps (0.0f), d;
6988 d = _mm256_fmadd_ps(a, b, c);
6992 [can_compile_fma=yes],
6993 [can_compile_fma=no])
6995 CXXFLAGS=$save_CXXFLAGS
6996 AC_MSG_RESULT([${can_compile_fma}])
6997 if test "${can_compile_fma}" = "yes" ; then
6998 CXXFLAGS_INTRINSICS_FMA="$flag_fma"
7001 AC_SUBST([CXXFLAGS_INTRINSICS_SSE2])
7002 AC_SUBST([CXXFLAGS_INTRINSICS_SSSE3])
7003 AC_SUBST([CXXFLAGS_INTRINSICS_SSE41])
7004 AC_SUBST([CXXFLAGS_INTRINSICS_SSE42])
7005 AC_SUBST([CXXFLAGS_INTRINSICS_AVX])
7006 AC_SUBST([CXXFLAGS_INTRINSICS_AVX2])
7007 AC_SUBST([CXXFLAGS_INTRINSICS_F16C])
7008 AC_SUBST([CXXFLAGS_INTRINSICS_FMA])
7010 dnl ===================================================================
7011 dnl system stl sanity tests
7012 dnl ===================================================================
7013 if test "$_os" != "WINNT"; then
7017 save_CPPFLAGS="$CPPFLAGS"
7018 if test -n "$MACOSX_SDK_PATH"; then
7019 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
7022 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
7024 if test "$CPP_LIBRARY" = GLIBCXX; then
7025 dnl gcc#19664, gcc#22482, rhbz#162935
7026 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
7027 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
7028 AC_MSG_RESULT([$stlvisok])
7029 if test "$stlvisok" = "no"; then
7030 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
7034 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
7035 # when we don't make any dynamic libraries?
7036 if test "$DISABLE_DYNLOADING" = ""; then
7037 AC_MSG_CHECKING([if $CXX_BASE is -fvisibility-inlines-hidden safe (Clang bug 11250)])
7038 cat > conftestlib1.cc <<_ACEOF
7039 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
7040 struct S2: S1<int> { virtual ~S2(); };
7043 cat > conftestlib2.cc <<_ACEOF
7044 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
7045 struct S2: S1<int> { virtual ~S2(); };
7046 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
7048 gccvisinlineshiddenok=yes
7049 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
7050 gccvisinlineshiddenok=no
7052 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
7053 dnl known to not work with -z defs (unsetting which makes the test
7055 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
7056 if test "$COM_IS_CLANG" = TRUE; then
7057 for i in $CXX $CXXFLAGS; do
7060 my_linkflagsnoundefs=
7066 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
7067 gccvisinlineshiddenok=no
7072 AC_MSG_RESULT([$gccvisinlineshiddenok])
7073 if test "$gccvisinlineshiddenok" = "no"; then
7074 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
7078 AC_MSG_CHECKING([if $CXX_BASE has a visibility bug with class-level attributes (GCC bug 26905)])
7079 cat >visibility.cxx <<_ACEOF
7080 #pragma GCC visibility push(hidden)
7081 struct __attribute__ ((visibility ("default"))) TestStruct {
7084 __attribute__ ((visibility ("default"))) void TestFunc() {
7088 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
7093 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
7096 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
7108 rm -f visibility.s visibility.cxx
7110 AC_MSG_RESULT([$gccvisbroken])
7111 if test "$gccvisbroken" = "yes"; then
7112 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
7115 CPPFLAGS="$save_CPPFLAGS"
7120 dnl ===================================================================
7122 dnl ===================================================================
7124 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
7125 if test "$GCC" = "yes"; then
7126 AC_MSG_CHECKING([whether $CXX_BASE supports -fno-enforce-eh-specs])
7128 save_CXXFLAGS=$CXXFLAGS
7129 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
7130 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
7131 CXXFLAGS=$save_CXXFLAGS
7133 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
7134 AC_MSG_RESULT([yes])
7139 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
7141 dnl ===================================================================
7142 dnl Compiler plugins
7143 dnl ===================================================================
7146 # currently only Clang
7148 if test "$COM_IS_CLANG" != "TRUE"; then
7149 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
7150 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
7151 enable_compiler_plugins=no
7155 if test "$COM_IS_CLANG" = "TRUE"; then
7156 if test -n "$enable_compiler_plugins"; then
7157 compiler_plugins="$enable_compiler_plugins"
7158 elif test -n "$ENABLE_DBGUTIL"; then
7159 compiler_plugins=test
7163 if test "$compiler_plugins" != no -a "$my_apple_clang" != yes; then
7164 if test "$CLANGVER" -lt 50002; then
7165 if test "$compiler_plugins" = yes; then
7166 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 5.0.2.])
7172 if test "$compiler_plugins" != "no"; then
7173 dnl The prefix where Clang resides, override to where Clang resides if
7174 dnl using a source build:
7175 if test -z "$CLANGDIR"; then
7176 CLANGDIR=$(dirname $(dirname $($CXX -print-prog-name=$(basename $CXX))))
7178 # Assume Clang is self-built, but allow overriding COMPILER_PLUGINS_CXX to the compiler Clang was built with.
7179 if test -z "$COMPILER_PLUGINS_CXX"; then
7180 COMPILER_PLUGINS_CXX=[$(echo $CXX | sed -e 's/-fsanitize=[^ ]*//g')]
7182 clangbindir=$CLANGDIR/bin
7183 if test "$build_os" = "cygwin"; then
7184 clangbindir=$(cygpath -u "$clangbindir")
7186 AC_PATH_PROG(LLVM_CONFIG, llvm-config,[],"$clangbindir" $PATH)
7187 if test -n "$LLVM_CONFIG"; then
7188 COMPILER_PLUGINS_CXXFLAGS=$($LLVM_CONFIG --cxxflags)
7189 COMPILER_PLUGINS_LINKFLAGS=$($LLVM_CONFIG --ldflags --libs --system-libs | tr '\n' ' ')
7190 if test -z "$CLANGLIBDIR"; then
7191 CLANGLIBDIR=$($LLVM_CONFIG --libdir)
7193 # Try if clang is built from source (in which case its includes are not together with llvm includes).
7194 # src-root is [llvm-toplevel-src-dir]/llvm, clang is [llvm-toplevel-src-dir]/clang
7195 clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
7196 if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d "$clangsrcdir/clang/include"; then
7197 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangsrcdir/clang/include"
7199 # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
7200 clangobjdir=$($LLVM_CONFIG --obj-root)
7201 if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
7202 COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
7205 AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
7209 save_CPPFLAGS=$CPPFLAGS
7210 save_CXXFLAGS=$CXXFLAGS
7211 save_LDFLAGS=$LDFLAGS
7213 CXX=$COMPILER_PLUGINS_CXX
7214 CXXCPP="$COMPILER_PLUGINS_CXX -E"
7215 CPPFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7216 CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS"
7217 AC_CHECK_HEADER(clang/Basic/SourceLocation.h,
7218 [COMPILER_PLUGINS=TRUE],
7220 if test "$compiler_plugins" = "yes"; then
7221 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
7223 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
7224 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
7227 dnl TODO: Windows doesn't use LO_CLANG_SHARED_PLUGINS for now, see corresponding TODO
7228 dnl comment in compilerplugins/Makefile-clang.mk:
7229 if test -n "$COMPILER_PLUGINS" && test "$_os" != "WINNT"; then
7231 AC_MSG_CHECKING([for clang libraries to use])
7232 if test -z "$CLANGTOOLLIBS"; then
7233 LIBS="-lclangTooling -lclangDriver -lclangFrontend -lclangParse -lclangSema -lclangEdit \
7234 -lclangAnalysis -lclangAST -lclangLex -lclangSerialization -lclangBasic $COMPILER_PLUGINS_LINKFLAGS"
7236 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7237 [[ clang::FullSourceLoc().dump(); ]])
7238 ],[CLANGTOOLLIBS="$LIBS"],[])
7240 if test -z "$CLANGTOOLLIBS"; then
7241 LIBS="-lclang-cpp $COMPILER_PLUGINS_LINKFLAGS"
7243 AC_LANG_PROGRAM([[#include "clang/Basic/SourceLocation.h"]],
7244 [[ clang::FullSourceLoc().dump(); ]])
7245 ],[CLANGTOOLLIBS="$LIBS"],[])
7247 AC_MSG_RESULT([$CLANGTOOLLIBS])
7248 if test -z "$CLANGTOOLLIBS"; then
7249 if test "$compiler_plugins" = "yes"; then
7250 AC_MSG_ERROR([Cannot find Clang libraries to build compiler plugins.])
7252 AC_MSG_WARN([Cannot find Clang libraries to build compiler plugins, plugins disabled])
7253 add_warning "Cannot find Clang libraries to build compiler plugins, plugins disabled."
7257 if test -n "$COMPILER_PLUGINS"; then
7258 if test -z "$CLANGSYSINCLUDE"; then
7259 if test -n "$LLVM_CONFIG"; then
7260 # Path to the clang system headers (no idea if there's a better way to get it).
7261 CLANGSYSINCLUDE=$($LLVM_CONFIG --libdir)/clang/$($LLVM_CONFIG --version | sed 's/svn//')/include
7268 CPPFLAGS=$save_CPPFLAGS
7269 CXXFLAGS=$save_CXXFLAGS
7270 LDFLAGS=$save_LDFLAGS
7275 if test "$enable_compiler_plugins" = "yes"; then
7276 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
7279 AC_SUBST(COMPILER_PLUGINS)
7280 AC_SUBST(COMPILER_PLUGINS_CXX)
7281 AC_SUBST(COMPILER_PLUGINS_CXXFLAGS)
7282 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
7283 AC_SUBST(COMPILER_PLUGINS_DEBUG)
7284 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
7286 AC_SUBST(CLANGLIBDIR)
7287 AC_SUBST(CLANGTOOLLIBS)
7288 AC_SUBST(CLANGSYSINCLUDE)
7290 # Plugin to help linker.
7291 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
7292 # This makes --enable-lto build with clang work.
7295 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
7296 AC_SUBST(HAVE_POSIX_FALLOCATE)
7298 dnl ===================================================================
7299 dnl Custom build version
7300 dnl ===================================================================
7302 AC_MSG_CHECKING([whether to add custom build version])
7303 if test "$with_build_version" != ""; then
7304 BUILD_VER_STRING=$with_build_version
7305 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
7310 AC_SUBST(BUILD_VER_STRING)
7312 JITC_PROCESSOR_TYPE=""
7313 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
7314 # IBMs JDK needs this...
7315 JITC_PROCESSOR_TYPE=6
7316 export JITC_PROCESSOR_TYPE
7318 AC_SUBST([JITC_PROCESSOR_TYPE])
7320 # Misc Windows Stuff
7321 AC_ARG_WITH(ucrt-dir,
7322 AS_HELP_STRING([--with-ucrt-dir],
7323 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
7324 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
7325 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
7326 Windows6.1-KB2999226-x64.msu
7327 Windows6.1-KB2999226-x86.msu
7328 Windows8.1-KB2999226-x64.msu
7329 Windows8.1-KB2999226-x86.msu
7330 Windows8-RT-KB2999226-x64.msu
7331 Windows8-RT-KB2999226-x86.msu
7332 A zip archive including those files is available from Microsoft site:
7333 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
7335 UCRT_REDISTDIR="$with_ucrt_dir"
7336 if test $_os = "WINNT"; then
7339 MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
7340 MSVC_DLLS="$msvcdlls"
7341 MSM_PATH=`win_short_path_for_make "$msmdir"`
7342 # MSVC 15.3 changed it to VC141
7343 if echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
7344 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
7346 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
7349 if test "$UCRT_REDISTDIR" = "no"; then
7350 dnl explicitly disabled
7353 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
7354 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
7355 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
7356 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
7357 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
7358 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
7360 if test -n "$PKGFORMAT"; then
7361 for i in $PKGFORMAT; do
7364 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
7365 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
7374 AC_SUBST(UCRT_REDISTDIR)
7375 AC_SUBST(MSVC_DLL_PATH)
7379 dnl ===================================================================
7381 dnl ===================================================================
7382 if test "$ENABLE_JAVA" != ""; then
7384 # Windows-specific tests
7385 if test "$build_os" = "cygwin"; then
7386 if test "$BITNESS_OVERRIDE" = 64; then
7392 if test -z "$with_jdk_home"; then
7393 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
7394 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
7395 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
7396 if test -n "$regvalue"; then
7398 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
7401 if test -z "$with_jdk_home"; then
7403 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
7404 if test -n "$regvalue"; then
7410 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
7411 with_jdk_home="$_jdk_home"
7412 howfound="found automatically"
7414 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
7417 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
7418 howfound="you passed"
7422 # 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.
7423 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
7424 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
7425 with_jdk_home=`/usr/libexec/java_home`
7428 JAVA_HOME=; export JAVA_HOME
7429 if test -z "$with_jdk_home"; then
7430 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
7432 _java_path="$with_jdk_home/bin/$with_java"
7433 dnl Check if there is a Java interpreter at all.
7434 if test -x "$_java_path"; then
7435 JAVAINTERPRETER=$_java_path
7437 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
7441 dnl Check that the JDK found is correct architecture (at least 2 reasons to
7442 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
7443 dnl loaded by java to run JunitTests:
7444 if test "$build_os" = "cygwin"; then
7445 shortjdkhome=`cygpath -d "$with_jdk_home"`
7446 if test "$BITNESS_OVERRIDE" = 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
7447 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
7448 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7449 elif test "$BITNESS_OVERRIDE" = "" -a -f "$_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
7450 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7451 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7454 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
7455 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
7457 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
7458 elif test "$cross_compiling" != "yes"; then
7460 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
7461 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
7462 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
7463 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7466 *) # assumption: everything else 32-bit
7467 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
7468 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7469 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7476 dnl ===================================================================
7478 dnl ===================================================================
7480 # Note that JAVA_HOME as for now always means the *build* platform's
7481 # JAVA_HOME. Whether all the complexity here actually is needed any
7482 # more or not, no idea.
7484 if test "$ENABLE_JAVA" != ""; then
7486 AC_MSG_CHECKING([the installed JDK])
7487 if test -n "$JAVAINTERPRETER"; then
7488 dnl java -version sends output to stderr!
7489 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
7490 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7491 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
7492 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7493 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
7494 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7495 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
7498 dnl IBM JDK specific tests
7499 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
7500 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7502 if test "$_jdk_ver" -lt 10800; then
7503 AC_MSG_ERROR([IBM JDK is too old, you need at least 8])
7506 AC_MSG_RESULT([found (IBM JDK $_jdk)])
7508 if test "$with_jdk_home" = ""; then
7509 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
7510 you must use the "--with-jdk-home" configure option explicitly])
7513 JAVA_HOME=$with_jdk_home
7517 dnl Sun JDK specific tests
7518 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
7519 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7521 if test "$_jdk_ver" -lt 10800; then
7522 AC_MSG_ERROR([JDK is too old, you need at least 8])
7524 if test "$_jdk_ver" -gt 10800; then
7525 JAVA_CLASSPATH_NOT_SET=TRUE
7528 AC_MSG_RESULT([found (JDK $_jdk)])
7529 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
7530 if test "$_os" = "WINNT"; then
7531 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
7534 # set to limit VM usage for JunitTests
7536 # set to limit VM usage for javac
7537 JAVAFLAGS=-J-Xmx128M
7540 AC_MSG_ERROR([Java not found. You need at least JDK 8])
7548 dnl ===================================================================
7549 dnl Checks for javac
7550 dnl ===================================================================
7551 if test "$ENABLE_JAVA" != ""; then
7552 javacompiler="javac"
7553 : ${JAVA_SOURCE_VER=8}
7554 : ${JAVA_TARGET_VER=8}
7555 if test -z "$with_jdk_home"; then
7556 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
7558 _javac_path="$with_jdk_home/bin/$javacompiler"
7559 dnl Check if there is a Java compiler at all.
7560 if test -x "$_javac_path"; then
7561 JAVACOMPILER=$_javac_path
7564 if test -z "$JAVACOMPILER"; then
7565 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7567 if test "$build_os" = "cygwin"; then
7568 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7569 JAVACOMPILER="${JAVACOMPILER}.exe"
7571 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7575 dnl ===================================================================
7576 dnl Checks for javadoc
7577 dnl ===================================================================
7578 if test "$ENABLE_JAVA" != ""; then
7579 if test -z "$with_jdk_home"; then
7580 AC_PATH_PROG(JAVADOC, javadoc)
7582 _javadoc_path="$with_jdk_home/bin/javadoc"
7583 dnl Check if there is a javadoc at all.
7584 if test -x "$_javadoc_path"; then
7585 JAVADOC=$_javadoc_path
7587 AC_PATH_PROG(JAVADOC, javadoc)
7590 if test -z "$JAVADOC"; then
7591 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7593 if test "$build_os" = "cygwin"; then
7594 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7595 JAVADOC="${JAVADOC}.exe"
7597 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7600 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7601 JAVADOCISGJDOC="yes"
7604 AC_SUBST(JAVADOCISGJDOC)
7606 if test "$ENABLE_JAVA" != ""; then
7607 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7608 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7609 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7610 # try to recover first by looking whether we have an alternative
7611 # system as in Debian or newer SuSEs where following /usr/bin/javac
7612 # over /etc/alternatives/javac leads to the right bindir where we
7613 # just need to strip a bit away to get a valid JAVA_HOME
7614 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7615 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7616 # maybe only one level of symlink (e.g. on Mac)
7617 JAVA_HOME=$(readlink $JAVACOMPILER)
7618 if test "$(dirname $JAVA_HOME)" = "."; then
7619 # we've got no path to trim back
7624 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7625 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7626 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7627 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7629 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it...
7630 if test "$JAVA_HOME" != "/usr"; then
7631 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7632 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7633 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7634 dnl Tiger already returns a JDK path...
7635 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7637 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7638 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7639 dnl that checks which version to run
7640 if test -f "$JAVA_HOME"; then
7641 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7646 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7648 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7649 if test -z "$JAVA_HOME"; then
7650 if test "x$with_jdk_home" = "x"; then
7651 cat > findhome.java <<_ACEOF
7652 [import java.io.File;
7656 public static void main(String args[])
7658 String jrelocation = System.getProperty("java.home");
7659 File jre = new File(jrelocation);
7660 System.out.println(jre.getParent());
7664 AC_MSG_CHECKING([if javac works])
7665 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7666 AC_TRY_EVAL(javac_cmd)
7667 if test $? = 0 -a -f ./findhome.class; then
7668 AC_MSG_RESULT([javac works])
7670 echo "configure: javac test failed" >&5
7671 cat findhome.java >&5
7672 AC_MSG_ERROR([javac does not work - java projects will not build!])
7674 AC_MSG_CHECKING([if gij knows its java.home])
7675 JAVA_HOME=`$JAVAINTERPRETER findhome`
7676 if test $? = 0 -a "$JAVA_HOME" != ""; then
7677 AC_MSG_RESULT([$JAVA_HOME])
7679 echo "configure: java test failed" >&5
7680 cat findhome.java >&5
7681 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7683 # clean-up after ourselves
7684 rm -f ./findhome.java ./findhome.class
7686 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7690 # now check if $JAVA_HOME is really valid
7691 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7692 case "${JAVA_HOME}" in
7693 /Library/Java/JavaVirtualMachines/*)
7696 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7699 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7702 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7705 if test "$JAVA_HOME_OK" = "NO"; then
7706 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7707 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7708 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
7709 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7710 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7711 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
7713 PathFormat "$JAVA_HOME"
7714 JAVA_HOME="$formatted_path"
7717 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7720 AC_MSG_CHECKING([for JAWT lib])
7721 if test "$_os" = WINNT; then
7722 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7727 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7728 JAVA_ARCH=$my_java_arch
7743 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7744 JAVA_ARCH=$my_java_arch
7747 my_java_arch=sparcv9
7753 my_java_arch=$host_cpu
7756 # This is where JDK9 puts the library
7757 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7758 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7760 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7762 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7764 AC_MSG_RESULT([$JAWTLIB])
7768 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7772 JAVAINC="-I$JAVA_HOME/include"
7773 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7774 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7778 JAVAINC="-I$JAVA_HOME/include/win32"
7779 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7783 if test -d "$JAVA_HOME/include/darwin"; then
7784 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7786 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7791 JAVAINC="-I$JAVA_HOME/include"
7792 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7796 JAVAINC="-I$JAVA_HOME/include"
7797 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7798 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7799 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7800 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7804 JAVAINC="-I$JAVA_HOME/include"
7805 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7806 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7810 JAVAINC="-I$JAVA_HOME/include"
7811 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7812 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7816 JAVAINC="-I$JAVA_HOME/include"
7817 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7818 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7822 JAVAINC="-I$JAVA_HOME/include"
7823 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7824 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7828 JAVAINC="-I$JAVA_HOME/include"
7829 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7830 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7834 SOLARINC="$SOLARINC $JAVAINC"
7836 AC_SUBST(JAVACOMPILER)
7838 AC_SUBST(JAVAINTERPRETER)
7839 AC_SUBST(JAVAIFLAGS)
7841 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7843 AC_SUBST(JAVA_SOURCE_VER)
7844 AC_SUBST(JAVA_TARGET_VER)
7848 dnl ===================================================================
7849 dnl Export file validation
7850 dnl ===================================================================
7851 AC_MSG_CHECKING([whether to enable export file validation])
7852 if test "$with_export_validation" != "no"; then
7853 if test -z "$ENABLE_JAVA"; then
7854 if test "$with_export_validation" = "yes"; then
7855 AC_MSG_ERROR([requested, but Java is disabled])
7857 AC_MSG_RESULT([no, as Java is disabled])
7859 elif ! test -d "${SRC_ROOT}/schema"; then
7860 if test "$with_export_validation" = "yes"; then
7861 AC_MSG_ERROR([requested, but schema directory is missing (it is excluded from tarballs)])
7863 AC_MSG_RESULT([no, schema directory is missing (it is excluded from tarballs)])
7866 AC_MSG_RESULT([yes])
7867 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7869 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7870 if test -z "$ODFVALIDATOR"; then
7871 # remember to download the ODF toolkit with validator later
7872 AC_MSG_NOTICE([no odfvalidator found, will download it])
7873 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7874 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7876 # and fetch name of odfvalidator jar name from download.lst
7877 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7878 AC_SUBST(ODFVALIDATOR_JAR)
7880 if test -z "$ODFVALIDATOR_JAR"; then
7881 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7884 if test "$build_os" = "cygwin"; then
7885 # In case of Cygwin it will be executed from Windows,
7886 # so we need to run bash and absolute path to validator
7887 # so instead of "odfvalidator" it will be
7888 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7889 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7891 ODFVALIDATOR="sh $ODFVALIDATOR"
7893 AC_SUBST(ODFVALIDATOR)
7896 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7897 if test -z "$OFFICEOTRON"; then
7898 # remember to download the officeotron with validator later
7899 AC_MSG_NOTICE([no officeotron found, will download it])
7900 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7901 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7903 # and fetch name of officeotron jar name from download.lst
7904 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7905 AC_SUBST(OFFICEOTRON_JAR)
7907 if test -z "$OFFICEOTRON_JAR"; then
7908 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7911 # check version of existing officeotron
7912 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7913 if test 0"$OFFICEOTRON_VER" -lt 704; then
7914 AC_MSG_ERROR([officeotron too old])
7917 if test "$build_os" = "cygwin"; then
7918 # In case of Cygwin it will be executed from Windows,
7919 # so we need to run bash and absolute path to validator
7920 # so instead of "odfvalidator" it will be
7921 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7922 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7924 OFFICEOTRON="sh $OFFICEOTRON"
7927 AC_SUBST(OFFICEOTRON)
7932 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7933 if test "$with_bffvalidator" != "no"; then
7934 AC_DEFINE(HAVE_BFFVALIDATOR)
7936 if test "$with_export_validation" = "no"; then
7937 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7940 if test "$with_bffvalidator" = "yes"; then
7941 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7943 BFFVALIDATOR="$with_bffvalidator"
7946 if test "$build_os" = "cygwin"; then
7947 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7948 AC_MSG_RESULT($BFFVALIDATOR)
7950 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7952 elif test -n "$BFFVALIDATOR"; then
7953 # We are not in Cygwin but need to run Windows binary with wine
7954 AC_PATH_PROGS(WINE, wine)
7956 # so swap in a shell wrapper that converts paths transparently
7957 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7958 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7959 AC_SUBST(BFFVALIDATOR_EXE)
7960 AC_MSG_RESULT($BFFVALIDATOR)
7962 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7964 AC_SUBST(BFFVALIDATOR)
7969 dnl ===================================================================
7970 dnl Check for C preprocessor to use
7971 dnl ===================================================================
7972 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7973 if test -n "$with_idlc_cpp"; then
7974 AC_MSG_RESULT([$with_idlc_cpp])
7975 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7977 AC_MSG_RESULT([ucpp])
7978 AC_MSG_CHECKING([which ucpp tp use])
7979 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7980 AC_MSG_RESULT([external])
7981 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7983 AC_MSG_RESULT([internal])
7984 BUILD_TYPE="$BUILD_TYPE UCPP"
7987 AC_SUBST(SYSTEM_UCPP)
7989 dnl ===================================================================
7990 dnl Check for epm (not needed for Windows)
7991 dnl ===================================================================
7992 AC_MSG_CHECKING([whether to enable EPM for packing])
7993 if test "$enable_epm" = "yes"; then
7994 AC_MSG_RESULT([yes])
7995 if test "$_os" != "WINNT"; then
7996 if test $_os = Darwin; then
7998 elif test -n "$with_epm"; then
8001 AC_PATH_PROG(EPM, epm, no)
8003 if test "$EPM" = "no" -o "$EPM" = "internal"; then
8004 AC_MSG_NOTICE([EPM will be built.])
8005 BUILD_TYPE="$BUILD_TYPE EPM"
8006 EPM=${WORKDIR}/UnpackedTarball/epm/epm
8008 # Gentoo has some epm which is something different...
8009 AC_MSG_CHECKING([whether the found epm is the right epm])
8010 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
8011 AC_MSG_RESULT([yes])
8013 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
8015 AC_MSG_CHECKING([epm version])
8016 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
8017 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
8018 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
8019 AC_MSG_RESULT([OK, >= 3.7])
8021 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
8022 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
8027 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
8028 AC_MSG_CHECKING([for rpm])
8029 for a in "$RPM" rpmbuild rpm; do
8030 $a --usage >/dev/null 2> /dev/null
8031 if test $? -eq 0; then
8035 $a --version >/dev/null 2> /dev/null
8036 if test $? -eq 0; then
8042 if test -z "$RPM"; then
8043 AC_MSG_ERROR([not found])
8044 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
8045 RPM_PATH=`which $RPM`
8046 AC_MSG_RESULT([$RPM_PATH])
8047 SCPDEFS="$SCPDEFS -DWITH_RPM"
8049 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
8052 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
8053 AC_PATH_PROG(DPKG, dpkg, no)
8054 if test "$DPKG" = "no"; then
8055 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
8058 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
8059 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
8060 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
8061 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
8062 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
8063 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
8064 AC_MSG_RESULT([yes])
8067 if echo "$PKGFORMAT" | $GREP -q rpm; then
8069 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
8070 add_warning "the rpms will need to be installed with --nodeps"
8074 AC_MSG_WARN([the ${_pt}s will not be relocatable])
8075 add_warning "the ${_pt}s will not be relocatable"
8076 AC_MSG_WARN([if you want to make sure installation without --nodeps and
8077 relocation will work, you need to patch your epm with the
8078 patch in epm/epm-3.7.patch or build with
8079 --with-epm=internal which will build a suitable epm])
8084 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
8085 AC_PATH_PROG(PKGMK, pkgmk, no)
8086 if test "$PKGMK" = "no"; then
8087 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
8094 for i in $PKGFORMAT; do
8096 aix | bsd | deb | pkg | rpm | native | portable)
8098 [--with-package-format='$PKGFORMAT' requires --enable-epm])
8108 if test "$enable_lotuswordpro" = "yes"; then
8111 AC_SUBST(ENABLE_LWP)
8113 dnl ===================================================================
8114 dnl Check for building ODK
8115 dnl ===================================================================
8116 if test "$enable_odk" = no; then
8119 if test "$with_doxygen" = no; then
8120 AC_MSG_CHECKING([for doxygen])
8124 if test "$with_doxygen" = yes; then
8125 AC_PATH_PROG([DOXYGEN], [doxygen])
8126 if test -z "$DOXYGEN"; then
8127 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
8129 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
8130 if ! dot -V 2>/dev/null; then
8131 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
8135 AC_MSG_CHECKING([for doxygen])
8136 DOXYGEN=$with_doxygen
8137 AC_MSG_RESULT([$DOXYGEN])
8139 if test -n "$DOXYGEN"; then
8140 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
8141 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
8142 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
8143 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
8150 AC_MSG_CHECKING([whether to build the ODK])
8151 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
8152 AC_MSG_RESULT([yes])
8154 if test "$with_java" != "no"; then
8155 AC_MSG_CHECKING([whether to build unowinreg.dll])
8156 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
8157 # build on Win by default
8158 enable_build_unowinreg=yes
8160 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
8164 AC_MSG_RESULT([yes])
8165 BUILD_UNOWINREG=TRUE
8167 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
8168 if test -z "$with_mingw_cross_compiler"; then
8170 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
8171 elif test -x "$with_mingw_cross_compiler"; then
8172 MINGWCXX="$with_mingw_cross_compiler"
8174 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
8177 if test "$MINGWCXX" = "false"; then
8178 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
8181 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
8182 if test -x "$mingwstrip_test"; then
8183 MINGWSTRIP="$mingwstrip_test"
8185 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
8188 if test "$MINGWSTRIP" = "false"; then
8189 AC_MSG_ERROR(MinGW32 binutils not found.)
8193 BUILD_TYPE="$BUILD_TYPE ODK"
8198 AC_SUBST(BUILD_UNOWINREG)
8200 AC_SUBST(MINGWSTRIP)
8202 dnl ===================================================================
8203 dnl Check for system zlib
8204 dnl ===================================================================
8205 if test "$with_system_zlib" = "auto"; then
8208 with_system_zlib="$with_system_libs"
8211 if test "$enable_fuzzers" != "yes"; then
8212 with_system_zlib=yes
8220 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
8221 dnl and has no pkg-config for it at least on some tinderboxes,
8222 dnl so leaving that out for now
8223 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
8224 AC_MSG_CHECKING([which zlib to use])
8225 if test "$with_system_zlib" = "yes"; then
8226 AC_MSG_RESULT([external])
8228 AC_CHECK_HEADER(zlib.h, [],
8229 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
8230 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
8231 [AC_MSG_ERROR(zlib not found or functional)], [])
8233 AC_MSG_RESULT([internal])
8235 BUILD_TYPE="$BUILD_TYPE ZLIB"
8236 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
8237 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
8239 AC_SUBST(ZLIB_CFLAGS)
8241 AC_SUBST(SYSTEM_ZLIB)
8243 dnl ===================================================================
8244 dnl Check for system jpeg
8245 dnl ===================================================================
8246 AC_MSG_CHECKING([which libjpeg to use])
8247 if test "$with_system_jpeg" = "yes"; then
8248 AC_MSG_RESULT([external])
8250 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
8251 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
8252 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
8253 [AC_MSG_ERROR(jpeg library not found or functional)], [])
8256 AC_MSG_RESULT([internal, libjpeg-turbo])
8257 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
8258 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
8259 if test "$COM" = "MSC"; then
8260 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
8262 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
8266 x86_64 | amd64 | i*86 | x86 | ia32)
8267 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
8268 if test -z "$NASM" -a "$build_os" = "cygwin"; then
8269 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
8270 NASM="$LODE_HOME/opt/bin/nasm"
8271 elif test -x "/opt/lo/bin/nasm"; then
8272 NASM="/opt/lo/bin/nasm"
8276 if test -n "$NASM"; then
8277 AC_MSG_CHECKING([for object file format of host system])
8279 cygwin* | mingw* | pw32* | interix*)
8289 msdosdjgpp* | go32*)
8292 os2-emx*) # not tested
8293 objfmt='MSOMF' # obj
8295 linux*coff* | linux*oldld*)
8311 kfreebsd* | freebsd* | netbsd* | openbsd*)
8312 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8325 solaris* | sunos* | sysv* | sco*)
8335 darwin* | rhapsody* | nextstep* | openstep* | macos*)
8350 AC_MSG_RESULT([$objfmt])
8351 if test "$objfmt" = 'ELF ?'; then
8353 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
8356 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
8358 MSOMF) NAFLAGS='-fobj -DOBJ32';;
8359 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
8360 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
8361 COFF) NAFLAGS='-fcoff -DCOFF';;
8362 a.out) NAFLAGS='-faout -DAOUT';;
8363 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
8364 ELF) NAFLAGS='-felf -DELF';;
8365 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
8366 RDF) NAFLAGS='-frdf -DRDF';;
8367 Mach-O) NAFLAGS='-fmacho -DMACHO';;
8368 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
8370 AC_MSG_RESULT([$NAFLAGS])
8372 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
8373 cat > conftest.asm << EOF
8374 [%line __oline__ "configure"
8382 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
8383 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
8386 echo "configure: failed program was:" >&AC_FD_CC
8387 cat conftest.asm >&AC_FD_CC
8390 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
8396 if test -z "$NASM"; then
8398 ****************************************************************************
8399 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
8403 if test "$build_os" = "cygwin"; then
8405 install a pre-compiled binary for Win32
8407 mkdir -p /opt/lo/bin
8409 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
8412 or get and install one from http://www.nasm.us/
8414 Then re-run autogen.sh
8416 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
8417 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
8422 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
8426 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
8427 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
8434 AC_SUBST(LIBJPEG_CFLAGS)
8435 AC_SUBST(LIBJPEG_LIBS)
8436 AC_SUBST(SYSTEM_LIBJPEG)
8438 dnl ===================================================================
8439 dnl Check for system clucene
8440 dnl ===================================================================
8441 dnl we should rather be using
8442 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
8443 dnl but the contribs-lib check seems tricky
8444 AC_MSG_CHECKING([which clucene to use])
8445 if test "$with_system_clucene" = "yes"; then
8446 AC_MSG_RESULT([external])
8448 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
8449 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
8450 FilterLibs "${CLUCENE_LIBS}"
8451 CLUCENE_LIBS="${filteredlibs}"
8453 save_CXXFLAGS=$CXXFLAGS
8454 save_CPPFLAGS=$CPPFLAGS
8455 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
8456 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
8457 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
8458 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
8459 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
8460 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
8461 CXXFLAGS=$save_CXXFLAGS
8462 CPPFLAGS=$save_CPPFLAGS
8465 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
8467 AC_MSG_RESULT([internal])
8469 BUILD_TYPE="$BUILD_TYPE CLUCENE"
8471 AC_SUBST(SYSTEM_CLUCENE)
8472 AC_SUBST(CLUCENE_CFLAGS)
8473 AC_SUBST(CLUCENE_LIBS)
8475 dnl ===================================================================
8476 dnl Check for system expat
8477 dnl ===================================================================
8478 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
8480 dnl ===================================================================
8481 dnl Check for system xmlsec
8482 dnl ===================================================================
8483 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.28])
8485 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
8486 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
8488 AC_DEFINE([ENABLE_EOT])
8489 AC_MSG_RESULT([yes])
8491 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
8496 AC_SUBST([ENABLE_EOT])
8498 dnl ===================================================================
8499 dnl Check for DLP libs
8500 dnl ===================================================================
8501 AS_IF([test "$COM" = "MSC"],
8502 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
8503 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
8505 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
8507 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
8509 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
8511 AS_IF([test "$COM" = "MSC"],
8512 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
8513 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
8515 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
8517 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
8519 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
8520 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
8522 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
8524 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
8526 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
8528 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
8529 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.15])
8531 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
8532 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
8534 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
8536 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
8537 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
8539 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
8541 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
8543 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
8545 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
8547 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
8548 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
8550 dnl ===================================================================
8551 dnl Check for system lcms2
8552 dnl ===================================================================
8553 if test "$with_system_lcms2" != "yes"; then
8556 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
8557 if test "$GCC" = "yes"; then
8558 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
8560 if test "$COM" = "MSC"; then # override the above
8561 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
8564 dnl ===================================================================
8565 dnl Check for system cppunit
8566 dnl ===================================================================
8567 if test "$_os" != "Android" ; then
8568 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
8571 dnl ===================================================================
8572 dnl Check whether freetype is available
8573 dnl ===================================================================
8574 if test "$test_freetype" = "yes"; then
8575 AC_MSG_CHECKING([whether freetype is available])
8576 # FreeType has 3 different kinds of versions
8577 # * release, like 2.4.10
8578 # * libtool, like 13.0.7 (this what pkg-config returns)
8580 # FreeType's docs/VERSION.DLL provides a table mapping between the three
8583 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
8584 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8585 FilterLibs "${FREETYPE_LIBS}"
8586 FREETYPE_LIBS="${filteredlibs}"
8587 SYSTEM_FREETYPE=TRUE
8589 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
8590 if test "x$ac_config_site_64bit_host" = xYES; then
8591 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib64 -lfreetype"
8593 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
8596 AC_SUBST(FREETYPE_CFLAGS)
8597 AC_SUBST(FREETYPE_LIBS)
8598 AC_SUBST([SYSTEM_FREETYPE])
8600 # ===================================================================
8601 # Check for system libxslt
8602 # to prevent incompatibilities between internal libxml2 and external libxslt,
8603 # or vice versa, use with_system_libxml here
8604 # ===================================================================
8605 if test "$with_system_libxml" = "auto"; then
8608 with_system_libxml="$with_system_libs"
8611 if test "$enable_fuzzers" != "yes"; then
8612 with_system_libxml=yes
8614 with_system_libxml=no
8620 AC_MSG_CHECKING([which libxslt to use])
8621 if test "$with_system_libxml" = "yes"; then
8622 AC_MSG_RESULT([external])
8624 if test "$_os" = "Darwin"; then
8625 dnl make sure to use SDK path
8626 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8627 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8629 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8630 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8632 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8633 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8634 FilterLibs "${LIBXSLT_LIBS}"
8635 LIBXSLT_LIBS="${filteredlibs}"
8636 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8637 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8638 FilterLibs "${LIBEXSLT_LIBS}"
8639 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8642 dnl Check for xsltproc
8643 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8644 if test "$XSLTPROC" = "no"; then
8645 AC_MSG_ERROR([xsltproc is required])
8648 AC_MSG_RESULT([internal])
8650 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8652 if test "$cross_compiling" = "yes"; then
8653 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8654 if test "$XSLTPROC" = "no"; then
8655 AC_MSG_ERROR([xsltproc is required])
8659 AC_SUBST(SYSTEM_LIBXSLT)
8660 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8661 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8663 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8665 AC_SUBST(LIBEXSLT_CFLAGS)
8666 AC_SUBST(LIBEXSLT_LIBS)
8667 AC_SUBST(LIBXSLT_CFLAGS)
8668 AC_SUBST(LIBXSLT_LIBS)
8671 # ===================================================================
8672 # Check for system libxml
8673 # ===================================================================
8674 AC_MSG_CHECKING([which libxml to use])
8675 if test "$with_system_libxml" = "yes"; then
8676 AC_MSG_RESULT([external])
8678 if test "$_os" = "Darwin"; then
8679 dnl make sure to use SDK path
8680 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8682 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8683 elif test $_os = iOS; then
8684 dnl make sure to use SDK path
8685 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8686 LIBXML_CFLAGS="-I$usr/include/libxml2"
8687 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8689 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8690 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8691 FilterLibs "${LIBXML_LIBS}"
8692 LIBXML_LIBS="${filteredlibs}"
8695 dnl Check for xmllint
8696 AC_PATH_PROG(XMLLINT, xmllint, no)
8697 if test "$XMLLINT" = "no"; then
8698 AC_MSG_ERROR([xmllint is required])
8701 AC_MSG_RESULT([internal])
8703 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8704 if test "$COM" = "MSC"; then
8705 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8707 if test "$COM" = "MSC"; then
8708 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8710 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8712 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8714 AC_SUBST(SYSTEM_LIBXML)
8715 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8716 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8718 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8719 AC_SUBST(LIBXML_CFLAGS)
8720 AC_SUBST(LIBXML_LIBS)
8723 # =====================================================================
8724 # Checking for a Python interpreter with version >= 2.7.
8725 # Build and runtime requires Python 3 compatible version (>= 2.7).
8726 # Optionally user can pass an option to configure, i. e.
8727 # ./configure PYTHON=/usr/bin/python
8728 # =====================================================================
8729 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8730 if test -n "$PYTHON"; then
8731 PYTHON_FOR_BUILD=$PYTHON
8733 # This allows a lack of system python with no error, we use internal one in that case.
8734 AM_PATH_PYTHON([2.7],, [:])
8735 # Clean PYTHON_VERSION checked below if cross-compiling
8737 if test "$PYTHON" != ":"; then
8738 PYTHON_FOR_BUILD=$PYTHON
8742 AC_SUBST(PYTHON_FOR_BUILD)
8744 # Checks for Python to use for Pyuno
8745 AC_MSG_CHECKING([which Python to use for Pyuno])
8746 case "$enable_python" in
8748 if test -z $PYTHON_FOR_BUILD; then
8749 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8750 # requirement from the choice whether to include Python stuff in the installer, but why
8752 AC_MSG_ERROR([Python is required at build time.])
8755 AC_MSG_RESULT([none])
8758 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8759 AC_MSG_RESULT([no, overridden by --disable-scripting])
8761 elif test $build_os = cygwin; then
8762 dnl When building on Windows we don't attempt to use any installed
8763 dnl "system" Python.
8764 AC_MSG_RESULT([fully internal])
8765 enable_python=internal
8766 elif test "$cross_compiling" = yes; then
8767 AC_MSG_RESULT([system])
8768 enable_python=system
8770 # Unset variables set by the above AM_PATH_PYTHON so that
8771 # we actually do check anew.
8773 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
8774 AM_PATH_PYTHON([3.3],, [:])
8775 AC_MSG_CHECKING([which Python to use for Pyuno])
8776 if test "$PYTHON" = ":"; then
8777 if test -z "$PYTHON_FOR_BUILD"; then
8778 AC_MSG_RESULT([fully internal])
8780 AC_MSG_RESULT([internal])
8782 enable_python=internal
8784 AC_MSG_RESULT([system])
8785 enable_python=system
8790 AC_MSG_RESULT([internal])
8793 AC_MSG_RESULT([fully internal])
8794 enable_python=internal
8797 AC_MSG_RESULT([system])
8798 if test "$_os" = Darwin; then
8799 AC_MSG_ERROR([--enable-python=system doesn't work on macOS: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h is known to contain uses of "register", which is removed from C++17])
8803 AC_MSG_ERROR([Incorrect --enable-python option])
8807 if test $enable_python != no; then
8808 BUILD_TYPE="$BUILD_TYPE PYUNO"
8811 if test $enable_python = system; then
8812 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8813 # Fallback: Accept these in the environment, or as set above
8816 elif test "$cross_compiling" != yes; then
8817 # Unset variables set by the above AM_PATH_PYTHON so that
8818 # we actually do check anew.
8819 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
8820 # This causes an error if no python command is found
8821 AM_PATH_PYTHON([3.3])
8822 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8823 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8824 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8825 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8826 if test -z "$PKG_CONFIG"; then
8827 PYTHON_CFLAGS="-I$python_include"
8828 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8829 elif $PKG_CONFIG --exists python-$python_version-embed; then
8830 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
8831 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
8832 elif $PKG_CONFIG --exists python-$python_version; then
8833 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8834 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8836 PYTHON_CFLAGS="-I$python_include"
8837 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8839 FilterLibs "${PYTHON_LIBS}"
8840 PYTHON_LIBS="${filteredlibs}"
8842 dnl How to find out the cross-compilation Python installation path?
8843 AC_MSG_CHECKING([for python version])
8844 AS_IF([test -n "$PYTHON_VERSION"],
8845 [AC_MSG_RESULT([$PYTHON_VERSION])],
8846 [AC_MSG_RESULT([not found])
8847 AC_MSG_ERROR([no usable python found])])
8848 test -n "$PYTHON_CFLAGS" && break
8851 dnl Check if the headers really work
8852 save_CPPFLAGS="$CPPFLAGS"
8853 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8854 AC_CHECK_HEADER(Python.h)
8855 CPPFLAGS="$save_CPPFLAGS"
8857 # let the PYTHON_FOR_BUILD match the same python installation that
8858 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8859 # better for PythonTests.
8860 PYTHON_FOR_BUILD=$PYTHON
8863 if test "$with_lxml" != no; then
8864 if test -z "$PYTHON_FOR_BUILD"; then
8867 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8870 if test "$cross_compiling" != yes ; then
8871 BUILD_TYPE="$BUILD_TYPE LXML"
8876 AC_MSG_CHECKING([for python lxml])
8877 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8878 AC_MSG_RESULT([yes])
8882 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8885 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8886 BUILD_TYPE="$BUILD_TYPE LXML"
8887 AC_MSG_RESULT([no, using internal lxml])
8889 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8897 dnl By now enable_python should be "system", "internal" or "no"
8898 case $enable_python in
8902 if test "x$ac_cv_header_Python_h" != "xyes"; then
8903 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8907 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8908 AC_MSG_CHECKING([for correct python library version])
8909 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8912 int main(int argc, char **argv) {
8913 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
8914 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8917 ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.7 when building with Python 2])],[AC_MSG_RESULT([skipped; cross-compiling])])
8921 dnl FIXME Check if the Python library can be linked with, too?
8926 PYTHON_VERSION_MAJOR=3
8927 PYTHON_VERSION_MINOR=5
8928 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.9
8929 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
8930 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
8932 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8933 BUILD_TYPE="$BUILD_TYPE PYTHON"
8934 # Embedded Python dies without Home set
8935 if test "$HOME" = ""; then
8944 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8948 AC_SUBST(DISABLE_PYTHON)
8949 AC_SUBST(SYSTEM_PYTHON)
8950 AC_SUBST(PYTHON_CFLAGS)
8951 AC_SUBST(PYTHON_LIBS)
8952 AC_SUBST(PYTHON_VERSION)
8953 AC_SUBST(PYTHON_VERSION_MAJOR)
8954 AC_SUBST(PYTHON_VERSION_MINOR)
8956 ENABLE_MARIADBC=TRUE
8957 if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then
8963 if test "$ENABLE_MARIADBC" = "TRUE"; then
8964 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8967 AC_SUBST(ENABLE_MARIADBC)
8968 AC_SUBST(MARIADBC_MAJOR)
8969 AC_SUBST(MARIADBC_MINOR)
8970 AC_SUBST(MARIADBC_MICRO)
8972 if test "$ENABLE_MARIADBC" = "TRUE"; then
8973 dnl ===================================================================
8974 dnl Check for system MariaDB
8975 dnl ===================================================================
8976 AC_MSG_CHECKING([which MariaDB to use])
8977 if test "$with_system_mariadb" = "yes"; then
8978 AC_MSG_RESULT([external])
8979 SYSTEM_MARIADB_CONNECTOR_C=TRUE
8980 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8981 if test -z "$MARIADBCONFIG"; then
8982 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8983 if test -z "$MARIADBCONFIG"; then
8984 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8985 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8988 AC_MSG_CHECKING([MariaDB version])
8989 MARIADB_VERSION=`$MARIADBCONFIG --version`
8990 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8991 if test "$MARIADB_MAJOR" -ge "5"; then
8994 AC_MSG_ERROR([too old, use 5.0.x or later])
8996 AC_MSG_CHECKING([for MariaDB Client library])
8997 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8998 if test "$COM_IS_CLANG" = TRUE; then
8999 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
9001 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
9002 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
9003 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
9005 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
9006 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
9007 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
9008 | sed -e 's|/lib64/|/lib/|')
9010 FilterLibs "${MARIADB_LIBS}"
9011 MARIADB_LIBS="${filteredlibs}"
9012 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
9013 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
9014 if test "$enable_bundle_mariadb" = "yes"; then
9015 AC_MSG_RESULT([yes])
9016 BUNDLE_MARIADB_CONNECTOR_C=TRUE
9017 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
9019 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
9021 /g' | grep -E '(mysqlclient|mariadb)')
9022 if test "$_os" = "Darwin"; then
9023 LIBMARIADB=${LIBMARIADB}.dylib
9024 elif test "$_os" = "WINNT"; then
9025 LIBMARIADB=${LIBMARIADB}.dll
9027 LIBMARIADB=${LIBMARIADB}.so
9029 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
9030 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
9031 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
9032 AC_MSG_RESULT([found.])
9033 PathFormat "$LIBMARIADB_PATH"
9034 LIBMARIADB_PATH="$formatted_path"
9036 AC_MSG_ERROR([not found.])
9040 BUNDLE_MARIADB_CONNECTOR_C=
9043 AC_MSG_RESULT([internal])
9044 SYSTEM_MARIADB_CONNECTOR_C=
9045 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
9046 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
9047 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
9050 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
9051 AC_SUBST(MARIADB_CFLAGS)
9052 AC_SUBST(MARIADB_LIBS)
9053 AC_SUBST(LIBMARIADB)
9054 AC_SUBST(LIBMARIADB_PATH)
9055 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
9058 dnl ===================================================================
9059 dnl Check for system hsqldb
9060 dnl ===================================================================
9061 if test "$with_java" != "no"; then
9062 HSQLDB_USE_JDBC_4_1=
9063 AC_MSG_CHECKING([which hsqldb to use])
9064 if test "$with_system_hsqldb" = "yes"; then
9065 AC_MSG_RESULT([external])
9067 if test -z $HSQLDB_JAR; then
9068 HSQLDB_JAR=/usr/share/java/hsqldb.jar
9070 if ! test -f $HSQLDB_JAR; then
9071 AC_MSG_ERROR(hsqldb.jar not found.)
9073 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
9077 my $file = "$ENV{'HSQLDB_JAR'}";
9078 my $zip = Archive::Zip->new( $file );
9079 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
9080 if ( $mf =~ m/Specification-Version: 1.8.*/ )
9082 push @l, split(/\n/, $mf);
9083 foreach my $line (@l)
9085 if ($line =~ m/Specification-Version:/)
9087 ($t, $version) = split (/:/,$line);
9088 $version =~ s/^\s//;
9089 ($a, $b, $c, $d) = split (/\./,$version);
9090 if ($c == "0" && $d > "8")
9105 AC_MSG_RESULT([yes])
9107 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
9110 AC_MSG_RESULT([internal])
9112 BUILD_TYPE="$BUILD_TYPE HSQLDB"
9114 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
9115 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
9116 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
9117 AC_MSG_RESULT([yes])
9118 HSQLDB_USE_JDBC_4_1=TRUE
9123 AC_SUBST(SYSTEM_HSQLDB)
9124 AC_SUBST(HSQLDB_JAR)
9125 AC_SUBST([HSQLDB_USE_JDBC_4_1])
9128 dnl ===================================================================
9129 dnl Check for PostgreSQL stuff
9130 dnl ===================================================================
9131 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
9132 if test "x$enable_postgresql_sdbc" != "xno"; then
9133 AC_MSG_RESULT([yes])
9134 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
9136 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
9137 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
9139 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
9140 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
9143 postgres_interface=""
9144 if test "$with_system_postgresql" = "yes"; then
9145 postgres_interface="external PostgreSQL"
9146 SYSTEM_POSTGRESQL=TRUE
9147 if test "$_os" = Darwin; then
9149 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
9150 pg_supp_path="$P_SEP$d$pg_supp_path"
9153 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
9154 if test -n "$PGCONFIG"; then
9155 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
9156 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
9158 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
9159 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
9160 POSTGRESQL_LIB=$POSTGRESQL_LIBS
9162 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
9165 FilterLibs "${POSTGRESQL_LIB}"
9166 POSTGRESQL_LIB="${filteredlibs}"
9168 # if/when anything else than PostgreSQL uses Kerberos,
9169 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
9174 # macOS has system MIT Kerberos 5 since 10.4
9175 if test "$with_krb5" != "no"; then
9178 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
9179 # that the libraries where these functions are located on macOS will change, is it?
9180 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9181 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9184 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9185 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9186 KRB5_LIBS="$KRB5_LIBS $LIBS"
9189 if test "$with_gssapi" != "no"; then
9192 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9193 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9199 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
9200 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
9203 Linux|GNU|*BSD|DragonFly)
9204 if test "$with_krb5" != "no"; then
9207 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9208 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9211 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9212 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9213 KRB5_LIBS="$KRB5_LIBS $LIBS"
9216 if test "$with_gssapi" != "no"; then
9219 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9220 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9226 if test "$with_krb5" = "yes"; then
9229 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9230 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
9233 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
9234 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
9235 KRB5_LIBS="$KRB5_LIBS $LIBS"
9238 if test "$with_gssapi" = "yes"; then
9241 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
9242 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
9248 if test -n "$with_libpq_path"; then
9249 SYSTEM_POSTGRESQL=TRUE
9250 postgres_interface="external libpq"
9251 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
9252 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
9255 postgres_interface="internal"
9257 POSTGRESQL_INC="%OVERRIDE_ME%"
9258 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
9262 AC_MSG_CHECKING([PostgreSQL C interface])
9263 AC_MSG_RESULT([$postgres_interface])
9265 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
9266 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
9268 save_CPPFLAGS=$CPPFLAGS
9270 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
9271 LIBS="${LIBS} ${POSTGRESQL_LIB}"
9272 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
9273 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
9274 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
9276 CPPFLAGS=$save_CPPFLAGS
9279 BUILD_POSTGRESQL_SDBC=TRUE
9284 AC_SUBST(WITH_GSSAPI)
9285 AC_SUBST(GSSAPI_LIBS)
9287 AC_SUBST(BUILD_POSTGRESQL_SDBC)
9288 AC_SUBST(SYSTEM_POSTGRESQL)
9289 AC_SUBST(POSTGRESQL_INC)
9290 AC_SUBST(POSTGRESQL_LIB)
9292 dnl ===================================================================
9293 dnl Check for Firebird stuff
9294 dnl ===================================================================
9295 ENABLE_FIREBIRD_SDBC=
9296 if test "$enable_firebird_sdbc" = "yes" ; then
9297 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
9299 dnl ===================================================================
9300 dnl Check for system Firebird
9301 dnl ===================================================================
9302 AC_MSG_CHECKING([which Firebird to use])
9303 if test "$with_system_firebird" = "yes"; then
9304 AC_MSG_RESULT([external])
9305 SYSTEM_FIREBIRD=TRUE
9306 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
9307 if test -z "$FIREBIRDCONFIG"; then
9308 AC_MSG_NOTICE([No fb_config -- using pkg-config])
9309 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
9310 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
9312 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
9314 AC_MSG_NOTICE([fb_config found])
9315 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
9316 AC_MSG_CHECKING([for Firebird Client library])
9317 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
9318 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
9319 FilterLibs "${FIREBIRD_LIBS}"
9320 FIREBIRD_LIBS="${filteredlibs}"
9322 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
9323 AC_MSG_CHECKING([Firebird version])
9324 if test -n "${FIREBIRD_VERSION}"; then
9325 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
9326 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
9327 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
9330 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
9333 __save_CFLAGS="${CFLAGS}"
9334 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
9335 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
9336 #if defined(FB_API_VER) && FB_API_VER == 30
9337 int fb_api_is_30(void) { return 0; }
9339 #error "Wrong Firebird API version"
9340 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
9341 CFLAGS="${__save_CFLAGS}"
9343 ENABLE_FIREBIRD_SDBC=TRUE
9344 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9345 elif test "$enable_database_connectivity" != yes; then
9346 AC_MSG_RESULT([none])
9347 elif test "$cross_compiling" = "yes"; then
9348 AC_MSG_RESULT([none])
9350 dnl Embedded Firebird has version 3.0
9351 AC_DEFINE(HAVE_FIREBIRD_30, 1)
9352 dnl We need libatomic_ops for any non X86/X64 system
9353 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
9354 dnl ===================================================================
9355 dnl Check for system libatomic_ops
9356 dnl ===================================================================
9357 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
9358 if test "$with_system_libatomic_ops" = "yes"; then
9359 SYSTEM_LIBATOMIC_OPS=TRUE
9360 AC_CHECK_HEADERS(atomic_ops.h, [],
9361 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
9363 SYSTEM_LIBATOMIC_OPS=
9364 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
9365 LIBATOMIC_OPS_LIBS="-latomic_ops"
9366 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
9370 AC_MSG_RESULT([internal])
9372 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
9373 FIREBIRD_LIBS="-lfbclient"
9375 if test "$with_system_libtommath" = "yes"; then
9376 SYSTEM_LIBTOMMATH=TRUE
9377 dnl check for tommath presence
9379 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
9380 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
9384 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
9385 LIBTOMMATH_LIBS="-ltommath"
9386 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
9389 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
9390 ENABLE_FIREBIRD_SDBC=TRUE
9391 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9394 AC_SUBST(ENABLE_FIREBIRD_SDBC)
9395 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
9396 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
9397 AC_SUBST(LIBATOMIC_OPS_LIBS)
9398 AC_SUBST(SYSTEM_FIREBIRD)
9399 AC_SUBST(FIREBIRD_CFLAGS)
9400 AC_SUBST(FIREBIRD_LIBS)
9401 AC_SUBST([TOMMATH_CFLAGS])
9402 AC_SUBST([TOMMATH_LIBS])
9404 dnl ===================================================================
9405 dnl Check for system curl
9406 dnl ===================================================================
9407 AC_MSG_CHECKING([which libcurl to use])
9408 if test "$with_system_curl" = "auto"; then
9409 with_system_curl="$with_system_libs"
9412 if test "$with_system_curl" = "yes"; then
9413 AC_MSG_RESULT([external])
9416 # First try PKGCONFIG and then fall back
9417 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
9419 if test -n "$CURL_PKG_ERRORS"; then
9420 AC_PATH_PROG(CURLCONFIG, curl-config)
9421 if test -z "$CURLCONFIG"; then
9422 AC_MSG_ERROR([curl development files not found])
9424 CURL_LIBS=`$CURLCONFIG --libs`
9425 FilterLibs "${CURL_LIBS}"
9426 CURL_LIBS="${filteredlibs}"
9427 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
9428 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
9430 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
9431 case $curl_version in
9432 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
9433 dnl so they need to be doubled to end up in the configure script
9434 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
9435 AC_MSG_RESULT([yes])
9438 AC_MSG_ERROR([no, you have $curl_version])
9444 elif test $_os = iOS; then
9445 # Let's see if we need curl, I think not?
9446 AC_MSG_RESULT([none])
9449 AC_MSG_RESULT([internal])
9451 BUILD_TYPE="$BUILD_TYPE CURL"
9454 AC_SUBST(SYSTEM_CURL)
9455 AC_SUBST(CURL_CFLAGS)
9457 AC_SUBST(ENABLE_CURL)
9459 dnl ===================================================================
9460 dnl Check for system boost
9461 dnl ===================================================================
9462 AC_MSG_CHECKING([which boost to use])
9463 if test "$with_system_boost" = "yes"; then
9464 AC_MSG_RESULT([external])
9472 save_CXXFLAGS=$CXXFLAGS
9473 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
9474 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
9475 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
9476 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
9477 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
9478 CXXFLAGS=$save_CXXFLAGS
9480 # this is in m4/ax_boost_base.m4
9481 FilterLibs "${BOOST_LDFLAGS}"
9482 BOOST_LDFLAGS="${filteredlibs}"
9484 AC_MSG_RESULT([internal])
9485 BUILD_TYPE="$BUILD_TYPE BOOST"
9487 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
9488 # use warning-suppressing wrapper headers
9489 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
9491 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
9494 AC_SUBST(SYSTEM_BOOST)
9496 dnl ===================================================================
9497 dnl Check for system mdds
9498 dnl ===================================================================
9499 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.5 >= 1.5.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
9501 dnl ===================================================================
9502 dnl Check for system glm
9503 dnl ===================================================================
9504 AC_MSG_CHECKING([which glm to use])
9505 if test "$with_system_glm" = "yes"; then
9506 AC_MSG_RESULT([external])
9509 AC_CHECK_HEADER([glm/glm.hpp], [],
9510 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
9513 AC_MSG_RESULT([internal])
9514 BUILD_TYPE="$BUILD_TYPE GLM"
9516 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
9518 AC_SUBST([GLM_CFLAGS])
9519 AC_SUBST([SYSTEM_GLM])
9521 dnl ===================================================================
9522 dnl Check for system odbc
9523 dnl ===================================================================
9524 AC_MSG_CHECKING([which odbc headers to use])
9525 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
9526 AC_MSG_RESULT([external])
9527 SYSTEM_ODBC_HEADERS=TRUE
9529 if test "$build_os" = "cygwin"; then
9530 save_CPPFLAGS=$CPPFLAGS
9532 PathFormat "$winsdktest"
9533 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"
9534 AC_CHECK_HEADER(sqlext.h, [],
9535 [AC_MSG_ERROR(odbc not found. install odbc)],
9536 [#include <windows.h>])
9537 CPPFLAGS=$save_CPPFLAGS
9539 AC_CHECK_HEADER(sqlext.h, [],
9540 [AC_MSG_ERROR(odbc not found. install odbc)],[])
9542 elif test "$enable_database_connectivity" != yes; then
9543 AC_MSG_RESULT([none])
9545 AC_MSG_RESULT([internal])
9546 SYSTEM_ODBC_HEADERS=
9548 AC_SUBST(SYSTEM_ODBC_HEADERS)
9550 dnl ===================================================================
9551 dnl Enable LDAP support
9552 dnl ===================================================================
9554 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
9555 AC_MSG_CHECKING([whether to enable LDAP support])
9556 if test "$enable_ldap" != "yes"; then
9561 AC_MSG_RESULT([yes])
9563 AC_DEFINE(HAVE_FEATURE_LDAP)
9566 AC_SUBST(ENABLE_LDAP)
9568 dnl ===================================================================
9569 dnl Check for system openldap
9570 dnl ===================================================================
9572 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android" -a "$ENABLE_LDAP" != ""; then
9573 AC_MSG_CHECKING([which openldap library to use])
9574 if test "$with_system_openldap" = "yes"; then
9575 AC_MSG_RESULT([external])
9576 SYSTEM_OPENLDAP=TRUE
9577 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
9578 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9579 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9581 AC_MSG_RESULT([internal])
9583 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
9586 AC_SUBST(SYSTEM_OPENLDAP)
9588 dnl ===================================================================
9589 dnl Check for system NSS
9590 dnl ===================================================================
9591 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
9592 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
9593 AC_DEFINE(HAVE_FEATURE_NSS)
9595 AC_DEFINE(ENABLE_NSS)
9596 elif test $_os != iOS ; then
9599 AC_SUBST(ENABLE_NSS)
9601 dnl ===================================================================
9602 dnl Check for TLS/SSL and cryptographic implementation to use
9603 dnl ===================================================================
9604 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
9605 if test -n "$with_tls"; then
9608 AC_DEFINE(USE_TLS_OPENSSL)
9611 if test "$enable_openssl" != "yes"; then
9612 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9615 # warn that OpenSSL has been selected but not all TLS code has this option
9616 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
9617 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
9620 AC_DEFINE(USE_TLS_NSS)
9624 AC_MSG_WARN([Skipping TLS/SSL])
9627 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9629 nss - Mozilla's Network Security Services (NSS)
9634 # default to using NSS, it results in smaller oox lib
9635 AC_DEFINE(USE_TLS_NSS)
9638 AC_MSG_RESULT([$TLS])
9641 dnl ===================================================================
9642 dnl Check for system sane
9643 dnl ===================================================================
9644 AC_MSG_CHECKING([which sane header to use])
9645 if test "$with_system_sane" = "yes"; then
9646 AC_MSG_RESULT([external])
9647 AC_CHECK_HEADER(sane/sane.h, [],
9648 [AC_MSG_ERROR(sane not found. install sane)], [])
9650 AC_MSG_RESULT([internal])
9651 BUILD_TYPE="$BUILD_TYPE SANE"
9654 dnl ===================================================================
9655 dnl Check for system icu
9656 dnl ===================================================================
9663 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9664 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9665 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9666 AC_MSG_CHECKING([which icu to use])
9667 if test "$with_system_icu" = "yes"; then
9668 AC_MSG_RESULT([external])
9671 AC_MSG_CHECKING([for unicode/rbbi.h])
9672 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([icu headers not found])])
9675 if test "$cross_compiling" != "yes"; then
9676 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9677 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9678 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9679 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9682 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9683 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9684 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9685 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9686 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9687 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9688 AC_MSG_RESULT([yes])
9691 if test "$with_system_icu_for_build" != "force"; then
9692 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9693 You can use --with-system-icu-for-build=force to use it anyway.])
9698 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9699 # using the system icu tools can lead to version confusion, use the
9700 # ones from the build environment when cross-compiling
9701 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9702 if test -z "$SYSTEM_GENBRK"; then
9703 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9705 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9706 if test -z "$SYSTEM_GENCCODE"; then
9707 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9709 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9710 if test -z "$SYSTEM_GENCMN"; then
9711 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9713 if test "$ICU_MAJOR" -ge "49"; then
9714 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9715 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9716 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9718 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9719 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9720 ICU_RECLASSIFIED_HEBREW_LETTER=
9724 if test "$cross_compiling" = "yes"; then
9725 if test "$ICU_MAJOR" -ge "50"; then
9726 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9731 AC_MSG_RESULT([internal])
9733 BUILD_TYPE="$BUILD_TYPE ICU"
9734 # surprisingly set these only for "internal" (to be used by various other
9735 # external libs): the system icu-config is quite unhelpful and spits out
9736 # dozens of weird flags and also default path -I/usr/include
9737 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9738 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9740 if test "$ICU_MAJOR" -ge "59"; then
9741 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9742 # with -std=c++11 but not all external libraries can be built with that,
9743 # for those use a bit-compatible typedef uint16_t UChar; see
9744 # icu/source/common/unicode/umachine.h
9745 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9749 AC_SUBST(SYSTEM_ICU)
9750 AC_SUBST(SYSTEM_GENBRK)
9751 AC_SUBST(SYSTEM_GENCCODE)
9752 AC_SUBST(SYSTEM_GENCMN)
9755 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9756 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9757 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9758 AC_SUBST(ICU_CFLAGS)
9760 AC_SUBST(ICU_UCHAR_TYPE)
9762 dnl ==================================================================
9764 dnl ==================================================================
9765 DEFAULT_CRASHDUMP_VALUE="true"
9766 AC_MSG_CHECKING([whether to enable breakpad])
9767 if test "$enable_breakpad" != yes; then
9770 AC_MSG_RESULT([yes])
9771 ENABLE_BREAKPAD="TRUE"
9772 AC_DEFINE(ENABLE_BREAKPAD)
9773 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9774 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9776 AC_MSG_CHECKING([for disable crash dump])
9777 if test "$enable_crashdump" = no; then
9778 DEFAULT_CRASHDUMP_VALUE="false"
9779 AC_MSG_RESULT([yes])
9784 AC_MSG_CHECKING([for crashreport config])
9785 if test "$with_symbol_config" = "no"; then
9786 BREAKPAD_SYMBOL_CONFIG="invalid"
9789 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9790 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9791 AC_MSG_RESULT([yes])
9793 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9795 AC_SUBST(ENABLE_BREAKPAD)
9796 AC_SUBST(DEFAULT_CRASHDUMP_VALUE)
9798 dnl ==================================================================
9800 dnl ==================================================================
9801 AC_MSG_CHECKING([whether to enable fuzzers])
9802 if test "$enable_fuzzers" != yes; then
9805 AC_MSG_RESULT([yes])
9806 ENABLE_FUZZERS="TRUE"
9807 AC_DEFINE([ENABLE_FUZZERS],1)
9808 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9810 AC_SUBST(ENABLE_FUZZERS)
9812 dnl ===================================================================
9814 dnl ===================================================================
9815 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.15 >= 0.15.0])
9816 if test "$with_system_orcus" != "yes"; then
9817 if test "$SYSTEM_BOOST" = "TRUE"; then
9818 # ===========================================================
9819 # Determine if we are going to need to link with Boost.System
9820 # ===========================================================
9821 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9822 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9823 dnl in documentation has no effect.
9824 AC_MSG_CHECKING([if we need to link with Boost.System])
9826 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9827 @%:@include <boost/version.hpp>
9829 #if BOOST_VERSION >= 105000
9830 # error yes, we need to link with Boost.System
9835 AC_MSG_RESULT([yes])
9841 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9842 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9843 AC_SUBST([BOOST_SYSTEM_LIB])
9844 AC_SUBST(SYSTEM_LIBORCUS)
9846 dnl ===================================================================
9848 dnl ===================================================================
9849 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9850 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9851 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9853 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9854 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9855 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9857 if test "$COM" = "MSC"; then # override the above
9858 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9859 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9862 if test "$with_system_harfbuzz" = "yes"; then
9863 if test "$with_system_graphite" = "no"; then
9864 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9866 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9868 _save_cflags="$CFLAGS"
9869 LIBS="$LIBS $HARFBUZZ_LIBS"
9870 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9871 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9873 CFLAGS="$_save_cflags"
9875 if test "$with_system_graphite" = "yes"; then
9876 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9880 AC_MSG_CHECKING([whether to use X11])
9881 dnl ***************************************
9882 dnl testing for X libraries and includes...
9883 dnl ***************************************
9884 if test "$USING_X11" = TRUE; then
9885 AC_DEFINE(HAVE_FEATURE_X11)
9887 AC_MSG_RESULT([$USING_X11])
9889 if test "$USING_X11" = TRUE; then
9892 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9894 if test -z "$x_includes"; then
9895 x_includes="default_x_includes"
9897 if test -z "$x_libraries"; then
9898 x_libraries="default_x_libraries"
9900 CFLAGS="$CFLAGS $X_CFLAGS"
9901 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9902 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9904 x_includes="no_x_includes"
9905 x_libraries="no_x_libraries"
9908 if test "$USING_X11" = TRUE; then
9909 dnl ===================================================================
9910 dnl Check for extension headers
9911 dnl ===================================================================
9912 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9913 [#include <X11/extensions/shape.h>])
9915 # vcl needs ICE and SM
9916 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9917 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9918 [AC_MSG_ERROR(ICE library not found)])
9919 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9920 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9921 [AC_MSG_ERROR(SM library not found)])
9924 dnl ===================================================================
9925 dnl Check for system Xrender
9926 dnl ===================================================================
9927 AC_MSG_CHECKING([whether to use Xrender])
9928 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9929 AC_MSG_RESULT([yes])
9930 PKG_CHECK_MODULES(XRENDER, xrender)
9931 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9932 FilterLibs "${XRENDER_LIBS}"
9933 XRENDER_LIBS="${filteredlibs}"
9934 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9935 [AC_MSG_ERROR(libXrender not found or functional)], [])
9936 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9937 [AC_MSG_ERROR(Xrender not found. install X)], [])
9941 AC_SUBST(XRENDER_CFLAGS)
9942 AC_SUBST(XRENDER_LIBS)
9944 dnl ===================================================================
9945 dnl Check for XRandr
9946 dnl ===================================================================
9947 AC_MSG_CHECKING([whether to enable RandR support])
9948 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9949 AC_MSG_RESULT([yes])
9950 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9951 if test "$ENABLE_RANDR" != "TRUE"; then
9952 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9953 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9955 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9956 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9957 XRANDR_LIBS="-lXrandr "
9960 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9961 FilterLibs "${XRANDR_LIBS}"
9962 XRANDR_LIBS="${filteredlibs}"
9967 AC_SUBST(XRANDR_CFLAGS)
9968 AC_SUBST(XRANDR_LIBS)
9969 AC_SUBST(ENABLE_RANDR)
9971 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9974 if test $_os = iOS -o $_os = Android; then
9977 AC_MSG_CHECKING([for webdav library])
9978 case "$WITH_WEBDAV" in
9980 AC_MSG_RESULT([serf])
9981 # Check for system apr-util
9982 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9983 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9984 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9985 if test "$COM" = "MSC"; then
9987 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9988 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9991 # Check for system serf
9992 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9993 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9994 if test "$COM" = "MSC"; then
9995 SERF_LIB_DIR="Release"
9996 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9997 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
10001 AC_MSG_RESULT([neon])
10002 # Check for system neon
10003 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
10004 if test "$with_system_neon" = "yes"; then
10005 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
10009 AC_SUBST(NEON_VERSION)
10012 AC_MSG_RESULT([none, disabled])
10016 AC_SUBST(WITH_WEBDAV)
10018 dnl ===================================================================
10019 dnl Check for disabling cve_tests
10020 dnl ===================================================================
10021 AC_MSG_CHECKING([whether to execute CVE tests])
10022 # If not explicitly enabled or disabled, default
10023 if test -z "$enable_cve_tests"; then
10026 # Default cves off for Windows with its wild and wonderful
10027 # variety of AV software kicking in and panicking
10028 enable_cve_tests=no
10032 enable_cve_tests=yes
10036 if test "$enable_cve_tests" = "no"; then
10037 AC_MSG_RESULT([no])
10038 DISABLE_CVE_TESTS=TRUE
10039 AC_SUBST(DISABLE_CVE_TESTS)
10041 AC_MSG_RESULT([yes])
10044 dnl ===================================================================
10045 dnl Check for enabling chart XShape tests
10046 dnl ===================================================================
10047 AC_MSG_CHECKING([whether to execute chart XShape tests])
10048 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
10049 AC_MSG_RESULT([yes])
10050 ENABLE_CHART_TESTS=TRUE
10051 AC_SUBST(ENABLE_CHART_TESTS)
10053 AC_MSG_RESULT([no])
10056 dnl ===================================================================
10057 dnl Check for system openssl
10058 dnl ===================================================================
10060 AC_MSG_CHECKING([whether to disable OpenSSL usage])
10061 if test "$enable_openssl" = "yes"; then
10062 AC_MSG_RESULT([no])
10063 if test "$_os" = Darwin ; then
10064 # OpenSSL is deprecated when building for 10.7 or later.
10066 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
10067 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
10069 with_system_openssl=no
10070 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
10071 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
10072 && test "$with_system_openssl" != "no"; then
10073 with_system_openssl=yes
10074 SYSTEM_OPENSSL=TRUE
10076 OPENSSL_LIBS="-lssl -lcrypto"
10078 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
10080 if test "$with_system_openssl" = "yes"; then
10081 AC_MSG_CHECKING([whether openssl supports SHA512])
10083 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
10084 SHA512_CTX context;
10085 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
10089 AC_MSG_RESULT([yes])
10090 DISABLE_OPENSSL=TRUE
10092 # warn that although OpenSSL is disabled, system libraries may depend on it
10093 AC_MSG_WARN([OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies])
10094 add_warning "OpenSSL has been disabled. No code compiled here will make use of it but system libraries may create indirect dependencies"
10097 AC_SUBST([DISABLE_OPENSSL])
10099 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
10100 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
10101 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
10102 enable_cipher_openssl_backend=no
10104 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
10107 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
10108 ENABLE_CIPHER_OPENSSL_BACKEND=
10109 if test "$enable_cipher_openssl_backend" = yes; then
10110 AC_MSG_RESULT([yes])
10111 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
10113 AC_MSG_RESULT([no])
10115 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
10117 dnl ===================================================================
10118 dnl Check for building gnutls
10119 dnl ===================================================================
10120 AC_MSG_CHECKING([whether to use gnutls])
10121 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
10122 AC_MSG_RESULT([yes])
10123 AM_PATH_LIBGCRYPT()
10124 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
10125 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
10126 available in the system to use as replacement.]]))
10127 FilterLibs "${LIBGCRYPT_LIBS}"
10128 LIBGCRYPT_LIBS="${filteredlibs}"
10130 AC_MSG_RESULT([no])
10133 AC_SUBST([LIBGCRYPT_CFLAGS])
10134 AC_SUBST([LIBGCRYPT_LIBS])
10136 dnl ===================================================================
10137 dnl Check for system redland
10138 dnl ===================================================================
10139 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
10140 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
10141 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
10142 if test "$with_system_redland" = "yes"; then
10143 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
10144 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
10150 AC_SUBST(RAPTOR_MAJOR)
10151 AC_SUBST(RASQAL_MAJOR)
10152 AC_SUBST(REDLAND_MAJOR)
10154 dnl ===================================================================
10155 dnl Check for system hunspell
10156 dnl ===================================================================
10157 AC_MSG_CHECKING([which libhunspell to use])
10158 if test "$with_system_hunspell" = "yes"; then
10159 AC_MSG_RESULT([external])
10160 SYSTEM_HUNSPELL=TRUE
10161 AC_LANG_PUSH([C++])
10162 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
10163 if test "$HUNSPELL_PC" != "TRUE"; then
10164 AC_CHECK_HEADER(hunspell.hxx, [],
10166 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
10167 [AC_MSG_ERROR(hunspell headers not found.)], [])
10169 AC_CHECK_LIB([hunspell], [main], [:],
10170 [ AC_MSG_ERROR(hunspell library not found.) ], [])
10171 HUNSPELL_LIBS=-lhunspell
10174 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10175 FilterLibs "${HUNSPELL_LIBS}"
10176 HUNSPELL_LIBS="${filteredlibs}"
10178 AC_MSG_RESULT([internal])
10180 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
10181 if test "$COM" = "MSC"; then
10182 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
10184 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
10186 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
10188 AC_SUBST(SYSTEM_HUNSPELL)
10189 AC_SUBST(HUNSPELL_CFLAGS)
10190 AC_SUBST(HUNSPELL_LIBS)
10192 dnl ===================================================================
10193 dnl Check for system qrcodegen
10194 dnl ===================================================================
10195 AC_MSG_CHECKING([which libqrcodegen to use])
10196 if test "$with_system_qrcodegen" = "yes"; then
10197 AC_MSG_RESULT([external])
10198 SYSTEM_QRCODEGEN=TRUE
10199 AC_LANG_PUSH([C++])
10200 AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
10201 [AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
10202 AC_CHECK_LIB([qrcodegencpp], [main], [:],
10203 [ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
10204 QRCODEGEN_LIBS=-lqrcodegencpp
10206 QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10207 FilterLibs "${QRCODEGEN_LIBS}"
10208 QRCODEGEN_LIBS="${filteredlibs}"
10210 AC_MSG_RESULT([internal])
10212 BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
10214 AC_SUBST(SYSTEM_QRCODEGEN)
10215 AC_SUBST(QRCODEGEN_CFLAGS)
10216 AC_SUBST(QRCODEGEN_LIBS)
10218 dnl ===================================================================
10219 dnl Checking for altlinuxhyph
10220 dnl ===================================================================
10221 AC_MSG_CHECKING([which altlinuxhyph to use])
10222 if test "$with_system_altlinuxhyph" = "yes"; then
10223 AC_MSG_RESULT([external])
10225 AC_CHECK_HEADER(hyphen.h, [],
10226 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
10227 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
10228 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
10229 [#include <hyphen.h>])
10230 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
10231 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10232 if test -z "$HYPHEN_LIB"; then
10233 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
10234 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10236 if test -z "$HYPHEN_LIB"; then
10237 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
10238 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
10241 AC_MSG_RESULT([internal])
10243 BUILD_TYPE="$BUILD_TYPE HYPHEN"
10244 if test "$COM" = "MSC"; then
10245 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
10247 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
10250 AC_SUBST(SYSTEM_HYPH)
10251 AC_SUBST(HYPHEN_LIB)
10253 dnl ===================================================================
10254 dnl Checking for mythes
10255 dnl ===================================================================
10256 AC_MSG_CHECKING([which mythes to use])
10257 if test "$with_system_mythes" = "yes"; then
10258 AC_MSG_RESULT([external])
10260 AC_LANG_PUSH([C++])
10261 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
10262 if test "$MYTHES_PKGCONFIG" = "no"; then
10263 AC_CHECK_HEADER(mythes.hxx, [],
10264 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
10265 AC_CHECK_LIB([mythes-1.2], [main], [:],
10266 [ MYTHES_FOUND=no], [])
10267 if test "$MYTHES_FOUND" = "no"; then
10268 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
10269 [ MYTHES_FOUND=no], [])
10271 if test "$MYTHES_FOUND" = "no"; then
10272 AC_MSG_ERROR([mythes library not found!.])
10276 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10277 FilterLibs "${MYTHES_LIBS}"
10278 MYTHES_LIBS="${filteredlibs}"
10280 AC_MSG_RESULT([internal])
10282 BUILD_TYPE="$BUILD_TYPE MYTHES"
10283 if test "$COM" = "MSC"; then
10284 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
10286 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
10289 AC_SUBST(SYSTEM_MYTHES)
10290 AC_SUBST(MYTHES_CFLAGS)
10291 AC_SUBST(MYTHES_LIBS)
10293 dnl ===================================================================
10294 dnl How should we build the linear programming solver ?
10295 dnl ===================================================================
10298 AC_MSG_CHECKING([whether to build with CoinMP])
10299 if test "$enable_coinmp" != "no"; then
10301 AC_MSG_RESULT([yes])
10302 if test "$with_system_coinmp" = "yes"; then
10304 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
10305 FilterLibs "${COINMP_LIBS}"
10306 COINMP_LIBS="${filteredlibs}"
10308 BUILD_TYPE="$BUILD_TYPE COINMP"
10311 AC_MSG_RESULT([no])
10313 AC_SUBST(ENABLE_COINMP)
10314 AC_SUBST(SYSTEM_COINMP)
10315 AC_SUBST(COINMP_CFLAGS)
10316 AC_SUBST(COINMP_LIBS)
10319 AC_MSG_CHECKING([whether to build with lpsolve])
10320 if test "$enable_lpsolve" != "no"; then
10321 ENABLE_LPSOLVE=TRUE
10322 AC_MSG_RESULT([yes])
10324 AC_MSG_RESULT([no])
10326 AC_SUBST(ENABLE_LPSOLVE)
10328 if test "$ENABLE_LPSOLVE" = TRUE; then
10329 AC_MSG_CHECKING([which lpsolve to use])
10330 if test "$with_system_lpsolve" = "yes"; then
10331 AC_MSG_RESULT([external])
10332 SYSTEM_LPSOLVE=TRUE
10333 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
10334 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
10336 # some systems need this. Like Ubuntu...
10337 AC_CHECK_LIB(m, floor)
10338 AC_CHECK_LIB(dl, dlopen)
10339 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
10340 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
10343 AC_MSG_RESULT([internal])
10345 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
10348 AC_SUBST(SYSTEM_LPSOLVE)
10350 dnl ===================================================================
10351 dnl Checking for libexttextcat
10352 dnl ===================================================================
10353 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
10354 if test "$with_system_libexttextcat" = "yes"; then
10355 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
10357 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
10359 dnl ===================================================================
10360 dnl Checking for libnumbertext
10361 dnl ===================================================================
10362 AC_MSG_CHECKING([whether to use libnumbertext])
10363 if test "$enable_libnumbertext" = "no"; then
10364 AC_MSG_RESULT([no])
10365 ENABLE_LIBNUMBERTEXT=
10366 SYSTEM_LIBNUMBERTEXT=
10368 AC_MSG_RESULT([yes])
10369 ENABLE_LIBNUMBERTEXT=TRUE
10370 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
10371 if test "$with_system_libnumbertext" = "yes"; then
10372 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
10373 SYSTEM_LIBNUMBERTEXT=YES
10375 SYSTEM_LIBNUMBERTEXT=
10376 AC_LANG_PUSH([C++])
10377 save_CPPFLAGS=$CPPFLAGS
10378 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
10379 AC_CHECK_HEADERS([codecvt regex])
10380 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
10381 [ ENABLE_LIBNUMBERTEXT=''
10382 LIBNUMBERTEXT_CFLAGS=''
10383 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
10384 Enable libnumbertext fallback (missing number to number name conversion).])
10386 CPPFLAGS=$save_CPPFLAGS
10389 if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
10390 AC_DEFINE(ENABLE_LIBNUMBERTEXT)
10393 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
10394 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
10395 AC_SUBST(ENABLE_LIBNUMBERTEXT)
10396 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
10398 dnl ***************************************
10399 dnl testing libc version for Linux...
10400 dnl ***************************************
10401 if test "$_os" = "Linux"; then
10402 AC_MSG_CHECKING([whether libc is >= 2.1.1])
10403 exec 6>/dev/null # no output
10404 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
10405 exec 6>&1 # output on again
10406 if test "$HAVE_LIBC"; then
10407 AC_MSG_RESULT([yes])
10409 AC_MSG_ERROR([no, upgrade libc])
10413 dnl =========================================
10414 dnl Check for uuidgen
10415 dnl =========================================
10416 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
10417 # presence is already tested above in the WINDOWS_SDK_HOME check
10418 UUIDGEN=uuidgen.exe
10421 AC_PATH_PROG([UUIDGEN], [uuidgen])
10422 if test -z "$UUIDGEN"; then
10423 AC_MSG_WARN([uuid is needed for building installation sets])
10427 dnl ***************************************
10428 dnl Checking for bison and flex
10429 dnl ***************************************
10430 AC_PATH_PROG(BISON, bison)
10431 if test -z "$BISON"; then
10432 AC_MSG_ERROR([no bison found in \$PATH, install it])
10434 AC_MSG_CHECKING([the bison version])
10435 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
10436 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
10437 dnl Accept newer than 2.0; for --enable-compiler-plugins at least 2.3 is known to be bad and
10440 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]
10441 dnl typedef union YYSTYPE
10444 dnl while at least 3.4.1 is know to be good:
10445 if test "$COMPILER_PLUGINS" = TRUE; then
10446 if test "$_bison_longver" -lt 2004; then
10447 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.4+ for --enable-compiler-plugins)])
10450 if test "$_bison_longver" -lt 2000; then
10451 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
10457 AC_PATH_PROG(FLEX, flex)
10458 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10459 FLEX=`cygpath -m $FLEX`
10461 if test -z "$FLEX"; then
10462 AC_MSG_ERROR([no flex found in \$PATH, install it])
10464 AC_MSG_CHECKING([the flex version])
10465 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
10466 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
10467 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
10471 dnl ***************************************
10472 dnl Checking for patch
10473 dnl ***************************************
10474 AC_PATH_PROG(PATCH, patch)
10475 if test -z "$PATCH"; then
10476 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
10479 dnl On Solaris, FreeBSD or macOS, check if --with-gnu-patch was used
10480 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
10481 if test -z "$with_gnu_patch"; then
10484 if test -x "$with_gnu_patch"; then
10485 GNUPATCH=$with_gnu_patch
10487 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
10491 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
10492 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
10493 AC_MSG_RESULT([yes])
10495 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
10501 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10502 GNUPATCH=`cygpath -m $GNUPATCH`
10505 dnl We also need to check for --with-gnu-cp
10507 if test -z "$with_gnu_cp"; then
10508 # check the place where the good stuff is hidden on Solaris...
10509 if test -x /usr/gnu/bin/cp; then
10510 GNUCP=/usr/gnu/bin/cp
10512 AC_PATH_PROGS(GNUCP, gnucp cp)
10514 if test -z $GNUCP; then
10515 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
10518 if test -x "$with_gnu_cp"; then
10521 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
10525 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10526 GNUCP=`cygpath -m $GNUCP`
10529 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
10530 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
10531 AC_MSG_RESULT([yes])
10532 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
10533 AC_MSG_RESULT([yes])
10535 case "$build_os" in
10536 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
10539 AC_MSG_RESULT([no gnucp found - using the system's cp command])
10542 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
10551 dnl ***************************************
10552 dnl testing assembler path
10553 dnl ***************************************
10555 if test "$_os" = "WINNT"; then
10556 if test "$BITNESS_OVERRIDE" = ""; then
10562 AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
10563 if test -f "$CL_PATH/$assembler"; then
10564 ML_EXE=`win_short_path_for_make "$CL_PATH/$assembler"`
10565 AC_MSG_RESULT([$ML_EXE])
10567 AC_MSG_ERROR([not found])
10573 dnl ===================================================================
10574 dnl We need zip and unzip
10575 dnl ===================================================================
10576 AC_PATH_PROG(ZIP, zip)
10577 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10578 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10579 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],,)
10582 AC_PATH_PROG(UNZIP, unzip)
10583 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10585 dnl ===================================================================
10586 dnl Zip must be a specific type for different build types.
10587 dnl ===================================================================
10588 if test $build_os = cygwin; then
10589 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10590 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10594 dnl ===================================================================
10595 dnl We need touch with -h option support.
10596 dnl ===================================================================
10597 AC_PATH_PROG(TOUCH, touch)
10598 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10600 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10601 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],,)
10604 dnl ===================================================================
10605 dnl Check for system epoxy
10606 dnl ===================================================================
10607 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
10609 dnl ===================================================================
10610 dnl Set vcl option: coordinate device in double or sal_Int32
10611 dnl ===================================================================
10613 dnl disabled for now, we don't want subtle differences between OSs
10614 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10615 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
10616 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10617 dnl AC_MSG_RESULT([double])
10619 dnl AC_MSG_RESULT([sal_Int32])
10622 dnl ===================================================================
10623 dnl Test which vclplugs have to be built.
10624 dnl ===================================================================
10626 if test "$USING_X11" != TRUE; then
10632 if test "x$enable_gtk3" = "xyes"; then
10633 if test "$with_system_cairo" = no; then
10634 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10636 : ${with_system_cairo:=yes}
10637 PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.18 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
10638 if test "x$ENABLE_GTK3" = "xTRUE"; then
10639 AC_DEFINE(ENABLE_GTK3)
10642 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10644 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10645 FilterLibs "${GTK3_LIBS}"
10646 GTK3_LIBS="${filteredlibs}"
10648 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10649 if test "$with_system_epoxy" != "yes"; then
10650 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10651 AC_CHECK_HEADER(EGL/eglplatform.h, [],
10652 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10655 AC_SUBST(GTK3_LIBS)
10656 AC_SUBST(GTK3_CFLAGS)
10657 AC_SUBST(ENABLE_GTK3)
10659 if test "$enable_introspection" = yes; then
10660 if test "$ENABLE_GTK3" = TRUE; then
10661 GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
10663 AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
10668 if test "x$enable_qt5" = "xyes"; then
10670 AC_DEFINE(ENABLE_QT5)
10673 AC_SUBST(ENABLE_QT5)
10676 if test "x$enable_kf5" = "xyes"; then
10678 AC_DEFINE(ENABLE_KF5)
10681 AC_SUBST(ENABLE_KF5)
10683 ENABLE_GTK3_KDE5=""
10684 if test "x$enable_gtk3_kde5" = "xyes"; then
10685 ENABLE_GTK3_KDE5="TRUE"
10686 AC_DEFINE(ENABLE_GTK3_KDE5)
10689 AC_SUBST(ENABLE_GTK3_KDE5)
10691 if test "$_os" = "WINNT"; then
10693 elif test "$_os" = "Darwin"; then
10695 elif test "$_os" = "iOS"; then
10699 build_vcl_plugins="$R"
10700 if test -z "$build_vcl_plugins"; then
10701 build_vcl_plugins="none"
10703 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10705 dnl ===================================================================
10706 dnl check for dbus support
10707 dnl ===================================================================
10711 DBUS_GLIB_CFLAGS=""
10715 if test "$enable_dbus" = "no"; then
10719 AC_MSG_CHECKING([whether to enable DBUS support])
10720 if test "$test_dbus" = "yes"; then
10722 AC_MSG_RESULT([yes])
10723 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10724 AC_DEFINE(ENABLE_DBUS)
10725 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10726 FilterLibs "${DBUS_LIBS}"
10727 DBUS_LIBS="${filteredlibs}"
10729 # Glib is needed for BluetoothServer
10730 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10731 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10733 DBUS_HAVE_GLIB="TRUE"
10734 AC_DEFINE(DBUS_HAVE_GLIB,1)
10736 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10739 AC_MSG_RESULT([no])
10742 AC_SUBST(ENABLE_DBUS)
10743 AC_SUBST(DBUS_CFLAGS)
10744 AC_SUBST(DBUS_LIBS)
10745 AC_SUBST(DBUS_GLIB_CFLAGS)
10746 AC_SUBST(DBUS_GLIB_LIBS)
10747 AC_SUBST(DBUS_HAVE_GLIB)
10749 AC_MSG_CHECKING([whether to enable Impress remote control])
10750 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10751 AC_MSG_RESULT([yes])
10752 ENABLE_SDREMOTE=TRUE
10753 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10755 if test $OS = MACOSX && test "$MAC_OS_X_VERSION_MAX_ALLOWED" -ge 101500; then
10756 # The Bluetooth code doesn't compile with macOS SDK 10.15
10757 enable_sdremote_bluetooth=no
10759 # If not explicitly enabled or disabled, default
10760 if test -z "$enable_sdremote_bluetooth"; then
10763 # Default to yes for these
10764 enable_sdremote_bluetooth=yes
10768 enable_sdremote_bluetooth=no
10772 # $enable_sdremote_bluetooth is guaranteed non-empty now
10774 if test "$enable_sdremote_bluetooth" != "no"; then
10775 if test "$OS" = "LINUX"; then
10776 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10777 AC_MSG_RESULT([yes])
10778 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10779 dnl ===================================================================
10780 dnl Check for system bluez
10781 dnl ===================================================================
10782 AC_MSG_CHECKING([which Bluetooth header to use])
10783 if test "$with_system_bluez" = "yes"; then
10784 AC_MSG_RESULT([external])
10785 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10786 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10789 AC_MSG_RESULT([internal])
10793 AC_MSG_RESULT([no, dbus disabled])
10794 ENABLE_SDREMOTE_BLUETOOTH=
10798 AC_MSG_RESULT([yes])
10799 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10803 AC_MSG_RESULT([no])
10804 ENABLE_SDREMOTE_BLUETOOTH=
10810 AC_MSG_RESULT([no])
10812 AC_SUBST(ENABLE_SDREMOTE)
10813 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10814 AC_SUBST(SYSTEM_BLUEZ)
10816 dnl ===================================================================
10817 dnl Check whether to enable GIO support
10818 dnl ===================================================================
10819 if test "$ENABLE_GTK3" = "TRUE"; then
10820 AC_MSG_CHECKING([whether to enable GIO support])
10821 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10822 dnl Need at least 2.26 for the dbus support.
10823 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10824 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10825 if test "$ENABLE_GIO" = "TRUE"; then
10826 AC_DEFINE(ENABLE_GIO)
10827 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10828 FilterLibs "${GIO_LIBS}"
10829 GIO_LIBS="${filteredlibs}"
10832 AC_MSG_RESULT([no])
10835 AC_SUBST(ENABLE_GIO)
10836 AC_SUBST(GIO_CFLAGS)
10840 dnl ===================================================================
10842 SPLIT_APP_MODULES=""
10843 if test "$enable_split_app_modules" = "yes"; then
10844 SPLIT_APP_MODULES="TRUE"
10846 AC_SUBST(SPLIT_APP_MODULES)
10848 SPLIT_OPT_FEATURES=""
10849 if test "$enable_split_opt_features" = "yes"; then
10850 SPLIT_OPT_FEATURES="TRUE"
10852 AC_SUBST(SPLIT_OPT_FEATURES)
10854 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10855 if test "$enable_cairo_canvas" = yes; then
10856 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10858 enable_cairo_canvas=no
10859 elif test -z "$enable_cairo_canvas"; then
10860 enable_cairo_canvas=yes
10863 ENABLE_CAIRO_CANVAS=""
10864 if test "$enable_cairo_canvas" = "yes"; then
10866 ENABLE_CAIRO_CANVAS="TRUE"
10867 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10869 AC_SUBST(ENABLE_CAIRO_CANVAS)
10871 dnl ===================================================================
10872 dnl Check whether the GStreamer libraries are available.
10873 dnl ===================================================================
10875 ENABLE_GSTREAMER_1_0=""
10877 if test "$build_gstreamer_1_0" = "yes"; then
10879 AC_MSG_CHECKING([whether to enable the GStreamer 1.0 avmedia backend])
10880 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10881 ENABLE_GSTREAMER_1_0="TRUE"
10882 AC_MSG_RESULT([yes])
10883 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10884 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10885 FilterLibs "${GSTREAMER_1_0_LIBS}"
10886 GSTREAMER_1_0_LIBS="${filteredlibs}"
10887 AC_DEFINE(ENABLE_GSTREAMER_1_0)
10889 AC_MSG_RESULT([no])
10892 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10893 AC_SUBST(GSTREAMER_1_0_LIBS)
10894 AC_SUBST(ENABLE_GSTREAMER_1_0)
10896 dnl ===================================================================
10897 dnl Check whether to build the VLC avmedia backend
10898 dnl ===================================================================
10902 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10903 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10905 AC_MSG_RESULT([yes])
10907 AC_MSG_RESULT([no])
10909 AC_SUBST(ENABLE_VLC)
10911 ENABLE_OPENGL_TRANSITIONS=
10912 ENABLE_OPENGL_CANVAS=
10913 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10915 elif test "$_os" = "Darwin"; then
10916 # We use frameworks on macOS, no need for detail checks
10917 ENABLE_OPENGL_TRANSITIONS=TRUE
10918 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10919 ENABLE_OPENGL_CANVAS=TRUE
10920 elif test $_os = WINNT; then
10921 ENABLE_OPENGL_TRANSITIONS=TRUE
10922 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10923 ENABLE_OPENGL_CANVAS=TRUE
10925 if test "$USING_X11" = TRUE; then
10926 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10927 ENABLE_OPENGL_TRANSITIONS=TRUE
10928 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10929 ENABLE_OPENGL_CANVAS=TRUE
10933 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10934 AC_SUBST(ENABLE_OPENGL_CANVAS)
10936 dnl =================================================
10937 dnl Check whether to build with OpenCL support.
10938 dnl =================================================
10940 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10941 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10942 # platform (optional at run-time, used through clew).
10943 BUILD_TYPE="$BUILD_TYPE OPENCL"
10944 AC_DEFINE(HAVE_FEATURE_OPENCL)
10947 dnl =================================================
10948 dnl Check whether to build with dconf support.
10949 dnl =================================================
10951 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
10952 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10953 if test "$enable_dconf" = yes; then
10954 AC_MSG_ERROR([dconf not found])
10959 AC_MSG_CHECKING([whether to enable dconf])
10960 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
10964 AC_MSG_RESULT([no])
10967 AC_DEFINE(ENABLE_DCONF)
10968 AC_MSG_RESULT([yes])
10970 AC_SUBST([DCONF_CFLAGS])
10971 AC_SUBST([DCONF_LIBS])
10972 AC_SUBST([ENABLE_DCONF])
10975 AC_MSG_CHECKING([whether to build the PDF import feature])
10977 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10978 AC_MSG_RESULT([yes])
10979 ENABLE_PDFIMPORT=TRUE
10980 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10982 AC_MSG_RESULT([no])
10986 AC_MSG_CHECKING([whether to build PDFium])
10988 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_pdfium" = yes; then
10989 AC_MSG_RESULT([yes])
10991 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10992 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10994 AC_MSG_RESULT([no])
10996 AC_SUBST(ENABLE_PDFIUM)
10998 dnl ===================================================================
10999 dnl Check for poppler
11000 dnl ===================================================================
11002 AC_MSG_CHECKING([whether to build Poppler])
11003 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" = "TRUE" \) -o "$enable_poppler" = yes; then
11004 AC_MSG_RESULT([yes])
11005 ENABLE_POPPLER=TRUE
11006 AC_DEFINE(HAVE_FEATURE_POPPLER)
11008 AC_MSG_RESULT([no])
11010 AC_SUBST(ENABLE_POPPLER)
11012 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
11013 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
11016 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" = "TRUE" -o "$ENABLE_PDFIUM" = "TRUE" \); then
11017 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
11020 if test "$ENABLE_PDFIMPORT" = "TRUE" -a "$ENABLE_POPPLER" = "TRUE"; then
11021 dnl ===================================================================
11022 dnl Check for system poppler
11023 dnl ===================================================================
11024 AC_MSG_CHECKING([which PDF import poppler to use])
11025 if test "$with_system_poppler" = "yes"; then
11026 AC_MSG_RESULT([external])
11027 SYSTEM_POPPLER=TRUE
11028 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
11029 AC_LANG_PUSH([C++])
11030 save_CXXFLAGS=$CXXFLAGS
11031 save_CPPFLAGS=$CPPFLAGS
11032 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
11033 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
11034 AC_CHECK_HEADER([cpp/poppler-version.h],
11035 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
11037 CXXFLAGS=$save_CXXFLAGS
11038 CPPFLAGS=$save_CPPFLAGS
11040 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11042 FilterLibs "${POPPLER_LIBS}"
11043 POPPLER_LIBS="${filteredlibs}"
11045 AC_MSG_RESULT([internal])
11047 BUILD_TYPE="$BUILD_TYPE POPPLER"
11048 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
11050 AC_DEFINE([ENABLE_PDFIMPORT],1)
11052 AC_SUBST(ENABLE_PDFIMPORT)
11053 AC_SUBST(SYSTEM_POPPLER)
11054 AC_SUBST(POPPLER_CFLAGS)
11055 AC_SUBST(POPPLER_LIBS)
11058 AC_MSG_CHECKING([whether to build Skia])
11060 if test "$enable_skia" != "no" -a "$build_skia" = "yes"; then
11061 AC_MSG_RESULT([yes])
11063 AC_DEFINE(HAVE_FEATURE_SKIA)
11064 BUILD_TYPE="$BUILD_TYPE SKIA"
11066 AC_MSG_RESULT([no])
11068 AC_SUBST(ENABLE_SKIA)
11072 if test "$build_for_ios" = "YES"; then
11073 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
11074 AC_MSG_RESULT([yes])
11075 elif test "$enable_mpl_subset" = "yes"; then
11076 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
11077 AC_MSG_RESULT([yes])
11078 elif test "$enable_fuzzers" = "yes"; then
11079 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
11080 AC_MSG_RESULT([yes])
11081 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
11082 dnl ===================================================================
11083 dnl Check for system gpgme
11084 dnl ===================================================================
11085 AC_MSG_CHECKING([which gpgmepp to use])
11086 if test "$with_system_gpgmepp" = "yes"; then
11087 AC_MSG_RESULT([external])
11088 SYSTEM_GPGMEPP=TRUE
11090 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
11091 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
11092 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
11093 # progress_callback is the only func with plain C linkage
11094 # checking for it also filters out older, KDE-dependent libgpgmepp versions
11095 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
11096 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
11097 AC_CHECK_HEADER(gpgme.h, [],
11098 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
11100 AC_MSG_RESULT([internal])
11101 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
11102 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
11104 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
11105 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
11106 if test "$_os" != "WINNT"; then
11107 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
11108 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
11109 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
11110 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
11113 ENABLE_GPGMEPP=TRUE
11114 AC_DEFINE([HAVE_FEATURE_GPGME])
11115 AC_PATH_PROG(GPG, gpg)
11116 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
11117 # so let's exclude that manually for the moment
11118 if test -n "$GPG" -a "$_os" != "WINNT"; then
11119 # make sure we not only have a working gpgme, but a full working
11120 # gpg installation to run OpenPGP signature verification
11121 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
11123 if test "$_os" = "Linux"; then
11125 AC_MSG_CHECKING([for /run/user/$uid])
11126 if test -d /run/user/$uid; then
11127 AC_MSG_RESULT([yes])
11128 AC_PATH_PROG(GPGCONF, gpgconf)
11130 # Older versions of gpgconf are not working as expected, since
11131 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
11132 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
11133 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
11134 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
11135 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
11136 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
11137 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
11138 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
11139 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
11140 if $GPGCONF --dump-options > /dev/null ; then
11141 if $GPGCONF --dump-options | grep -q create-socketdir ; then
11142 AC_MSG_RESULT([yes])
11143 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
11144 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
11146 AC_MSG_RESULT([no])
11149 AC_MSG_RESULT([no. missing or broken gpgconf?])
11152 AC_MSG_RESULT([no, $GPGCONF_VERSION])
11155 AC_MSG_RESULT([no])
11159 AC_SUBST(ENABLE_GPGMEPP)
11160 AC_SUBST(SYSTEM_GPGMEPP)
11161 AC_SUBST(GPG_ERROR_CFLAGS)
11162 AC_SUBST(GPG_ERROR_LIBS)
11163 AC_SUBST(LIBASSUAN_CFLAGS)
11164 AC_SUBST(LIBASSUAN_LIBS)
11165 AC_SUBST(GPGMEPP_CFLAGS)
11166 AC_SUBST(GPGMEPP_LIBS)
11168 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
11169 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
11170 AC_MSG_RESULT([yes])
11171 ENABLE_MEDIAWIKI=TRUE
11172 BUILD_TYPE="$BUILD_TYPE XSLTML"
11173 if test "x$with_java" = "xno"; then
11174 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
11177 AC_MSG_RESULT([no])
11179 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
11181 AC_SUBST(ENABLE_MEDIAWIKI)
11183 AC_MSG_CHECKING([whether to build the Report Builder])
11184 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
11185 AC_MSG_RESULT([yes])
11186 ENABLE_REPORTBUILDER=TRUE
11187 AC_MSG_CHECKING([which jfreereport libs to use])
11188 if test "$with_system_jfreereport" = "yes"; then
11189 SYSTEM_JFREEREPORT=TRUE
11190 AC_MSG_RESULT([external])
11191 if test -z $SAC_JAR; then
11192 SAC_JAR=/usr/share/java/sac.jar
11194 if ! test -f $SAC_JAR; then
11195 AC_MSG_ERROR(sac.jar not found.)
11198 if test -z $LIBXML_JAR; then
11199 if test -f /usr/share/java/libxml-1.0.0.jar; then
11200 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
11201 elif test -f /usr/share/java/libxml.jar; then
11202 LIBXML_JAR=/usr/share/java/libxml.jar
11204 AC_MSG_ERROR(libxml.jar replacement not found.)
11206 elif ! test -f $LIBXML_JAR; then
11207 AC_MSG_ERROR(libxml.jar not found.)
11210 if test -z $FLUTE_JAR; then
11211 if test -f/usr/share/java/flute-1.3.0.jar; then
11212 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
11213 elif test -f /usr/share/java/flute.jar; then
11214 FLUTE_JAR=/usr/share/java/flute.jar
11216 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
11218 elif ! test -f $FLUTE_JAR; then
11219 AC_MSG_ERROR(flute-1.3.0.jar not found.)
11222 if test -z $JFREEREPORT_JAR; then
11223 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
11224 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
11225 elif test -f /usr/share/java/flow-engine.jar; then
11226 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
11228 AC_MSG_ERROR(jfreereport.jar replacement not found.)
11230 elif ! test -f $JFREEREPORT_JAR; then
11231 AC_MSG_ERROR(jfreereport.jar not found.)
11234 if test -z $LIBLAYOUT_JAR; then
11235 if test -f /usr/share/java/liblayout-0.2.9.jar; then
11236 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
11237 elif test -f /usr/share/java/liblayout.jar; then
11238 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
11240 AC_MSG_ERROR(liblayout.jar replacement not found.)
11242 elif ! test -f $LIBLAYOUT_JAR; then
11243 AC_MSG_ERROR(liblayout.jar not found.)
11246 if test -z $LIBLOADER_JAR; then
11247 if test -f /usr/share/java/libloader-1.0.0.jar; then
11248 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
11249 elif test -f /usr/share/java/libloader.jar; then
11250 LIBLOADER_JAR=/usr/share/java/libloader.jar
11252 AC_MSG_ERROR(libloader.jar replacement not found.)
11254 elif ! test -f $LIBLOADER_JAR; then
11255 AC_MSG_ERROR(libloader.jar not found.)
11258 if test -z $LIBFORMULA_JAR; then
11259 if test -f /usr/share/java/libformula-0.2.0.jar; then
11260 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
11261 elif test -f /usr/share/java/libformula.jar; then
11262 LIBFORMULA_JAR=/usr/share/java/libformula.jar
11264 AC_MSG_ERROR(libformula.jar replacement not found.)
11266 elif ! test -f $LIBFORMULA_JAR; then
11267 AC_MSG_ERROR(libformula.jar not found.)
11270 if test -z $LIBREPOSITORY_JAR; then
11271 if test -f /usr/share/java/librepository-1.0.0.jar; then
11272 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
11273 elif test -f /usr/share/java/librepository.jar; then
11274 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
11276 AC_MSG_ERROR(librepository.jar replacement not found.)
11278 elif ! test -f $LIBREPOSITORY_JAR; then
11279 AC_MSG_ERROR(librepository.jar not found.)
11282 if test -z $LIBFONTS_JAR; then
11283 if test -f /usr/share/java/libfonts-1.0.0.jar; then
11284 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
11285 elif test -f /usr/share/java/libfonts.jar; then
11286 LIBFONTS_JAR=/usr/share/java/libfonts.jar
11288 AC_MSG_ERROR(libfonts.jar replacement not found.)
11290 elif ! test -f $LIBFONTS_JAR; then
11291 AC_MSG_ERROR(libfonts.jar not found.)
11294 if test -z $LIBSERIALIZER_JAR; then
11295 if test -f /usr/share/java/libserializer-1.0.0.jar; then
11296 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
11297 elif test -f /usr/share/java/libserializer.jar; then
11298 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
11300 AC_MSG_ERROR(libserializer.jar replacement not found.)
11302 elif ! test -f $LIBSERIALIZER_JAR; then
11303 AC_MSG_ERROR(libserializer.jar not found.)
11306 if test -z $LIBBASE_JAR; then
11307 if test -f /usr/share/java/libbase-1.0.0.jar; then
11308 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
11309 elif test -f /usr/share/java/libbase.jar; then
11310 LIBBASE_JAR=/usr/share/java/libbase.jar
11312 AC_MSG_ERROR(libbase.jar replacement not found.)
11314 elif ! test -f $LIBBASE_JAR; then
11315 AC_MSG_ERROR(libbase.jar not found.)
11319 AC_MSG_RESULT([internal])
11320 SYSTEM_JFREEREPORT=
11321 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
11325 AC_MSG_RESULT([no])
11326 ENABLE_REPORTBUILDER=
11327 SYSTEM_JFREEREPORT=
11329 AC_SUBST(ENABLE_REPORTBUILDER)
11330 AC_SUBST(SYSTEM_JFREEREPORT)
11332 AC_SUBST(LIBXML_JAR)
11333 AC_SUBST(FLUTE_JAR)
11334 AC_SUBST(JFREEREPORT_JAR)
11335 AC_SUBST(LIBBASE_JAR)
11336 AC_SUBST(LIBLAYOUT_JAR)
11337 AC_SUBST(LIBLOADER_JAR)
11338 AC_SUBST(LIBFORMULA_JAR)
11339 AC_SUBST(LIBREPOSITORY_JAR)
11340 AC_SUBST(LIBFONTS_JAR)
11341 AC_SUBST(LIBSERIALIZER_JAR)
11343 # this has to be here because both the Wiki Publisher and the SRB use
11345 COMMONS_LOGGING_VERSION=1.2
11346 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
11347 AC_MSG_CHECKING([which Apache commons-* libs to use])
11348 if test "$with_system_apache_commons" = "yes"; then
11349 SYSTEM_APACHE_COMMONS=TRUE
11350 AC_MSG_RESULT([external])
11351 if test -z $COMMONS_LOGGING_JAR; then
11352 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
11353 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
11354 elif test -f /usr/share/java/commons-logging.jar; then
11355 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
11357 AC_MSG_ERROR(commons-logging.jar replacement not found.)
11359 elif ! test -f $COMMONS_LOGGING_JAR; then
11360 AC_MSG_ERROR(commons-logging.jar not found.)
11363 AC_MSG_RESULT([internal])
11364 SYSTEM_APACHE_COMMONS=
11365 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
11369 AC_SUBST(SYSTEM_APACHE_COMMONS)
11370 AC_SUBST(COMMONS_LOGGING_JAR)
11371 AC_SUBST(COMMONS_LOGGING_VERSION)
11373 # scripting provider for BeanShell?
11374 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
11375 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
11376 AC_MSG_RESULT([yes])
11377 ENABLE_SCRIPTING_BEANSHELL=TRUE
11379 dnl ===================================================================
11380 dnl Check for system beanshell
11381 dnl ===================================================================
11382 AC_MSG_CHECKING([which beanshell to use])
11383 if test "$with_system_beanshell" = "yes"; then
11384 AC_MSG_RESULT([external])
11386 if test -z $BSH_JAR; then
11387 BSH_JAR=/usr/share/java/bsh.jar
11389 if ! test -f $BSH_JAR; then
11390 AC_MSG_ERROR(bsh.jar not found.)
11393 AC_MSG_RESULT([internal])
11395 BUILD_TYPE="$BUILD_TYPE BSH"
11398 AC_MSG_RESULT([no])
11399 ENABLE_SCRIPTING_BEANSHELL=
11400 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
11402 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
11403 AC_SUBST(SYSTEM_BSH)
11406 # scripting provider for JavaScript?
11407 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
11408 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
11409 AC_MSG_RESULT([yes])
11410 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
11412 dnl ===================================================================
11413 dnl Check for system rhino
11414 dnl ===================================================================
11415 AC_MSG_CHECKING([which rhino to use])
11416 if test "$with_system_rhino" = "yes"; then
11417 AC_MSG_RESULT([external])
11419 if test -z $RHINO_JAR; then
11420 RHINO_JAR=/usr/share/java/js.jar
11422 if ! test -f $RHINO_JAR; then
11423 AC_MSG_ERROR(js.jar not found.)
11426 AC_MSG_RESULT([internal])
11428 BUILD_TYPE="$BUILD_TYPE RHINO"
11432 AC_MSG_RESULT([no])
11433 ENABLE_SCRIPTING_JAVASCRIPT=
11434 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
11436 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
11437 AC_SUBST(SYSTEM_RHINO)
11438 AC_SUBST(RHINO_JAR)
11440 # This is only used in Qt5/KF5 checks to determine if /usr/lib64
11441 # paths should be added to library search path. So lets put all 64-bit
11444 case "$host_cpu" in
11445 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
11446 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
11447 supports_multilib="yes"
11454 dnl ===================================================================
11455 dnl QT5 Integration
11456 dnl ===================================================================
11462 QT5_GOBJECT_CFLAGS=""
11463 QT5_GOBJECT_LIBS=""
11464 QT5_HAVE_GOBJECT=""
11465 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11466 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11467 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11469 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11470 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11472 if test -n "$supports_multilib"; then
11473 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11476 qt5_test_include="QtWidgets/qapplication.h"
11477 qt5_test_library="libQt5Widgets.so"
11479 dnl Check for qmake5
11480 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH])
11481 if test "$QMAKE5" = "no"; then
11482 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11484 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11485 if test -z "$qmake5_test_ver"; then
11486 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11488 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11489 qt5_minimal_minor="6"
11490 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11491 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11493 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11497 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11498 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11500 AC_MSG_CHECKING([for Qt5 headers])
11502 for inc_dir in $qt5_incdirs; do
11503 if test -r "$inc_dir/$qt5_test_include"; then
11504 qt5_incdir="$inc_dir"
11508 AC_MSG_RESULT([$qt5_incdir])
11509 if test "x$qt5_incdir" = "xno"; then
11510 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11513 AC_MSG_CHECKING([for Qt5 libraries])
11515 for lib_dir in $qt5_libdirs; do
11516 if test -r "$lib_dir/$qt5_test_library"; then
11517 qt5_libdir="$lib_dir"
11521 AC_MSG_RESULT([$qt5_libdir])
11522 if test "x$qt5_libdir" = "xno"; then
11523 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11526 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT -DQT_NO_VERSION_TAGGING"
11527 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11528 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11530 if test "$USING_X11" = TRUE; then
11531 PKG_CHECK_MODULES(QT5_XCB,[xcb],,[AC_MSG_ERROR([XCB not found, which is needed for correct app grouping in X11.])])
11532 PKG_CHECK_MODULES(QT5_XCB_ICCCM,[xcb-icccm],[
11533 QT5_HAVE_XCB_ICCCM=1
11534 AC_DEFINE(QT5_HAVE_XCB_ICCCM)
11536 AC_MSG_WARN([XCB ICCCM not found, which is needed for old Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)])
11537 add_warning "XCB ICCCM not found, which is needed for Qt versions (< 5.12) on some WMs to correctly group dialogs (like QTBUG-46626)"
11539 QT5_CFLAGS="$QT5_CFLAGS $QT5_XCB_CFLAGS $QT5_XCB_ICCCM_CFLAGS"
11540 QT5_LIBS="$QT5_LIBS $QT5_XCB_LIBS $QT5_XCB_ICCCM_LIBS -lQt5X11Extras"
11542 AC_DEFINE(QT5_USING_X11)
11545 dnl Check for Meta Object Compiler
11547 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH])
11548 if test "$MOC5" = "no"; then
11549 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11550 the root of your Qt installation by exporting QT5DIR before running "configure".])
11553 if test "$build_gstreamer_1_0" = "yes"; then
11554 PKG_CHECK_MODULES(QT5_GOBJECT,[gobject-2.0], [
11556 AC_DEFINE(QT5_HAVE_GOBJECT)
11558 AC_MSG_WARN([[No GObject found, can't use QWidget GStreamer sink on wayland!]])
11562 AC_SUBST(QT5_CFLAGS)
11565 AC_SUBST(QT5_GOBJECT_CFLAGS)
11566 AC_SUBST(QT5_GOBJECT_LIBS)
11567 AC_SUBST(QT5_HAVE_GOBJECT)
11569 dnl ===================================================================
11570 dnl KF5 Integration
11571 dnl ===================================================================
11575 KF5_CONFIG="kf5-config"
11576 if test \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11577 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11579 if test "$OS" = "HAIKU"; then
11580 haiku_arch="`echo $RTL_ARCH | tr X x`"
11581 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11582 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11585 kf5_incdirs="$KF5INC /usr/include $kf5_haiku_incdirs $x_includes"
11586 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11587 if test -n "$supports_multilib"; then
11588 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11591 kf5_test_include="KF5/kcoreaddons_version.h"
11592 kf5_test_library="libKF5CoreAddons.so"
11593 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11595 dnl kf5 KDE4 support compatibility installed
11596 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11597 if test "$KF5_CONFIG" != "no"; then
11598 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11599 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11602 dnl Check for KF5 headers
11603 AC_MSG_CHECKING([for KF5 headers])
11605 for kf5_check in $kf5_incdirs; do
11606 if test -r "$kf5_check/$kf5_test_include"; then
11607 kf5_incdir="$kf5_check/KF5"
11611 AC_MSG_RESULT([$kf5_incdir])
11612 if test "x$kf5_incdir" = "xno"; then
11613 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11616 dnl Check for KF5 libraries
11617 AC_MSG_CHECKING([for KF5 libraries])
11619 for kf5_check in $kf5_libdirs; do
11620 if test -r "$kf5_check/$kf5_test_library"; then
11621 kf5_libdir="$kf5_check"
11626 AC_MSG_RESULT([$kf5_libdir])
11627 if test "x$kf5_libdir" = "xno"; then
11628 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11631 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"
11632 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11633 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11635 if test "$USING_X11" = TRUE; then
11636 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11639 AC_LANG_PUSH([C++])
11640 save_CXXFLAGS=$CXXFLAGS
11641 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11642 AC_MSG_CHECKING([whether KDE is >= 5.0])
11643 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11644 #include <kcoreaddons_version.h>
11646 int main(int argc, char **argv) {
11647 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11650 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11651 CXXFLAGS=$save_CXXFLAGS
11654 AC_SUBST(KF5_CFLAGS)
11657 dnl ===================================================================
11658 dnl Test whether to include Evolution 2 support
11659 dnl ===================================================================
11660 AC_MSG_CHECKING([whether to enable evolution 2 support])
11661 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11662 AC_MSG_RESULT([yes])
11663 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11664 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11665 FilterLibs "${GOBJECT_LIBS}"
11666 GOBJECT_LIBS="${filteredlibs}"
11667 ENABLE_EVOAB2="TRUE"
11670 AC_MSG_RESULT([no])
11672 AC_SUBST(ENABLE_EVOAB2)
11673 AC_SUBST(GOBJECT_CFLAGS)
11674 AC_SUBST(GOBJECT_LIBS)
11676 dnl ===================================================================
11677 dnl Test which themes to include
11678 dnl ===================================================================
11679 AC_MSG_CHECKING([which themes to include])
11680 # if none given use default subset of available themes
11681 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11682 with_theme="breeze breeze_dark breeze_svg colibre colibre_svg elementary elementary_svg karasa_jaga karasa_jaga_svg sifr sifr_svg sifr_dark tango"
11686 if test "x$with_theme" != "xno"; then
11687 for theme in $with_theme; do
11689 breeze|breeze_dark|breeze_svg|colibre|colibre_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg|sifr|sifr_svg|sifr_dark|tango) real_theme="$theme" ;;
11690 default) real_theme=colibre ;;
11691 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11693 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11696 AC_MSG_RESULT([$WITH_THEMES])
11697 AC_SUBST([WITH_THEMES])
11698 # FIXME: remove this, and the convenience default->colibre remapping after a grace period
11699 for theme in $with_theme; do
11701 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11706 dnl ===================================================================
11707 dnl Test whether to integrate helppacks into the product's installer
11708 dnl ===================================================================
11709 AC_MSG_CHECKING([for helppack integration])
11710 if test "$with_helppack_integration" = "no"; then
11711 AC_MSG_RESULT([no integration])
11713 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11714 AC_MSG_RESULT([integration])
11717 ###############################################################################
11718 # Extensions checking
11719 ###############################################################################
11720 AC_MSG_CHECKING([for extensions integration])
11721 if test "x$enable_extension_integration" != "xno"; then
11722 WITH_EXTENSION_INTEGRATION=TRUE
11723 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11724 AC_MSG_RESULT([yes, use integration])
11726 WITH_EXTENSION_INTEGRATION=
11727 AC_MSG_RESULT([no, do not integrate])
11729 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11731 dnl Should any extra extensions be included?
11732 dnl There are standalone tests for each of these below.
11733 WITH_EXTRA_EXTENSIONS=
11734 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11736 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11737 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11738 if test "x$with_java" != "xno"; then
11739 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11740 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11743 AC_MSG_CHECKING([whether to build opens___.ttf])
11744 if test "$enable_build_opensymbol" = "yes"; then
11745 AC_MSG_RESULT([yes])
11746 AC_PATH_PROG(FONTFORGE, fontforge)
11747 if test -z "$FONTFORGE"; then
11748 AC_MSG_ERROR([fontforge not installed])
11751 AC_MSG_RESULT([no])
11752 OPENSYMBOL_TTF=884ed41809687c3e168fc7c19b16585149ff058eca79acbf3ee784f6630704cc-opens___.ttf
11753 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11755 AC_SUBST(OPENSYMBOL_TTF)
11756 AC_SUBST(FONTFORGE)
11758 dnl ===================================================================
11759 dnl Test whether to include fonts
11760 dnl ===================================================================
11761 AC_MSG_CHECKING([whether to include third-party fonts])
11762 if test "$with_fonts" != "no"; then
11763 AC_MSG_RESULT([yes])
11765 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11766 AC_DEFINE(HAVE_MORE_FONTS)
11768 AC_MSG_RESULT([no])
11770 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11772 AC_SUBST(WITH_FONTS)
11775 dnl ===================================================================
11776 dnl Test whether to enable online update service
11777 dnl ===================================================================
11778 AC_MSG_CHECKING([whether to enable online update])
11779 ENABLE_ONLINE_UPDATE=
11780 ENABLE_ONLINE_UPDATE_MAR=
11782 if test "$enable_online_update" = ""; then
11783 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11784 AC_MSG_RESULT([yes])
11785 ENABLE_ONLINE_UPDATE="TRUE"
11787 AC_MSG_RESULT([no])
11790 if test "$enable_online_update" = "mar"; then
11791 AC_MSG_RESULT([yes - MAR-based online update])
11792 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11793 if test "$with_update_config" = ""; then
11794 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11796 UPDATE_CONFIG="$with_update_config"
11797 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11798 elif test "$enable_online_update" = "yes"; then
11799 AC_MSG_RESULT([yes])
11800 ENABLE_ONLINE_UPDATE="TRUE"
11802 AC_MSG_RESULT([no])
11805 AC_SUBST(ENABLE_ONLINE_UPDATE)
11806 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11807 AC_SUBST(UPDATE_CONFIG)
11809 dnl ===================================================================
11810 dnl Test whether we need bzip2
11811 dnl ===================================================================
11813 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11814 AC_MSG_CHECKING([whether to use system bzip2])
11815 if test "$with_system_bzip2" = yes; then
11817 AC_MSG_RESULT([yes])
11818 PKG_CHECK_MODULES(BZIP2, bzip2)
11819 FilterLibs "${BZIP2_LIBS}"
11820 BZIP2_LIBS="${filteredlibs}"
11822 AC_MSG_RESULT([no])
11823 BUILD_TYPE="$BUILD_TYPE BZIP2"
11826 AC_SUBST(SYSTEM_BZIP2)
11827 AC_SUBST(BZIP2_CFLAGS)
11828 AC_SUBST(BZIP2_LIBS)
11830 dnl ===================================================================
11831 dnl Test whether to enable extension update
11832 dnl ===================================================================
11833 AC_MSG_CHECKING([whether to enable extension update])
11834 ENABLE_EXTENSION_UPDATE=
11835 if test "x$enable_extension_update" = "xno"; then
11836 AC_MSG_RESULT([no])
11838 AC_MSG_RESULT([yes])
11839 ENABLE_EXTENSION_UPDATE="TRUE"
11840 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11841 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11843 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11846 dnl ===================================================================
11847 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11848 dnl ===================================================================
11849 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11850 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11851 AC_MSG_RESULT([no])
11854 AC_MSG_RESULT([yes])
11855 ENABLE_SILENT_MSI=TRUE
11856 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11858 AC_SUBST(ENABLE_SILENT_MSI)
11860 AC_MSG_CHECKING([whether and how to use Xinerama])
11861 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11862 if test "$x_libraries" = "default_x_libraries"; then
11863 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11864 if test "x$XINERAMALIB" = x; then
11865 XINERAMALIB="/usr/lib"
11868 XINERAMALIB="$x_libraries"
11870 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11871 # we have both versions, let the user decide but use the dynamic one
11874 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11875 XINERAMA_LINK=dynamic
11877 XINERAMA_LINK=static
11879 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11880 # we have only the dynamic version
11882 XINERAMA_LINK=dynamic
11883 elif test -e "$XINERAMALIB/libXinerama.a"; then
11885 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11887 XINERAMA_LINK=static
11897 if test "$USE_XINERAMA" = "TRUE"; then
11898 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11899 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11900 [AC_MSG_ERROR(Xinerama header not found.)], [])
11901 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11902 if test "x$XEXTLIB" = x; then
11903 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11905 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11906 if test "$_os" = "FreeBSD"; then
11907 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11909 if test "$_os" = "Linux"; then
11910 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11912 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11913 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11915 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11920 AC_MSG_RESULT([no])
11922 AC_SUBST(USE_XINERAMA)
11923 AC_SUBST(XINERAMA_LINK)
11925 dnl ===================================================================
11926 dnl Test whether to build cairo or rely on the system version
11927 dnl ===================================================================
11929 if test "$USING_X11" = TRUE; then
11930 # Used in vcl/Library_vclplug_gen.mk
11934 if test "$test_cairo" = "yes"; then
11935 AC_MSG_CHECKING([whether to use the system cairo])
11937 : ${with_system_cairo:=$with_system_libs}
11938 if test "$with_system_cairo" = "yes"; then
11940 AC_MSG_RESULT([yes])
11942 PKG_CHECK_MODULES( CAIRO, cairo >= 1.8.0 )
11943 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11944 FilterLibs "${CAIRO_LIBS}"
11945 CAIRO_LIBS="${filteredlibs}"
11947 if test "$test_xrender" = "yes"; then
11948 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11950 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11951 #ifdef PictStandardA8
11955 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11961 AC_MSG_RESULT([no])
11963 BUILD_TYPE="$BUILD_TYPE CAIRO"
11967 AC_SUBST(SYSTEM_CAIRO)
11968 AC_SUBST(CAIRO_CFLAGS)
11969 AC_SUBST(CAIRO_LIBS)
11971 dnl ===================================================================
11972 dnl Test whether to use avahi
11973 dnl ===================================================================
11974 if test "$_os" = "WINNT"; then
11975 # Windows uses bundled mDNSResponder
11976 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11977 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11978 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11979 [ENABLE_AVAHI="TRUE"])
11980 AC_DEFINE(HAVE_FEATURE_AVAHI)
11981 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11982 FilterLibs "${AVAHI_LIBS}"
11983 AVAHI_LIBS="${filteredlibs}"
11986 AC_SUBST(ENABLE_AVAHI)
11987 AC_SUBST(AVAHI_CFLAGS)
11988 AC_SUBST(AVAHI_LIBS)
11990 dnl ===================================================================
11991 dnl Test whether to use liblangtag
11992 dnl ===================================================================
11994 AC_MSG_CHECKING([whether to use system liblangtag])
11995 if test "$with_system_liblangtag" = yes; then
11996 SYSTEM_LIBLANGTAG=TRUE
11997 AC_MSG_RESULT([yes])
11998 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11999 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
12000 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
12001 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12002 FilterLibs "${LIBLANGTAG_LIBS}"
12003 LIBLANGTAG_LIBS="${filteredlibs}"
12006 AC_MSG_RESULT([no])
12007 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
12008 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
12009 if test "$COM" = "MSC"; then
12010 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
12012 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
12015 AC_SUBST(SYSTEM_LIBLANGTAG)
12016 AC_SUBST(LIBLANGTAG_CFLAGS)
12017 AC_SUBST(LIBLANGTAG_LIBS)
12019 dnl ===================================================================
12020 dnl Test whether to build libpng or rely on the system version
12021 dnl ===================================================================
12023 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
12025 dnl ===================================================================
12026 dnl Check for runtime JVM search path
12027 dnl ===================================================================
12028 if test "$ENABLE_JAVA" != ""; then
12029 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
12030 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
12031 AC_MSG_RESULT([yes])
12032 if ! test -d "$with_jvm_path"; then
12033 AC_MSG_ERROR(["$with_jvm_path" not a directory])
12035 if ! test -d "$with_jvm_path"jvm; then
12036 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
12038 JVM_ONE_PATH_CHECK="$with_jvm_path"
12039 AC_SUBST(JVM_ONE_PATH_CHECK)
12041 AC_MSG_RESULT([no])
12045 dnl ===================================================================
12046 dnl Test for the presence of Ant and that it works
12047 dnl ===================================================================
12049 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
12050 ANT_HOME=; export ANT_HOME
12051 WITH_ANT_HOME=; export WITH_ANT_HOME
12052 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
12053 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
12054 if test "$_os" = "WINNT"; then
12055 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
12057 with_ant_home="$LODE_HOME/opt/ant"
12059 elif test -x "$LODE_HOME/opt/bin/ant" ; then
12060 with_ant_home="$LODE_HOME/opt/ant"
12063 if test -z "$with_ant_home"; then
12064 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
12066 if test "$_os" = "WINNT"; then
12067 # AC_PATH_PROGS needs unix path
12068 with_ant_home=`cygpath -u "$with_ant_home"`
12070 AbsolutePath "$with_ant_home"
12071 with_ant_home=$absolute_path
12072 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
12073 WITH_ANT_HOME=$with_ant_home
12074 ANT_HOME=$with_ant_home
12077 if test -z "$ANT"; then
12078 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
12080 # resolve relative or absolute symlink
12081 while test -h "$ANT"; do
12083 a_basename=`basename "$ANT"`
12084 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
12085 cd "`dirname "$ANT"`"
12086 cd "`dirname "$a_script"`"
12087 ANT="`pwd`"/"`basename "$a_script"`"
12091 AC_MSG_CHECKING([if $ANT works])
12092 mkdir -p conftest.dir
12095 cat > conftest.java << EOF
12096 public class conftest {
12097 int testmethod(int a, int b) {
12103 cat > conftest.xml << EOF
12104 <project name="conftest" default="conftest">
12105 <target name="conftest">
12106 <javac srcdir="." includes="conftest.java">
12112 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
12113 if test $? = 0 -a -f ./conftest.class; then
12114 AC_MSG_RESULT([Ant works])
12115 if test -z "$WITH_ANT_HOME"; then
12116 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
12117 if test -z "$ANT_HOME"; then
12118 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
12121 ANT_HOME="$WITH_ANT_HOME"
12124 echo "configure: Ant test failed" >&5
12125 cat conftest.java >&5
12126 cat conftest.xml >&5
12127 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
12130 rm -fr conftest.dir
12132 if test -z "$ANT_HOME"; then
12133 ANT_HOME="NO_ANT_HOME"
12135 PathFormat "$ANT_HOME"
12136 ANT_HOME="$formatted_path"
12138 ANT="$formatted_path"
12143 dnl Checking for ant.jar
12144 if test "$ANT_HOME" != "NO_ANT_HOME"; then
12145 AC_MSG_CHECKING([Ant lib directory])
12146 if test -f $ANT_HOME/lib/ant.jar; then
12147 ANT_LIB="$ANT_HOME/lib"
12149 if test -f $ANT_HOME/ant.jar; then
12150 ANT_LIB="$ANT_HOME"
12152 if test -f /usr/share/java/ant.jar; then
12153 ANT_LIB=/usr/share/java
12155 if test -f /usr/share/ant-core/lib/ant.jar; then
12156 ANT_LIB=/usr/share/ant-core/lib
12158 if test -f $ANT_HOME/lib/ant/ant.jar; then
12159 ANT_LIB="$ANT_HOME/lib/ant"
12161 if test -f /usr/share/lib/ant/ant.jar; then
12162 ANT_LIB=/usr/share/lib/ant
12164 AC_MSG_ERROR([Ant libraries not found!])
12171 PathFormat "$ANT_LIB"
12172 ANT_LIB="$formatted_path"
12173 AC_MSG_RESULT([Ant lib directory found.])
12178 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
12180 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
12181 ant_version=`"$ANT" -version | $AWK '$3 == "version" { print $4; }'`
12182 ant_version_major=`echo $ant_version | cut -d. -f1`
12183 ant_version_minor=`echo $ant_version | cut -d. -f2`
12184 echo "configure: ant_version $ant_version " >&5
12185 echo "configure: ant_version_major $ant_version_major " >&5
12186 echo "configure: ant_version_minor $ant_version_minor " >&5
12187 if test "$ant_version_major" -ge "2"; then
12188 AC_MSG_RESULT([yes, $ant_version])
12189 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
12190 AC_MSG_RESULT([yes, $ant_version])
12192 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
12195 rm -f conftest* core core.* *.core
12199 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12200 AC_MSG_CHECKING([for JUnit 4])
12201 if test "$with_junit" = "yes"; then
12202 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
12203 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
12204 elif test -e /usr/share/java/junit4.jar; then
12205 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
12207 if test -e /usr/share/lib/java/junit.jar; then
12208 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
12210 OOO_JUNIT_JAR=/usr/share/java/junit.jar
12214 OOO_JUNIT_JAR=$with_junit
12216 if test "$_os" = "WINNT"; then
12217 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
12219 printf 'import org.junit.Before;' > conftest.java
12220 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12221 AC_MSG_RESULT([$OOO_JUNIT_JAR])
12224 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
12225 specify its pathname via --with-junit=..., or disable it via --without-junit])
12227 rm -f conftest.class conftest.java
12228 if test $OOO_JUNIT_JAR != ""; then
12229 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
12232 AC_SUBST(OOO_JUNIT_JAR)
12235 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12236 AC_MSG_CHECKING([for included Hamcrest])
12237 printf 'import org.hamcrest.BaseDescription;' > conftest.java
12238 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12239 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
12241 AC_MSG_RESULT([Not included])
12242 AC_MSG_CHECKING([for standalone hamcrest jar.])
12243 if test "$with_hamcrest" = "yes"; then
12244 if test -e /usr/share/lib/java/hamcrest.jar; then
12245 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
12246 elif test -e /usr/share/java/hamcrest/core.jar; then
12247 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
12249 HAMCREST_JAR=/usr/share/java/hamcrest.jar
12252 HAMCREST_JAR=$with_hamcrest
12254 if test "$_os" = "WINNT"; then
12255 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
12257 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
12258 AC_MSG_RESULT([$HAMCREST_JAR])
12260 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),
12261 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
12264 rm -f conftest.class conftest.java
12266 AC_SUBST(HAMCREST_JAR)
12272 # check for wget and curl
12277 if test "$enable_fetch_external" != "no"; then
12279 CURL=`which curl 2>/dev/null`
12281 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12283 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
12284 if test $? -eq 0; then
12290 if test -z "$WGET" -a -z "$CURL"; then
12291 AC_MSG_ERROR([neither wget nor curl found!])
12300 # check for sha256sum
12304 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
12305 eval "$i -a 256 --version" > /dev/null 2>&1
12307 if test $ret -eq 0; then
12308 SHA256SUM="$i -a 256"
12313 if test -z "$SHA256SUM"; then
12314 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
12315 eval "$i --version" > /dev/null 2>&1
12317 if test $ret -eq 0; then
12324 if test -z "$SHA256SUM"; then
12325 AC_MSG_ERROR([no sha256sum found!])
12328 AC_SUBST(SHA256SUM)
12330 dnl ===================================================================
12331 dnl Dealing with l10n options
12332 dnl ===================================================================
12333 AC_MSG_CHECKING([which languages to be built])
12334 # get list of all languages
12335 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12336 # the sed command does the following:
12337 # + if a line ends with a backslash, append the next line to it
12338 # + adds " on the beginning of the value (after =)
12339 # + adds " at the end of the value
12340 # + removes en-US; we want to put it on the beginning
12341 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12342 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' $SRC_ROOT/solenv/inc/langlist.mk)]
12343 ALL_LANGS="en-US $completelangiso"
12344 # check the configured localizations
12345 WITH_LANG="$with_lang"
12347 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
12348 # (Norwegian is "nb" and "nn".)
12349 if test "$WITH_LANG" = "no"; then
12353 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12354 AC_MSG_RESULT([en-US])
12356 AC_MSG_RESULT([$WITH_LANG])
12357 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12358 if test -z "$MSGFMT"; then
12359 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12360 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12361 elif test -x "/opt/lo/bin/msgfmt"; then
12362 MSGFMT="/opt/lo/bin/msgfmt"
12364 AC_CHECK_PROGS(MSGFMT, [msgfmt])
12365 if test -z "$MSGFMT"; then
12366 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12370 if test -z "$MSGUNIQ"; then
12371 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12372 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12373 elif test -x "/opt/lo/bin/msguniq"; then
12374 MSGUNIQ="/opt/lo/bin/msguniq"
12376 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12377 if test -z "$MSGUNIQ"; then
12378 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12385 # check that the list is valid
12386 for lang in $WITH_LANG; do
12387 test "$lang" = "ALL" && continue
12388 # need to check for the exact string, so add space before and after the list of all languages
12389 for vl in $ALL_LANGS; do
12390 if test "$vl" = "$lang"; then
12394 if test "$vl" != "$lang"; then
12395 # if you're reading this - you prolly quoted your languages remove the quotes ...
12396 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12399 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12400 echo $WITH_LANG | grep -q en-US
12401 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12403 # list with substituted ALL
12404 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12405 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12406 test "$WITH_LANG" = "en-US" && WITH_LANG=
12407 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12408 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12409 ALL_LANGS=`echo $ALL_LANGS qtz`
12411 AC_SUBST(ALL_LANGS)
12412 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12413 AC_SUBST(WITH_LANG)
12414 AC_SUBST(WITH_LANG_LIST)
12415 AC_SUBST(GIT_NEEDED_SUBMODULES)
12417 WITH_POOR_HELP_LOCALIZATIONS=
12418 if test -d "$SRC_ROOT/translations/source"; then
12419 for l in `ls -1 $SRC_ROOT/translations/source`; do
12420 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12421 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12425 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12427 if test -n "$with_locales"; then
12428 WITH_LOCALES="$with_locales"
12430 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12431 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12432 # config_host/config_locales.h.in
12433 for locale in $WITH_LOCALES; do
12436 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12440 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12443 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12448 AC_DEFINE(WITH_LOCALE_ALL)
12450 AC_SUBST(WITH_LOCALES)
12452 dnl git submodule update --reference
12453 dnl ===================================================================
12454 if test -n "${GIT_REFERENCE_SRC}"; then
12455 for repo in ${GIT_NEEDED_SUBMODULES}; do
12456 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12457 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12461 AC_SUBST(GIT_REFERENCE_SRC)
12463 dnl git submodules linked dirs
12464 dnl ===================================================================
12465 if test -n "${GIT_LINK_SRC}"; then
12466 for repo in ${GIT_NEEDED_SUBMODULES}; do
12467 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12468 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12472 AC_SUBST(GIT_LINK_SRC)
12475 dnl ===================================================================
12476 AC_MSG_CHECKING([for alternative branding images directory])
12477 # initialize mapped arrays
12478 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12479 brand_files="$BRAND_INTRO_IMAGES about.svg"
12481 if test -z "$with_branding" -o "$with_branding" = "no"; then
12482 AC_MSG_RESULT([none])
12483 DEFAULT_BRAND_IMAGES="$brand_files"
12485 if ! test -d $with_branding ; then
12486 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12488 AC_MSG_RESULT([$with_branding])
12489 CUSTOM_BRAND_DIR="$with_branding"
12490 for lfile in $brand_files
12492 if ! test -f $with_branding/$lfile ; then
12493 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12494 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12496 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12499 check_for_progress="yes"
12502 AC_SUBST([BRAND_INTRO_IMAGES])
12503 AC_SUBST([CUSTOM_BRAND_DIR])
12504 AC_SUBST([CUSTOM_BRAND_IMAGES])
12505 AC_SUBST([DEFAULT_BRAND_IMAGES])
12508 AC_MSG_CHECKING([for 'intro' progress settings])
12512 PROGRESSFRAMECOLOR=
12514 PROGRESSTEXTBASELINE=
12516 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12517 source "$with_branding/progress.conf"
12518 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12520 AC_MSG_RESULT([none])
12523 AC_SUBST(PROGRESSBARCOLOR)
12524 AC_SUBST(PROGRESSSIZE)
12525 AC_SUBST(PROGRESSPOSITION)
12526 AC_SUBST(PROGRESSFRAMECOLOR)
12527 AC_SUBST(PROGRESSTEXTCOLOR)
12528 AC_SUBST(PROGRESSTEXTBASELINE)
12531 AC_MSG_CHECKING([for extra build ID])
12532 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12533 EXTRA_BUILDID="$with_extra_buildid"
12535 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12536 if test -n "$EXTRA_BUILDID" ; then
12537 AC_MSG_RESULT([$EXTRA_BUILDID])
12539 AC_MSG_RESULT([not set])
12541 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12544 AC_MSG_CHECKING([for vendor])
12545 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12546 OOO_VENDOR="$USERNAME"
12548 if test -z "$OOO_VENDOR"; then
12552 if test -z "$OOO_VENDOR"; then
12553 OOO_VENDOR="`id -u -n`"
12556 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12558 OOO_VENDOR="$with_vendor"
12559 AC_MSG_RESULT([$OOO_VENDOR])
12561 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12562 AC_SUBST(OOO_VENDOR)
12564 if test "$_os" = "Android" ; then
12565 ANDROID_PACKAGE_NAME=
12566 AC_MSG_CHECKING([for Android package name])
12567 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12568 if test -n "$ENABLE_DEBUG"; then
12569 # Default to the package name that makes ndk-gdb happy.
12570 ANDROID_PACKAGE_NAME="org.libreoffice"
12572 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12575 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12577 ANDROID_PACKAGE_NAME="$with_android_package_name"
12578 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12580 AC_SUBST(ANDROID_PACKAGE_NAME)
12583 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12584 if test "$with_compat_oowrappers" = "yes"; then
12585 WITH_COMPAT_OOWRAPPERS=TRUE
12588 WITH_COMPAT_OOWRAPPERS=
12591 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12593 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12594 AC_MSG_CHECKING([for install dirname])
12595 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12596 INSTALLDIRNAME="$with_install_dirname"
12598 AC_MSG_RESULT([$INSTALLDIRNAME])
12599 AC_SUBST(INSTALLDIRNAME)
12601 AC_MSG_CHECKING([for prefix])
12602 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12603 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12604 PREFIXDIR="$prefix"
12605 AC_MSG_RESULT([$PREFIXDIR])
12606 AC_SUBST(PREFIXDIR)
12608 LIBDIR=[$(eval echo $(eval echo $libdir))]
12611 DATADIR=[$(eval echo $(eval echo $datadir))]
12614 MANDIR=[$(eval echo $(eval echo $mandir))]
12617 DOCDIR=[$(eval echo $(eval echo $docdir))]
12620 BINDIR=[$(eval echo $(eval echo $bindir))]
12623 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12624 AC_SUBST(INSTALLDIR)
12626 TESTINSTALLDIR="${BUILDDIR}/test-install"
12627 AC_SUBST(TESTINSTALLDIR)
12630 # ===================================================================
12631 # OAuth2 id and secrets
12632 # ===================================================================
12634 AC_MSG_CHECKING([for Google Drive client id and secret])
12635 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12636 AC_MSG_RESULT([not set])
12637 GDRIVE_CLIENT_ID="\"\""
12638 GDRIVE_CLIENT_SECRET="\"\""
12640 AC_MSG_RESULT([set])
12641 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12642 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12644 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12645 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12647 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12648 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12649 AC_MSG_RESULT([not set])
12650 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12651 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12653 AC_MSG_RESULT([set])
12654 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12655 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12657 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12658 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12660 AC_MSG_CHECKING([for OneDrive client id and secret])
12661 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12662 AC_MSG_RESULT([not set])
12663 ONEDRIVE_CLIENT_ID="\"\""
12664 ONEDRIVE_CLIENT_SECRET="\"\""
12666 AC_MSG_RESULT([set])
12667 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12668 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12670 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12671 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12674 dnl ===================================================================
12675 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12676 dnl --enable-dependency-tracking configure option
12677 dnl ===================================================================
12678 AC_MSG_CHECKING([whether to enable dependency tracking])
12679 if test "$enable_dependency_tracking" = "no"; then
12681 AC_MSG_RESULT([no])
12683 AC_MSG_RESULT([yes])
12687 dnl ===================================================================
12688 dnl Number of CPUs to use during the build
12689 dnl ===================================================================
12690 AC_MSG_CHECKING([for number of processors to use])
12691 # plain --with-parallelism is just the default
12692 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12693 if test "$with_parallelism" = "no"; then
12696 PARALLELISM=$with_parallelism
12699 if test "$enable_icecream" = "yes"; then
12704 Darwin|FreeBSD|NetBSD|OpenBSD)
12705 PARALLELISM=`sysctl -n hw.ncpu`
12709 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12711 # what else than above does profit here *and* has /proc?
12713 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12717 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12718 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12722 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12723 if test -z "$with_parallelism"; then
12724 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12725 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12728 add_warning "make 3.81 is prone to crashes with parallelism > 1. Since --with-parallelism was explicitly given, it is honored, but do not complain when make segfaults on you."
12732 if test $PARALLELISM -eq 0; then
12733 AC_MSG_RESULT([explicit make -j option needed])
12735 AC_MSG_RESULT([$PARALLELISM])
12737 AC_SUBST(PARALLELISM)
12739 IWYU_PATH="$with_iwyu"
12740 AC_SUBST(IWYU_PATH)
12741 if test ! -z "$IWYU_PATH"; then
12742 if test ! -f "$IWYU_PATH"; then
12743 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12748 # Set up ILIB for MSVC build
12751 if test "$build_os" = "cygwin"; then
12753 if test -n "$JAVA_HOME"; then
12754 ILIB="$ILIB;$JAVA_HOME/lib"
12757 if test "$BITNESS_OVERRIDE" = 64; then
12758 ILIB="$ILIB;$COMPATH/lib/x64"
12759 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12760 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12761 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12762 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12763 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12764 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12766 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12767 ucrtlibpath_formatted=$formatted_path
12768 ILIB="$ILIB;$ucrtlibpath_formatted"
12769 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12771 ILIB="$ILIB;$COMPATH/lib/x86"
12772 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12773 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12774 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12775 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12776 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12777 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12779 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12780 ucrtlibpath_formatted=$formatted_path
12781 ILIB="$ILIB;$ucrtlibpath_formatted"
12782 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12784 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12785 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12787 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12793 # ===================================================================
12794 # Creating bigger shared library to link against
12795 # ===================================================================
12796 AC_MSG_CHECKING([whether to create huge library])
12799 if test $_os = iOS -o $_os = Android; then
12800 # Never any point in mergelibs for these as we build just static
12801 # libraries anyway...
12802 enable_mergelibs=no
12805 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12806 if test $_os != Linux -a $_os != WINNT; then
12807 add_warning "--enable-mergelibs is not tested for this platform"
12810 AC_MSG_RESULT([yes])
12812 AC_MSG_RESULT([no])
12814 AC_SUBST([MERGELIBS])
12816 dnl ===================================================================
12817 dnl icerun is a wrapper that stops us spawning tens of processes
12818 dnl locally - for tools that can't be executed on the compile cluster
12819 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12820 dnl ===================================================================
12821 AC_MSG_CHECKING([whether to use icerun wrapper])
12823 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12824 ICECREAM_RUN=icerun
12825 AC_MSG_RESULT([yes])
12827 AC_MSG_RESULT([no])
12829 AC_SUBST(ICECREAM_RUN)
12831 dnl ===================================================================
12832 dnl Setup the ICECC_VERSION for the build the same way it was set for
12833 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12834 dnl ===================================================================
12835 x_ICECC_VERSION=[\#]
12836 if test -n "$ICECC_VERSION" ; then
12839 AC_SUBST(x_ICECC_VERSION)
12840 AC_SUBST(ICECC_VERSION)
12842 dnl ===================================================================
12844 AC_MSG_CHECKING([MPL subset])
12847 if test "$enable_mpl_subset" = "yes"; then
12849 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12851 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12854 if test "$warn_report" = "true"; then
12855 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12857 if test "x$enable_postgresql_sdbc" != "xno"; then
12858 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12860 if test "$enable_lotuswordpro" = "yes"; then
12861 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12863 if test "$WITH_WEBDAV" = "neon"; then
12864 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12866 if test -n "$ENABLE_POPPLER"; then
12867 if test "x$SYSTEM_POPPLER" = "x"; then
12868 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12871 # cf. m4/libo_check_extension.m4
12872 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12873 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12875 for theme in $WITH_THEMES; do
12877 breeze|breeze_dark|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg) #blacklist of icon themes under GPL or LGPL
12878 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12883 ENABLE_OPENGL_TRANSITIONS=
12885 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12886 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12890 AC_DEFINE(MPL_HAVE_SUBSET)
12891 AC_MSG_RESULT([only])
12893 AC_MSG_RESULT([no restrictions])
12895 AC_SUBST(MPL_SUBSET)
12897 dnl ===================================================================
12899 AC_MSG_CHECKING([formula logger])
12900 ENABLE_FORMULA_LOGGER=
12902 if test "x$enable_formula_logger" = "xyes"; then
12903 AC_MSG_RESULT([yes])
12904 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12905 ENABLE_FORMULA_LOGGER=TRUE
12906 elif test -n "$ENABLE_DBGUTIL" ; then
12907 AC_MSG_RESULT([yes])
12908 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12909 ENABLE_FORMULA_LOGGER=TRUE
12911 AC_MSG_RESULT([no])
12914 AC_SUBST(ENABLE_FORMULA_LOGGER)
12916 dnl ===================================================================
12917 dnl Setting up the environment.
12918 dnl ===================================================================
12919 AC_MSG_NOTICE([setting up the build environment variables...])
12923 if test "$build_os" = "cygwin"; then
12924 if test -d "$COMPATH/atlmfc/lib/spectre"; then
12925 ATL_LIB="$COMPATH/atlmfc/lib/spectre"
12926 ATL_INCLUDE="$COMPATH/atlmfc/include"
12927 elif test -d "$COMPATH/atlmfc/lib"; then
12928 ATL_LIB="$COMPATH/atlmfc/lib"
12929 ATL_INCLUDE="$COMPATH/atlmfc/include"
12931 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12932 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12934 if test "$BITNESS_OVERRIDE" = 64; then
12935 ATL_LIB="$ATL_LIB/x64"
12937 ATL_LIB="$ATL_LIB/x86"
12939 ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
12940 ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
12942 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12943 PathFormat "/usr/bin/find.exe"
12944 FIND="$formatted_path"
12945 PathFormat "/usr/bin/sort.exe"
12946 SORT="$formatted_path"
12947 PathFormat "/usr/bin/grep.exe"
12948 WIN_GREP="$formatted_path"
12949 PathFormat "/usr/bin/ls.exe"
12950 WIN_LS="$formatted_path"
12951 PathFormat "/usr/bin/touch.exe"
12952 WIN_TOUCH="$formatted_path"
12958 AC_SUBST(ATL_INCLUDE)
12964 AC_SUBST(WIN_TOUCH)
12966 AC_SUBST(BUILD_TYPE)
12971 PERL="$formatted_path"
12974 if test -n "$TMPDIR"; then
12975 TEMP_DIRECTORY="$TMPDIR"
12977 TEMP_DIRECTORY="/tmp"
12979 if test "$build_os" = "cygwin"; then
12980 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12982 AC_SUBST(TEMP_DIRECTORY)
12984 # setup the PATH for the environment
12985 if test -n "$LO_PATH_FOR_BUILD"; then
12986 LO_PATH="$LO_PATH_FOR_BUILD"
12992 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12993 if test "$ENABLE_JAVA" != ""; then
12994 pathmunge "$JAVA_HOME/bin" "after"
12999 # Win32 make needs native paths
13000 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
13001 LO_PATH=`cygpath -p -m "$PATH"`
13003 if test "$BITNESS_OVERRIDE" = 64; then
13004 # needed for msi packaging
13005 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
13007 # .NET 4.6 and higher don't have bin directory
13008 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
13009 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
13011 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
13012 pathmunge "$CSC_PATH" "before"
13013 pathmunge "$MIDL_PATH" "before"
13014 pathmunge "$AL_PATH" "before"
13015 pathmunge "$MSPDB_PATH" "before"
13016 if test "$MSPDB_PATH" != "$CL_PATH" ; then
13017 pathmunge "$CL_PATH" "before"
13019 if test -n "$MSBUILD_PATH" ; then
13020 pathmunge "$MSBUILD_PATH" "before"
13022 if test "$BITNESS_OVERRIDE" = 64; then
13023 pathmunge "$COMPATH/bin/amd64" "before"
13024 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
13026 pathmunge "$COMPATH/bin" "before"
13027 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
13029 if test "$ENABLE_JAVA" != ""; then
13030 if test -d "$JAVA_HOME/jre/bin/client"; then
13031 pathmunge "$JAVA_HOME/jre/bin/client" "before"
13033 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
13034 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
13036 pathmunge "$JAVA_HOME/bin" "before"
13041 pathmunge "/usr/css/bin" "before"
13042 if test "$ENABLE_JAVA" != ""; then
13043 pathmunge "$JAVA_HOME/bin" "after"
13053 # Generate a configuration sha256 we can use for deps
13054 if test -f config_host.mk; then
13055 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
13057 if test -f config_host_lang.mk; then
13058 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
13061 CFLAGS=$my_original_CFLAGS
13062 CXXFLAGS=$my_original_CXXFLAGS
13063 CPPFLAGS=$my_original_CPPFLAGS
13065 AC_CONFIG_FILES([config_host.mk
13066 config_host_lang.mk
13068 bin/bffvalidator.sh
13069 bin/odfvalidator.sh
13071 instsetoo_native/util/openoffice.lst
13072 sysui/desktop/macosx/Info.plist])
13073 AC_CONFIG_HEADERS([config_host/config_buildid.h])
13074 AC_CONFIG_HEADERS([config_host/config_clang.h])
13075 AC_CONFIG_HEADERS([config_host/config_dconf.h])
13076 AC_CONFIG_HEADERS([config_host/config_eot.h])
13077 AC_CONFIG_HEADERS([config_host/config_extensions.h])
13078 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
13079 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
13080 AC_CONFIG_HEADERS([config_host/config_dbus.h])
13081 AC_CONFIG_HEADERS([config_host/config_features.h])
13082 AC_CONFIG_HEADERS([config_host/config_feature_desktop.h])
13083 AC_CONFIG_HEADERS([config_host/config_feature_opencl.h])
13084 AC_CONFIG_HEADERS([config_host/config_firebird.h])
13085 AC_CONFIG_HEADERS([config_host/config_folders.h])
13086 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
13087 AC_CONFIG_HEADERS([config_host/config_gio.h])
13088 AC_CONFIG_HEADERS([config_host/config_global.h])
13089 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
13090 AC_CONFIG_HEADERS([config_host/config_java.h])
13091 AC_CONFIG_HEADERS([config_host/config_langs.h])
13092 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
13093 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
13094 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
13095 AC_CONFIG_HEADERS([config_host/config_libnumbertext.h])
13096 AC_CONFIG_HEADERS([config_host/config_locales.h])
13097 AC_CONFIG_HEADERS([config_host/config_mpl.h])
13098 AC_CONFIG_HEADERS([config_host/config_oox.h])
13099 AC_CONFIG_HEADERS([config_host/config_options.h])
13100 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
13101 AC_CONFIG_HEADERS([config_host/config_skia.h])
13102 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
13103 AC_CONFIG_HEADERS([config_host/config_vendor.h])
13104 AC_CONFIG_HEADERS([config_host/config_vcl.h])
13105 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
13106 AC_CONFIG_HEADERS([config_host/config_version.h])
13107 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
13108 AC_CONFIG_HEADERS([config_host/config_poppler.h])
13109 AC_CONFIG_HEADERS([config_host/config_python.h])
13110 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
13113 if test "$CROSS_COMPILING" = TRUE; then
13114 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
13117 # touch the config timestamp file
13118 if test ! -f config_host.mk.stamp; then
13119 echo > config_host.mk.stamp
13120 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
13121 echo "Host Configuration unchanged - avoiding scp2 stamp update"
13123 echo > config_host.mk.stamp
13126 # touch the config lang timestamp file
13127 if test ! -f config_host_lang.mk.stamp; then
13128 echo > config_host_lang.mk.stamp
13129 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
13130 echo "Language Configuration unchanged - avoiding scp2 stamp update"
13132 echo > config_host_lang.mk.stamp
13136 if test \( "$STALE_MAKE" = "TRUE" -o "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE" \) \
13137 -a "$build_os" = "cygwin"; then
13140 ****************************************************************************
13142 Your make version is known to be horribly slow, and hard to debug
13143 problems with. To get a reasonably functional make please do:
13145 to install a pre-compiled binary make for Win32
13147 mkdir -p /opt/lo/bin
13149 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
13150 cp make-4.2.1-msvc.exe make
13153 to install from source:
13154 place yourself in a working directory of you choice.
13156 git clone git://git.savannah.gnu.org/make.git
13158 [go to Start menu, open "Visual Studio 2017", click "VS2017 x86 Native Tools Command Prompt" or "VS2017 x64 Native Tools Command Prompt"]
13159 set PATH=%PATH%;C:\Cygwin\bin
13160 [or Cygwin64, if that is what you have]
13161 cd path-to-make-repo-you-cloned-above
13162 build_w32.bat --without-guile
13164 should result in a WinRel/gnumake.exe.
13165 Copy it to the Cygwin /opt/lo/bin directory as make.exe
13167 Then re-run autogen.sh
13169 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
13170 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
13173 if test "$HAVE_GNUMAKE_FILE_FUNC" != "TRUE"; then
13174 AC_MSG_ERROR([no file function found; the build will fail without it; use GNU make 4.0 or later])
13180 ****************************************************************************
13185 To view some help, run:
13190 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
13192 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
13195 if test $_os = Darwin; then
13196 echo open instdir/$PRODUCTNAME.app
13198 echo instdir/program/soffice
13202 If you want to run the smoketest, run:
13208 if test -f warn; then
13213 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: