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.3.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.])
30 GIT_NEEDED_SUBMODULES=""
31 LO_PATH= # used by path_munge to construct a PATH variable
38 # let's start with Fedora's paths for now
39 -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
40 # ignore it: on UNIXoids it is searched by default anyway
41 # but if it's given explicitly then it may override other paths
42 # (on macOS it would be an error to use it instead of SDK)
45 filteredlibs="$filteredlibs $f"
54 if test "$build_os" = "cygwin"; then
56 # spaces,parentheses,brackets,braces are problematic in pathname
58 case "$formatted_path" in
59 *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
63 if test "$pf_conv_to_dos" = "yes"; then
64 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
65 formatted_path=`cygpath -sm "$formatted_path"`
67 formatted_path=`cygpath -d "$formatted_path"`
69 if test $? -ne 0; then
70 AC_MSG_ERROR([path conversion failed for "$1".])
73 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
74 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
75 if test "$fp_count_slash$fp_count_colon" != "00"; then
76 if test "$fp_count_colon" = "0"; then
77 new_formatted_path=`realpath "$formatted_path"`
78 if test $? -ne 0; then
79 AC_MSG_WARN([realpath failed for "$1", not necessarily a problem.])
81 formatted_path="$new_formatted_path"
84 formatted_path=`cygpath -m "$formatted_path"`
85 if test $? -ne 0; then
86 AC_MSG_ERROR([path conversion failed for "$1".])
89 fp_count_space=`echo "$formatted_path" | $GREP -c "[ ]"`
90 if test "$fp_count_space" != "0"; then
91 AC_MSG_ERROR([converted path "$formatted_path" still contains spaces. Short filenames (8.3 filenames) support was disabled on this system?])
98 # There appears to be no simple and portable method to get an absolute and
99 # canonical path, so we try creating the directory if does not exist and
100 # utilizing the shell and pwd.
103 test ! -e "$rel" && mkdir -p "$rel"
104 if test -d "$rel" ; then
105 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
106 absolute_path="$(pwd)"
109 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
117 if test "$have_WARNINGS" = "no"; then
118 echo "*************************************" > warn
120 if which tput >/dev/null && test "`tput colors 2>/dev/null || echo 0`" -ge 8; then
121 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
122 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
124 COLORWARN="* WARNING :"
127 echo "$COLORWARN $@" >> warn
130 dnl Some Mac User have the bad habit of letting a lot of crap
131 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
132 dnl that confuse the build.
133 dnl For the ones that use LODE, let's be nice and protect them
138 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
139 dnl a common but nevertheless necessary thing that may be in a fancy
140 dnl path location is git, so make sure we have it
141 mac_git_path=`which git 2>/dev/null`
142 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
143 mac_path="$mac_path:`dirname $mac_git_path`"
145 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
146 dnl path location is gpg, so make sure we find it
147 mac_gpg_path=`which gpg 2>/dev/null`
148 if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
149 mac_path="$mac_path:`dirname $mac_gpg_path`"
157 echo "********************************************************************"
159 echo "* Running ${PACKAGE_NAME} build configuration."
161 echo "********************************************************************"
164 dnl ===================================================================
165 dnl checks build and host OSes
166 dnl do this before argument processing to allow for platform dependent defaults
167 dnl ===================================================================
170 AC_MSG_CHECKING([for product name])
171 PRODUCTNAME="AC_PACKAGE_NAME"
172 if test -n "$with_product_name" -a "$with_product_name" != no; then
173 PRODUCTNAME="$with_product_name"
175 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
176 PRODUCTNAME="${PRODUCTNAME}Dev"
178 AC_MSG_RESULT([$PRODUCTNAME])
179 AC_SUBST(PRODUCTNAME)
180 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
181 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
183 dnl ===================================================================
184 dnl Our version is defined by the AC_INIT() at the top of this script.
185 dnl ===================================================================
187 AC_MSG_CHECKING([for package version])
188 if test -n "$with_package_version" -a "$with_package_version" != no; then
189 PACKAGE_VERSION="$with_package_version"
191 AC_MSG_RESULT([$PACKAGE_VERSION])
193 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
195 LIBO_VERSION_MAJOR=$1
196 LIBO_VERSION_MINOR=$2
197 LIBO_VERSION_MICRO=$3
198 LIBO_VERSION_PATCH=$4
200 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
201 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
202 # no way to encode that into an integer in general.
203 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
205 LIBO_VERSION_SUFFIX=$5
206 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
207 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
208 # they get undoubled before actually passed to sed.
209 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
210 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
211 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
212 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
214 AC_SUBST(LIBO_VERSION_MAJOR)
215 AC_SUBST(LIBO_VERSION_MINOR)
216 AC_SUBST(LIBO_VERSION_MICRO)
217 AC_SUBST(LIBO_VERSION_PATCH)
218 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
219 AC_SUBST(LIBO_VERSION_SUFFIX)
220 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
222 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
223 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
224 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
225 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
227 LIBO_THIS_YEAR=`date +%Y`
228 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
230 dnl ===================================================================
232 dnl ===================================================================
233 AC_MSG_CHECKING([for product version])
234 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
235 AC_MSG_RESULT([$PRODUCTVERSION])
236 AC_SUBST(PRODUCTVERSION)
239 # AC_PROG_EGREP doesn't set GREP on all systems as well
240 AC_PATH_PROG(GREP, grep)
248 dnl ======================================
249 dnl Required GObject introspection version
250 dnl ======================================
251 INTROSPECTION_REQUIRED_VERSION=1.32.0
253 dnl ===================================================================
254 dnl Search all the common names for GNU Make
255 dnl ===================================================================
256 AC_MSG_CHECKING([for GNU Make])
258 # try to use our own make if it is available and GNUMAKE was not already defined
259 if test -z "$GNUMAKE"; then
260 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
261 GNUMAKE="$LODE_HOME/opt/bin/make"
262 elif test -x "/opt/lo/bin/make"; then
263 GNUMAKE="/opt/lo/bin/make"
268 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
269 if test -n "$a"; then
270 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
271 if test $? -eq 0; then
272 if test "$build_os" = "cygwin"; then
273 if test -n "$($a -v | grep 'Built for Windows')" ; then
274 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
275 GNUMAKE_WIN_NATIVE="TRUE"
286 AC_MSG_RESULT($GNUMAKE)
287 if test -z "$GNUMAKE"; then
288 AC_MSG_ERROR([not found. install GNU Make.])
290 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
291 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
295 win_short_path_for_make()
297 local_short_path="$1"
298 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
299 cygpath -sm "$local_short_path"
301 cygpath -u "$(cygpath -d "$local_short_path")"
306 if test "$build_os" = "cygwin"; then
307 PathFormat "$SRC_ROOT"
308 SRC_ROOT="$formatted_path"
309 PathFormat "$BUILDDIR"
310 BUILDDIR="$formatted_path"
312 AC_MSG_CHECKING(for explicit COMSPEC)
313 if test -z "$COMSPEC"; then
314 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
316 AC_MSG_RESULT([found: $COMSPEC])
323 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
324 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
326 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
327 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
330 # need sed in os checks...
331 AC_PATH_PROGS(SED, sed)
332 if test -z "$SED"; then
333 AC_MSG_ERROR([install sed to run this script])
336 # Set the ENABLE_LTO variable
337 # ===================================================================
338 AC_MSG_CHECKING([whether to use link-time optimization])
339 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
342 AC_DEFINE(STATIC_LINKING)
349 AC_ARG_ENABLE(fuzz-options,
350 AS_HELP_STRING([--enable-fuzz-options],
351 [Randomly enable or disable each of those configurable options
352 that are supposed to be freely selectable without interdependencies,
353 or where bad interaction from interdependencies is automatically avoided.])
356 dnl ===================================================================
357 dnl When building for Android, --with-android-ndk,
358 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
360 dnl ===================================================================
362 AC_ARG_WITH(android-ndk,
363 AS_HELP_STRING([--with-android-ndk],
364 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
367 AC_ARG_WITH(android-ndk-toolchain-version,
368 AS_HELP_STRING([--with-android-ndk-toolchain-version],
369 [Specify which toolchain version to use, of those present in the
370 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
371 with_android_ndk_toolchain_version=clang5.0)
373 AC_ARG_WITH(android-sdk,
374 AS_HELP_STRING([--with-android-sdk],
375 [Specify location of the Android SDK. Mandatory when building for Android.]),
379 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
380 with_android_ndk="$SRC_ROOT/external/android-ndk"
382 if test -n "$with_android_ndk"; then
383 ANDROID_NDK_HOME=$with_android_ndk
385 # Set up a lot of pre-canned defaults
387 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
388 if test ! -f $ANDROID_NDK_HOME/source.properties; then
389 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
391 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
393 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
395 if test -z "$ANDROID_NDK_VERSION"; then
396 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
398 case $ANDROID_NDK_VERSION in
400 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
402 11.1.*|12.1.*|13.1.*|14.1.*)
403 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
408 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk.])
409 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk."
414 android_cpu=$host_cpu
415 ANDROID_ARCH=$android_cpu
416 if test $host_cpu = arm; then
417 android_platform_prefix=$android_cpu-linux-androideabi
418 android_gnu_prefix=$android_platform_prefix
419 LLVM_TRIPLE=armv7-none-linux-androideabi
420 ANDROID_APP_ABI=armeabi-v7a
421 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
422 elif test $host_cpu = aarch64; then
423 android_platform_prefix=$android_cpu-linux-android
424 android_gnu_prefix=$android_platform_prefix
425 LLVM_TRIPLE=aarch64-none-linux-android
426 # minimum android version that supports aarch64
428 ANDROID_APP_ABI=arm64-v8a
430 elif test $host_cpu = mips; then
431 android_platform_prefix=mipsel-linux-android
432 android_gnu_prefix=$android_platform_prefix
433 LLVM_TRIPLE=mipsel-none-linux-android
436 # host_cpu is something like "i386" or "i686" I guess, NDK uses
437 # "x86" in some contexts
439 android_platform_prefix=$android_cpu
440 android_gnu_prefix=i686-linux-android
441 LLVM_TRIPLE=i686-none-linux-android
443 ANDROID_ARCH=$android_cpu
444 ANDROIDCFLAGS="-march=atom"
447 case "$with_android_ndk_toolchain_version" in
449 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
450 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION
451 ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm
454 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
457 if test ! -d $ANDROID_BINUTILS_DIR; then
458 AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
459 elif test ! -d $ANDROID_COMPILER_DIR; then
460 AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
463 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
464 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
465 # manage to link the (app-specific) single huge .so that is built for the app in
466 # android/source/ if there is debug information in a significant part of the object files.
467 # (A 64-bit ld.gold grows too much over 10 gigabytes of virtual space when linking such a .so if
468 # all objects have been built with debug information.)
477 AC_MSG_ERROR([We only support building for Android from Linux or macOS])
480 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64/bin
481 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64
482 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
484 test -z "$SYSBASE" && SYSBASE=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}
485 test -z "$AR" && AR=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ar
486 test -z "$NM" && NM=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-nm
487 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-objdump
488 test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ranlib
489 test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-strip
491 ANDROIDCFLAGS="$ANDROIDCFLAGS -gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT -target $LLVM_TRIPLE$ANDROID_API_LEVEL -no-canonical-prefixes"
492 # android is using different sysroots for compilation and linking, but as
493 # there is no full separation in configure and elsewhere, use isystem for
494 # compilation stuff and sysroot for linking
495 ANDROIDCFLAGS="$ANDROIDCFLAGS -D__ANDROID_API__=$ANDROID_API_LEVEL -isystem $ANDROID_NDK_HOME/sysroot/usr/include"
496 ANDROIDCFLAGS="$ANDROIDCFLAGS -isystem $ANDROID_NDK_HOME/sysroot/usr/include/$android_gnu_prefix"
497 ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$SYSBASE -ffunction-sections -fdata-sections -Qunused-arguments"
498 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/$ANDROID_APP_ABI"
499 if test "$ENABLE_LTO" = TRUE; then
500 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
501 # $CC and $CXX when building external libraries
502 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
505 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++abi/include -I$ANDROID_NDK_HOME/sources/android/support/include -std=c++11"
507 if test -z "$CC"; then
508 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
510 if test -z "$CXX"; then
511 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
514 # remember to download the ownCloud Android library later
515 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
517 AC_SUBST(ANDROID_NDK_HOME)
518 AC_SUBST(ANDROID_APP_ABI)
519 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
521 dnl ===================================================================
522 dnl --with-android-sdk
523 dnl ===================================================================
525 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
526 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
528 if test -n "$with_android_sdk"; then
529 ANDROID_SDK_HOME=$with_android_sdk
530 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
532 AC_SUBST(ANDROID_SDK_HOME)
534 libo_FUZZ_ARG_ENABLE([android-editing],
535 AS_HELP_STRING([--enable-android-editing],
536 [Enable the experimental editing feature on Android.])
538 ENABLE_ANDROID_EDITING=
539 if test "$enable_android_editing" = yes; then
540 ENABLE_ANDROID_EDITING=TRUE
542 AC_SUBST([ENABLE_ANDROID_EDITING])
544 dnl ===================================================================
545 dnl The following is a list of supported systems.
546 dnl Sequential to keep the logic very simple
547 dnl These values may be checked and reset later.
548 dnl ===================================================================
549 #defaults unless the os test overrides this:
559 # Default values, as such probably valid just for Linux, set
560 # differently below just for Mac OSX, but at least better than
561 # hardcoding these as we used to do. Much of this is duplicated also
562 # in solenv for old build system and for gbuild, ideally we should
563 # perhaps define stuff like this only here in configure.ac?
565 LINKFLAGSSHL="-shared"
569 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
572 INSTROOTCONTENTSUFFIX=
579 build_gstreamer_1_0=yes
580 build_gstreamer_0_10=yes
584 dnl ===========================================================
585 dnl Check whether we're using Solaris 10 - SPARC or Intel.
586 dnl ===========================================================
587 AC_MSG_CHECKING([the Solaris operating system release])
588 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
589 if test "$_os_release" -lt "10"; then
590 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
592 AC_MSG_RESULT([ok ($_os_release)])
595 dnl Check whether we're using a SPARC or i386 processor
596 AC_MSG_CHECKING([the processor type])
597 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
598 AC_MSG_RESULT([ok ($host_cpu)])
600 AC_MSG_ERROR([only SPARC and i386 processors are supported])
604 linux-gnu*|k*bsd*-gnu*)
606 build_gstreamer_1_0=yes
607 build_gstreamer_0_10=yes
612 if test "$enable_fuzzers" != yes; then
618 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
631 # When building on Windows normally with MSVC under Cygwin,
632 # configure thinks that the host platform (the platform the
633 # built code will run on) is Cygwin, even if it obviously is
634 # Windows, which in Autoconf terminology is called
635 # "mingw32". (Which is misleading as MinGW is the name of the
636 # tool-chain, not an operating system.)
638 # Somewhat confusing, yes. But this configure script doesn't
639 # look at $host etc that much, it mostly uses its own $_os
640 # variable, set here in this case statement.
654 darwin*) # macOS or iOS
661 if test -n "$LODE_HOME" ; then
663 AC_MSG_NOTICE([sanitized the PATH to $PATH])
665 if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
670 enable_mpl_subset=yes
671 enable_lotuswordpro=no
674 enable_postgresql_sdbc=no
675 enable_extension_integration=no
676 enable_report_builder=no
678 if test "$enable_ios_simulator" = "yes"; then
679 host=x86_64-apple-darwin
683 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
684 INSTROOTCONTENTSUFFIX=/Contents
685 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
687 # See comment above the case "$host_os"
688 LINKFLAGSSHL="-dynamiclib -single_module"
695 # -undefined error is the default
701 build_gstreamer_1_0=yes
702 build_gstreamer_0_10=yes
706 AC_MSG_CHECKING([the FreeBSD operating system release])
707 if test -n "$with_os_version"; then
708 OSVERSION="$with_os_version"
710 OSVERSION=`/sbin/sysctl -n kern.osreldate`
712 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
713 AC_MSG_CHECKING([which thread library to use])
714 if test "$OSVERSION" -lt "500016"; then
715 PTHREAD_CFLAGS="-D_THREAD_SAFE"
716 PTHREAD_LIBS="-pthread"
717 elif test "$OSVERSION" -lt "502102"; then
718 PTHREAD_CFLAGS="-D_THREAD_SAFE"
722 PTHREAD_LIBS="-pthread"
724 AC_MSG_RESULT([$PTHREAD_LIBS])
730 build_gstreamer_1_0=yes
731 build_gstreamer_0_10=yes
735 PTHREAD_LIBS="-pthread -lpthread"
742 PTHREAD_LIBS=-pthread
749 PTHREAD_CFLAGS="-D_THREAD_SAFE"
750 PTHREAD_LIBS="-pthread"
756 build_gstreamer_1_0=yes
757 build_gstreamer_0_10=yes
761 PTHREAD_LIBS="-pthread"
766 build_gstreamer_1_0=no
767 build_gstreamer_0_10=no
768 enable_lotuswordpro=no
769 enable_mpl_subset=yes
772 enable_report_builder=no
774 enable_postgresql_sdbc=no
788 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
789 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
799 enable_gstreamer_0_10=no
800 enable_gstreamer_1_0=no
805 enable_postgresql_sdbc=no
806 enable_firebird_sdbc=no
811 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
815 if test "$_os" = "Android" ; then
816 # Verify that the NDK and SDK options are proper
817 if test -z "$with_android_ndk"; then
818 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
819 elif test ! -f "$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}/usr/lib/libc.a"; then
820 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
823 if test -z "$ANDROID_SDK_HOME"; then
824 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
825 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
826 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
829 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
830 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
831 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
832 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
833 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
834 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
835 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
836 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
838 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
839 AC_MSG_WARN([android support repository not found - install with
840 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
841 to allow the build to download the specified version of the android support libraries])
842 add_warning "android support repository not found - install with"
843 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
844 add_warning "to allow the build to download the specified version of the android support libraries"
848 if test "$_os" = "AIX"; then
849 AC_PATH_PROG(GAWK, gawk)
850 if test -z "$GAWK"; then
851 AC_MSG_ERROR([gawk not found in \$PATH])
857 AC_SUBST(PTHREAD_CFLAGS)
858 AC_SUBST(PTHREAD_LIBS)
860 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
861 # By default use the ones specified by our build system,
862 # but explicit override is possible.
863 AC_MSG_CHECKING(for explicit AFLAGS)
864 if test -n "$AFLAGS"; then
865 AC_MSG_RESULT([$AFLAGS])
871 AC_MSG_CHECKING(for explicit CFLAGS)
872 if test -n "$CFLAGS"; then
873 AC_MSG_RESULT([$CFLAGS])
879 AC_MSG_CHECKING(for explicit CXXFLAGS)
880 if test -n "$CXXFLAGS"; then
881 AC_MSG_RESULT([$CXXFLAGS])
887 AC_MSG_CHECKING(for explicit OBJCFLAGS)
888 if test -n "$OBJCFLAGS"; then
889 AC_MSG_RESULT([$OBJCFLAGS])
895 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
896 if test -n "$OBJCXXFLAGS"; then
897 AC_MSG_RESULT([$OBJCXXFLAGS])
903 AC_MSG_CHECKING(for explicit LDFLAGS)
904 if test -n "$LDFLAGS"; then
905 AC_MSG_RESULT([$LDFLAGS])
915 AC_SUBST(OBJCXXFLAGS)
920 AC_SUBST(x_OBJCFLAGS)
921 AC_SUBST(x_OBJCXXFLAGS)
924 dnl These are potentially set for MSVC, in the code checking for UCRT below:
925 my_original_CFLAGS=$CFLAGS
926 my_original_CXXFLAGS=$CXXFLAGS
927 my_original_CPPFLAGS=$CPPFLAGS
929 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
930 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
931 dnl AC_PROG_CC internally.
932 if test "$_os" != "WINNT"; then
933 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
939 if test "$_os" != "WINNT"; then
940 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
946 if test $_os != "WINNT"; then
948 AC_SEARCH_LIBS([dlsym], [dl],
949 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
950 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
953 AC_SUBST(DLOPEN_LIBS)
955 AC_ARG_ENABLE(ios-simulator,
956 AS_HELP_STRING([--enable-ios-simulator],
957 [build i386 or x86_64 for ios simulator])
960 AC_ARG_ENABLE(ios-libreofficelight-app,
961 AS_HELP_STRING([--enable-ios-libreofficelight-app],
962 [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
963 (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
964 and also that its actual build (in Xcode) requires some obvious modifications to the project.])
967 ENABLE_IOS_LIBREOFFICELIGHT_APP=
968 if test "$enable_ios_libreofficelight_app" = yes; then
969 ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
971 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
973 ###############################################################################
974 # Extensions switches --enable/--disable
975 ###############################################################################
976 # By default these should be enabled unless having extra dependencies.
977 # If there is extra dependency over configure options then the enable should
978 # be automagic based on whether the requiring feature is enabled or not.
979 # All this options change anything only with --enable-extension-integration.
981 # The name of this option and its help string makes it sound as if
982 # extensions are built anyway, just not integrated in the installer,
983 # if you use --disable-extension-integration. Is that really the
986 libo_FUZZ_ARG_ENABLE(extension-integration,
987 AS_HELP_STRING([--disable-extension-integration],
988 [Disable integration of the built extensions in the installer of the
989 product. Use this switch to disable the integration.])
992 AC_ARG_ENABLE(avmedia,
993 AS_HELP_STRING([--disable-avmedia],
994 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
997 AC_ARG_ENABLE(database-connectivity,
998 AS_HELP_STRING([--disable-database-connectivity],
999 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
1002 # This doesn't mean not building (or "integrating") extensions
1003 # (although it probably should; i.e. it should imply
1004 # --disable-extension-integration I guess), it means not supporting
1005 # any extension mechanism at all
1006 libo_FUZZ_ARG_ENABLE(extensions,
1007 AS_HELP_STRING([--disable-extensions],
1008 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1011 AC_ARG_ENABLE(scripting,
1012 AS_HELP_STRING([--disable-scripting],
1013 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1016 # This is mainly for Android and iOS, but could potentially be used in some
1017 # special case otherwise, too, so factored out as a separate setting
1019 AC_ARG_ENABLE(dynamic-loading,
1020 AS_HELP_STRING([--disable-dynamic-loading],
1021 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1024 libo_FUZZ_ARG_ENABLE(report-builder,
1025 AS_HELP_STRING([--disable-report-builder],
1026 [Disable the Report Builder.])
1029 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1030 AS_HELP_STRING([--enable-ext-wiki-publisher],
1031 [Enable the Wiki Publisher extension.])
1034 libo_FUZZ_ARG_ENABLE(lpsolve,
1035 AS_HELP_STRING([--disable-lpsolve],
1036 [Disable compilation of the lp solve solver ])
1038 libo_FUZZ_ARG_ENABLE(coinmp,
1039 AS_HELP_STRING([--disable-coinmp],
1040 [Disable compilation of the CoinMP solver ])
1043 libo_FUZZ_ARG_ENABLE(pdfimport,
1044 AS_HELP_STRING([--disable-pdfimport],
1045 [Disable building the PDF import feature.])
1048 libo_FUZZ_ARG_ENABLE(pdfium,
1049 AS_HELP_STRING([--disable-pdfium],
1050 [Disable building PDFium.])
1053 ###############################################################################
1055 dnl ---------- *** ----------
1057 libo_FUZZ_ARG_ENABLE(mergelibs,
1058 AS_HELP_STRING([--enable-mergelibs],
1059 [Merge several of the smaller libraries into one big, "merged", one.])
1062 libo_FUZZ_ARG_ENABLE(breakpad,
1063 AS_HELP_STRING([--enable-breakpad],
1064 [Enables breakpad for crash reporting.])
1067 AC_ARG_ENABLE(fetch-external,
1068 AS_HELP_STRING([--disable-fetch-external],
1069 [Disables fetching external tarballs from web sources.])
1072 AC_ARG_ENABLE(fuzzers,
1073 AS_HELP_STRING([--enable-fuzzers],
1074 [Enables building libfuzzer targets for fuzz testing.])
1077 libo_FUZZ_ARG_ENABLE(pch,
1078 AS_HELP_STRING([--enable-pch],
1079 [Enables precompiled header support for C++. Forced default on Windows/VC build])
1082 libo_FUZZ_ARG_ENABLE(epm,
1083 AS_HELP_STRING([--enable-epm],
1084 [LibreOffice includes self-packaging code, that requires epm, however epm is
1085 useless for large scale package building.])
1088 libo_FUZZ_ARG_ENABLE(odk,
1089 AS_HELP_STRING([--disable-odk],
1090 [LibreOffice includes an ODK, office development kit which some packagers may
1091 wish to build without.])
1094 AC_ARG_ENABLE(mpl-subset,
1095 AS_HELP_STRING([--enable-mpl-subset],
1096 [Don't compile any pieces which are not MPL or more liberally licensed])
1099 libo_FUZZ_ARG_ENABLE(evolution2,
1100 AS_HELP_STRING([--enable-evolution2],
1101 [Allows the built-in evolution 2 addressbook connectivity build to be
1105 AC_ARG_ENABLE(avahi,
1106 AS_HELP_STRING([--enable-avahi],
1107 [Determines whether to use Avahi to advertise Impress to remote controls.])
1110 libo_FUZZ_ARG_ENABLE(werror,
1111 AS_HELP_STRING([--enable-werror],
1112 [Turn warnings to errors. (Has no effect in modules where the treating
1113 of warnings as errors is disabled explicitly.)]),
1116 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1117 AS_HELP_STRING([--enable-assert-always-abort],
1118 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1121 libo_FUZZ_ARG_ENABLE(dbgutil,
1122 AS_HELP_STRING([--enable-dbgutil],
1123 [Provide debugging support from --enable-debug and include additional debugging
1124 utilities such as object counting or more expensive checks.
1125 This is the recommended option for developers.
1126 Note that this makes the build ABI incompatible, it is not possible to mix object
1127 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1129 libo_FUZZ_ARG_ENABLE(debug,
1130 AS_HELP_STRING([--enable-debug],
1131 [Include debugging information, disable compiler optimization and inlining plus
1132 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1134 libo_FUZZ_ARG_ENABLE(split-debug,
1135 AS_HELP_STRING([--disable-split-debug],
1136 [Disable using split debug information (-gsplit-dwarf compile flag). Split debug information
1137 saves disk space and build time, but requires tools that support it (both build tools and debuggers).]))
1139 libo_FUZZ_ARG_ENABLE(gdb-index,
1140 AS_HELP_STRING([--disable-gdb-index],
1141 [Disables creating debug information in the gdb index format, which makes gdb start faster.
1142 The feature requires the gold or lld linker.]))
1144 libo_FUZZ_ARG_ENABLE(sal-log,
1145 AS_HELP_STRING([--enable-sal-log],
1146 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1148 AC_ARG_ENABLE(selective-debuginfo,
1149 AS_HELP_STRING([--enable-selective-debuginfo],
1150 [If --enable-debug or --enable-dbgutil is used, build debugging information
1151 (-g compiler flag) only for the specified gbuild build targets
1152 (where all means everything, - prepended means not to enable, / appended means
1153 everything in the directory; there is no ordering, more specific overrides
1154 more general, and disabling takes precedence).
1155 Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
1157 libo_FUZZ_ARG_ENABLE(symbols,
1158 AS_HELP_STRING([--enable-symbols],
1159 [Generate debug information.
1160 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1163 libo_FUZZ_ARG_ENABLE(optimized,
1164 AS_HELP_STRING([--disable-optimized],
1165 [Whether to compile with optimization flags.
1166 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1169 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1170 AS_HELP_STRING([--disable-runtime-optimizations],
1171 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1172 JVM JIT) that are known to interact badly with certain dynamic analysis
1173 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1174 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1175 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1177 AC_ARG_WITH(valgrind,
1178 AS_HELP_STRING([--with-valgrind],
1179 [Make availability of Valgrind headers a hard requirement.]))
1181 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1182 AS_HELP_STRING([--enable-compiler-plugins],
1183 [Enable compiler plugins that will perform additional checks during
1184 building. Enabled automatically by --enable-dbgutil.
1185 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1186 COMPILER_PLUGINS_DEBUG=
1187 if test "$enable_compiler_plugins" = debug; then
1188 enable_compiler_plugins=yes
1189 COMPILER_PLUGINS_DEBUG=TRUE
1192 libo_FUZZ_ARG_ENABLE(ooenv,
1193 AS_HELP_STRING([--disable-ooenv],
1194 [Disable ooenv for the instdir installation.]))
1196 libo_FUZZ_ARG_ENABLE(libnumbertext,
1197 AS_HELP_STRING([--disable-libnumbertext],
1198 [Disable use of numbertext external library.]))
1201 AS_HELP_STRING([--enable-lto],
1202 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1203 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1204 linker. For MSVC, this option is broken at the moment. This is experimental work
1205 in progress that shouldn't be used unless you are working on it.)]))
1207 AC_ARG_ENABLE(python,
1208 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1209 [Enables or disables Python support at run-time.
1210 Also specifies what Python to use. 'auto' is the default.
1211 'fully-internal' even forces the internal version for uses of Python
1212 during the build.]))
1214 libo_FUZZ_ARG_ENABLE(gtk,
1215 AS_HELP_STRING([--disable-gtk],
1216 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
1217 ,test "${enable_gtk+set}" = set || enable_gtk=yes)
1219 libo_FUZZ_ARG_ENABLE(gtk3,
1220 AS_HELP_STRING([--disable-gtk3],
1221 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1222 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1224 AC_ARG_ENABLE(split-app-modules,
1225 AS_HELP_STRING([--enable-split-app-modules],
1226 [Split file lists for app modules, e.g. base, calc.
1227 Has effect only with make distro-pack-install]),
1230 AC_ARG_ENABLE(split-opt-features,
1231 AS_HELP_STRING([--enable-split-opt-features],
1232 [Split file lists for some optional features, e.g. pyuno, testtool.
1233 Has effect only with make distro-pack-install]),
1236 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1237 AS_HELP_STRING([--disable-cairo-canvas],
1238 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1241 libo_FUZZ_ARG_ENABLE(dbus,
1242 AS_HELP_STRING([--disable-dbus],
1243 [Determines whether to enable features that depend on dbus.
1244 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1245 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1247 libo_FUZZ_ARG_ENABLE(sdremote,
1248 AS_HELP_STRING([--disable-sdremote],
1249 [Determines whether to enable Impress remote control (i.e. the server component).]),
1250 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1252 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1253 AS_HELP_STRING([--disable-sdremote-bluetooth],
1254 [Determines whether to build sdremote with bluetooth support.
1255 Requires dbus on Linux.]))
1257 libo_FUZZ_ARG_ENABLE(gio,
1258 AS_HELP_STRING([--disable-gio],
1259 [Determines whether to use the GIO support.]),
1260 ,test "${enable_gio+set}" = set || enable_gio=yes)
1263 AS_HELP_STRING([--enable-qt5],
1264 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1269 AS_HELP_STRING([--enable-kde5],
1270 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1271 KF5 are available.]),
1274 AC_ARG_ENABLE(gtk3_kde5,
1275 AS_HELP_STRING([--enable-gtk3-kde5],
1276 [Determines whether to use Gtk3 vclplug with KDE file dialogs on
1277 platforms where Gtk3, Qt5 and Plasma is available.]),
1280 libo_FUZZ_ARG_ENABLE(gui,
1281 AS_HELP_STRING([--disable-gui],
1282 [Disable use of X11 or Wayland to reduce dependencies. Not related to the --headless
1283 command-line option. Not related to LibreOffice Online functionality. Don't use
1284 unless you are certain you need to. Nobody will help you if you insist on trying
1285 this and run into problems.]),
1286 ,test "${enable_gui+set}" = set || enable_gui=yes)
1288 libo_FUZZ_ARG_ENABLE(randr,
1289 AS_HELP_STRING([--disable-randr],
1290 [Disable RandR support in the vcl project.]),
1291 ,test "${enable_randr+set}" = set || enable_randr=yes)
1293 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1294 AS_HELP_STRING([--disable-gstreamer-1-0],
1295 [Disable building with the new gstreamer 1.0 avmedia backend.]),
1296 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1298 AC_ARG_ENABLE(gstreamer-0-10,
1299 AS_HELP_STRING([--enable-gstreamer-0-10],
1300 [Enable building with the gstreamer 0.10 avmedia backend.]),
1301 ,enable_gstreamer_0_10=no)
1303 libo_FUZZ_ARG_ENABLE(vlc,
1304 AS_HELP_STRING([--enable-vlc],
1305 [Enable building with the (experimental) VLC avmedia backend.]),
1306 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1308 libo_FUZZ_ARG_ENABLE(neon,
1309 AS_HELP_STRING([--disable-neon],
1310 [Disable neon and the compilation of webdav binding.]),
1313 libo_FUZZ_ARG_ENABLE([eot],
1314 [AS_HELP_STRING([--enable-eot],
1315 [Enable support for Embedded OpenType fonts.])],
1316 ,test "${enable_eot+set}" = set || enable_eot=no)
1318 libo_FUZZ_ARG_ENABLE(cve-tests,
1319 AS_HELP_STRING([--disable-cve-tests],
1320 [Prevent CVE tests to be executed]),
1323 libo_FUZZ_ARG_ENABLE(chart-tests,
1324 AS_HELP_STRING([--enable-chart-tests],
1325 [Executes chart XShape tests. In a perfect world these tests would be
1326 stable and everyone could run them, in reality it is best to run them
1327 only on a few machines that are known to work and maintained by people
1328 who can judge if a test failure is a regression or not.]),
1331 AC_ARG_ENABLE(build-unowinreg,
1332 AS_HELP_STRING([--enable-build-unowinreg],
1333 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1334 compiler is needed on Linux.]),
1337 AC_ARG_ENABLE(build-opensymbol,
1338 AS_HELP_STRING([--enable-build-opensymbol],
1339 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1340 fontforge installed.]),
1343 AC_ARG_ENABLE(dependency-tracking,
1344 AS_HELP_STRING([--enable-dependency-tracking],
1345 [Do not reject slow dependency extractors.])[
1346 --disable-dependency-tracking
1347 Disables generation of dependency information.
1348 Speed up one-time builds.],
1351 AC_ARG_ENABLE(icecream,
1352 AS_HELP_STRING([--enable-icecream],
1353 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1354 It defaults to /opt/icecream for the location of the icecream gcc/g++
1355 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1359 AS_HELP_STRING([--enable-ld=<linker>],
1360 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.
1361 By default tries to use the best linker possible, use --disable-ld to use the default linker.]),
1364 libo_FUZZ_ARG_ENABLE(cups,
1365 AS_HELP_STRING([--disable-cups],
1366 [Do not build cups support.])
1369 AC_ARG_ENABLE(ccache,
1370 AS_HELP_STRING([--disable-ccache],
1371 [Do not try to use ccache automatically.
1372 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1373 CC/CXX are not yet set, and --enable-icecream is not given, we
1374 attempt to use ccache. --disable-ccache disables ccache completely.
1378 AC_ARG_ENABLE(64-bit,
1379 AS_HELP_STRING([--enable-64-bit],
1380 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1381 At the moment meaningful only for Windows.]), ,)
1383 libo_FUZZ_ARG_ENABLE(online-update,
1384 AS_HELP_STRING([--enable-online-update],
1385 [Enable the online update service that will check for new versions of
1386 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1387 If the value is "mar", the experimental Mozilla-like update will be
1388 enabled instead of the traditional update mechanism.]),
1391 AC_ARG_WITH(update-config,
1392 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1393 [Path to the update config ini file]))
1395 libo_FUZZ_ARG_ENABLE(extension-update,
1396 AS_HELP_STRING([--disable-extension-update],
1397 [Disable possibility to update installed extensions.]),
1400 libo_FUZZ_ARG_ENABLE(release-build,
1401 AS_HELP_STRING([--enable-release-build],
1402 [Enable release build. Note that the "release build" choice is orthogonal to
1403 whether symbols are present, debug info is generated, or optimization
1405 See http://wiki.documentfoundation.org/Development/DevBuild]),
1408 AC_ARG_ENABLE(windows-build-signing,
1409 AS_HELP_STRING([--enable-windows-build-signing],
1410 [Enable signing of windows binaries (*.exe, *.dll)]),
1413 AC_ARG_ENABLE(silent-msi,
1414 AS_HELP_STRING([--enable-silent-msi],
1415 [Enable MSI with LIMITUI=1 (silent install).]),
1418 AC_ARG_ENABLE(macosx-code-signing,
1419 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1420 [Sign executables, dylibs, frameworks and the app bundle. If you
1421 don't provide an identity the first suitable certificate
1422 in your keychain is used.]),
1425 AC_ARG_ENABLE(macosx-package-signing,
1426 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1427 [Create a .pkg suitable for uploading to the Mac App Store and sign
1428 it. If you don't provide an identity the first suitable certificate
1429 in your keychain is used.]),
1432 AC_ARG_ENABLE(macosx-sandbox,
1433 AS_HELP_STRING([--enable-macosx-sandbox],
1434 [Make the app bundle run in a sandbox. Requires code signing.
1435 Is required by apps distributed in the Mac App Store, and implies
1436 adherence to App Store rules.]),
1439 AC_ARG_WITH(macosx-bundle-identifier,
1440 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1441 [Define the macOS bundle identifier. Default is the somewhat weird
1442 org.libreoffice.script ("script", huh?).]),
1443 ,with_macosx_bundle_identifier=org.libreoffice.script)
1445 AC_ARG_WITH(product-name,
1446 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1447 [Define the product name. Default is AC_PACKAGE_NAME.]),
1448 ,with_product_name=$PRODUCTNAME)
1450 AC_ARG_WITH(package-version,
1451 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1452 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1455 libo_FUZZ_ARG_ENABLE(readonly-installset,
1456 AS_HELP_STRING([--enable-readonly-installset],
1457 [Prevents any attempts by LibreOffice to write into its installation. That means
1458 at least that no "system-wide" extensions can be added. Partly experimental work in
1459 progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
1462 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1463 AS_HELP_STRING([--disable-postgresql-sdbc],
1464 [Disable the build of the PostgreSQL-SDBC driver.])
1467 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1468 AS_HELP_STRING([--disable-lotuswordpro],
1469 [Disable the build of the Lotus Word Pro filter.]),
1470 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1472 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1473 AS_HELP_STRING([--disable-firebird-sdbc],
1474 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1475 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1477 AC_ARG_ENABLE(bogus-pkg-config,
1478 AS_HELP_STRING([--enable-bogus-pkg-config],
1479 [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.]),
1482 AC_ARG_ENABLE(openssl,
1483 AS_HELP_STRING([--disable-openssl],
1484 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1485 components will either use GNUTLS or NSS. Work in progress,
1486 use only if you are hacking on it.]),
1487 ,enable_openssl=yes)
1489 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1490 AS_HELP_STRING([--enable-cipher-openssl-backend],
1491 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1492 Requires --enable-openssl.]))
1494 AC_ARG_ENABLE(library-bin-tar,
1495 AS_HELP_STRING([--enable-library-bin-tar],
1496 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1497 Some libraries can save their build result in a tarball
1498 stored in TARFILE_LOCATION. That binary tarball is
1499 uniquely identified by the source tarball,
1500 the content of the config_host.mk file and the content
1501 of the top-level directory in core for that library
1502 If this option is enabled, then if such a tarfile exist, it will be untarred
1503 instead of the source tarfile, and the build step will be skipped for that
1505 If a proper tarfile does not exist, then the normal source-based
1506 build is done for that library and a proper binary tarfile is created
1507 for the next time.]),
1510 AC_ARG_ENABLE(dconf,
1511 AS_HELP_STRING([--disable-dconf],
1512 [Disable the dconf configuration backend (enabled by default where
1515 libo_FUZZ_ARG_ENABLE(formula-logger,
1517 [--enable-formula-logger],
1518 [Enable formula logger for logging formula calculation flow in Calc.]
1523 AS_HELP_STRING([--disable-ldap],
1524 [Disable LDAP support.]),
1527 dnl ===================================================================
1528 dnl Optional Packages (--with/without-)
1529 dnl ===================================================================
1531 AC_ARG_WITH(gcc-home,
1532 AS_HELP_STRING([--with-gcc-home],
1533 [Specify the location of gcc/g++ manually. This can be used in conjunction
1534 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1535 non-default path.]),
1538 AC_ARG_WITH(gnu-patch,
1539 AS_HELP_STRING([--with-gnu-patch],
1540 [Specify location of GNU patch on Solaris or FreeBSD.]),
1543 AC_ARG_WITH(build-platform-configure-options,
1544 AS_HELP_STRING([--with-build-platform-configure-options],
1545 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1549 AS_HELP_STRING([--with-gnu-cp],
1550 [Specify location of GNU cp on Solaris or FreeBSD.]),
1553 AC_ARG_WITH(external-tar,
1554 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1555 [Specify an absolute path of where to find (and store) tarfiles.]),
1556 TARFILE_LOCATION=$withval ,
1559 AC_ARG_WITH(referenced-git,
1560 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1561 [Specify another checkout directory to reference. This makes use of
1562 git submodule update --reference, and saves a lot of diskspace
1563 when having multiple trees side-by-side.]),
1564 GIT_REFERENCE_SRC=$withval ,
1567 AC_ARG_WITH(linked-git,
1568 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1569 [Specify a directory where the repositories of submodules are located.
1570 This uses a method similar to git-new-workdir to get submodules.]),
1571 GIT_LINK_SRC=$withval ,
1574 AC_ARG_WITH(galleries,
1575 AS_HELP_STRING([--with-galleries],
1576 [Specify how galleries should be built. It is possible either to
1577 build these internally from source ("build"),
1578 or to disable them ("no")]),
1582 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1583 [Choose which themes to include. By default those themes with an '*' are included.
1584 Possible choices: *breeze, *breeze_dark, *breeze_svg, *colibre, *colibre_svg, *elementary,
1585 *elementary_svg, *karasa_jaga, *sifr, *sifr_dark, *tango.]),
1588 libo_FUZZ_ARG_WITH(helppack-integration,
1589 AS_HELP_STRING([--without-helppack-integration],
1590 [It will not integrate the helppacks to the installer
1591 of the product. Please use this switch to use the online help
1592 or separate help packages.]),
1595 libo_FUZZ_ARG_WITH(fonts,
1596 AS_HELP_STRING([--without-fonts],
1597 [LibreOffice includes some third-party fonts to provide a reliable basis for
1598 help content, templates, samples, etc. When these fonts are already
1599 known to be available on the system then you should use this option.]),
1603 AS_HELP_STRING([--with-epm],
1604 [Decides which epm to use. Default is to use the one from the system if
1605 one is built. When either this is not there or you say =internal epm
1609 AC_ARG_WITH(package-format,
1610 AS_HELP_STRING([--with-package-format],
1611 [Specify package format(s) for LibreOffice installation sets. The
1612 implicit --without-package-format leads to no installation sets being
1613 generated. Possible values: aix, archive, bsd, deb, dmg,
1614 installed, msi, pkg, and rpm.
1615 Example: --with-package-format='deb rpm']),
1619 AS_HELP_STRING([--with-tls],
1620 [Decides which TLS/SSL and cryptographic implementations to use for
1621 LibreOffice's code. Notice that this doesn't apply for depending
1622 libraries like "neon", for example. Default is to use OpenSSL
1623 although NSS is also possible. Notice that selecting NSS restricts
1624 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1625 restrict by now the usage of NSS in LO's code. Possible values:
1626 openssl, nss. Example: --with-tls="nss"]),
1629 AC_ARG_WITH(system-libs,
1630 AS_HELP_STRING([--with-system-libs],
1631 [Use libraries already on system -- enables all --with-system-* flags.]),
1634 AC_ARG_WITH(system-bzip2,
1635 AS_HELP_STRING([--with-system-bzip2],
1636 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1637 [with_system_bzip2="$with_system_libs"])
1639 AC_ARG_WITH(system-headers,
1640 AS_HELP_STRING([--with-system-headers],
1641 [Use headers already on system -- enables all --with-system-* flags for
1642 external packages whose headers are the only entities used i.e.
1643 boost/odbc/sane-header(s).]),,
1644 [with_system_headers="$with_system_libs"])
1646 AC_ARG_WITH(system-jars,
1647 AS_HELP_STRING([--without-system-jars],
1648 [When building with --with-system-libs, also the needed jars are expected
1649 on the system. Use this to disable that]),,
1650 [with_system_jars="$with_system_libs"])
1652 AC_ARG_WITH(system-cairo,
1653 AS_HELP_STRING([--with-system-cairo],
1654 [Use cairo libraries already on system. Happens automatically for
1655 (implicit) --enable-gtk and for --enable-gtk3.]))
1657 AC_ARG_WITH(system-epoxy,
1658 AS_HELP_STRING([--with-system-epoxy],
1659 [Use epoxy libraries already on system. Happens automatically for
1661 [with_system_epoxy="$with_system_libs"])
1663 AC_ARG_WITH(myspell-dicts,
1664 AS_HELP_STRING([--with-myspell-dicts],
1665 [Adds myspell dictionaries to the LibreOffice installation set]),
1668 AC_ARG_WITH(system-dicts,
1669 AS_HELP_STRING([--without-system-dicts],
1670 [Do not use dictionaries from system paths.]),
1673 AC_ARG_WITH(external-dict-dir,
1674 AS_HELP_STRING([--with-external-dict-dir],
1675 [Specify external dictionary dir.]),
1678 AC_ARG_WITH(external-hyph-dir,
1679 AS_HELP_STRING([--with-external-hyph-dir],
1680 [Specify external hyphenation pattern dir.]),
1683 AC_ARG_WITH(external-thes-dir,
1684 AS_HELP_STRING([--with-external-thes-dir],
1685 [Specify external thesaurus dir.]),
1688 AC_ARG_WITH(system-zlib,
1689 AS_HELP_STRING([--with-system-zlib],
1690 [Use zlib already on system.]),,
1691 [with_system_zlib=auto])
1693 AC_ARG_WITH(system-jpeg,
1694 AS_HELP_STRING([--with-system-jpeg],
1695 [Use jpeg already on system.]),,
1696 [with_system_jpeg="$with_system_libs"])
1698 AC_ARG_WITH(system-clucene,
1699 AS_HELP_STRING([--with-system-clucene],
1700 [Use clucene already on system.]),,
1701 [with_system_clucene="$with_system_libs"])
1703 AC_ARG_WITH(system-expat,
1704 AS_HELP_STRING([--with-system-expat],
1705 [Use expat already on system.]),,
1706 [with_system_expat="$with_system_libs"])
1708 AC_ARG_WITH(system-libxml,
1709 AS_HELP_STRING([--with-system-libxml],
1710 [Use libxml/libxslt already on system.]),,
1711 [with_system_libxml=auto])
1713 AC_ARG_WITH(system-icu,
1714 AS_HELP_STRING([--with-system-icu],
1715 [Use icu already on system.]),,
1716 [with_system_icu="$with_system_libs"])
1718 AC_ARG_WITH(system-ucpp,
1719 AS_HELP_STRING([--with-system-ucpp],
1720 [Use ucpp already on system.]),,
1723 AC_ARG_WITH(system-openldap,
1724 AS_HELP_STRING([--with-system-openldap],
1725 [Use the OpenLDAP LDAP SDK already on system.]),,
1726 [with_system_openldap="$with_system_libs"])
1728 libo_FUZZ_ARG_ENABLE(poppler,
1729 AS_HELP_STRING([--disable-poppler],
1730 [Disable building Poppler.])
1733 AC_ARG_WITH(system-poppler,
1734 AS_HELP_STRING([--with-system-poppler],
1735 [Use system poppler (only needed for PDF import).]),,
1736 [with_system_poppler="$with_system_libs"])
1738 AC_ARG_WITH(system-gpgmepp,
1739 AS_HELP_STRING([--with-system-gpgmepp],
1740 [Use gpgmepp already on system]),,
1741 [with_system_gpgmepp="$with_system_libs"])
1743 AC_ARG_WITH(system-apache-commons,
1744 AS_HELP_STRING([--with-system-apache-commons],
1745 [Use Apache commons libraries already on system.]),,
1746 [with_system_apache_commons="$with_system_jars"])
1748 AC_ARG_WITH(system-mariadb,
1749 AS_HELP_STRING([--with-system-mariadb],
1750 [Use MariaDB/MySQL libraries already on system.]),,
1751 [with_system_mariadb="$with_system_libs"])
1753 AC_ARG_ENABLE(bundle-mariadb,
1754 AS_HELP_STRING([--enable-bundle-mariadb],
1755 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
1758 AC_ARG_WITH(system-postgresql,
1759 AS_HELP_STRING([--with-system-postgresql],
1760 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1761 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1762 [with_system_postgresql="$with_system_libs"])
1764 AC_ARG_WITH(libpq-path,
1765 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1766 [Use this PostgreSQL C interface (libpq) installation for building
1767 the PostgreSQL-SDBC extension.]),
1770 AC_ARG_WITH(system-firebird,
1771 AS_HELP_STRING([--with-system-firebird],
1772 [Use Firebird libraries already on system, for building the Firebird-SDBC
1773 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1774 [with_system_firebird="$with_system_libs"])
1776 AC_ARG_WITH(system-libtommath,
1777 AS_HELP_STRING([--with-system-libtommath],
1778 [Use libtommath already on system]),,
1779 [with_system_libtommath="$with_system_libs"])
1781 AC_ARG_WITH(system-hsqldb,
1782 AS_HELP_STRING([--with-system-hsqldb],
1783 [Use hsqldb already on system.]))
1785 AC_ARG_WITH(hsqldb-jar,
1786 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1787 [Specify path to jarfile manually.]),
1788 HSQLDB_JAR=$withval)
1790 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1791 AS_HELP_STRING([--disable-scripting-beanshell],
1792 [Disable support for scripts in BeanShell.]),
1796 AC_ARG_WITH(system-beanshell,
1797 AS_HELP_STRING([--with-system-beanshell],
1798 [Use beanshell already on system.]),,
1799 [with_system_beanshell="$with_system_jars"])
1801 AC_ARG_WITH(beanshell-jar,
1802 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1803 [Specify path to jarfile manually.]),
1806 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1807 AS_HELP_STRING([--disable-scripting-javascript],
1808 [Disable support for scripts in JavaScript.]),
1812 AC_ARG_WITH(system-rhino,
1813 AS_HELP_STRING([--with-system-rhino],
1814 [Use rhino already on system.]),,)
1815 # [with_system_rhino="$with_system_jars"])
1816 # Above is not used as we have different debug interface
1817 # patched into internal rhino. This code needs to be fixed
1818 # before we can enable it by default.
1820 AC_ARG_WITH(rhino-jar,
1821 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1822 [Specify path to jarfile manually.]),
1825 AC_ARG_WITH(commons-logging-jar,
1826 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1827 [Specify path to jarfile manually.]),
1828 COMMONS_LOGGING_JAR=$withval)
1830 AC_ARG_WITH(system-jfreereport,
1831 AS_HELP_STRING([--with-system-jfreereport],
1832 [Use JFreeReport already on system.]),,
1833 [with_system_jfreereport="$with_system_jars"])
1835 AC_ARG_WITH(sac-jar,
1836 AS_HELP_STRING([--with-sac-jar=JARFILE],
1837 [Specify path to jarfile manually.]),
1840 AC_ARG_WITH(libxml-jar,
1841 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1842 [Specify path to jarfile manually.]),
1843 LIBXML_JAR=$withval)
1845 AC_ARG_WITH(flute-jar,
1846 AS_HELP_STRING([--with-flute-jar=JARFILE],
1847 [Specify path to jarfile manually.]),
1850 AC_ARG_WITH(jfreereport-jar,
1851 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1852 [Specify path to jarfile manually.]),
1853 JFREEREPORT_JAR=$withval)
1855 AC_ARG_WITH(liblayout-jar,
1856 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1857 [Specify path to jarfile manually.]),
1858 LIBLAYOUT_JAR=$withval)
1860 AC_ARG_WITH(libloader-jar,
1861 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1862 [Specify path to jarfile manually.]),
1863 LIBLOADER_JAR=$withval)
1865 AC_ARG_WITH(libformula-jar,
1866 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1867 [Specify path to jarfile manually.]),
1868 LIBFORMULA_JAR=$withval)
1870 AC_ARG_WITH(librepository-jar,
1871 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1872 [Specify path to jarfile manually.]),
1873 LIBREPOSITORY_JAR=$withval)
1875 AC_ARG_WITH(libfonts-jar,
1876 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1877 [Specify path to jarfile manually.]),
1878 LIBFONTS_JAR=$withval)
1880 AC_ARG_WITH(libserializer-jar,
1881 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1882 [Specify path to jarfile manually.]),
1883 LIBSERIALIZER_JAR=$withval)
1885 AC_ARG_WITH(libbase-jar,
1886 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1887 [Specify path to jarfile manually.]),
1888 LIBBASE_JAR=$withval)
1890 AC_ARG_WITH(system-odbc,
1891 AS_HELP_STRING([--with-system-odbc],
1892 [Use the odbc headers already on system.]),,
1893 [with_system_odbc="auto"])
1895 AC_ARG_WITH(system-sane,
1896 AS_HELP_STRING([--with-system-sane],
1897 [Use sane.h already on system.]),,
1898 [with_system_sane="$with_system_headers"])
1900 AC_ARG_WITH(system-bluez,
1901 AS_HELP_STRING([--with-system-bluez],
1902 [Use bluetooth.h already on system.]),,
1903 [with_system_bluez="$with_system_headers"])
1905 AC_ARG_WITH(system-curl,
1906 AS_HELP_STRING([--with-system-curl],
1907 [Use curl already on system.]),,
1908 [with_system_curl=auto])
1910 AC_ARG_WITH(system-boost,
1911 AS_HELP_STRING([--with-system-boost],
1912 [Use boost already on system.]),,
1913 [with_system_boost="$with_system_headers"])
1915 AC_ARG_WITH(system-glm,
1916 AS_HELP_STRING([--with-system-glm],
1917 [Use glm already on system.]),,
1918 [with_system_glm="$with_system_headers"])
1920 AC_ARG_WITH(system-hunspell,
1921 AS_HELP_STRING([--with-system-hunspell],
1922 [Use libhunspell already on system.]),,
1923 [with_system_hunspell="$with_system_libs"])
1925 AC_ARG_WITH(system-mythes,
1926 AS_HELP_STRING([--with-system-mythes],
1927 [Use mythes already on system.]),,
1928 [with_system_mythes="$with_system_libs"])
1930 AC_ARG_WITH(system-altlinuxhyph,
1931 AS_HELP_STRING([--with-system-altlinuxhyph],
1932 [Use ALTLinuxhyph already on system.]),,
1933 [with_system_altlinuxhyph="$with_system_libs"])
1935 AC_ARG_WITH(system-lpsolve,
1936 AS_HELP_STRING([--with-system-lpsolve],
1937 [Use lpsolve already on system.]),,
1938 [with_system_lpsolve="$with_system_libs"])
1940 AC_ARG_WITH(system-coinmp,
1941 AS_HELP_STRING([--with-system-coinmp],
1942 [Use CoinMP already on system.]),,
1943 [with_system_coinmp="$with_system_libs"])
1945 AC_ARG_WITH(system-liblangtag,
1946 AS_HELP_STRING([--with-system-liblangtag],
1947 [Use liblangtag library already on system.]),,
1948 [with_system_liblangtag="$with_system_libs"])
1951 AS_HELP_STRING([--with-webdav],
1952 [Specify which library to use for webdav implementation.
1953 Possible values: "neon", "serf", "no". The default value is "neon".
1954 Example: --with-webdav="serf"]),
1955 WITH_WEBDAV=$withval,
1958 AC_ARG_WITH(linker-hash-style,
1959 AS_HELP_STRING([--with-linker-hash-style],
1960 [Use linker with --hash-style=<style> when linking shared objects.
1961 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1962 if supported on the build system, and "sysv" otherwise.]))
1964 AC_ARG_WITH(jdk-home,
1965 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
1966 [If you have installed JDK 1.6 or later on your system please supply the
1967 path here. Note that this is not the location of the java command but the
1968 location of the entire distribution.]),
1972 AS_HELP_STRING([--with-help],
1973 [Enable the build of help. There is a special parameter "common" that
1974 can be used to bundle only the common part, .e.g help-specific icons.
1975 This is useful when you build the helpcontent separately.])
1977 Usage: --with-help build the old local help
1978 --without-help no local help (default)
1979 --with-help=html build the new HTML local help
1980 --with-help=online build the new HTML online help
1984 libo_FUZZ_ARG_WITH(java,
1985 AS_HELP_STRING([--with-java=<java command>],
1986 [Specify the name of the Java interpreter command. Typically "java"
1987 which is the default.
1989 To build without support for Java components, applets, accessibility
1990 or the XML filters written in Java, use --without-java or --with-java=no.]),
1991 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1992 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
1995 AC_ARG_WITH(jvm-path,
1996 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
1997 [Use a specific JVM search path at runtime.
1998 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2001 AC_ARG_WITH(ant-home,
2002 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2003 [If you have installed Apache Ant on your system, please supply the path here.
2004 Note that this is not the location of the Ant binary but the location
2005 of the entire distribution.]),
2008 AC_ARG_WITH(symbol-config,
2009 AS_HELP_STRING([--with-symbol-config],
2010 [Configuration for the crashreport symbol upload]),
2012 [with_symbol_config=no])
2014 AC_ARG_WITH(export-validation,
2015 AS_HELP_STRING([--without-export-validation],
2016 [Disable validating OOXML and ODF files as exported from in-tree tests.]),
2017 ,with_export_validation=auto)
2019 AC_ARG_WITH(bffvalidator,
2020 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2021 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2022 Requires installed Microsoft Office Binary File Format Validator.
2023 Note: export-validation (--with-export-validation) is required to be turned on.
2024 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2025 ,with_bffvalidator=no)
2027 libo_FUZZ_ARG_WITH(junit,
2028 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2029 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2030 --without-junit disables those tests. Not relevant in the --without-java case.]),
2033 AC_ARG_WITH(hamcrest,
2034 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2035 [Specifies the hamcrest jar file to use for JUnit-based tests.
2036 --without-junit disables those tests. Not relevant in the --without-java case.]),
2039 AC_ARG_WITH(perl-home,
2040 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2041 [If you have installed Perl 5 Distribution, on your system, please
2042 supply the path here. Note that this is not the location of the Perl
2043 binary but the location of the entire distribution.]),
2046 libo_FUZZ_ARG_WITH(doxygen,
2048 [--with-doxygen=<absolute path to doxygen executable>],
2049 [Specifies the doxygen executable to use when generating ODK C/C++
2050 documentation. --without-doxygen disables generation of ODK C/C++
2051 documentation. Not relevant in the --disable-odk case.]),
2054 AC_ARG_WITH(visual-studio,
2055 AS_HELP_STRING([--with-visual-studio=<2017>],
2056 [Specify which Visual Studio version to use in case several are
2057 installed. Currently only 2017 is supported.]),
2060 AC_ARG_WITH(windows-sdk,
2061 AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
2062 [Specify which Windows SDK, or "Windows Kit", version to use
2063 in case the one that came with the selected Visual Studio
2064 is not what you want for some reason. Note that not all compiler/SDK
2065 combinations are supported. The intent is that this option should not
2070 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2071 [Use this option to build LibreOffice with additional UI language support.
2072 English (US) is always included by default.
2073 Separate multiple languages with space.
2074 For all languages, use --with-lang=ALL.]),
2077 AC_ARG_WITH(locales,
2078 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2079 [Use this option to limit the locale information built in.
2080 Separate multiple locales with space.
2081 Very experimental and might well break stuff.
2082 Just a desperate measure to shrink code and data size.
2083 By default all the locales available is included.
2084 This option is completely unrelated to --with-lang.])
2086 Affects also our character encoding conversion
2087 tables for encodings mainly targeted for a
2088 particular locale, like EUC-CN and EUC-TW for
2089 zh, ISO-2022-JP for ja.
2091 Affects also our add-on break iterator data for
2094 For the default, all locales, don't use this switch at all.
2095 Specifying just the language part of a locale means all matching
2096 locales will be included.
2100 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2101 libo_FUZZ_ARG_WITH(krb5,
2102 AS_HELP_STRING([--with-krb5],
2103 [Enable MIT Kerberos 5 support in modules that support it.
2104 By default automatically enabled on platforms
2105 where a good system Kerberos 5 is available.]),
2108 libo_FUZZ_ARG_WITH(gssapi,
2109 AS_HELP_STRING([--with-gssapi],
2110 [Enable GSSAPI support in modules that support it.
2111 By default automatically enabled on platforms
2112 where a good system GSSAPI is available.]),
2116 AS_HELP_STRING([--with-iwyu],
2117 [Use given IWYU binary path to check unneeded includes instead of building.
2118 Use only if you are hacking on it.]),
2121 libo_FUZZ_ARG_WITH(lxml,
2122 AS_HELP_STRING([--without-lxml],
2123 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2124 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2125 report widget classes and ids.]),
2128 dnl ===================================================================
2130 dnl ===================================================================
2132 AC_ARG_WITH(branding,
2133 AS_HELP_STRING([--with-branding=/path/to/images],
2134 [Use given path to retrieve branding images set.])
2136 Search for intro.png about.svg and flat_logo.svg.
2137 If any is missing, default ones will be used instead.
2139 Search also progress.conf for progress
2140 settings on intro screen :
2142 PROGRESSBARCOLOR="255,255,255" Set color of
2143 progress bar. Comma separated RGB decimal values.
2144 PROGRESSSIZE="407,6" Set size of progress bar.
2145 Comma separated decimal values (width, height).
2146 PROGRESSPOSITION="61,317" Set position of progress
2147 bar from left,top. Comma separated decimal values.
2148 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2149 bar frame. Comma separated RGB decimal values.
2150 PROGRESSTEXTCOLOR="0,0,0" Set color of progress
2151 bar text. Comma separated RGB decimal values.
2152 PROGRESSTEXTBASELINE="287" Set vertical position of
2153 progress bar text from top. Decimal value.
2155 Default values will be used if not found.
2160 AC_ARG_WITH(extra-buildid,
2161 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2162 [Show addition build identification in about dialog.]),
2167 AS_HELP_STRING([--with-vendor="John the Builder"],
2168 [Set vendor of the build.]),
2171 AC_ARG_WITH(android-package-name,
2172 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2173 [Set Android package name of the build.]),
2176 AC_ARG_WITH(compat-oowrappers,
2177 AS_HELP_STRING([--with-compat-oowrappers],
2178 [Install oo* wrappers in parallel with
2179 lo* ones to keep backward compatibility.
2180 Has effect only with make distro-pack-install]),
2183 AC_ARG_WITH(os-version,
2184 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2185 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2188 AC_ARG_WITH(mingw-cross-compiler,
2189 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2190 [Specify the MinGW cross-compiler to use.
2191 When building on the ODK on Unix and building unowinreg.dll,
2192 specify the MinGW C++ cross-compiler.]),
2195 AC_ARG_WITH(idlc-cpp,
2196 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2197 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2200 AC_ARG_WITH(build-version,
2201 AS_HELP_STRING([--with-build-version="Built by Jim"],
2202 [Allows the builder to add a custom version tag that will appear in the
2203 Help/About box for QA purposes.]),
2204 with_build_version=$withval,
2207 AC_ARG_WITH(parallelism,
2208 AS_HELP_STRING([--with-parallelism],
2209 [Number of jobs to run simultaneously during build. Parallel builds can
2210 save a lot of time on multi-cpu machines. Defaults to the number of
2211 CPUs on the machine, unless you configure --enable-icecream - then to
2215 AC_ARG_WITH(all-tarballs,
2216 AS_HELP_STRING([--with-all-tarballs],
2217 [Download all external tarballs unconditionally]))
2219 AC_ARG_WITH(gdrive-client-id,
2220 AS_HELP_STRING([--with-gdrive-client-id],
2221 [Provides the client id of the application for OAuth2 authentication
2222 on Google Drive. If either this or --with-gdrive-client-secret is
2223 empty, the feature will be disabled]),
2226 AC_ARG_WITH(gdrive-client-secret,
2227 AS_HELP_STRING([--with-gdrive-client-secret],
2228 [Provides the client secret of the application for OAuth2
2229 authentication on Google Drive. If either this or
2230 --with-gdrive-client-id is empty, the feature will be disabled]),
2233 AC_ARG_WITH(alfresco-cloud-client-id,
2234 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2235 [Provides the client id of the application for OAuth2 authentication
2236 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2237 empty, the feature will be disabled]),
2240 AC_ARG_WITH(alfresco-cloud-client-secret,
2241 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2242 [Provides the client secret of the application for OAuth2
2243 authentication on Alfresco Cloud. If either this or
2244 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2247 AC_ARG_WITH(onedrive-client-id,
2248 AS_HELP_STRING([--with-onedrive-client-id],
2249 [Provides the client id of the application for OAuth2 authentication
2250 on OneDrive. If either this or --with-onedrive-client-secret is
2251 empty, the feature will be disabled]),
2254 AC_ARG_WITH(onedrive-client-secret,
2255 AS_HELP_STRING([--with-onedrive-client-secret],
2256 [Provides the client secret of the application for OAuth2
2257 authentication on OneDrive. If either this or
2258 --with-onedrive-client-id is empty, the feature will be disabled]),
2260 dnl ===================================================================
2261 dnl Do we want to use pre-build binary tarball for recompile
2262 dnl ===================================================================
2264 if test "$enable_library_bin_tar" = "yes" ; then
2265 USE_LIBRARY_BIN_TAR=TRUE
2267 USE_LIBRARY_BIN_TAR=
2269 AC_SUBST(USE_LIBRARY_BIN_TAR)
2271 dnl ===================================================================
2272 dnl Test whether build target is Release Build
2273 dnl ===================================================================
2274 AC_MSG_CHECKING([whether build target is Release Build])
2275 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2277 ENABLE_RELEASE_BUILD=
2279 AC_MSG_RESULT([yes])
2280 ENABLE_RELEASE_BUILD=TRUE
2282 AC_SUBST(ENABLE_RELEASE_BUILD)
2284 dnl ===================================================================
2285 dnl Test whether to sign Windows Build
2286 dnl ===================================================================
2287 AC_MSG_CHECKING([whether to sign windows build])
2288 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2289 AC_MSG_RESULT([yes])
2290 WINDOWS_BUILD_SIGNING="TRUE"
2293 WINDOWS_BUILD_SIGNING="FALSE"
2295 AC_SUBST(WINDOWS_BUILD_SIGNING)
2297 dnl ===================================================================
2298 dnl MacOSX build and runtime environment options
2299 dnl ===================================================================
2301 AC_ARG_WITH(macosx-sdk,
2302 AS_HELP_STRING([--with-macosx-sdk=<version>],
2303 [Prefer a specific SDK for building.])
2305 If the requested SDK is not available, a search for the oldest one will be done.
2306 With current Xcode versions, only the latest SDK is included, so this option is
2307 not terribly useful. It works fine to build with a new SDK and run the result
2310 e. g.: --with-macosx-sdk=10.10
2312 there are 3 options to control the MacOSX build:
2313 --with-macosx-sdk (referred as 'sdk' below)
2314 --with-macosx-version-min-required (referred as 'min' below)
2315 --with-macosx-version-max-allowed (referred as 'max' below)
2317 the connection between these value and the default they take is as follow:
2318 ( ? means not specified on the command line, s means the SDK version found,
2319 constraint: 8 <= x <= y <= z)
2321 ==========================================
2322 command line || config result
2323 ==========================================
2324 min | max | sdk || min | max | sdk |
2325 ? | ? | ? || 10.10 | 10.s | 10.s |
2326 ? | ? | 10.x || 10.10 | 10.x | 10.x |
2327 ? | 10.x | ? || 10.10 | 10.s | 10.s |
2328 ? | 10.x | 10.y || 10.10 | 10.x | 10.y |
2329 10.x | ? | ? || 10.x | 10.s | 10.s |
2330 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2331 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2332 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2335 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2336 for a detailed technical explanation of these variables
2338 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2342 AC_ARG_WITH(macosx-version-min-required,
2343 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2344 [set the minimum OS version needed to run the built LibreOffice])
2346 e. g.: --with-macos-version-min-required=10.10
2347 see --with-macosx-sdk for more info
2351 AC_ARG_WITH(macosx-version-max-allowed,
2352 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2353 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2355 e. g.: --with-macos-version-max-allowed=10.10
2356 see --with-macosx-sdk for more info
2361 dnl ===================================================================
2362 dnl options for stuff used during cross-compilation build
2363 dnl Not quite superseded by --with-build-platform-configure-options.
2364 dnl TODO: check, if the "force" option is still needed anywhere.
2365 dnl ===================================================================
2367 AC_ARG_WITH(system-icu-for-build,
2368 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2369 [Use icu already on system for build tools (cross-compilation only).]))
2372 dnl ===================================================================
2373 dnl Check for incompatible options set by fuzzing, and reset those
2374 dnl automatically to working combinations
2375 dnl ===================================================================
2377 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2378 "$enable_dbus" != "$enable_avahi"; then
2379 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2380 enable_avahi=$enable_dbus
2383 dnl ===================================================================
2384 dnl check for required programs (grep, awk, sed, bash)
2385 dnl ===================================================================
2389 if test -n "$1"; then
2390 if test "$build_os" = "cygwin"; then
2391 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2393 new_path=`cygpath -sm "$formatted_path"`
2396 new_path=`cygpath -u "$formatted_path"`
2401 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2402 if test "$2" = "after"; then
2403 LO_PATH="$LO_PATH${P_SEP}$new_path"
2405 LO_PATH="$new_path${P_SEP}$LO_PATH"
2413 AC_PATH_PROG( AWK, $AWK)
2414 if test -z "$AWK"; then
2415 AC_MSG_ERROR([install awk to run this script])
2418 AC_PATH_PROG(BASH, bash)
2419 if test -z "$BASH"; then
2420 AC_MSG_ERROR([bash not found in \$PATH])
2424 AC_MSG_CHECKING([for GNU or BSD tar])
2425 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2426 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2427 if test $? -eq 0; then
2432 AC_MSG_RESULT($GNUTAR)
2433 if test -z "$GNUTAR"; then
2434 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2438 AC_MSG_CHECKING([for tar's option to strip components])
2439 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2440 if test $? -eq 0; then
2441 STRIP_COMPONENTS="--strip-components"
2443 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2444 if test $? -eq 0; then
2445 STRIP_COMPONENTS="--strip-path"
2447 STRIP_COMPONENTS="unsupported"
2450 AC_MSG_RESULT($STRIP_COMPONENTS)
2451 if test x$STRIP_COMPONENTS = xunsupported; then
2452 AC_MSG_ERROR([you need a tar that is able to strip components.])
2454 AC_SUBST(STRIP_COMPONENTS)
2456 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2457 dnl desktop OSes from "mobile" ones.
2459 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2460 dnl In other words, that when building for an OS that is not a
2461 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2463 dnl Note the direction of the implication; there is no assumption that
2464 dnl cross-compiling would imply a non-desktop OS.
2466 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2467 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2468 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2469 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2472 # Whether to build "avmedia" functionality or not.
2474 if test -z "$enable_avmedia"; then
2478 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2479 if test "$enable_avmedia" = yes; then
2480 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2482 USE_AVMEDIA_DUMMY='TRUE'
2484 AC_SUBST(USE_AVMEDIA_DUMMY)
2486 # Decide whether to build database connectivity stuff (including
2487 # Base) or not. We probably don't want to on non-desktop OSes.
2488 if test -z "$enable_database_connectivity"; then
2489 # --disable-database-connectivity is unfinished work in progress
2490 # and the iOS test app doesn't link if we actually try to use it.
2491 # if test $_os != iOS -a $_os != Android; then
2492 if test $_os != iOS; then
2493 enable_database_connectivity=yes
2497 if test "$enable_database_connectivity" = yes; then
2498 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2499 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2502 if test -z "$enable_extensions"; then
2503 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2504 if test $_os != iOS -a $_os != Android; then
2505 enable_extensions=yes
2509 if test "$enable_extensions" = yes; then
2510 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2511 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2514 if test -z "$enable_scripting"; then
2515 # Disable scripting for iOS unless specifically overridden
2516 # with --enable-scripting.
2517 if test $_os != iOS; then
2518 enable_scripting=yes
2522 DISABLE_SCRIPTING=''
2523 if test "$enable_scripting" = yes; then
2524 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2525 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2527 DISABLE_SCRIPTING='TRUE'
2528 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2531 if test $_os = iOS -o $_os = Android; then
2532 # Disable dynamic_loading always for iOS and Android
2533 enable_dynamic_loading=no
2534 elif test -z "$enable_dynamic_loading"; then
2535 # Otherwise enable it unless specifically disabled
2536 enable_dynamic_loading=yes
2539 DISABLE_DYNLOADING=''
2540 if test "$enable_dynamic_loading" = yes; then
2541 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2543 DISABLE_DYNLOADING='TRUE'
2545 AC_SUBST(DISABLE_DYNLOADING)
2547 # remember SYSBASE value
2550 dnl ===================================================================
2551 dnl Sort out various gallery compilation options
2552 dnl ===================================================================
2553 AC_MSG_CHECKING([how to build and package galleries])
2554 if test -n "${with_galleries}"; then
2555 if test "$with_galleries" = "build"; then
2556 WITH_GALLERY_BUILD=TRUE
2557 AC_MSG_RESULT([build from source images internally])
2558 elif test "$with_galleries" = "no"; then
2560 AC_MSG_RESULT([disable non-internal gallery build])
2562 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2565 if test $_os != iOS -a $_os != Android; then
2566 WITH_GALLERY_BUILD=TRUE
2567 AC_MSG_RESULT([internal src images for desktop])
2570 AC_MSG_RESULT([disable src image build])
2573 AC_SUBST(WITH_GALLERY_BUILD)
2575 dnl ===================================================================
2576 dnl Checks if ccache is available
2577 dnl ===================================================================
2578 if test "$_os" = "WINNT"; then
2579 # on windows/VC build do not use ccache
2581 elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2582 case "%$CC%$CXX%" in
2583 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2584 # assume that's good then
2585 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2586 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2589 AC_PATH_PROG([CCACHE],[ccache],[not found])
2590 if test "$CCACHE" = "not found"; then
2593 # Need to check for ccache version: otherwise prevents
2594 # caching of the results (like "-x objective-c++" for Mac)
2595 if test $_os = Darwin -o $_os = iOS; then
2596 # Check ccache version
2597 AC_MSG_CHECKING([whether version of ccache is suitable])
2598 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2599 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2600 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2601 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2603 AC_MSG_RESULT([no, $CCACHE_VERSION])
2614 if test "$CCACHE" != ""; then
2615 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2616 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2617 if test "$ccache_size" = ""; then
2618 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2619 if test "$ccache_size" = ""; then
2622 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2623 if test $ccache_size -lt 1024; then
2625 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2626 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2628 # warn that ccache may be too small for debug build
2629 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2630 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2633 if test $ccache_size -lt 5; then
2634 #warn that ccache may be too small for debug build
2635 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2636 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2641 dnl ===================================================================
2642 dnl Checks for C compiler,
2643 dnl The check for the C++ compiler is later on.
2644 dnl ===================================================================
2645 if test "$_os" != "WINNT"; then
2647 AC_MSG_CHECKING([gcc home])
2648 if test -z "$with_gcc_home"; then
2649 if test "$enable_icecream" = "yes"; then
2650 if test -d "/usr/lib/icecc/bin"; then
2651 GCC_HOME="/usr/lib/icecc/"
2652 elif test -d "/usr/libexec/icecc/bin"; then
2653 GCC_HOME="/usr/libexec/icecc/"
2654 elif test -d "/opt/icecream/bin"; then
2655 GCC_HOME="/opt/icecream/"
2657 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
2661 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2662 GCC_HOME_SET="false"
2665 GCC_HOME="$with_gcc_home"
2667 AC_MSG_RESULT($GCC_HOME)
2670 if test "$GCC_HOME_SET" = "true"; then
2671 if test -z "$CC"; then
2672 CC="$GCC_HOME/bin/gcc"
2674 if test -z "$CXX"; then
2675 CXX="$GCC_HOME/bin/g++"
2680 COMPATH=`dirname "$CC"`
2681 if test "$COMPATH" = "."; then
2682 AC_PATH_PROGS(COMPATH, $CC)
2683 dnl double square bracket to get single because of M4 quote...
2684 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2686 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2688 dnl ===================================================================
2690 dnl ===================================================================
2691 AC_MSG_CHECKING([whether to build with Java support])
2692 if test "$with_java" != "no"; then
2693 if test "$DISABLE_SCRIPTING" = TRUE; then
2694 AC_MSG_RESULT([no, overridden by --disable-scripting])
2698 AC_MSG_RESULT([yes])
2700 AC_DEFINE(HAVE_FEATURE_JAVA)
2707 AC_SUBST(ENABLE_JAVA)
2709 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2711 dnl ENABLE_JAVA="" indicate no Java support at all
2713 dnl ===================================================================
2714 dnl Check macOS SDK and compiler
2715 dnl ===================================================================
2717 if test $_os = Darwin -o $_os = iOS; then
2719 # If no --with-macosx-sdk option is given, look for one
2721 # The intent is that for "most" Mac-based developers, a suitable
2722 # SDK will be found automatically without any configure options.
2724 # For developers with a current Xcode, the lowest-numbered SDK
2725 # higher than or equal to the minimum required should be found.
2727 AC_MSG_CHECKING([what macOS SDK to use])
2728 for _macosx_sdk in ${with_macosx_sdk-10.14 10.13 10.12}; do
2729 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2730 if test -d "$MACOSX_SDK_PATH"; then
2731 with_macosx_sdk="${_macosx_sdk}"
2734 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2735 if test -d "$MACOSX_SDK_PATH"; then
2736 with_macosx_sdk="${_macosx_sdk}"
2741 if test ! -d "$MACOSX_SDK_PATH"; then
2742 AC_MSG_ERROR([Could not find an appropriate macOS SDK])
2745 if test $_os = iOS; then
2746 if test "$enable_ios_simulator" = "yes"; then
2747 useos=iphonesimulator
2751 MACOSX_SDK_PATH=`xcrun --sdk ${useos} --show-sdk-path 2> /dev/null`
2753 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2756 case $with_macosx_sdk in
2758 MACOSX_SDK_VERSION=101200
2761 MACOSX_SDK_VERSION=101300
2764 MACOSX_SDK_VERSION=101400
2767 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--14])
2771 if test "$with_macosx_version_min_required" = "" ; then
2772 with_macosx_version_min_required="10.10";
2775 if test "$with_macosx_version_max_allowed" = "" ; then
2776 with_macosx_version_max_allowed="$with_macosx_sdk"
2779 # export this so that "xcrun" invocations later return matching values
2780 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2781 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2782 export DEVELOPER_DIR
2783 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2784 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2786 AC_MSG_CHECKING([whether Xcode is new enough])
2787 my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
2788 my_xcode_ver2=${my_xcode_ver1#Xcode }
2789 my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
2790 if test "$my_xcode_ver3" -ge 903; then
2791 AC_MSG_RESULT([yes ($my_xcode_ver2)])
2793 AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 9.3])
2796 case "$with_macosx_version_min_required" in
2798 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2801 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2804 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2807 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2810 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
2813 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--14])
2816 MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
2818 LIBTOOL=/usr/bin/libtool
2819 INSTALL_NAME_TOOL=install_name_tool
2820 if test -z "$save_CC"; then
2821 AC_MSG_CHECKING([what compiler to use])
2822 stdlib=-stdlib=libc++
2823 if test "$ENABLE_LTO" = TRUE; then
2826 CC="`xcrun -find clang` -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2827 CXX="`xcrun -find clang++` -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2828 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2831 STRIP=`xcrun -find strip`
2832 LIBTOOL=`xcrun -find libtool`
2833 RANLIB=`xcrun -find ranlib`
2834 AC_MSG_RESULT([$CC and $CXX])
2837 case "$with_macosx_version_max_allowed" in
2839 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2842 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2845 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2848 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2851 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
2854 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--14])
2858 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2859 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2860 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])
2865 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2866 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2867 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2871 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2872 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2874 AC_MSG_CHECKING([whether to do code signing])
2876 if test "$enable_macosx_code_signing" = yes; then
2877 # By default use the first suitable certificate (?).
2879 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2880 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2881 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2882 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2883 # "Developer ID Application" one.
2885 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2886 if test -n "$identity"; then
2887 MACOSX_CODESIGNING_IDENTITY=$identity
2888 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2889 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2891 AC_MSG_ERROR([cannot determine identity to use])
2893 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2894 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2895 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2896 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2901 AC_MSG_CHECKING([whether to create a Mac App Store package])
2903 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2904 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2905 elif test "$enable_macosx_package_signing" = yes; then
2906 # By default use the first suitable certificate.
2907 # It should be a "3rd Party Mac Developer Installer" one
2909 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2910 if test -n "$identity"; then
2911 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2912 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2913 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2915 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2917 elif test -n "$enable_macosx_package_signing"; then
2918 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2919 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2920 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2925 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2926 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2929 AC_MSG_CHECKING([whether to sandbox the application])
2931 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2932 AC_MSG_ERROR([macOS sandboxing requires code signing])
2933 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
2934 AC_MSG_ERROR([macOS sandboxing (actually App Store rules) disallows use of Java])
2935 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2936 ENABLE_MACOSX_SANDBOX=TRUE
2937 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
2938 AC_MSG_RESULT([yes])
2943 AC_MSG_CHECKING([what macOS app bundle identifier to use])
2944 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
2945 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
2947 AC_SUBST(MACOSX_SDK_PATH)
2948 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2949 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2950 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
2951 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2952 AC_SUBST(INSTALL_NAME_TOOL)
2953 AC_SUBST(LIBTOOL) # Note that the macOS libtool command is unrelated to GNU libtool
2954 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2955 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
2956 AC_SUBST(ENABLE_MACOSX_SANDBOX)
2957 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
2959 dnl ===================================================================
2960 dnl Check iOS SDK and compiler
2961 dnl ===================================================================
2963 if test $_os = iOS; then
2964 AC_MSG_CHECKING([what iOS SDK to use])
2965 current_sdk_ver=12.2
2966 older_sdk_vers="12.1 12.0 11.4"
2967 if test "$enable_ios_simulator" = "yes"; then
2968 platform=iPhoneSimulator
2969 versionmin=-mios-simulator-version-min=11.0
2972 versionmin=-miphoneos-version-min=11.0
2974 xcode_developer=`xcode-select -print-path`
2976 for sdkver in $current_sdk_ver $older_sdk_vers; do
2977 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
2984 if test -z "$sysroot"; then
2985 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
2988 AC_MSG_RESULT($sysroot)
2990 # LTO is not really recommended for iOS builds,
2991 # the link time will be astronomical
2992 if test "$ENABLE_LTO" = TRUE; then
2996 stdlib="-stdlib=libc++"
2998 CC="`xcrun -find clang` -arch $host_cpu -isysroot $sysroot $lto $versionmin"
2999 CXX="`xcrun -find clang++` -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
3001 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3004 STRIP=`xcrun -find strip`
3005 LIBTOOL=`xcrun -find libtool`
3006 RANLIB=`xcrun -find ranlib`
3009 AC_MSG_CHECKING([whether to treat the installation as read-only])
3011 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3012 "$enable_extensions" != yes; then
3013 enable_readonly_installset=yes
3015 if test "$enable_readonly_installset" = yes; then
3016 AC_MSG_RESULT([yes])
3017 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3022 dnl ===================================================================
3023 dnl Structure of install set
3024 dnl ===================================================================
3026 if test $_os = Darwin; then
3027 LIBO_BIN_FOLDER=MacOS
3028 LIBO_ETC_FOLDER=Resources
3029 LIBO_LIBEXEC_FOLDER=MacOS
3030 LIBO_LIB_FOLDER=Frameworks
3031 LIBO_LIB_PYUNO_FOLDER=Resources
3032 LIBO_SHARE_FOLDER=Resources
3033 LIBO_SHARE_HELP_FOLDER=Resources/help
3034 LIBO_SHARE_JAVA_FOLDER=Resources/java
3035 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3036 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3037 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3038 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3039 LIBO_URE_BIN_FOLDER=MacOS
3040 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3041 LIBO_URE_LIB_FOLDER=Frameworks
3042 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3043 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3044 elif test $_os = WINNT; then
3045 LIBO_BIN_FOLDER=program
3046 LIBO_ETC_FOLDER=program
3047 LIBO_LIBEXEC_FOLDER=program
3048 LIBO_LIB_FOLDER=program
3049 LIBO_LIB_PYUNO_FOLDER=program
3050 LIBO_SHARE_FOLDER=share
3051 LIBO_SHARE_HELP_FOLDER=help
3052 LIBO_SHARE_JAVA_FOLDER=program/classes
3053 LIBO_SHARE_PRESETS_FOLDER=presets
3054 LIBO_SHARE_READMES_FOLDER=readmes
3055 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3056 LIBO_SHARE_SHELL_FOLDER=program/shell
3057 LIBO_URE_BIN_FOLDER=program
3058 LIBO_URE_ETC_FOLDER=program
3059 LIBO_URE_LIB_FOLDER=program
3060 LIBO_URE_MISC_FOLDER=program
3061 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3063 LIBO_BIN_FOLDER=program
3064 LIBO_ETC_FOLDER=program
3065 LIBO_LIBEXEC_FOLDER=program
3066 LIBO_LIB_FOLDER=program
3067 LIBO_LIB_PYUNO_FOLDER=program
3068 LIBO_SHARE_FOLDER=share
3069 LIBO_SHARE_HELP_FOLDER=help
3070 LIBO_SHARE_JAVA_FOLDER=program/classes
3071 LIBO_SHARE_PRESETS_FOLDER=presets
3072 LIBO_SHARE_READMES_FOLDER=readmes
3073 if test "$enable_fuzzers" != yes; then
3074 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3076 LIBO_SHARE_RESOURCE_FOLDER=resource
3078 LIBO_SHARE_SHELL_FOLDER=program/shell
3079 LIBO_URE_BIN_FOLDER=program
3080 LIBO_URE_ETC_FOLDER=program
3081 LIBO_URE_LIB_FOLDER=program
3082 LIBO_URE_MISC_FOLDER=program
3083 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3085 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3086 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3087 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3088 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3089 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3090 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3091 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3092 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3093 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3094 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3095 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3096 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3097 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3098 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3099 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3100 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3102 # Not all of them needed in config_host.mk, add more if need arises
3103 AC_SUBST(LIBO_BIN_FOLDER)
3104 AC_SUBST(LIBO_ETC_FOLDER)
3105 AC_SUBST(LIBO_LIB_FOLDER)
3106 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3107 AC_SUBST(LIBO_SHARE_FOLDER)
3108 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3109 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3110 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3111 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3112 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3113 AC_SUBST(LIBO_URE_BIN_FOLDER)
3114 AC_SUBST(LIBO_URE_ETC_FOLDER)
3115 AC_SUBST(LIBO_URE_LIB_FOLDER)
3116 AC_SUBST(LIBO_URE_MISC_FOLDER)
3117 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3119 dnl ===================================================================
3120 dnl Windows specific tests and stuff
3121 dnl ===================================================================
3125 # Return value: $regvalue
3128 local _regentry="/proc/registry${1}/${2}"
3129 if test -f "$_regentry"; then
3130 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3131 # Registry keys read via /proc/registry* are always \0 terminated!
3132 local _regvalue=$(tr -d '\0' < "$_regentry")
3133 if test $? -eq 0; then
3139 # Get a value from the 32-bit side of the Registry
3142 reg_get_value "32" "$1"
3145 # Get a value from the 64-bit side of the Registry
3148 reg_get_value "64" "$1"
3151 if test "$_os" = "WINNT"; then
3152 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3153 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3155 WINDOWS_SDK_ARCH="x86"
3157 AC_MSG_RESULT([yes])
3158 WINDOWS_SDK_ARCH="x64"
3162 if test "$_os" = "iOS"; then
3163 cross_compiling="yes"
3166 if test "$cross_compiling" = "yes"; then
3167 export CROSS_COMPILING=TRUE
3170 BUILD_TYPE="$BUILD_TYPE NATIVE"
3172 AC_SUBST(CROSS_COMPILING)
3174 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3175 # NOTE: must _not_ be used for bundled external libraries!
3177 if test "$GCC" = "yes"; then
3178 AC_MSG_CHECKING( for -isystem )
3180 CFLAGS="$CFLAGS -Werror"
3181 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3183 if test -n "$ISYSTEM"; then
3189 if test -z "$ISYSTEM"; then
3190 # fall back to using -I
3195 dnl ===================================================================
3196 dnl Check which Visual Studio compiler is used
3197 dnl ===================================================================
3199 map_vs_year_to_version()
3201 # Return value: $vsversion
3209 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3213 vs_versions_to_check()
3215 # Args: $1 (optional) : versions to check, in the order of preference
3216 # Return value: $vsversions
3220 if test -n "$1"; then
3221 map_vs_year_to_version "$1"
3222 vsversions=$vsversion
3224 # We accept only 2017
3229 win_get_env_from_vsvars32bat()
3231 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3232 # Also seems to be located in another directory under the same name: vsvars32.bat
3233 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3234 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3235 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3236 chmod +x $WRAPPERBATCHFILEPATH
3237 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3238 rm -f $WRAPPERBATCHFILEPATH
3239 printf '%s' "$_win_get_env_from_vsvars32bat"
3244 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3245 if test -n "$regvalue"; then
3246 PathFormat "$regvalue"
3247 UCRTSDKDIR=$formatted_path
3248 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3249 UCRTVERSION=$regvalue
3251 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3255 if test -z "$UCRTSDKDIR"; then
3256 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3257 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3258 if test -f "$ide_env_file"; then
3259 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3260 UCRTSDKDIR=$formatted_path
3261 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3262 dnl Hack needed at least by tml:
3263 if test "$UCRTVERSION" = 10.0.15063.0 \
3264 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3265 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3267 UCRTVERSION=10.0.14393.0
3270 AC_MSG_ERROR([No UCRT found])
3277 # Find Visual C++ 2017
3278 # Args: $1 (optional) : The VS version year
3279 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3281 unset vctest vcnum vcnumwithdot vcbuildnumber
3283 vs_versions_to_check "$1"
3285 for ver in $vsversions; do
3286 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3287 if test -n "$regvalue"; then
3291 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver
3292 if test -n "$regvalue"; then
3293 AC_MSG_RESULT([found: $regvalue])
3294 PathFormat "$regvalue"
3295 vctest=$formatted_path
3299 if test -n "$vctest"; then
3301 case "$vcnumwithdot" in
3305 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3314 if test "$_os" = "WINNT"; then
3315 AC_MSG_CHECKING([Visual C++])
3317 find_msvc "$with_visual_studio"
3318 if test -z "$vctest"; then
3319 if test -n "$with_visual_studio"; then
3320 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3322 AC_MSG_ERROR([No Visual Studio 2017 installation found])
3326 if test "$BITNESS_OVERRIDE" = ""; then
3327 if test -f "$vctest/bin/cl.exe"; then
3328 VC_PRODUCT_DIR=$vctest
3329 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3330 VC_PRODUCT_DIR=$vctest/VC
3332 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3335 if test -f "$vctest/bin/amd64/cl.exe"; then
3336 VC_PRODUCT_DIR=$vctest
3337 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3338 VC_PRODUCT_DIR=$vctest/VC
3340 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe or $vctest/bin/amd64/cl.exe or $vctest/bin/x86_amd64/cl.exe])
3344 AC_MSG_CHECKING([for short pathname of VC product directory])
3345 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3346 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3351 AC_MSG_CHECKING([for UCRT location])
3353 # find_ucrt errors out if it doesn't find it
3354 AC_MSG_RESULT([found])
3355 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3356 ucrtincpath_formatted=$formatted_path
3357 # SOLARINC is used for external modules and must be set too.
3358 # And no, it's not sufficient to set SOLARINC only, as configure
3359 # itself doesn't honour it.
3360 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3361 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3362 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3363 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3365 AC_SUBST(UCRTSDKDIR)
3366 AC_SUBST(UCRTVERSION)
3368 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3369 # Find the proper version of MSBuild.exe to use based on the VS version
3370 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3371 if test -n "$regvalue" ; then
3372 AC_MSG_RESULT([found: $regvalue])
3373 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3375 if test "$BITNESS_OVERRIDE" = ""; then
3376 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3378 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3380 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3381 AC_MSG_RESULT([$regvalue])
3384 # Find the version of devenv.exe
3385 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3386 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3387 if test ! -e "$DEVENV"; then
3388 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3391 dnl ===========================================================
3392 dnl Check for the corresponding mspdb*.dll
3393 dnl ===========================================================
3399 if test "$BITNESS_OVERRIDE" = ""; then
3400 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86"
3401 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX86/x86
3403 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64"
3404 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX64/x64
3407 # MSVC 15.0 has libraries from 14.0?
3410 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3411 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3414 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3415 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3417 dnl The path needs to be added before cl is called
3418 PATH="$MSPDB_PATH:$PATH"
3420 AC_MSG_CHECKING([cl.exe])
3422 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3423 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3424 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3427 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3428 dnl needed when building CLR code:
3429 if test -z "$MSVC_CXX"; then
3430 if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
3431 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
3434 # This gives us a posix path with 8.3 filename restrictions
3435 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3438 if test -z "$CC"; then
3441 if test "$BITNESS_OVERRIDE" = ""; then
3442 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3443 MSVC_CXX="$MSVC_CXX -arch:SSE"
3446 if test -n "$CC"; then
3447 # Remove /cl.exe from CC case insensitive
3448 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3449 if test "$BITNESS_OVERRIDE" = ""; then
3450 COMPATH="$VC_PRODUCT_DIR"
3452 if test -n "$VC_PRODUCT_DIR"; then
3453 COMPATH=$VC_PRODUCT_DIR
3456 if test "$BITNESS_OVERRIDE" = ""; then
3457 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3461 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3463 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3465 PathFormat "$COMPATH"
3466 COMPATH="$formatted_path"
3471 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3472 # are always "better", we list them in reverse chronological order.
3477 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
3481 # The expectation is that --with-windows-sdk should not need to be used
3482 if test -n "$with_windows_sdk"; then
3483 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3484 *" "$with_windows_sdk" "*)
3485 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3488 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3493 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3498 AC_MSG_ERROR([Visual C++ not found after all, huh])
3501 AC_MSG_CHECKING([$CC is at least Visual Studio 2017 version 15.7])
3502 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3503 // See <https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros> for mapping
3504 // between Visual Studio versions and _MSC_VER:
3508 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no])])
3510 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3511 # version of the Explorer extension (and maybe other small
3512 # bits, too) needed when installing a 32-bit LibreOffice on a
3513 # 64-bit OS. The 64-bit Explorer extension is a feature that
3514 # has been present since long in OOo. Don't confuse it with
3515 # building LibreOffice itself as 64-bit code.
3521 if test "$BITNESS_OVERRIDE" = ""; then
3522 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3523 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3524 # Prefer native x64 compiler to cross-compiler, in case we are running
3525 # the build on a 64-bit OS.
3526 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3528 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3529 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3530 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3532 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3533 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3535 elif test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib"; then
3536 # nobody uses 32-bit OS to build, just pick the 64-bit compiler
3537 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3539 CXX_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"
3540 LINK_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/link.exe"
3543 if test "$BUILD_X64" = TRUE; then
3544 AC_MSG_RESULT([found])
3546 AC_MSG_RESULT([not found])
3547 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3552 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3553 AC_SUBST(CXX_X64_BINARY)
3554 AC_SUBST(LINK_X64_BINARY)
3556 # Check for 32-bit compiler to use to build the 32-bit TWAIN shim
3557 # needed to support TWAIN scan on both 32- and 64-bit systems
3561 if test "$BITNESS_OVERRIDE" = "64"; then
3562 AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
3563 if test -n "$CXX_X86_BINARY"; then
3565 AC_MSG_RESULT([preset])
3566 elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then
3568 CXX_X86_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe -arch:SSE"
3569 AC_MSG_RESULT([found])
3572 AC_MSG_RESULT([not found])
3573 AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
3577 CXX_X86_BINARY=$MSVC_CXX
3580 AC_SUBST(CXX_X86_BINARY)
3584 PathFormat "$MSPDB_PATH"
3585 MSPDB_PATH="$formatted_path"
3591 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3592 AC_SUBST(UNOWINREG_DLL)
3595 AC_MSG_CHECKING([whether the compiler is actually Clang])
3596 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3602 [AC_MSG_RESULT([yes])
3604 [AC_MSG_RESULT([no])])
3605 AC_SUBST(COM_IS_CLANG)
3609 if test "$COM_IS_CLANG" = TRUE; then
3610 AC_MSG_CHECKING([whether Clang is new enough])
3611 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3612 #if !defined __apple_build_version__
3616 [my_apple_clang=yes],[my_apple_clang=])
3617 if test "$my_apple_clang" = yes; then
3618 AC_MSG_RESULT([assumed yes (Apple Clang)])
3620 if test "$_os" = WINNT; then
3621 dnl In which case, assume clang-cl:
3623 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3631 CC_PLAIN="$CC_PLAIN $i"
3638 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
3639 CLANGVER=`echo $clang_version \
3640 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3641 if test "$CLANGVER" -ge 50002; then
3642 AC_MSG_RESULT([yes ($clang_version)])
3644 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3645 AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
3647 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3651 SHOWINCLUDES_PREFIX=
3652 if test "$_os" = WINNT; then
3653 dnl We need to guess the prefix of the -showIncludes output, it can be
3655 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3656 echo "#include <stdlib.h>" > conftest.c
3657 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3658 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3659 rm -f conftest.c conftest.obj
3660 if test -z "$SHOWINCLUDES_PREFIX"; then
3661 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3663 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3666 AC_SUBST(SHOWINCLUDES_PREFIX)
3669 # prefix C with ccache if needed
3671 if test "$CCACHE" != ""; then
3672 AC_MSG_CHECKING([whether $CC is already ccached])
3676 CFLAGS="$CFLAGS --ccache-skip -O2"
3677 dnl an empty program will do, we're checking the compiler flags
3678 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3679 [use_ccache=yes], [use_ccache=no])
3680 if test $use_ccache = yes; then
3681 AC_MSG_RESULT([yes])
3690 # ===================================================================
3691 # check various GCC options that Clang does not support now but maybe
3692 # will somewhen in the future, check them even for GCC, so that the
3694 # ===================================================================
3697 if test "$GCC" = "yes"; then
3698 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3700 CFLAGS="$CFLAGS -Werror -ggdb2"
3701 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3703 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3704 AC_MSG_RESULT([yes])
3709 if test "$host_cpu" = "m68k"; then
3710 AC_MSG_CHECKING([whether $CC supports -mlong-jump-table-offsets])
3712 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3713 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3715 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3716 AC_MSG_RESULT([yes])
3722 AC_SUBST(HAVE_GCC_GGDB2)
3724 dnl ===================================================================
3725 dnl Test the gcc version
3726 dnl ===================================================================
3727 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3728 AC_MSG_CHECKING([the GCC version])
3729 _gcc_version=`$CC -dumpversion`
3730 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3731 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3732 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3734 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3736 if test "$gcc_full_version" -lt 70000; then
3737 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 7.0.0])
3740 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3741 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3742 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3743 # (which reports itself as GCC 4.2.1).
3746 AC_SUBST(GCC_VERSION)
3748 dnl Set the ENABLE_DBGUTIL variable
3749 dnl ===================================================================
3750 AC_MSG_CHECKING([whether to build with additional debug utilities])
3751 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3752 ENABLE_DBGUTIL="TRUE"
3753 # this is an extra var so it can have different default on different MSVC
3754 # versions (in case there are version specific problems with it)
3755 MSVC_USE_DEBUG_RUNTIME="TRUE"
3757 AC_MSG_RESULT([yes])
3758 # cppunit and graphite expose STL in public headers
3759 if test "$with_system_cppunit" = "yes"; then
3760 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3762 with_system_cppunit=no
3764 if test "$with_system_graphite" = "yes"; then
3765 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3767 with_system_graphite=no
3769 if test "$with_system_orcus" = "yes"; then
3770 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3772 with_system_orcus=no
3774 if test "$with_system_libcmis" = "yes"; then
3775 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3777 with_system_libcmis=no
3779 if test "$with_system_hunspell" = "yes"; then
3780 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3782 with_system_hunspell=no
3784 if test "$with_system_gpgmepp" = "yes"; then
3785 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3787 with_system_gpgmepp=no
3789 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
3790 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
3791 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
3792 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
3793 # of those two is using the system variant:
3794 if test "$with_system_libnumbertext" = "yes"; then
3795 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
3797 with_system_libnumbertext=no
3799 if test "$with_system_libwps" = "yes"; then
3800 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
3802 with_system_libwps=no
3806 MSVC_USE_DEBUG_RUNTIME=""
3809 AC_SUBST(ENABLE_DBGUTIL)
3810 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3812 dnl Set the ENABLE_DEBUG variable.
3813 dnl ===================================================================
3814 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3815 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3817 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3818 if test -z "$libo_fuzzed_enable_debug"; then
3819 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3821 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3826 AC_MSG_CHECKING([whether to do a debug build])
3827 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3829 if test -n "$ENABLE_DBGUTIL" ; then
3830 AC_MSG_RESULT([yes (dbgutil)])
3832 AC_MSG_RESULT([yes])
3838 AC_SUBST(ENABLE_DEBUG)
3840 dnl ===================================================================
3841 dnl Select the linker to use (gold/lld/ld.bfd).
3842 dnl This is done only after compiler checks (need to know if Clang is
3843 dnl used, for different defaults) and after checking if a debug build
3844 dnl is wanted (non-debug builds get the default linker if not explicitly
3845 dnl specified otherwise).
3846 dnl All checks for linker features/options should come after this.
3847 dnl ===================================================================
3851 use_ld_fail_if_error=$2
3853 AC_MSG_CHECKING([for -fuse-ld=$use_ld linker support])
3854 use_ld_ldflags_save="$LDFLAGS"
3855 LDFLAGS="$LDFLAGS -fuse-ld=$use_ld"
3856 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3859 printf ("hello world\n");
3860 ])], USE_LD=$use_ld, [])
3861 if test -n "$USE_LD"; then
3862 AC_MSG_RESULT( yes )
3864 dnl For obscure reasons, unxgcc.mk uses the --dynamic-list-cpp-typeinfo linker option
3865 dnl if sanitizers are used, and lld doesn't support this option.
3866 use_ld_has_sanitizers=
3870 use_ld_has_sanitizers=yes
3875 if test -n "$use_ld_has_sanitizers"; then
3876 AC_MSG_CHECKING([for --dynamic-list-cpp-typeinfo linker support (-fuse-ld=$use_ld)])
3877 use_ld_ldflags_save_2="$LDFLAGS"
3878 LDFLAGS="$LDFLAGS -Wl,--dynamic-list-cpp-typeinfo"
3879 use_ld_has_cpp_typeinfo=
3880 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3883 printf ("hello world\n");
3884 ])], use_ld_has_cpp_typeinfo=yes, [])
3885 LDFLAGS="$use_ld_ldflags_save_2"
3886 if test -n "$use_ld_has_cpp_typeinfo"; then
3887 AC_MSG_RESULT( yes )
3894 if test -n "$use_ld_fail_if_error"; then
3900 if test -n "$use_ld_ok"; then
3901 dnl keep the value of LDFLAGS
3904 LDFLAGS="$use_ld_ldflags_save"
3908 if test "$enable_ld" != "no"; then
3909 if test "$GCC" = "yes"; then
3910 if test -n "$enable_ld"; then
3911 check_use_ld "$enable_ld" fail_if_error
3912 elif test -z "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3913 dnl non-debug builds default to the default linker
3915 elif test -n "$COM_IS_CLANG"; then
3917 if test $? -ne 0; then
3923 ld_output=$(echo 'int main() { return 0; }' | $CC -Wl,-v -x c -o conftest.out - $CFLAGS $LDFLAGS 2>/dev/null)
3925 ld_used=$(echo "$ld_output" | grep -E '(^GNU gold|^GNU ld|^LLD)')
3926 if test -z "$ld_used"; then
3929 AC_MSG_CHECKING([for linker that is used])
3930 AC_MSG_RESULT([$ld_used])
3931 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3932 if echo "$ld_used" | grep -q "^GNU ld"; then
3933 if test -n "$COM_IS_CLANG"; then
3934 AC_MSG_WARN([The default GNU linker is slow, consider using the LLD or the GNU gold linker.])
3935 add_warning "The default GNU linker is slow, consider using the LLD or the GNU gold linker."
3937 AC_MSG_WARN([The default GNU linker is slow, consider using the GNU gold linker.])
3938 add_warning "The default GNU linker is slow, consider using the GNU gold linker."
3943 if test "$enable_ld" = "yes"; then
3944 AC_MSG_ERROR([--enable-ld not supported])
3950 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3951 if test "$GCC" = "yes"; then
3952 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
3953 bsymbolic_functions_ldflags_save=$LDFLAGS
3954 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
3955 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3958 printf ("hello world\n");
3959 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3960 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3961 AC_MSG_RESULT( found )
3963 AC_MSG_RESULT( not found )
3965 LDFLAGS=$bsymbolic_functions_ldflags_save
3967 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3971 if test "$enable_split_debug" != no; then
3972 dnl Currently by default enabled only on Linux, feel free to set test_split_debug above also for other platforms.
3973 if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
3974 AC_MSG_CHECKING([whether $CC supports -gsplit-dwarf])
3976 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
3977 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
3979 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
3980 AC_MSG_RESULT([yes])
3982 if test "$enable_split_debug" = yes; then
3989 if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3990 AC_MSG_WARN([Compiler is not capable of creating split debug info, linking will require more time and disk space.])
3991 add_warning "Compiler is not capable of creating split debug info, linking will require more time and disk space."
3994 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
3997 if test "$enable_gdb_index" != "no"; then
3998 dnl Currently by default enabled only on Linux, feel free to set test_gdb_index above also for other platforms.
3999 if test "$enable_gdb_index" = yes -o \( "$test_gdb_index" = "yes" -o -n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
4000 AC_MSG_CHECKING([whether $CC supports -ggnu-pubnames])
4002 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
4004 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[have_ggnu_pubnames=TRUE],[have_ggnu_pubnames=])
4005 if test "$have_ggnu_pubnames" != "TRUE"; then
4006 if test "$enable_gdb_index" = "yes"; then
4007 AC_MSG_ERROR( no, --enable-gdb-index not supported )
4012 AC_MSG_RESULT( yes )
4013 AC_MSG_CHECKING([whether $CC supports -Wl,--gdb-index])
4014 ldflags_save=$LDFLAGS
4015 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
4016 AC_LINK_IFELSE([AC_LANG_PROGRAM([
4019 printf ("hello world\n");
4020 ])], ENABLE_GDB_INDEX=TRUE, [])
4021 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
4022 AC_MSG_RESULT( yes )
4024 if test "$enable_gdb_index" = "yes"; then
4030 LDFLAGS=$ldflags_save
4034 if test -z "$ENABLE_GDB_INDEX" -a "$test_gdb_index" = "yes" -a -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4035 AC_MSG_WARN([Linker is not capable of creating gdb index, debugger startup will be slow.])
4036 add_warning "Linker is not capable of creating gdb index, debugger startup will be slow."
4039 AC_SUBST(ENABLE_GDB_INDEX)
4041 if test "$enable_sal_log" = yes; then
4044 AC_SUBST(ENABLE_SAL_LOG)
4046 dnl Selective debuginfo
4047 ENABLE_DEBUGINFO_FOR=
4048 if test -n "$ENABLE_DEBUG"; then
4049 AC_MSG_CHECKING([whether to use selective debuginfo])
4050 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
4051 if test "$enable_selective_debuginfo" = "yes"; then
4052 AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
4054 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
4055 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
4057 ENABLE_DEBUGINFO_FOR=all
4058 AC_MSG_RESULT([no, for all])
4061 if test -n "$enable_selective_debuginfo"; then
4062 AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
4065 AC_SUBST(ENABLE_DEBUGINFO_FOR)
4067 dnl Check for enable symbols option
4068 dnl ===================================================================
4069 AC_MSG_CHECKING([whether to generate debug information])
4070 if test -z "$enable_symbols"; then
4071 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4077 if test "$enable_symbols" != no; then
4079 AC_MSG_RESULT([yes])
4084 AC_SUBST(ENABLE_SYMBOLS)
4086 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
4087 # Building on Android with full symbols: without enough memory the linker never finishes currently.
4088 AC_MSG_CHECKING([whether enough memory is available for linking])
4089 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
4090 # Check for 15GB, as Linux reports a bit less than the physical memory size.
4091 if test -n "$mem_size" -a $mem_size -lt 15728640; then
4092 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
4094 AC_MSG_RESULT([yes])
4098 AC_MSG_CHECKING([whether to compile with optimization flags])
4099 if test -z "$enable_optimized"; then
4100 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
4103 enable_optimized=yes
4106 if test "$enable_optimized" != no; then
4107 ENABLE_OPTIMIZED=TRUE
4108 AC_MSG_RESULT([yes])
4113 AC_SUBST(ENABLE_OPTIMIZED)
4116 # determine CPUNAME, OS, ...
4117 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
4128 PLATFORMID=aix_powerpc
4137 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4144 if test "$BITNESS_OVERRIDE" = 64; then
4147 PLATFORMID=windows_x86_64
4149 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4153 PLATFORMID=windows_x86
4157 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4160 SCPDEFS="$SCPDEFS -D_MSC_VER"
4172 AC_MSG_ERROR([Can't build 32-bit code for iOS])
4176 if test "$enable_ios_simulator" = "yes"; then
4177 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
4181 PLATFORMID=ios_arm64
4185 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4188 if test "$enable_ios_simulator" = "yes"; then
4193 PLATFORMID=macosx_x86_64
4196 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4212 PLATFORMID=dragonfly_x86
4217 PLATFORMID=dragonfly_x86_64
4220 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4236 PLATFORMID=freebsd_x86
4241 PLATFORMID=freebsd_x86_64
4244 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4261 PLATFORMID=haiku_x86
4266 PLATFORMID=haiku_x86_64
4269 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4286 PLATFORMID=kfreebsd_x86
4291 PLATFORMID=kfreebsd_x86_64
4294 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4310 PLATFORMID=linux_aarch64
4316 PLATFORMID=linux_alpha
4322 PLATFORMID=linux_arm_eabi
4326 PLATFORMID=linux_arm_oabi
4334 PLATFORMID=linux_hppa
4339 PLATFORMID=linux_x86
4344 PLATFORMID=linux_ia64
4350 PLATFORMID=linux_mips_eb
4355 EPM_FLAGS="-a mips64"
4356 PLATFORMID=linux_mips64_eb
4361 EPM_FLAGS="-a mips64el"
4362 PLATFORMID=linux_mips64_el
4367 EPM_FLAGS="-a mipsel"
4368 PLATFORMID=linux_mips_el
4373 PLATFORMID=linux_m68k
4378 PLATFORMID=linux_powerpc
4383 PLATFORMID=linux_powerpc64
4387 RTL_ARCH=PowerPC_64_LE
4388 PLATFORMID=linux_powerpc64_le
4393 PLATFORMID=linux_sparc
4398 PLATFORMID=linux_sparc64
4403 PLATFORMID=linux_s390
4408 PLATFORMID=linux_s390x
4413 PLATFORMID=linux_x86_64
4416 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4433 PLATFORMID=android_arm_eabi
4438 PLATFORMID=android_aarch64
4441 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4443 PLATFORMID=android_mips_el
4448 PLATFORMID=android_x86
4451 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4467 PLATFORMID=netbsd_x86
4472 PLATFORMID=netbsd_powerpc
4477 PLATFORMID=netbsd_sparc
4482 PLATFORMID=netbsd_x86_64
4485 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4501 PLATFORMID=openbsd_x86
4506 PLATFORMID=openbsd_x86_64
4509 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4512 SOLARINC="$SOLARINC -I/usr/local/include"
4526 PLATFORMID=solaris_x86
4531 PLATFORMID=solaris_sparc
4536 PLATFORMID=solaris_sparc64
4539 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4542 SOLARINC="$SOLARINC -I/usr/local/include"
4546 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4550 if test "$with_x" = "no"; then
4551 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4555 if test "$enable_gui" = "no"; then
4556 if test "$USING_X11" != TRUE; then
4557 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4561 AC_DEFINE(HAVE_FEATURE_UI,0)
4564 AC_SUBST(DISABLE_GUI)
4566 WORKDIR="${BUILDDIR}/workdir"
4567 INSTDIR="${BUILDDIR}/instdir"
4568 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4569 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4570 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4578 AC_SUBST([INSTROOT])
4579 AC_SUBST([INSTROOTBASE])
4583 AC_SUBST(PLATFORMID)
4584 AC_SUBST(WINDOWS_X64)
4585 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4587 dnl ===================================================================
4588 dnl Test which package format to use
4589 dnl ===================================================================
4590 AC_MSG_CHECKING([which package format to use])
4591 if test -n "$with_package_format" -a "$with_package_format" != no; then
4592 for i in $with_package_format; do
4594 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4597 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4598 aix - AIX software distribution
4599 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4600 deb - Debian software distribution
4601 pkg - Solaris software distribution
4602 rpm - RedHat software distribution
4604 LibreOffice additionally supports:
4605 archive - .tar.gz or .zip
4607 installed - installation tree
4613 # fakeroot is needed to ensure correct file ownerships/permissions
4614 # inside deb packages and tar archives created on Linux and Solaris.
4615 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4616 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4617 if test "$FAKEROOT" = "no"; then
4619 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4622 PKGFORMAT="$with_package_format"
4623 AC_MSG_RESULT([$PKGFORMAT])
4626 AC_MSG_RESULT([none])
4630 dnl ===================================================================
4631 dnl Set up a different compiler to produce tools to run on the build
4632 dnl machine when doing cross-compilation
4633 dnl ===================================================================
4635 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4636 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4637 if test "$cross_compiling" = "yes"; then
4638 AC_MSG_CHECKING([for BUILD platform configuration])
4640 rm -rf CONF-FOR-BUILD config_build.mk
4641 mkdir CONF-FOR-BUILD
4642 # Here must be listed all files needed when running the configure script. In particular, also
4643 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4644 # keep them in the same order as there.
4645 (cd $SRC_ROOT && tar cf - \
4647 bin/get_config_variables \
4648 solenv/bin/getcompver.awk \
4649 solenv/inc/langlist.mk \
4652 config_host_lang.mk.in \
4654 bin/bffvalidator.sh.in \
4655 bin/odfvalidator.sh.in \
4656 bin/officeotron.sh.in \
4657 instsetoo_native/util/openoffice.lst.in \
4659 sysui/desktop/macosx/Info.plist.in) \
4660 | (cd CONF-FOR-BUILD && tar xf -)
4661 cp configure CONF-FOR-BUILD
4662 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4664 unset COM USING_X11 OS CPUNAME
4665 unset CC CXX SYSBASE CFLAGS
4666 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4667 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4668 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4669 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4670 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4671 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4674 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4675 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4676 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4677 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4678 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4679 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4680 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4681 # Don't bother having configure look for stuff not needed for the build platform anyway
4684 --disable-gstreamer-1-0 \
4685 --disable-gstreamer-0-10 \
4688 --disable-pdfimport \
4689 --disable-postgresql-sdbc \
4690 --with-parallelism="$with_parallelism" \
4695 2>&1 | sed -e 's/^/ /'
4696 test -f ./config_host.mk 2>/dev/null || exit
4697 cp config_host.mk ../config_build.mk
4698 cp config_host_lang.mk ../config_build_lang.mk
4699 mv config.log ../config.Build.log
4700 mkdir -p ../config_build
4701 mv config_host/*.h ../config_build
4702 . ./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
4704 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
4706 VV=`eval "echo $VV"`
4707 if test -n "$VV"; then
4708 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4709 echo "$line" >>build-config
4713 for V in INSTDIR INSTROOT WORKDIR; do
4715 VV=`eval "echo $VV"`
4716 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4717 if test -n "$VV"; then
4718 line="${V}_FOR_BUILD='$VV'"
4719 echo "$line" >>build-config
4723 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4724 echo "$line" >>build-config
4727 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4728 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])
4729 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4730 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4732 eval `cat CONF-FOR-BUILD/build-config`
4734 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4736 rm -rf CONF-FOR-BUILD
4740 CXX_FOR_BUILD="$CXX"
4741 INSTDIR_FOR_BUILD="$INSTDIR"
4742 INSTROOT_FOR_BUILD="$INSTROOT"
4743 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4744 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4745 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4746 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4747 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4748 WORKDIR_FOR_BUILD="$WORKDIR"
4750 AC_SUBST(OS_FOR_BUILD)
4751 AC_SUBST(INSTDIR_FOR_BUILD)
4752 AC_SUBST(INSTROOT_FOR_BUILD)
4753 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4754 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4755 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4756 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4757 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4758 AC_SUBST(WORKDIR_FOR_BUILD)
4760 dnl ===================================================================
4761 dnl Check for syslog header
4762 dnl ===================================================================
4763 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4765 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4766 dnl ===================================================================
4767 AC_MSG_CHECKING([whether to turn warnings to errors])
4768 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4769 ENABLE_WERROR="TRUE"
4770 AC_MSG_RESULT([yes])
4772 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4773 ENABLE_WERROR="TRUE"
4774 AC_MSG_RESULT([yes])
4779 AC_SUBST(ENABLE_WERROR)
4781 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4782 dnl ===================================================================
4783 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4784 if test -z "$enable_assert_always_abort"; then
4785 if test "$ENABLE_DEBUG" = TRUE; then
4786 enable_assert_always_abort=yes
4788 enable_assert_always_abort=no
4791 if test "$enable_assert_always_abort" = "yes"; then
4792 ASSERT_ALWAYS_ABORT="TRUE"
4793 AC_MSG_RESULT([yes])
4795 ASSERT_ALWAYS_ABORT="FALSE"
4798 AC_SUBST(ASSERT_ALWAYS_ABORT)
4800 # Determine whether to use ooenv for the instdir installation
4801 # ===================================================================
4802 if test $_os != "WINNT" -a $_os != "Darwin"; then
4803 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4804 if test "$enable_ooenv" = "no"; then
4808 AC_MSG_RESULT([yes])
4811 AC_SUBST(ENABLE_OOENV)
4813 if test "$USING_X11" != TRUE; then
4814 # be sure to do not mess with unneeded stuff
4820 build_gstreamer_1_0=no
4821 build_gstreamer_0_10=no
4825 enable_cairo_canvas=no
4828 if test "$OS" = "HAIKU"; then
4829 enable_cairo_canvas=yes
4833 if test "$test_kde5" = "yes"; then
4837 if test "$test_kde5" = "yes" -a "$enable_kde5" = "yes"; then
4838 if test "$enable_qt5" = "no"; then
4839 AC_MSG_ERROR([KDE5 support depends on QT5, so it conflicts with --disable-qt5])
4845 dnl ===================================================================
4846 dnl check for cups support
4847 dnl ===================================================================
4850 if test "$enable_cups" = "no"; then
4854 AC_MSG_CHECKING([whether to enable CUPS support])
4855 if test "$test_cups" = "yes"; then
4857 AC_MSG_RESULT([yes])
4859 AC_MSG_CHECKING([whether cups support is present])
4860 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4861 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4862 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4863 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4870 AC_SUBST(ENABLE_CUPS)
4873 if test "$test_fontconfig" = "yes"; then
4874 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4875 SYSTEM_FONTCONFIG=TRUE
4876 FilterLibs "${FONTCONFIG_LIBS}"
4877 FONTCONFIG_LIBS="${filteredlibs}"
4879 AC_SUBST(FONTCONFIG_CFLAGS)
4880 AC_SUBST(FONTCONFIG_LIBS)
4881 AC_SUBST([SYSTEM_FONTCONFIG])
4883 dnl whether to find & fetch external tarballs?
4884 dnl ===================================================================
4885 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4886 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4887 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4889 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4892 if test -z "$TARFILE_LOCATION"; then
4893 if test -d "$SRC_ROOT/src" ; then
4894 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4895 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4897 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4899 AbsolutePath "$TARFILE_LOCATION"
4900 PathFormat "${absolute_path}"
4901 TARFILE_LOCATION="${formatted_path}"
4903 AC_SUBST(TARFILE_LOCATION)
4905 AC_MSG_CHECKING([whether we want to fetch tarballs])
4906 if test "$enable_fetch_external" != "no"; then
4907 if test "$with_all_tarballs" = "yes"; then
4908 AC_MSG_RESULT([yes, all of them])
4909 DO_FETCH_TARBALLS="ALL"
4911 AC_MSG_RESULT([yes, if we use them])
4912 DO_FETCH_TARBALLS="TRUE"
4918 AC_SUBST(DO_FETCH_TARBALLS)
4920 AC_MSG_CHECKING([whether to build help])
4921 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4922 BUILD_TYPE="$BUILD_TYPE HELP"
4923 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4924 case "$with_help" in
4926 ENABLE_HTMLHELP=TRUE
4927 SCPDEFS="$SCPDEFS -DWITH_HELP"
4928 AC_MSG_RESULT([HTML])
4931 ENABLE_HTMLHELP=TRUE
4933 AC_MSG_RESULT([HTML])
4936 SCPDEFS="$SCPDEFS -DWITH_HELP"
4937 AC_MSG_RESULT([yes])
4940 AC_MSG_ERROR([Unknown --with-help=$with_help])
4946 AC_SUBST([ENABLE_HTMLHELP])
4947 AC_SUBST([HELP_ONLINE])
4949 dnl Test whether to include MySpell dictionaries
4950 dnl ===================================================================
4951 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4952 if test "$with_myspell_dicts" = "yes"; then
4953 AC_MSG_RESULT([yes])
4954 WITH_MYSPELL_DICTS=TRUE
4955 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4956 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4961 AC_SUBST(WITH_MYSPELL_DICTS)
4963 # There are no "system" myspell, hyphen or mythes dictionaries on macOS, Windows, Android or iOS.
4964 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4965 if test "$with_system_dicts" = yes; then
4966 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4968 with_system_dicts=no
4971 AC_MSG_CHECKING([whether to use dicts from external paths])
4972 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4973 AC_MSG_RESULT([yes])
4975 AC_MSG_CHECKING([for spelling dictionary directory])
4976 if test -n "$with_external_dict_dir"; then
4977 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4979 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4980 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4981 DICT_SYSTEM_DIR=file:///usr/share/myspell
4984 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4985 AC_MSG_CHECKING([for hyphenation patterns directory])
4986 if test -n "$with_external_hyph_dir"; then
4987 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4989 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4991 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4992 AC_MSG_CHECKING([for thesaurus directory])
4993 if test -n "$with_external_thes_dir"; then
4994 THES_SYSTEM_DIR=file://$with_external_thes_dir
4996 THES_SYSTEM_DIR=file:///usr/share/mythes
4998 AC_MSG_RESULT([$THES_SYSTEM_DIR])
5003 AC_SUBST(SYSTEM_DICTS)
5004 AC_SUBST(DICT_SYSTEM_DIR)
5005 AC_SUBST(HYPH_SYSTEM_DIR)
5006 AC_SUBST(THES_SYSTEM_DIR)
5008 dnl ===================================================================
5009 dnl enable pch by default on windows
5010 dnl enable it explicitly otherwise
5012 if test "$enable_pch" = yes -a "$enable_compiler_plugins" = yes; then
5013 if test -z "$libo_fuzzed_enable_pch"; then
5014 AC_MSG_ERROR([--enable-pch cannot be used with --enable-compiler-plugins])
5016 AC_MSG_NOTICE([Resetting --enable-pch=no])
5021 AC_MSG_CHECKING([whether to enable pch feature])
5022 if test "$enable_pch" != "no"; then
5023 if test "$_os" = "WINNT"; then
5025 AC_MSG_RESULT([yes])
5026 elif test -n "$enable_pch" && test "$GCC" = "yes"; then
5028 AC_MSG_RESULT([yes])
5029 elif test -n "$enable_pch"; then
5030 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
5037 AC_SUBST(ENABLE_PCH)
5041 AC_MSG_CHECKING([the GNU Make version])
5042 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5043 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5044 if test "$_make_longver" -ge "038200"; then
5045 AC_MSG_RESULT([$GNUMAKE $_make_version])
5047 elif test "$_make_longver" -ge "038100"; then
5048 if test "$build_os" = "cygwin"; then
5049 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
5051 AC_MSG_RESULT([$GNUMAKE $_make_version])
5053 dnl ===================================================================
5054 dnl Search all the common names for sha1sum
5055 dnl ===================================================================
5056 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
5057 if test -z "$SHA1SUM"; then
5058 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
5059 elif test "$SHA1SUM" = "openssl"; then
5060 SHA1SUM="openssl sha1"
5062 AC_MSG_CHECKING([for GNU Make bug 20033])
5063 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
5064 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
5065 A := \$(wildcard *.a)
5069 <TAB>@echo survived bug20033.
5073 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5086 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5087 <TAB>\$(call d1,\$(CHECKSUM)),\
5088 <TAB>\$(call d2,\$(CHECKSUM)))
5090 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5091 no_parallelism_make="YES"
5092 AC_MSG_RESULT([yes, disable parallelism])
5094 AC_MSG_RESULT([no, keep parallelism enabled])
5096 rm -rf $TESTGMAKEBUG20033
5098 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5101 # find if gnumake support file function
5102 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5103 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5104 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5105 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5107 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5108 \$(file >test.txt,Success )
5115 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5116 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5117 HAVE_GNUMAKE_FILE_FUNC=TRUE
5118 AC_MSG_RESULT([yes])
5122 rm -rf $TESTGMAKEFILEFUNC
5123 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5124 AC_SUBST(GNUMAKE_WIN_NATIVE)
5126 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5128 if test "$_make_ver_check" = ""; then
5132 HAVE_LD_HASH_STYLE=FALSE
5133 WITH_LINKER_HASH_STYLE=
5134 AC_MSG_CHECKING([for --hash-style gcc linker support])
5135 if test "$GCC" = "yes"; then
5136 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5137 hash_styles="gnu sysv"
5138 elif test "$with_linker_hash_style" = "no"; then
5141 hash_styles="$with_linker_hash_style"
5144 for hash_style in $hash_styles; do
5145 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5146 hash_style_ldflags_save=$LDFLAGS
5147 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5149 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5156 HAVE_LD_HASH_STYLE=TRUE
5157 WITH_LINKER_HASH_STYLE=$hash_style
5159 [HAVE_LD_HASH_STYLE=FALSE],
5160 [HAVE_LD_HASH_STYLE=FALSE])
5161 LDFLAGS=$hash_style_ldflags_save
5164 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5165 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5169 LDFLAGS=$hash_style_ldflags_save
5173 AC_SUBST(HAVE_LD_HASH_STYLE)
5174 AC_SUBST(WITH_LINKER_HASH_STYLE)
5176 dnl ===================================================================
5177 dnl Check whether there's a Perl version available.
5178 dnl ===================================================================
5179 if test -z "$with_perl_home"; then
5180 AC_PATH_PROG(PERL, perl)
5182 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5183 _perl_path="$with_perl_home/bin/perl"
5184 if test -x "$_perl_path"; then
5187 AC_MSG_ERROR([$_perl_path not found])
5191 dnl ===================================================================
5192 dnl Testing for Perl version 5 or greater.
5193 dnl $] is the Perl version variable, it is returned as an integer
5194 dnl ===================================================================
5195 if test "$PERL"; then
5196 AC_MSG_CHECKING([the Perl version])
5197 ${PERL} -e "exit($]);"
5199 if test "$_perl_version" -lt 5; then
5200 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
5202 AC_MSG_RESULT([Perl $_perl_version])
5204 AC_MSG_ERROR([Perl not found, install Perl 5])
5207 dnl ===================================================================
5208 dnl Testing for required Perl modules
5209 dnl ===================================================================
5211 AC_MSG_CHECKING([for required Perl modules])
5212 perl_use_string="use Cwd ; use Digest::MD5"
5213 if test "$_os" = "WINNT"; then
5214 if test -n "$PKGFORMAT"; then
5215 for i in $PKGFORMAT; do
5218 # for getting fonts versions to use in MSI
5219 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5225 if test "$with_system_hsqldb" = "yes"; then
5226 perl_use_string="$perl_use_string ; use Archive::Zip"
5228 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
5229 AC_MSG_RESULT([all modules found])
5231 AC_MSG_RESULT([failed to find some modules])
5232 # Find out which modules are missing.
5233 for i in $perl_use_string; do
5234 if test "$i" != "use" -a "$i" != ";"; then
5235 if ! $PERL -e "use $i;">/dev/null 2>&1; then
5236 missing_perl_modules="$missing_perl_modules $i"
5241 The missing Perl modules are: $missing_perl_modules
5242 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5245 dnl ===================================================================
5246 dnl Check for pkg-config
5247 dnl ===================================================================
5248 if test "$_os" != "WINNT"; then
5252 if test "$_os" != "WINNT"; then
5254 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5255 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5256 # explicitly. Or put /path/to/compiler in PATH yourself.
5258 # Use wrappers for LTO
5259 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5260 AC_CHECK_TOOL(AR,gcc-ar)
5261 AC_CHECK_TOOL(NM,gcc-nm)
5262 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5264 AC_CHECK_TOOL(AR,ar)
5265 AC_CHECK_TOOL(NM,nm)
5266 AC_CHECK_TOOL(RANLIB,ranlib)
5268 AC_CHECK_TOOL(OBJDUMP,objdump)
5269 AC_CHECK_TOOL(READELF,readelf)
5270 AC_CHECK_TOOL(STRIP,strip)
5271 if test "$_os" = "WINNT"; then
5272 AC_CHECK_TOOL(DLLTOOL,dlltool)
5273 AC_CHECK_TOOL(WINDRES,windres)
5280 AC_SUBST(PKG_CONFIG)
5286 dnl ===================================================================
5287 dnl pkg-config checks on macOS
5288 dnl ===================================================================
5290 if test $_os = Darwin; then
5291 AC_MSG_CHECKING([for bogus pkg-config])
5292 if test -n "$PKG_CONFIG"; then
5293 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5294 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5296 if test "$enable_bogus_pkg_config" = "yes"; then
5297 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5299 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.])
5303 AC_MSG_RESULT([no, good])
5309 # Return value: $csctest
5313 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5314 if test -n "$regvalue"; then
5322 # Return value: $altest
5326 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5327 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5328 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5334 # We need this additional check to detect 4.6.1 or above.
5335 for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
5336 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5337 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5342 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools"
5343 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5354 for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
5355 reg_get_value_64 "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5356 if test -n "$regvalue"; then
5360 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5361 if test -n "$regvalue"; then
5368 find_winsdk_version()
5370 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5371 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5373 unset winsdktest winsdkbinsubdir winsdklibsubdir
5377 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5378 if test -n "$regvalue"; then
5379 winsdktest=$regvalue
5385 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5386 if test -n "$regvalue"; then
5387 winsdktest=$regvalue
5388 winsdklibsubdir=win8
5393 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5394 if test -n "$regvalue"; then
5395 winsdktest=$regvalue
5396 winsdklibsubdir=winv6.3
5401 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5402 if test -n "$regvalue"; then
5403 winsdktest=$regvalue
5404 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5405 if test -n "$regvalue"; then
5406 winsdkbinsubdir="$regvalue".0
5407 winsdklibsubdir=$winsdkbinsubdir
5408 tmppath="$winsdktest\\Include\\$winsdklibsubdir"
5409 # test exist the SDK path
5410 if test -d "$tmppath"; then
5411 # when path is convertible to a short path then path is okay
5412 if ! cygpath -d "$tmppath"; then
5413 AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
5416 AC_MSG_ERROR([The Windows SDK not found, check the installation])
5427 # Return value: From find_winsdk_version
5431 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5432 find_winsdk_version $ver
5433 if test -n "$winsdktest"; then
5441 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5442 if test $VCVER = 150; then
5443 my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
5445 AC_MSG_CHECKING([for ${my_msm_files}])
5447 for ver in 14.0 15.0; do
5448 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5449 if test -n "$regvalue"; then
5450 for f in ${my_msm_files}; do
5451 if test -e "$regvalue/${f}"; then
5458 dnl Is the following fallback really necessary, or was it added in response
5459 dnl to never having started Visual Studio on a given machine, so the
5460 dnl registry keys checked above had presumably not yet been created?
5461 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5462 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5463 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5464 dnl expanding to "C:\Program Files\Common Files"), which would need
5465 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5466 dnl obtain its value from cygwin:
5467 if test -z "$msmdir"; then
5468 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5469 for f in ${my_msm_files}; do
5470 if test -e "$my_msm_dir/${f}"; then
5476 dnl Starting from MSVC 15.0, merge modules are located in different directory
5477 if test $VCVER = 150; then
5478 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5479 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])
5480 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5481 for f in ${my_msm_files}; do
5482 if test -e "$my_msm_dir/${f}"; then
5490 if test -n "$msmdir"; then
5491 msmdir=`cygpath -m "$msmdir"`
5492 AC_MSG_RESULT([$msmdir])
5494 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5495 AC_MSG_ERROR([not found])
5497 AC_MSG_WARN([not found])
5498 add_warning "MSM none of ${my_msm_files} found"
5503 find_msvc_x64_dlls()
5505 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5506 if test "$VCVER" = 150; then
5507 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5508 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT])
5509 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5510 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5513 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
5514 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
5519 msvcdlls="msvcp140.dll vcruntime140.dll"
5520 for dll in $msvcdlls; do
5521 if ! test -f "$msvcdllpath/$dll"; then
5522 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5527 dnl =========================================
5528 dnl Check for the Windows SDK.
5529 dnl =========================================
5530 if test "$_os" = "WINNT"; then
5531 AC_MSG_CHECKING([for Windows SDK])
5532 if test "$build_os" = "cygwin"; then
5534 WINDOWS_SDK_HOME=$winsdktest
5536 # normalize if found
5537 if test -n "$WINDOWS_SDK_HOME"; then
5538 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5539 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5542 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5545 if test -n "$WINDOWS_SDK_HOME"; then
5546 # Remove a possible trailing backslash
5547 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5549 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5550 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5551 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5552 have_windows_sdk_headers=yes
5553 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5554 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5555 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5556 have_windows_sdk_headers=yes
5557 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5558 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5559 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5560 have_windows_sdk_headers=yes
5562 have_windows_sdk_headers=no
5565 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5566 have_windows_sdk_libs=yes
5567 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5568 have_windows_sdk_libs=yes
5570 have_windows_sdk_libs=no
5573 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5574 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5575 the Windows SDK are installed.])
5579 if test -z "$WINDOWS_SDK_HOME"; then
5580 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5581 elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
5582 WINDOWS_SDK_VERSION=70
5583 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
5584 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5585 WINDOWS_SDK_VERSION=80
5586 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5587 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5588 WINDOWS_SDK_VERSION=81
5589 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5590 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5591 WINDOWS_SDK_VERSION=10
5592 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5594 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5596 PathFormat "$WINDOWS_SDK_HOME"
5597 WINDOWS_SDK_HOME="$formatted_path"
5598 if test "$build_os" = "cygwin"; then
5599 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5600 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5601 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5602 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5603 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5607 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5608 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5609 dnl but not in v8.0), so allow this to be overridden with a
5610 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5611 dnl and configuration error if no WiLangId.vbs is found would arguably be
5612 dnl better, but I do not know under which conditions exactly it is needed by
5614 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5615 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5616 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5617 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5619 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5620 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5622 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5623 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5626 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5627 if test -n "$with_package_format" -a "$with_package_format" != no; then
5628 for i in "$with_package_format"; do
5629 if test "$i" = "msi"; then
5630 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5631 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5638 AC_SUBST(WINDOWS_SDK_HOME)
5639 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5640 AC_SUBST(WINDOWS_SDK_VERSION)
5641 AC_SUBST(WINDOWS_SDK_WILANGID)
5643 if test "$build_os" = "cygwin"; then
5644 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5645 dnl dir, it also determines that dir's path w/o an arch segment if any,
5646 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5647 AC_MSG_CHECKING([for midl.exe])
5650 if test -n "$winsdkbinsubdir" \
5651 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5653 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5654 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5655 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5656 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5657 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5658 elif test -f "$winsdktest/Bin/midl.exe"; then
5659 MIDL_PATH=$winsdktest/Bin
5660 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5662 if test ! -f "$MIDL_PATH/midl.exe"; then
5663 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5665 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5668 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5669 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5671 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5672 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5673 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5674 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5675 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5676 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5677 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5678 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5679 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5680 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5681 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5682 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5684 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5688 AC_MSG_CHECKING([for csc.exe])
5690 if test -f "$csctest/csc.exe"; then
5693 if test ! -f "$CSC_PATH/csc.exe"; then
5694 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5696 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5699 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5702 AC_MSG_CHECKING([for al.exe])
5704 if test -n "$winsdkbinsubdir" \
5705 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5707 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5708 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5709 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5710 elif test -f "$winsdktest/Bin/al.exe"; then
5711 AL_PATH="$winsdktest/Bin"
5714 if test -z "$AL_PATH"; then
5716 if test -f "$altest/bin/al.exe"; then
5717 AL_PATH="$altest/bin"
5718 elif test -f "$altest/al.exe"; then
5722 if test ! -f "$AL_PATH/al.exe"; then
5723 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5725 AC_MSG_RESULT([$AL_PATH/al.exe])
5728 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5730 dnl Check mscoree.lib / .NET Framework dir
5731 AC_MSG_CHECKING(.NET Framework)
5733 PathFormat "$frametest"
5734 frametest="$formatted_path"
5735 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5736 DOTNET_FRAMEWORK_HOME="$frametest"
5739 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5740 DOTNET_FRAMEWORK_HOME="$winsdktest"
5743 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
5744 AC_MSG_ERROR([mscoree.lib not found])
5746 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5748 PathFormat "$MIDL_PATH"
5749 MIDL_PATH="$formatted_path"
5751 PathFormat "$AL_PATH"
5752 AL_PATH="$formatted_path"
5754 PathFormat "$DOTNET_FRAMEWORK_HOME"
5755 DOTNET_FRAMEWORK_HOME="$formatted_path"
5757 PathFormat "$CSC_PATH"
5758 CSC_PATH="$formatted_path"
5761 dnl ===================================================================
5762 dnl Check if stdc headers are available excluding MSVC.
5763 dnl ===================================================================
5764 if test "$_os" != "WINNT"; then
5768 dnl ===================================================================
5769 dnl Testing for C++ compiler and version...
5770 dnl ===================================================================
5772 if test "$_os" != "WINNT"; then
5773 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5774 save_CXXFLAGS=$CXXFLAGS
5776 CXXFLAGS=$save_CXXFLAGS
5778 if test -n "$CC" -a -z "$CXX"; then
5783 dnl check for GNU C++ compiler version
5784 if test "$GXX" = "yes"; then
5785 AC_MSG_CHECKING([the GNU C++ compiler version])
5787 _gpp_version=`$CXX -dumpversion`
5788 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5790 if test "$_gpp_majmin" -lt "401"; then
5791 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
5793 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5796 dnl see https://code.google.com/p/android/issues/detail?id=41770
5797 if test "$_gpp_majmin" -ge "401"; then
5801 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5802 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5803 #include <bits/c++config.h>]],[[
5804 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5805 && !defined(_GLIBCXX__PTHREADS) \
5806 && !defined(_GLIBCXX_HAS_GTHREADS)
5809 ]])],[AC_MSG_RESULT([yes])
5810 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5812 if test $glibcxx_threads = yes; then
5813 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5817 AC_SUBST(BOOST_CXXFLAGS)
5820 # prefx CXX with ccache if needed
5822 if test "$CCACHE" != ""; then
5823 AC_MSG_CHECKING([whether $CXX is already ccached])
5825 save_CXXFLAGS=$CXXFLAGS
5826 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5827 dnl an empty program will do, we're checking the compiler flags
5828 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5829 [use_ccache=yes], [use_ccache=no])
5830 if test $use_ccache = yes; then
5831 AC_MSG_RESULT([yes])
5836 CXXFLAGS=$save_CXXFLAGS
5840 dnl ===================================================================
5841 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5842 dnl ===================================================================
5844 if test "$_os" != "WINNT"; then
5847 dnl Check whether there's a C pre-processor.
5852 dnl ===================================================================
5853 dnl Find integral type sizes and alignments
5854 dnl ===================================================================
5856 if test "$_os" != "WINNT"; then
5858 if test "$_os" == "iOS"; then
5859 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
5861 ac_cv_sizeof_short=2
5863 ac_cv_sizeof_long_long=8
5864 ac_cv_sizeof_double=8
5865 ac_cv_sizeof_voidp=8
5867 AC_CHECK_SIZEOF(long)
5868 AC_CHECK_SIZEOF(short)
5869 AC_CHECK_SIZEOF(int)
5870 AC_CHECK_SIZEOF(long long)
5871 AC_CHECK_SIZEOF(double)
5872 AC_CHECK_SIZEOF(void*)
5875 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5876 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5877 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5878 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5879 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5881 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5882 m4_pattern_allow([AC_CHECK_ALIGNOF])
5883 m4_ifdef([AC_CHECK_ALIGNOF],
5885 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5886 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5887 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5888 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5891 case "$_os-$host_cpu" in
5893 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5894 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5895 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5896 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5899 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5900 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5901 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5902 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5905 if test -z "$ac_cv_alignof_short" -o \
5906 -z "$ac_cv_alignof_int" -o \
5907 -z "$ac_cv_alignof_long" -o \
5908 -z "$ac_cv_alignof_double"; then
5909 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.])
5915 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5916 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5917 if test $ac_cv_sizeof_long -eq 8; then
5918 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5919 elif test $ac_cv_sizeof_double -eq 8; then
5920 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5922 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5925 dnl Check for large file support
5927 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5928 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5930 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5931 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5935 SAL_TYPES_SIZEOFSHORT=2
5936 SAL_TYPES_SIZEOFINT=4
5937 SAL_TYPES_SIZEOFLONG=4
5938 SAL_TYPES_SIZEOFLONGLONG=8
5939 if test "$BITNESS_OVERRIDE" = ""; then
5940 SAL_TYPES_SIZEOFPOINTER=4
5942 SAL_TYPES_SIZEOFPOINTER=8
5944 SAL_TYPES_ALIGNMENT2=2
5945 SAL_TYPES_ALIGNMENT4=4
5946 SAL_TYPES_ALIGNMENT8=8
5949 AC_SUBST(LFS_CFLAGS)
5951 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5952 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5953 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5954 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5955 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5956 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5957 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5958 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5960 dnl ===================================================================
5961 dnl Check whether to enable runtime optimizations
5962 dnl ===================================================================
5963 ENABLE_RUNTIME_OPTIMIZATIONS=
5964 AC_MSG_CHECKING([whether to enable runtime optimizations])
5965 if test -z "$enable_runtime_optimizations"; then
5969 enable_runtime_optimizations=no
5975 if test "$enable_runtime_optimizations" != no; then
5976 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
5977 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
5978 AC_MSG_RESULT([yes])
5982 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
5984 dnl ===================================================================
5985 dnl Check if valgrind headers are available
5986 dnl ===================================================================
5988 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
5989 prev_cppflags=$CPPFLAGS
5990 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5991 # or where does it come from?
5992 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5993 AC_CHECK_HEADER([valgrind/valgrind.h],
5994 [ENABLE_VALGRIND=TRUE])
5995 CPPFLAGS=$prev_cppflags
5997 AC_SUBST([ENABLE_VALGRIND])
5998 if test -z "$ENABLE_VALGRIND"; then
5999 if test "$with_valgrind" = yes; then
6000 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
6004 AC_SUBST([VALGRIND_CFLAGS])
6007 dnl ===================================================================
6008 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
6009 dnl ===================================================================
6011 # We need at least the sys/sdt.h include header.
6012 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
6013 if test "$SDT_H_FOUND" = "TRUE"; then
6014 # Found sys/sdt.h header, now make sure the c++ compiler works.
6015 # Old g++ versions had problems with probes in constructors/destructors.
6016 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
6018 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6019 #include <sys/sdt.h>
6027 ProbeClass(int& v, const char *n) : ref(v), name(n)
6029 DTRACE_PROBE2(_test_, cons, name, ref);
6032 void method(int min)
6034 DTRACE_PROBE3(_test_, meth, name, ref, min);
6040 DTRACE_PROBE2(_test_, dest, name, ref);
6045 DTRACE_PROBE1(_test_, call, i);
6046 ProbeClass inst = ProbeClass(i, "call");
6048 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
6049 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
6052 AC_CONFIG_HEADERS([config_host/config_probes.h])
6054 dnl ===================================================================
6056 dnl ===================================================================
6057 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6058 AC_MSG_CHECKING([whether $CC supports -mno-avx])
6060 CFLAGS="$CFLAGS -Werror -mno-avx"
6061 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
6063 if test "$HAVE_GCC_AVX" = "TRUE"; then
6064 AC_MSG_RESULT([yes])
6069 AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong])
6071 CFLAGS="$CFLAGS -O0 -Werror -fstack-protector-strong"
6072 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; a[7] = 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
6074 if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
6075 AC_MSG_RESULT([yes])
6080 AC_MSG_CHECKING([whether $CC supports atomic functions])
6081 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6083 if (__sync_add_and_fetch(&v, 1) != 1 ||
6084 __sync_sub_and_fetch(&v, 1) != 0)
6086 __sync_synchronize();
6087 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6091 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6092 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6093 AC_MSG_RESULT([yes])
6094 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6099 AC_MSG_CHECKING([whether $CC supports __builtin_ffs])
6100 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
6101 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
6102 AC_MSG_RESULT([yes])
6103 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
6108 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
6110 CFLAGS="$CFLAGS -Werror"
6111 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6112 __attribute__((deprecated("test"))) void f();
6114 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6115 AC_MSG_RESULT([yes])
6116 ], [AC_MSG_RESULT([no])])
6119 AC_MSG_CHECKING([whether $CXX defines __base_class_type_info in cxxabi.h])
6121 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6124 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
6126 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
6127 AC_MSG_RESULT([yes])
6128 ], [AC_MSG_RESULT([no])])
6131 AC_MSG_CHECKING([whether $CXX defines __class_type_info in cxxabi.h])
6133 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6136 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
6138 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
6139 AC_MSG_RESULT([yes])
6140 ], [AC_MSG_RESULT([no])])
6143 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
6145 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6147 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6149 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6150 AC_MSG_RESULT([yes])
6151 ], [AC_MSG_RESULT([no])])
6154 AC_MSG_CHECKING([whether $CXX defines __cxa_eh_globals in cxxabi.h])
6156 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6159 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6161 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6162 AC_MSG_RESULT([yes])
6163 ], [AC_MSG_RESULT([no])])
6166 AC_MSG_CHECKING([whether $CXX defines __cxa_exceptions in cxxabi.h])
6168 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6171 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6173 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6174 AC_MSG_RESULT([yes])
6175 ], [AC_MSG_RESULT([no])])
6178 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
6180 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6182 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6184 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6185 AC_MSG_RESULT([yes])
6186 ], [AC_MSG_RESULT([no])])
6189 AC_MSG_CHECKING([whether $CXX declares __cxa_current_exception_type in cxxabi.h])
6191 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6193 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6195 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6196 AC_MSG_RESULT([yes])
6197 ], [AC_MSG_RESULT([no])])
6200 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6202 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6204 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6206 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6207 AC_MSG_RESULT([yes])
6208 ], [AC_MSG_RESULT([no])])
6211 AC_MSG_CHECKING([whether $CXX defines __si_class_type_info in cxxabi.h])
6213 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6216 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6218 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6219 AC_MSG_RESULT([yes])
6220 ], [AC_MSG_RESULT([no])])
6223 AC_MSG_CHECKING([whether $CXX defines __vmi_class_type_info in cxxabi.h])
6225 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6228 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6230 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6231 AC_MSG_RESULT([yes])
6232 ], [AC_MSG_RESULT([no])])
6235 dnl Available in GCC 4.9 and at least since Clang 3.4:
6236 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6238 save_CXXFLAGS=$CXXFLAGS
6239 CXXFLAGS="$CXXFLAGS -Werror"
6240 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6241 struct __attribute__((warn_unused)) dummy {};
6243 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6244 AC_MSG_RESULT([yes])
6245 ], [AC_MSG_RESULT([no])])
6246 CXXFLAGS=$save_CXXFLAGS
6250 AC_SUBST(HAVE_GCC_AVX)
6251 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
6252 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6253 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6255 dnl ===================================================================
6256 dnl Identify the C++ library
6257 dnl ===================================================================
6259 AC_MSG_CHECKING([what the C++ library is])
6261 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6267 [CPP_LIBRARY=GLIBCXX
6268 cpp_library_name="GNU libstdc++"
6270 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6272 #ifndef _LIBCPP_VERSION
6277 cpp_library_name="LLVM libc++"
6278 AC_DEFINE([HAVE_LIBCXX])
6280 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6287 cpp_library_name="Microsoft"
6289 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6290 AC_MSG_RESULT([$cpp_library_name])
6293 dnl ===================================================================
6295 dnl ===================================================================
6296 AC_PATH_PROG(GPERF, gperf)
6297 if test -z "$GPERF"; then
6298 AC_MSG_ERROR([gperf not found but needed. Install it.])
6300 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6301 GPERF=`cygpath -m $GPERF`
6303 AC_MSG_CHECKING([whether gperf is new enough])
6304 my_gperf_ver1=$($GPERF --version | head -n 1)
6305 my_gperf_ver2=${my_gperf_ver1#GNU gperf }
6306 my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
6307 if test "$my_gperf_ver3" -ge 301; then
6308 AC_MSG_RESULT([yes ($my_gperf_ver2)])
6310 AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
6314 dnl ===================================================================
6315 dnl Check for system libcmis
6316 dnl ===================================================================
6317 # libcmis requires curl and we can't build curl for iOS
6318 if test $_os != iOS; then
6319 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.0])
6324 AC_SUBST(ENABLE_LIBCMIS)
6326 dnl ===================================================================
6328 dnl ===================================================================
6330 AC_MSG_CHECKING([whether $CXX supports C++17])
6332 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6333 CXXFLAGS_CXX11='-std:c++17 -Zc:__cplusplus'
6334 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6335 my_flags='-std=gnu++2a -std=c++2a -std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z'
6336 for flag in $my_flags; do
6337 if test "$COM" = MSC; then
6338 flag="-Xclang $flag"
6340 save_CXXFLAGS=$CXXFLAGS
6341 CXXFLAGS="$CXXFLAGS $flag -Werror"
6342 if test "$SYSTEM_LIBCMIS" = TRUE; then
6343 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6346 dnl Clang 3.9 supports __float128 since
6347 dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
6348 dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
6349 dnl hacky workaround to be able to include <vector> (as is done in the main check whether
6350 dnl $flag is supported below, so check this first):
6352 my_float128hack_impl=-D__float128=void
6353 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6355 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6359 dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
6360 dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
6361 dnl is available during its build, but it's usually built using GCC, and so c++config.h
6362 dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
6363 dnl place where __float128 is used is in a template specialization, -D__float128=void
6364 dnl will avoid the problem there while still causing a problem if somebody actually uses
6365 dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
6366 dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
6367 dnl "fixed" with this hack):
6368 CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
6369 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6371 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6374 ],[my_float128hack=$my_float128hack_impl])
6376 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6377 #include <algorithm>
6379 #include <functional>
6382 #if defined SYSTEM_LIBCMIS
6383 // See ucb/source/ucp/cmis/auth_provider.hxx:
6384 #if !defined __clang__
6385 #pragma GCC diagnostic push
6386 #pragma GCC diagnostic ignored "-Wdeprecated"
6387 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6389 #include <libcmis/libcmis.hxx>
6390 #if !defined __clang__
6391 #pragma GCC diagnostic pop
6395 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6396 std::sort(v.begin(), v.end(), fn);
6399 // At least with glibc-headers-2.28-26.fc29.x86_64, when building for Linux x86 32-bit
6400 // (via -m32) and passed-in CXXFLAGS setting -O1 (or higher; overriding -Os as set in
6401 // solenv/gbuild/platform/LINUX_INTEL_GCC.mk), std=gnu* would cause math_errhandling to
6402 // get undef'ed in /usr/include/bits/mathinline.h, while std=c* keeps it defined (as
6403 // needed by sc/source/core/tool/math.cxx):
6404 int g() { return math_errhandling; }
6405 ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
6407 CXXFLAGS=$save_CXXFLAGS
6408 if test -n "$CXXFLAGS_CXX11"; then
6413 if test -n "$CXXFLAGS_CXX11"; then
6414 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6418 AC_SUBST(CXXFLAGS_CXX11)
6420 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6421 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6422 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6423 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6424 dnl again towards 4.7.2:
6425 if test $CPP_LIBRARY = GLIBCXX; then
6426 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6428 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6430 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6431 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6432 // GCC 4.7.0: 20120322
6433 // GCC 4.7.1: 20120614
6434 // and using a range check is not possible as the mapping between
6435 // __GLIBCXX__ values and GCC versions is not monotonic
6440 ]])], [AC_MSG_RESULT(no, ok)],
6441 [AC_MSG_ERROR(yes)])
6445 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6446 save_CXXFLAGS=$CXXFLAGS
6447 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6450 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6453 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6469 a thinga[]={{0,0}, {1,1}};
6470 b thingb[]={{0,0}, {1,1}};
6471 size_t i = sizeof(sal_n_array_size(thinga));
6472 size_t j = sizeof(sal_n_array_size(thingb));
6473 return !(i != 0 && j != 0);
6475 ], [ AC_MSG_RESULT(yes) ],
6476 [ AC_MSG_ERROR(no)])
6478 CXXFLAGS=$save_CXXFLAGS
6480 dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
6481 AC_MSG_CHECKING([that $CXX supports C++14 constexpr])
6482 save_CXXFLAGS=$CXXFLAGS
6483 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6485 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6486 // A somewhat over-complicated way of checking for
6487 // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "ICE using __func__
6488 // in constexpr function":
6490 template<typename T> inline constexpr T f(T x) { return x; }
6491 template<typename T> inline constexpr T g(T x) {
6492 assert(f(static_cast<int>(x)));
6500 constexpr bool f() {
6503 while (n > 0) { --n; ++i; }
6508 constexpr auto v2 = S{10}.f();
6509 ]])], AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks required C++14 constexpr support]))
6511 CXXFLAGS=$save_CXXFLAGS
6513 dnl _Pragma support (may require C++11)
6514 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6515 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6517 save_CXXFLAGS=$CXXFLAGS
6518 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6519 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6520 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6522 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6523 AC_MSG_RESULT([yes])
6524 ], [AC_MSG_RESULT([no])])
6526 CXXFLAGS=$save_CXXFLAGS
6529 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6530 if test "$GCC" = yes; then
6531 AC_MSG_CHECKING([whether $CXX supports -fno-sized-deallocation])
6533 save_CXXFLAGS=$CXXFLAGS
6534 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6535 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6536 CXXFLAGS=$save_CXXFLAGS
6538 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6539 AC_MSG_RESULT([yes])
6544 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6546 dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
6547 AC_MSG_CHECKING([[that $CXX supports [[fallthrough]]]])
6549 save_CXXFLAGS=$CXXFLAGS
6550 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6551 dnl Unknown attributes must be ignored by compilers, but they do emit warnings about them:
6552 if test "$COM" = MSC; then
6553 CXXFLAGS="$CXXFLAGS /we5030"
6555 CXXFLAGS="$CXXFLAGS -Werror"
6557 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6558 // There appears to be no feature-test macro for __has_cpp_attribute in C++2a, approximate
6559 // by checking for __cplusplus:
6560 #if __cplusplus > 201703L
6561 #if !__has_cpp_attribute(fallthrough)
6576 AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks required [[fallthrough]] support]))
6577 CXXFLAGS=$save_CXXFLAGS
6580 dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
6581 AC_MSG_CHECKING([[that $CXX supports [[nodiscard]]]])
6583 save_CXXFLAGS=$CXXFLAGS
6584 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6585 dnl Unknown attributes must be ignored by compilers, but they do emit warnings about them:
6586 if test "$COM" = MSC; then
6587 CXXFLAGS="$CXXFLAGS /we5030"
6589 CXXFLAGS="$CXXFLAGS -Werror"
6591 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6592 // There appears to be no feature-test macro for __has_cpp_attribute in C++2a, approximate
6593 // by checking for __cplusplus:
6594 #if __cplusplus > 201703L
6595 #if !__has_cpp_attribute(nodiscard)
6599 [[nodiscard]] int f();
6602 AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks required [[nodiscard]] support]))
6603 CXXFLAGS=$save_CXXFLAGS
6606 AC_MSG_CHECKING([whether $CXX supports guaranteed copy elision])
6608 save_CXXFLAGS=$CXXFLAGS
6609 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6610 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6611 // At least VS 2017 15.8.1 defines __cpp_guaranteed_copy_elision as 201606L without actually
6613 #if !defined __cpp_guaranteed_copy_elision || (defined _MSC_VER && !defined __clang__)
6622 void f() { S c(copy()); }
6625 AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
6626 AC_MSG_RESULT([yes])
6627 ], [AC_MSG_RESULT([no])])
6628 CXXFLAGS=$save_CXXFLAGS
6631 dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
6632 AC_MSG_CHECKING([that $CXX has a fix for CWG1579])
6634 save_CXXFLAGS=$CXXFLAGS
6635 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6636 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6640 std::unique_ptr<S1> f() {
6641 std::unique_ptr<S2> s2(new S2);
6645 AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks a required fix for CWG1579]))
6646 CXXFLAGS=$save_CXXFLAGS
6649 AC_MSG_CHECKING([whether $CXX has GCC bug 87150])
6651 save_CXXFLAGS=$CXXFLAGS
6652 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6653 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6654 struct S1 { S1(S1 &&); };
6656 S1 f(S2 s) { return s; }
6658 AC_DEFINE([HAVE_GCC_BUG_87150],[1])
6659 AC_MSG_RESULT([yes])
6660 ], [AC_MSG_RESULT([no])])
6661 CXXFLAGS=$save_CXXFLAGS
6664 dnl At least GCC 8.2 with -O2 (i.e., --enable-optimized) causes a false-positive -Wmaybe-
6665 dnl uninitialized warning for code like
6668 dnl boost::optional<OString> * g(bool b) {
6669 dnl boost::optional<OString> o;
6671 dnl return new boost::optional<OString>(o);
6674 dnl (as is e.g. present, in a slightly more elaborate form, in
6675 dnl librdf_TypeConverter::extractNode_NoLock in unoxml/source/rdf/librdf_repository.cxx); the below
6676 dnl code is meant to be a faithfully stripped-down and self-contained version of the above code:
6677 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=
6678 if test "$GCC" = yes && test "$COM_IS_CLANG" != TRUE; then
6679 AC_MSG_CHECKING([whether $CXX might report false -Werror=maybe-uninitialized])
6681 save_CXXFLAGS=$CXXFLAGS
6682 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror -Wmaybe-uninitialized"
6683 if test "$ENABLE_OPTIMIZED" = TRUE; then
6684 CXXFLAGS="$CXXFLAGS -O2"
6686 CXXFLAGS="$CXXFLAGS -O0"
6688 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6697 S2(S2 const & s) { if (s.init) set(*reinterpret_cast<S1 const *>(s.stg)); }
6698 ~S2() { if (init) reinterpret_cast<S1 *>(stg)->S1::~S1(); }
6704 char stg[sizeof (S1)];
6712 ]])], [AC_MSG_RESULT([no])], [
6713 HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=TRUE
6714 AC_MSG_RESULT([yes])
6716 CXXFLAGS=$save_CXXFLAGS
6719 AC_SUBST([HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED])
6721 dnl ===================================================================
6722 dnl system stl sanity tests
6723 dnl ===================================================================
6724 if test "$_os" != "WINNT"; then
6728 save_CPPFLAGS="$CPPFLAGS"
6729 if test -n "$MACOSX_SDK_PATH"; then
6730 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6733 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6735 if test "$CPP_LIBRARY" = GLIBCXX; then
6736 dnl gcc#19664, gcc#22482, rhbz#162935
6737 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6738 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6739 AC_MSG_RESULT([$stlvisok])
6740 if test "$stlvisok" = "no"; then
6741 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
6745 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6746 # when we don't make any dynamic libraries?
6747 if test "$DISABLE_DYNLOADING" = ""; then
6748 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6749 cat > conftestlib1.cc <<_ACEOF
6750 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6751 struct S2: S1<int> { virtual ~S2(); };
6754 cat > conftestlib2.cc <<_ACEOF
6755 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6756 struct S2: S1<int> { virtual ~S2(); };
6757 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6759 gccvisinlineshiddenok=yes
6760 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6761 gccvisinlineshiddenok=no
6763 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6764 dnl known to not work with -z defs (unsetting which makes the test
6766 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6767 if test "$COM_IS_CLANG" = TRUE; then
6768 for i in $CXX $CXXFLAGS; do
6771 my_linkflagsnoundefs=
6777 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6778 gccvisinlineshiddenok=no
6783 AC_MSG_RESULT([$gccvisinlineshiddenok])
6784 if test "$gccvisinlineshiddenok" = "no"; then
6785 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6789 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6790 cat >visibility.cxx <<_ACEOF
6791 #pragma GCC visibility push(hidden)
6792 struct __attribute__ ((visibility ("default"))) TestStruct {
6795 __attribute__ ((visibility ("default"))) void TestFunc() {
6799 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
6804 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
6807 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
6819 rm -f visibility.s visibility.cxx
6821 AC_MSG_RESULT([$gccvisbroken])
6822 if test "$gccvisbroken" = "yes"; then
6823 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
6826 CPPFLAGS="$save_CPPFLAGS"
6831 dnl ===================================================================
6833 dnl ===================================================================
6835 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6836 if test "$GCC" = "yes"; then
6837 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6839 save_CXXFLAGS=$CXXFLAGS
6840 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6841 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6842 CXXFLAGS=$save_CXXFLAGS
6844 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6845 AC_MSG_RESULT([yes])
6850 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6852 dnl ===================================================================
6853 dnl Compiler plugins
6854 dnl ===================================================================
6857 # currently only Clang
6859 if test "$COM_IS_CLANG" != "TRUE"; then
6860 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
6861 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
6862 enable_compiler_plugins=no
6866 if test "$COM_IS_CLANG" = "TRUE"; then
6867 if test -n "$enable_compiler_plugins"; then
6868 compiler_plugins="$enable_compiler_plugins"
6869 elif test -n "$ENABLE_DBGUTIL"; then
6870 compiler_plugins=test
6874 if test "$compiler_plugins" != no -a "$CLANGVER" -lt 50002; then
6875 if test "$compiler_plugins" = yes; then
6876 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 5.0.2.])
6881 if test "$compiler_plugins" != "no"; then
6882 dnl The prefix where Clang resides, override to where Clang resides if
6883 dnl using a source build:
6884 if test -z "$CLANGDIR"; then
6888 save_CPPFLAGS=$CPPFLAGS
6891 # compiler plugins must be built with "native" compiler that was used to build Clang itself:
6892 : "${COMPILER_PLUGINS_CXX=g++ -std=c++11}"
6893 CXX=$COMPILER_PLUGINS_CXX
6894 CXXCPP="$COMPILER_PLUGINS_CXX -E"
6895 CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
6896 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
6897 [COMPILER_PLUGINS=TRUE],
6899 if test "$compiler_plugins" = "yes"; then
6900 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
6902 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
6903 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
6908 CPPFLAGS=$save_CPPFLAGS
6912 if test "$enable_compiler_plugins" = "yes"; then
6913 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
6916 AC_SUBST(COMPILER_PLUGINS)
6917 AC_SUBST(COMPILER_PLUGINS_CXX)
6918 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
6919 AC_SUBST(COMPILER_PLUGINS_DEBUG)
6920 AC_SUBST(COMPILER_PLUGINS_TOOLING_ARGS)
6922 AC_SUBST(CLANGLIBDIR)
6924 # Plugin to help linker.
6925 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
6926 # This makes --enable-lto build with clang work.
6929 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6930 AC_SUBST(HAVE_POSIX_FALLOCATE)
6932 dnl ===================================================================
6933 dnl Custom build version
6934 dnl ===================================================================
6936 AC_MSG_CHECKING([whether to add custom build version])
6937 if test "$with_build_version" != ""; then
6938 BUILD_VER_STRING=$with_build_version
6939 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6944 AC_SUBST(BUILD_VER_STRING)
6946 JITC_PROCESSOR_TYPE=""
6947 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6948 # IBMs JDK needs this...
6949 JITC_PROCESSOR_TYPE=6
6950 export JITC_PROCESSOR_TYPE
6952 AC_SUBST([JITC_PROCESSOR_TYPE])
6954 # Misc Windows Stuff
6955 AC_ARG_WITH(ucrt-dir,
6956 AS_HELP_STRING([--with-ucrt-dir],
6957 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
6958 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
6959 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
6960 Windows6.1-KB2999226-x64.msu
6961 Windows6.1-KB2999226-x86.msu
6962 Windows8.1-KB2999226-x64.msu
6963 Windows8.1-KB2999226-x86.msu
6964 Windows8-RT-KB2999226-x64.msu
6965 Windows8-RT-KB2999226-x86.msu
6966 A zip archive including those files is available from Microsoft site:
6967 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
6969 UCRT_REDISTDIR="$with_ucrt_dir"
6970 if test $_os = "WINNT"; then
6973 MSVC_DLL_PATH="$msvcdllpath"
6974 MSVC_DLLS="$msvcdlls"
6976 # MSVC 15.3 changed it to VC141
6977 if echo "$MSVC_DLL_PATH" | grep -q "VC141.CRT$"; then
6978 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
6980 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6982 if test "$UCRT_REDISTDIR" = "no"; then
6983 dnl explicitly disabled
6986 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
6987 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
6988 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
6989 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
6990 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
6991 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
6993 if test -n "$PKGFORMAT"; then
6994 for i in $PKGFORMAT; do
6997 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
6998 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
7007 AC_SUBST(UCRT_REDISTDIR)
7008 AC_SUBST(MSVC_DLL_PATH)
7012 dnl ===================================================================
7014 dnl ===================================================================
7015 if test "$ENABLE_JAVA" != ""; then
7017 # Windows-specific tests
7018 if test "$build_os" = "cygwin"; then
7019 if test "$BITNESS_OVERRIDE" = 64; then
7025 if test -z "$with_jdk_home"; then
7026 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
7027 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
7028 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
7029 if test -n "$regvalue"; then
7031 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
7034 if test -z "$with_jdk_home"; then
7035 for ver in 1.8 1.7 1.6; do
7036 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
7037 if test -n "$regvalue"; then
7043 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
7044 with_jdk_home="$_jdk_home"
7045 howfound="found automatically"
7047 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
7050 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
7051 howfound="you passed"
7055 # 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.
7056 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
7057 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
7058 with_jdk_home=`/usr/libexec/java_home`
7061 JAVA_HOME=; export JAVA_HOME
7062 if test -z "$with_jdk_home"; then
7063 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
7065 _java_path="$with_jdk_home/bin/$with_java"
7066 dnl Check if there is a Java interpreter at all.
7067 if test -x "$_java_path"; then
7068 JAVAINTERPRETER=$_java_path
7070 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
7074 dnl Check that the JDK found is correct architecture (at least 2 reasons to
7075 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
7076 dnl loaded by java to run JunitTests:
7077 if test "$build_os" = "cygwin"; then
7078 shortjdkhome=`cygpath -d "$with_jdk_home"`
7079 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
7080 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
7081 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7082 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
7083 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7084 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7087 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
7088 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
7090 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
7091 elif test "$cross_compiling" != "yes"; then
7093 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
7094 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
7095 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
7096 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
7099 *) # assumption: everything else 32-bit
7100 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
7101 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
7102 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
7109 dnl ===================================================================
7111 dnl ===================================================================
7113 # Note that JAVA_HOME as for now always means the *build* platform's
7114 # JAVA_HOME. Whether all the complexity here actually is needed any
7115 # more or not, no idea.
7117 if test "$ENABLE_JAVA" != ""; then
7119 AC_MSG_CHECKING([the installed JDK])
7120 if test -n "$JAVAINTERPRETER"; then
7121 dnl java -version sends output to stderr!
7122 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
7123 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7124 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
7125 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7126 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
7127 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
7128 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
7131 dnl IBM JDK specific tests
7132 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
7133 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7135 if test "$_jdk_ver" -lt 10600; then
7136 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.6])
7139 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
7141 if test "$with_jdk_home" = ""; then
7142 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
7143 you must use the "--with-jdk-home" configure option explicitly])
7146 JAVA_HOME=$with_jdk_home
7150 dnl Sun JDK specific tests
7151 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
7152 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7154 if test "$_jdk_ver" -lt 10600; then
7155 AC_MSG_ERROR([JDK is too old, you need at least 1.6])
7157 if test "$_jdk_ver" -gt 10600; then
7158 JAVA_CLASSPATH_NOT_SET=TRUE
7161 AC_MSG_RESULT([checked (JDK $_jdk)])
7162 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
7163 if test "$_os" = "WINNT"; then
7164 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
7167 # set to limit VM usage for JunitTests
7169 # set to limit VM usage for javac
7170 JAVAFLAGS=-J-Xmx128M
7173 AC_MSG_ERROR([Java not found. You need at least jdk-1.6])
7181 dnl ===================================================================
7182 dnl Checks for javac
7183 dnl ===================================================================
7184 if test "$ENABLE_JAVA" != ""; then
7185 javacompiler="javac"
7186 JAVA_SOURCE_VER="1.6"
7187 JAVA_TARGET_VER="1.6"
7188 if test -z "$with_jdk_home"; then
7189 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
7191 _javac_path="$with_jdk_home/bin/$javacompiler"
7192 dnl Check if there is a Java compiler at all.
7193 if test -x "$_javac_path"; then
7194 JAVACOMPILER=$_javac_path
7197 if test -z "$JAVACOMPILER"; then
7198 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7200 if test "$build_os" = "cygwin"; then
7201 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7202 JAVACOMPILER="${JAVACOMPILER}.exe"
7204 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7208 dnl ===================================================================
7209 dnl Checks for javadoc
7210 dnl ===================================================================
7211 if test "$ENABLE_JAVA" != ""; then
7212 if test -z "$with_jdk_home"; then
7213 AC_PATH_PROG(JAVADOC, javadoc)
7215 _javadoc_path="$with_jdk_home/bin/javadoc"
7216 dnl Check if there is a javadoc at all.
7217 if test -x "$_javadoc_path"; then
7218 JAVADOC=$_javadoc_path
7220 AC_PATH_PROG(JAVADOC, javadoc)
7223 if test -z "$JAVADOC"; then
7224 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7226 if test "$build_os" = "cygwin"; then
7227 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7228 JAVADOC="${JAVADOC}.exe"
7230 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7233 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7234 JAVADOCISGJDOC="yes"
7237 AC_SUBST(JAVADOCISGJDOC)
7239 if test "$ENABLE_JAVA" != ""; then
7240 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7241 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7242 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7243 # try to recover first by looking whether we have a alternatives
7244 # system as in Debian or newer SuSEs where following /usr/bin/javac
7245 # over /etc/alternatives/javac leads to the right bindir where we
7246 # just need to strip a bit away to get a valid JAVA_HOME
7247 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7248 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7249 # maybe only one level of symlink (e.g. on Mac)
7250 JAVA_HOME=$(readlink $JAVACOMPILER)
7251 if test "$(dirname $JAVA_HOME)" = "."; then
7252 # we've got no path to trim back
7257 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7258 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7259 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7260 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7262 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
7263 if test "$JAVA_HOME" != "/usr"; then
7264 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7265 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7266 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7267 dnl Tiger already returns a JDK path..
7268 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7270 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7271 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7272 dnl that checks which version to run
7273 if test -f "$JAVA_HOME"; then
7274 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7279 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7281 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7282 if test -z "$JAVA_HOME"; then
7283 if test "x$with_jdk_home" = "x"; then
7284 cat > findhome.java <<_ACEOF
7285 [import java.io.File;
7289 public static void main(String args[])
7291 String jrelocation = System.getProperty("java.home");
7292 File jre = new File(jrelocation);
7293 System.out.println(jre.getParent());
7297 AC_MSG_CHECKING([if javac works])
7298 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7299 AC_TRY_EVAL(javac_cmd)
7300 if test $? = 0 -a -f ./findhome.class; then
7301 AC_MSG_RESULT([javac works])
7303 echo "configure: javac test failed" >&5
7304 cat findhome.java >&5
7305 AC_MSG_ERROR([javac does not work - java projects will not build!])
7307 AC_MSG_CHECKING([if gij knows its java.home])
7308 JAVA_HOME=`$JAVAINTERPRETER findhome`
7309 if test $? = 0 -a "$JAVA_HOME" != ""; then
7310 AC_MSG_RESULT([$JAVA_HOME])
7312 echo "configure: java test failed" >&5
7313 cat findhome.java >&5
7314 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7316 # clean-up after ourselves
7317 rm -f ./findhome.java ./findhome.class
7319 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7323 # now check if $JAVA_HOME is really valid
7324 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7325 case "${JAVA_HOME}" in
7326 /Library/Java/JavaVirtualMachines/*)
7329 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7332 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7335 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7338 if test "$JAVA_HOME_OK" = "NO"; then
7339 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7340 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7341 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
7342 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7343 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7344 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
7346 PathFormat "$JAVA_HOME"
7347 JAVA_HOME="$formatted_path"
7350 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7353 AC_MSG_CHECKING([for JAWT lib])
7354 if test "$_os" = WINNT; then
7355 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7360 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7361 JAVA_ARCH=$my_java_arch
7376 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7377 JAVA_ARCH=$my_java_arch
7380 my_java_arch=sparcv9
7386 my_java_arch=$host_cpu
7389 # This is where JDK9 puts the library
7390 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7391 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7393 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7395 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7397 AC_MSG_RESULT([$JAWTLIB])
7401 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7405 JAVAINC="-I$JAVA_HOME/include"
7406 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7407 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7411 JAVAINC="-I$JAVA_HOME/include/win32"
7412 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7416 if test -d "$JAVA_HOME/include/darwin"; then
7417 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7419 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7424 JAVAINC="-I$JAVA_HOME/include"
7425 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7429 JAVAINC="-I$JAVA_HOME/include"
7430 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7431 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7432 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7433 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7437 JAVAINC="-I$JAVA_HOME/include"
7438 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7439 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7443 JAVAINC="-I$JAVA_HOME/include"
7444 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7445 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7449 JAVAINC="-I$JAVA_HOME/include"
7450 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7451 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7455 JAVAINC="-I$JAVA_HOME/include"
7456 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7457 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7461 JAVAINC="-I$JAVA_HOME/include"
7462 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7463 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7467 SOLARINC="$SOLARINC $JAVAINC"
7469 if test "$ENABLE_JAVA" != "" -a "x" != "x$JAVACOMPILER"; then
7471 java_base="testurlcheck"
7472 java_src="${java_base}.java"
7473 java_cls="${java_base}.class"
7474 cat > "${java_src}" <<_ACEOF
7475 [import jdk.internal.loader.URLClassPath;
7476 import java.lang.reflect.Field;
7477 import java.net.URL;
7481 public static void main(String args[])
7484 URLClassPath cp = new URLClassPath(new URL[0], null);
7485 Field field = cp.getClass().getDeclaredField("DISABLE_CP_URL_CHECK");
7486 field.setAccessible(true);
7487 System.out.println(field.get(cp).toString());
7488 } catch(Exception e) {
7489 System.out.println("unknown");
7494 AC_MSG_CHECKING([if jdk.net.URLClassPath.ClassPathURLCheck is disabled])
7495 java_cmd="$JAVACOMPILER --add-exports java.base/jdk.internal.loader=ALL-UNNAMED ${java_src} 1>&2"
7496 AC_TRY_EVAL(java_cmd)
7497 if test $? = 0 -a -f "./${java_cls}"; then
7498 java_res=`$JAVAINTERPRETER --add-opens java.base/jdk.internal.loader=ALL-UNNAMED ${java_base} 2>/dev/null`
7499 if test $? = 0; then
7500 case "${java_res}" in
7501 true) AC_MSG_RESULT([yes]) ;;
7503 rm -f "./${java_src}" "./${java_cls}"
7504 AC_MSG_ERROR([no - Java unit tests will break!])
7506 *) url_check_unknown=1 ;;
7514 if test $url_check_unknown -eq 1; then
7515 AC_MSG_RESULT([unknown - assuming yes])
7516 add_warning "Unable to find the default value for jdk.net.URLClassPath.ClassPathURLCheck - java tests might fail!"
7518 rm -f "./${java_src}" "./${java_cls}"
7521 AC_SUBST(JAVACOMPILER)
7523 AC_SUBST(JAVAINTERPRETER)
7524 AC_SUBST(JAVAIFLAGS)
7526 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7528 AC_SUBST(JAVA_SOURCE_VER)
7529 AC_SUBST(JAVA_TARGET_VER)
7533 dnl ===================================================================
7534 dnl Export file validation
7535 dnl ===================================================================
7536 AC_MSG_CHECKING([whether to enable export file validation])
7537 if test "$with_export_validation" != "no"; then
7538 if test -z "$ENABLE_JAVA"; then
7539 if test "$with_export_validation" = "yes"; then
7540 AC_MSG_ERROR([requested, but Java is disabled])
7542 AC_MSG_RESULT([no, as Java is disabled])
7544 elif test "$_jdk_ver" -lt 10800; then
7545 if test "$with_export_validation" = "yes"; then
7546 AC_MSG_ERROR([requested, but Java is too old, need Java 8])
7548 AC_MSG_RESULT([no, as Java is too old, need Java 8])
7551 AC_MSG_RESULT([yes])
7552 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7554 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7555 if test -z "$ODFVALIDATOR"; then
7556 # remember to download the ODF toolkit with validator later
7557 AC_MSG_NOTICE([no odfvalidator found, will download it])
7558 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7559 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7561 # and fetch name of odfvalidator jar name from download.lst
7562 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7563 AC_SUBST(ODFVALIDATOR_JAR)
7565 if test -z "$ODFVALIDATOR_JAR"; then
7566 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7569 if test "$build_os" = "cygwin"; then
7570 # In case of Cygwin it will be executed from Windows,
7571 # so we need to run bash and absolute path to validator
7572 # so instead of "odfvalidator" it will be
7573 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7574 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7576 ODFVALIDATOR="sh $ODFVALIDATOR"
7578 AC_SUBST(ODFVALIDATOR)
7581 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7582 if test -z "$OFFICEOTRON"; then
7583 # remember to download the officeotron with validator later
7584 AC_MSG_NOTICE([no officeotron found, will download it])
7585 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7586 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7588 # and fetch name of officeotron jar name from download.lst
7589 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7590 AC_SUBST(OFFICEOTRON_JAR)
7592 if test -z "$OFFICEOTRON_JAR"; then
7593 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7596 # check version of existing officeotron
7597 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7598 if test 0"$OFFICEOTRON_VER" -lt 704; then
7599 AC_MSG_ERROR([officeotron too old])
7602 if test "$build_os" = "cygwin"; then
7603 # In case of Cygwin it will be executed from Windows,
7604 # so we need to run bash and absolute path to validator
7605 # so instead of "odfvalidator" it will be
7606 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7607 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7609 OFFICEOTRON="sh $OFFICEOTRON"
7612 AC_SUBST(OFFICEOTRON)
7617 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7618 if test "$with_bffvalidator" != "no"; then
7619 AC_DEFINE(HAVE_BFFVALIDATOR)
7621 if test "$with_export_validation" = "no"; then
7622 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7625 if test "$with_bffvalidator" = "yes"; then
7626 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7628 BFFVALIDATOR="$with_bffvalidator"
7631 if test "$build_os" = "cygwin"; then
7632 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7633 AC_MSG_RESULT($BFFVALIDATOR)
7635 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7637 elif test -n "$BFFVALIDATOR"; then
7638 # We are not in Cygwin but need to run Windows binary with wine
7639 AC_PATH_PROGS(WINE, wine)
7641 # so swap in a shell wrapper that converts paths transparently
7642 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7643 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7644 AC_SUBST(BFFVALIDATOR_EXE)
7645 AC_MSG_RESULT($BFFVALIDATOR)
7647 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7649 AC_SUBST(BFFVALIDATOR)
7654 dnl ===================================================================
7655 dnl Check for C preprocessor to use
7656 dnl ===================================================================
7657 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7658 if test -n "$with_idlc_cpp"; then
7659 AC_MSG_RESULT([$with_idlc_cpp])
7660 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7662 AC_MSG_RESULT([ucpp])
7663 AC_MSG_CHECKING([which ucpp tp use])
7664 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7665 AC_MSG_RESULT([external])
7666 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7668 AC_MSG_RESULT([internal])
7669 BUILD_TYPE="$BUILD_TYPE UCPP"
7672 AC_SUBST(SYSTEM_UCPP)
7674 dnl ===================================================================
7675 dnl Check for epm (not needed for Windows)
7676 dnl ===================================================================
7677 AC_MSG_CHECKING([whether to enable EPM for packing])
7678 if test "$enable_epm" = "yes"; then
7679 AC_MSG_RESULT([yes])
7680 if test "$_os" != "WINNT"; then
7681 if test $_os = Darwin; then
7683 elif test -n "$with_epm"; then
7686 AC_PATH_PROG(EPM, epm, no)
7688 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7689 AC_MSG_NOTICE([EPM will be built.])
7690 BUILD_TYPE="$BUILD_TYPE EPM"
7691 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7693 # Gentoo has some epm which is something different...
7694 AC_MSG_CHECKING([whether the found epm is the right epm])
7695 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7696 AC_MSG_RESULT([yes])
7698 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7700 AC_MSG_CHECKING([epm version])
7701 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7702 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7703 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7704 AC_MSG_RESULT([OK, >= 3.7])
7706 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7707 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7712 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7713 AC_MSG_CHECKING([for rpm])
7714 for a in "$RPM" rpmbuild rpm; do
7715 $a --usage >/dev/null 2> /dev/null
7716 if test $? -eq 0; then
7720 $a --version >/dev/null 2> /dev/null
7721 if test $? -eq 0; then
7727 if test -z "$RPM"; then
7728 AC_MSG_ERROR([not found])
7729 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7730 RPM_PATH=`which $RPM`
7731 AC_MSG_RESULT([$RPM_PATH])
7732 SCPDEFS="$SCPDEFS -DWITH_RPM"
7734 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7737 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7738 AC_PATH_PROG(DPKG, dpkg, no)
7739 if test "$DPKG" = "no"; then
7740 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7743 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7744 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7745 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7746 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7747 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7748 if grep "Patched for .*Office" $EPM >/dev/null 2>/dev/null; then
7749 AC_MSG_RESULT([yes])
7752 if echo "$PKGFORMAT" | $GREP -q rpm; then
7754 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7755 add_warning "the rpms will need to be installed with --nodeps"
7759 AC_MSG_WARN([the ${_pt}s will not be relocatable])
7760 add_warning "the ${_pt}s will not be relocatable"
7761 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7762 relocation will work, you need to patch your epm with the
7763 patch in epm/epm-3.7.patch or build with
7764 --with-epm=internal which will build a suitable epm])
7769 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7770 AC_PATH_PROG(PKGMK, pkgmk, no)
7771 if test "$PKGMK" = "no"; then
7772 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7779 for i in $PKGFORMAT; do
7781 aix | bsd | deb | pkg | rpm | native | portable)
7783 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7793 if test "$enable_lotuswordpro" = "yes"; then
7796 AC_SUBST(ENABLE_LWP)
7798 dnl ===================================================================
7799 dnl Check for building ODK
7800 dnl ===================================================================
7801 if test "$enable_odk" = no; then
7804 if test "$with_doxygen" = no; then
7805 AC_MSG_CHECKING([for doxygen])
7809 if test "$with_doxygen" = yes; then
7810 AC_PATH_PROG([DOXYGEN], [doxygen])
7811 if test -z "$DOXYGEN"; then
7812 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7814 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
7815 if ! dot -V 2>/dev/null; then
7816 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
7820 AC_MSG_CHECKING([for doxygen])
7821 DOXYGEN=$with_doxygen
7822 AC_MSG_RESULT([$DOXYGEN])
7824 if test -n "$DOXYGEN"; then
7825 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7826 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7827 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7828 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7835 AC_MSG_CHECKING([whether to build the ODK])
7836 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7837 AC_MSG_RESULT([yes])
7839 if test "$with_java" != "no"; then
7840 AC_MSG_CHECKING([whether to build unowinreg.dll])
7841 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7842 # build on Win by default
7843 enable_build_unowinreg=yes
7845 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7849 AC_MSG_RESULT([yes])
7850 BUILD_UNOWINREG=TRUE
7852 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7853 if test -z "$with_mingw_cross_compiler"; then
7855 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7856 elif test -x "$with_mingw_cross_compiler"; then
7857 MINGWCXX="$with_mingw_cross_compiler"
7859 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7862 if test "$MINGWCXX" = "false"; then
7863 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7866 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7867 if test -x "$mingwstrip_test"; then
7868 MINGWSTRIP="$mingwstrip_test"
7870 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7873 if test "$MINGWSTRIP" = "false"; then
7874 AC_MSG_ERROR(MinGW32 binutils not found.)
7878 BUILD_TYPE="$BUILD_TYPE ODK"
7883 AC_SUBST(BUILD_UNOWINREG)
7885 AC_SUBST(MINGWSTRIP)
7887 dnl ===================================================================
7888 dnl Check for system zlib
7889 dnl ===================================================================
7890 if test "$with_system_zlib" = "auto"; then
7893 with_system_zlib="$with_system_libs"
7896 if test "$enable_fuzzers" != "yes"; then
7897 with_system_zlib=yes
7905 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but macOS is too stupid
7906 dnl and has no pkg-config for it at least on some tinderboxes,
7907 dnl so leaving that out for now
7908 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7909 AC_MSG_CHECKING([which zlib to use])
7910 if test "$with_system_zlib" = "yes"; then
7911 AC_MSG_RESULT([external])
7913 AC_CHECK_HEADER(zlib.h, [],
7914 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7915 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
7916 [AC_MSG_ERROR(zlib not found or functional)], [])
7918 AC_MSG_RESULT([internal])
7920 BUILD_TYPE="$BUILD_TYPE ZLIB"
7921 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7922 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
7924 AC_SUBST(ZLIB_CFLAGS)
7926 AC_SUBST(SYSTEM_ZLIB)
7928 dnl ===================================================================
7929 dnl Check for system jpeg
7930 dnl ===================================================================
7931 AC_MSG_CHECKING([which libjpeg to use])
7932 if test "$with_system_jpeg" = "yes"; then
7933 AC_MSG_RESULT([external])
7935 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
7936 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7937 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
7938 [AC_MSG_ERROR(jpeg library not found or functional)], [])
7941 AC_MSG_RESULT([internal, libjpeg-turbo])
7942 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
7943 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
7944 if test "$COM" = "MSC"; then
7945 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
7947 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
7951 x86_64 | amd64 | i*86 | x86 | ia32)
7952 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
7953 if test -z "$NASM" -a "$build_os" = "cygwin"; then
7954 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
7955 NASM="$LODE_HOME/opt/bin/nasm"
7956 elif test -x "/opt/lo/bin/nasm"; then
7957 NASM="/opt/lo/bin/nasm"
7961 if test -n "$NASM"; then
7962 AC_MSG_CHECKING([for object file format of host system])
7964 cygwin* | mingw* | pw32* | interix*)
7974 msdosdjgpp* | go32*)
7977 os2-emx*) # not tested
7978 objfmt='MSOMF' # obj
7980 linux*coff* | linux*oldld*)
7996 kfreebsd* | freebsd* | netbsd* | openbsd*)
7997 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
8010 solaris* | sunos* | sysv* | sco*)
8020 darwin* | rhapsody* | nextstep* | openstep* | macos*)
8035 AC_MSG_RESULT([$objfmt])
8036 if test "$objfmt" = 'ELF ?'; then
8038 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
8041 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
8043 MSOMF) NAFLAGS='-fobj -DOBJ32';;
8044 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
8045 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
8046 COFF) NAFLAGS='-fcoff -DCOFF';;
8047 a.out) NAFLAGS='-faout -DAOUT';;
8048 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
8049 ELF) NAFLAGS='-felf -DELF';;
8050 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
8051 RDF) NAFLAGS='-frdf -DRDF';;
8052 Mach-O) NAFLAGS='-fmacho -DMACHO';;
8053 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
8055 AC_MSG_RESULT([$NAFLAGS])
8057 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
8058 cat > conftest.asm << EOF
8059 [%line __oline__ "configure"
8067 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
8068 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
8071 echo "configure: failed program was:" >&AC_FD_CC
8072 cat conftest.asm >&AC_FD_CC
8075 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
8081 if test -z "$NASM"; then
8083 ****************************************************************************
8084 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
8088 if test "$build_os" = "cygwin"; then
8090 install a pre-compiled binary for Win32
8092 mkdir -p /opt/lo/bin
8094 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
8097 or get and install one from http://www.nasm.us/
8099 Then re-run autogen.sh
8101 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
8102 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
8107 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
8111 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
8112 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
8119 AC_SUBST(LIBJPEG_CFLAGS)
8120 AC_SUBST(LIBJPEG_LIBS)
8121 AC_SUBST(SYSTEM_LIBJPEG)
8123 dnl ===================================================================
8124 dnl Check for system clucene
8125 dnl ===================================================================
8126 dnl we should rather be using
8127 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
8128 dnl but the contribs-lib check seems tricky
8129 AC_MSG_CHECKING([which clucene to use])
8130 if test "$with_system_clucene" = "yes"; then
8131 AC_MSG_RESULT([external])
8133 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
8134 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
8135 FilterLibs "${CLUCENE_LIBS}"
8136 CLUCENE_LIBS="${filteredlibs}"
8138 save_CXXFLAGS=$CXXFLAGS
8139 save_CPPFLAGS=$CPPFLAGS
8140 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
8141 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
8142 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
8143 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
8144 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
8145 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
8146 CXXFLAGS=$save_CXXFLAGS
8147 CPPFLAGS=$save_CPPFLAGS
8150 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
8152 AC_MSG_RESULT([internal])
8154 BUILD_TYPE="$BUILD_TYPE CLUCENE"
8156 AC_SUBST(SYSTEM_CLUCENE)
8157 AC_SUBST(CLUCENE_CFLAGS)
8158 AC_SUBST(CLUCENE_LIBS)
8160 dnl ===================================================================
8161 dnl Check for system expat
8162 dnl ===================================================================
8163 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
8165 dnl ===================================================================
8166 dnl Check for system xmlsec
8167 dnl ===================================================================
8168 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
8170 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
8171 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
8173 AC_DEFINE([ENABLE_EOT])
8174 AC_MSG_RESULT([yes])
8176 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
8181 AC_SUBST([ENABLE_EOT])
8183 dnl ===================================================================
8184 dnl Check for DLP libs
8185 dnl ===================================================================
8186 AS_IF([test "$COM" = "MSC"],
8187 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
8188 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
8190 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
8192 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
8194 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
8196 AS_IF([test "$COM" = "MSC"],
8197 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
8198 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
8200 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
8202 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
8204 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
8205 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
8207 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
8209 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
8211 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
8213 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
8214 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.14])
8216 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
8217 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
8219 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
8221 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
8222 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
8224 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
8226 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
8228 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
8230 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
8232 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
8233 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
8235 dnl ===================================================================
8236 dnl Check for system lcms2
8237 dnl ===================================================================
8238 if test "$with_system_lcms2" != "yes"; then
8241 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
8242 if test "$GCC" = "yes"; then
8243 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
8245 if test "$COM" = "MSC"; then # override the above
8246 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
8249 dnl ===================================================================
8250 dnl Check for system cppunit
8251 dnl ===================================================================
8252 if test "$_os" != "Android" ; then
8253 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
8256 dnl ===================================================================
8257 dnl Check whether freetype is available
8258 dnl ===================================================================
8259 if test "$test_freetype" = "yes"; then
8260 AC_MSG_CHECKING([whether freetype is available])
8261 # FreeType has 3 different kinds of versions
8262 # * release, like 2.4.10
8263 # * libtool, like 13.0.7 (this what pkg-config returns)
8265 # FreeType's docs/VERSION.DLL provides a table mapping between the three
8268 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
8269 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8270 FilterLibs "${FREETYPE_LIBS}"
8271 FREETYPE_LIBS="${filteredlibs}"
8272 SYSTEM_FREETYPE=TRUE
8274 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
8275 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
8277 AC_SUBST(FREETYPE_CFLAGS)
8278 AC_SUBST(FREETYPE_LIBS)
8279 AC_SUBST([SYSTEM_FREETYPE])
8281 # ===================================================================
8282 # Check for system libxslt
8283 # to prevent incompatibilities between internal libxml2 and external libxslt,
8284 # or vice versa, use with_system_libxml here
8285 # ===================================================================
8286 if test "$with_system_libxml" = "auto"; then
8289 with_system_libxml="$with_system_libs"
8292 if test "$enable_fuzzers" != "yes"; then
8293 with_system_libxml=yes
8295 with_system_libxml=no
8301 AC_MSG_CHECKING([which libxslt to use])
8302 if test "$with_system_libxml" = "yes"; then
8303 AC_MSG_RESULT([external])
8305 if test "$_os" = "Darwin"; then
8306 dnl make sure to use SDK path
8307 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8308 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8310 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8311 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8313 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8314 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8315 FilterLibs "${LIBXSLT_LIBS}"
8316 LIBXSLT_LIBS="${filteredlibs}"
8317 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8318 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8319 FilterLibs "${LIBEXSLT_LIBS}"
8320 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8323 dnl Check for xsltproc
8324 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8325 if test "$XSLTPROC" = "no"; then
8326 AC_MSG_ERROR([xsltproc is required])
8329 AC_MSG_RESULT([internal])
8331 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8333 if test "$cross_compiling" = "yes"; then
8334 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8335 if test "$XSLTPROC" = "no"; then
8336 AC_MSG_ERROR([xsltproc is required])
8340 AC_SUBST(SYSTEM_LIBXSLT)
8341 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8342 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8344 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8346 AC_SUBST(LIBEXSLT_CFLAGS)
8347 AC_SUBST(LIBEXSLT_LIBS)
8348 AC_SUBST(LIBXSLT_CFLAGS)
8349 AC_SUBST(LIBXSLT_LIBS)
8352 # ===================================================================
8353 # Check for system libxml
8354 # ===================================================================
8355 AC_MSG_CHECKING([which libxml to use])
8356 if test "$with_system_libxml" = "yes"; then
8357 AC_MSG_RESULT([external])
8359 if test "$_os" = "Darwin"; then
8360 dnl make sure to use SDK path
8361 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8363 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8364 elif test $_os = iOS; then
8365 dnl make sure to use SDK path
8366 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8367 LIBXML_CFLAGS="-I$usr/include/libxml2"
8368 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8370 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8371 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8372 FilterLibs "${LIBXML_LIBS}"
8373 LIBXML_LIBS="${filteredlibs}"
8376 dnl Check for xmllint
8377 AC_PATH_PROG(XMLLINT, xmllint, no)
8378 if test "$XMLLINT" = "no"; then
8379 AC_MSG_ERROR([xmllint is required])
8382 AC_MSG_RESULT([internal])
8384 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8385 if test "$COM" = "MSC"; then
8386 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8388 if test "$COM" = "MSC"; then
8389 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8391 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8393 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8395 AC_SUBST(SYSTEM_LIBXML)
8396 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8397 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8399 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8400 AC_SUBST(LIBXML_CFLAGS)
8401 AC_SUBST(LIBXML_LIBS)
8404 # =====================================================================
8405 # Checking for a Python interpreter with version >= 2.7.
8406 # Build and runtime requires Python 3 compatible version (>= 2.7).
8407 # Optionally user can pass an option to configure, i. e.
8408 # ./configure PYTHON=/usr/bin/python
8409 # =====================================================================
8410 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8411 # This allows a lack of system python with no error, we use internal one in that case.
8412 AM_PATH_PYTHON([2.7],, [:])
8413 # Clean PYTHON_VERSION checked below if cross-compiling
8415 if test "$PYTHON" != ":"; then
8416 PYTHON_FOR_BUILD=$PYTHON
8419 AC_SUBST(PYTHON_FOR_BUILD)
8421 # Checks for Python to use for Pyuno
8422 AC_MSG_CHECKING([which Python to use for Pyuno])
8423 case "$enable_python" in
8425 if test -z $PYTHON_FOR_BUILD; then
8426 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8427 # requirement from the choice whether to include Python stuff in the installer, but why
8429 AC_MSG_ERROR([Python is required at build time.])
8432 AC_MSG_RESULT([none])
8435 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8436 AC_MSG_RESULT([no, overridden by --disable-scripting])
8438 elif test $build_os = cygwin; then
8439 dnl When building on Windows we don't attempt to use any installed
8440 dnl "system" Python.
8441 AC_MSG_RESULT([fully internal])
8442 enable_python=internal
8443 elif test "$cross_compiling" = yes; then
8444 AC_MSG_RESULT([system])
8445 enable_python=system
8447 # Unset variables set by the above AM_PATH_PYTHON so that
8448 # we actually do check anew.
8449 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
8450 AM_PATH_PYTHON([3.3],, [:])
8451 if test "$PYTHON" = ":"; then
8452 if test -z "$PYTHON_FOR_BUILD"; then
8453 AC_MSG_RESULT([fully internal])
8455 AC_MSG_RESULT([internal])
8457 enable_python=internal
8459 AC_MSG_RESULT([system])
8460 enable_python=system
8465 AC_MSG_RESULT([internal])
8468 AC_MSG_RESULT([fully internal])
8469 enable_python=internal
8472 AC_MSG_RESULT([system])
8473 if test "$_os" = Darwin; then
8474 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])
8478 AC_MSG_ERROR([Incorrect --enable-python option])
8482 if test $enable_python != no; then
8483 BUILD_TYPE="$BUILD_TYPE PYUNO"
8486 if test $enable_python = system; then
8487 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8488 # Fallback: Accept these in the environment, or as set above
8491 elif test "$cross_compiling" != yes; then
8492 # Unset variables set by the above AM_PATH_PYTHON so that
8493 # we actually do check anew.
8494 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
8495 # This causes an error if no python command is found
8496 AM_PATH_PYTHON([3.3])
8497 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8498 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8499 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8500 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8501 if test -z "$PKG_CONFIG"; then
8502 PYTHON_CFLAGS="-I$python_include"
8503 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8504 elif $PKG_CONFIG --exists python-$python_version; then
8505 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8506 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8508 PYTHON_CFLAGS="-I$python_include"
8509 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8511 FilterLibs "${PYTHON_LIBS}"
8512 PYTHON_LIBS="${filteredlibs}"
8514 dnl How to find out the cross-compilation Python installation path?
8515 AC_MSG_CHECKING([for python version])
8516 AS_IF([test -n "$PYTHON_VERSION"],
8517 [AC_MSG_RESULT([$PYTHON_VERSION])],
8518 [AC_MSG_RESULT([not found])
8519 AC_MSG_ERROR([no usable python found])])
8520 test -n "$PYTHON_CFLAGS" && break
8523 dnl Check if the headers really work
8524 save_CPPFLAGS="$CPPFLAGS"
8525 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8526 AC_CHECK_HEADER(Python.h)
8527 CPPFLAGS="$save_CPPFLAGS"
8529 # let the PYTHON_FOR_BUILD match the same python installation that
8530 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8531 # better for PythonTests.
8532 PYTHON_FOR_BUILD=$PYTHON
8535 if test "$with_lxml" != no; then
8536 if test -z "$PYTHON_FOR_BUILD"; then
8539 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8542 if test "$cross_compiling" != yes ; then
8543 BUILD_TYPE="$BUILD_TYPE LXML"
8548 AC_MSG_CHECKING([for python lxml])
8549 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8550 AC_MSG_RESULT([yes])
8554 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8557 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8558 BUILD_TYPE="$BUILD_TYPE LXML"
8559 AC_MSG_RESULT([no, using internal lxml])
8561 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8569 dnl By now enable_python should be "system", "internal" or "no"
8570 case $enable_python in
8574 if test "x$ac_cv_header_Python_h" != "xyes"; then
8575 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8579 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8580 AC_MSG_CHECKING([for correct python library version])
8581 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8584 int main(int argc, char **argv) {
8585 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
8586 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8589 ]])],[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])])
8593 dnl FIXME Check if the Python library can be linked with, too?
8598 PYTHON_VERSION_MAJOR=3
8599 PYTHON_VERSION_MINOR=5
8600 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.6
8601 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
8602 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
8604 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8605 BUILD_TYPE="$BUILD_TYPE PYTHON"
8606 # Embedded Python dies without Home set
8607 if test "$HOME" = ""; then
8616 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8620 AC_SUBST(DISABLE_PYTHON)
8621 AC_SUBST(SYSTEM_PYTHON)
8622 AC_SUBST(PYTHON_CFLAGS)
8623 AC_SUBST(PYTHON_LIBS)
8624 AC_SUBST(PYTHON_VERSION)
8625 AC_SUBST(PYTHON_VERSION_MAJOR)
8626 AC_SUBST(PYTHON_VERSION_MINOR)
8628 ENABLE_MARIADBC=TRUE
8629 if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then
8635 if test "$ENABLE_MARIADBC" = "TRUE"; then
8636 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8639 AC_SUBST(ENABLE_MARIADBC)
8640 AC_SUBST(MARIADBC_MAJOR)
8641 AC_SUBST(MARIADBC_MINOR)
8642 AC_SUBST(MARIADBC_MICRO)
8644 if test "$ENABLE_MARIADBC" = "TRUE"; then
8645 dnl ===================================================================
8646 dnl Check for system MariaDB
8647 dnl ===================================================================
8648 AC_MSG_CHECKING([which MariaDB to use])
8649 if test "$with_system_mariadb" = "yes"; then
8650 AC_MSG_RESULT([external])
8651 SYSTEM_MARIADB_CONNECTOR_C=TRUE
8652 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8653 if test -z "$MARIADBCONFIG"; then
8654 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8655 if test -z "$MARIADBCONFIG"; then
8656 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8657 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8660 AC_MSG_CHECKING([MariaDB version])
8661 MARIADB_VERSION=`$MARIADBCONFIG --version`
8662 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8663 if test "$MARIADB_MAJOR" -ge "5"; then
8666 AC_MSG_ERROR([too old, use 5.0.x or later])
8668 AC_MSG_CHECKING([for MariaDB Client library])
8669 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8670 if test "$COM_IS_CLANG" = TRUE; then
8671 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8673 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8674 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8675 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8677 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8678 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8679 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8680 | sed -e 's|/lib64/|/lib/|')
8682 FilterLibs "${MARIADB_LIBS}"
8683 MARIADB_LIBS="${filteredlibs}"
8684 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8685 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8686 if test "$enable_bundle_mariadb" = "yes"; then
8687 AC_MSG_RESULT([yes])
8688 BUNDLE_MARIADB_CONNECTOR_C=TRUE
8689 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8691 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8693 /g' | grep -E '(mysqlclient|mariadb)')
8694 if test "$_os" = "Darwin"; then
8695 LIBMARIADB=${LIBMARIADB}.dylib
8696 elif test "$_os" = "WINNT"; then
8697 LIBMARIADB=${LIBMARIADB}.dll
8699 LIBMARIADB=${LIBMARIADB}.so
8701 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8702 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8703 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8704 AC_MSG_RESULT([found.])
8705 PathFormat "$LIBMARIADB_PATH"
8706 LIBMARIADB_PATH="$formatted_path"
8708 AC_MSG_ERROR([not found.])
8712 BUNDLE_MARIADB_CONNECTOR_C=
8715 AC_MSG_RESULT([internal])
8716 SYSTEM_MARIADB_CONNECTOR_C=
8717 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
8718 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
8719 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
8722 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
8723 AC_SUBST(MARIADB_CFLAGS)
8724 AC_SUBST(MARIADB_LIBS)
8725 AC_SUBST(LIBMARIADB)
8726 AC_SUBST(LIBMARIADB_PATH)
8727 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
8730 dnl ===================================================================
8731 dnl Check for system hsqldb
8732 dnl ===================================================================
8733 if test "$with_java" != "no"; then
8734 HSQLDB_USE_JDBC_4_1=
8735 AC_MSG_CHECKING([which hsqldb to use])
8736 if test "$with_system_hsqldb" = "yes"; then
8737 AC_MSG_RESULT([external])
8739 if test -z $HSQLDB_JAR; then
8740 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8742 if ! test -f $HSQLDB_JAR; then
8743 AC_MSG_ERROR(hsqldb.jar not found.)
8745 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8749 my $file = "$ENV{'HSQLDB_JAR'}";
8750 my $zip = Archive::Zip->new( $file );
8751 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8752 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8754 push @l, split(/\n/, $mf);
8755 foreach my $line (@l)
8757 if ($line =~ m/Specification-Version:/)
8759 ($t, $version) = split (/:/,$line);
8760 $version =~ s/^\s//;
8761 ($a, $b, $c, $d) = split (/\./,$version);
8762 if ($c == "0" && $d > "8")
8777 AC_MSG_RESULT([yes])
8779 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8782 AC_MSG_RESULT([internal])
8784 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8786 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8787 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8788 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8789 AC_MSG_RESULT([yes])
8790 HSQLDB_USE_JDBC_4_1=TRUE
8795 AC_SUBST(SYSTEM_HSQLDB)
8796 AC_SUBST(HSQLDB_JAR)
8797 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8800 dnl ===================================================================
8801 dnl Check for PostgreSQL stuff
8802 dnl ===================================================================
8803 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
8804 if test "x$enable_postgresql_sdbc" != "xno"; then
8805 AC_MSG_RESULT([yes])
8806 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8808 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8809 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8811 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8812 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8815 postgres_interface=""
8816 if test "$with_system_postgresql" = "yes"; then
8817 postgres_interface="external PostgreSQL"
8818 SYSTEM_POSTGRESQL=TRUE
8819 if test "$_os" = Darwin; then
8821 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8822 pg_supp_path="$P_SEP$d$pg_supp_path"
8825 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8826 if test -n "$PGCONFIG"; then
8827 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8828 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8830 PKG_CHECK_MODULES(POSTGRESQL, libpq, [
8831 POSTGRESQL_INC=$POSTGRESQL_CFLAGS
8832 POSTGRESQL_LIB=$POSTGRESQL_LIBS
8834 AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
8837 FilterLibs "${POSTGRESQL_LIB}"
8838 POSTGRESQL_LIB="${filteredlibs}"
8840 # if/when anything else than PostgreSQL uses Kerberos,
8841 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8846 # macOS has system MIT Kerberos 5 since 10.4
8847 if test "$with_krb5" != "no"; then
8850 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
8851 # that the libraries where these functions are located on macOS will change, is it?
8852 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8853 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8856 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8857 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8858 KRB5_LIBS="$KRB5_LIBS $LIBS"
8861 if test "$with_gssapi" != "no"; then
8864 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8865 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8871 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8872 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8875 Linux|GNU|*BSD|DragonFly)
8876 if test "$with_krb5" != "no"; then
8879 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8880 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8883 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8884 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8885 KRB5_LIBS="$KRB5_LIBS $LIBS"
8888 if test "$with_gssapi" != "no"; then
8891 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8892 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8898 if test "$with_krb5" = "yes"; then
8901 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8902 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8905 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8906 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8907 KRB5_LIBS="$KRB5_LIBS $LIBS"
8910 if test "$with_gssapi" = "yes"; then
8913 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8914 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8920 if test -n "$with_libpq_path"; then
8921 SYSTEM_POSTGRESQL=TRUE
8922 postgres_interface="external libpq"
8923 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8924 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8927 postgres_interface="internal"
8929 POSTGRESQL_INC="%OVERRIDE_ME%"
8930 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8934 AC_MSG_CHECKING([PostgreSQL C interface])
8935 AC_MSG_RESULT([$postgres_interface])
8937 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
8938 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8940 save_CPPFLAGS=$CPPFLAGS
8942 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8943 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8944 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8945 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8946 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8948 CPPFLAGS=$save_CPPFLAGS
8951 BUILD_POSTGRESQL_SDBC=TRUE
8956 AC_SUBST(WITH_GSSAPI)
8957 AC_SUBST(GSSAPI_LIBS)
8959 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8960 AC_SUBST(SYSTEM_POSTGRESQL)
8961 AC_SUBST(POSTGRESQL_INC)
8962 AC_SUBST(POSTGRESQL_LIB)
8964 dnl ===================================================================
8965 dnl Check for Firebird stuff
8966 dnl ===================================================================
8967 ENABLE_FIREBIRD_SDBC=
8968 if test "$enable_firebird_sdbc" = "yes" ; then
8969 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8971 dnl ===================================================================
8972 dnl Check for system Firebird
8973 dnl ===================================================================
8974 AC_MSG_CHECKING([which Firebird to use])
8975 if test "$with_system_firebird" = "yes"; then
8976 AC_MSG_RESULT([external])
8977 SYSTEM_FIREBIRD=TRUE
8978 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8979 if test -z "$FIREBIRDCONFIG"; then
8980 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8981 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
8982 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
8984 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
8986 AC_MSG_NOTICE([fb_config found])
8987 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8988 AC_MSG_CHECKING([for Firebird Client library])
8989 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8990 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8991 FilterLibs "${FIREBIRD_LIBS}"
8992 FIREBIRD_LIBS="${filteredlibs}"
8994 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8995 AC_MSG_CHECKING([Firebird version])
8996 if test -n "${FIREBIRD_VERSION}"; then
8997 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8998 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8999 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
9002 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
9005 __save_CFLAGS="${CFLAGS}"
9006 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
9007 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
9008 #if defined(FB_API_VER) && FB_API_VER == 30
9009 int fb_api_is_30(void) { return 0; }
9011 #error "Wrong Firebird API version"
9012 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
9013 CFLAGS="${__save_CFLAGS}"
9015 ENABLE_FIREBIRD_SDBC=TRUE
9016 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9017 elif test "$enable_database_connectivity" != yes; then
9018 AC_MSG_RESULT([none])
9019 elif test "$cross_compiling" = "yes"; then
9020 AC_MSG_RESULT([none])
9022 dnl Embedded Firebird has version 3.0
9023 AC_DEFINE(HAVE_FIREBIRD_30, 1)
9024 dnl We need libatomic_ops for any non X86/X64 system
9025 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
9026 dnl ===================================================================
9027 dnl Check for system libatomic_ops
9028 dnl ===================================================================
9029 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
9030 if test "$with_system_libatomic_ops" = "yes"; then
9031 SYSTEM_LIBATOMIC_OPS=TRUE
9032 AC_CHECK_HEADERS(atomic_ops.h, [],
9033 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic_ops)], [])
9035 SYSTEM_LIBATOMIC_OPS=
9036 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
9037 LIBATOMIC_OPS_LIBS="-latomic_ops"
9038 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
9042 AC_MSG_RESULT([internal])
9044 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
9045 FIREBIRD_LIBS="-lfbclient"
9047 if test "$with_system_libtommath" = "yes"; then
9048 SYSTEM_LIBTOMMATH=TRUE
9049 dnl check for tommath presence
9051 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
9052 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
9056 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
9057 LIBTOMMATH_LIBS="-ltommath"
9058 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
9061 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
9062 ENABLE_FIREBIRD_SDBC=TRUE
9063 AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
9066 AC_SUBST(ENABLE_FIREBIRD_SDBC)
9067 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
9068 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
9069 AC_SUBST(LIBATOMIC_OPS_LIBS)
9070 AC_SUBST(SYSTEM_FIREBIRD)
9071 AC_SUBST(FIREBIRD_CFLAGS)
9072 AC_SUBST(FIREBIRD_LIBS)
9073 AC_SUBST([TOMMATH_CFLAGS])
9074 AC_SUBST([TOMMATH_LIBS])
9076 dnl ===================================================================
9077 dnl Check for system curl
9078 dnl ===================================================================
9079 AC_MSG_CHECKING([which libcurl to use])
9080 if test "$with_system_curl" = "auto"; then
9081 with_system_curl="$with_system_libs"
9084 if test "$with_system_curl" = "yes"; then
9085 AC_MSG_RESULT([external])
9088 # First try PKGCONFIG and then fall back
9089 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
9091 if test -n "$CURL_PKG_ERRORS"; then
9092 AC_PATH_PROG(CURLCONFIG, curl-config)
9093 if test -z "$CURLCONFIG"; then
9094 AC_MSG_ERROR([curl development files not found])
9096 CURL_LIBS=`$CURLCONFIG --libs`
9097 FilterLibs "${CURL_LIBS}"
9098 CURL_LIBS="${filteredlibs}"
9099 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
9100 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
9102 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
9103 case $curl_version in
9104 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
9105 dnl so they need to be doubled to end up in the configure script
9106 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
9107 AC_MSG_RESULT([yes])
9110 AC_MSG_ERROR([no, you have $curl_version])
9116 elif test $_os = iOS; then
9117 # Let's see if we need curl, I think not?
9118 AC_MSG_RESULT([none])
9121 AC_MSG_RESULT([internal])
9123 BUILD_TYPE="$BUILD_TYPE CURL"
9126 AC_SUBST(SYSTEM_CURL)
9127 AC_SUBST(CURL_CFLAGS)
9129 AC_SUBST(ENABLE_CURL)
9131 dnl ===================================================================
9132 dnl Check for system boost
9133 dnl ===================================================================
9134 AC_MSG_CHECKING([which boost to use])
9135 if test "$with_system_boost" = "yes"; then
9136 AC_MSG_RESULT([external])
9144 save_CXXFLAGS=$CXXFLAGS
9145 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
9146 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
9147 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
9148 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
9149 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
9150 CXXFLAGS=$save_CXXFLAGS
9152 # this is in m4/ax_boost_base.m4
9153 FilterLibs "${BOOST_LDFLAGS}"
9154 BOOST_LDFLAGS="${filteredlibs}"
9156 AC_MSG_RESULT([internal])
9157 BUILD_TYPE="$BUILD_TYPE BOOST"
9159 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
9160 # use warning-suppressing wrapper headers
9161 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
9163 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
9166 AC_SUBST(SYSTEM_BOOST)
9168 dnl ===================================================================
9169 dnl Check for system mdds
9170 dnl ===================================================================
9171 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.4 >= 1.4.1], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
9173 dnl ===================================================================
9174 dnl Check for system glm
9175 dnl ===================================================================
9176 AC_MSG_CHECKING([which glm to use])
9177 if test "$with_system_glm" = "yes"; then
9178 AC_MSG_RESULT([external])
9181 AC_CHECK_HEADER([glm/glm.hpp], [],
9182 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
9185 AC_MSG_RESULT([internal])
9186 BUILD_TYPE="$BUILD_TYPE GLM"
9188 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
9190 AC_SUBST([GLM_CFLAGS])
9191 AC_SUBST([SYSTEM_GLM])
9193 dnl ===================================================================
9194 dnl Check for system odbc
9195 dnl ===================================================================
9196 AC_MSG_CHECKING([which odbc headers to use])
9197 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
9198 AC_MSG_RESULT([external])
9199 SYSTEM_ODBC_HEADERS=TRUE
9201 if test "$build_os" = "cygwin"; then
9202 save_CPPFLAGS=$CPPFLAGS
9204 PathFormat "$winsdktest"
9205 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"
9206 AC_CHECK_HEADER(sqlext.h, [],
9207 [AC_MSG_ERROR(odbc not found. install odbc)],
9208 [#include <windows.h>])
9209 CPPFLAGS=$save_CPPFLAGS
9211 AC_CHECK_HEADER(sqlext.h, [],
9212 [AC_MSG_ERROR(odbc not found. install odbc)],[])
9214 elif test "$enable_database_connectivity" != yes; then
9215 AC_MSG_RESULT([none])
9217 AC_MSG_RESULT([internal])
9218 SYSTEM_ODBC_HEADERS=
9220 AC_SUBST(SYSTEM_ODBC_HEADERS)
9222 dnl ===================================================================
9223 dnl Enable LDAP support
9224 dnl ===================================================================
9226 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
9227 AC_MSG_CHECKING([whether to enable LDAP support])
9228 if test "$enable_ldap" != "yes"; then
9233 AC_MSG_RESULT([yes])
9235 AC_DEFINE(HAVE_FEATURE_LDAP)
9238 AC_SUBST(ENABLE_LDAP)
9240 dnl ===================================================================
9241 dnl Check for system openldap
9242 dnl ===================================================================
9244 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android" -a "$ENABLE_LDAP" != ""; then
9245 AC_MSG_CHECKING([which openldap library to use])
9246 if test "$with_system_openldap" = "yes"; then
9247 AC_MSG_RESULT([external])
9248 SYSTEM_OPENLDAP=TRUE
9249 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
9250 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9251 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9253 AC_MSG_RESULT([internal])
9255 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
9258 AC_SUBST(SYSTEM_OPENLDAP)
9260 dnl ===================================================================
9261 dnl Check for system NSS
9262 dnl ===================================================================
9263 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
9264 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
9265 AC_DEFINE(HAVE_FEATURE_NSS)
9267 AC_DEFINE(ENABLE_NSS)
9268 elif test $_os != iOS ; then
9271 AC_SUBST(ENABLE_NSS)
9273 dnl ===================================================================
9274 dnl Check for TLS/SSL and cryptographic implementation to use
9275 dnl ===================================================================
9276 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
9277 if test -n "$with_tls"; then
9280 AC_DEFINE(USE_TLS_OPENSSL)
9283 if test "$enable_openssl" != "yes"; then
9284 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9287 # warn that OpenSSL has been selected but not all TLS code has this option
9288 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
9289 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
9292 AC_DEFINE(USE_TLS_NSS)
9296 AC_MSG_WARN([Skipping TLS/SSL])
9299 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9301 nss - Mozilla's Network Security Services (NSS)
9306 # default to using NSS, it results in smaller oox lib
9307 AC_DEFINE(USE_TLS_NSS)
9310 AC_MSG_RESULT([$TLS])
9313 dnl ===================================================================
9314 dnl Check for system sane
9315 dnl ===================================================================
9316 AC_MSG_CHECKING([which sane header to use])
9317 if test "$with_system_sane" = "yes"; then
9318 AC_MSG_RESULT([external])
9319 AC_CHECK_HEADER(sane/sane.h, [],
9320 [AC_MSG_ERROR(sane not found. install sane)], [])
9322 AC_MSG_RESULT([internal])
9323 BUILD_TYPE="$BUILD_TYPE SANE"
9326 dnl ===================================================================
9327 dnl Check for system icu
9328 dnl ===================================================================
9335 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9336 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9337 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9338 AC_MSG_CHECKING([which icu to use])
9339 if test "$with_system_icu" = "yes"; then
9340 AC_MSG_RESULT([external])
9343 AC_MSG_CHECKING([for unicode/rbbi.h])
9344 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
9347 if test "$cross_compiling" != "yes"; then
9348 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9349 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9350 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9351 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9354 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9355 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9356 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9357 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9358 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9359 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9360 AC_MSG_RESULT([yes])
9363 if test "$with_system_icu_for_build" != "force"; then
9364 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9365 You can use --with-system-icu-for-build=force to use it anyway.])
9370 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9371 # using the system icu tools can lead to version confusion, use the
9372 # ones from the build environment when cross-compiling
9373 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9374 if test -z "$SYSTEM_GENBRK"; then
9375 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9377 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9378 if test -z "$SYSTEM_GENCCODE"; then
9379 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9381 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9382 if test -z "$SYSTEM_GENCMN"; then
9383 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9385 if test "$ICU_MAJOR" -ge "49"; then
9386 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9387 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9388 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9390 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9391 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9392 ICU_RECLASSIFIED_HEBREW_LETTER=
9396 if test "$cross_compiling" = "yes"; then
9397 if test "$ICU_MAJOR" -ge "50"; then
9398 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9403 AC_MSG_RESULT([internal])
9405 BUILD_TYPE="$BUILD_TYPE ICU"
9406 # surprisingly set these only for "internal" (to be used by various other
9407 # external libs): the system icu-config is quite unhelpful and spits out
9408 # dozens of weird flags and also default path -I/usr/include
9409 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9410 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9412 if test "$ICU_MAJOR" -ge "59"; then
9413 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9414 # with -std=c++11 but not all external libraries can be built with that,
9415 # for those use a bit-compatible typedef uint16_t UChar; see
9416 # icu/source/common/unicode/umachine.h
9417 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9421 AC_SUBST(SYSTEM_ICU)
9422 AC_SUBST(SYSTEM_GENBRK)
9423 AC_SUBST(SYSTEM_GENCCODE)
9424 AC_SUBST(SYSTEM_GENCMN)
9427 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9428 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9429 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9430 AC_SUBST(ICU_CFLAGS)
9432 AC_SUBST(ICU_UCHAR_TYPE)
9434 dnl ==================================================================
9436 dnl ==================================================================
9437 AC_MSG_CHECKING([whether to enable breakpad])
9438 if test "$enable_breakpad" != yes; then
9441 AC_MSG_RESULT([yes])
9442 ENABLE_BREAKPAD="TRUE"
9443 AC_DEFINE(ENABLE_BREAKPAD)
9444 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9445 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9447 AC_MSG_CHECKING([for crashreport config])
9448 if test "$with_symbol_config" = "no"; then
9449 BREAKPAD_SYMBOL_CONFIG="invalid"
9452 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9453 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9454 AC_MSG_RESULT([yes])
9456 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9458 AC_SUBST(ENABLE_BREAKPAD)
9460 dnl ==================================================================
9462 dnl ==================================================================
9463 AC_MSG_CHECKING([whether to enable fuzzers])
9464 if test "$enable_fuzzers" != yes; then
9467 AC_MSG_RESULT([yes])
9468 ENABLE_FUZZERS="TRUE"
9469 AC_DEFINE([ENABLE_FUZZERS],1)
9470 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9472 AC_SUBST(ENABLE_FUZZERS)
9474 dnl ===================================================================
9476 dnl ===================================================================
9477 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.14 >= 0.14.0])
9478 if test "$with_system_orcus" != "yes"; then
9479 if test "$SYSTEM_BOOST" = "TRUE"; then
9480 # ===========================================================
9481 # Determine if we are going to need to link with Boost.System
9482 # ===========================================================
9483 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9484 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9485 dnl in documentation has no effect.
9486 AC_MSG_CHECKING([if we need to link with Boost.System])
9488 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9489 @%:@include <boost/version.hpp>
9491 #if BOOST_VERSION >= 105000
9492 # error yes, we need to link with Boost.System
9497 AC_MSG_RESULT([yes])
9503 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9504 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9505 AC_SUBST([BOOST_SYSTEM_LIB])
9506 AC_SUBST(SYSTEM_LIBORCUS)
9508 dnl ===================================================================
9510 dnl ===================================================================
9511 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9512 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9513 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9515 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9516 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9517 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9519 if test "$COM" = "MSC"; then # override the above
9520 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9521 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9524 if test "$with_system_harfbuzz" = "yes"; then
9525 if test "$with_system_graphite" = "no"; then
9526 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9528 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9530 _save_cflags="$CFLAGS"
9531 LIBS="$LIBS $HARFBUZZ_LIBS"
9532 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9533 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9535 CFLAGS="$_save_cflags"
9537 if test "$with_system_graphite" = "yes"; then
9538 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9542 AC_MSG_CHECKING([whether to use X11])
9543 dnl ***************************************
9544 dnl testing for X libraries and includes...
9545 dnl ***************************************
9546 if test "$USING_X11" = TRUE; then
9547 AC_DEFINE(HAVE_FEATURE_X11)
9549 AC_MSG_RESULT([$USING_X11])
9551 if test "$USING_X11" = TRUE; then
9554 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9556 if test -z "$x_includes"; then
9557 x_includes="default_x_includes"
9559 if test -z "$x_libraries"; then
9560 x_libraries="default_x_libraries"
9562 CFLAGS="$CFLAGS $X_CFLAGS"
9563 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9564 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9566 x_includes="no_x_includes"
9567 x_libraries="no_x_libraries"
9570 if test "$USING_X11" = TRUE; then
9571 dnl ===================================================================
9572 dnl Check for extension headers
9573 dnl ===================================================================
9574 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9575 [#include <X11/extensions/shape.h>])
9577 # vcl needs ICE and SM
9578 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9579 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9580 [AC_MSG_ERROR(ICE library not found)])
9581 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9582 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9583 [AC_MSG_ERROR(SM library not found)])
9586 dnl ===================================================================
9587 dnl Check for system Xrender
9588 dnl ===================================================================
9589 AC_MSG_CHECKING([whether to use Xrender])
9590 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9591 AC_MSG_RESULT([yes])
9592 PKG_CHECK_MODULES(XRENDER, xrender)
9593 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9594 FilterLibs "${XRENDER_LIBS}"
9595 XRENDER_LIBS="${filteredlibs}"
9596 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9597 [AC_MSG_ERROR(libXrender not found or functional)], [])
9598 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9599 [AC_MSG_ERROR(Xrender not found. install X)], [])
9603 AC_SUBST(XRENDER_CFLAGS)
9604 AC_SUBST(XRENDER_LIBS)
9606 dnl ===================================================================
9607 dnl Check for XRandr
9608 dnl ===================================================================
9609 AC_MSG_CHECKING([whether to enable RandR support])
9610 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9611 AC_MSG_RESULT([yes])
9612 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9613 if test "$ENABLE_RANDR" != "TRUE"; then
9614 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9615 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9617 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9618 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9619 XRANDR_LIBS="-lXrandr "
9622 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9623 FilterLibs "${XRANDR_LIBS}"
9624 XRANDR_LIBS="${filteredlibs}"
9629 AC_SUBST(XRANDR_CFLAGS)
9630 AC_SUBST(XRANDR_LIBS)
9631 AC_SUBST(ENABLE_RANDR)
9633 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9636 if test $_os = iOS -o $_os = Android; then
9639 AC_MSG_CHECKING([for webdav library])
9640 case "$WITH_WEBDAV" in
9642 AC_MSG_RESULT([serf])
9643 # Check for system apr-util
9644 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9645 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9646 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9647 if test "$COM" = "MSC"; then
9649 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9650 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9653 # Check for system serf
9654 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9655 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9656 if test "$COM" = "MSC"; then
9657 SERF_LIB_DIR="Release"
9658 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9659 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9663 AC_MSG_RESULT([neon])
9664 # Check for system neon
9665 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9666 if test "$with_system_neon" = "yes"; then
9667 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9671 AC_SUBST(NEON_VERSION)
9674 AC_MSG_RESULT([none, disabled])
9678 AC_SUBST(WITH_WEBDAV)
9680 dnl ===================================================================
9681 dnl Check for disabling cve_tests
9682 dnl ===================================================================
9683 AC_MSG_CHECKING([whether to execute CVE tests])
9684 # If not explicitly enabled or disabled, default
9685 if test -z "$enable_cve_tests"; then
9688 # Default cves off for Windows with its wild and wonderful
9689 # variety of AV software kicking in and panicking
9694 enable_cve_tests=yes
9698 if test "$enable_cve_tests" = "no"; then
9700 DISABLE_CVE_TESTS=TRUE
9701 AC_SUBST(DISABLE_CVE_TESTS)
9703 AC_MSG_RESULT([yes])
9706 dnl ===================================================================
9707 dnl Check for enabling chart XShape tests
9708 dnl ===================================================================
9709 AC_MSG_CHECKING([whether to execute chart XShape tests])
9710 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
9711 AC_MSG_RESULT([yes])
9712 ENABLE_CHART_TESTS=TRUE
9713 AC_SUBST(ENABLE_CHART_TESTS)
9718 dnl ===================================================================
9719 dnl Check for system openssl
9720 dnl ===================================================================
9722 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9723 if test "$enable_openssl" = "yes"; then
9725 if test "$_os" = Darwin ; then
9726 # OpenSSL is deprecated when building for 10.7 or later.
9728 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9729 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9731 with_system_openssl=no
9732 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9733 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9734 && test "$with_system_openssl" != "no"; then
9735 with_system_openssl=yes
9738 OPENSSL_LIBS="-lssl -lcrypto"
9740 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9742 if test "$with_system_openssl" = "yes"; then
9743 AC_MSG_CHECKING([whether openssl supports SHA512])
9745 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9747 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9751 AC_MSG_RESULT([yes])
9752 DISABLE_OPENSSL=TRUE
9754 # warn that although OpenSSL is disabled, system libraries may depend on it
9755 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9756 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9759 AC_SUBST([DISABLE_OPENSSL])
9761 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
9762 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
9763 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
9764 enable_cipher_openssl_backend=no
9766 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
9769 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
9770 ENABLE_CIPHER_OPENSSL_BACKEND=
9771 if test "$enable_cipher_openssl_backend" = yes; then
9772 AC_MSG_RESULT([yes])
9773 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
9777 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
9779 dnl ===================================================================
9780 dnl Check for building gnutls
9781 dnl ===================================================================
9782 AC_MSG_CHECKING([whether to use gnutls])
9783 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
9784 AC_MSG_RESULT([yes])
9786 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9787 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9788 available in the system to use as replacement.]]))
9789 FilterLibs "${LIBGCRYPT_LIBS}"
9790 LIBGCRYPT_LIBS="${filteredlibs}"
9795 AC_SUBST([LIBGCRYPT_CFLAGS])
9796 AC_SUBST([LIBGCRYPT_LIBS])
9798 dnl ===================================================================
9799 dnl Check for system redland
9800 dnl ===================================================================
9801 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9802 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9803 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9804 if test "$with_system_redland" = "yes"; then
9805 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9806 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9812 AC_SUBST(RAPTOR_MAJOR)
9813 AC_SUBST(RASQAL_MAJOR)
9814 AC_SUBST(REDLAND_MAJOR)
9816 dnl ===================================================================
9817 dnl Check for system hunspell
9818 dnl ===================================================================
9819 AC_MSG_CHECKING([which libhunspell to use])
9820 if test "$with_system_hunspell" = "yes"; then
9821 AC_MSG_RESULT([external])
9822 SYSTEM_HUNSPELL=TRUE
9824 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9825 if test "$HUNSPELL_PC" != "TRUE"; then
9826 AC_CHECK_HEADER(hunspell.hxx, [],
9828 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9829 [AC_MSG_ERROR(hunspell headers not found.)], [])
9831 AC_CHECK_LIB([hunspell], [main], [:],
9832 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9833 HUNSPELL_LIBS=-lhunspell
9836 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9837 FilterLibs "${HUNSPELL_LIBS}"
9838 HUNSPELL_LIBS="${filteredlibs}"
9840 AC_MSG_RESULT([internal])
9842 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9843 if test "$COM" = "MSC"; then
9844 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9846 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
9848 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9850 AC_SUBST(SYSTEM_HUNSPELL)
9851 AC_SUBST(HUNSPELL_CFLAGS)
9852 AC_SUBST(HUNSPELL_LIBS)
9854 dnl ===================================================================
9855 dnl Checking for altlinuxhyph
9856 dnl ===================================================================
9857 AC_MSG_CHECKING([which altlinuxhyph to use])
9858 if test "$with_system_altlinuxhyph" = "yes"; then
9859 AC_MSG_RESULT([external])
9861 AC_CHECK_HEADER(hyphen.h, [],
9862 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9863 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9864 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9865 [#include <hyphen.h>])
9866 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9867 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9868 if test -z "$HYPHEN_LIB"; then
9869 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9870 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9872 if test -z "$HYPHEN_LIB"; then
9873 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9874 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9877 AC_MSG_RESULT([internal])
9879 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9880 if test "$COM" = "MSC"; then
9881 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9883 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9886 AC_SUBST(SYSTEM_HYPH)
9887 AC_SUBST(HYPHEN_LIB)
9889 dnl ===================================================================
9890 dnl Checking for mythes
9891 dnl ===================================================================
9892 AC_MSG_CHECKING([which mythes to use])
9893 if test "$with_system_mythes" = "yes"; then
9894 AC_MSG_RESULT([external])
9897 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9898 if test "$MYTHES_PKGCONFIG" = "no"; then
9899 AC_CHECK_HEADER(mythes.hxx, [],
9900 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9901 AC_CHECK_LIB([mythes-1.2], [main], [:],
9902 [ MYTHES_FOUND=no], [])
9903 if test "$MYTHES_FOUND" = "no"; then
9904 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9905 [ MYTHES_FOUND=no], [])
9907 if test "$MYTHES_FOUND" = "no"; then
9908 AC_MSG_ERROR([mythes library not found!.])
9912 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9913 FilterLibs "${MYTHES_LIBS}"
9914 MYTHES_LIBS="${filteredlibs}"
9916 AC_MSG_RESULT([internal])
9918 BUILD_TYPE="$BUILD_TYPE MYTHES"
9919 if test "$COM" = "MSC"; then
9920 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9922 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9925 AC_SUBST(SYSTEM_MYTHES)
9926 AC_SUBST(MYTHES_CFLAGS)
9927 AC_SUBST(MYTHES_LIBS)
9929 dnl ===================================================================
9930 dnl How should we build the linear programming solver ?
9931 dnl ===================================================================
9934 AC_MSG_CHECKING([whether to build with CoinMP])
9935 if test "$enable_coinmp" != "no"; then
9937 AC_MSG_RESULT([yes])
9938 if test "$with_system_coinmp" = "yes"; then
9940 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
9941 FilterLibs "${COINMP_LIBS}"
9942 COINMP_LIBS="${filteredlibs}"
9944 BUILD_TYPE="$BUILD_TYPE COINMP"
9949 AC_SUBST(ENABLE_COINMP)
9950 AC_SUBST(SYSTEM_COINMP)
9951 AC_SUBST(COINMP_CFLAGS)
9952 AC_SUBST(COINMP_LIBS)
9955 AC_MSG_CHECKING([whether to build with lpsolve])
9956 if test "$enable_lpsolve" != "no"; then
9958 AC_MSG_RESULT([yes])
9962 AC_SUBST(ENABLE_LPSOLVE)
9964 if test "$ENABLE_LPSOLVE" = TRUE; then
9965 AC_MSG_CHECKING([which lpsolve to use])
9966 if test "$with_system_lpsolve" = "yes"; then
9967 AC_MSG_RESULT([external])
9969 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9970 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9972 # some systems need this. Like Ubuntu....
9973 AC_CHECK_LIB(m, floor)
9974 AC_CHECK_LIB(dl, dlopen)
9975 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9976 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9979 AC_MSG_RESULT([internal])
9981 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9984 AC_SUBST(SYSTEM_LPSOLVE)
9986 dnl ===================================================================
9987 dnl Checking for libexttextcat
9988 dnl ===================================================================
9989 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
9990 if test "$with_system_libexttextcat" = "yes"; then
9991 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9993 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9995 dnl ===================================================================
9996 dnl Checking for libnumbertext
9997 dnl ===================================================================
9998 AC_MSG_CHECKING([whether to use libnumbertext])
9999 if test "$enable_libnumbertext" = "no"; then
10000 AC_MSG_RESULT([no])
10001 ENABLE_LIBNUMBERTEXT=
10002 SYSTEM_LIBNUMBERTEXT=
10004 AC_MSG_RESULT([yes])
10005 ENABLE_LIBNUMBERTEXT=TRUE
10006 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
10007 if test "$with_system_libnumbertext" = "yes"; then
10008 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
10009 SYSTEM_LIBNUMBERTEXT=YES
10011 SYSTEM_LIBNUMBERTEXT=
10012 AC_LANG_PUSH([C++])
10013 save_CPPFLAGS=$CPPFLAGS
10014 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
10015 AC_CHECK_HEADERS([codecvt regex])
10016 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
10017 [ ENABLE_LIBNUMBERTEXT=''
10018 LIBNUMBERTEXT_CFLAGS=''
10019 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
10020 Enable libnumbertext fallback (missing number to number name conversion).])
10022 CPPFLAGS=$save_CPPFLAGS
10025 if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
10026 AC_DEFINE(ENABLE_LIBNUMBERTEXT)
10029 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
10030 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
10031 AC_SUBST(ENABLE_LIBNUMBERTEXT)
10032 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
10034 dnl ***************************************
10035 dnl testing libc version for Linux...
10036 dnl ***************************************
10037 if test "$_os" = "Linux"; then
10038 AC_MSG_CHECKING([whether libc is >= 2.1.1])
10039 exec 6>/dev/null # no output
10040 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
10041 exec 6>&1 # output on again
10042 if test "$HAVE_LIBC"; then
10043 AC_MSG_RESULT([yes])
10045 AC_MSG_ERROR([no, upgrade libc])
10049 dnl =========================================
10050 dnl Check for uuidgen
10051 dnl =========================================
10052 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
10053 # presence is already tested above in the WINDOWS_SDK_HOME check
10054 UUIDGEN=uuidgen.exe
10057 AC_PATH_PROG([UUIDGEN], [uuidgen])
10058 if test -z "$UUIDGEN"; then
10059 AC_MSG_WARN([uuid is needed for building installation sets])
10063 dnl ***************************************
10064 dnl Checking for bison and flex
10065 dnl ***************************************
10066 AC_PATH_PROG(BISON, bison)
10067 if test -z "$BISON"; then
10068 AC_MSG_ERROR([no bison found in \$PATH, install it])
10070 AC_MSG_CHECKING([the bison version])
10071 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
10072 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
10073 # Accept newer than 2.0
10074 if test "$_bison_longver" -lt 2000; then
10075 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
10079 AC_PATH_PROG(FLEX, flex)
10080 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10081 FLEX=`cygpath -m $FLEX`
10083 if test -z "$FLEX"; then
10084 AC_MSG_ERROR([no flex found in \$PATH, install it])
10086 AC_MSG_CHECKING([the flex version])
10087 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
10088 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2006000; then
10089 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.6.0)])
10093 dnl ***************************************
10094 dnl Checking for patch
10095 dnl ***************************************
10096 AC_PATH_PROG(PATCH, patch)
10097 if test -z "$PATCH"; then
10098 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
10101 dnl On Solaris, FreeBSD or macOS, check if --with-gnu-patch was used
10102 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
10103 if test -z "$with_gnu_patch"; then
10106 if test -x "$with_gnu_patch"; then
10107 GNUPATCH=$with_gnu_patch
10109 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
10113 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
10114 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
10115 AC_MSG_RESULT([yes])
10117 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
10123 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10124 GNUPATCH=`cygpath -m $GNUPATCH`
10127 dnl We also need to check for --with-gnu-cp
10129 if test -z "$with_gnu_cp"; then
10130 # check the place where the good stuff is hidden on Solaris...
10131 if test -x /usr/gnu/bin/cp; then
10132 GNUCP=/usr/gnu/bin/cp
10134 AC_PATH_PROGS(GNUCP, gnucp cp)
10136 if test -z $GNUCP; then
10137 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
10140 if test -x "$with_gnu_cp"; then
10143 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
10147 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10148 GNUCP=`cygpath -m $GNUCP`
10151 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
10152 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
10153 AC_MSG_RESULT([yes])
10154 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
10155 AC_MSG_RESULT([yes])
10157 case "$build_os" in
10158 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
10161 AC_MSG_RESULT([no gnucp found - using the system's cp command])
10164 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
10173 dnl ***************************************
10174 dnl testing assembler path
10175 dnl ***************************************
10177 if test "$_os" = "WINNT"; then
10178 if test "$BITNESS_OVERRIDE" = ""; then
10180 assembler_bin=$CL_DIR
10183 assembler_bin=$CL_DIR
10186 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
10187 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
10188 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
10189 AC_MSG_RESULT([found])
10190 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
10192 AC_MSG_ERROR([Configure did not find $assembler assembler.])
10195 PathFormat "$ASM_HOME"
10196 ASM_HOME="$formatted_path"
10203 dnl ===================================================================
10204 dnl We need zip and unzip
10205 dnl ===================================================================
10206 AC_PATH_PROG(ZIP, zip)
10207 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10208 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10209 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],,)
10212 AC_PATH_PROG(UNZIP, unzip)
10213 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10215 dnl ===================================================================
10216 dnl Zip must be a specific type for different build types.
10217 dnl ===================================================================
10218 if test $build_os = cygwin; then
10219 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10220 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10224 dnl ===================================================================
10225 dnl We need touch with -h option support.
10226 dnl ===================================================================
10227 AC_PATH_PROG(TOUCH, touch)
10228 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10230 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10231 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],,)
10234 dnl ===================================================================
10235 dnl Check for system epoxy
10236 dnl ===================================================================
10237 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
10239 dnl ===================================================================
10240 dnl Set vcl option: coordinate device in double or sal_Int32
10241 dnl ===================================================================
10243 dnl disabled for now, we don't want subtle differences between OSs
10244 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10245 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
10246 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10247 dnl AC_MSG_RESULT([double])
10249 dnl AC_MSG_RESULT([sal_Int32])
10252 dnl ===================================================================
10253 dnl Test which vclplugs have to be built.
10254 dnl ===================================================================
10256 if test "$USING_X11" != TRUE; then
10263 if test "x$enable_gtk3" = "xyes"; then
10264 if test "$with_system_cairo" = no; then
10265 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10267 : ${with_system_cairo:=yes}
10268 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="")
10269 if test "x$ENABLE_GTK3" = "xTRUE"; then
10271 dnl Avoid installed by unpackaged files for now.
10272 if test -z "$PKGFORMAT"; then
10273 GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
10276 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10278 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10279 FilterLibs "${GTK3_LIBS}"
10280 GTK3_LIBS="${filteredlibs}"
10282 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10283 if test "$with_system_epoxy" != "yes"; then
10284 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10285 AC_CHECK_HEADER(EGL/eglplatform.h, [],
10286 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10289 AC_SUBST(GTK3_LIBS)
10290 AC_SUBST(GTK3_CFLAGS)
10291 AC_SUBST(ENABLE_GTK3)
10294 if test "x$enable_gtk" = "xyes"; then
10295 if test "$with_system_cairo" = no; then
10296 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10298 : ${with_system_cairo:=yes}
10300 AC_DEFINE(ENABLE_GTK)
10303 AC_SUBST(ENABLE_GTK)
10306 if test "x$enable_qt5" = "xyes"; then
10308 AC_DEFINE(ENABLE_QT5)
10311 AC_SUBST(ENABLE_QT5)
10314 if test "x$enable_kde5" = "xyes"; then
10316 AC_DEFINE(ENABLE_KDE5)
10319 AC_SUBST(ENABLE_KDE5)
10321 ENABLE_GTK3_KDE5=""
10322 if test "x$enable_gtk3_kde5" = "xyes"; then
10323 ENABLE_GTK3_KDE5="TRUE"
10324 AC_DEFINE(ENABLE_GTK3_KDE5)
10327 AC_SUBST(ENABLE_GTK3_KDE5)
10329 build_vcl_plugins="$R"
10330 if test -z "$build_vcl_plugins"; then
10331 build_vcl_plugins="none"
10333 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10335 dnl ===================================================================
10336 dnl check for dbus support
10337 dnl ===================================================================
10341 DBUS_GLIB_CFLAGS=""
10345 if test "$enable_dbus" = "no"; then
10349 AC_MSG_CHECKING([whether to enable DBUS support])
10350 if test "$test_dbus" = "yes"; then
10352 AC_MSG_RESULT([yes])
10353 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10354 AC_DEFINE(ENABLE_DBUS)
10355 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10356 FilterLibs "${DBUS_LIBS}"
10357 DBUS_LIBS="${filteredlibs}"
10359 # Glib is needed for BluetoothServer
10360 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10361 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10363 DBUS_HAVE_GLIB="TRUE"
10364 AC_DEFINE(DBUS_HAVE_GLIB,1)
10366 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10369 AC_MSG_RESULT([no])
10372 AC_SUBST(ENABLE_DBUS)
10373 AC_SUBST(DBUS_CFLAGS)
10374 AC_SUBST(DBUS_LIBS)
10375 AC_SUBST(DBUS_GLIB_CFLAGS)
10376 AC_SUBST(DBUS_GLIB_LIBS)
10377 AC_SUBST(DBUS_HAVE_GLIB)
10379 AC_MSG_CHECKING([whether to enable Impress remote control])
10380 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10381 AC_MSG_RESULT([yes])
10382 ENABLE_SDREMOTE=TRUE
10383 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10385 # If not explicitly enabled or disabled, default
10386 if test -z "$enable_sdremote_bluetooth"; then
10389 # Default to yes for these
10390 enable_sdremote_bluetooth=yes
10394 enable_sdremote_bluetooth=no
10398 # $enable_sdremote_bluetooth is guaranteed non-empty now
10400 if test "$enable_sdremote_bluetooth" != "no"; then
10401 if test "$OS" = "LINUX"; then
10402 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10403 AC_MSG_RESULT([yes])
10404 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10405 dnl ===================================================================
10406 dnl Check for system bluez
10407 dnl ===================================================================
10408 AC_MSG_CHECKING([which Bluetooth header to use])
10409 if test "$with_system_bluez" = "yes"; then
10410 AC_MSG_RESULT([external])
10411 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10412 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10415 AC_MSG_RESULT([internal])
10419 AC_MSG_RESULT([no, dbus disabled])
10420 ENABLE_SDREMOTE_BLUETOOTH=
10424 AC_MSG_RESULT([yes])
10425 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10429 AC_MSG_RESULT([no])
10430 ENABLE_SDREMOTE_BLUETOOTH=
10436 AC_MSG_RESULT([no])
10438 AC_SUBST(ENABLE_SDREMOTE)
10439 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10440 AC_SUBST(SYSTEM_BLUEZ)
10442 dnl ===================================================================
10443 dnl Check whether the gtk 2.0 libraries are available.
10444 dnl ===================================================================
10448 if test "$test_gtk" = "yes"; then
10450 if test "$ENABLE_GTK" = "TRUE"; then
10451 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0 gdk-pixbuf-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
10452 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10453 FilterLibs "${GTK_LIBS}"
10454 GTK_LIBS="${filteredlibs}"
10455 PKG_CHECK_MODULES(GTHREAD, gthread-2.0,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
10456 BUILD_TYPE="$BUILD_TYPE GTK"
10457 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10458 FilterLibs "${GTHREAD_LIBS}"
10459 GTHREAD_LIBS="${filteredlibs}"
10461 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10462 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10463 [ENABLE_GTK_PRINT="TRUE"],
10464 [ENABLE_GTK_PRINT=""])
10465 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10466 FilterLibs "${GTK_PRINT_LIBS}"
10467 GTK_PRINT_LIBS="${filteredlibs}"
10470 if test "$ENABLE_GTK" = "TRUE" || test "$ENABLE_GTK3" = "TRUE"; then
10471 AC_MSG_CHECKING([whether to enable GIO support])
10472 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10473 dnl Need at least 2.26 for the dbus support.
10474 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10475 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10476 if test "$ENABLE_GIO" = "TRUE"; then
10477 AC_DEFINE(ENABLE_GIO)
10478 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10479 FilterLibs "${GIO_LIBS}"
10480 GIO_LIBS="${filteredlibs}"
10483 AC_MSG_RESULT([no])
10487 AC_SUBST(ENABLE_GIO)
10488 AC_SUBST(GIO_CFLAGS)
10490 AC_SUBST(GTK_CFLAGS)
10492 AC_SUBST(GTHREAD_CFLAGS)
10493 AC_SUBST(GTHREAD_LIBS)
10494 AC_SUBST([ENABLE_GTK_PRINT])
10495 AC_SUBST([GTK_PRINT_CFLAGS])
10496 AC_SUBST([GTK_PRINT_LIBS])
10499 dnl ===================================================================
10501 SPLIT_APP_MODULES=""
10502 if test "$enable_split_app_modules" = "yes"; then
10503 SPLIT_APP_MODULES="TRUE"
10505 AC_SUBST(SPLIT_APP_MODULES)
10507 SPLIT_OPT_FEATURES=""
10508 if test "$enable_split_opt_features" = "yes"; then
10509 SPLIT_OPT_FEATURES="TRUE"
10511 AC_SUBST(SPLIT_OPT_FEATURES)
10513 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10514 if test "$enable_cairo_canvas" = yes; then
10515 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10517 enable_cairo_canvas=no
10518 elif test -z "$enable_cairo_canvas"; then
10519 enable_cairo_canvas=yes
10522 ENABLE_CAIRO_CANVAS=""
10523 if test "$enable_cairo_canvas" = "yes"; then
10525 ENABLE_CAIRO_CANVAS="TRUE"
10526 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10528 AC_SUBST(ENABLE_CAIRO_CANVAS)
10530 dnl ===================================================================
10531 dnl Check whether the GStreamer libraries are available.
10532 dnl It's possible to build avmedia with both GStreamer backends!
10533 dnl ===================================================================
10535 ENABLE_GSTREAMER_1_0=""
10537 if test "$build_gstreamer_1_0" = "yes"; then
10539 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10540 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10541 ENABLE_GSTREAMER_1_0="TRUE"
10542 AC_MSG_RESULT([yes])
10543 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10544 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10545 FilterLibs "${GSTREAMER_1_0_LIBS}"
10546 GSTREAMER_1_0_LIBS="${filteredlibs}"
10548 AC_MSG_RESULT([no])
10551 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10552 AC_SUBST(GSTREAMER_1_0_LIBS)
10553 AC_SUBST(ENABLE_GSTREAMER_1_0)
10556 ENABLE_GSTREAMER_0_10=""
10557 if test "$build_gstreamer_0_10" = "yes"; then
10559 AC_MSG_CHECKING([whether to enable the GStreamer 0.10 avmedia backend])
10560 if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10561 ENABLE_GSTREAMER_0_10="TRUE"
10562 AC_MSG_RESULT([yes])
10563 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10],, [
10564 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10] )
10566 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10567 FilterLibs "${GSTREAMER_0_10_LIBS}"
10568 GSTREAMER_0_10_LIBS="${filteredlibs}"
10570 AC_MSG_RESULT([no])
10574 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10575 AC_SUBST(GSTREAMER_0_10_LIBS)
10576 AC_SUBST(ENABLE_GSTREAMER_0_10)
10578 dnl ===================================================================
10579 dnl Check whether to build the VLC avmedia backend
10580 dnl ===================================================================
10584 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10585 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10587 AC_MSG_RESULT([yes])
10589 AC_MSG_RESULT([no])
10591 AC_SUBST(ENABLE_VLC)
10593 ENABLE_OPENGL_TRANSITIONS=
10594 ENABLE_OPENGL_CANVAS=
10595 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10597 elif test "$_os" = "Darwin"; then
10598 # We use frameworks on macOS, no need for detail checks
10599 ENABLE_OPENGL_TRANSITIONS=TRUE
10600 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10601 ENABLE_OPENGL_CANVAS=TRUE
10602 elif test $_os = WINNT; then
10603 ENABLE_OPENGL_TRANSITIONS=TRUE
10604 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10605 ENABLE_OPENGL_CANVAS=TRUE
10607 if test "$USING_X11" = TRUE; then
10608 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10609 ENABLE_OPENGL_TRANSITIONS=TRUE
10610 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10611 ENABLE_OPENGL_CANVAS=TRUE
10615 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10616 AC_SUBST(ENABLE_OPENGL_CANVAS)
10618 dnl =================================================
10619 dnl Check whether to build with OpenCL support.
10620 dnl =================================================
10622 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10623 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10624 # platform (optional at run-time, used through clew).
10625 BUILD_TYPE="$BUILD_TYPE OPENCL"
10626 AC_DEFINE(HAVE_FEATURE_OPENCL)
10629 dnl =================================================
10630 dnl Check whether to build with dconf support.
10631 dnl =================================================
10633 if test $_os != Android -a $_os != iOS -a "$enable_dconf" != no; then
10634 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10635 if test "$enable_dconf" = yes; then
10636 AC_MSG_ERROR([dconf not found])
10641 AC_MSG_CHECKING([whether to enable dconf])
10642 if test $_os = Android -o $_os = iOS -o "$enable_dconf" = no; then
10646 AC_MSG_RESULT([no])
10649 AC_DEFINE(ENABLE_DCONF)
10650 AC_MSG_RESULT([yes])
10652 AC_SUBST([DCONF_CFLAGS])
10653 AC_SUBST([DCONF_LIBS])
10654 AC_SUBST([ENABLE_DCONF])
10657 AC_MSG_CHECKING([whether to build the PDF import feature])
10659 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10660 AC_MSG_RESULT([yes])
10661 ENABLE_PDFIMPORT=TRUE
10662 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10664 AC_MSG_RESULT([no])
10668 AC_MSG_CHECKING([whether to build PDFium])
10670 if test \( -z "$enable_pdfium" -a "$ENABLE_PDFIMPORT" == "TRUE" \) -o "$enable_pdfium" = yes; then
10671 AC_MSG_RESULT([yes])
10673 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10674 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10676 AC_MSG_RESULT([no])
10678 AC_SUBST(ENABLE_PDFIUM)
10680 dnl ===================================================================
10681 dnl Check for poppler
10682 dnl ===================================================================
10684 AC_MSG_CHECKING([whether to build Poppler])
10685 if test \( -z "$enable_poppler" -a "$ENABLE_PDFIMPORT" == "TRUE" \) -o "$enable_poppler" = yes; then
10686 AC_MSG_RESULT([yes])
10687 ENABLE_POPPLER=TRUE
10688 AC_DEFINE(HAVE_FEATURE_POPPLER)
10690 AC_MSG_RESULT([no])
10692 AC_SUBST(ENABLE_POPPLER)
10694 if test "$ENABLE_PDFIMPORT" == "TRUE" -a "$ENABLE_POPPLER" != "TRUE" -a "$ENABLE_PDFIUM" != "TRUE"; then
10695 AC_MSG_ERROR([Cannot import PDF without either Pdfium or Poppler; please enable either of them.])
10698 if test "$ENABLE_PDFIMPORT" != "TRUE" -a \( "$ENABLE_POPPLER" == "TRUE" -o "$ENABLE_PDFIUM" == "TRUE" \); then
10699 AC_MSG_ERROR([Cannot enable Pdfium or Poppler when PDF importing is disabled; please enable PDF import first.])
10702 if test "$ENABLE_PDFIMPORT" == "TRUE" -a "$ENABLE_POPPLER" == "TRUE"; then
10703 dnl ===================================================================
10704 dnl Check for system poppler
10705 dnl ===================================================================
10706 AC_MSG_CHECKING([which PDF import poppler to use])
10707 if test "$with_system_poppler" = "yes"; then
10708 AC_MSG_RESULT([external])
10709 SYSTEM_POPPLER=TRUE
10710 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10711 AC_LANG_PUSH([C++])
10712 save_CXXFLAGS=$CXXFLAGS
10713 save_CPPFLAGS=$CPPFLAGS
10714 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10715 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10716 AC_CHECK_HEADER([cpp/poppler-version.h],
10717 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10719 CXXFLAGS=$save_CXXFLAGS
10720 CPPFLAGS=$save_CPPFLAGS
10722 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10724 FilterLibs "${POPPLER_LIBS}"
10725 POPPLER_LIBS="${filteredlibs}"
10727 AC_MSG_RESULT([internal])
10729 BUILD_TYPE="$BUILD_TYPE POPPLER"
10730 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10732 AC_DEFINE([ENABLE_PDFIMPORT],1)
10734 AC_SUBST(ENABLE_PDFIMPORT)
10735 AC_SUBST(SYSTEM_POPPLER)
10736 AC_SUBST(POPPLER_CFLAGS)
10737 AC_SUBST(POPPLER_LIBS)
10741 if test "$build_for_ios" = "YES"; then
10742 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
10743 AC_MSG_RESULT([yes])
10744 elif test "$enable_mpl_subset" = "yes"; then
10745 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
10746 AC_MSG_RESULT([yes])
10747 elif test "$enable_fuzzers" = "yes"; then
10748 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
10749 AC_MSG_RESULT([yes])
10750 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
10751 dnl ===================================================================
10752 dnl Check for system gpgme
10753 dnl ===================================================================
10754 AC_MSG_CHECKING([which gpgmepp to use])
10755 if test "$with_system_gpgmepp" = "yes"; then
10756 AC_MSG_RESULT([external])
10757 SYSTEM_GPGMEPP=TRUE
10759 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
10760 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
10761 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
10762 # progress_callback is the only func with plain C linkage
10763 # checking for it also filters out older, KDE-dependent libgpgmepp versions
10764 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
10765 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
10766 AC_CHECK_HEADER(gpgme.h, [],
10767 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
10769 AC_MSG_RESULT([internal])
10770 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
10771 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
10773 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
10774 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
10775 if test "$_os" != "WINNT"; then
10776 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
10777 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
10778 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
10779 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
10782 ENABLE_GPGMEPP=TRUE
10783 AC_DEFINE([HAVE_FEATURE_GPGME])
10784 AC_PATH_PROG(GPG, gpg)
10785 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
10786 # so let's exclude that manually for the moment
10787 if test -n "$GPG" -a "$_os" != "WINNT"; then
10788 # make sure we not only have a working gpgme, but a full working
10789 # gpg installation to run OpenPGP signature verification
10790 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
10792 if test "$_os" = "Linux"; then
10794 AC_MSG_CHECKING([for /run/user/$uid])
10795 if test -d /run/user/$uid; then
10796 AC_MSG_RESULT([yes])
10797 AC_PATH_PROG(GPGCONF, gpgconf)
10799 # Older versions of gpgconf are not working as expected, since
10800 # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
10801 # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
10802 # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
10803 AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
10804 GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
10805 GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
10806 if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
10807 AC_MSG_RESULT([yes, $GPGCONF_VERSION])
10808 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
10809 if $GPGCONF --dump-options > /dev/null ; then
10810 if $GPGCONF --dump-options | grep -q create-socketdir ; then
10811 AC_MSG_RESULT([yes])
10812 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
10813 AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
10815 AC_MSG_RESULT([no])
10818 AC_MSG_RESULT([no. missing or broken gpgconf?])
10821 AC_MSG_RESULT([no, $GPGCONF_VERSION])
10824 AC_MSG_RESULT([no])
10828 AC_SUBST(ENABLE_GPGMEPP)
10829 AC_SUBST(SYSTEM_GPGMEPP)
10830 AC_SUBST(GPG_ERROR_CFLAGS)
10831 AC_SUBST(GPG_ERROR_LIBS)
10832 AC_SUBST(LIBASSUAN_CFLAGS)
10833 AC_SUBST(LIBASSUAN_LIBS)
10834 AC_SUBST(GPGMEPP_CFLAGS)
10835 AC_SUBST(GPGMEPP_LIBS)
10837 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10838 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10839 AC_MSG_RESULT([yes])
10840 ENABLE_MEDIAWIKI=TRUE
10841 BUILD_TYPE="$BUILD_TYPE XSLTML"
10842 if test "x$with_java" = "xno"; then
10843 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10846 AC_MSG_RESULT([no])
10848 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10850 AC_SUBST(ENABLE_MEDIAWIKI)
10852 AC_MSG_CHECKING([whether to build the Report Builder])
10853 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10854 AC_MSG_RESULT([yes])
10855 ENABLE_REPORTBUILDER=TRUE
10856 AC_MSG_CHECKING([which jfreereport libs to use])
10857 if test "$with_system_jfreereport" = "yes"; then
10858 SYSTEM_JFREEREPORT=TRUE
10859 AC_MSG_RESULT([external])
10860 if test -z $SAC_JAR; then
10861 SAC_JAR=/usr/share/java/sac.jar
10863 if ! test -f $SAC_JAR; then
10864 AC_MSG_ERROR(sac.jar not found.)
10867 if test -z $LIBXML_JAR; then
10868 if test -f /usr/share/java/libxml-1.0.0.jar; then
10869 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
10870 elif test -f /usr/share/java/libxml.jar; then
10871 LIBXML_JAR=/usr/share/java/libxml.jar
10873 AC_MSG_ERROR(libxml.jar replacement not found.)
10875 elif ! test -f $LIBXML_JAR; then
10876 AC_MSG_ERROR(libxml.jar not found.)
10879 if test -z $FLUTE_JAR; then
10880 if test -f/usr/share/java/flute-1.3.0.jar; then
10881 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
10882 elif test -f /usr/share/java/flute.jar; then
10883 FLUTE_JAR=/usr/share/java/flute.jar
10885 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
10887 elif ! test -f $FLUTE_JAR; then
10888 AC_MSG_ERROR(flute-1.3.0.jar not found.)
10891 if test -z $JFREEREPORT_JAR; then
10892 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
10893 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
10894 elif test -f /usr/share/java/flow-engine.jar; then
10895 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
10897 AC_MSG_ERROR(jfreereport.jar replacement not found.)
10899 elif ! test -f $JFREEREPORT_JAR; then
10900 AC_MSG_ERROR(jfreereport.jar not found.)
10903 if test -z $LIBLAYOUT_JAR; then
10904 if test -f /usr/share/java/liblayout-0.2.9.jar; then
10905 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
10906 elif test -f /usr/share/java/liblayout.jar; then
10907 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
10909 AC_MSG_ERROR(liblayout.jar replacement not found.)
10911 elif ! test -f $LIBLAYOUT_JAR; then
10912 AC_MSG_ERROR(liblayout.jar not found.)
10915 if test -z $LIBLOADER_JAR; then
10916 if test -f /usr/share/java/libloader-1.0.0.jar; then
10917 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
10918 elif test -f /usr/share/java/libloader.jar; then
10919 LIBLOADER_JAR=/usr/share/java/libloader.jar
10921 AC_MSG_ERROR(libloader.jar replacement not found.)
10923 elif ! test -f $LIBLOADER_JAR; then
10924 AC_MSG_ERROR(libloader.jar not found.)
10927 if test -z $LIBFORMULA_JAR; then
10928 if test -f /usr/share/java/libformula-0.2.0.jar; then
10929 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
10930 elif test -f /usr/share/java/libformula.jar; then
10931 LIBFORMULA_JAR=/usr/share/java/libformula.jar
10933 AC_MSG_ERROR(libformula.jar replacement not found.)
10935 elif ! test -f $LIBFORMULA_JAR; then
10936 AC_MSG_ERROR(libformula.jar not found.)
10939 if test -z $LIBREPOSITORY_JAR; then
10940 if test -f /usr/share/java/librepository-1.0.0.jar; then
10941 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
10942 elif test -f /usr/share/java/librepository.jar; then
10943 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
10945 AC_MSG_ERROR(librepository.jar replacement not found.)
10947 elif ! test -f $LIBREPOSITORY_JAR; then
10948 AC_MSG_ERROR(librepository.jar not found.)
10951 if test -z $LIBFONTS_JAR; then
10952 if test -f /usr/share/java/libfonts-1.0.0.jar; then
10953 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
10954 elif test -f /usr/share/java/libfonts.jar; then
10955 LIBFONTS_JAR=/usr/share/java/libfonts.jar
10957 AC_MSG_ERROR(libfonts.jar replacement not found.)
10959 elif ! test -f $LIBFONTS_JAR; then
10960 AC_MSG_ERROR(libfonts.jar not found.)
10963 if test -z $LIBSERIALIZER_JAR; then
10964 if test -f /usr/share/java/libserializer-1.0.0.jar; then
10965 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
10966 elif test -f /usr/share/java/libserializer.jar; then
10967 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
10969 AC_MSG_ERROR(libserializer.jar replacement not found.)
10971 elif ! test -f $LIBSERIALIZER_JAR; then
10972 AC_MSG_ERROR(libserializer.jar not found.)
10975 if test -z $LIBBASE_JAR; then
10976 if test -f /usr/share/java/libbase-1.0.0.jar; then
10977 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
10978 elif test -f /usr/share/java/libbase.jar; then
10979 LIBBASE_JAR=/usr/share/java/libbase.jar
10981 AC_MSG_ERROR(libbase.jar replacement not found.)
10983 elif ! test -f $LIBBASE_JAR; then
10984 AC_MSG_ERROR(libbase.jar not found.)
10988 AC_MSG_RESULT([internal])
10989 SYSTEM_JFREEREPORT=
10990 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10994 AC_MSG_RESULT([no])
10995 ENABLE_REPORTBUILDER=
10996 SYSTEM_JFREEREPORT=
10998 AC_SUBST(ENABLE_REPORTBUILDER)
10999 AC_SUBST(SYSTEM_JFREEREPORT)
11001 AC_SUBST(LIBXML_JAR)
11002 AC_SUBST(FLUTE_JAR)
11003 AC_SUBST(JFREEREPORT_JAR)
11004 AC_SUBST(LIBBASE_JAR)
11005 AC_SUBST(LIBLAYOUT_JAR)
11006 AC_SUBST(LIBLOADER_JAR)
11007 AC_SUBST(LIBFORMULA_JAR)
11008 AC_SUBST(LIBREPOSITORY_JAR)
11009 AC_SUBST(LIBFONTS_JAR)
11010 AC_SUBST(LIBSERIALIZER_JAR)
11012 # this has to be here because both the Wiki Publisher and the SRB use
11014 COMMONS_LOGGING_VERSION=1.2
11015 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
11016 AC_MSG_CHECKING([which Apache commons-* libs to use])
11017 if test "$with_system_apache_commons" = "yes"; then
11018 SYSTEM_APACHE_COMMONS=TRUE
11019 AC_MSG_RESULT([external])
11020 if test -z $COMMONS_LOGGING_JAR; then
11021 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
11022 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
11023 elif test -f /usr/share/java/commons-logging.jar; then
11024 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
11026 AC_MSG_ERROR(commons-logging.jar replacement not found.)
11028 elif ! test -f $COMMONS_LOGGING_JAR; then
11029 AC_MSG_ERROR(commons-logging.jar not found.)
11032 AC_MSG_RESULT([internal])
11033 SYSTEM_APACHE_COMMONS=
11034 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
11038 AC_SUBST(SYSTEM_APACHE_COMMONS)
11039 AC_SUBST(COMMONS_LOGGING_JAR)
11040 AC_SUBST(COMMONS_LOGGING_VERSION)
11042 # scripting provider for BeanShell?
11043 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
11044 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
11045 AC_MSG_RESULT([yes])
11046 ENABLE_SCRIPTING_BEANSHELL=TRUE
11048 dnl ===================================================================
11049 dnl Check for system beanshell
11050 dnl ===================================================================
11051 AC_MSG_CHECKING([which beanshell to use])
11052 if test "$with_system_beanshell" = "yes"; then
11053 AC_MSG_RESULT([external])
11055 if test -z $BSH_JAR; then
11056 BSH_JAR=/usr/share/java/bsh.jar
11058 if ! test -f $BSH_JAR; then
11059 AC_MSG_ERROR(bsh.jar not found.)
11062 AC_MSG_RESULT([internal])
11064 BUILD_TYPE="$BUILD_TYPE BSH"
11067 AC_MSG_RESULT([no])
11068 ENABLE_SCRIPTING_BEANSHELL=
11069 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
11071 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
11072 AC_SUBST(SYSTEM_BSH)
11075 # scripting provider for JavaScript?
11076 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
11077 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
11078 AC_MSG_RESULT([yes])
11079 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
11081 dnl ===================================================================
11082 dnl Check for system rhino
11083 dnl ===================================================================
11084 AC_MSG_CHECKING([which rhino to use])
11085 if test "$with_system_rhino" = "yes"; then
11086 AC_MSG_RESULT([external])
11088 if test -z $RHINO_JAR; then
11089 RHINO_JAR=/usr/share/java/js.jar
11091 if ! test -f $RHINO_JAR; then
11092 AC_MSG_ERROR(js.jar not found.)
11095 AC_MSG_RESULT([internal])
11097 BUILD_TYPE="$BUILD_TYPE RHINO"
11101 AC_MSG_RESULT([no])
11102 ENABLE_SCRIPTING_JAVASCRIPT=
11103 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
11105 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
11106 AC_SUBST(SYSTEM_RHINO)
11107 AC_SUBST(RHINO_JAR)
11109 # This is only used in Qt5/KDE5 checks to determine if /usr/lib64
11110 # paths should be added to library search path. So lets put all 64-bit
11113 case "$host_cpu" in
11114 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
11115 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
11116 supports_multilib="yes"
11123 dnl ===================================================================
11124 dnl QT5 Integration
11125 dnl ===================================================================
11134 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11135 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11136 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11138 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11139 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11141 if test -n "$supports_multilib"; then
11142 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11145 qt5_test_include="QtWidgets/qapplication.h"
11146 qt5_test_library="libQt5Widgets.so"
11148 dnl Check for qmake5
11149 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
11150 if test "$QMAKE5" = "no"; then
11151 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11153 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11154 if test -z "$qmake5_test_ver"; then
11155 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11157 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11158 qt5_minimal_minor="6"
11159 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11160 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11162 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11166 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11167 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11169 AC_MSG_CHECKING([for Qt5 headers])
11171 for inc_dir in $qt5_incdirs; do
11172 if test -r "$inc_dir/$qt5_test_include"; then
11173 qt5_incdir="$inc_dir"
11177 AC_MSG_RESULT([$qt5_incdir])
11178 if test "x$qt5_incdir" = "xno"; then
11179 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11182 AC_MSG_CHECKING([for Qt5 libraries])
11184 for lib_dir in $qt5_libdirs; do
11185 if test -r "$lib_dir/$qt5_test_library"; then
11186 qt5_libdir="$lib_dir"
11190 AC_MSG_RESULT([$qt5_libdir])
11191 if test "x$qt5_libdir" = "xno"; then
11192 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11195 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11196 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11197 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11199 dnl Check for Meta Object Compiler
11201 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH] )
11202 if test "$MOC5" = "no"; then
11203 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11204 the root of your Qt installation by exporting QT5DIR before running "configure".])
11207 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11208 # Sets also QT5_GLIB_CFLAGS/QT5_GLIB_LIBS if successful.
11209 PKG_CHECK_MODULES(QT5_GLIB,[glib-2.0 >= 2.4],
11212 AC_DEFINE(QT5_HAVE_GLIB,1)
11214 AC_MSG_WARN([[No Glib found, Qt5 support will not use native file pickers!]])
11217 AC_SUBST(QT5_CFLAGS)
11220 AC_SUBST(QT5_GLIB_CFLAGS)
11221 AC_SUBST(QT5_GLIB_LIBS)
11222 AC_SUBST(QT5_HAVE_GLIB)
11224 dnl ===================================================================
11225 dnl KDE5 Integration
11226 dnl ===================================================================
11230 KF5_CONFIG="kf5-config"
11231 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11232 \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11233 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11235 if test "$OS" = "HAIKU"; then
11236 haiku_arch="`echo $RTL_ARCH | tr X x`"
11237 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11238 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11241 kf5_incdirs="$KF5INC /usr/include/ $kf5_haiku_incdirs $x_includes"
11242 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11243 if test -n "$supports_multilib"; then
11244 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11247 kf5_test_include="KF5/kcoreaddons_version.h"
11248 kf5_test_library="libKF5CoreAddons.so"
11249 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11251 dnl kf5 KDE4 support compatibility installed
11252 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11253 if test "$KF5_CONFIG" != "no"; then
11254 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11255 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11258 dnl Check for KF5 headers
11259 AC_MSG_CHECKING([for KF5 headers])
11261 for kf5_check in $kf5_incdirs; do
11262 if test -r "$kf5_check/$kf5_test_include"; then
11263 kf5_incdir="$kf5_check/KF5"
11267 AC_MSG_RESULT([$kf5_incdir])
11268 if test "x$kf5_incdir" = "xno"; then
11269 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11272 dnl Check for KF5 libraries
11273 AC_MSG_CHECKING([for KF5 libraries])
11275 for kf5_check in $kf5_libdirs; do
11276 if test -r "$kf5_check/$kf5_test_library"; then
11277 kf5_libdir="$kf5_check"
11282 AC_MSG_RESULT([$kf5_libdir])
11283 if test "x$kf5_libdir" = "xno"; then
11284 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11287 if test "$USING_X11" = TRUE; then
11288 PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])])
11291 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 $KF5_XCB_CFLAGS"
11292 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS"
11293 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11295 if test "$USING_X11" = TRUE; then
11296 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11299 AC_LANG_PUSH([C++])
11300 save_CXXFLAGS=$CXXFLAGS
11301 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11302 AC_MSG_CHECKING([whether KDE is >= 5.0])
11303 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11304 #include <kcoreaddons_version.h>
11306 int main(int argc, char **argv) {
11307 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11310 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11311 CXXFLAGS=$save_CXXFLAGS
11314 AC_SUBST(KF5_CFLAGS)
11317 dnl ===================================================================
11318 dnl Test whether to include Evolution 2 support
11319 dnl ===================================================================
11320 AC_MSG_CHECKING([whether to enable evolution 2 support])
11321 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11322 AC_MSG_RESULT([yes])
11323 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11324 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11325 FilterLibs "${GOBJECT_LIBS}"
11326 GOBJECT_LIBS="${filteredlibs}"
11327 ENABLE_EVOAB2="TRUE"
11330 AC_MSG_RESULT([no])
11332 AC_SUBST(ENABLE_EVOAB2)
11333 AC_SUBST(GOBJECT_CFLAGS)
11334 AC_SUBST(GOBJECT_LIBS)
11336 dnl ===================================================================
11337 dnl Test which themes to include
11338 dnl ===================================================================
11339 AC_MSG_CHECKING([which themes to include])
11340 # if none given use default subset of available themes
11341 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11342 with_theme="breeze breeze_dark breeze_svg colibre colibre_svg elementary elementary_svg karasa_jaga sifr sifr_dark tango"
11346 if test "x$with_theme" != "xno"; then
11347 for theme in $with_theme; do
11349 breeze|breeze_dark|breeze_svg|colibre|colibre_svg|elementary|elementary_svg|karasa_jaga|sifr|sifr_dark|tango) real_theme="$theme" ;;
11350 default) real_theme=colibre ;;
11351 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11353 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11356 AC_MSG_RESULT([$WITH_THEMES])
11357 AC_SUBST([WITH_THEMES])
11358 # FIXME: remove this, and the convenience default->colibre remapping after a grace period
11359 for theme in $with_theme; do
11361 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11366 dnl ===================================================================
11367 dnl Test whether to integrate helppacks into the product's installer
11368 dnl ===================================================================
11369 AC_MSG_CHECKING([for helppack integration])
11370 if test "$with_helppack_integration" = "no"; then
11371 AC_MSG_RESULT([no integration])
11373 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11374 AC_MSG_RESULT([integration])
11377 ###############################################################################
11378 # Extensions checking
11379 ###############################################################################
11380 AC_MSG_CHECKING([for extensions integration])
11381 if test "x$enable_extension_integration" != "xno"; then
11382 WITH_EXTENSION_INTEGRATION=TRUE
11383 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11384 AC_MSG_RESULT([yes, use integration])
11386 WITH_EXTENSION_INTEGRATION=
11387 AC_MSG_RESULT([no, do not integrate])
11389 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11391 dnl Should any extra extensions be included?
11392 dnl There are standalone tests for each of these below.
11393 WITH_EXTRA_EXTENSIONS=
11394 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11396 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11397 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11398 if test "x$with_java" != "xno"; then
11399 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11400 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11403 AC_MSG_CHECKING([whether to build opens___.ttf])
11404 if test "$enable_build_opensymbol" = "yes"; then
11405 AC_MSG_RESULT([yes])
11406 AC_PATH_PROG(FONTFORGE, fontforge)
11407 if test -z "$FONTFORGE"; then
11408 AC_MSG_ERROR([fontforge not installed])
11411 AC_MSG_RESULT([no])
11412 OPENSYMBOL_TTF=49a64f3bcf20a7909ba2751349231d6652ded9cd2840e961b5164d09de3ffa63-opens___.ttf
11413 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11415 AC_SUBST(OPENSYMBOL_TTF)
11416 AC_SUBST(FONTFORGE)
11418 dnl ===================================================================
11419 dnl Test whether to include fonts
11420 dnl ===================================================================
11421 AC_MSG_CHECKING([whether to include third-party fonts])
11422 if test "$with_fonts" != "no"; then
11423 AC_MSG_RESULT([yes])
11425 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11426 AC_DEFINE(HAVE_MORE_FONTS)
11428 AC_MSG_RESULT([no])
11430 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11432 AC_SUBST(WITH_FONTS)
11435 dnl ===================================================================
11436 dnl Test whether to enable online update service
11437 dnl ===================================================================
11438 AC_MSG_CHECKING([whether to enable online update])
11439 ENABLE_ONLINE_UPDATE=
11440 ENABLE_ONLINE_UPDATE_MAR=
11442 if test "$enable_online_update" = ""; then
11443 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11444 AC_MSG_RESULT([yes])
11445 ENABLE_ONLINE_UPDATE="TRUE"
11447 AC_MSG_RESULT([no])
11450 if test "$enable_online_update" = "mar"; then
11451 AC_MSG_RESULT([yes - MAR-based online update])
11452 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11453 if test "$with_update_config" = ""; then
11454 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11456 UPDATE_CONFIG="$with_update_config"
11457 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11458 elif test "$enable_online_update" = "yes"; then
11459 AC_MSG_RESULT([yes])
11460 ENABLE_ONLINE_UPDATE="TRUE"
11462 AC_MSG_RESULT([no])
11465 AC_SUBST(ENABLE_ONLINE_UPDATE)
11466 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11467 AC_SUBST(UPDATE_CONFIG)
11469 dnl ===================================================================
11470 dnl Test whether we need bzip2
11471 dnl ===================================================================
11473 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11474 AC_MSG_CHECKING([whether to use system bzip2])
11475 if test "$with_system_bzip2" = yes; then
11477 AC_MSG_RESULT([yes])
11478 PKG_CHECK_MODULES(BZIP2, bzip2)
11479 FilterLibs "${BZIP2_LIBS}"
11480 BZIP2_LIBS="${filteredlibs}"
11482 AC_MSG_RESULT([no])
11483 BUILD_TYPE="$BUILD_TYPE BZIP2"
11486 AC_SUBST(SYSTEM_BZIP2)
11487 AC_SUBST(BZIP2_CFLAGS)
11488 AC_SUBST(BZIP2_LIBS)
11490 dnl ===================================================================
11491 dnl Test whether to enable extension update
11492 dnl ===================================================================
11493 AC_MSG_CHECKING([whether to enable extension update])
11494 ENABLE_EXTENSION_UPDATE=
11495 if test "x$enable_extension_update" = "xno"; then
11496 AC_MSG_RESULT([no])
11498 AC_MSG_RESULT([yes])
11499 ENABLE_EXTENSION_UPDATE="TRUE"
11500 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11501 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11503 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11506 dnl ===================================================================
11507 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11508 dnl ===================================================================
11509 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11510 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11511 AC_MSG_RESULT([no])
11514 AC_MSG_RESULT([yes])
11515 ENABLE_SILENT_MSI=TRUE
11516 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11518 AC_SUBST(ENABLE_SILENT_MSI)
11520 AC_MSG_CHECKING([whether and how to use Xinerama])
11521 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11522 if test "$x_libraries" = "default_x_libraries"; then
11523 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11524 if test "x$XINERAMALIB" = x; then
11525 XINERAMALIB="/usr/lib"
11528 XINERAMALIB="$x_libraries"
11530 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11531 # we have both versions, let the user decide but use the dynamic one
11534 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11535 XINERAMA_LINK=dynamic
11537 XINERAMA_LINK=static
11539 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11540 # we have only the dynamic version
11542 XINERAMA_LINK=dynamic
11543 elif test -e "$XINERAMALIB/libXinerama.a"; then
11545 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11547 XINERAMA_LINK=static
11557 if test "$USE_XINERAMA" = "TRUE"; then
11558 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11559 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11560 [AC_MSG_ERROR(Xinerama header not found.)], [])
11561 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11562 if test "x$XEXTLIB" = x; then
11563 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11565 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11566 if test "$_os" = "FreeBSD"; then
11567 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11569 if test "$_os" = "Linux"; then
11570 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11572 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11573 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11575 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11580 AC_MSG_RESULT([no])
11582 AC_SUBST(USE_XINERAMA)
11583 AC_SUBST(XINERAMA_LINK)
11585 dnl ===================================================================
11586 dnl Test whether to build cairo or rely on the system version
11587 dnl ===================================================================
11589 if test "$USING_X11" = TRUE; then
11590 # Used in vcl/Library_vclplug_gen.mk
11594 if test "$test_cairo" = "yes"; then
11595 AC_MSG_CHECKING([whether to use the system cairo])
11597 : ${with_system_cairo:=$with_system_libs}
11598 if test "$with_system_cairo" = "yes"; then
11600 AC_MSG_RESULT([yes])
11602 PKG_CHECK_MODULES( CAIRO, cairo >= 1.2.0 )
11603 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11604 FilterLibs "${CAIRO_LIBS}"
11605 CAIRO_LIBS="${filteredlibs}"
11607 if test "$test_xrender" = "yes"; then
11608 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11610 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11611 #ifdef PictStandardA8
11615 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11621 AC_MSG_RESULT([no])
11623 BUILD_TYPE="$BUILD_TYPE CAIRO"
11627 AC_SUBST(SYSTEM_CAIRO)
11628 AC_SUBST(CAIRO_CFLAGS)
11629 AC_SUBST(CAIRO_LIBS)
11631 dnl ===================================================================
11632 dnl Test whether to use avahi
11633 dnl ===================================================================
11634 if test "$_os" = "WINNT"; then
11635 # Windows uses bundled mDNSResponder
11636 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11637 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11638 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11639 [ENABLE_AVAHI="TRUE"])
11640 AC_DEFINE(HAVE_FEATURE_AVAHI)
11641 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11642 FilterLibs "${AVAHI_LIBS}"
11643 AVAHI_LIBS="${filteredlibs}"
11646 AC_SUBST(ENABLE_AVAHI)
11647 AC_SUBST(AVAHI_CFLAGS)
11648 AC_SUBST(AVAHI_LIBS)
11650 dnl ===================================================================
11651 dnl Test whether to use liblangtag
11652 dnl ===================================================================
11654 AC_MSG_CHECKING([whether to use system liblangtag])
11655 if test "$with_system_liblangtag" = yes; then
11656 SYSTEM_LIBLANGTAG=TRUE
11657 AC_MSG_RESULT([yes])
11658 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11659 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11660 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11661 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11662 FilterLibs "${LIBLANGTAG_LIBS}"
11663 LIBLANGTAG_LIBS="${filteredlibs}"
11666 AC_MSG_RESULT([no])
11667 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11668 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
11669 if test "$COM" = "MSC"; then
11670 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
11672 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
11675 AC_SUBST(SYSTEM_LIBLANGTAG)
11676 AC_SUBST(LIBLANGTAG_CFLAGS)
11677 AC_SUBST(LIBLANGTAG_LIBS)
11679 dnl ===================================================================
11680 dnl Test whether to build libpng or rely on the system version
11681 dnl ===================================================================
11683 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
11685 dnl ===================================================================
11686 dnl Check for runtime JVM search path
11687 dnl ===================================================================
11688 if test "$ENABLE_JAVA" != ""; then
11689 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11690 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11691 AC_MSG_RESULT([yes])
11692 if ! test -d "$with_jvm_path"; then
11693 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11695 if ! test -d "$with_jvm_path"jvm; then
11696 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11698 JVM_ONE_PATH_CHECK="$with_jvm_path"
11699 AC_SUBST(JVM_ONE_PATH_CHECK)
11701 AC_MSG_RESULT([no])
11705 dnl ===================================================================
11706 dnl Test for the presence of Ant and that it works
11707 dnl ===================================================================
11709 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
11710 ANT_HOME=; export ANT_HOME
11711 WITH_ANT_HOME=; export WITH_ANT_HOME
11712 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11713 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11714 if test "$_os" = "WINNT"; then
11715 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11717 with_ant_home="$LODE_HOME/opt/ant"
11719 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11720 with_ant_home="$LODE_HOME/opt/ant"
11723 if test -z "$with_ant_home"; then
11724 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd])
11726 if test "$_os" = "WINNT"; then
11727 # AC_PATH_PROGS needs unix path
11728 with_ant_home=`cygpath -u "$with_ant_home"`
11730 AbsolutePath "$with_ant_home"
11731 with_ant_home=$absolute_path
11732 AC_PATH_PROGS(ANT, [ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11733 WITH_ANT_HOME=$with_ant_home
11734 ANT_HOME=$with_ant_home
11737 if test -z "$ANT"; then
11738 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11740 # resolve relative or absolute symlink
11741 while test -h "$ANT"; do
11743 a_basename=`basename "$ANT"`
11744 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11745 cd "`dirname "$ANT"`"
11746 cd "`dirname "$a_script"`"
11747 ANT="`pwd`"/"`basename "$a_script"`"
11751 AC_MSG_CHECKING([if $ANT works])
11752 mkdir -p conftest.dir
11755 cat > conftest.java << EOF
11756 public class conftest {
11757 int testmethod(int a, int b) {
11763 cat > conftest.xml << EOF
11764 <project name="conftest" default="conftest">
11765 <target name="conftest">
11766 <javac srcdir="." includes="conftest.java">
11772 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
11773 if test $? = 0 -a -f ./conftest.class; then
11774 AC_MSG_RESULT([Ant works])
11775 if test -z "$WITH_ANT_HOME"; then
11776 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11777 if test -z "$ANT_HOME"; then
11778 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11781 ANT_HOME="$WITH_ANT_HOME"
11784 echo "configure: Ant test failed" >&5
11785 cat conftest.java >&5
11786 cat conftest.xml >&5
11787 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
11790 rm -fr conftest.dir
11792 if test -z "$ANT_HOME"; then
11793 ANT_HOME="NO_ANT_HOME"
11795 PathFormat "$ANT_HOME"
11796 ANT_HOME="$formatted_path"
11798 ANT="$formatted_path"
11803 dnl Checking for ant.jar
11804 if test "$ANT_HOME" != "NO_ANT_HOME"; then
11805 AC_MSG_CHECKING([Ant lib directory])
11806 if test -f $ANT_HOME/lib/ant.jar; then
11807 ANT_LIB="$ANT_HOME/lib"
11809 if test -f $ANT_HOME/ant.jar; then
11810 ANT_LIB="$ANT_HOME"
11812 if test -f /usr/share/java/ant.jar; then
11813 ANT_LIB=/usr/share/java
11815 if test -f /usr/share/ant-core/lib/ant.jar; then
11816 ANT_LIB=/usr/share/ant-core/lib
11818 if test -f $ANT_HOME/lib/ant/ant.jar; then
11819 ANT_LIB="$ANT_HOME/lib/ant"
11821 if test -f /usr/share/lib/ant/ant.jar; then
11822 ANT_LIB=/usr/share/lib/ant
11824 AC_MSG_ERROR([Ant libraries not found!])
11831 PathFormat "$ANT_LIB"
11832 ANT_LIB="$formatted_path"
11833 AC_MSG_RESULT([Ant lib directory found.])
11838 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11840 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11841 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11842 ant_version_major=`echo $ant_version | cut -d. -f1`
11843 ant_version_minor=`echo $ant_version | cut -d. -f2`
11844 echo "configure: ant_version $ant_version " >&5
11845 echo "configure: ant_version_major $ant_version_major " >&5
11846 echo "configure: ant_version_minor $ant_version_minor " >&5
11847 if test "$ant_version_major" -ge "2"; then
11848 AC_MSG_RESULT([yes, $ant_version])
11849 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11850 AC_MSG_RESULT([yes, $ant_version])
11852 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11855 rm -f conftest* core core.* *.core
11859 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11860 AC_MSG_CHECKING([for JUnit 4])
11861 if test "$with_junit" = "yes"; then
11862 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
11863 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
11864 elif test -e /usr/share/java/junit4.jar; then
11865 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11867 if test -e /usr/share/lib/java/junit.jar; then
11868 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11870 OOO_JUNIT_JAR=/usr/share/java/junit.jar
11874 OOO_JUNIT_JAR=$with_junit
11876 if test "$_os" = "WINNT"; then
11877 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11879 printf 'import org.junit.Before;' > conftest.java
11880 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11881 AC_MSG_RESULT([$OOO_JUNIT_JAR])
11884 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
11885 specify its pathname via --with-junit=..., or disable it via --without-junit])
11887 rm -f conftest.class conftest.java
11888 if test $OOO_JUNIT_JAR != ""; then
11889 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11892 AC_SUBST(OOO_JUNIT_JAR)
11895 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11896 AC_MSG_CHECKING([for included Hamcrest])
11897 printf 'import org.hamcrest.BaseDescription;' > conftest.java
11898 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11899 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
11901 AC_MSG_RESULT([Not included])
11902 AC_MSG_CHECKING([for standalone hamcrest jar.])
11903 if test "$with_hamcrest" = "yes"; then
11904 if test -e /usr/share/lib/java/hamcrest.jar; then
11905 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
11906 elif test -e /usr/share/java/hamcrest/core.jar; then
11907 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
11909 HAMCREST_JAR=/usr/share/java/hamcrest.jar
11912 HAMCREST_JAR=$with_hamcrest
11914 if test "$_os" = "WINNT"; then
11915 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
11917 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
11918 AC_MSG_RESULT([$HAMCREST_JAR])
11920 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),
11921 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
11924 rm -f conftest.class conftest.java
11926 AC_SUBST(HAMCREST_JAR)
11932 # check for wget and curl
11937 if test "$enable_fetch_external" != "no"; then
11939 CURL=`which curl 2>/dev/null`
11941 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
11943 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
11944 if test $? -eq 0; then
11950 if test -z "$WGET" -a -z "$CURL"; then
11951 AC_MSG_ERROR([neither wget nor curl found!])
11960 # check for sha256sum
11964 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
11965 eval "$i -a 256 --version" > /dev/null 2>&1
11967 if test $ret -eq 0; then
11968 SHA256SUM="$i -a 256"
11973 if test -z "$SHA256SUM"; then
11974 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
11975 eval "$i --version" > /dev/null 2>&1
11977 if test $ret -eq 0; then
11984 if test -z "$SHA256SUM"; then
11985 AC_MSG_ERROR([no sha256sum found!])
11988 AC_SUBST(SHA256SUM)
11990 dnl ===================================================================
11991 dnl Dealing with l10n options
11992 dnl ===================================================================
11993 AC_MSG_CHECKING([which languages to be built])
11994 # get list of all languages
11995 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
11996 # the sed command does the following:
11997 # + if a line ends with a backslash, append the next line to it
11998 # + adds " on the beginning of the value (after =)
11999 # + adds " at the end of the value
12000 # + removes en-US; we want to put it on the beginning
12001 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12002 [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)]
12003 ALL_LANGS="en-US $completelangiso"
12004 # check the configured localizations
12005 WITH_LANG="$with_lang"
12007 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
12008 # (Norwegian is "nb" and "nn".)
12009 if test "$WITH_LANG" = "no"; then
12013 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12014 AC_MSG_RESULT([en-US])
12016 AC_MSG_RESULT([$WITH_LANG])
12017 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12018 if test -z "$MSGFMT"; then
12019 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12020 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12021 elif test -x "/opt/lo/bin/msgfmt"; then
12022 MSGFMT="/opt/lo/bin/msgfmt"
12024 AC_CHECK_PROGS(MSGFMT, [msgfmt])
12025 if test -z "$MSGFMT"; then
12026 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12030 if test -z "$MSGUNIQ"; then
12031 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12032 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12033 elif test -x "/opt/lo/bin/msguniq"; then
12034 MSGUNIQ="/opt/lo/bin/msguniq"
12036 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12037 if test -z "$MSGUNIQ"; then
12038 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12045 # check that the list is valid
12046 for lang in $WITH_LANG; do
12047 test "$lang" = "ALL" && continue
12048 # need to check for the exact string, so add space before and after the list of all languages
12049 for vl in $ALL_LANGS; do
12050 if test "$vl" = "$lang"; then
12054 if test "$vl" != "$lang"; then
12055 # if you're reading this - you prolly quoted your languages remove the quotes ...
12056 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12059 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12060 echo $WITH_LANG | grep -q en-US
12061 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12063 # list with substituted ALL
12064 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12065 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12066 test "$WITH_LANG" = "en-US" && WITH_LANG=
12067 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12068 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12069 ALL_LANGS=`echo $ALL_LANGS qtz`
12071 AC_SUBST(ALL_LANGS)
12072 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12073 AC_SUBST(WITH_LANG)
12074 AC_SUBST(WITH_LANG_LIST)
12075 AC_SUBST(GIT_NEEDED_SUBMODULES)
12077 WITH_POOR_HELP_LOCALIZATIONS=
12078 if test -d "$SRC_ROOT/translations/source"; then
12079 for l in `ls -1 $SRC_ROOT/translations/source`; do
12080 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12081 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12085 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12087 if test -n "$with_locales"; then
12088 WITH_LOCALES="$with_locales"
12090 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12091 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12092 # config_host/config_locales.h.in
12093 for locale in $WITH_LOCALES; do
12096 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12100 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12103 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12108 AC_DEFINE(WITH_LOCALE_ALL)
12110 AC_SUBST(WITH_LOCALES)
12112 dnl git submodule update --reference
12113 dnl ===================================================================
12114 if test -n "${GIT_REFERENCE_SRC}"; then
12115 for repo in ${GIT_NEEDED_SUBMODULES}; do
12116 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12117 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12121 AC_SUBST(GIT_REFERENCE_SRC)
12123 dnl git submodules linked dirs
12124 dnl ===================================================================
12125 if test -n "${GIT_LINK_SRC}"; then
12126 for repo in ${GIT_NEEDED_SUBMODULES}; do
12127 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12128 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12132 AC_SUBST(GIT_LINK_SRC)
12135 dnl ===================================================================
12136 AC_MSG_CHECKING([for alternative branding images directory])
12137 # initialize mapped arrays
12138 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12139 brand_files="$BRAND_INTRO_IMAGES about.svg"
12141 if test -z "$with_branding" -o "$with_branding" = "no"; then
12142 AC_MSG_RESULT([none])
12143 DEFAULT_BRAND_IMAGES="$brand_files"
12145 if ! test -d $with_branding ; then
12146 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12148 AC_MSG_RESULT([$with_branding])
12149 CUSTOM_BRAND_DIR="$with_branding"
12150 for lfile in $brand_files
12152 if ! test -f $with_branding/$lfile ; then
12153 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12154 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12156 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12159 check_for_progress="yes"
12162 AC_SUBST([BRAND_INTRO_IMAGES])
12163 AC_SUBST([CUSTOM_BRAND_DIR])
12164 AC_SUBST([CUSTOM_BRAND_IMAGES])
12165 AC_SUBST([DEFAULT_BRAND_IMAGES])
12168 AC_MSG_CHECKING([for 'intro' progress settings])
12172 PROGRESSFRAMECOLOR=
12174 PROGRESSTEXTBASELINE=
12176 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12177 source "$with_branding/progress.conf"
12178 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12180 AC_MSG_RESULT([none])
12183 AC_SUBST(PROGRESSBARCOLOR)
12184 AC_SUBST(PROGRESSSIZE)
12185 AC_SUBST(PROGRESSPOSITION)
12186 AC_SUBST(PROGRESSFRAMECOLOR)
12187 AC_SUBST(PROGRESSTEXTCOLOR)
12188 AC_SUBST(PROGRESSTEXTBASELINE)
12191 AC_MSG_CHECKING([for extra build ID])
12192 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12193 EXTRA_BUILDID="$with_extra_buildid"
12195 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12196 if test -n "$EXTRA_BUILDID" ; then
12197 AC_MSG_RESULT([$EXTRA_BUILDID])
12199 AC_MSG_RESULT([not set])
12201 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12204 AC_MSG_CHECKING([for vendor])
12205 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12206 OOO_VENDOR="$USERNAME"
12208 if test -z "$OOO_VENDOR"; then
12212 if test -z "$OOO_VENDOR"; then
12213 OOO_VENDOR="`id -u -n`"
12216 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12218 OOO_VENDOR="$with_vendor"
12219 AC_MSG_RESULT([$OOO_VENDOR])
12221 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12222 AC_SUBST(OOO_VENDOR)
12224 if test "$_os" = "Android" ; then
12225 ANDROID_PACKAGE_NAME=
12226 AC_MSG_CHECKING([for Android package name])
12227 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12228 if test -n "$ENABLE_DEBUG"; then
12229 # Default to the package name that makes ndk-gdb happy.
12230 ANDROID_PACKAGE_NAME="org.libreoffice"
12232 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12235 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12237 ANDROID_PACKAGE_NAME="$with_android_package_name"
12238 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12240 AC_SUBST(ANDROID_PACKAGE_NAME)
12243 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12244 if test "$with_compat_oowrappers" = "yes"; then
12245 WITH_COMPAT_OOWRAPPERS=TRUE
12248 WITH_COMPAT_OOWRAPPERS=
12251 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12253 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12254 AC_MSG_CHECKING([for install dirname])
12255 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12256 INSTALLDIRNAME="$with_install_dirname"
12258 AC_MSG_RESULT([$INSTALLDIRNAME])
12259 AC_SUBST(INSTALLDIRNAME)
12261 AC_MSG_CHECKING([for prefix])
12262 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12263 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12264 PREFIXDIR="$prefix"
12265 AC_MSG_RESULT([$PREFIXDIR])
12266 AC_SUBST(PREFIXDIR)
12268 LIBDIR=[$(eval echo $(eval echo $libdir))]
12271 DATADIR=[$(eval echo $(eval echo $datadir))]
12274 MANDIR=[$(eval echo $(eval echo $mandir))]
12277 DOCDIR=[$(eval echo $(eval echo $docdir))]
12280 BINDIR=[$(eval echo $(eval echo $bindir))]
12283 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12284 AC_SUBST(INSTALLDIR)
12286 TESTINSTALLDIR="${BUILDDIR}/test-install"
12287 AC_SUBST(TESTINSTALLDIR)
12290 # ===================================================================
12291 # OAuth2 id and secrets
12292 # ===================================================================
12294 AC_MSG_CHECKING([for Google Drive client id and secret])
12295 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12296 AC_MSG_RESULT([not set])
12297 GDRIVE_CLIENT_ID="\"\""
12298 GDRIVE_CLIENT_SECRET="\"\""
12300 AC_MSG_RESULT([set])
12301 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12302 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12304 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12305 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12307 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12308 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12309 AC_MSG_RESULT([not set])
12310 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12311 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12313 AC_MSG_RESULT([set])
12314 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12315 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12317 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12318 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12320 AC_MSG_CHECKING([for OneDrive client id and secret])
12321 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12322 AC_MSG_RESULT([not set])
12323 ONEDRIVE_CLIENT_ID="\"\""
12324 ONEDRIVE_CLIENT_SECRET="\"\""
12326 AC_MSG_RESULT([set])
12327 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12328 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12330 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12331 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12334 dnl ===================================================================
12335 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12336 dnl --enable-dependency-tracking configure option
12337 dnl ===================================================================
12338 AC_MSG_CHECKING([whether to enable dependency tracking])
12339 if test "$enable_dependency_tracking" = "no"; then
12341 AC_MSG_RESULT([no])
12343 AC_MSG_RESULT([yes])
12347 dnl ===================================================================
12348 dnl Number of CPUs to use during the build
12349 dnl ===================================================================
12350 AC_MSG_CHECKING([for number of processors to use])
12351 # plain --with-parallelism is just the default
12352 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12353 if test "$with_parallelism" = "no"; then
12356 PARALLELISM=$with_parallelism
12359 if test "$enable_icecream" = "yes"; then
12364 Darwin|FreeBSD|NetBSD|OpenBSD)
12365 PARALLELISM=`sysctl -n hw.ncpu`
12369 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12371 # what else than above does profit here *and* has /proc?
12373 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12377 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12378 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12382 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12383 if test -z "$with_parallelism"; then
12384 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12385 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12388 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."
12392 if test $PARALLELISM -eq 0; then
12393 AC_MSG_RESULT([explicit make -j option needed])
12395 AC_MSG_RESULT([$PARALLELISM])
12397 AC_SUBST(PARALLELISM)
12399 IWYU_PATH="$with_iwyu"
12400 AC_SUBST(IWYU_PATH)
12401 if test ! -z "$IWYU_PATH"; then
12402 if test ! -f "$IWYU_PATH"; then
12403 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12408 # Set up ILIB for MSVC build
12411 if test "$build_os" = "cygwin"; then
12413 if test -n "$JAVA_HOME"; then
12414 ILIB="$ILIB;$JAVA_HOME/lib"
12417 if test "$BITNESS_OVERRIDE" = 64; then
12418 ILIB="$ILIB;$COMPATH/lib/x64"
12419 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12420 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12421 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12422 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12423 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12424 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12426 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12427 ucrtlibpath_formatted=$formatted_path
12428 ILIB="$ILIB;$ucrtlibpath_formatted"
12429 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12431 ILIB="$ILIB;$COMPATH/lib/x86"
12432 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12433 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12434 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12435 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12436 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12437 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12439 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12440 ucrtlibpath_formatted=$formatted_path
12441 ILIB="$ILIB;$ucrtlibpath_formatted"
12442 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12444 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12445 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12447 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12453 dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
12454 AC_MSG_CHECKING([that $CXX supports inline variables])
12455 AC_LANG_PUSH([C++])
12456 save_CXXFLAGS=$CXXFLAGS
12457 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12458 if test "$build_os" = cygwin; then
12462 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
12463 #if !defined __cpp_inline_variables
12464 // This tests for one specific aspect of inline variables that is actually used by
12465 // ORegistry::ROOT (registry/source/regimpl.cxx):
12466 struct S { constexpr S() {} };
12467 struct T { static constexpr S s{}; };
12468 S const * f() { return &T::s; }
12471 AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks required inline variable support]))
12472 CXXFLAGS=$save_CXXFLAGS
12473 if test "$build_os" = cygwin; then
12478 dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
12480 [that C++11 use of const_iterator in standard containers is not broken])
12481 save_CXXFLAGS=$CXXFLAGS
12482 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12483 AC_LANG_PUSH([C++])
12484 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12488 l.erase(l.cbegin());
12490 AC_MSG_RESULT([yes]),
12491 AC_MSG_ERROR([C++11 use of const_iterator in standard containers must not broken]))
12493 CXXFLAGS=$save_CXXFLAGS
12495 # ===================================================================
12496 # Creating bigger shared library to link against
12497 # ===================================================================
12498 AC_MSG_CHECKING([whether to create huge library])
12501 if test $_os = iOS -o $_os = Android; then
12502 # Never any point in mergelibs for these as we build just static
12503 # libraries anyway...
12504 enable_mergelibs=no
12507 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12508 if test $_os != Linux -a $_os != WINNT; then
12509 add_warning "--enable-mergelibs is not tested for this platform"
12512 AC_MSG_RESULT([yes])
12514 AC_MSG_RESULT([no])
12516 AC_SUBST([MERGELIBS])
12518 dnl ===================================================================
12519 dnl icerun is a wrapper that stops us spawning tens of processes
12520 dnl locally - for tools that can't be executed on the compile cluster
12521 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12522 dnl ===================================================================
12523 AC_MSG_CHECKING([whether to use icerun wrapper])
12525 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12526 ICECREAM_RUN=icerun
12527 AC_MSG_RESULT([yes])
12529 AC_MSG_RESULT([no])
12531 AC_SUBST(ICECREAM_RUN)
12533 dnl ===================================================================
12534 dnl Setup the ICECC_VERSION for the build the same way it was set for
12535 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12536 dnl ===================================================================
12537 x_ICECC_VERSION=[\#]
12538 if test -n "$ICECC_VERSION" ; then
12541 AC_SUBST(x_ICECC_VERSION)
12542 AC_SUBST(ICECC_VERSION)
12544 dnl ===================================================================
12546 AC_MSG_CHECKING([MPL subset])
12549 if test "$enable_mpl_subset" = "yes"; then
12551 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12553 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12556 if test "$warn_report" = "true"; then
12557 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12559 if test "x$enable_postgresql_sdbc" != "xno"; then
12560 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12562 if test "$enable_lotuswordpro" = "yes"; then
12563 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12565 if test "$WITH_WEBDAV" = "neon"; then
12566 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12568 if test -n "$ENABLE_POPPLER"; then
12569 if test "x$SYSTEM_POPPLER" = "x"; then
12570 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12573 # cf. m4/libo_check_extension.m4
12574 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12575 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12577 for theme in $WITH_THEMES; do
12579 breeze|breeze_dark|breeze_svg|elementary|elementary_svg|karasa_jaga|karasa_jaga_svg) #blacklist of icon themes under GPL or LGPL
12580 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12585 ENABLE_OPENGL_TRANSITIONS=
12587 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12588 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12592 AC_DEFINE(MPL_HAVE_SUBSET)
12593 AC_MSG_RESULT([only])
12595 AC_MSG_RESULT([no restrictions])
12597 AC_SUBST(MPL_SUBSET)
12599 dnl ===================================================================
12601 AC_MSG_CHECKING([formula logger])
12602 ENABLE_FORMULA_LOGGER=
12604 if test "x$enable_formula_logger" = "xyes"; then
12605 AC_MSG_RESULT([yes])
12606 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12607 ENABLE_FORMULA_LOGGER=TRUE
12608 elif test -n "$ENABLE_DBGUTIL" ; then
12609 AC_MSG_RESULT([yes])
12610 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12611 ENABLE_FORMULA_LOGGER=TRUE
12613 AC_MSG_RESULT([no])
12616 AC_SUBST(ENABLE_FORMULA_LOGGER)
12618 dnl ===================================================================
12619 dnl Setting up the environment.
12620 dnl ===================================================================
12621 AC_MSG_NOTICE([setting up the build environment variables...])
12625 if test "$build_os" = "cygwin"; then
12626 if test -d "$COMPATH/atlmfc/lib"; then
12627 ATL_LIB="$COMPATH/atlmfc/lib"
12628 ATL_INCLUDE="$COMPATH/atlmfc/include"
12630 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12631 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12633 if test "$BITNESS_OVERRIDE" = 64; then
12634 if test $VCVER = "150"; then
12635 ATL_LIB="$ATL_LIB/x64"
12637 ATL_LIB="$ATL_LIB/amd64"
12640 if test $VCVER = "150"; then
12641 ATL_LIB="$ATL_LIB/x86"
12644 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12645 PathFormat "/usr/bin/find.exe"
12646 FIND="$formatted_path"
12647 PathFormat "/usr/bin/sort.exe"
12648 SORT="$formatted_path"
12649 PathFormat "/usr/bin/grep.exe"
12650 WIN_GREP="$formatted_path"
12651 PathFormat "/usr/bin/ls.exe"
12652 WIN_LS="$formatted_path"
12653 PathFormat "/usr/bin/touch.exe"
12654 WIN_TOUCH="$formatted_path"
12660 AC_SUBST(ATL_INCLUDE)
12666 AC_SUBST(WIN_TOUCH)
12668 AC_SUBST(BUILD_TYPE)
12673 PERL="$formatted_path"
12676 if test -n "$TMPDIR"; then
12677 TEMP_DIRECTORY="$TMPDIR"
12679 TEMP_DIRECTORY="/tmp"
12681 if test "$build_os" = "cygwin"; then
12682 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12684 AC_SUBST(TEMP_DIRECTORY)
12686 # setup the PATH for the environment
12687 if test -n "$LO_PATH_FOR_BUILD"; then
12688 LO_PATH="$LO_PATH_FOR_BUILD"
12694 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12695 if test "$ENABLE_JAVA" != ""; then
12696 pathmunge "$JAVA_HOME/bin" "after"
12701 # Win32 make needs native paths
12702 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12703 LO_PATH=`cygpath -p -m "$PATH"`
12705 if test "$BITNESS_OVERRIDE" = 64; then
12706 # needed for msi packaging
12707 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12709 # .NET 4.6 and higher don't have bin directory
12710 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
12711 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12713 pathmunge "$ASM_HOME" "before"
12714 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12715 pathmunge "$CSC_PATH" "before"
12716 pathmunge "$MIDL_PATH" "before"
12717 pathmunge "$AL_PATH" "before"
12718 pathmunge "$MSPDB_PATH" "before"
12719 if test -n "$MSBUILD_PATH" ; then
12720 pathmunge "$MSBUILD_PATH" "before"
12722 if test "$BITNESS_OVERRIDE" = 64; then
12723 pathmunge "$COMPATH/bin/amd64" "before"
12724 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
12726 pathmunge "$COMPATH/bin" "before"
12727 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12729 if test "$ENABLE_JAVA" != ""; then
12730 if test -d "$JAVA_HOME/jre/bin/client"; then
12731 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12733 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12734 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12736 pathmunge "$JAVA_HOME/bin" "before"
12741 pathmunge "/usr/css/bin" "before"
12742 if test "$ENABLE_JAVA" != ""; then
12743 pathmunge "$JAVA_HOME/bin" "after"
12753 # Generate a configuration sha256 we can use for deps
12754 if test -f config_host.mk; then
12755 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
12757 if test -f config_host_lang.mk; then
12758 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
12761 CFLAGS=$my_original_CFLAGS
12762 CXXFLAGS=$my_original_CXXFLAGS
12763 CPPFLAGS=$my_original_CPPFLAGS
12765 AC_CONFIG_FILES([config_host.mk
12766 config_host_lang.mk
12768 bin/bffvalidator.sh
12769 bin/odfvalidator.sh
12771 instsetoo_native/util/openoffice.lst
12772 sysui/desktop/macosx/Info.plist])
12773 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12774 AC_CONFIG_HEADERS([config_host/config_clang.h])
12775 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12776 AC_CONFIG_HEADERS([config_host/config_eot.h])
12777 AC_CONFIG_HEADERS([config_host/config_extensions.h])
12778 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12779 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
12780 AC_CONFIG_HEADERS([config_host/config_dbus.h])
12781 AC_CONFIG_HEADERS([config_host/config_features.h])
12782 AC_CONFIG_HEADERS([config_host/config_firebird.h])
12783 AC_CONFIG_HEADERS([config_host/config_folders.h])
12784 AC_CONFIG_HEADERS([config_host/config_fuzzers.h])
12785 AC_CONFIG_HEADERS([config_host/config_gio.h])
12786 AC_CONFIG_HEADERS([config_host/config_global.h])
12787 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
12788 AC_CONFIG_HEADERS([config_host/config_java.h])
12789 AC_CONFIG_HEADERS([config_host/config_langs.h])
12790 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12791 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
12792 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
12793 AC_CONFIG_HEADERS([config_host/config_libnumbertext.h])
12794 AC_CONFIG_HEADERS([config_host/config_locales.h])
12795 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12796 AC_CONFIG_HEADERS([config_host/config_qt5.h])
12797 AC_CONFIG_HEADERS([config_host/config_kde5.h])
12798 AC_CONFIG_HEADERS([config_host/config_gtk3_kde5.h])
12799 AC_CONFIG_HEADERS([config_host/config_oox.h])
12800 AC_CONFIG_HEADERS([config_host/config_options.h])
12801 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
12802 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12803 AC_CONFIG_HEADERS([config_host/config_vendor.h])
12804 AC_CONFIG_HEADERS([config_host/config_vcl.h])
12805 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12806 AC_CONFIG_HEADERS([config_host/config_version.h])
12807 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12808 AC_CONFIG_HEADERS([config_host/config_poppler.h])
12809 AC_CONFIG_HEADERS([config_host/config_python.h])
12810 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
12813 if test "$CROSS_COMPILING" = TRUE; then
12814 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12817 # touch the config timestamp file
12818 if test ! -f config_host.mk.stamp; then
12819 echo > config_host.mk.stamp
12820 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
12821 echo "Host Configuration unchanged - avoiding scp2 stamp update"
12823 echo > config_host.mk.stamp
12826 # touch the config lang timestamp file
12827 if test ! -f config_host_lang.mk.stamp; then
12828 echo > config_host_lang.mk.stamp
12829 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
12830 echo "Language Configuration unchanged - avoiding scp2 stamp update"
12832 echo > config_host_lang.mk.stamp
12836 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12839 ****************************************************************************
12841 Your make version is known to be horribly slow, and hard to debug
12842 problems with. To get a reasonably functional make please do:
12844 to install a pre-compiled binary make for Win32
12846 mkdir -p /opt/lo/bin
12848 wget https://dev-www.libreoffice.org/bin/cygwin/make-4.2.1-msvc.exe
12849 cp make-4.2.1-msvc.exe make
12852 to install from source:
12853 place yourself in a working directory of you choice.
12855 git clone git://git.savannah.gnu.org/make.git
12857 [go to Start menu, open "Visual Studio 2017", click "VS2017 x86 Native Tools Command Prompt" or "VS2017 x64 Native Tools Command Prompt"]
12858 set PATH=%PATH%;C:\Cygwin\bin
12859 [or Cygwin64, if that is what you have]
12860 cd path-to-make-repo-you-cloned-above
12861 build_w32.bat --without-guile
12863 should result in a WinRel/gnumake.exe.
12864 Copy it to the Cygwin /opt/lo/bin directory as make.exe
12866 Then re-run autogen.sh
12868 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12869 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12875 ****************************************************************************
12880 To view some help, run:
12885 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
12887 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
12890 if test $_os = Darwin; then
12891 echo open instdir/$PRODUCTNAME.app
12893 echo instdir/program/soffice
12897 If you want to run the smoketest, run:
12903 if test -f warn; then
12908 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: