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.2.0.0.alpha0+],[],[],[http://documentfoundation.org/])
16 if test -n "$BUILD_TYPE"; then
17 AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
25 GIT_NEEDED_SUBMODULES=""
26 LO_PATH= # used by path_munge to construct a PATH variable
33 # let's start with Fedora's paths for now
34 -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
35 # ignore it: on UNIXoids it is searched by default anyway
36 # but if it's given explicitly then it may override other paths
37 # (on Mac OS X it would be an error to use it instead of SDK)
40 filteredlibs="$filteredlibs $f"
49 if test "$build_os" = "cygwin"; then
51 # spaces,parentheses,brackets,braces are problematic in pathname
53 case "$formatted_path" in
54 *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
58 if test "$pf_conv_to_dos" = "yes"; then
59 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
60 formatted_path=`cygpath -sm "$formatted_path"`
62 formatted_path=`cygpath -d "$formatted_path"`
64 if test $? -ne 0; then
65 AC_MSG_ERROR([path conversion failed for "$1".])
68 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
69 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
70 if test "$fp_count_slash$fp_count_colon" != "00"; then
71 if test "$fp_count_colon" = "0"; then
72 new_formatted_path=`realpath "$formatted_path"`
73 if test $? -ne 0; then
74 AC_MSG_WARN([realpath failed for "$1", not necessarily a problem.])
76 formatted_path="$new_formatted_path"
79 formatted_path=`cygpath -m "$formatted_path"`
80 if test $? -ne 0; then
81 AC_MSG_ERROR([path conversion failed for "$1".])
84 fp_count_space=`echo "$formatted_path" | $GREP -c "[ ]"`
85 if test "$fp_count_space" != "0"; then
86 AC_MSG_ERROR([converted path "$formatted_path" still contains spaces. Short filenames (8.3 filenames) support was disabled on this system?])
93 # There appears to be no simple and portable method to get an absolute and
94 # canonical path, so we try creating the directory if does not exist and
95 # utilizing the shell and pwd.
98 test ! -e "$rel" && mkdir -p "$rel"
99 if test -d "$rel" ; then
100 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
101 absolute_path="$(pwd)"
104 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
112 if test "$have_WARNINGS" = "no"; then
113 echo "*************************************" > warn
115 if which tput >/dev/null && test "`tput colors 2>/dev/null || echo 0`" -ge 8; then
116 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
117 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
119 COLORWARN="* WARNING :"
122 echo "$COLORWARN $@" >> warn
125 dnl Some Mac User have the bad habbit of letting a lot fo crap
126 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
127 dnl that confuse the build.
128 dnl For the ones that use LODE, let's be nice and protect them
133 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
134 dnl a common but nevertheless necessary thing that may be in a fancy
135 dnl path location is git, so make sure we have it
136 mac_git_path=`which git 2>/dev/null`
137 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
138 mac_path="$mac_path:`dirname $mac_git_path`"
140 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
141 dnl path location is gpg, so make sure we find it
142 mac_gpg_path=`which gpg 2>/dev/null`
143 if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
144 mac_path="$mac_path:`dirname $mac_gpg_path`"
152 echo "********************************************************************"
154 echo "* Running ${PACKAGE_NAME} build configuration."
156 echo "********************************************************************"
159 dnl ===================================================================
160 dnl checks build and host OSes
161 dnl do this before argument processing to allow for platform dependent defaults
162 dnl ===================================================================
165 AC_MSG_CHECKING([for product name])
166 PRODUCTNAME="AC_PACKAGE_NAME"
167 if test -n "$with_product_name" -a "$with_product_name" != no; then
168 PRODUCTNAME="$with_product_name"
170 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
171 PRODUCTNAME="${PRODUCTNAME}Dev"
173 AC_MSG_RESULT([$PRODUCTNAME])
174 AC_SUBST(PRODUCTNAME)
175 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
176 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
178 dnl ===================================================================
179 dnl Our version is defined by the AC_INIT() at the top of this script.
180 dnl ===================================================================
182 AC_MSG_CHECKING([for package version])
183 if test -n "$with_package_version" -a "$with_package_version" != no; then
184 PACKAGE_VERSION="$with_package_version"
186 AC_MSG_RESULT([$PACKAGE_VERSION])
188 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
190 LIBO_VERSION_MAJOR=$1
191 LIBO_VERSION_MINOR=$2
192 LIBO_VERSION_MICRO=$3
193 LIBO_VERSION_PATCH=$4
195 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
196 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
197 # no way to encode that into an integer in general.
198 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
200 LIBO_VERSION_SUFFIX=$5
201 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
202 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
203 # they get undoubled before actually passed to sed.
204 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
205 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
206 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
207 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
209 AC_SUBST(LIBO_VERSION_MAJOR)
210 AC_SUBST(LIBO_VERSION_MINOR)
211 AC_SUBST(LIBO_VERSION_MICRO)
212 AC_SUBST(LIBO_VERSION_PATCH)
213 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
214 AC_SUBST(LIBO_VERSION_SUFFIX)
215 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
217 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
218 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
219 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
220 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
222 LIBO_THIS_YEAR=`date +%Y`
223 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
225 dnl ===================================================================
227 dnl ===================================================================
228 AC_MSG_CHECKING([for product version])
229 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
230 AC_MSG_RESULT([$PRODUCTVERSION])
231 AC_SUBST(PRODUCTVERSION)
234 # AC_PROG_EGREP doesn't set GREP on all systems as well
235 AC_PATH_PROG(GREP, grep)
243 dnl ======================================
244 dnl Required GObject introspection version
245 dnl ======================================
246 INTROSPECTION_REQUIRED_VERSION=1.32.0
248 dnl ===================================================================
249 dnl Search all the common names for GNU Make
250 dnl ===================================================================
251 AC_MSG_CHECKING([for GNU Make])
253 # try to use our own make if it is available and GNUMAKE was not already defined
254 if test -z "$GNUMAKE"; then
255 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
256 GNUMAKE="$LODE_HOME/opt/bin/make"
257 elif test -x "/opt/lo/bin/make"; then
258 GNUMAKE="/opt/lo/bin/make"
263 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
264 if test -n "$a"; then
265 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
266 if test $? -eq 0; then
267 if test "$build_os" = "cygwin"; then
268 if test -n "$($a -v | grep 'Built for Windows')" ; then
269 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
270 GNUMAKE_WIN_NATIVE="TRUE"
281 AC_MSG_RESULT($GNUMAKE)
282 if test -z "$GNUMAKE"; then
283 AC_MSG_ERROR([not found. install GNU Make.])
285 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
286 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
290 win_short_path_for_make()
292 local_short_path="$1"
293 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
294 cygpath -sm "$local_short_path"
296 cygpath -u "$(cygpath -d "$local_short_path")"
301 if test "$build_os" = "cygwin"; then
302 PathFormat "$SRC_ROOT"
303 SRC_ROOT="$formatted_path"
304 PathFormat "$BUILDDIR"
305 BUILDDIR="$formatted_path"
307 AC_MSG_CHECKING(for explicit COMSPEC)
308 if test -z "$COMSPEC"; then
309 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
311 AC_MSG_RESULT([found: $COMSPEC])
318 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
319 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
321 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
322 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
325 # need sed in os checks...
326 AC_PATH_PROGS(SED, sed)
327 if test -z "$SED"; then
328 AC_MSG_ERROR([install sed to run this script])
331 # Set the ENABLE_LTO variable
332 # ===================================================================
333 AC_MSG_CHECKING([whether to use link-time optimization])
334 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
337 AC_DEFINE(STATIC_LINKING)
344 AC_ARG_ENABLE(fuzz-options,
345 AS_HELP_STRING([--enable-fuzz-options],
346 [Randomly enable or disable each of those configurable options
347 that are supposed to be freely selectable without interdependencies,
348 or where bad interaction from interdependencies is automatically avoided.])
351 dnl ===================================================================
352 dnl When building for Android, --with-android-ndk,
353 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
355 dnl ===================================================================
357 AC_ARG_WITH(android-ndk,
358 AS_HELP_STRING([--with-android-ndk],
359 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
362 AC_ARG_WITH(android-ndk-toolchain-version,
363 AS_HELP_STRING([--with-android-ndk-toolchain-version],
364 [Specify which toolchain version to use, of those present in the
365 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
366 with_android_ndk_toolchain_version=clang5.0)
368 AC_ARG_WITH(android-sdk,
369 AS_HELP_STRING([--with-android-sdk],
370 [Specify location of the Android SDK. Mandatory when building for Android.]),
374 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
375 with_android_ndk="$SRC_ROOT/external/android-ndk"
377 if test -n "$with_android_ndk"; then
378 ANDROID_NDK_HOME=$with_android_ndk
380 # Set up a lot of pre-canned defaults
382 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
383 if test ! -f $ANDROID_NDK_HOME/source.properties; then
384 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
386 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
388 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
390 if test -z "$ANDROID_NDK_VERSION"; then
391 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
393 case $ANDROID_NDK_VERSION in
395 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
397 11.1.*|12.1.*|13.1.*|14.1.*)
398 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
403 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk.])
404 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk."
409 android_cpu=$host_cpu
410 ANDROID_ARCH=$android_cpu
411 if test $host_cpu = arm; then
412 android_platform_prefix=$android_cpu-linux-androideabi
413 android_gnu_prefix=$android_platform_prefix
414 LLVM_TRIPLE=armv7-none-linux-androideabi
415 ANDROID_APP_ABI=armeabi-v7a
416 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
417 elif test $host_cpu = aarch64; then
418 android_platform_prefix=$android_cpu-linux-android
419 android_gnu_prefix=$android_platform_prefix
420 LLVM_TRIPLE=aarch64-none-linux-android
421 # minimum android version that supports aarch64
423 ANDROID_APP_ABI=arm64-v8a
425 elif test $host_cpu = mips; then
426 android_platform_prefix=mipsel-linux-android
427 android_gnu_prefix=$android_platform_prefix
428 LLVM_TRIPLE=mipsel-none-linux-android
431 # host_cpu is something like "i386" or "i686" I guess, NDK uses
432 # "x86" in some contexts
434 android_platform_prefix=$android_cpu
435 android_gnu_prefix=i686-linux-android
436 LLVM_TRIPLE=i686-none-linux-android
438 ANDROID_ARCH=$android_cpu
439 ANDROIDCFLAGS="-march=atom"
442 case "$with_android_ndk_toolchain_version" in
444 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
445 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION
446 ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm
449 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
452 if test ! -d $ANDROID_BINUTILS_DIR; then
453 AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
454 elif test ! -d $ANDROID_COMPILER_DIR; then
455 AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
458 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
459 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
460 # manage to link the (app-specific) single huge .so that is built for the app in
461 # android/source/ if there is debug information in a significant part of the object files.
462 # (A 64-bit ld.gold grows to much over 10 gigabytes of virtual space when linking such a .so if
463 # all objects have been built with debug information.)
472 AC_MSG_ERROR([We only support building for Android from Linux or OS X])
475 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64/bin
476 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64
477 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
479 test -z "$SYSBASE" && SYSBASE=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}
480 test -z "$AR" && AR=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ar
481 test -z "$NM" && NM=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-nm
482 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-objdump
483 test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ranlib
484 test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-strip
486 ANDROIDCFLAGS="$ANDROIDCFLAGS -gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT -target $LLVM_TRIPLE$ANDROID_API_LEVEL -no-canonical-prefixes"
487 # android is using different sysroots for compilation and linking, but as
488 # there is no full separation in configure and elsewhere, use isystem for
489 # compilation stuff and sysroot for linking
490 ANDROIDCFLAGS="$ANDROIDCFLAGS -D__ANDROID_API__=$ANDROID_API_LEVEL -isystem $ANDROID_NDK_HOME/sysroot/usr/include"
491 ANDROIDCFLAGS="$ANDROIDCFLAGS -isystem $ANDROID_NDK_HOME/sysroot/usr/include/$android_gnu_prefix"
492 ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$SYSBASE -ffunction-sections -fdata-sections -Qunused-arguments"
493 if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
494 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI -D_GTHREAD_USE_MUTEX_INIT_FUNC=1"
496 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/$ANDROID_APP_ABI"
498 if test "$ENABLE_LTO" = TRUE; then
499 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
500 # $CC and $CXX when building external libraries
501 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
504 if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
505 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI/include -std=c++11"
507 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"
510 if test -z "$CC"; then
511 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
513 if test -z "$CXX"; then
514 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
517 # remember to download the ownCloud Android library later
518 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
520 AC_SUBST(ANDROID_NDK_HOME)
521 AC_SUBST(ANDROID_APP_ABI)
522 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
524 dnl ===================================================================
525 dnl --with-android-sdk
526 dnl ===================================================================
528 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
529 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
531 if test -n "$with_android_sdk"; then
532 ANDROID_SDK_HOME=$with_android_sdk
533 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
535 AC_SUBST(ANDROID_SDK_HOME)
537 dnl ===================================================================
538 dnl The following is a list of supported systems.
539 dnl Sequential to keep the logic very simple
540 dnl These values may be checked and reset later.
541 dnl ===================================================================
542 #defaults unless the os test overrides this:
550 # Default values, as such probably valid just for Linux, set
551 # differently below just for Mac OSX,but at least better than
552 # hardcoding these as we used to do. Much of this is duplicated also
553 # in solenv for old build system and for gbuild, ideally we should
554 # perhaps define stuff like this only here in configure.ac?
556 LINKFLAGSSHL="-shared"
560 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
563 INSTROOTCONTENTSUFFIX=
570 build_gstreamer_1_0=yes
571 build_gstreamer_0_10=yes
575 dnl ===========================================================
576 dnl Check whether we're using Solaris 10 - SPARC or Intel.
577 dnl ===========================================================
578 AC_MSG_CHECKING([the Solaris operating system release])
579 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
580 if test "$_os_release" -lt "10"; then
581 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
583 AC_MSG_RESULT([ok ($_os_release)])
586 dnl Check whether we're using a SPARC or i386 processor
587 AC_MSG_CHECKING([the processor type])
588 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
589 AC_MSG_RESULT([ok ($host_cpu)])
591 AC_MSG_ERROR([only SPARC and i386 processors are supported])
595 linux-gnu*|k*bsd*-gnu*)
597 build_gstreamer_1_0=yes
598 build_gstreamer_0_10=yes
603 if test "$enable_fuzzers" != yes; then
609 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
622 # When building on Windows normally with MSVC under Cygwin,
623 # configure thinks that the host platform (the platform the
624 # built code will run on) is Cygwin, even if it obviously is
625 # Windows, which in Autoconf terminology is called
626 # "mingw32". (Which is misleading as MinGW is the name of the
627 # tool-chain, not an operating system.)
629 # Somewhat confusing, yes. But this configure script doesn't
630 # look at $host etc that much, it mostly uses its own $_os
631 # variable, set here in this case statement.
645 darwin*) # Mac OS X or iOS
652 if test -n "$LODE_HOME" ; then
654 AC_MSG_NOTICE([sanitized the PATH to $PATH])
656 if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
661 enable_mpl_subset=yes
662 enable_lotuswordpro=no
665 enable_postgresql_sdbc=no
666 enable_extension_integration=no
667 enable_report_builder=no
670 if test "$enable_ios_simulator" = "yes"; then
671 host=x86_64-apple-darwin
675 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
676 INSTROOTCONTENTSUFFIX=/Contents
677 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
679 # See comment above the case "$host_os"
680 LINKFLAGSSHL="-dynamiclib -single_module"
687 # -undefined error is the default
693 build_gstreamer_1_0=yes
694 build_gstreamer_0_10=yes
700 AC_MSG_CHECKING([the FreeBSD operating system release])
701 if test -n "$with_os_version"; then
702 OSVERSION="$with_os_version"
704 OSVERSION=`/sbin/sysctl -n kern.osreldate`
706 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
707 AC_MSG_CHECKING([which thread library to use])
708 if test "$OSVERSION" -lt "500016"; then
709 PTHREAD_CFLAGS="-D_THREAD_SAFE"
710 PTHREAD_LIBS="-pthread"
711 elif test "$OSVERSION" -lt "502102"; then
712 PTHREAD_CFLAGS="-D_THREAD_SAFE"
716 PTHREAD_LIBS="-pthread"
718 AC_MSG_RESULT([$PTHREAD_LIBS])
724 build_gstreamer_1_0=yes
725 build_gstreamer_0_10=yes
731 PTHREAD_LIBS="-pthread -lpthread"
738 PTHREAD_LIBS=-pthread
745 PTHREAD_CFLAGS="-D_THREAD_SAFE"
746 PTHREAD_LIBS="-pthread"
752 build_gstreamer_1_0=yes
753 build_gstreamer_0_10=yes
759 PTHREAD_LIBS="-pthread"
764 build_gstreamer_1_0=no
765 build_gstreamer_0_10=no
766 enable_lotuswordpro=no
767 enable_mpl_subset=yes
770 enable_report_builder=no
772 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" != "WINNT"; then
816 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
822 if test "$_os" = "Android" ; then
823 # Verify that the NDK and SDK options are proper
824 if test -z "$with_android_ndk"; then
825 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
826 elif test ! -f "$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}/usr/lib/libc.a"; then
827 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
830 if test -z "$ANDROID_SDK_HOME"; then
831 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
832 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
833 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
836 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
837 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
838 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
839 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
840 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
841 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
842 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
843 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
845 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
846 AC_MSG_WARN([android support repository not found - install with
847 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
848 to allow the build to download the specified version of the android support libraries])
849 add_warning "android support repository not found - install with"
850 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
851 add_warning "to allow the build to download the specified version of the android support libraries"
855 if test "$_os" = "AIX"; then
856 AC_PATH_PROG(GAWK, gawk)
857 if test -z "$GAWK"; then
858 AC_MSG_ERROR([gawk not found in \$PATH])
864 AC_SUBST(PTHREAD_CFLAGS)
865 AC_SUBST(PTHREAD_LIBS)
867 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
868 # By default use the ones specified by our build system,
869 # but explicit override is possible.
870 AC_MSG_CHECKING(for explicit AFLAGS)
871 if test -n "$AFLAGS"; then
872 AC_MSG_RESULT([$AFLAGS])
878 AC_MSG_CHECKING(for explicit CFLAGS)
879 if test -n "$CFLAGS"; then
880 AC_MSG_RESULT([$CFLAGS])
886 AC_MSG_CHECKING(for explicit CXXFLAGS)
887 if test -n "$CXXFLAGS"; then
888 AC_MSG_RESULT([$CXXFLAGS])
894 AC_MSG_CHECKING(for explicit OBJCFLAGS)
895 if test -n "$OBJCFLAGS"; then
896 AC_MSG_RESULT([$OBJCFLAGS])
902 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
903 if test -n "$OBJCXXFLAGS"; then
904 AC_MSG_RESULT([$OBJCXXFLAGS])
910 AC_MSG_CHECKING(for explicit LDFLAGS)
911 if test -n "$LDFLAGS"; then
912 AC_MSG_RESULT([$LDFLAGS])
922 AC_SUBST(OBJCXXFLAGS)
927 AC_SUBST(x_OBJCFLAGS)
928 AC_SUBST(x_OBJCXXFLAGS)
931 dnl These are potentially set for MSVC, in the code checking for UCRT below:
932 my_original_CFLAGS=$CFLAGS
933 my_original_CXXFLAGS=$CXXFLAGS
934 my_original_CPPFLAGS=$CPPFLAGS
936 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
937 dnl Needs to precede the AC_SEARCH_LIBS call below, which apparently calls
938 dnl AC_PROG_CC internally.
939 if test "$_os" != "WINNT"; then
940 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
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([--enable-split-debug],
1136 [Uses split debug information (-gsplit-dwarf compile flag). Saves disk space and build time,
1137 but requires tools that support it (both build tools and debuggers).]))
1139 libo_FUZZ_ARG_ENABLE(gdb-index,
1140 AS_HELP_STRING([--enable-gdb-index],
1141 [Creates debug information in the gdb index format, which makes gdb start faster.
1142 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-kde4],
1264 [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
1265 KDE4 are available.]),
1269 AS_HELP_STRING([--enable-qt5],
1270 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1275 AS_HELP_STRING([--enable-kde5],
1276 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1277 KF5 are available.]),
1280 AC_ARG_ENABLE(gtk3_kde5,
1281 AS_HELP_STRING([--enable-gtk3-kde5],
1282 [Determines whether to use Gtk3 vclplug with KDE file dialogs on
1283 platforms where Gtk3, Qt5 and Plasma is available.]),
1286 libo_FUZZ_ARG_ENABLE(gui,
1287 AS_HELP_STRING([--disable-gui],
1288 [Disable use of X11 or Wayland to reduce dependencies. Not related to the --headless
1289 command-line option. Not related to LibreOffice Online functionality. Don't use
1290 unless you are certain you need to. Nobody will help you if you insist on trying
1291 this and run into problems.]),
1292 ,test "${enable_gui+set}" = set || enable_gui=yes)
1294 libo_FUZZ_ARG_ENABLE(randr,
1295 AS_HELP_STRING([--disable-randr],
1296 [Disable RandR support in the vcl project.]),
1297 ,test "${enable_randr+set}" = set || enable_randr=yes)
1299 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1300 AS_HELP_STRING([--disable-gstreamer-1-0],
1301 [Disable building with the new gstreamer 1.0 avmedia backend.]),
1302 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1304 AC_ARG_ENABLE(gstreamer-0-10,
1305 AS_HELP_STRING([--enable-gstreamer-0-10],
1306 [Enable building with the gstreamer 0.10 avmedia backend.]),
1307 ,enable_gstreamer_0_10=no)
1309 libo_FUZZ_ARG_ENABLE(vlc,
1310 AS_HELP_STRING([--enable-vlc],
1311 [Enable building with the (experimental) VLC avmedia backend.]),
1312 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1314 libo_FUZZ_ARG_ENABLE(neon,
1315 AS_HELP_STRING([--disable-neon],
1316 [Disable neon and the compilation of webdav binding.]),
1319 libo_FUZZ_ARG_ENABLE([eot],
1320 [AS_HELP_STRING([--enable-eot],
1321 [Enable support for Embedded OpenType fonts.])],
1322 ,test "${enable_eot+set}" = set || enable_eot=no)
1324 libo_FUZZ_ARG_ENABLE(cve-tests,
1325 AS_HELP_STRING([--disable-cve-tests],
1326 [Prevent CVE tests to be executed]),
1329 libo_FUZZ_ARG_ENABLE(chart-tests,
1330 AS_HELP_STRING([--enable-chart-tests],
1331 [Executes chart XShape tests. In a perfect world these tests would be
1332 stable and everyone could run them, in reality it is best to run them
1333 only on a few machines that are known to work and maintained by people
1334 who can judge if a test failure is a regression or not.]),
1337 AC_ARG_ENABLE(build-unowinreg,
1338 AS_HELP_STRING([--enable-build-unowinreg],
1339 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1340 compiler is needed on Linux.]),
1343 AC_ARG_ENABLE(build-opensymbol,
1344 AS_HELP_STRING([--enable-build-opensymbol],
1345 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1346 fontforge installed.]),
1349 AC_ARG_ENABLE(dependency-tracking,
1350 AS_HELP_STRING([--enable-dependency-tracking],
1351 [Do not reject slow dependency extractors.])[
1352 --disable-dependency-tracking
1353 Disables generation of dependency information.
1354 Speed up one-time builds.],
1357 AC_ARG_ENABLE(icecream,
1358 AS_HELP_STRING([--enable-icecream],
1359 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1360 It defaults to /opt/icecream for the location of the icecream gcc/g++
1361 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1365 AS_HELP_STRING([--enable-ld=<linker>],
1366 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.]),
1369 libo_FUZZ_ARG_ENABLE(cups,
1370 AS_HELP_STRING([--disable-cups],
1371 [Do not build cups support.])
1374 AC_ARG_ENABLE(ccache,
1375 AS_HELP_STRING([--disable-ccache],
1376 [Do not try to use ccache automatically.
1377 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1378 CC/CXX are not yet set, and --enable-icecream is not given, we
1379 attempt to use ccache. --disable-ccache disables ccache completely.
1383 AC_ARG_ENABLE(64-bit,
1384 AS_HELP_STRING([--enable-64-bit],
1385 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1386 At the moment meaningful only for Windows.]), ,)
1388 libo_FUZZ_ARG_ENABLE(online-update,
1389 AS_HELP_STRING([--enable-online-update],
1390 [Enable the online update service that will check for new versions of
1391 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1392 If the value is "mar", the experimental Mozilla-like update will be
1393 enabled instead of the traditional update mechanism.]),
1396 AC_ARG_WITH(update-config,
1397 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1398 [Path to the update config ini file]))
1400 libo_FUZZ_ARG_ENABLE(extension-update,
1401 AS_HELP_STRING([--disable-extension-update],
1402 [Disable possibility to update installed extensions.]),
1405 libo_FUZZ_ARG_ENABLE(release-build,
1406 AS_HELP_STRING([--enable-release-build],
1407 [Enable release build. Note that the "release build" choice is orthogonal to
1408 whether symbols are present, debug info is generated, or optimization
1410 See http://wiki.documentfoundation.org/Development/DevBuild]),
1413 AC_ARG_ENABLE(windows-build-signing,
1414 AS_HELP_STRING([--enable-windows-build-signing],
1415 [Enable signing of windows binaries (*.exe, *.dll)]),
1418 AC_ARG_ENABLE(silent-msi,
1419 AS_HELP_STRING([--enable-silent-msi],
1420 [Enable MSI with LIMITUI=1 (silent install).]),
1423 AC_ARG_ENABLE(macosx-code-signing,
1424 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1425 [Sign executables, dylibs, frameworks and the app bundle. If you
1426 don't provide an identity the first suitable certificate
1427 in your keychain is used.]),
1430 AC_ARG_ENABLE(macosx-package-signing,
1431 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1432 [Create a .pkg suitable for uploading to the Mac App Store and sign
1433 it. If you don't provide an identity the first suitable certificate
1434 in your keychain is used.]),
1437 AC_ARG_ENABLE(macosx-sandbox,
1438 AS_HELP_STRING([--enable-macosx-sandbox],
1439 [Make the app bundle run in a sandbox. Requires code signing.
1440 Is required by apps distributed in the Mac App Store, and implies
1441 adherence to App Store rules.]),
1444 AC_ARG_WITH(macosx-bundle-identifier,
1445 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1446 [Define the OS X bundle identifier. Default is the somewhat weird
1447 org.libreoffice.script ("script", huh?).]),
1448 ,with_macosx_bundle_identifier=org.libreoffice.script)
1450 AC_ARG_WITH(product-name,
1451 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1452 [Define the product name. Default is AC_PACKAGE_NAME.]),
1453 ,with_product_name=$PRODUCTNAME)
1455 AC_ARG_WITH(package-version,
1456 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1457 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1460 libo_FUZZ_ARG_ENABLE(readonly-installset,
1461 AS_HELP_STRING([--enable-readonly-installset],
1462 [Prevents any attempts by LibreOffice to write into its installation. That means
1463 at least that no "system-wide" extensions can be added. Partly experimental work in
1464 progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
1467 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1468 AS_HELP_STRING([--disable-postgresql-sdbc],
1469 [Disable the build of the PostgreSQL-SDBC driver.])
1472 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1473 AS_HELP_STRING([--disable-lotuswordpro],
1474 [Disable the build of the Lotus Word Pro filter.]),
1475 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1477 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1478 AS_HELP_STRING([--disable-firebird-sdbc],
1479 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1480 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1482 AC_ARG_ENABLE(bogus-pkg-config,
1483 AS_HELP_STRING([--enable-bogus-pkg-config],
1484 [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.]),
1487 AC_ARG_ENABLE(openssl,
1488 AS_HELP_STRING([--disable-openssl],
1489 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1490 components will either use GNUTLS or NSS. Work in progress,
1491 use only if you are hacking on it.]),
1492 ,enable_openssl=yes)
1494 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1495 AS_HELP_STRING([--enable-cipher-openssl-backend],
1496 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1497 Requires --enable-openssl.]))
1499 AC_ARG_ENABLE(library-bin-tar,
1500 AS_HELP_STRING([--enable-library-bin-tar],
1501 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1502 Some libraries can save their build result in a tarball
1503 stored in TARFILE_LOCATION. That binary tarball is
1504 uniquely identified by the source tarball,
1505 the content of the config_host.mk file and the content
1506 of the top-level directory in core for that library
1507 If this option is enabled, then if such a tarfile exist, it will be untarred
1508 instead of the source tarfile, and the build step will be skipped for that
1510 If a proper tarfile does not exist, then the normal source-based
1511 build is done for that library and a proper binary tarfile is created
1512 for the next time.]),
1515 AC_ARG_ENABLE(dconf,
1516 AS_HELP_STRING([--disable-dconf],
1517 [Disable the dconf configuration backend (enabled by default where
1520 libo_FUZZ_ARG_ENABLE(formula-logger,
1522 [--enable-formula-logger],
1523 [Enable formula logger for logging formula calculation flow in Calc.]
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, *colibre, *elementary, *karasa_jaga, *sifr, *sifr_dark, *tango.]),
1587 libo_FUZZ_ARG_WITH(helppack-integration,
1588 AS_HELP_STRING([--without-helppack-integration],
1589 [It will not integrate the helppacks to the installer
1590 of the product. Please use this switch to use the online help
1591 or separate help packages.]),
1594 libo_FUZZ_ARG_WITH(fonts,
1595 AS_HELP_STRING([--without-fonts],
1596 [LibreOffice includes some third-party fonts to provide a reliable basis for
1597 help content, templates, samples, etc. When these fonts are already
1598 known to be available on the system then you should use this option.]),
1602 AS_HELP_STRING([--with-epm],
1603 [Decides which epm to use. Default is to use the one from the system if
1604 one is built. When either this is not there or you say =internal epm
1608 AC_ARG_WITH(package-format,
1609 AS_HELP_STRING([--with-package-format],
1610 [Specify package format(s) for LibreOffice installation sets. The
1611 implicit --without-package-format leads to no installation sets being
1612 generated. Possible values: aix, archive, bsd, deb, dmg,
1613 installed, msi, pkg, and rpm.
1614 Example: --with-package-format='deb rpm']),
1618 AS_HELP_STRING([--with-tls],
1619 [Decides which TLS/SSL and cryptographic implementations to use for
1620 LibreOffice's code. Notice that this doesn't apply for depending
1621 libraries like "neon", for example. Default is to use OpenSSL
1622 although NSS is also possible. Notice that selecting NSS restricts
1623 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1624 restrict by now the usage of NSS in LO's code. Possible values:
1625 openssl, nss. Example: --with-tls="nss"]),
1628 AC_ARG_WITH(system-libs,
1629 AS_HELP_STRING([--with-system-libs],
1630 [Use libraries already on system -- enables all --with-system-* flags.]),
1633 AC_ARG_WITH(system-bzip2,
1634 AS_HELP_STRING([--with-system-bzip2],
1635 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1636 [with_system_bzip2="$with_system_libs"])
1638 AC_ARG_WITH(system-headers,
1639 AS_HELP_STRING([--with-system-headers],
1640 [Use headers already on system -- enables all --with-system-* flags for
1641 external packages whose headers are the only entities used i.e.
1642 boost/odbc/sane-header(s).]),,
1643 [with_system_headers="$with_system_libs"])
1645 AC_ARG_WITH(system-jars,
1646 AS_HELP_STRING([--without-system-jars],
1647 [When building with --with-system-libs, also the needed jars are expected
1648 on the system. Use this to disable that]),,
1649 [with_system_jars="$with_system_libs"])
1651 AC_ARG_WITH(system-cairo,
1652 AS_HELP_STRING([--with-system-cairo],
1653 [Use cairo libraries already on system. Happens automatically for
1654 (implicit) --enable-gtk and for --enable-gtk3.]))
1656 AC_ARG_WITH(system-epoxy,
1657 AS_HELP_STRING([--with-system-epoxy],
1658 [Use epoxy libraries already on system. Happens automatically for
1660 [with_system_epoxy="$with_system_libs"])
1662 AC_ARG_WITH(myspell-dicts,
1663 AS_HELP_STRING([--with-myspell-dicts],
1664 [Adds myspell dictionaries to the LibreOffice installation set]),
1667 AC_ARG_WITH(system-dicts,
1668 AS_HELP_STRING([--without-system-dicts],
1669 [Do not use dictionaries from system paths.]),
1672 AC_ARG_WITH(external-dict-dir,
1673 AS_HELP_STRING([--with-external-dict-dir],
1674 [Specify external dictionary dir.]),
1677 AC_ARG_WITH(external-hyph-dir,
1678 AS_HELP_STRING([--with-external-hyph-dir],
1679 [Specify external hyphenation pattern dir.]),
1682 AC_ARG_WITH(external-thes-dir,
1683 AS_HELP_STRING([--with-external-thes-dir],
1684 [Specify external thesaurus dir.]),
1687 AC_ARG_WITH(system-zlib,
1688 AS_HELP_STRING([--with-system-zlib],
1689 [Use zlib already on system.]),,
1690 [with_system_zlib=auto])
1692 AC_ARG_WITH(system-jpeg,
1693 AS_HELP_STRING([--with-system-jpeg],
1694 [Use jpeg already on system.]),,
1695 [with_system_jpeg="$with_system_libs"])
1697 AC_ARG_WITH(system-clucene,
1698 AS_HELP_STRING([--with-system-clucene],
1699 [Use clucene already on system.]),,
1700 [with_system_clucene="$with_system_libs"])
1702 AC_ARG_WITH(system-expat,
1703 AS_HELP_STRING([--with-system-expat],
1704 [Use expat already on system.]),,
1705 [with_system_expat="$with_system_libs"])
1707 AC_ARG_WITH(system-libxml,
1708 AS_HELP_STRING([--with-system-libxml],
1709 [Use libxml/libxslt already on system.]),,
1710 [with_system_libxml=auto])
1712 AC_ARG_WITH(system-icu,
1713 AS_HELP_STRING([--with-system-icu],
1714 [Use icu already on system.]),,
1715 [with_system_icu="$with_system_libs"])
1717 AC_ARG_WITH(system-ucpp,
1718 AS_HELP_STRING([--with-system-ucpp],
1719 [Use ucpp already on system.]),,
1722 AC_ARG_WITH(system-openldap,
1723 AS_HELP_STRING([--with-system-openldap],
1724 [Use the OpenLDAP LDAP SDK already on system.]),,
1725 [with_system_openldap="$with_system_libs"])
1727 AC_ARG_WITH(system-poppler,
1728 AS_HELP_STRING([--with-system-poppler],
1729 [Use system poppler (only needed for PDF import).]),,
1730 [with_system_poppler="$with_system_libs"])
1732 AC_ARG_WITH(system-gpgmepp,
1733 AS_HELP_STRING([--with-system-gpgmepp],
1734 [Use gpgmepp already on system]),,
1735 [with_system_gpgmepp="$with_system_libs"])
1737 AC_ARG_WITH(system-apache-commons,
1738 AS_HELP_STRING([--with-system-apache-commons],
1739 [Use Apache commons libraries already on system.]),,
1740 [with_system_apache_commons="$with_system_jars"])
1742 AC_ARG_WITH(system-mariadb,
1743 AS_HELP_STRING([--with-system-mariadb],
1744 [Use MariaDB/MySQL libraries already on system.]),,
1745 [with_system_mariadb="$with_system_libs"])
1747 AC_ARG_ENABLE(bundle-mariadb,
1748 AS_HELP_STRING([--enable-bundle-mariadb],
1749 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
1752 AC_ARG_WITH(system-postgresql,
1753 AS_HELP_STRING([--with-system-postgresql],
1754 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1755 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1756 [with_system_postgresql="$with_system_libs"])
1758 AC_ARG_WITH(libpq-path,
1759 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1760 [Use this PostgreSQL C interface (libpq) installation for building
1761 the PostgreSQL-SDBC extension.]),
1764 AC_ARG_WITH(system-firebird,
1765 AS_HELP_STRING([--with-system-firebird],
1766 [Use Firebird libraries already on system, for building the Firebird-SDBC
1767 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1768 [with_system_firebird="$with_system_libs"])
1770 AC_ARG_WITH(system-libtommath,
1771 AS_HELP_STRING([--with-system-libtommath],
1772 [Use libtommath already on system]),,
1773 [with_system_libtommath="$with_system_libs"])
1775 AC_ARG_WITH(system-hsqldb,
1776 AS_HELP_STRING([--with-system-hsqldb],
1777 [Use hsqldb already on system.]))
1779 AC_ARG_WITH(hsqldb-jar,
1780 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1781 [Specify path to jarfile manually.]),
1782 HSQLDB_JAR=$withval)
1784 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1785 AS_HELP_STRING([--disable-scripting-beanshell],
1786 [Disable support for scripts in BeanShell.]),
1790 AC_ARG_WITH(system-beanshell,
1791 AS_HELP_STRING([--with-system-beanshell],
1792 [Use beanshell already on system.]),,
1793 [with_system_beanshell="$with_system_jars"])
1795 AC_ARG_WITH(beanshell-jar,
1796 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1797 [Specify path to jarfile manually.]),
1800 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1801 AS_HELP_STRING([--disable-scripting-javascript],
1802 [Disable support for scripts in JavaScript.]),
1806 AC_ARG_WITH(system-rhino,
1807 AS_HELP_STRING([--with-system-rhino],
1808 [Use rhino already on system.]),,)
1809 # [with_system_rhino="$with_system_jars"])
1810 # Above is not used as we have different debug interface
1811 # patched into internal rhino. This code needs to be fixed
1812 # before we can enable it by default.
1814 AC_ARG_WITH(rhino-jar,
1815 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1816 [Specify path to jarfile manually.]),
1819 AC_ARG_WITH(commons-logging-jar,
1820 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1821 [Specify path to jarfile manually.]),
1822 COMMONS_LOGGING_JAR=$withval)
1824 AC_ARG_WITH(system-jfreereport,
1825 AS_HELP_STRING([--with-system-jfreereport],
1826 [Use JFreeReport already on system.]),,
1827 [with_system_jfreereport="$with_system_jars"])
1829 AC_ARG_WITH(sac-jar,
1830 AS_HELP_STRING([--with-sac-jar=JARFILE],
1831 [Specify path to jarfile manually.]),
1834 AC_ARG_WITH(libxml-jar,
1835 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1836 [Specify path to jarfile manually.]),
1837 LIBXML_JAR=$withval)
1839 AC_ARG_WITH(flute-jar,
1840 AS_HELP_STRING([--with-flute-jar=JARFILE],
1841 [Specify path to jarfile manually.]),
1844 AC_ARG_WITH(jfreereport-jar,
1845 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1846 [Specify path to jarfile manually.]),
1847 JFREEREPORT_JAR=$withval)
1849 AC_ARG_WITH(liblayout-jar,
1850 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1851 [Specify path to jarfile manually.]),
1852 LIBLAYOUT_JAR=$withval)
1854 AC_ARG_WITH(libloader-jar,
1855 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1856 [Specify path to jarfile manually.]),
1857 LIBLOADER_JAR=$withval)
1859 AC_ARG_WITH(libformula-jar,
1860 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1861 [Specify path to jarfile manually.]),
1862 LIBFORMULA_JAR=$withval)
1864 AC_ARG_WITH(librepository-jar,
1865 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1866 [Specify path to jarfile manually.]),
1867 LIBREPOSITORY_JAR=$withval)
1869 AC_ARG_WITH(libfonts-jar,
1870 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1871 [Specify path to jarfile manually.]),
1872 LIBFONTS_JAR=$withval)
1874 AC_ARG_WITH(libserializer-jar,
1875 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1876 [Specify path to jarfile manually.]),
1877 LIBSERIALIZER_JAR=$withval)
1879 AC_ARG_WITH(libbase-jar,
1880 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1881 [Specify path to jarfile manually.]),
1882 LIBBASE_JAR=$withval)
1884 AC_ARG_WITH(system-odbc,
1885 AS_HELP_STRING([--with-system-odbc],
1886 [Use the odbc headers already on system.]),,
1887 [with_system_odbc="auto"])
1889 AC_ARG_WITH(system-sane,
1890 AS_HELP_STRING([--with-system-sane],
1891 [Use sane.h already on system.]),,
1892 [with_system_sane="$with_system_headers"])
1894 AC_ARG_WITH(system-bluez,
1895 AS_HELP_STRING([--with-system-bluez],
1896 [Use bluetooth.h already on system.]),,
1897 [with_system_bluez="$with_system_headers"])
1899 AC_ARG_WITH(system-curl,
1900 AS_HELP_STRING([--with-system-curl],
1901 [Use curl already on system.]),,
1902 [with_system_curl=auto])
1904 AC_ARG_WITH(system-boost,
1905 AS_HELP_STRING([--with-system-boost],
1906 [Use boost already on system.]),,
1907 [with_system_boost="$with_system_headers"])
1909 AC_ARG_WITH(system-glm,
1910 AS_HELP_STRING([--with-system-glm],
1911 [Use glm already on system.]),,
1912 [with_system_glm="$with_system_headers"])
1914 AC_ARG_WITH(system-hunspell,
1915 AS_HELP_STRING([--with-system-hunspell],
1916 [Use libhunspell already on system.]),,
1917 [with_system_hunspell="$with_system_libs"])
1919 AC_ARG_WITH(system-mythes,
1920 AS_HELP_STRING([--with-system-mythes],
1921 [Use mythes already on system.]),,
1922 [with_system_mythes="$with_system_libs"])
1924 AC_ARG_WITH(system-altlinuxhyph,
1925 AS_HELP_STRING([--with-system-altlinuxhyph],
1926 [Use ALTLinuxhyph already on system.]),,
1927 [with_system_altlinuxhyph="$with_system_libs"])
1929 AC_ARG_WITH(system-lpsolve,
1930 AS_HELP_STRING([--with-system-lpsolve],
1931 [Use lpsolve already on system.]),,
1932 [with_system_lpsolve="$with_system_libs"])
1934 AC_ARG_WITH(system-coinmp,
1935 AS_HELP_STRING([--with-system-coinmp],
1936 [Use CoinMP already on system.]),,
1937 [with_system_coinmp="$with_system_libs"])
1939 AC_ARG_WITH(system-liblangtag,
1940 AS_HELP_STRING([--with-system-liblangtag],
1941 [Use liblangtag library already on system.]),,
1942 [with_system_liblangtag="$with_system_libs"])
1945 AS_HELP_STRING([--with-webdav],
1946 [Specify which library to use for webdav implementation.
1947 Possible values: "neon", "serf", "no". The default value is "neon".
1948 Example: --with-webdav="serf"]),
1949 WITH_WEBDAV=$withval,
1952 AC_ARG_WITH(linker-hash-style,
1953 AS_HELP_STRING([--with-linker-hash-style],
1954 [Use linker with --hash-style=<style> when linking shared objects.
1955 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1956 if supported on the build system, and "sysv" otherwise.]))
1958 AC_ARG_WITH(jdk-home,
1959 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
1960 [If you have installed JDK 1.6 or later on your system please supply the
1961 path here. Note that this is not the location of the java command but the
1962 location of the entire distribution.]),
1966 AS_HELP_STRING([--with-help],
1967 [Enable the build of help. There is a special parameter "common" that
1968 can be used to bundle only the common part, .e.g help-specific icons.
1969 This is useful when you build the helpcontent separately.])
1971 Usage: --with-help build the old local help
1972 --without-help no local help (default)
1973 --with-help=html build the new HTML local help
1974 --with-help=online build the new HTML online help
1978 libo_FUZZ_ARG_WITH(java,
1979 AS_HELP_STRING([--with-java=<java command>],
1980 [Specify the name of the Java interpreter command. Typically "java"
1981 which is the default.
1983 To build without support for Java components, applets, accessibility
1984 or the XML filters written in Java, use --without-java or --with-java=no.]),
1985 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1986 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
1989 AC_ARG_WITH(jvm-path,
1990 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
1991 [Use a specific JVM search path at runtime.
1992 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
1995 AC_ARG_WITH(ant-home,
1996 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
1997 [If you have installed Jakarta Ant on your system, please supply the path here.
1998 Note that this is not the location of the Ant binary but the location
1999 of the entire distribution.]),
2002 AC_ARG_WITH(symbol-config,
2003 AS_HELP_STRING([--with-symbol-config],
2004 [Configuration for the crashreport symbol upload]),
2006 [with_symbol_config=no])
2008 AC_ARG_WITH(export-validation,
2009 AS_HELP_STRING([--without-export-validation],
2010 [Disable validating OOXML and ODF files as exported from in-tree tests.
2011 Use this option e.g. if your system only provides Java 5.]),
2012 ,with_export_validation=auto)
2014 AC_ARG_WITH(bffvalidator,
2015 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2016 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2017 Requires installed Microsoft Office Binary File Format Validator.
2018 Note: export-validation (--with-export-validation) is required to be turned on.
2019 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2020 ,with_bffvalidator=no)
2022 libo_FUZZ_ARG_WITH(junit,
2023 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2024 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2025 --without-junit disables those tests. Not relevant in the --without-java case.]),
2028 AC_ARG_WITH(hamcrest,
2029 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2030 [Specifies the hamcrest jar file to use for JUnit-based tests.
2031 --without-junit disables those tests. Not relevant in the --without-java case.]),
2034 AC_ARG_WITH(perl-home,
2035 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2036 [If you have installed Perl 5 Distribution, on your system, please
2037 supply the path here. Note that this is not the location of the Perl
2038 binary but the location of the entire distribution.]),
2041 libo_FUZZ_ARG_WITH(doxygen,
2043 [--with-doxygen=<absolute path to doxygen executable>],
2044 [Specifies the doxygen executable to use when generating ODK C/C++
2045 documentation. --without-doxygen disables generation of ODK C/C++
2046 documentation. Not relevant in the --disable-odk case.]),
2049 AC_ARG_WITH(visual-studio,
2050 AS_HELP_STRING([--with-visual-studio=<2017>],
2051 [Specify which Visual Studio version to use in case several are
2052 installed. Currently only 2017 is supported.]),
2055 AC_ARG_WITH(windows-sdk,
2056 AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
2057 [Specify which Windows SDK, or "Windows Kit", version to use
2058 in case the one that came with the selected Visual Studio
2059 is not what you want for some reason. Note that not all compiler/SDK
2060 combinations are supported. The intent is that this option should not
2065 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2066 [Use this option to build LibreOffice with additional UI language support.
2067 English (US) is always included by default.
2068 Separate multiple languages with space.
2069 For all languages, use --with-lang=ALL.]),
2072 AC_ARG_WITH(locales,
2073 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2074 [Use this option to limit the locale information built in.
2075 Separate multiple locales with space.
2076 Very experimental and might well break stuff.
2077 Just a desperate measure to shrink code and data size.
2078 By default all the locales available is included.
2079 This option is completely unrelated to --with-lang.])
2081 Affects also our character encoding conversion
2082 tables for encodings mainly targeted for a
2083 particular locale, like EUC-CN and EUC-TW for
2084 zh, ISO-2022-JP for ja.
2086 Affects also our add-on break iterator data for
2089 For the default, all locales, don't use this switch at all.
2090 Specifying just the language part of a locale means all matching
2091 locales will be included.
2095 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2096 libo_FUZZ_ARG_WITH(krb5,
2097 AS_HELP_STRING([--with-krb5],
2098 [Enable MIT Kerberos 5 support in modules that support it.
2099 By default automatically enabled on platforms
2100 where a good system Kerberos 5 is available.]),
2103 libo_FUZZ_ARG_WITH(gssapi,
2104 AS_HELP_STRING([--with-gssapi],
2105 [Enable GSSAPI support in modules that support it.
2106 By default automatically enabled on platforms
2107 where a good system GSSAPI is available.]),
2111 AS_HELP_STRING([--with-iwyu],
2112 [Use given IWYU binary path to check unneeded includes instead of building.
2113 Use only if you are hacking on it.]),
2116 libo_FUZZ_ARG_WITH(lxml,
2117 AS_HELP_STRING([--without-lxml],
2118 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2119 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2120 report widget classes and ids.]),
2123 dnl ===================================================================
2125 dnl ===================================================================
2127 AC_ARG_WITH(branding,
2128 AS_HELP_STRING([--with-branding=/path/to/images],
2129 [Use given path to retrieve branding images set.])
2131 Search for intro.png about.svg and flat_logo.svg.
2132 If any is missing, default ones will be used instead.
2134 Search also progress.conf for progress
2135 settings on intro screen :
2137 PROGRESSBARCOLOR="255,255,255" Set color of
2138 progress bar. Comma separated RGB decimal values.
2139 PROGRESSSIZE="407,6" Set size of progress bar.
2140 Comma separated decimal values (width, height).
2141 PROGRESSPOSITION="61,317" Set position of progress
2142 bar from left,top. Comma separated decimal values.
2143 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2144 bar frame. Comma separated RGB decimal values.
2145 PROGRESSTEXTCOLOR="255,255,255" Set color of progress
2146 bar text. Comma separated RGB decimal values.
2147 PROGRESSTEXTBASELINE="287" Set vertical position of
2148 progress bar text from top. Decimal value.
2150 Default values will be used if not found.
2155 AC_ARG_WITH(extra-buildid,
2156 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2157 [Show addition build identification in about dialog.]),
2162 AS_HELP_STRING([--with-vendor="John the Builder"],
2163 [Set vendor of the build.]),
2166 AC_ARG_WITH(android-package-name,
2167 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2168 [Set Android package name of the build.]),
2171 AC_ARG_WITH(compat-oowrappers,
2172 AS_HELP_STRING([--with-compat-oowrappers],
2173 [Install oo* wrappers in parallel with
2174 lo* ones to keep backward compatibility.
2175 Has effect only with make distro-pack-install]),
2178 AC_ARG_WITH(os-version,
2179 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2180 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2183 AC_ARG_WITH(mingw-cross-compiler,
2184 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2185 [Specify the MinGW cross-compiler to use.
2186 When building on the ODK on Unix and building unowinreg.dll,
2187 specify the MinGW C++ cross-compiler.]),
2190 AC_ARG_WITH(idlc-cpp,
2191 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2192 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2195 AC_ARG_WITH(build-version,
2196 AS_HELP_STRING([--with-build-version="Built by Jim"],
2197 [Allows the builder to add a custom version tag that will appear in the
2198 Help/About box for QA purposes.]),
2199 with_build_version=$withval,
2202 AC_ARG_WITH(parallelism,
2203 AS_HELP_STRING([--with-parallelism],
2204 [Number of jobs to run simultaneously during build. Parallel builds can
2205 save a lot of time on multi-cpu machines. Defaults to the number of
2206 CPUs on the machine, unless you configure --enable-icecream - then to
2210 AC_ARG_WITH(all-tarballs,
2211 AS_HELP_STRING([--with-all-tarballs],
2212 [Download all external tarballs unconditionally]))
2214 AC_ARG_WITH(gdrive-client-id,
2215 AS_HELP_STRING([--with-gdrive-client-id],
2216 [Provides the client id of the application for OAuth2 authentication
2217 on Google Drive. If either this or --with-gdrive-client-secret is
2218 empty, the feature will be disabled]),
2221 AC_ARG_WITH(gdrive-client-secret,
2222 AS_HELP_STRING([--with-gdrive-client-secret],
2223 [Provides the client secret of the application for OAuth2
2224 authentication on Google Drive. If either this or
2225 --with-gdrive-client-id is empty, the feature will be disabled]),
2228 AC_ARG_WITH(alfresco-cloud-client-id,
2229 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2230 [Provides the client id of the application for OAuth2 authentication
2231 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2232 empty, the feature will be disabled]),
2235 AC_ARG_WITH(alfresco-cloud-client-secret,
2236 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2237 [Provides the client secret of the application for OAuth2
2238 authentication on Alfresco Cloud. If either this or
2239 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2242 AC_ARG_WITH(onedrive-client-id,
2243 AS_HELP_STRING([--with-onedrive-client-id],
2244 [Provides the client id of the application for OAuth2 authentication
2245 on OneDrive. If either this or --with-onedrive-client-secret is
2246 empty, the feature will be disabled]),
2249 AC_ARG_WITH(onedrive-client-secret,
2250 AS_HELP_STRING([--with-onedrive-client-secret],
2251 [Provides the client secret of the application for OAuth2
2252 authentication on OneDrive. If either this or
2253 --with-onedrive-client-id is empty, the feature will be disabled]),
2255 dnl ===================================================================
2256 dnl Do we want to use pre-build binary tarball for recompile
2257 dnl ===================================================================
2259 if test "$enable_library_bin_tar" = "yes" ; then
2260 USE_LIBRARY_BIN_TAR=TRUE
2262 USE_LIBRARY_BIN_TAR=
2264 AC_SUBST(USE_LIBRARY_BIN_TAR)
2266 dnl ===================================================================
2267 dnl Test whether build target is Release Build
2268 dnl ===================================================================
2269 AC_MSG_CHECKING([whether build target is Release Build])
2270 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2272 ENABLE_RELEASE_BUILD=
2274 AC_MSG_RESULT([yes])
2275 ENABLE_RELEASE_BUILD=TRUE
2277 AC_SUBST(ENABLE_RELEASE_BUILD)
2279 dnl ===================================================================
2280 dnl Test whether to sign Windows Build
2281 dnl ===================================================================
2282 AC_MSG_CHECKING([whether to sign windows build])
2283 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2284 AC_MSG_RESULT([yes])
2285 WINDOWS_BUILD_SIGNING="TRUE"
2288 WINDOWS_BUILD_SIGNING="FALSE"
2290 AC_SUBST(WINDOWS_BUILD_SIGNING)
2292 dnl ===================================================================
2293 dnl MacOSX build and runtime environment options
2294 dnl ===================================================================
2296 AC_ARG_WITH(macosx-sdk,
2297 AS_HELP_STRING([--with-macosx-sdk=<version>],
2298 [Prefer a specific SDK for building.])
2300 If the requested SDK is not available, a search for the oldest one will be done.
2301 With current Xcode versions, only the latest SDK is included, so this option is
2302 not terribly useful. It works fine to build with a new SDK and run the result
2305 e. g.: --with-macosx-sdk=10.9
2307 there are 3 options to control the MacOSX build:
2308 --with-macosx-sdk (referred as 'sdk' below)
2309 --with-macosx-version-min-required (referred as 'min' below)
2310 --with-macosx-version-max-allowed (referred as 'max' below)
2312 the connection between these value and the default they take is as follow:
2313 ( ? means not specified on the command line, s means the SDK version found,
2314 constraint: 8 <= x <= y <= z)
2316 ==========================================
2317 command line || config result
2318 ==========================================
2319 min | max | sdk || min | max | sdk |
2320 ? | ? | ? || 10.9 | 10.s | 10.s |
2321 ? | ? | 10.x || 10.9 | 10.x | 10.x |
2322 ? | 10.x | ? || 10.9 | 10.s | 10.s |
2323 ? | 10.x | 10.y || 10.9 | 10.x | 10.y |
2324 10.x | ? | ? || 10.x | 10.s | 10.s |
2325 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2326 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2327 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2330 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2331 for a detailed technical explanation of these variables
2333 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2337 AC_ARG_WITH(macosx-version-min-required,
2338 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2339 [set the minimum OS version needed to run the built LibreOffice])
2341 e. g.: --with-macos-version-min-required=10.9
2342 see --with-macosx-sdk for more info
2346 AC_ARG_WITH(macosx-version-max-allowed,
2347 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2348 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2350 e. g.: --with-macos-version-max-allowed=10.9
2351 see --with-macosx-sdk for more info
2356 dnl ===================================================================
2357 dnl options for stuff used during cross-compilation build
2358 dnl Not quite superseded by --with-build-platform-configure-options.
2359 dnl TODO: check, if the "force" option is still needed anywhere.
2360 dnl ===================================================================
2362 AC_ARG_WITH(system-icu-for-build,
2363 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2364 [Use icu already on system for build tools (cross-compilation only).]))
2367 dnl ===================================================================
2368 dnl Check for incompatible options set by fuzzing, and reset those
2369 dnl automatically to working combinations
2370 dnl ===================================================================
2372 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2373 "$enable_dbus" != "$enable_avahi"; then
2374 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2375 enable_avahi=$enable_dbus
2378 dnl ===================================================================
2379 dnl check for required programs (grep, awk, sed, bash)
2380 dnl ===================================================================
2384 if test -n "$1"; then
2385 if test "$build_os" = "cygwin"; then
2386 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2388 new_path=`cygpath -sm "$formatted_path"`
2391 new_path=`cygpath -u "$formatted_path"`
2396 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2397 if test "$2" = "after"; then
2398 LO_PATH="$LO_PATH${P_SEP}$new_path"
2400 LO_PATH="$new_path${P_SEP}$LO_PATH"
2408 AC_PATH_PROG( AWK, $AWK)
2409 if test -z "$AWK"; then
2410 AC_MSG_ERROR([install awk to run this script])
2413 AC_PATH_PROG(BASH, bash)
2414 if test -z "$BASH"; then
2415 AC_MSG_ERROR([bash not found in \$PATH])
2419 AC_MSG_CHECKING([for GNU or BSD tar])
2420 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2421 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2422 if test $? -eq 0; then
2427 AC_MSG_RESULT($GNUTAR)
2428 if test -z "$GNUTAR"; then
2429 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2433 AC_MSG_CHECKING([for tar's option to strip components])
2434 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2435 if test $? -eq 0; then
2436 STRIP_COMPONENTS="--strip-components"
2438 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2439 if test $? -eq 0; then
2440 STRIP_COMPONENTS="--strip-path"
2442 STRIP_COMPONENTS="unsupported"
2445 AC_MSG_RESULT($STRIP_COMPONENTS)
2446 if test x$STRIP_COMPONENTS = xunsupported; then
2447 AC_MSG_ERROR([you need a tar that is able to strip components.])
2449 AC_SUBST(STRIP_COMPONENTS)
2451 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2452 dnl desktop OSes from "mobile" ones.
2454 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2455 dnl In other words, that when building for an OS that is not a
2456 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2458 dnl Note the direction of the implication; there is no assumption that
2459 dnl cross-compiling would imply a non-desktop OS.
2461 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2462 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2463 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2464 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2467 # Whether to build "avmedia" functionality or not.
2469 if test -z "$enable_avmedia"; then
2473 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2474 if test "$enable_avmedia" = yes; then
2475 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2477 USE_AVMEDIA_DUMMY='TRUE'
2479 AC_SUBST(USE_AVMEDIA_DUMMY)
2481 # Decide whether to build database connectivity stuff (including
2482 # Base) or not. We probably don't want to on non-desktop OSes.
2483 if test -z "$enable_database_connectivity"; then
2484 # --disable-database-connectivity is unfinished work in progress
2485 # and the iOS test app doesn't link if we actually try to use it.
2486 # if test $_os != iOS -a $_os != Android; then
2487 if test $_os != iOS; then
2488 enable_database_connectivity=yes
2492 if test "$enable_database_connectivity" = yes; then
2493 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2494 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2497 if test -z "$enable_extensions"; then
2498 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2499 if test $_os != iOS -a $_os != Android; then
2500 enable_extensions=yes
2504 if test "$enable_extensions" = yes; then
2505 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2506 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2509 if test -z "$enable_scripting"; then
2510 # Disable scripting for iOS unless specifically overridden
2511 # with --enable-scripting.
2512 if test $_os != iOS; then
2513 enable_scripting=yes
2517 DISABLE_SCRIPTING=''
2518 if test "$enable_scripting" = yes; then
2519 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2520 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2522 DISABLE_SCRIPTING='TRUE'
2523 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2526 if test $_os = iOS -o $_os = Android; then
2527 # Disable dynamic_loading always for iOS and Android
2528 enable_dynamic_loading=no
2529 elif test -z "$enable_dynamic_loading"; then
2530 # Otherwise enable it unless speficically disabled
2531 enable_dynamic_loading=yes
2534 DISABLE_DYNLOADING=''
2535 if test "$enable_dynamic_loading" = yes; then
2536 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2538 DISABLE_DYNLOADING='TRUE'
2540 AC_SUBST(DISABLE_DYNLOADING)
2542 # remenber SYSBASE value
2545 dnl ===================================================================
2546 dnl Sort out various gallery compilation options
2547 dnl ===================================================================
2548 AC_MSG_CHECKING([how to build and package galleries])
2549 if test -n "${with_galleries}"; then
2550 if test "$with_galleries" = "build"; then
2551 WITH_GALLERY_BUILD=TRUE
2552 AC_MSG_RESULT([build from source images internally])
2553 elif test "$with_galleries" = "no"; then
2555 AC_MSG_RESULT([disable non-internal gallery build])
2557 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2560 if test $_os != iOS -a $_os != Android; then
2561 WITH_GALLERY_BUILD=TRUE
2562 AC_MSG_RESULT([internal src images for desktop])
2565 AC_MSG_RESULT([disable src image build])
2568 AC_SUBST(WITH_GALLERY_BUILD)
2570 dnl ===================================================================
2571 dnl Checks if ccache is available
2572 dnl ===================================================================
2573 if test "$_os" = "WINNT"; then
2574 # on windows/VC build do not use ccache
2576 elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2577 case "%$CC%$CXX%" in
2578 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2579 # assume that's good then
2580 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2581 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2584 AC_PATH_PROG([CCACHE],[ccache],[not found])
2585 if test "$CCACHE" = "not found"; then
2588 # Need to check for ccache version: otherwise prevents
2589 # caching of the results (like "-x objective-c++" for Mac)
2590 if test $_os = Darwin -o $_os = iOS; then
2591 # Check ccache version
2592 AC_MSG_CHECKING([whether version of ccache is suitable])
2593 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2594 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2595 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2596 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2598 AC_MSG_RESULT([no, $CCACHE_VERSION])
2609 if test "$CCACHE" != ""; then
2610 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2611 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2612 if test "$ccache_size" = ""; then
2613 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2614 if test "$ccache_size" = ""; then
2617 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2618 if test $ccache_size -lt 1024; then
2620 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2621 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2623 # warn that ccache may be too small for debug build
2624 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2625 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2628 if test $ccache_size -lt 5; then
2629 #warn that ccache may be too small for debug build
2630 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2631 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2636 dnl ===================================================================
2637 dnl Checks for C compiler,
2638 dnl The check for the C++ compiler is later on.
2639 dnl ===================================================================
2640 if test "$_os" != "WINNT"; then
2642 AC_MSG_CHECKING([gcc home])
2643 if test -z "$with_gcc_home"; then
2644 if test "$enable_icecream" = "yes"; then
2645 if test -d "/usr/lib/icecc/bin"; then
2646 GCC_HOME="/usr/lib/icecc/"
2647 elif test -d "/usr/libexec/icecc/bin"; then
2648 GCC_HOME="/usr/libexec/icecc/"
2649 elif test -d "/opt/icecream/bin"; then
2650 GCC_HOME="/opt/icecream/"
2652 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
2656 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2657 GCC_HOME_SET="false"
2660 GCC_HOME="$with_gcc_home"
2662 AC_MSG_RESULT($GCC_HOME)
2665 if test "$GCC_HOME_SET" = "true"; then
2666 if test -z "$CC"; then
2667 CC="$GCC_HOME/bin/gcc"
2669 if test -z "$CXX"; then
2670 CXX="$GCC_HOME/bin/g++"
2675 COMPATH=`dirname "$CC"`
2676 if test "$COMPATH" = "."; then
2677 AC_PATH_PROGS(COMPATH, $CC)
2678 dnl double square bracket to get single because of M4 quote...
2679 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2681 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2683 dnl ===================================================================
2685 dnl ===================================================================
2686 AC_MSG_CHECKING([whether to build with Java support])
2687 if test "$with_java" != "no"; then
2688 if test "$DISABLE_SCRIPTING" = TRUE; then
2689 AC_MSG_RESULT([no, overridden by --disable-scripting])
2693 AC_MSG_RESULT([yes])
2695 AC_DEFINE(HAVE_FEATURE_JAVA)
2702 AC_SUBST(ENABLE_JAVA)
2704 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2706 dnl ENABLE_JAVA="" indicate no Java support at all
2708 dnl ===================================================================
2709 dnl Check OS X SDK and compiler
2710 dnl ===================================================================
2712 if test $_os = Darwin -o $_os = iOS; then
2714 # If no --with-macosx-sdk option is given, look for one
2716 # The intent is that for "most" Mac-based developers, a suitable
2717 # SDK will be found automatically without any configure options.
2719 # For developers with a current Xcode, the lowest-numbered SDK
2720 # higher than or equal to the minimum required should be found.
2722 AC_MSG_CHECKING([what Mac OS X SDK to use])
2723 for _macosx_sdk in ${with_macosx_sdk-10.14 10.13 10.12}; do
2724 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2725 if test -d "$MACOSX_SDK_PATH"; then
2726 with_macosx_sdk="${_macosx_sdk}"
2729 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2730 if test -d "$MACOSX_SDK_PATH"; then
2731 with_macosx_sdk="${_macosx_sdk}"
2736 if test ! -d "$MACOSX_SDK_PATH"; then
2737 AC_MSG_ERROR([Could not find an appropriate Mac OS X SDK])
2740 if test $_os = iOS; then
2741 if test "$enable_ios_simulator" = "yes"; then
2742 useos=iphonesimulator
2746 MACOSX_SDK_PATH=`xcrun --sdk ${useos} --show-sdk-path 2> /dev/null`
2748 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2751 case $with_macosx_sdk in
2753 MACOSX_SDK_VERSION=101200
2756 MACOSX_SDK_VERSION=101300
2759 MACOSX_SDK_VERSION=101400
2762 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--14])
2766 if test "$with_macosx_version_min_required" = "" ; then
2767 with_macosx_version_min_required="10.9";
2770 if test "$with_macosx_version_max_allowed" = "" ; then
2771 with_macosx_version_max_allowed="$with_macosx_sdk"
2774 # export this so that "xcrun" invocations later return matching values
2775 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2776 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2777 export DEVELOPER_DIR
2778 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2779 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2781 case "$with_macosx_version_min_required" in
2783 MAC_OS_X_VERSION_MIN_REQUIRED="1090"
2786 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2789 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2792 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2795 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2798 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
2801 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.9--14])
2804 MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
2806 LIBTOOL=/usr/bin/libtool
2807 INSTALL_NAME_TOOL=install_name_tool
2808 if test -z "$save_CC"; then
2809 AC_MSG_CHECKING([what compiler to use])
2810 stdlib=-stdlib=libc++
2811 if test "$ENABLE_LTO" = TRUE; then
2814 CC="`xcrun -find clang` -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2815 CXX="`xcrun -find clang++` -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2816 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2819 STRIP=`xcrun -find strip`
2820 LIBTOOL=`xcrun -find libtool`
2821 RANLIB=`xcrun -find ranlib`
2822 AC_MSG_RESULT([$CC and $CXX])
2825 case "$with_macosx_version_max_allowed" in
2827 MAC_OS_X_VERSION_MAX_ALLOWED="1090"
2830 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2833 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2836 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2839 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2842 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
2845 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.9--14])
2849 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2850 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2851 AC_MSG_ERROR([the version minimumn required, $MAC_OS_X_VERSION_MIN_REQUIRED, must be <= the version maximum allowed, $MAC_OS_X_VERSION_MAX_ALLOWED])
2856 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2857 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2858 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2862 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2863 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2865 AC_MSG_CHECKING([whether to do code signing])
2867 if test "$enable_macosx_code_signing" = yes; then
2868 # By default use the first suitable certificate (?).
2870 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2871 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2872 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2873 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2874 # "Developer ID Application" one.
2876 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2877 if test -n "$identity"; then
2878 MACOSX_CODESIGNING_IDENTITY=$identity
2879 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2880 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2882 AC_MSG_ERROR([cannot determine identity to use])
2884 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2885 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2886 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2887 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2892 AC_MSG_CHECKING([whether to create a Mac App Store package])
2894 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2895 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2896 elif test "$enable_macosx_package_signing" = yes; then
2897 # By default use the first suitable certificate.
2898 # It should be a "3rd Party Mac Developer Installer" one
2900 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2901 if test -n "$identity"; then
2902 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2903 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2904 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2906 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2908 elif test -n "$enable_macosx_package_signing"; then
2909 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2910 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2911 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2916 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2917 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2920 AC_MSG_CHECKING([whether to sandbox the application])
2922 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2923 AC_MSG_ERROR([OS X sandboxing requires code signing])
2924 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
2925 AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
2926 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2927 ENABLE_MACOSX_SANDBOX=TRUE
2928 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
2929 AC_MSG_RESULT([yes])
2934 AC_MSG_CHECKING([what OS X app bundle identifier to use])
2935 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
2936 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
2938 AC_SUBST(MACOSX_SDK_PATH)
2939 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2940 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2941 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
2942 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2943 AC_SUBST(INSTALL_NAME_TOOL)
2944 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
2945 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2946 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
2947 AC_SUBST(ENABLE_MACOSX_SANDBOX)
2948 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
2950 dnl ===================================================================
2951 dnl Check iOS SDK and compiler
2952 dnl ===================================================================
2954 if test $_os = iOS; then
2955 AC_MSG_CHECKING([what iOS SDK to use])
2956 current_sdk_ver=12.0
2957 if test "$enable_ios_simulator" = "yes"; then
2958 platform=iPhoneSimulator
2959 versionmin=-mios-simulator-version-min=$current_sdk_ver
2962 versionmin=-miphoneos-version-min=11.0
2964 xcode_developer=`xcode-select -print-path`
2966 for sdkver in $current_sdk_ver; do
2967 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
2975 if test -z "$sysroot"; then
2976 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
2979 AC_MSG_RESULT($sysroot)
2981 IOS_SDK=`echo $platform | tr A-Z a-z`$ios_sdk
2982 IOS_DEPLOYMENT_VERSION=$current_sdk_ver
2984 # LTO is not really recommended for iOS builds,
2985 # the link time will be astronomical
2986 if test "$ENABLE_LTO" = TRUE; then
2990 stdlib="-stdlib=libc++"
2992 CC="`xcrun -find clang` -arch $host_cpu -isysroot $sysroot $lto $versionmin"
2993 CXX="`xcrun -find clang++` -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
2995 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2998 STRIP=`xcrun -find strip`
2999 LIBTOOL=`xcrun -find libtool`
3000 RANLIB=`xcrun -find ranlib`
3004 AC_SUBST(IOS_DEPLOYMENT_VERSION)
3006 AC_MSG_CHECKING([whether to treat the installation as read-only])
3008 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3009 "$enable_extensions" != yes; then
3010 enable_readonly_installset=yes
3012 if test "$enable_readonly_installset" = yes; then
3013 AC_MSG_RESULT([yes])
3014 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3019 dnl ===================================================================
3020 dnl Structure of install set
3021 dnl ===================================================================
3023 if test $_os = Darwin; then
3024 LIBO_BIN_FOLDER=MacOS
3025 LIBO_ETC_FOLDER=Resources
3026 LIBO_LIBEXEC_FOLDER=MacOS
3027 LIBO_LIB_FOLDER=Frameworks
3028 LIBO_LIB_PYUNO_FOLDER=Resources
3029 LIBO_SHARE_FOLDER=Resources
3030 LIBO_SHARE_HELP_FOLDER=Resources/help
3031 LIBO_SHARE_JAVA_FOLDER=Resources/java
3032 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3033 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3034 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3035 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3036 LIBO_URE_BIN_FOLDER=MacOS
3037 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3038 LIBO_URE_LIB_FOLDER=Frameworks
3039 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3040 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3041 elif test $_os = WINNT; then
3042 LIBO_BIN_FOLDER=program
3043 LIBO_ETC_FOLDER=program
3044 LIBO_LIBEXEC_FOLDER=program
3045 LIBO_LIB_FOLDER=program
3046 LIBO_LIB_PYUNO_FOLDER=program
3047 LIBO_SHARE_FOLDER=share
3048 LIBO_SHARE_HELP_FOLDER=help
3049 LIBO_SHARE_JAVA_FOLDER=program/classes
3050 LIBO_SHARE_PRESETS_FOLDER=presets
3051 LIBO_SHARE_READMES_FOLDER=readmes
3052 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3053 LIBO_SHARE_SHELL_FOLDER=program/shell
3054 LIBO_URE_BIN_FOLDER=program
3055 LIBO_URE_ETC_FOLDER=program
3056 LIBO_URE_LIB_FOLDER=program
3057 LIBO_URE_MISC_FOLDER=program
3058 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3060 LIBO_BIN_FOLDER=program
3061 LIBO_ETC_FOLDER=program
3062 LIBO_LIBEXEC_FOLDER=program
3063 LIBO_LIB_FOLDER=program
3064 LIBO_LIB_PYUNO_FOLDER=program
3065 LIBO_SHARE_FOLDER=share
3066 LIBO_SHARE_HELP_FOLDER=help
3067 LIBO_SHARE_JAVA_FOLDER=program/classes
3068 LIBO_SHARE_PRESETS_FOLDER=presets
3069 LIBO_SHARE_READMES_FOLDER=readmes
3070 if test "$enable_fuzzers" != yes; then
3071 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3073 LIBO_SHARE_RESOURCE_FOLDER=resource
3075 LIBO_SHARE_SHELL_FOLDER=program/shell
3076 LIBO_URE_BIN_FOLDER=program
3077 LIBO_URE_ETC_FOLDER=program
3078 LIBO_URE_LIB_FOLDER=program
3079 LIBO_URE_MISC_FOLDER=program
3080 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3082 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3083 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3084 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3085 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3086 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3087 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3088 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3089 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3090 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3091 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3092 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3093 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3094 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3095 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3096 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3097 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3099 # Not all of them needed in config_host.mk, add more if need arises
3100 AC_SUBST(LIBO_BIN_FOLDER)
3101 AC_SUBST(LIBO_ETC_FOLDER)
3102 AC_SUBST(LIBO_LIB_FOLDER)
3103 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3104 AC_SUBST(LIBO_SHARE_FOLDER)
3105 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3106 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3107 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3108 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3109 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3110 AC_SUBST(LIBO_URE_BIN_FOLDER)
3111 AC_SUBST(LIBO_URE_ETC_FOLDER)
3112 AC_SUBST(LIBO_URE_LIB_FOLDER)
3113 AC_SUBST(LIBO_URE_MISC_FOLDER)
3114 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3116 dnl ===================================================================
3117 dnl Windows specific tests and stuff
3118 dnl ===================================================================
3122 # Return value: $regvalue
3125 local _regentry="/proc/registry${1}/${2}"
3126 if test -f "$_regentry"; then
3127 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3128 # Registry keys read via /proc/registry* are always \0 terminated!
3129 local _regvalue=$(tr -d '\0' < "$_regentry")
3130 if test $? -eq 0; then
3136 # Get a value from the 32-bit side of the Registry
3139 reg_get_value "32" "$1"
3142 # Get a value from the 64-bit side of the Registry
3145 reg_get_value "64" "$1"
3148 if test "$_os" = "WINNT"; then
3149 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3150 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3152 WINDOWS_SDK_ARCH="x86"
3154 AC_MSG_RESULT([yes])
3155 WINDOWS_SDK_ARCH="x64"
3159 if test "$_os" = "iOS"; then
3160 cross_compiling="yes"
3163 if test "$cross_compiling" = "yes"; then
3164 export CROSS_COMPILING=TRUE
3167 BUILD_TYPE="$BUILD_TYPE NATIVE"
3169 AC_SUBST(CROSS_COMPILING)
3172 if test -n "$enable_ld" -a "$enable_ld" != "no"; then
3173 AC_MSG_CHECKING([for -fuse-ld=$enable_ld linker support])
3174 if test "$GCC" = "yes"; then
3175 ldflags_save=$LDFLAGS
3176 LDFLAGS="$LDFLAGS -fuse-ld=$enable_ld"
3177 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3180 printf ("hello world\n");
3181 ])], USE_LD=$enable_ld, [])
3182 if test -n "$USE_LD"; then
3183 AC_MSG_RESULT( yes )
3184 LDFLAGS="$ldflags_save -fuse-ld=$enable_ld"
3189 AC_MSG_ERROR( not supported )
3195 if test "$enable_gdb_index" = "yes"; then
3196 AC_MSG_CHECKING([whether $CC supports -ggnu-pubnames])
3198 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
3199 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ AC_MSG_RESULT( yes )],[ AC_MSG_ERROR( no )])
3201 AC_MSG_CHECKING([whether $CC supports -Wl,--gdb-index])
3202 ldflags_save=$LDFLAGS
3203 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
3204 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3207 printf ("hello world\n");
3208 ])], ENABLE_GDB_INDEX=TRUE, [])
3209 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
3210 AC_MSG_RESULT( yes )
3215 LDFLAGS=$ldflags_save
3217 AC_SUBST(ENABLE_GDB_INDEX)
3219 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3220 if test "$GCC" = "yes"; then
3221 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
3222 bsymbolic_functions_ldflags_save=$LDFLAGS
3223 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
3224 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3227 printf ("hello world\n");
3228 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3229 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3230 AC_MSG_RESULT( found )
3232 AC_MSG_RESULT( not found )
3234 LDFLAGS=$bsymbolic_functions_ldflags_save
3236 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3238 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3239 # NOTE: must _not_ be used for bundled external libraries!
3241 if test "$GCC" = "yes"; then
3242 AC_MSG_CHECKING( for -isystem )
3244 CFLAGS="$CFLAGS -Werror"
3245 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3247 if test -n "$ISYSTEM"; then
3253 if test -z "$ISYSTEM"; then
3254 # fall back to using -I
3259 dnl ===================================================================
3260 dnl Check which Visual Studio compiler is used
3261 dnl ===================================================================
3263 map_vs_year_to_version()
3265 # Return value: $vsversion
3273 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3277 vs_versions_to_check()
3279 # Args: $1 (optional) : versions to check, in the order of preference
3280 # Return value: $vsversions
3284 if test -n "$1"; then
3285 map_vs_year_to_version "$1"
3286 vsversions=$vsversion
3288 # We accept only 2017
3293 win_get_env_from_vsvars32bat()
3295 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3296 # Also seems to be located in another directory under the same name: vsvars32.bat
3297 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3298 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3299 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3300 chmod +x $WRAPPERBATCHFILEPATH
3301 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3302 rm -f $WRAPPERBATCHFILEPATH
3303 printf '%s' "$_win_get_env_from_vsvars32bat"
3308 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3309 if test -n "$regvalue"; then
3310 PathFormat "$regvalue"
3311 UCRTSDKDIR=$formatted_path
3312 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3313 UCRTVERSION=$regvalue
3315 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3319 if test -z "$UCRTSDKDIR"; then
3320 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3321 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3322 if test -f "$ide_env_file"; then
3323 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3324 UCRTSDKDIR=$formatted_path
3325 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3326 dnl Hack needed at least by tml:
3327 if test "$UCRTVERSION" = 10.0.15063.0 \
3328 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3329 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3331 UCRTVERSION=10.0.14393.0
3334 AC_MSG_ERROR([No UCRT found])
3341 # Find Visual C++ 2017
3342 # Args: $1 (optional) : The VS version year
3343 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3345 unset vctest vcnum vcnumwithdot vcbuildnumber
3347 vs_versions_to_check "$1"
3349 for ver in $vsversions; do
3350 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3351 if test -n "$regvalue"; then
3355 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver
3356 if test -n "$regvalue"; then
3357 AC_MSG_RESULT([found: $regvalue])
3358 PathFormat "$regvalue"
3359 vctest=$formatted_path
3363 if test -n "$vctest"; then
3365 case "$vcnumwithdot" in
3369 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3378 if test "$_os" = "WINNT"; then
3379 AC_MSG_CHECKING([Visual C++])
3381 find_msvc "$with_visual_studio"
3382 if test -z "$vctest"; then
3383 if test -n "$with_visual_studio"; then
3384 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3386 AC_MSG_ERROR([No Visual Studio 2017 installation found])
3390 if test "$BITNESS_OVERRIDE" = ""; then
3391 if test -f "$vctest/bin/cl.exe"; then
3392 VC_PRODUCT_DIR=$vctest
3393 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3394 VC_PRODUCT_DIR=$vctest/VC
3396 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3399 if test -f "$vctest/bin/amd64/cl.exe"; then
3400 VC_PRODUCT_DIR=$vctest
3401 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3402 VC_PRODUCT_DIR=$vctest/VC
3404 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])
3408 AC_MSG_CHECKING([for short pathname of VC product directory])
3409 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3410 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3415 AC_MSG_CHECKING([for UCRT location])
3417 # find_ucrt errors out if it doesn't find it
3418 AC_MSG_RESULT([found])
3419 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3420 ucrtincpath_formatted=$formatted_path
3421 # SOLARINC is used for external modules and must be set too.
3422 # And no, it's not sufficient to set SOLARINC only, as configure
3423 # itself doesn't honour it.
3424 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3425 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3426 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3427 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3429 AC_SUBST(UCRTSDKDIR)
3430 AC_SUBST(UCRTVERSION)
3432 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3433 # Find the proper version of MSBuild.exe to use based on the VS version
3434 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3435 if test -n "$regvalue" ; then
3436 AC_MSG_RESULT([found: $regvalue])
3437 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3439 if test "$BITNESS_OVERRIDE" = ""; then
3440 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3442 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3444 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3445 AC_MSG_RESULT([$regvalue])
3448 # Find the version of devenv.exe
3449 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3450 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3451 if test ! -e "$DEVENV"; then
3452 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3455 dnl ===========================================================
3456 dnl Check for the corresponding mspdb*.dll
3457 dnl ===========================================================
3463 if test "$BITNESS_OVERRIDE" = ""; then
3464 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86"
3465 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX86/x86
3467 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64"
3468 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX64/x64
3471 # MSVC 15.0 has libraries from 14.0?
3474 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3475 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3478 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3479 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3481 dnl The path needs to be added before cl is called
3482 PATH="$MSPDB_PATH:$PATH"
3484 AC_MSG_CHECKING([cl.exe])
3486 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3487 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3488 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3491 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3492 dnl needed when building CLR code:
3493 if test -z "$MSVC_CXX"; then
3494 if test "$BITNESS_OVERRIDE" = ""; then
3495 if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
3496 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
3499 if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
3500 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
3504 # This gives us a posix path with 8.3 filename restrictions
3505 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3508 if test -z "$CC"; then
3511 if test "$BITNESS_OVERRIDE" = ""; then
3512 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3513 MSVC_CXX="$MSVC_CXX -arch:SSE"
3516 if test -n "$CC"; then
3517 # Remove /cl.exe from CC case insensitive
3518 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3519 if test "$BITNESS_OVERRIDE" = ""; then
3520 COMPATH="$VC_PRODUCT_DIR"
3522 if test -n "$VC_PRODUCT_DIR"; then
3523 COMPATH=$VC_PRODUCT_DIR
3526 if test "$BITNESS_OVERRIDE" = ""; then
3527 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3531 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3533 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3535 PathFormat "$COMPATH"
3536 COMPATH="$formatted_path"
3541 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3542 # are always "better", we list them in reverse chronological order.
3547 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
3551 # The expectation is that --with-windows-sdk should not need to be used
3552 if test -n "$with_windows_sdk"; then
3553 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3554 *" "$with_windows_sdk" "*)
3555 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3558 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3563 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3568 AC_MSG_ERROR([Visual C++ not found after all, huh])
3571 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3572 # version of the Explorer extension (and maybe other small
3573 # bits, too) needed when installing a 32-bit LibreOffice on a
3574 # 64-bit OS. The 64-bit Explorer extension is a feature that
3575 # has been present since long in OOo. Don't confuse it with
3576 # building LibreOffice itself as 64-bit code.
3582 if test "$BITNESS_OVERRIDE" = ""; then
3583 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3584 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3585 # Prefer native x64 compiler to cross-compiler, in case we are running
3586 # the build on a 64-bit OS.
3587 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3589 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3590 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3591 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3593 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3594 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3596 elif test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib"; then
3597 # nobody uses 32-bit OS to build, just pick the 64-bit compiler
3598 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3600 CXX_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"
3601 LINK_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/link.exe"
3604 if test "$BUILD_X64" = TRUE; then
3605 AC_MSG_RESULT([found])
3607 AC_MSG_RESULT([not found])
3608 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3613 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3614 AC_SUBST(CXX_X64_BINARY)
3615 AC_SUBST(LINK_X64_BINARY)
3619 PathFormat "$MSPDB_PATH"
3620 MSPDB_PATH="$formatted_path"
3626 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3627 AC_SUBST(UNOWINREG_DLL)
3630 AC_MSG_CHECKING([whether the compiler is actually Clang])
3631 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3637 [AC_MSG_RESULT([yes])
3639 [AC_MSG_RESULT([no])])
3642 if test "$COM_IS_CLANG" = TRUE; then
3643 AC_MSG_CHECKING([the Clang version])
3644 if test "$_os" = WINNT; then
3645 dnl In which case, assume clang-cl:
3647 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3655 CC_PLAIN="$CC_PLAIN $i"
3662 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
3663 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3664 CLANGVER=`echo $clang_version \
3665 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3666 AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3667 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3668 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3670 AC_SUBST(COM_IS_CLANG)
3673 SHOWINCLUDES_PREFIX=
3674 if test "$_os" = WINNT; then
3675 dnl We need to guess the prefix of the -showIncludes output, it can be
3677 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3678 echo "#include <stdlib.h>" > conftest.c
3679 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3680 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3681 rm -f conftest.c conftest.obj
3682 if test -z "$SHOWINCLUDES_PREFIX"; then
3683 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3685 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3688 AC_SUBST(SHOWINCLUDES_PREFIX)
3691 # prefix C with ccache if needed
3693 if test "$CCACHE" != ""; then
3694 AC_MSG_CHECKING([whether $CC is already ccached])
3698 CFLAGS="$CFLAGS --ccache-skip -O2"
3699 dnl an empty program will do, we're checking the compiler flags
3700 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3701 [use_ccache=yes], [use_ccache=no])
3702 if test $use_ccache = yes; then
3703 AC_MSG_RESULT([yes])
3712 # ===================================================================
3713 # check various GCC options that Clang does not support now but maybe
3714 # will somewhen in the future, check them even for GCC, so that the
3716 # ===================================================================
3719 HAVE_GCC_FINLINE_LIMIT=
3720 HAVE_GCC_FNO_INLINE=
3721 if test "$GCC" = "yes"; then
3722 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3724 CFLAGS="$CFLAGS -Werror -ggdb2"
3725 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3727 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3728 AC_MSG_RESULT([yes])
3733 AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3735 CFLAGS="$CFLAGS -Werror -finline-limit=0"
3736 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3738 if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3739 AC_MSG_RESULT([yes])
3744 AC_MSG_CHECKING([whether $CC supports -fno-inline])
3746 CFLAGS="$CFLAGS -Werror -fno-inline"
3747 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3749 if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3750 AC_MSG_RESULT([yes])
3755 if test "$host_cpu" = "m68k"; then
3756 AC_MSG_CHECKING([whether $CC supports -mlong-jump-table-offsets])
3758 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3759 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3761 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3762 AC_MSG_RESULT([yes])
3768 AC_SUBST(HAVE_GCC_GGDB2)
3769 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3770 AC_SUBST(HAVE_GCC_FNO_INLINE)
3772 dnl ===================================================================
3773 dnl Test the gcc version
3774 dnl ===================================================================
3775 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3776 AC_MSG_CHECKING([the GCC version])
3777 _gcc_version=`$CC -dumpversion`
3778 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3779 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3780 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3782 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3784 if test "$gcc_full_version" -lt 40801; then
3785 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.8.1])
3788 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3789 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3790 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3791 # (which reports itself as GCC 4.2.1).
3794 AC_SUBST(GCC_VERSION)
3796 dnl Set the ENABLE_DBGUTIL variable
3797 dnl ===================================================================
3798 AC_MSG_CHECKING([whether to build with additional debug utilities])
3799 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3800 ENABLE_DBGUTIL="TRUE"
3801 # this is an extra var so it can have different default on different MSVC
3802 # versions (in case there are version specific problems with it)
3803 MSVC_USE_DEBUG_RUNTIME="TRUE"
3805 AC_MSG_RESULT([yes])
3806 # cppunit and graphite expose STL in public headers
3807 if test "$with_system_cppunit" = "yes"; then
3808 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3810 with_system_cppunit=no
3812 if test "$with_system_graphite" = "yes"; then
3813 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3815 with_system_graphite=no
3817 if test "$with_system_orcus" = "yes"; then
3818 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3820 with_system_orcus=no
3822 if test "$with_system_libcmis" = "yes"; then
3823 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3825 with_system_libcmis=no
3827 if test "$with_system_hunspell" = "yes"; then
3828 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3830 with_system_hunspell=no
3832 if test "$with_system_gpgmepp" = "yes"; then
3833 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3835 with_system_gpgmepp=no
3837 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
3838 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
3839 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
3840 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
3841 # of those two is using the system variant:
3842 if test "$with_system_libnumbertext" = "yes"; then
3843 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
3845 with_system_libnumbertext=no
3847 if test "$with_system_libwps" = "yes"; then
3848 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
3850 with_system_libwps=no
3854 MSVC_USE_DEBUG_RUNTIME=""
3857 AC_SUBST(ENABLE_DBGUTIL)
3858 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3860 dnl Set the ENABLE_DEBUG variable.
3861 dnl ===================================================================
3862 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3863 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3865 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3866 if test -z "$libo_fuzzed_enable_debug"; then
3867 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3869 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3874 AC_MSG_CHECKING([whether to do a debug build])
3875 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3877 if test -n "$ENABLE_DBGUTIL" ; then
3878 AC_MSG_RESULT([yes (dbgutil)])
3880 AC_MSG_RESULT([yes])
3886 AC_SUBST(ENABLE_DEBUG)
3888 if test "$enable_split_debug" = yes; then
3890 if test "$GCC" = "yes"; then
3891 AC_MSG_CHECKING([whether $CC supports -gsplit-dwarf])
3893 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
3894 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
3896 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
3897 AC_MSG_RESULT([yes])
3902 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
3905 if test "$enable_sal_log" = yes; then
3908 AC_SUBST(ENABLE_SAL_LOG)
3910 dnl Selective debuginfo
3911 ENABLE_DEBUGINFO_FOR=
3912 if test -n "$ENABLE_DEBUG"; then
3913 AC_MSG_CHECKING([whether to use selective debuginfo])
3914 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3915 if test "$enable_selective_debuginfo" = "yes"; then
3916 AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
3918 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3919 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3921 ENABLE_DEBUGINFO_FOR=all
3922 AC_MSG_RESULT([no, for all])
3925 if test -n "$enable_selective_debuginfo"; then
3926 AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
3929 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3931 dnl Check for enable symbols option
3932 dnl ===================================================================
3933 AC_MSG_CHECKING([whether to generate debug information])
3934 if test -z "$enable_symbols"; then
3935 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3941 if test "$enable_symbols" != no; then
3943 AC_MSG_RESULT([yes])
3948 AC_SUBST(ENABLE_SYMBOLS)
3950 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
3951 # Building on Android with full symbols: without enough memory the linker never finishes currently.
3952 AC_MSG_CHECKING([whether enough memory is available for linking])
3953 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
3954 # Check for 15GB, as Linux reports a bit less than the physical memory size.
3955 if test -n "$mem_size" -a $mem_size -lt 15728640; then
3956 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
3958 AC_MSG_RESULT([yes])
3962 AC_MSG_CHECKING([whether to compile with optimization flags])
3963 if test -z "$enable_optimized"; then
3964 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3967 enable_optimized=yes
3970 if test "$enable_optimized" != no; then
3971 ENABLE_OPTIMIZED=TRUE
3972 AC_MSG_RESULT([yes])
3977 AC_SUBST(ENABLE_OPTIMIZED)
3980 # determine CPUNAME, OS, ...
3981 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
3992 PLATFORMID=aix_powerpc
4001 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4008 if test "$BITNESS_OVERRIDE" = 64; then
4011 PLATFORMID=windows_x86_64
4013 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4017 PLATFORMID=windows_x86
4021 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4024 SCPDEFS="$SCPDEFS -D_MSC_VER"
4036 AC_MSG_ERROR([Can't build 32-bit code for iOS])
4040 if test "$enable_ios_simulator" = "yes"; then
4041 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
4045 PLATFORMID=ios_arm64
4049 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4052 if test "$enable_ios_simulator" = "yes"; then
4057 PLATFORMID=macosx_x86_64
4060 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4076 PLATFORMID=dragonfly_x86
4081 PLATFORMID=dragonfly_x86_64
4084 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4100 PLATFORMID=freebsd_x86
4105 PLATFORMID=freebsd_x86_64
4108 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4125 PLATFORMID=haiku_x86
4130 PLATFORMID=haiku_x86_64
4133 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4150 PLATFORMID=kfreebsd_x86
4155 PLATFORMID=kfreebsd_x86_64
4158 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4174 PLATFORMID=linux_aarch64
4180 PLATFORMID=linux_alpha
4186 PLATFORMID=linux_arm_eabi
4190 PLATFORMID=linux_arm_oabi
4198 PLATFORMID=linux_hppa
4203 PLATFORMID=linux_x86
4208 PLATFORMID=linux_ia64
4214 PLATFORMID=linux_mips_eb
4219 EPM_FLAGS="-a mips64"
4220 PLATFORMID=linux_mips64_eb
4225 EPM_FLAGS="-a mips64el"
4226 PLATFORMID=linux_mips64_el
4231 EPM_FLAGS="-a mipsel"
4232 PLATFORMID=linux_mips_el
4237 PLATFORMID=linux_m68k
4242 PLATFORMID=linux_powerpc
4247 PLATFORMID=linux_powerpc64
4251 RTL_ARCH=PowerPC_64_LE
4252 PLATFORMID=linux_powerpc64_le
4257 PLATFORMID=linux_sparc
4262 PLATFORMID=linux_sparc64
4267 PLATFORMID=linux_s390
4272 PLATFORMID=linux_s390x
4277 PLATFORMID=linux_x86_64
4280 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4297 PLATFORMID=android_arm_eabi
4302 PLATFORMID=android_aarch64
4305 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4307 PLATFORMID=android_mips_el
4312 PLATFORMID=android_x86
4315 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4331 PLATFORMID=netbsd_x86
4336 PLATFORMID=netbsd_powerpc
4341 PLATFORMID=netbsd_sparc
4346 PLATFORMID=netbsd_x86_64
4349 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4365 PLATFORMID=openbsd_x86
4370 PLATFORMID=openbsd_x86_64
4373 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4376 SOLARINC="$SOLARINC -I/usr/local/include"
4390 PLATFORMID=solaris_x86
4395 PLATFORMID=solaris_sparc
4400 PLATFORMID=solaris_sparc64
4403 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4406 SOLARINC="$SOLARINC -I/usr/local/include"
4410 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4414 if test "$with_x" = "no"; then
4415 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4419 if test "$enable_gui" = "no"; then
4420 if test "$USING_X11" != TRUE; then
4421 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4425 AC_DEFINE(HAVE_FEATURE_UI,0)
4428 AC_SUBST(DISABLE_GUI)
4430 WORKDIR="${BUILDDIR}/workdir"
4431 INSTDIR="${BUILDDIR}/instdir"
4432 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4433 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4434 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4442 AC_SUBST([INSTROOT])
4443 AC_SUBST([INSTROOTBASE])
4447 AC_SUBST(PLATFORMID)
4448 AC_SUBST(WINDOWS_X64)
4449 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4451 dnl ===================================================================
4452 dnl Test which package format to use
4453 dnl ===================================================================
4454 AC_MSG_CHECKING([which package format to use])
4455 if test -n "$with_package_format" -a "$with_package_format" != no; then
4456 for i in $with_package_format; do
4458 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4461 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4462 aix - AIX software distribution
4463 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4464 deb - Debian software distribution
4465 pkg - Solaris software distribution
4466 rpm - RedHat software distribution
4468 LibreOffice additionally supports:
4469 archive - .tar.gz or .zip
4471 installed - installation tree
4477 # fakeroot is needed to ensure correct file ownerships/permissions
4478 # inside deb packages and tar archives created on Linux and Solaris.
4479 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4480 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4481 if test "$FAKEROOT" = "no"; then
4483 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4486 PKGFORMAT="$with_package_format"
4487 AC_MSG_RESULT([$PKGFORMAT])
4490 AC_MSG_RESULT([none])
4494 dnl ===================================================================
4495 dnl Set up a different compiler to produce tools to run on the build
4496 dnl machine when doing cross-compilation
4497 dnl ===================================================================
4499 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4500 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4501 if test "$cross_compiling" = "yes"; then
4502 AC_MSG_CHECKING([for BUILD platform configuration])
4504 rm -rf CONF-FOR-BUILD config_build.mk
4505 mkdir CONF-FOR-BUILD
4506 # Here must be listed all files needed when running the configure script. In particular, also
4507 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4508 # keep them in the same order as there.
4509 (cd $SRC_ROOT && tar cf - \
4511 bin/get_config_variables \
4512 solenv/bin/getcompver.awk \
4513 solenv/inc/langlist.mk \
4516 config_host_lang.mk.in \
4519 bin/bffvalidator.sh.in \
4520 bin/odfvalidator.sh.in \
4521 bin/officeotron.sh.in \
4522 instsetoo_native/util/openoffice.lst.in \
4524 sysui/desktop/macosx/Info.plist.in) \
4525 | (cd CONF-FOR-BUILD && tar xf -)
4526 cp configure CONF-FOR-BUILD
4527 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4529 unset COM USING_X11 OS CPUNAME
4530 unset CC CXX SYSBASE CFLAGS
4531 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4532 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4533 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4534 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4535 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4536 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4539 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4540 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4541 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4542 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4543 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4544 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4545 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4546 # Don't bother having configure look for stuff not needed for the build platform anyway
4550 --disable-pdfimport \
4551 --disable-postgresql-sdbc \
4552 --with-parallelism="$with_parallelism" \
4557 2>&1 | sed -e 's/^/ /'
4558 test -f ./config_host.mk 2>/dev/null || exit
4559 cp config_host.mk ../config_build.mk
4560 cp config_host_lang.mk ../config_build_lang.mk
4561 mv config.log ../config.Build.log
4562 mkdir -p ../config_build
4563 mv config_host/*.h ../config_build
4564 . ./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
4566 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
4568 VV=`eval "echo $VV"`
4569 if test -n "$VV"; then
4570 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4571 echo "$line" >>build-config
4575 for V in INSTDIR INSTROOT WORKDIR; do
4577 VV=`eval "echo $VV"`
4578 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4579 if test -n "$VV"; then
4580 line="${V}_FOR_BUILD='$VV'"
4581 echo "$line" >>build-config
4585 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4586 echo "$line" >>build-config
4589 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4590 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])
4591 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4592 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4594 eval `cat CONF-FOR-BUILD/build-config`
4596 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4598 rm -rf CONF-FOR-BUILD
4602 CXX_FOR_BUILD="$CXX"
4603 INSTDIR_FOR_BUILD="$INSTDIR"
4604 INSTROOT_FOR_BUILD="$INSTROOT"
4605 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4606 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4607 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4608 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4609 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4610 WORKDIR_FOR_BUILD="$WORKDIR"
4612 AC_SUBST(OS_FOR_BUILD)
4613 AC_SUBST(INSTDIR_FOR_BUILD)
4614 AC_SUBST(INSTROOT_FOR_BUILD)
4615 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4616 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4617 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4618 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4619 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4620 AC_SUBST(WORKDIR_FOR_BUILD)
4622 dnl ===================================================================
4623 dnl Check for syslog header
4624 dnl ===================================================================
4625 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4627 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4628 dnl ===================================================================
4629 AC_MSG_CHECKING([whether to turn warnings to errors])
4630 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4631 ENABLE_WERROR="TRUE"
4632 AC_MSG_RESULT([yes])
4634 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4635 ENABLE_WERROR="TRUE"
4636 AC_MSG_RESULT([yes])
4641 AC_SUBST(ENABLE_WERROR)
4643 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4644 dnl ===================================================================
4645 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4646 if test -z "$enable_assert_always_abort"; then
4647 if test "$ENABLE_DEBUG" = TRUE; then
4648 enable_assert_always_abort=yes
4650 enable_assert_always_abort=no
4653 if test "$enable_assert_always_abort" = "yes"; then
4654 ASSERT_ALWAYS_ABORT="TRUE"
4655 AC_MSG_RESULT([yes])
4657 ASSERT_ALWAYS_ABORT="FALSE"
4660 AC_SUBST(ASSERT_ALWAYS_ABORT)
4662 # Determine whether to use ooenv for the instdir installation
4663 # ===================================================================
4664 if test $_os != "WINNT" -a $_os != "Darwin"; then
4665 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4666 if test "$enable_ooenv" = "no"; then
4670 AC_MSG_RESULT([yes])
4673 AC_SUBST(ENABLE_OOENV)
4675 if test "$USING_X11" != TRUE; then
4676 # be sure to do not mess with unneeded stuff
4682 build_gstreamer_1_0=no
4683 build_gstreamer_0_10=no
4688 enable_cairo_canvas=no
4691 if test "$OS" = "HAIKU"; then
4692 enable_cairo_canvas=yes
4697 dnl ===================================================================
4698 dnl check for cups support
4699 dnl ===================================================================
4702 if test "$enable_cups" = "no"; then
4706 AC_MSG_CHECKING([whether to enable CUPS support])
4707 if test "$test_cups" = "yes"; then
4709 AC_MSG_RESULT([yes])
4711 AC_MSG_CHECKING([whether cups support is present])
4712 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4713 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4714 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4715 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4722 AC_SUBST(ENABLE_CUPS)
4725 if test "$test_fontconfig" = "yes"; then
4726 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4727 SYSTEM_FONTCONFIG=TRUE
4728 FilterLibs "${FONTCONFIG_LIBS}"
4729 FONTCONFIG_LIBS="${filteredlibs}"
4731 AC_SUBST(FONTCONFIG_CFLAGS)
4732 AC_SUBST(FONTCONFIG_LIBS)
4733 AC_SUBST([SYSTEM_FONTCONFIG])
4735 dnl whether to find & fetch external tarballs?
4736 dnl ===================================================================
4737 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4738 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4739 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4741 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4744 if test -z "$TARFILE_LOCATION"; then
4745 if test -d "$SRC_ROOT/src" ; then
4746 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4747 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4749 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4751 AbsolutePath "$TARFILE_LOCATION"
4752 PathFormat "${absolute_path}"
4753 TARFILE_LOCATION="${formatted_path}"
4755 AC_SUBST(TARFILE_LOCATION)
4757 AC_MSG_CHECKING([whether we want to fetch tarballs])
4758 if test "$enable_fetch_external" != "no"; then
4759 if test "$with_all_tarballs" = "yes"; then
4760 AC_MSG_RESULT([yes, all of them])
4761 DO_FETCH_TARBALLS="ALL"
4763 AC_MSG_RESULT([yes, if we use them])
4764 DO_FETCH_TARBALLS="TRUE"
4770 AC_SUBST(DO_FETCH_TARBALLS)
4772 AC_MSG_CHECKING([whether to build help])
4773 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4774 BUILD_TYPE="$BUILD_TYPE HELP"
4775 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4776 case "$with_help" in
4778 ENABLE_HTMLHELP=TRUE
4779 SCPDEFS="$SCPDEFS -DWITH_HELP"
4780 AC_MSG_RESULT([HTML])
4783 ENABLE_HTMLHELP=TRUE
4785 AC_MSG_RESULT([HTML])
4788 SCPDEFS="$SCPDEFS -DWITH_HELP"
4789 AC_MSG_RESULT([yes])
4792 AC_MSG_ERROR([Unknown --with-help=$with_help])
4798 AC_SUBST([ENABLE_HTMLHELP])
4799 AC_SUBST([HELP_ONLINE])
4801 dnl Test whether to include MySpell dictionaries
4802 dnl ===================================================================
4803 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4804 if test "$with_myspell_dicts" = "yes"; then
4805 AC_MSG_RESULT([yes])
4806 WITH_MYSPELL_DICTS=TRUE
4807 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4808 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4813 AC_SUBST(WITH_MYSPELL_DICTS)
4815 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
4816 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4817 if test "$with_system_dicts" = yes; then
4818 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4820 with_system_dicts=no
4823 AC_MSG_CHECKING([whether to use dicts from external paths])
4824 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4825 AC_MSG_RESULT([yes])
4827 AC_MSG_CHECKING([for spelling dictionary directory])
4828 if test -n "$with_external_dict_dir"; then
4829 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4831 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4832 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4833 DICT_SYSTEM_DIR=file:///usr/share/myspell
4836 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4837 AC_MSG_CHECKING([for hyphenation patterns directory])
4838 if test -n "$with_external_hyph_dir"; then
4839 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4841 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4843 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4844 AC_MSG_CHECKING([for thesaurus directory])
4845 if test -n "$with_external_thes_dir"; then
4846 THES_SYSTEM_DIR=file://$with_external_thes_dir
4848 THES_SYSTEM_DIR=file:///usr/share/mythes
4850 AC_MSG_RESULT([$THES_SYSTEM_DIR])
4855 AC_SUBST(SYSTEM_DICTS)
4856 AC_SUBST(DICT_SYSTEM_DIR)
4857 AC_SUBST(HYPH_SYSTEM_DIR)
4858 AC_SUBST(THES_SYSTEM_DIR)
4860 dnl ===================================================================
4861 dnl enable pch by default on windows
4862 dnl enable it explicitly otherwise
4864 if test "$enable_pch" = yes -a "$enable_compiler_plugins" = yes; then
4865 if test -z "$libo_fuzzed_enable_pch"; then
4866 AC_MSG_ERROR([--enable-pch cannot be used with --enable-compiler-plugins])
4868 AC_MSG_NOTICE([Resetting --enable-pch=no])
4873 AC_MSG_CHECKING([whether to enable pch feature])
4874 if test "$enable_pch" != "no"; then
4875 if test "$_os" = "WINNT"; then
4877 AC_MSG_RESULT([yes])
4878 elif test -n "$enable_pch" && test "$GCC" = "yes"; then
4880 AC_MSG_RESULT([yes])
4881 elif test -n "$enable_pch"; then
4882 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
4889 AC_SUBST(ENABLE_PCH)
4893 AC_MSG_CHECKING([the GNU Make version])
4894 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4895 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4896 if test "$_make_longver" -ge "038200"; then
4897 AC_MSG_RESULT([$GNUMAKE $_make_version])
4899 elif test "$_make_longver" -ge "038100"; then
4900 if test "$build_os" = "cygwin"; then
4901 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4903 AC_MSG_RESULT([$GNUMAKE $_make_version])
4905 dnl ===================================================================
4906 dnl Search all the common names for sha1sum
4907 dnl ===================================================================
4908 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
4909 if test -z "$SHA1SUM"; then
4910 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
4911 elif test "$SHA1SUM" = "openssl"; then
4912 SHA1SUM="openssl sha1"
4914 AC_MSG_CHECKING([for GNU Make bug 20033])
4915 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4916 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
4917 A := \$(wildcard *.a)
4921 <TAB>@echo survived bug20033.
4925 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
4938 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
4939 <TAB>\$(call d1,\$(CHECKSUM)),\
4940 <TAB>\$(call d2,\$(CHECKSUM)))
4942 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
4943 no_parallelism_make="YES"
4944 AC_MSG_RESULT([yes, disable parallelism])
4946 AC_MSG_RESULT([no, keep parallelism enabled])
4948 rm -rf $TESTGMAKEBUG20033
4950 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
4953 # find if gnumake support file function
4954 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
4955 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
4956 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4957 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
4959 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
4960 \$(file >test.txt,Success )
4967 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
4968 if test -f $TESTGMAKEFILEFUNC/test.txt; then
4969 HAVE_GNUMAKE_FILE_FUNC=TRUE
4970 AC_MSG_RESULT([yes])
4974 rm -rf $TESTGMAKEFILEFUNC
4975 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
4976 AC_SUBST(GNUMAKE_WIN_NATIVE)
4978 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
4980 if test "$_make_ver_check" = ""; then
4984 HAVE_LD_HASH_STYLE=FALSE
4985 WITH_LINKER_HASH_STYLE=
4986 AC_MSG_CHECKING([for --hash-style gcc linker support])
4987 if test "$GCC" = "yes"; then
4988 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
4989 hash_styles="gnu sysv"
4990 elif test "$with_linker_hash_style" = "no"; then
4993 hash_styles="$with_linker_hash_style"
4996 for hash_style in $hash_styles; do
4997 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4998 hash_style_ldflags_save=$LDFLAGS
4999 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5001 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5008 HAVE_LD_HASH_STYLE=TRUE
5009 WITH_LINKER_HASH_STYLE=$hash_style
5011 [HAVE_LD_HASH_STYLE=FALSE],
5012 [HAVE_LD_HASH_STYLE=FALSE])
5013 LDFLAGS=$hash_style_ldflags_save
5016 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5017 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5021 LDFLAGS=$hash_style_ldflags_save
5025 AC_SUBST(HAVE_LD_HASH_STYLE)
5026 AC_SUBST(WITH_LINKER_HASH_STYLE)
5028 dnl ===================================================================
5029 dnl Check whether there's a Perl version available.
5030 dnl ===================================================================
5031 if test -z "$with_perl_home"; then
5032 AC_PATH_PROG(PERL, perl)
5034 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5035 _perl_path="$with_perl_home/bin/perl"
5036 if test -x "$_perl_path"; then
5039 AC_MSG_ERROR([$_perl_path not found])
5043 dnl ===================================================================
5044 dnl Testing for Perl version 5 or greater.
5045 dnl $] is the Perl version variable, it is returned as an integer
5046 dnl ===================================================================
5047 if test "$PERL"; then
5048 AC_MSG_CHECKING([the Perl version])
5049 ${PERL} -e "exit($]);"
5051 if test "$_perl_version" -lt 5; then
5052 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
5054 AC_MSG_RESULT([Perl $_perl_version])
5056 AC_MSG_ERROR([Perl not found, install Perl 5])
5059 dnl ===================================================================
5060 dnl Testing for required Perl modules
5061 dnl ===================================================================
5063 AC_MSG_CHECKING([for required Perl modules])
5064 perl_use_string="use Cwd ; use Digest::MD5"
5065 if test "$_os" = "WINNT"; then
5066 if test -n "$PKGFORMAT"; then
5067 for i in $PKGFORMAT; do
5070 # for getting fonts versions to use in MSI
5071 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5077 if test "$with_system_hsqldb" = "yes"; then
5078 perl_use_string="$perl_use_string ; use Archive::Zip"
5080 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
5081 AC_MSG_RESULT([all modules found])
5083 AC_MSG_RESULT([failed to find some modules])
5084 # Find out which modules are missing.
5085 for i in $perl_use_string; do
5086 if test "$i" != "use" -a "$i" != ";"; then
5087 if ! $PERL -e "use $i;">/dev/null 2>&1; then
5088 missing_perl_modules="$missing_perl_modules $i"
5093 The missing Perl modules are: $missing_perl_modules
5094 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5097 dnl ===================================================================
5098 dnl Check for pkg-config
5099 dnl ===================================================================
5100 if test "$_os" != "WINNT"; then
5104 if test "$_os" != "WINNT"; then
5106 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5107 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5108 # explicitly. Or put /path/to/compiler in PATH yourself.
5110 # Use wrappers for LTO
5111 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5112 AC_CHECK_TOOL(AR,gcc-ar)
5113 AC_CHECK_TOOL(NM,gcc-nm)
5114 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5116 AC_CHECK_TOOL(AR,ar)
5117 AC_CHECK_TOOL(NM,nm)
5118 AC_CHECK_TOOL(RANLIB,ranlib)
5120 AC_CHECK_TOOL(OBJDUMP,objdump)
5121 AC_CHECK_TOOL(READELF,readelf)
5122 AC_CHECK_TOOL(STRIP,strip)
5123 if test "$_os" = "WINNT"; then
5124 AC_CHECK_TOOL(DLLTOOL,dlltool)
5125 AC_CHECK_TOOL(WINDRES,windres)
5132 AC_SUBST(PKG_CONFIG)
5138 dnl ===================================================================
5139 dnl pkg-config checks on Mac OS X
5140 dnl ===================================================================
5142 if test $_os = Darwin; then
5143 AC_MSG_CHECKING([for bogus pkg-config])
5144 if test -n "$PKG_CONFIG"; then
5145 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5146 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5148 if test "$enable_bogus_pkg_config" = "yes"; then
5149 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5151 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.])
5155 AC_MSG_RESULT([no, good])
5161 # Return value: $csctest
5165 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5166 if test -n "$regvalue"; then
5174 # Return value: $altest
5178 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5179 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5180 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5186 # We need this additional check to detect 4.6.1 or above.
5187 for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
5188 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5189 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5194 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools"
5195 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5206 for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
5207 reg_get_value_64 "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5208 if test -n "$regvalue"; then
5212 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5213 if test -n "$regvalue"; then
5220 find_winsdk_version()
5222 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5223 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5225 unset winsdktest winsdkbinsubdir winsdklibsubdir
5229 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5230 if test -n "$regvalue"; then
5231 winsdktest=$regvalue
5237 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5238 if test -n "$regvalue"; then
5239 winsdktest=$regvalue
5240 winsdklibsubdir=win8
5245 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5246 if test -n "$regvalue"; then
5247 winsdktest=$regvalue
5248 winsdklibsubdir=winv6.3
5253 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5254 if test -n "$regvalue"; then
5255 winsdktest=$regvalue
5256 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5257 if test -n "$regvalue"; then
5258 winsdkbinsubdir="$regvalue".0
5259 winsdklibsubdir=$winsdkbinsubdir
5260 tmppath="$winsdktest\\Include\\$winsdklibsubdir"
5261 # test exist the SDK path
5262 if test -d "$tmppath"; then
5263 # when path is convertible to a short path then path is okay
5264 if ! cygpath -d "$tmppath"; then
5265 AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
5268 AC_MSG_ERROR([The Windows SDK not found, check the installation])
5279 # Return value: From find_winsdk_version
5283 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5284 find_winsdk_version $ver
5285 if test -n "$winsdktest"; then
5293 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5294 if test $VCVER = 150; then
5295 my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
5297 AC_MSG_CHECKING([for ${my_msm_files}])
5299 for ver in 14.0 15.0; do
5300 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5301 if test -n "$regvalue"; then
5302 for f in ${my_msm_files}; do
5303 if test -e "$regvalue/${f}"; then
5310 dnl Is the following fallback really necessary, or was it added in response
5311 dnl to never having started Visual Studio on a given machine, so the
5312 dnl registry keys checked above had presumably not yet been created?
5313 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5314 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5315 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5316 dnl expanding to "C:\Program Files\Common Files"), which would need
5317 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5318 dnl obtain its value from cygwin:
5319 if test -z "$msmdir"; then
5320 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5321 for f in ${my_msm_files}; do
5322 if test -e "$my_msm_dir/${f}"; then
5328 dnl Starting from MSVC 15.0, merge modules are located in different directory
5329 if test $VCVER = 150; then
5330 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5331 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])
5332 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5333 for f in ${my_msm_files}; do
5334 if test -e "$my_msm_dir/${f}"; then
5342 if test -n "$msmdir"; then
5343 msmdir=`cygpath -m "$msmdir"`
5344 AC_MSG_RESULT([$msmdir])
5346 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5347 AC_MSG_ERROR([not found])
5349 AC_MSG_WARN([not found])
5350 add_warning "MSM none of ${my_msm_files} found"
5355 find_msvc_x64_dlls()
5357 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5358 if test "$VCVER" = 150; then
5359 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5360 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT])
5361 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5362 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5365 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
5366 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
5371 msvcdlls="msvcp140.dll vcruntime140.dll"
5372 for dll in $msvcdlls; do
5373 if ! test -f "$msvcdllpath/$dll"; then
5374 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5379 dnl =========================================
5380 dnl Check for the Windows SDK.
5381 dnl =========================================
5382 if test "$_os" = "WINNT"; then
5383 AC_MSG_CHECKING([for Windows SDK])
5384 if test "$build_os" = "cygwin"; then
5386 WINDOWS_SDK_HOME=$winsdktest
5388 # normalize if found
5389 if test -n "$WINDOWS_SDK_HOME"; then
5390 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5391 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5394 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5397 if test -n "$WINDOWS_SDK_HOME"; then
5398 # Remove a possible trailing backslash
5399 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5401 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5402 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5403 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5404 have_windows_sdk_headers=yes
5405 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5406 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5407 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5408 have_windows_sdk_headers=yes
5409 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5410 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5411 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5412 have_windows_sdk_headers=yes
5414 have_windows_sdk_headers=no
5417 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5418 have_windows_sdk_libs=yes
5419 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5420 have_windows_sdk_libs=yes
5422 have_windows_sdk_libs=no
5425 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5426 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5427 the Windows SDK are installed.])
5431 if test -z "$WINDOWS_SDK_HOME"; then
5432 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5433 elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
5434 WINDOWS_SDK_VERSION=70
5435 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
5436 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5437 WINDOWS_SDK_VERSION=80
5438 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5439 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5440 WINDOWS_SDK_VERSION=81
5441 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5442 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5443 WINDOWS_SDK_VERSION=10
5444 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5446 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5448 PathFormat "$WINDOWS_SDK_HOME"
5449 WINDOWS_SDK_HOME="$formatted_path"
5450 if test "$build_os" = "cygwin"; then
5451 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5452 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5453 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5454 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5455 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5459 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5460 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5461 dnl but not in v8.0), so allow this to be overridden with a
5462 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5463 dnl and configuration error if no WiLangId.vbs is found would arguably be
5464 dnl better, but I do not know under which conditions exactly it is needed by
5466 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5467 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5468 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5469 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5471 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5472 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5474 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5475 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5478 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5479 if test -n "$with_package_format" -a "$with_package_format" != no; then
5480 for i in "$with_package_format"; do
5481 if test "$i" = "msi"; then
5482 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5483 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5490 AC_SUBST(WINDOWS_SDK_HOME)
5491 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5492 AC_SUBST(WINDOWS_SDK_VERSION)
5493 AC_SUBST(WINDOWS_SDK_WILANGID)
5495 if test "$build_os" = "cygwin"; then
5496 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5497 dnl dir, it also determines that dir's path w/o an arch segment if any,
5498 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5499 AC_MSG_CHECKING([for midl.exe])
5502 if test -n "$winsdkbinsubdir" \
5503 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5505 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5506 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5507 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5508 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5509 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5510 elif test -f "$winsdktest/Bin/midl.exe"; then
5511 MIDL_PATH=$winsdktest/Bin
5512 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5514 if test ! -f "$MIDL_PATH/midl.exe"; then
5515 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5517 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5520 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5521 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5523 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5524 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5525 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5526 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5527 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5528 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5529 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5530 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5531 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5532 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5533 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5534 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5536 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5540 AC_MSG_CHECKING([for csc.exe])
5542 if test -f "$csctest/csc.exe"; then
5545 if test ! -f "$CSC_PATH/csc.exe"; then
5546 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5548 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5551 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5554 AC_MSG_CHECKING([for al.exe])
5556 if test -n "$winsdkbinsubdir" \
5557 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5559 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5560 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5561 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5562 elif test -f "$winsdktest/Bin/al.exe"; then
5563 AL_PATH="$winsdktest/Bin"
5566 if test -z "$AL_PATH"; then
5568 if test -f "$altest/bin/al.exe"; then
5569 AL_PATH="$altest/bin"
5570 elif test -f "$altest/al.exe"; then
5574 if test ! -f "$AL_PATH/al.exe"; then
5575 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5577 AC_MSG_RESULT([$AL_PATH/al.exe])
5580 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5582 dnl Check mscoree.lib / .NET Framework dir
5583 AC_MSG_CHECKING(.NET Framework)
5585 PathFormat "$frametest"
5586 frametest="$formatted_path"
5587 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5588 DOTNET_FRAMEWORK_HOME="$frametest"
5591 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5592 DOTNET_FRAMEWORK_HOME="$winsdktest"
5595 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
5596 AC_MSG_ERROR([mscoree.lib not found])
5598 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5600 PathFormat "$MIDL_PATH"
5601 MIDL_PATH="$formatted_path"
5603 PathFormat "$AL_PATH"
5604 AL_PATH="$formatted_path"
5606 PathFormat "$DOTNET_FRAMEWORK_HOME"
5607 DOTNET_FRAMEWORK_HOME="$formatted_path"
5609 PathFormat "$CSC_PATH"
5610 CSC_PATH="$formatted_path"
5613 dnl ===================================================================
5614 dnl Check if stdc headers are available excluding MSVC.
5615 dnl ===================================================================
5616 if test "$_os" != "WINNT"; then
5620 dnl ===================================================================
5621 dnl Testing for C++ compiler and version...
5622 dnl ===================================================================
5624 if test "$_os" != "WINNT"; then
5625 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5626 save_CXXFLAGS=$CXXFLAGS
5628 CXXFLAGS=$save_CXXFLAGS
5630 if test -n "$CC" -a -z "$CXX"; then
5635 dnl check for GNU C++ compiler version
5636 if test "$GXX" = "yes"; then
5637 AC_MSG_CHECKING([the GNU C++ compiler version])
5639 _gpp_version=`$CXX -dumpversion`
5640 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5642 if test "$_gpp_majmin" -lt "401"; then
5643 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
5645 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5648 dnl see https://code.google.com/p/android/issues/detail?id=41770
5649 if test "$_gpp_majmin" -ge "401"; then
5653 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5654 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5655 #include <bits/c++config.h>]],[[
5656 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5657 && !defined(_GLIBCXX__PTHREADS) \
5658 && !defined(_GLIBCXX_HAS_GTHREADS)
5661 ]])],[AC_MSG_RESULT([yes])
5662 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5664 if test $glibcxx_threads = yes; then
5665 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5669 AC_SUBST(BOOST_CXXFLAGS)
5672 # prefx CXX with ccache if needed
5674 if test "$CCACHE" != ""; then
5675 AC_MSG_CHECKING([whether $CXX is already ccached])
5677 save_CXXFLAGS=$CXXFLAGS
5678 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5679 dnl an empty program will do, we're checking the compiler flags
5680 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5681 [use_ccache=yes], [use_ccache=no])
5682 if test $use_ccache = yes; then
5683 AC_MSG_RESULT([yes])
5688 CXXFLAGS=$save_CXXFLAGS
5692 dnl ===================================================================
5693 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5694 dnl ===================================================================
5696 if test "$_os" != "WINNT"; then
5699 dnl Check whether there's a C pre-processor.
5704 dnl ===================================================================
5705 dnl Find integral type sizes and alignments
5706 dnl ===================================================================
5708 if test "$_os" != "WINNT"; then
5710 if test "$_os" == "iOS"; then
5711 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
5713 ac_cv_sizeof_short=2
5715 ac_cv_sizeof_long_long=8
5716 ac_cv_sizeof_double=8
5717 ac_cv_sizeof_voidp=8
5719 AC_CHECK_SIZEOF(long)
5720 AC_CHECK_SIZEOF(short)
5721 AC_CHECK_SIZEOF(int)
5722 AC_CHECK_SIZEOF(long long)
5723 AC_CHECK_SIZEOF(double)
5724 AC_CHECK_SIZEOF(void*)
5727 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5728 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5729 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5730 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5731 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5733 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5734 m4_pattern_allow([AC_CHECK_ALIGNOF])
5735 m4_ifdef([AC_CHECK_ALIGNOF],
5737 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5738 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5739 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5740 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5743 case "$_os-$host_cpu" in
5745 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5746 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5747 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5748 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5751 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5752 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5753 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5754 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5757 if test -z "$ac_cv_alignof_short" -o \
5758 -z "$ac_cv_alignof_int" -o \
5759 -z "$ac_cv_alignof_long" -o \
5760 -z "$ac_cv_alignof_double"; then
5761 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.])
5767 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5768 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5769 if test $ac_cv_sizeof_long -eq 8; then
5770 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5771 elif test $ac_cv_sizeof_double -eq 8; then
5772 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5774 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5777 dnl Check for large file support
5779 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5780 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5782 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5783 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5787 SAL_TYPES_SIZEOFSHORT=2
5788 SAL_TYPES_SIZEOFINT=4
5789 SAL_TYPES_SIZEOFLONG=4
5790 SAL_TYPES_SIZEOFLONGLONG=8
5791 if test "$BITNESS_OVERRIDE" = ""; then
5792 SAL_TYPES_SIZEOFPOINTER=4
5794 SAL_TYPES_SIZEOFPOINTER=8
5796 SAL_TYPES_ALIGNMENT2=2
5797 SAL_TYPES_ALIGNMENT4=4
5798 SAL_TYPES_ALIGNMENT8=8
5801 AC_SUBST(LFS_CFLAGS)
5803 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5804 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5805 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5806 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5807 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5808 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5809 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5810 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5812 dnl ===================================================================
5813 dnl Check whether to enable runtime optimizations
5814 dnl ===================================================================
5815 ENABLE_RUNTIME_OPTIMIZATIONS=
5816 AC_MSG_CHECKING([whether to enable runtime optimizations])
5817 if test -z "$enable_runtime_optimizations"; then
5821 enable_runtime_optimizations=no
5827 if test "$enable_runtime_optimizations" != no; then
5828 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
5829 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
5830 AC_MSG_RESULT([yes])
5834 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
5836 dnl ===================================================================
5837 dnl Check if valgrind headers are available
5838 dnl ===================================================================
5840 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
5841 prev_cppflags=$CPPFLAGS
5842 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5843 # or where does it come from?
5844 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5845 AC_CHECK_HEADER([valgrind/valgrind.h],
5846 [ENABLE_VALGRIND=TRUE])
5847 CPPFLAGS=$prev_cppflags
5849 AC_SUBST([ENABLE_VALGRIND])
5850 if test -z "$ENABLE_VALGRIND"; then
5851 if test "$with_valgrind" = yes; then
5852 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
5856 AC_SUBST([VALGRIND_CFLAGS])
5859 dnl ===================================================================
5860 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
5861 dnl ===================================================================
5863 # We need at least the sys/sdt.h include header.
5864 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
5865 if test "$SDT_H_FOUND" = "TRUE"; then
5866 # Found sys/sdt.h header, now make sure the c++ compiler works.
5867 # Old g++ versions had problems with probes in constructors/destructors.
5868 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
5870 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5871 #include <sys/sdt.h>
5879 ProbeClass(int& v, const char *n) : ref(v), name(n)
5881 DTRACE_PROBE2(_test_, cons, name, ref);
5884 void method(int min)
5886 DTRACE_PROBE3(_test_, meth, name, ref, min);
5892 DTRACE_PROBE2(_test_, dest, name, ref);
5897 DTRACE_PROBE1(_test_, call, i);
5898 ProbeClass inst = ProbeClass(i, "call");
5900 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
5901 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
5904 AC_CONFIG_HEADERS([config_host/config_probes.h])
5906 dnl ===================================================================
5908 dnl ===================================================================
5909 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
5910 AC_MSG_CHECKING([whether $CC supports -mno-avx])
5912 CFLAGS="$CFLAGS -Werror -mno-avx"
5913 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5915 if test "$HAVE_GCC_AVX" = "TRUE"; then
5916 AC_MSG_RESULT([yes])
5921 AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong])
5923 CFLAGS="$CFLAGS -Werror -fstack-protector-strong"
5924 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; return 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
5926 if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
5927 AC_MSG_RESULT([yes])
5932 AC_MSG_CHECKING([whether $CC supports atomic functions])
5933 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5935 if (__sync_add_and_fetch(&v, 1) != 1 ||
5936 __sync_sub_and_fetch(&v, 1) != 0)
5938 __sync_synchronize();
5939 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
5943 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
5944 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
5945 AC_MSG_RESULT([yes])
5946 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
5951 AC_MSG_CHECKING([whether $CC supports __builtin_ffs])
5952 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
5953 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
5954 AC_MSG_RESULT([yes])
5955 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
5960 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
5962 CFLAGS="$CFLAGS -Werror"
5963 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5964 __attribute__((deprecated("test"))) void f();
5966 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
5967 AC_MSG_RESULT([yes])
5968 ], [AC_MSG_RESULT([no])])
5971 AC_MSG_CHECKING([whether $CXX defines __base_class_type_info in cxxabi.h])
5973 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5976 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
5978 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
5979 AC_MSG_RESULT([yes])
5980 ], [AC_MSG_RESULT([no])])
5983 AC_MSG_CHECKING([whether $CXX defines __class_type_info in cxxabi.h])
5985 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5988 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
5990 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
5991 AC_MSG_RESULT([yes])
5992 ], [AC_MSG_RESULT([no])])
5995 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
5997 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5999 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6001 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6002 AC_MSG_RESULT([yes])
6003 ], [AC_MSG_RESULT([no])])
6006 AC_MSG_CHECKING([whether $CXX defines __cxa_eh_globals in cxxabi.h])
6008 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6011 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6013 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6014 AC_MSG_RESULT([yes])
6015 ], [AC_MSG_RESULT([no])])
6018 AC_MSG_CHECKING([whether $CXX defines __cxa_exceptions in cxxabi.h])
6020 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6023 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6025 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6026 AC_MSG_RESULT([yes])
6027 ], [AC_MSG_RESULT([no])])
6030 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
6032 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6034 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6036 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6037 AC_MSG_RESULT([yes])
6038 ], [AC_MSG_RESULT([no])])
6041 AC_MSG_CHECKING([whether $CXX declares __cxa_current_exception_type in cxxabi.h])
6043 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6045 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6047 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6048 AC_MSG_RESULT([yes])
6049 ], [AC_MSG_RESULT([no])])
6052 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6054 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6056 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6058 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6059 AC_MSG_RESULT([yes])
6060 ], [AC_MSG_RESULT([no])])
6063 AC_MSG_CHECKING([whether $CXX defines __si_class_type_info in cxxabi.h])
6065 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6068 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6070 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6071 AC_MSG_RESULT([yes])
6072 ], [AC_MSG_RESULT([no])])
6075 AC_MSG_CHECKING([whether $CXX defines __vmi_class_type_info in cxxabi.h])
6077 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6080 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6082 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6083 AC_MSG_RESULT([yes])
6084 ], [AC_MSG_RESULT([no])])
6087 dnl Available in GCC 4.9 and at least since Clang 3.4:
6088 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6090 save_CXXFLAGS=$CXXFLAGS
6091 CXXFLAGS="$CXXFLAGS -Werror"
6092 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6093 struct __attribute__((warn_unused)) dummy {};
6095 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6096 AC_MSG_RESULT([yes])
6097 ], [AC_MSG_RESULT([no])])
6098 CXXFLAGS=$save_CXXFLAGS
6102 AC_SUBST(HAVE_GCC_AVX)
6103 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
6104 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6105 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6107 dnl ===================================================================
6108 dnl Identify the C++ library
6109 dnl ===================================================================
6111 AC_MSG_CHECKING([what the C++ library is])
6113 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6119 [CPP_LIBRARY=GLIBCXX
6120 cpp_library_name="GNU libstdc++"
6122 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6124 #ifndef _LIBCPP_VERSION
6129 cpp_library_name="LLVM libc++"
6130 AC_DEFINE([HAVE_LIBCXX])
6132 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6139 cpp_library_name="Microsoft"
6141 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6142 AC_MSG_RESULT([$cpp_library_name])
6145 dnl ===================================================================
6147 dnl ===================================================================
6148 AC_PATH_PROG(GPERF, gperf)
6149 if test -z "$GPERF"; then
6150 AC_MSG_ERROR([gperf not found but needed. Install it.])
6152 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6153 GPERF=`cygpath -m $GPERF`
6155 AC_MSG_CHECKING([gperf version])
6156 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
6159 AC_MSG_ERROR([too old, you need at least 3.0.0])
6163 dnl ===================================================================
6164 dnl Check for system libcmis
6165 dnl ===================================================================
6166 # libcmis requires curl and we can't build curl for iOS
6167 if test $_os != iOS; then
6168 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.0])
6173 AC_SUBST(ENABLE_LIBCMIS)
6175 dnl ===================================================================
6177 dnl ===================================================================
6180 libo_FUZZ_ARG_ENABLE(c++17,
6181 AS_HELP_STRING([--disable-c++17],
6182 [Do not attempt to run GCC/Clang in C++17 mode (needed for Coverity).])
6185 AC_MSG_CHECKING([whether $CXX supports C++17, C++14, or C++11])
6187 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6188 CXXFLAGS_CXX11=-std:c++17
6189 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6190 dnl But only use C++17 if the gperf that is being used knows not to emit
6191 dnl "register" in C++ output:
6192 printf 'foo\n' | $GPERF -L C++ > conftest.inc
6193 my_flags='-std=gnu++14 -std=gnu++1y -std=c++14 -std=c++1y -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x'
6194 if test "$enable_c__17" != no; then
6195 my_flags="-std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z $my_flags"
6197 for flag in $my_flags; do
6198 if test "$COM" = MSC; then
6199 flag="-Xclang $flag"
6201 save_CXXFLAGS=$CXXFLAGS
6202 CXXFLAGS="$CXXFLAGS $flag -Werror"
6203 if test "$SYSTEM_LIBCMIS" = TRUE; then
6204 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6207 dnl Clang 3.9 supports __float128 since
6208 dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
6209 dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
6210 dnl hacky workaround to be able to include <vector> (as is done in the main check whether
6211 dnl $flag is supported below, so check this first):
6213 my_float128hack_impl=-D__float128=void
6214 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6216 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6220 dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
6221 dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
6222 dnl is available during its build, but it's usually built using GCC, and so c++config.h
6223 dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
6224 dnl place where __float128 is used is in a template specialization, -D__float128=void
6225 dnl will avoid the problem there while still causing a problem if somebody actually uses
6226 dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
6227 dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
6228 dnl "fixed" with this hack):
6229 CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
6230 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6232 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6235 ],[my_float128hack=$my_float128hack_impl])
6237 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6238 #include <algorithm>
6239 #include <functional>
6243 #pragma GCC diagnostic push
6244 #pragma GCC diagnostic ignored "-Wpragmas"
6245 // make GCC not warn about next pragma
6246 #pragma GCC diagnostic ignored "-Wdeprecated-register"
6247 // make Clang with -std < C++17 not even warn about register
6248 #include "conftest.inc"
6249 #pragma GCC diagnostic pop
6251 #if defined SYSTEM_LIBCMIS
6252 // See ucb/source/ucp/cmis/auth_provider.hxx:
6254 #pragma GCC diagnostic push
6255 #pragma GCC diagnostic ignored "-Wdeprecated"
6256 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6258 #include <libcmis/libcmis.hxx>
6260 #pragma GCC diagnostic pop
6264 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6265 std::sort(v.begin(), v.end(), fn);
6267 ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
6269 CXXFLAGS=$save_CXXFLAGS
6270 if test -n "$CXXFLAGS_CXX11"; then
6276 if test -n "$CXXFLAGS_CXX11"; then
6277 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6281 AC_SUBST(CXXFLAGS_CXX11)
6283 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6284 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6285 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6286 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6287 dnl again towards 4.7.2:
6288 if test $CPP_LIBRARY = GLIBCXX; then
6289 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6291 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6293 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6294 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6295 // GCC 4.7.0: 20120322
6296 // GCC 4.7.1: 20120614
6297 // and using a range check is not possible as the mapping between
6298 // __GLIBCXX__ values and GCC versions is not monotonic
6303 ]])], [AC_MSG_RESULT(no, ok)],
6304 [AC_MSG_ERROR(yes)])
6308 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6309 save_CXXFLAGS=$CXXFLAGS
6310 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6313 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6316 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6332 a thinga[]={{0,0}, {1,1}};
6333 b thingb[]={{0,0}, {1,1}};
6334 size_t i = sizeof(sal_n_array_size(thinga));
6335 size_t j = sizeof(sal_n_array_size(thingb));
6336 return !(i != 0 && j != 0);
6338 ], [ AC_MSG_RESULT(yes) ],
6339 [ AC_MSG_ERROR(no)])
6341 CXXFLAGS=$save_CXXFLAGS
6343 AC_MSG_CHECKING([whether $CXX supports C++14 constexpr])
6344 save_CXXFLAGS=$CXXFLAGS
6345 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6347 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6348 // A somewhat over-complicated way of checking for
6349 // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "ICE using __func__
6350 // in constexpr function":
6352 template<typename T> inline constexpr T f(T x) { return x; }
6353 template<typename T> inline constexpr T g(T x) {
6354 assert(f(static_cast<int>(x)));
6362 constexpr bool f() {
6365 while (n > 0) { --n; ++i; }
6370 constexpr auto v2 = S{10}.f();
6371 ]])], [cxx14_constexpr=yes], [cxx14_constexpr=no])
6373 CXXFLAGS=$save_CXXFLAGS
6374 AC_MSG_RESULT([$cxx14_constexpr])
6375 if test "$cxx14_constexpr" = yes; then
6376 AC_DEFINE([HAVE_CXX14_CONSTEXPR])
6379 dnl _Pragma support (may require C++11)
6380 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6381 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6383 save_CXXFLAGS=$CXXFLAGS
6384 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6385 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6386 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6388 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6389 AC_MSG_RESULT([yes])
6390 ], [AC_MSG_RESULT([no])])
6392 CXXFLAGS=$save_CXXFLAGS
6395 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6396 if test "$GCC" = yes; then
6397 AC_MSG_CHECKING([whether $CXX supports -fno-sized-deallocation])
6399 save_CXXFLAGS=$CXXFLAGS
6400 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6401 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6402 CXXFLAGS=$save_CXXFLAGS
6404 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6405 AC_MSG_RESULT([yes])
6410 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6412 AC_MSG_CHECKING([[whether $CXX supports [[fallthrough]]]])
6414 save_CXXFLAGS=$CXXFLAGS
6415 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6416 dnl Unknown attributes must be ignored by compilers, but they do emit warnings about them:
6417 if test "$COM" = MSC; then
6418 CXXFLAGS="$CXXFLAGS /we5030"
6420 CXXFLAGS="$CXXFLAGS -Werror"
6422 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6423 // There appears to be no feature-test macro for __has_cpp_attribute in C++2a, approximate
6424 // by checking for __cplusplus:
6425 #if __cplusplus > 201703L
6426 #if !__has_cpp_attribute(fallthrough)
6441 AC_DEFINE([HAVE_CPP_ATTRIBUTE_FALLTHROUGH],[1])
6442 AC_MSG_RESULT([yes])
6443 ], [AC_MSG_RESULT([no])])
6444 CXXFLAGS=$save_CXXFLAGS
6447 AC_MSG_CHECKING([[whether $CXX supports [[nodiscard]]]])
6449 save_CXXFLAGS=$CXXFLAGS
6450 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6451 dnl Unknown attributes must be ignored by compilers, but they do emit warnings about them:
6452 if test "$COM" = MSC; then
6453 CXXFLAGS="$CXXFLAGS /we5030"
6455 CXXFLAGS="$CXXFLAGS -Werror"
6457 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
6458 // There appears to be no feature-test macro for __has_cpp_attribute in C++2a, approximate
6459 // by checking for __cplusplus:
6460 #if __cplusplus > 201703L
6461 #if !__has_cpp_attribute(nodiscard)
6465 [[nodiscard]] int f();
6468 AC_DEFINE([HAVE_CPP_ATTRIBUTE_NODISCARD],[1])
6469 AC_MSG_RESULT([yes])
6470 ], [AC_MSG_RESULT([no])])
6471 CXXFLAGS=$save_CXXFLAGS
6474 AC_MSG_CHECKING([whether $CXX supports guaranteed copy elision])
6476 save_CXXFLAGS=$CXXFLAGS
6477 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6478 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6479 // At least VS 2017 15.8.1 defines __cpp_guaranteed_copy_elision as 201606L without actually
6481 #if !defined __cpp_guaranteed_copy_elision || (defined _MSC_VER && !defined __clang__)
6490 void f() { S c(copy()); }
6493 AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
6494 AC_MSG_RESULT([yes])
6495 ], [AC_MSG_RESULT([no])])
6496 CXXFLAGS=$save_CXXFLAGS
6499 AC_MSG_CHECKING([whether $CXX has a fix for CWG1579])
6501 save_CXXFLAGS=$CXXFLAGS
6502 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6503 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6507 std::unique_ptr<S1> f() {
6508 std::unique_ptr<S2> s2(new S2);
6512 AC_DEFINE([HAVE_CXX_CWG1579_FIX],[1])
6513 AC_MSG_RESULT([yes])
6514 ], [AC_MSG_RESULT([no])])
6515 CXXFLAGS=$save_CXXFLAGS
6518 AC_MSG_CHECKING([whether $CXX has GCC bug 87150])
6520 save_CXXFLAGS=$CXXFLAGS
6521 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6522 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6523 struct S1 { S1(S1 &&); };
6525 S1 f(S2 s) { return s; }
6527 AC_DEFINE([HAVE_GCC_BUG_87150],[1])
6528 AC_MSG_RESULT([yes])
6529 ], [AC_MSG_RESULT([no])])
6530 CXXFLAGS=$save_CXXFLAGS
6533 dnl ===================================================================
6534 dnl system stl sanity tests
6535 dnl ===================================================================
6536 if test "$_os" != "WINNT"; then
6540 save_CPPFLAGS="$CPPFLAGS"
6541 if test -n "$MACOSX_SDK_PATH"; then
6542 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6545 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6547 if test "$CPP_LIBRARY" = GLIBCXX; then
6548 dnl gcc#19664, gcc#22482, rhbz#162935
6549 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6550 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6551 AC_MSG_RESULT([$stlvisok])
6552 if test "$stlvisok" = "no"; then
6553 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
6557 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6558 # when we don't make any dynamic libraries?
6559 if test "$DISABLE_DYNLOADING" = ""; then
6560 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6561 cat > conftestlib1.cc <<_ACEOF
6562 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6563 struct S2: S1<int> { virtual ~S2(); };
6566 cat > conftestlib2.cc <<_ACEOF
6567 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6568 struct S2: S1<int> { virtual ~S2(); };
6569 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6571 gccvisinlineshiddenok=yes
6572 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6573 gccvisinlineshiddenok=no
6575 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6576 dnl known to not work with -z defs (unsetting which makes the test
6578 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6579 if test "$COM_IS_CLANG" = TRUE; then
6580 for i in $CXX $CXXFLAGS; do
6583 my_linkflagsnoundefs=
6589 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6590 gccvisinlineshiddenok=no
6595 AC_MSG_RESULT([$gccvisinlineshiddenok])
6596 if test "$gccvisinlineshiddenok" = "no"; then
6597 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6601 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6602 cat >visibility.cxx <<_ACEOF
6603 #pragma GCC visibility push(hidden)
6604 struct __attribute__ ((visibility ("default"))) TestStruct {
6607 __attribute__ ((visibility ("default"))) void TestFunc() {
6611 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
6616 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
6619 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
6631 rm -f visibility.s visibility.cxx
6633 AC_MSG_RESULT([$gccvisbroken])
6634 if test "$gccvisbroken" = "yes"; then
6635 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
6638 CPPFLAGS="$save_CPPFLAGS"
6643 dnl ===================================================================
6645 dnl ===================================================================
6647 HAVE_GCC_FNO_DEFAULT_INLINE=
6648 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6649 if test "$GCC" = "yes"; then
6650 AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
6652 save_CXXFLAGS=$CXXFLAGS
6653 CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
6654 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
6655 CXXFLAGS=$save_CXXFLAGS
6657 if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
6658 AC_MSG_RESULT([yes])
6663 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6665 save_CXXFLAGS=$CXXFLAGS
6666 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6667 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6668 CXXFLAGS=$save_CXXFLAGS
6670 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6671 AC_MSG_RESULT([yes])
6676 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
6677 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6679 dnl ===================================================================
6680 dnl Compiler plugins
6681 dnl ===================================================================
6684 # currently only Clang
6686 if test "$COM_IS_CLANG" != "TRUE"; then
6687 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
6688 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
6689 enable_compiler_plugins=no
6693 if test "$COM_IS_CLANG" = "TRUE"; then
6694 if test -n "$enable_compiler_plugins"; then
6695 compiler_plugins="$enable_compiler_plugins"
6696 elif test -n "$ENABLE_DBGUTIL"; then
6697 compiler_plugins=test
6701 if test "$compiler_plugins" != no -a "$CLANGVER" -lt 30800; then
6702 if test "$compiler_plugins" = yes; then
6703 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 3.8.0.])
6708 if test "$compiler_plugins" != "no"; then
6709 dnl The prefix where Clang resides, override to where Clang resides if
6710 dnl using a source build:
6711 if test -z "$CLANGDIR"; then
6715 save_CPPFLAGS=$CPPFLAGS
6717 # compiler plugins must be built with "native" compiler that was used to build Clang itself:
6718 : "${COMPILER_PLUGINS_CXX=g++}"
6719 CXX=$COMPILER_PLUGINS_CXX
6720 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
6721 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
6722 [COMPILER_PLUGINS=TRUE],
6724 if test "$compiler_plugins" = "yes"; then
6725 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
6727 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
6728 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
6732 CPPFLAGS=$save_CPPFLAGS
6736 if test "$enable_compiler_plugins" = "yes"; then
6737 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
6740 AC_SUBST(COMPILER_PLUGINS)
6741 AC_SUBST(COMPILER_PLUGINS_CXX)
6742 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
6743 AC_SUBST(COMPILER_PLUGINS_DEBUG)
6745 AC_SUBST(CLANGLIBDIR)
6747 # Plugin to help linker.
6748 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
6749 # This makes --enable-lto build with clang work.
6752 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6753 AC_SUBST(HAVE_POSIX_FALLOCATE)
6755 dnl ===================================================================
6756 dnl Custom build version
6757 dnl ===================================================================
6759 AC_MSG_CHECKING([whether to add custom build version])
6760 if test "$with_build_version" != ""; then
6761 BUILD_VER_STRING=$with_build_version
6762 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6767 AC_SUBST(BUILD_VER_STRING)
6769 JITC_PROCESSOR_TYPE=""
6770 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6771 # IBMs JDK needs this...
6772 JITC_PROCESSOR_TYPE=6
6773 export JITC_PROCESSOR_TYPE
6775 AC_SUBST([JITC_PROCESSOR_TYPE])
6777 # Misc Windows Stuff
6778 AC_ARG_WITH(ucrt-dir,
6779 AS_HELP_STRING([--with-ucrt-dir],
6780 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
6781 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
6782 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
6783 Windows6.1-KB2999226-x64.msu
6784 Windows6.1-KB2999226-x86.msu
6785 Windows8.1-KB2999226-x64.msu
6786 Windows8.1-KB2999226-x86.msu
6787 Windows8-RT-KB2999226-x64.msu
6788 Windows8-RT-KB2999226-x86.msu
6789 A zip archive including those files is available from Microsoft site:
6790 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
6792 UCRT_REDISTDIR="$with_ucrt_dir"
6793 if test $_os = "WINNT"; then
6796 MSVC_DLL_PATH="$msvcdllpath"
6797 MSVC_DLLS="$msvcdlls"
6799 # MSVC 15.3 changed it to VC141
6800 if echo "$MSVC_DLL_PATH" | grep -q "VC141.CRT$"; then
6801 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
6803 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6805 if test "$UCRT_REDISTDIR" = "no"; then
6806 dnl explicitly disabled
6809 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
6810 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
6811 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
6812 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
6813 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
6814 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
6816 if test -n "$PKGFORMAT"; then
6817 for i in $PKGFORMAT; do
6820 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
6821 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
6830 AC_SUBST(UCRT_REDISTDIR)
6831 AC_SUBST(MSVC_DLL_PATH)
6835 dnl ===================================================================
6837 dnl ===================================================================
6838 if test "$ENABLE_JAVA" != ""; then
6840 # Windows-specific tests
6841 if test "$build_os" = "cygwin"; then
6842 if test "$BITNESS_OVERRIDE" = 64; then
6848 if test -z "$with_jdk_home"; then
6849 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
6850 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
6851 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
6852 if test -n "$regvalue"; then
6854 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
6857 if test -z "$with_jdk_home"; then
6858 for ver in 1.8 1.7 1.6; do
6859 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
6860 if test -n "$regvalue"; then
6866 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
6867 with_jdk_home="$_jdk_home"
6868 howfound="found automatically"
6870 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
6873 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
6874 howfound="you passed"
6878 # MacOS X: /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.
6879 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
6880 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
6881 with_jdk_home=`/usr/libexec/java_home`
6884 JAVA_HOME=; export JAVA_HOME
6885 if test -z "$with_jdk_home"; then
6886 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
6888 _java_path="$with_jdk_home/bin/$with_java"
6889 dnl Check if there is a Java interpreter at all.
6890 if test -x "$_java_path"; then
6891 JAVAINTERPRETER=$_java_path
6893 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
6897 dnl Check that the JDK found is correct architecture (at least 2 reasons to
6898 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
6899 dnl loaded by java to run JunitTests:
6900 if test "$build_os" = "cygwin"; then
6901 shortjdkhome=`cygpath -d "$with_jdk_home"`
6902 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
6903 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
6904 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6905 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
6906 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6907 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6910 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6911 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6913 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
6914 elif test "$cross_compiling" != "yes"; then
6916 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
6917 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
6918 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
6919 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6922 *) # assumption: everything else 32-bit
6923 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
6924 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6925 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6933 dnl ===================================================================
6935 dnl ===================================================================
6937 # Note that JAVA_HOME as for now always means the *build* platform's
6938 # JAVA_HOME. Whether all the complexity here actually is needed any
6939 # more or not, no idea.
6941 if test "$ENABLE_JAVA" != ""; then
6943 AC_MSG_CHECKING([the installed JDK])
6944 if test -n "$JAVAINTERPRETER"; then
6945 dnl java -version sends output to stderr!
6946 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6947 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6948 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6949 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6950 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6951 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6952 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6955 dnl IBM JDK specific tests
6956 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6957 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6959 if test "$_jdk_ver" -lt 10600; then
6960 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.6])
6963 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6965 if test "$with_jdk_home" = ""; then
6966 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6967 you must use the "--with-jdk-home" configure option explicitly])
6970 JAVA_HOME=$with_jdk_home
6974 dnl Sun JDK specific tests
6975 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
6976 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6978 if test "$_jdk_ver" -lt 10600; then
6979 AC_MSG_ERROR([JDK is too old, you need at least 1.6])
6981 if test "$_jdk_ver" -gt 10600; then
6982 JAVA_CLASSPATH_NOT_SET=TRUE
6984 if test "$_jdk_ver" -ge 10900; then
6988 AC_MSG_RESULT([checked (JDK $_jdk)])
6989 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6990 if test "$_os" = "WINNT"; then
6991 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6994 # set to limit VM usage for JunitTests
6996 # set to limit VM usage for javac
6997 JAVAFLAGS=-J-Xmx128M
7000 AC_MSG_ERROR([Java not found. You need at least jdk-1.6])
7008 dnl ===================================================================
7009 dnl Set target Java bytecode version
7010 dnl ===================================================================
7011 if test "$ENABLE_JAVA" != ""; then
7012 if test "$HAVE_JAVA9" = "TRUE"; then
7013 _java_target_ver="1.6"
7015 _java_target_ver="1.5"
7017 JAVA_SOURCE_VER="$_java_target_ver"
7018 JAVA_TARGET_VER="$_java_target_ver"
7021 dnl ===================================================================
7022 dnl Checks for javac
7023 dnl ===================================================================
7024 if test "$ENABLE_JAVA" != ""; then
7025 javacompiler="javac"
7026 if test -z "$with_jdk_home"; then
7027 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
7029 _javac_path="$with_jdk_home/bin/$javacompiler"
7030 dnl Check if there is a Java compiler at all.
7031 if test -x "$_javac_path"; then
7032 JAVACOMPILER=$_javac_path
7035 if test -z "$JAVACOMPILER"; then
7036 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7038 if test "$build_os" = "cygwin"; then
7039 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7040 JAVACOMPILER="${JAVACOMPILER}.exe"
7042 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7046 dnl ===================================================================
7047 dnl Checks for javadoc
7048 dnl ===================================================================
7049 if test "$ENABLE_JAVA" != ""; then
7050 if test -z "$with_jdk_home"; then
7051 AC_PATH_PROG(JAVADOC, javadoc)
7053 _javadoc_path="$with_jdk_home/bin/javadoc"
7054 dnl Check if there is a javadoc at all.
7055 if test -x "$_javadoc_path"; then
7056 JAVADOC=$_javadoc_path
7058 AC_PATH_PROG(JAVADOC, javadoc)
7061 if test -z "$JAVADOC"; then
7062 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7064 if test "$build_os" = "cygwin"; then
7065 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7066 JAVADOC="${JAVADOC}.exe"
7068 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7071 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7072 JAVADOCISGJDOC="yes"
7075 AC_SUBST(JAVADOCISGJDOC)
7077 if test "$ENABLE_JAVA" != ""; then
7078 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7079 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7080 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7081 # try to recover first by looking whether we have a alternatives
7082 # system as in Debian or newer SuSEs where following /usr/bin/javac
7083 # over /etc/alternatives/javac leads to the right bindir where we
7084 # just need to strip a bit away to get a valid JAVA_HOME
7085 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7086 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7087 # maybe only one level of symlink (e.g. on Mac)
7088 JAVA_HOME=$(readlink $JAVACOMPILER)
7089 if test "$(dirname $JAVA_HOME)" = "."; then
7090 # we've got no path to trim back
7095 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7096 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7097 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7098 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7100 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
7101 if test "$JAVA_HOME" != "/usr"; then
7102 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7103 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7104 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7105 dnl Tiger already returns a JDK path..
7106 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7108 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7109 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7110 dnl that checks which version to run
7111 if test -f "$JAVA_HOME"; then
7112 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7117 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7119 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7120 if test -z "$JAVA_HOME"; then
7121 if test "x$with_jdk_home" = "x"; then
7122 cat > findhome.java <<_ACEOF
7123 [import java.io.File;
7127 public static void main(String args[])
7129 String jrelocation = System.getProperty("java.home");
7130 File jre = new File(jrelocation);
7131 System.out.println(jre.getParent());
7135 AC_MSG_CHECKING([if javac works])
7136 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7137 AC_TRY_EVAL(javac_cmd)
7138 if test $? = 0 -a -f ./findhome.class; then
7139 AC_MSG_RESULT([javac works])
7141 echo "configure: javac test failed" >&5
7142 cat findhome.java >&5
7143 AC_MSG_ERROR([javac does not work - java projects will not build!])
7145 AC_MSG_CHECKING([if gij knows its java.home])
7146 JAVA_HOME=`$JAVAINTERPRETER findhome`
7147 if test $? = 0 -a "$JAVA_HOME" != ""; then
7148 AC_MSG_RESULT([$JAVA_HOME])
7150 echo "configure: java test failed" >&5
7151 cat findhome.java >&5
7152 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7154 # clean-up after ourselves
7155 rm -f ./findhome.java ./findhome.class
7157 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7161 # now check if $JAVA_HOME is really valid
7162 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7163 case "${JAVA_HOME}" in
7164 /Library/Java/JavaVirtualMachines/*)
7167 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7170 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7173 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7176 if test "$JAVA_HOME_OK" = "NO"; then
7177 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7178 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7179 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
7180 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7181 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7182 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
7184 PathFormat "$JAVA_HOME"
7185 JAVA_HOME="$formatted_path"
7188 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7191 AC_MSG_CHECKING([for JAWT lib])
7192 if test "$_os" = WINNT; then
7193 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7198 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7199 JAVA_ARCH=$my_java_arch
7214 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7215 JAVA_ARCH=$my_java_arch
7218 my_java_arch=sparcv9
7224 my_java_arch=$host_cpu
7227 # This is where JDK9 puts the library
7228 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7229 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7231 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7233 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7235 AC_MSG_RESULT([$JAWTLIB])
7239 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7243 JAVAINC="-I$JAVA_HOME/include"
7244 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7245 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7249 JAVAINC="-I$JAVA_HOME/include/win32"
7250 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7254 if test -d "$JAVA_HOME/include/darwin"; then
7255 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7257 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7262 JAVAINC="-I$JAVA_HOME/include"
7263 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7267 JAVAINC="-I$JAVA_HOME/include"
7268 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7269 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7270 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7271 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7275 JAVAINC="-I$JAVA_HOME/include"
7276 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7277 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7281 JAVAINC="-I$JAVA_HOME/include"
7282 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7283 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7287 JAVAINC="-I$JAVA_HOME/include"
7288 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7289 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7293 JAVAINC="-I$JAVA_HOME/include"
7294 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7295 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7299 JAVAINC="-I$JAVA_HOME/include"
7300 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7301 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7305 SOLARINC="$SOLARINC $JAVAINC"
7307 AC_SUBST(JAVACOMPILER)
7309 AC_SUBST(JAVAINTERPRETER)
7310 AC_SUBST(JAVAIFLAGS)
7312 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7314 AC_SUBST(JAVA_SOURCE_VER)
7315 AC_SUBST(JAVA_TARGET_VER)
7319 dnl ===================================================================
7320 dnl Export file validation
7321 dnl ===================================================================
7322 AC_MSG_CHECKING([whether to enable export file validation])
7323 if test "$with_export_validation" != "no"; then
7324 if test -z "$ENABLE_JAVA"; then
7325 if test "$with_export_validation" = "yes"; then
7326 AC_MSG_ERROR([requested, but Java is disabled])
7328 AC_MSG_RESULT([no, as Java is disabled])
7330 elif test "$_jdk_ver" -lt 10800; then
7331 if test "$with_export_validation" = "yes"; then
7332 AC_MSG_ERROR([requested, but Java is too old, need Java 8])
7334 AC_MSG_RESULT([no, as Java is too old, need Java 8])
7337 AC_MSG_RESULT([yes])
7338 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7340 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7341 if test -z "$ODFVALIDATOR"; then
7342 # remember to download the ODF toolkit with validator later
7343 AC_MSG_NOTICE([no odfvalidator found, will download it])
7344 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7345 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7347 # and fetch name of odfvalidator jar name from download.lst
7348 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7349 AC_SUBST(ODFVALIDATOR_JAR)
7351 if test -z "$ODFVALIDATOR_JAR"; then
7352 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7355 if test "$build_os" = "cygwin"; then
7356 # In case of Cygwin it will be executed from Windows,
7357 # so we need to run bash and absolute path to validator
7358 # so instead of "odfvalidator" it will be
7359 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7360 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7362 ODFVALIDATOR="sh $ODFVALIDATOR"
7364 AC_SUBST(ODFVALIDATOR)
7367 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7368 if test -z "$OFFICEOTRON"; then
7369 # remember to download the officeotron with validator later
7370 AC_MSG_NOTICE([no officeotron found, will download it])
7371 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7372 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7374 # and fetch name of officeotron jar name from download.lst
7375 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7376 AC_SUBST(OFFICEOTRON_JAR)
7378 if test -z "$OFFICEOTRON_JAR"; then
7379 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7382 # check version of existing officeotron
7383 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7384 if test 0"$OFFICEOTRON_VER" -lt 704; then
7385 AC_MSG_ERROR([officeotron too old])
7388 if test "$build_os" = "cygwin"; then
7389 # In case of Cygwin it will be executed from Windows,
7390 # so we need to run bash and absolute path to validator
7391 # so instead of "odfvalidator" it will be
7392 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7393 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7395 OFFICEOTRON="sh $OFFICEOTRON"
7398 AC_SUBST(OFFICEOTRON)
7403 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7404 if test "$with_bffvalidator" != "no"; then
7405 AC_DEFINE(HAVE_BFFVALIDATOR)
7407 if test "$with_export_validation" = "no"; then
7408 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7411 if test "$with_bffvalidator" = "yes"; then
7412 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7414 BFFVALIDATOR="$with_bffvalidator"
7417 if test "$build_os" = "cygwin"; then
7418 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7419 AC_MSG_RESULT($BFFVALIDATOR)
7421 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7423 elif test -n "$BFFVALIDATOR"; then
7424 # We are not in Cygwin but need to run Windows binary with wine
7425 AC_PATH_PROGS(WINE, wine)
7427 # so swap in a shell wrapper that converts paths transparently
7428 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7429 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7430 AC_SUBST(BFFVALIDATOR_EXE)
7431 AC_MSG_RESULT($BFFVALIDATOR)
7433 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7435 AC_SUBST(BFFVALIDATOR)
7440 dnl ===================================================================
7441 dnl Check for C preprocessor to use
7442 dnl ===================================================================
7443 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7444 if test -n "$with_idlc_cpp"; then
7445 AC_MSG_RESULT([$with_idlc_cpp])
7446 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7448 AC_MSG_RESULT([ucpp])
7449 AC_MSG_CHECKING([which ucpp tp use])
7450 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7451 AC_MSG_RESULT([external])
7452 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7454 AC_MSG_RESULT([internal])
7455 BUILD_TYPE="$BUILD_TYPE UCPP"
7458 AC_SUBST(SYSTEM_UCPP)
7460 dnl ===================================================================
7461 dnl Check for epm (not needed for Windows)
7462 dnl ===================================================================
7463 AC_MSG_CHECKING([whether to enable EPM for packing])
7464 if test "$enable_epm" = "yes"; then
7465 AC_MSG_RESULT([yes])
7466 if test "$_os" != "WINNT"; then
7467 if test $_os = Darwin; then
7469 elif test -n "$with_epm"; then
7472 AC_PATH_PROG(EPM, epm, no)
7474 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7475 AC_MSG_NOTICE([EPM will be built.])
7476 BUILD_TYPE="$BUILD_TYPE EPM"
7477 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7479 # Gentoo has some epm which is something different...
7480 AC_MSG_CHECKING([whether the found epm is the right epm])
7481 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7482 AC_MSG_RESULT([yes])
7484 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7486 AC_MSG_CHECKING([epm version])
7487 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7488 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7489 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7490 AC_MSG_RESULT([OK, >= 3.7])
7492 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7493 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7498 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7499 AC_MSG_CHECKING([for rpm])
7500 for a in "$RPM" rpmbuild rpm; do
7501 $a --usage >/dev/null 2> /dev/null
7502 if test $? -eq 0; then
7506 $a --version >/dev/null 2> /dev/null
7507 if test $? -eq 0; then
7513 if test -z "$RPM"; then
7514 AC_MSG_ERROR([not found])
7515 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7516 RPM_PATH=`which $RPM`
7517 AC_MSG_RESULT([$RPM_PATH])
7518 SCPDEFS="$SCPDEFS -DWITH_RPM"
7520 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7523 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7524 AC_PATH_PROG(DPKG, dpkg, no)
7525 if test "$DPKG" = "no"; then
7526 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7529 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7530 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7531 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7532 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7533 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7534 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
7535 AC_MSG_RESULT([yes])
7538 if echo "$PKGFORMAT" | $GREP -q rpm; then
7540 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7541 add_warning "the rpms will need to be installed with --nodeps"
7545 AC_MSG_WARN([the ${_pt}s will not be relocatable])
7546 add_warning "the ${_pt}s will not be relocatable"
7547 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7548 relocation will work, you need to patch your epm with the
7549 patch in epm/epm-3.7.patch or build with
7550 --with-epm=internal which will build a suitable epm])
7555 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7556 AC_PATH_PROG(PKGMK, pkgmk, no)
7557 if test "$PKGMK" = "no"; then
7558 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7565 for i in $PKGFORMAT; do
7567 aix | bsd | deb | pkg | rpm | native | portable)
7569 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7579 if test "$enable_lotuswordpro" = "yes"; then
7582 AC_SUBST(ENABLE_LWP)
7584 dnl ===================================================================
7585 dnl Check for building ODK
7586 dnl ===================================================================
7587 if test "$enable_odk" = no; then
7590 if test "$with_doxygen" = no; then
7591 AC_MSG_CHECKING([for doxygen])
7595 if test "$with_doxygen" = yes; then
7596 AC_PATH_PROG([DOXYGEN], [doxygen])
7597 if test -z "$DOXYGEN"; then
7598 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7600 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
7601 if ! dot -V 2>/dev/null; then
7602 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
7606 AC_MSG_CHECKING([for doxygen])
7607 DOXYGEN=$with_doxygen
7608 AC_MSG_RESULT([$DOXYGEN])
7610 if test -n "$DOXYGEN"; then
7611 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7612 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7613 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7614 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7621 AC_MSG_CHECKING([whether to build the ODK])
7622 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7623 AC_MSG_RESULT([yes])
7625 if test "$with_java" != "no"; then
7626 AC_MSG_CHECKING([whether to build unowinreg.dll])
7627 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7628 # build on Win by default
7629 enable_build_unowinreg=yes
7631 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7635 AC_MSG_RESULT([yes])
7636 BUILD_UNOWINREG=TRUE
7638 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7639 if test -z "$with_mingw_cross_compiler"; then
7641 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7642 elif test -x "$with_mingw_cross_compiler"; then
7643 MINGWCXX="$with_mingw_cross_compiler"
7645 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7648 if test "$MINGWCXX" = "false"; then
7649 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7652 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7653 if test -x "$mingwstrip_test"; then
7654 MINGWSTRIP="$mingwstrip_test"
7656 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7659 if test "$MINGWSTRIP" = "false"; then
7660 AC_MSG_ERROR(MinGW32 binutils not found.)
7664 BUILD_TYPE="$BUILD_TYPE ODK"
7669 AC_SUBST(BUILD_UNOWINREG)
7671 AC_SUBST(MINGWSTRIP)
7673 dnl ===================================================================
7674 dnl Check for system zlib
7675 dnl ===================================================================
7676 if test "$with_system_zlib" = "auto"; then
7679 with_system_zlib="$with_system_libs"
7682 if test "$enable_fuzzers" != "yes"; then
7683 with_system_zlib=yes
7691 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
7692 dnl and has no pkg-config for it at least on some tinderboxes,
7693 dnl so leaving that out for now
7694 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7695 AC_MSG_CHECKING([which zlib to use])
7696 if test "$with_system_zlib" = "yes"; then
7697 AC_MSG_RESULT([external])
7699 AC_CHECK_HEADER(zlib.h, [],
7700 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7701 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
7702 [AC_MSG_ERROR(zlib not found or functional)], [])
7704 AC_MSG_RESULT([internal])
7706 BUILD_TYPE="$BUILD_TYPE ZLIB"
7707 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7708 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
7710 AC_SUBST(ZLIB_CFLAGS)
7712 AC_SUBST(SYSTEM_ZLIB)
7714 dnl ===================================================================
7715 dnl Check for system jpeg
7716 dnl ===================================================================
7717 AC_MSG_CHECKING([which libjpeg to use])
7718 if test "$with_system_jpeg" = "yes"; then
7719 AC_MSG_RESULT([external])
7721 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
7722 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7723 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
7724 [AC_MSG_ERROR(jpeg library not found or fuctional)], [])
7727 AC_MSG_RESULT([internal, libjpeg-turbo])
7728 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
7729 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
7730 if test "$COM" = "MSC"; then
7731 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
7733 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
7737 x86_64 | amd64 | i*86 | x86 | ia32)
7738 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
7739 if test -z "$NASM" -a "$build_os" = "cygwin"; then
7740 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
7741 NASM="$LODE_HOME/opt/bin/nasm"
7742 elif test -x "/opt/lo/bin/nasm"; then
7743 NASM="/opt/lo/bin/nasm"
7747 if test -n "$NASM"; then
7748 AC_MSG_CHECKING([for object file format of host system])
7750 cygwin* | mingw* | pw32* | interix*)
7760 msdosdjgpp* | go32*)
7763 os2-emx*) # not tested
7764 objfmt='MSOMF' # obj
7766 linux*coff* | linux*oldld*)
7782 kfreebsd* | freebsd* | netbsd* | openbsd*)
7783 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7796 solaris* | sunos* | sysv* | sco*)
7806 darwin* | rhapsody* | nextstep* | openstep* | macos*)
7821 AC_MSG_RESULT([$objfmt])
7822 if test "$objfmt" = 'ELF ?'; then
7824 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
7827 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
7829 MSOMF) NAFLAGS='-fobj -DOBJ32';;
7830 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
7831 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
7832 COFF) NAFLAGS='-fcoff -DCOFF';;
7833 a.out) NAFLAGS='-faout -DAOUT';;
7834 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
7835 ELF) NAFLAGS='-felf -DELF';;
7836 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
7837 RDF) NAFLAGS='-frdf -DRDF';;
7838 Mach-O) NAFLAGS='-fmacho -DMACHO';;
7839 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
7841 AC_MSG_RESULT([$NAFLAGS])
7843 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
7844 cat > conftest.asm << EOF
7845 [%line __oline__ "configure"
7853 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
7854 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
7857 echo "configure: failed program was:" >&AC_FD_CC
7858 cat conftest.asm >&AC_FD_CC
7861 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
7867 if test -z "$NASM"; then
7869 ****************************************************************************
7870 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
7874 if test "$build_os" = "cygwin"; then
7876 install a pre-compiled binary for Win32
7878 mkdir -p /opt/lo/bin
7880 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
7883 or get and install one from http://www.nasm.us/
7885 Then re-run autogen.sh
7887 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
7888 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
7893 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
7897 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
7898 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
7905 AC_SUBST(LIBJPEG_CFLAGS)
7906 AC_SUBST(LIBJPEG_LIBS)
7907 AC_SUBST(SYSTEM_LIBJPEG)
7909 dnl ===================================================================
7910 dnl Check for system clucene
7911 dnl ===================================================================
7912 dnl we should rather be using
7913 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
7914 dnl but the contribs-lib check seems tricky
7915 AC_MSG_CHECKING([which clucene to use])
7916 if test "$with_system_clucene" = "yes"; then
7917 AC_MSG_RESULT([external])
7919 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
7920 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
7921 FilterLibs "${CLUCENE_LIBS}"
7922 CLUCENE_LIBS="${filteredlibs}"
7924 save_CXXFLAGS=$CXXFLAGS
7925 save_CPPFLAGS=$CPPFLAGS
7926 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
7927 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
7928 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
7929 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
7930 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
7931 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
7932 CXXFLAGS=$save_CXXFLAGS
7933 CPPFLAGS=$save_CPPFLAGS
7936 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
7938 AC_MSG_RESULT([internal])
7940 BUILD_TYPE="$BUILD_TYPE CLUCENE"
7942 AC_SUBST(SYSTEM_CLUCENE)
7943 AC_SUBST(CLUCENE_CFLAGS)
7944 AC_SUBST(CLUCENE_LIBS)
7946 dnl ===================================================================
7947 dnl Check for system expat
7948 dnl ===================================================================
7949 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
7951 dnl ===================================================================
7952 dnl Check for system xmlsec
7953 dnl ===================================================================
7954 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
7956 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
7957 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
7959 AC_DEFINE([ENABLE_EOT])
7960 AC_MSG_RESULT([yes])
7962 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
7967 AC_SUBST([ENABLE_EOT])
7969 dnl ===================================================================
7970 dnl Check for DLP libs
7971 dnl ===================================================================
7972 AS_IF([test "$COM" = "MSC"],
7973 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
7974 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
7976 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
7978 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
7980 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
7982 AS_IF([test "$COM" = "MSC"],
7983 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
7984 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
7986 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
7988 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
7990 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
7991 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
7993 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
7995 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
7997 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
7999 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
8000 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.14])
8002 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
8003 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
8005 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
8007 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
8008 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
8010 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
8012 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
8014 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
8016 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
8018 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
8019 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
8021 dnl ===================================================================
8022 dnl Check for system lcms2
8023 dnl ===================================================================
8024 if test "$with_system_lcms2" != "yes"; then
8027 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
8028 if test "$GCC" = "yes"; then
8029 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
8031 if test "$COM" = "MSC"; then # override the above
8032 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
8035 dnl ===================================================================
8036 dnl Check for system cppunit
8037 dnl ===================================================================
8038 if test "$_os" != "Android" ; then
8039 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
8042 dnl ===================================================================
8043 dnl Check whether freetype is available
8044 dnl ===================================================================
8045 if test "$test_freetype" = "yes"; then
8046 AC_MSG_CHECKING([whether freetype is available])
8047 # FreeType has 3 different kinds of versions
8048 # * release, like 2.4.10
8049 # * libtool, like 13.0.7 (this what pkg-config returns)
8051 # FreeType's docs/VERSION.DLL provides a table mapping between the three
8054 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
8055 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8056 FilterLibs "${FREETYPE_LIBS}"
8057 FREETYPE_LIBS="${filteredlibs}"
8058 SYSTEM_FREETYPE=TRUE
8060 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
8061 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
8063 AC_SUBST(FREETYPE_CFLAGS)
8064 AC_SUBST(FREETYPE_LIBS)
8065 AC_SUBST([SYSTEM_FREETYPE])
8067 # ===================================================================
8068 # Check for system libxslt
8069 # to prevent incompatibilities between internal libxml2 and external libxslt,
8070 # or vice versa, use with_system_libxml here
8071 # ===================================================================
8072 if test "$with_system_libxml" = "auto"; then
8075 with_system_libxml="$with_system_libs"
8078 if test "$enable_fuzzers" != "yes"; then
8079 with_system_libxml=yes
8081 with_system_libxml=no
8087 AC_MSG_CHECKING([which libxslt to use])
8088 if test "$with_system_libxml" = "yes"; then
8089 AC_MSG_RESULT([external])
8091 if test "$_os" = "Darwin"; then
8092 dnl make sure to use SDK path
8093 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8094 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8096 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8097 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8099 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8100 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8101 FilterLibs "${LIBXSLT_LIBS}"
8102 LIBXSLT_LIBS="${filteredlibs}"
8103 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8104 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8105 FilterLibs "${LIBEXSLT_LIBS}"
8106 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8109 dnl Check for xsltproc
8110 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8111 if test "$XSLTPROC" = "no"; then
8112 AC_MSG_ERROR([xsltproc is required])
8115 AC_MSG_RESULT([internal])
8117 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8119 if test "$cross_compiling" = "yes"; then
8120 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8121 if test "$XSLTPROC" = "no"; then
8122 AC_MSG_ERROR([xsltproc is required])
8126 AC_SUBST(SYSTEM_LIBXSLT)
8127 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8128 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8130 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8132 AC_SUBST(LIBEXSLT_CFLAGS)
8133 AC_SUBST(LIBEXSLT_LIBS)
8134 AC_SUBST(LIBXSLT_CFLAGS)
8135 AC_SUBST(LIBXSLT_LIBS)
8138 # ===================================================================
8139 # Check for system libxml
8140 # ===================================================================
8141 AC_MSG_CHECKING([which libxml to use])
8142 if test "$with_system_libxml" = "yes"; then
8143 AC_MSG_RESULT([external])
8145 if test "$_os" = "Darwin"; then
8146 dnl make sure to use SDK path
8147 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8149 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8150 elif test $_os = iOS; then
8151 dnl make sure to use SDK path
8152 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8153 LIBXML_CFLAGS="-I$usr/include/libxml2"
8154 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8156 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8157 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8158 FilterLibs "${LIBXML_LIBS}"
8159 LIBXML_LIBS="${filteredlibs}"
8162 dnl Check for xmllint
8163 AC_PATH_PROG(XMLLINT, xmllint, no)
8164 if test "$XMLLINT" = "no"; then
8165 AC_MSG_ERROR([xmllint is required])
8168 AC_MSG_RESULT([internal])
8170 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8171 if test "$COM" = "MSC"; then
8172 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8174 if test "$COM" = "MSC"; then
8175 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8177 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8179 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8181 AC_SUBST(SYSTEM_LIBXML)
8182 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8183 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8185 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8186 AC_SUBST(LIBXML_CFLAGS)
8187 AC_SUBST(LIBXML_LIBS)
8190 # =====================================================================
8191 # Checking for a Python interpreter with version >= 2.7.
8192 # Build and runtime requires Python 3 compatible version (>= 2.7).
8193 # Optionally user can pass an option to configure, i. e.
8194 # ./configure PYTHON=/usr/bin/python
8195 # =====================================================================
8196 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8197 # This allows a lack of system python with no error, we use internal one in that case.
8198 AM_PATH_PYTHON([2.7],, [:])
8199 # Clean PYTHON_VERSION checked below if cross-compiling
8201 if test "$PYTHON" != ":"; then
8202 PYTHON_FOR_BUILD=$PYTHON
8205 AC_SUBST(PYTHON_FOR_BUILD)
8207 # Checks for Python to use for Pyuno
8208 AC_MSG_CHECKING([which Python to use for Pyuno])
8209 case "$enable_python" in
8211 if test -z $PYTHON_FOR_BUILD; then
8212 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8213 # requirement from the choice whether to include Python stuff in the installer, but why
8215 AC_MSG_ERROR([Python is required at build time.])
8218 AC_MSG_RESULT([none])
8221 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8222 AC_MSG_RESULT([no, overridden by --disable-scripting])
8224 elif test $build_os = cygwin; then
8225 dnl When building on Windows we don't attempt to use any installed
8226 dnl "system" Python.
8227 AC_MSG_RESULT([fully internal])
8228 enable_python=internal
8229 elif test "$cross_compiling" = yes; then
8230 AC_MSG_RESULT([system])
8231 enable_python=system
8233 # Unset variables set by the above AM_PATH_PYTHON so that
8234 # we actually do check anew.
8235 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
8236 AM_PATH_PYTHON([3.3],, [:])
8237 if test "$PYTHON" = ":"; then
8238 if test -z "$PYTHON_FOR_BUILD"; then
8239 AC_MSG_RESULT([fully internal])
8241 AC_MSG_RESULT([internal])
8243 enable_python=internal
8245 AC_MSG_RESULT([system])
8246 enable_python=system
8251 AC_MSG_RESULT([internal])
8254 AC_MSG_RESULT([fully internal])
8255 enable_python=internal
8258 AC_MSG_RESULT([system])
8261 AC_MSG_ERROR([Incorrect --enable-python option])
8265 if test $enable_python != no; then
8266 BUILD_TYPE="$BUILD_TYPE PYUNO"
8269 if test $enable_python = system; then
8270 if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
8272 PYTHON=python$python_version
8273 if test -d "$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"; then
8274 PYTHON_CFLAGS="-I$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"
8275 PYTHON_LIBS="-framework Python"
8277 PYTHON_CFLAGS="`$PYTHON-config --includes`"
8278 PYTHON_LIBS="`$PYTHON-config --libs`"
8281 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8282 # Fallback: Accept these in the environment, or as set above
8285 elif test "$cross_compiling" != yes; then
8286 # Unset variables set by the above AM_PATH_PYTHON so that
8287 # we actually do check anew.
8288 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
8289 # This causes an error if no python command is found
8290 AM_PATH_PYTHON([3.3])
8291 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8292 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8293 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8294 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8295 if test -z "$PKG_CONFIG"; then
8296 PYTHON_CFLAGS="-I$python_include"
8297 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8298 elif $PKG_CONFIG --exists python-$python_version; then
8299 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8300 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8302 PYTHON_CFLAGS="-I$python_include"
8303 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8305 FilterLibs "${PYTHON_LIBS}"
8306 PYTHON_LIBS="${filteredlibs}"
8308 dnl How to find out the cross-compilation Python installation path?
8309 AC_MSG_CHECKING([for python version])
8310 AS_IF([test -n "$PYTHON_VERSION"],
8311 [AC_MSG_RESULT([$PYTHON_VERSION])],
8312 [AC_MSG_RESULT([not found])
8313 AC_MSG_ERROR([no usable python found])])
8314 test -n "$PYTHON_CFLAGS" && break
8317 dnl Check if the headers really work
8318 save_CPPFLAGS="$CPPFLAGS"
8319 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8320 AC_CHECK_HEADER(Python.h)
8321 CPPFLAGS="$save_CPPFLAGS"
8323 # let the PYTHON_FOR_BUILD match the same python installation that
8324 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8325 # better for PythonTests.
8326 PYTHON_FOR_BUILD=$PYTHON
8329 if test "$with_lxml" != no; then
8330 if test -z "$PYTHON_FOR_BUILD"; then
8333 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8336 if test "$cross_compiling" != yes ; then
8337 BUILD_TYPE="$BUILD_TYPE LXML"
8342 AC_MSG_CHECKING([for python lxml])
8343 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8344 AC_MSG_RESULT([yes])
8348 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8351 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8352 BUILD_TYPE="$BUILD_TYPE LXML"
8353 AC_MSG_RESULT([no, using internal lxml])
8355 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8363 dnl By now enable_python should be "system", "internal" or "no"
8364 case $enable_python in
8368 if test "x$ac_cv_header_Python_h" != "xyes"; then
8369 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8373 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8374 AC_MSG_CHECKING([for correct python library version])
8375 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8378 int main(int argc, char **argv) {
8379 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
8380 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8383 ]])],[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])])
8387 dnl FIXME Check if the Python library can be linked with, too?
8392 PYTHON_VERSION_MAJOR=3
8393 PYTHON_VERSION_MINOR=5
8394 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.5
8395 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
8396 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
8398 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8399 BUILD_TYPE="$BUILD_TYPE PYTHON"
8400 # Embedded Python dies without Home set
8401 if test "$HOME" = ""; then
8410 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8414 AC_SUBST(DISABLE_PYTHON)
8415 AC_SUBST(SYSTEM_PYTHON)
8416 AC_SUBST(PYTHON_CFLAGS)
8417 AC_SUBST(PYTHON_LIBS)
8418 AC_SUBST(PYTHON_VERSION)
8419 AC_SUBST(PYTHON_VERSION_MAJOR)
8420 AC_SUBST(PYTHON_VERSION_MINOR)
8422 ENABLE_MARIADBC=TRUE
8423 if test "$_os" = "Android" -o "$_os" = "iOS"; then
8429 if test "$ENABLE_MARIADBC" = "TRUE"; then
8430 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8433 AC_SUBST(ENABLE_MARIADBC)
8434 AC_SUBST(MARIADBC_MAJOR)
8435 AC_SUBST(MARIADBC_MINOR)
8436 AC_SUBST(MARIADBC_MICRO)
8438 if test "$ENABLE_MARIADBC" = "TRUE"; then
8439 dnl ===================================================================
8440 dnl Check for system MariaDB
8441 dnl ===================================================================
8442 AC_MSG_CHECKING([which MariaDB to use])
8443 if test "$with_system_mariadb" = "yes"; then
8444 AC_MSG_RESULT([external])
8445 SYSTEM_MARIADB_CONNECTOR_C=TRUE
8446 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8447 if test -z "$MARIADBCONFIG"; then
8448 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8449 if test -z "$MARIADBCONFIG"; then
8450 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8451 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8454 AC_MSG_CHECKING([MariaDB version])
8455 MARIADB_VERSION=`$MARIADBCONFIG --version`
8456 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8457 if test "$MARIADB_MAJOR" -ge "5"; then
8460 AC_MSG_ERROR([too old, use 5.0.x or later])
8462 AC_MSG_CHECKING([for MariaDB Client library])
8463 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8464 if test "$COM_IS_CLANG" = TRUE; then
8465 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8467 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8468 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8469 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8471 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8472 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8473 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8474 | sed -e 's|/lib64/|/lib/|')
8476 FilterLibs "${MARIADB_LIBS}"
8477 MARIADB_LIBS="${filteredlibs}"
8478 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8479 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8480 if test "$enable_bundle_mariadb" = "yes"; then
8481 AC_MSG_RESULT([yes])
8482 BUNDLE_MARIADB_CONNECTOR_C=TRUE
8483 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8485 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8487 /g' | grep -E '(mysqlclient|mariadb)')
8488 if test "$_os" = "Darwin"; then
8489 LIBMARIADB=${LIBMARIADB}.dylib
8490 elif test "$_os" = "WINNT"; then
8491 LIBMARIADB=${LIBMARIADB}.dll
8493 LIBMARIADB=${LIBMARIADB}.so
8495 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8496 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8497 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8498 AC_MSG_RESULT([found.])
8499 PathFormat "$LIBMARIADB_PATH"
8500 LIBMARIADB_PATH="$formatted_path"
8502 AC_MSG_ERROR([not found.])
8506 BUNDLE_MARIADB_CONNECTOR_C=
8509 AC_MSG_RESULT([internal])
8510 SYSTEM_MARIADB_CONNECTOR_C=
8511 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
8512 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
8513 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
8516 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
8517 AC_SUBST(MARIADB_CFLAGS)
8518 AC_SUBST(MARIADB_LIBS)
8519 AC_SUBST(LIBMARIADB)
8520 AC_SUBST(LIBMARIADB_PATH)
8521 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
8524 dnl ===================================================================
8525 dnl Check for system hsqldb
8526 dnl ===================================================================
8527 if test "$with_java" != "no"; then
8528 HSQLDB_USE_JDBC_4_1=
8529 AC_MSG_CHECKING([which hsqldb to use])
8530 if test "$with_system_hsqldb" = "yes"; then
8531 AC_MSG_RESULT([external])
8533 if test -z $HSQLDB_JAR; then
8534 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8536 if ! test -f $HSQLDB_JAR; then
8537 AC_MSG_ERROR(hsqldb.jar not found.)
8539 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8543 my $file = "$ENV{'HSQLDB_JAR'}";
8544 my $zip = Archive::Zip->new( $file );
8545 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8546 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8548 push @l, split(/\n/, $mf);
8549 foreach my $line (@l)
8551 if ($line =~ m/Specification-Version:/)
8553 ($t, $version) = split (/:/,$line);
8554 $version =~ s/^\s//;
8555 ($a, $b, $c, $d) = split (/\./,$version);
8556 if ($c == "0" && $d > "8")
8571 AC_MSG_RESULT([yes])
8573 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8576 AC_MSG_RESULT([internal])
8578 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8580 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8581 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8582 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8583 AC_MSG_RESULT([yes])
8584 HSQLDB_USE_JDBC_4_1=TRUE
8589 AC_SUBST(SYSTEM_HSQLDB)
8590 AC_SUBST(HSQLDB_JAR)
8591 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8594 dnl ===================================================================
8595 dnl Check for PostgreSQL stuff
8596 dnl ===================================================================
8597 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
8598 if test "x$enable_postgresql_sdbc" != "xno"; then
8599 AC_MSG_RESULT([yes])
8600 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8602 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8603 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8605 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8606 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8609 postgres_interface=""
8610 if test "$with_system_postgresql" = "yes"; then
8611 postgres_interface="external PostgreSQL"
8612 SYSTEM_POSTGRESQL=TRUE
8613 if test "$_os" = Darwin; then
8615 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8616 pg_supp_path="$P_SEP$d$pg_supp_path"
8619 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8620 if test -z "$PGCONFIG"; then
8621 AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
8623 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8624 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8625 FilterLibs "${POSTGRESQL_LIB}"
8626 POSTGRESQL_LIB="${filteredlibs}"
8628 # if/when anything else than PostgreSQL uses Kerberos,
8629 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8634 # MacOS X has system MIT Kerberos 5 since 10.4
8635 if test "$with_krb5" != "no"; then
8638 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
8639 # that the libraries where these functions are located on macOS will change, is it?
8640 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8641 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8644 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8645 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8646 KRB5_LIBS="$KRB5_LIBS $LIBS"
8649 if test "$with_gssapi" != "no"; then
8652 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8653 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8659 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8660 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8663 Linux|GNU|*BSD|DragonFly)
8664 if test "$with_krb5" != "no"; then
8667 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8668 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8671 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8672 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8673 KRB5_LIBS="$KRB5_LIBS $LIBS"
8676 if test "$with_gssapi" != "no"; then
8679 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8680 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8686 if test "$with_krb5" = "yes"; then
8689 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8690 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8693 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8694 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8695 KRB5_LIBS="$KRB5_LIBS $LIBS"
8698 if test "$with_gssapi" = "yes"; then
8701 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8702 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8708 if test -n "$with_libpq_path"; then
8709 SYSTEM_POSTGRESQL=TRUE
8710 postgres_interface="external libpq"
8711 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8712 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8715 postgres_interface="internal"
8717 POSTGRESQL_INC="%OVERRIDE_ME%"
8718 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8722 AC_MSG_CHECKING([PostgreSQL C interface])
8723 AC_MSG_RESULT([$postgres_interface])
8725 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
8726 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8728 save_CPPFLAGS=$CPPFLAGS
8730 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8731 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8732 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8733 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8734 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8736 CPPFLAGS=$save_CPPFLAGS
8739 BUILD_POSTGRESQL_SDBC=TRUE
8744 AC_SUBST(WITH_GSSAPI)
8745 AC_SUBST(GSSAPI_LIBS)
8747 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8748 AC_SUBST(SYSTEM_POSTGRESQL)
8749 AC_SUBST(POSTGRESQL_INC)
8750 AC_SUBST(POSTGRESQL_LIB)
8752 dnl ===================================================================
8753 dnl Check for Firebird stuff
8754 dnl ===================================================================
8755 ENABLE_FIREBIRD_SDBC=""
8756 if test "$enable_firebird_sdbc" = "yes" ; then
8757 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8759 dnl ===================================================================
8760 dnl Check for system Firebird
8761 dnl ===================================================================
8762 AC_MSG_CHECKING([which Firebird to use])
8763 if test "$with_system_firebird" = "yes"; then
8764 AC_MSG_RESULT([external])
8765 SYSTEM_FIREBIRD=TRUE
8766 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8767 if test -z "$FIREBIRDCONFIG"; then
8768 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8769 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
8770 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
8772 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
8774 AC_MSG_NOTICE([fb_config found])
8775 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8776 AC_MSG_CHECKING([for Firebird Client library])
8777 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8778 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8779 FilterLibs "${FIREBIRD_LIBS}"
8780 FIREBIRD_LIBS="${filteredlibs}"
8782 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8783 AC_MSG_CHECKING([Firebird version])
8784 if test -n "${FIREBIRD_VERSION}"; then
8785 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8786 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8787 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
8790 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
8793 __save_CFLAGS="${CFLAGS}"
8794 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
8795 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
8796 #if defined(FB_API_VER) && FB_API_VER == 30
8797 int fb_api_is_30(void) { return 0; }
8799 #error "Wrong Firebird API version"
8800 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
8801 CFLAGS="${__save_CFLAGS}"
8803 ENABLE_FIREBIRD_SDBC="TRUE"
8804 elif test "$enable_database_connectivity" != yes; then
8805 AC_MSG_RESULT([none])
8806 elif test "$cross_compiling" = "yes"; then
8807 AC_MSG_RESULT([none])
8809 dnl Embedded Firebird has version 3.0
8810 AC_DEFINE(HAVE_FIREBIRD_30, 1)
8811 dnl We need libatomic-ops for any non X86/X64 system
8812 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
8813 dnl ===================================================================
8814 dnl Check for system libatomic-ops
8815 dnl ===================================================================
8816 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
8817 if test "$with_system_libatomic_ops" = "yes"; then
8818 SYSTEM_LIBATOMIC_OPS=TRUE
8819 AC_CHECK_HEADERS(atomic_ops.h, [],
8820 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
8822 SYSTEM_LIBATOMIC_OPS=
8823 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
8824 LIBATOMIC_OPS_LIBS="-latomic_ops"
8825 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
8829 AC_MSG_RESULT([internal])
8831 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
8832 FIREBIRD_LIBS="-lfbclient"
8834 if test "$with_system_libtommath" = "yes"; then
8835 SYSTEM_LIBTOMMATH=TRUE
8836 dnl check for tommath presence
8838 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
8839 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
8843 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
8844 LIBTOMMATH_LIBS="-ltommath"
8845 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
8848 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
8849 ENABLE_FIREBIRD_SDBC="TRUE"
8850 AC_DEFINE(ENABLE_FIREBIRD_SDBC)
8853 AC_SUBST(ENABLE_FIREBIRD_SDBC)
8854 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
8855 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
8856 AC_SUBST(LIBATOMIC_OPS_LIBS)
8857 AC_SUBST(SYSTEM_FIREBIRD)
8858 AC_SUBST(FIREBIRD_CFLAGS)
8859 AC_SUBST(FIREBIRD_LIBS)
8860 AC_SUBST([TOMMATH_CFLAGS])
8861 AC_SUBST([TOMMATH_LIBS])
8863 dnl ===================================================================
8864 dnl Check for system curl
8865 dnl ===================================================================
8866 AC_MSG_CHECKING([which libcurl to use])
8867 if test "$with_system_curl" = "auto"; then
8868 with_system_curl="$with_system_libs"
8871 if test "$with_system_curl" = "yes"; then
8872 AC_MSG_RESULT([external])
8875 # First try PKGCONFIG and then fall back
8876 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
8878 if test -n "$CURL_PKG_ERRORS"; then
8879 AC_PATH_PROG(CURLCONFIG, curl-config)
8880 if test -z "$CURLCONFIG"; then
8881 AC_MSG_ERROR([curl development files not found])
8883 CURL_LIBS=`$CURLCONFIG --libs`
8884 FilterLibs "${CURL_LIBS}"
8885 CURL_LIBS="${filteredlibs}"
8886 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
8887 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
8889 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
8890 case $curl_version in
8891 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
8892 dnl so they need to be doubled to end up in the configure script
8893 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
8894 AC_MSG_RESULT([yes])
8897 AC_MSG_ERROR([no, you have $curl_version])
8903 elif test $_os = iOS; then
8904 # Let's see if we need curl, I think not?
8905 AC_MSG_RESULT([none])
8908 AC_MSG_RESULT([internal])
8910 BUILD_TYPE="$BUILD_TYPE CURL"
8913 AC_SUBST(SYSTEM_CURL)
8914 AC_SUBST(CURL_CFLAGS)
8916 AC_SUBST(ENABLE_CURL)
8918 dnl ===================================================================
8919 dnl Check for system boost
8920 dnl ===================================================================
8921 AC_MSG_CHECKING([which boost to use])
8922 if test "$with_system_boost" = "yes"; then
8923 AC_MSG_RESULT([external])
8931 save_CXXFLAGS=$CXXFLAGS
8932 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
8933 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
8934 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
8935 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
8936 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
8937 CXXFLAGS=$save_CXXFLAGS
8939 # this is in m4/ax_boost_base.m4
8940 FilterLibs "${BOOST_LDFLAGS}"
8941 BOOST_LDFLAGS="${filteredlibs}"
8943 AC_MSG_RESULT([internal])
8944 BUILD_TYPE="$BUILD_TYPE BOOST"
8946 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
8947 # use warning-suppressing wrapper headers
8948 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
8950 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
8953 AC_SUBST(SYSTEM_BOOST)
8955 dnl ===================================================================
8956 dnl Check for system mdds
8957 dnl ===================================================================
8958 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.4 >= 1.4.1], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
8960 dnl ===================================================================
8961 dnl Check for system glm
8962 dnl ===================================================================
8963 AC_MSG_CHECKING([which glm to use])
8964 if test "$with_system_glm" = "yes"; then
8965 AC_MSG_RESULT([external])
8968 AC_CHECK_HEADER([glm/glm.hpp], [],
8969 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
8972 AC_MSG_RESULT([internal])
8973 BUILD_TYPE="$BUILD_TYPE GLM"
8975 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
8977 AC_SUBST([GLM_CFLAGS])
8978 AC_SUBST([SYSTEM_GLM])
8980 dnl ===================================================================
8981 dnl Check for system odbc
8982 dnl ===================================================================
8983 AC_MSG_CHECKING([which odbc headers to use])
8984 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
8985 AC_MSG_RESULT([external])
8986 SYSTEM_ODBC_HEADERS=TRUE
8988 if test "$build_os" = "cygwin"; then
8989 save_CPPFLAGS=$CPPFLAGS
8991 PathFormat "$winsdktest"
8992 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"
8993 AC_CHECK_HEADER(sqlext.h, [],
8994 [AC_MSG_ERROR(odbc not found. install odbc)],
8995 [#include <windows.h>])
8996 CPPFLAGS=$save_CPPFLAGS
8998 AC_CHECK_HEADER(sqlext.h, [],
8999 [AC_MSG_ERROR(odbc not found. install odbc)],[])
9001 elif test "$enable_database_connectivity" != yes; then
9002 AC_MSG_RESULT([none])
9004 AC_MSG_RESULT([internal])
9005 SYSTEM_ODBC_HEADERS=
9007 AC_SUBST(SYSTEM_ODBC_HEADERS)
9010 dnl ===================================================================
9011 dnl Check for system openldap
9012 dnl ===================================================================
9014 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
9015 AC_MSG_CHECKING([which openldap library to use])
9016 if test "$with_system_openldap" = "yes"; then
9017 AC_MSG_RESULT([external])
9018 SYSTEM_OPENLDAP=TRUE
9019 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
9020 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9021 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9023 AC_MSG_RESULT([internal])
9025 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
9028 AC_SUBST(SYSTEM_OPENLDAP)
9030 dnl ===================================================================
9031 dnl Check for system NSS
9032 dnl ===================================================================
9033 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
9034 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
9035 AC_DEFINE(HAVE_FEATURE_NSS)
9037 AC_DEFINE(ENABLE_NSS)
9038 elif test $_os != iOS ; then
9041 AC_SUBST(ENABLE_NSS)
9043 dnl ===================================================================
9044 dnl Check for TLS/SSL and cryptographic implementation to use
9045 dnl ===================================================================
9046 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
9047 if test -n "$with_tls"; then
9050 AC_DEFINE(USE_TLS_OPENSSL)
9053 if test "$enable_openssl" != "yes"; then
9054 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9057 # warn that OpenSSL has been selected but not all TLS code has this option
9058 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
9059 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
9062 AC_DEFINE(USE_TLS_NSS)
9066 AC_MSG_WARN([Skipping TLS/SSL])
9069 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9071 nss - Mozilla's Network Security Services (NSS)
9076 # default to using NSS, it results in smaller oox lib
9077 AC_DEFINE(USE_TLS_NSS)
9080 AC_MSG_RESULT([$TLS])
9083 dnl ===================================================================
9084 dnl Check for system sane
9085 dnl ===================================================================
9086 AC_MSG_CHECKING([which sane header to use])
9087 if test "$with_system_sane" = "yes"; then
9088 AC_MSG_RESULT([external])
9089 AC_CHECK_HEADER(sane/sane.h, [],
9090 [AC_MSG_ERROR(sane not found. install sane)], [])
9092 AC_MSG_RESULT([internal])
9093 BUILD_TYPE="$BUILD_TYPE SANE"
9096 dnl ===================================================================
9097 dnl Check for system icu
9098 dnl ===================================================================
9105 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9106 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9107 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9108 AC_MSG_CHECKING([which icu to use])
9109 if test "$with_system_icu" = "yes"; then
9110 AC_MSG_RESULT([external])
9113 AC_MSG_CHECKING([for unicode/rbbi.h])
9114 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
9117 if test "$cross_compiling" != "yes"; then
9118 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9119 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9120 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9121 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9124 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9125 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9126 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9127 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9128 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9129 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9130 AC_MSG_RESULT([yes])
9133 if test "$with_system_icu_for_build" != "force"; then
9134 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9135 You can use --with-system-icu-for-build=force to use it anyway.])
9140 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9141 # using the system icu tools can lead to version confusion, use the
9142 # ones from the build environment when cross-compiling
9143 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9144 if test -z "$SYSTEM_GENBRK"; then
9145 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9147 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9148 if test -z "$SYSTEM_GENCCODE"; then
9149 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9151 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9152 if test -z "$SYSTEM_GENCMN"; then
9153 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9155 if test "$ICU_MAJOR" -ge "49"; then
9156 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9157 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9158 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9160 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9161 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9162 ICU_RECLASSIFIED_HEBREW_LETTER=
9166 if test "$cross_compiling" = "yes"; then
9167 if test "$ICU_MAJOR" -ge "50"; then
9168 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9173 AC_MSG_RESULT([internal])
9175 BUILD_TYPE="$BUILD_TYPE ICU"
9176 # surprisingly set these only for "internal" (to be used by various other
9177 # external libs): the system icu-config is quite unhelpful and spits out
9178 # dozens of weird flags and also default path -I/usr/include
9179 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9180 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9182 if test "$ICU_MAJOR" -ge "59"; then
9183 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9184 # with -std=c++11 but not all external libraries can be built with that,
9185 # for those use a bit-compatible typedef uint16_t UChar; see
9186 # icu/source/common/unicode/umachine.h
9187 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9191 AC_SUBST(SYSTEM_ICU)
9192 AC_SUBST(SYSTEM_GENBRK)
9193 AC_SUBST(SYSTEM_GENCCODE)
9194 AC_SUBST(SYSTEM_GENCMN)
9197 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9198 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9199 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9200 AC_SUBST(ICU_CFLAGS)
9202 AC_SUBST(ICU_UCHAR_TYPE)
9204 dnl ==================================================================
9206 dnl ==================================================================
9207 AC_MSG_CHECKING([whether to enable breakpad])
9208 if test "$enable_breakpad" != yes; then
9211 AC_MSG_RESULT([yes])
9212 ENABLE_BREAKPAD="TRUE"
9213 AC_DEFINE(ENABLE_BREAKPAD)
9214 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9215 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9217 AC_MSG_CHECKING([for crashreport config])
9218 if test "$with_symbol_config" = "no"; then
9219 BREAKPAD_SYMBOL_CONFIG="invalid"
9222 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9223 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9224 AC_MSG_RESULT([yes])
9226 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9228 AC_SUBST(ENABLE_BREAKPAD)
9230 dnl ==================================================================
9232 dnl ==================================================================
9233 AC_MSG_CHECKING([whether to enable fuzzers])
9234 if test "$enable_fuzzers" != yes; then
9237 AC_MSG_RESULT([yes])
9238 ENABLE_FUZZERS="TRUE"
9239 AC_DEFINE(ENABLE_FUZZERS)
9240 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9242 AC_SUBST(ENABLE_FUZZERS)
9244 dnl ===================================================================
9246 dnl ===================================================================
9247 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.14 >= 0.14.0])
9248 if test "$with_system_orcus" != "yes"; then
9249 if test "$SYSTEM_BOOST" = "TRUE"; then
9250 # ===========================================================
9251 # Determine if we are going to need to link with Boost.System
9252 # ===========================================================
9253 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9254 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9255 dnl in documentation has no effect.
9256 AC_MSG_CHECKING([if we need to link with Boost.System])
9258 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9259 @%:@include <boost/version.hpp>
9261 #if BOOST_VERSION >= 105000
9262 # error yes, we need to link with Boost.System
9267 AC_MSG_RESULT([yes])
9273 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9274 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9275 AC_SUBST([BOOST_SYSTEM_LIB])
9276 AC_SUBST(SYSTEM_LIBORCUS)
9278 dnl ===================================================================
9280 dnl ===================================================================
9281 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9282 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9283 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9285 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9286 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9287 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9289 if test "$COM" = "MSC"; then # override the above
9290 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9291 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9294 if test "$with_system_harfbuzz" = "yes"; then
9295 if test "$with_system_graphite" = "no"; then
9296 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9298 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9300 _save_cflags="$CFLAGS"
9301 LIBS="$LIBS $HARFBUZZ_LIBS"
9302 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9303 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9305 CFLAGS="$_save_cflags"
9307 if test "$with_system_graphite" = "yes"; then
9308 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9312 AC_MSG_CHECKING([whether to use X11])
9313 dnl ***************************************
9314 dnl testing for X libraries and includes...
9315 dnl ***************************************
9316 if test "$USING_X11" = TRUE; then
9317 AC_DEFINE(HAVE_FEATURE_X11)
9319 AC_MSG_RESULT([$USING_X11])
9321 if test "$USING_X11" = TRUE; then
9324 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9326 if test -z "$x_includes"; then
9327 x_includes="default_x_includes"
9329 if test -z "$x_libraries"; then
9330 x_libraries="default_x_libraries"
9332 CFLAGS="$CFLAGS $X_CFLAGS"
9333 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9334 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9336 x_includes="no_x_includes"
9337 x_libraries="no_x_libraries"
9340 if test "$USING_X11" = TRUE; then
9341 dnl ===================================================================
9342 dnl Check for extension headers
9343 dnl ===================================================================
9344 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9345 [#include <X11/extensions/shape.h>])
9347 # vcl needs ICE and SM
9348 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9349 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9350 [AC_MSG_ERROR(ICE library not found)])
9351 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9352 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9353 [AC_MSG_ERROR(SM library not found)])
9356 dnl ===================================================================
9357 dnl Check for system Xrender
9358 dnl ===================================================================
9359 AC_MSG_CHECKING([whether to use Xrender])
9360 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9361 AC_MSG_RESULT([yes])
9362 PKG_CHECK_MODULES(XRENDER, xrender)
9363 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9364 FilterLibs "${XRENDER_LIBS}"
9365 XRENDER_LIBS="${filteredlibs}"
9366 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9367 [AC_MSG_ERROR(libXrender not found or functional)], [])
9368 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9369 [AC_MSG_ERROR(Xrender not found. install X)], [])
9373 AC_SUBST(XRENDER_CFLAGS)
9374 AC_SUBST(XRENDER_LIBS)
9376 dnl ===================================================================
9377 dnl Check for XRandr
9378 dnl ===================================================================
9379 AC_MSG_CHECKING([whether to enable RandR support])
9380 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9381 AC_MSG_RESULT([yes])
9382 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9383 if test "$ENABLE_RANDR" != "TRUE"; then
9384 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9385 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9387 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9388 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9389 XRANDR_LIBS="-lXrandr "
9392 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9393 FilterLibs "${XRANDR_LIBS}"
9394 XRANDR_LIBS="${filteredlibs}"
9399 AC_SUBST(XRANDR_CFLAGS)
9400 AC_SUBST(XRANDR_LIBS)
9401 AC_SUBST(ENABLE_RANDR)
9403 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9406 if test $_os = iOS -o $_os = Android; then
9409 AC_MSG_CHECKING([for webdav library])
9410 case "$WITH_WEBDAV" in
9412 AC_MSG_RESULT([serf])
9413 # Check for system apr-util
9414 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9415 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9416 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9417 if test "$COM" = "MSC"; then
9419 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9420 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9423 # Check for system serf
9424 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9425 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9426 if test "$COM" = "MSC"; then
9427 SERF_LIB_DIR="Release"
9428 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9429 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9433 AC_MSG_RESULT([neon])
9434 # Check for system neon
9435 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9436 if test "$with_system_neon" = "yes"; then
9437 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9441 AC_SUBST(NEON_VERSION)
9444 AC_MSG_RESULT([none, disabled])
9448 AC_SUBST(WITH_WEBDAV)
9450 dnl ===================================================================
9451 dnl Check for disabling cve_tests
9452 dnl ===================================================================
9453 AC_MSG_CHECKING([whether to execute CVE tests])
9454 # If not explicitly enabled or disabled, default
9455 if test -z "$enable_cve_tests"; then
9458 # Default cves off for windows with its wild and wonderful
9459 # varienty of AV software kicking in and panicking
9464 enable_cve_tests=yes
9468 if test "$enable_cve_tests" = "no"; then
9470 DISABLE_CVE_TESTS=TRUE
9471 AC_SUBST(DISABLE_CVE_TESTS)
9473 AC_MSG_RESULT([yes])
9476 dnl ===================================================================
9477 dnl Check for enabling chart XShape tests
9478 dnl ===================================================================
9479 AC_MSG_CHECKING([whether to execute chart XShape tests])
9480 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
9481 AC_MSG_RESULT([yes])
9482 ENABLE_CHART_TESTS=TRUE
9483 AC_SUBST(ENABLE_CHART_TESTS)
9488 dnl ===================================================================
9489 dnl Check for system openssl
9490 dnl ===================================================================
9492 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9493 if test "$enable_openssl" = "yes"; then
9495 if test "$_os" = Darwin ; then
9496 # OpenSSL is deprecated when building for 10.7 or later.
9498 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9499 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9501 with_system_openssl=no
9502 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9503 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9504 && test "$with_system_openssl" != "no"; then
9505 with_system_openssl=yes
9508 OPENSSL_LIBS="-lssl -lcrypto"
9510 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9512 if test "$with_system_openssl" = "yes"; then
9513 AC_MSG_CHECKING([whether openssl supports SHA512])
9515 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9517 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9521 AC_MSG_RESULT([yes])
9522 DISABLE_OPENSSL=TRUE
9524 # warn that although OpenSSL is disabled, system libraries may depend on it
9525 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9526 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9529 AC_SUBST([DISABLE_OPENSSL])
9531 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
9532 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
9533 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
9534 enable_cipher_openssl_backend=no
9536 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
9539 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
9540 ENABLE_CIPHER_OPENSSL_BACKEND=
9541 if test "$enable_cipher_openssl_backend" = yes; then
9542 AC_MSG_RESULT([yes])
9543 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
9547 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
9549 dnl ===================================================================
9550 dnl Check for building gnutls
9551 dnl ===================================================================
9552 AC_MSG_CHECKING([whether to use gnutls])
9553 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
9554 AC_MSG_RESULT([yes])
9556 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9557 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9558 available in the system to use as replacement.]]))
9559 FilterLibs "${LIBGCRYPT_LIBS}"
9560 LIBGCRYPT_LIBS="${filteredlibs}"
9565 AC_SUBST([LIBGCRYPT_CFLAGS])
9566 AC_SUBST([LIBGCRYPT_LIBS])
9568 dnl ===================================================================
9569 dnl Check for system redland
9570 dnl ===================================================================
9571 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9572 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9573 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9574 if test "$with_system_redland" = "yes"; then
9575 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9576 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9582 AC_SUBST(RAPTOR_MAJOR)
9583 AC_SUBST(RASQAL_MAJOR)
9584 AC_SUBST(REDLAND_MAJOR)
9586 dnl ===================================================================
9587 dnl Check for system hunspell
9588 dnl ===================================================================
9589 AC_MSG_CHECKING([which libhunspell to use])
9590 if test "$with_system_hunspell" = "yes"; then
9591 AC_MSG_RESULT([external])
9592 SYSTEM_HUNSPELL=TRUE
9594 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9595 if test "$HUNSPELL_PC" != "TRUE"; then
9596 AC_CHECK_HEADER(hunspell.hxx, [],
9598 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9599 [AC_MSG_ERROR(hunspell headers not found.)], [])
9601 AC_CHECK_LIB([hunspell], [main], [:],
9602 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9603 HUNSPELL_LIBS=-lhunspell
9606 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9607 FilterLibs "${HUNSPELL_LIBS}"
9608 HUNSPELL_LIBS="${filteredlibs}"
9610 AC_MSG_RESULT([internal])
9612 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9613 if test "$COM" = "MSC"; then
9614 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9616 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.6"
9618 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9620 AC_SUBST(SYSTEM_HUNSPELL)
9621 AC_SUBST(HUNSPELL_CFLAGS)
9622 AC_SUBST(HUNSPELL_LIBS)
9624 dnl ===================================================================
9625 dnl Checking for altlinuxhyph
9626 dnl ===================================================================
9627 AC_MSG_CHECKING([which altlinuxhyph to use])
9628 if test "$with_system_altlinuxhyph" = "yes"; then
9629 AC_MSG_RESULT([external])
9631 AC_CHECK_HEADER(hyphen.h, [],
9632 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9633 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9634 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9635 [#include <hyphen.h>])
9636 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9637 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9638 if test -z "$HYPHEN_LIB"; then
9639 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9640 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9642 if test -z "$HYPHEN_LIB"; then
9643 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9644 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9647 AC_MSG_RESULT([internal])
9649 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9650 if test "$COM" = "MSC"; then
9651 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9653 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9656 AC_SUBST(SYSTEM_HYPH)
9657 AC_SUBST(HYPHEN_LIB)
9659 dnl ===================================================================
9660 dnl Checking for mythes
9661 dnl ===================================================================
9662 AC_MSG_CHECKING([which mythes to use])
9663 if test "$with_system_mythes" = "yes"; then
9664 AC_MSG_RESULT([external])
9667 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9668 if test "$MYTHES_PKGCONFIG" = "no"; then
9669 AC_CHECK_HEADER(mythes.hxx, [],
9670 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9671 AC_CHECK_LIB([mythes-1.2], [main], [:],
9672 [ MYTHES_FOUND=no], [])
9673 if test "$MYTHES_FOUND" = "no"; then
9674 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9675 [ MYTHES_FOUND=no], [])
9677 if test "$MYTHES_FOUND" = "no"; then
9678 AC_MSG_ERROR([mythes library not found!.])
9682 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9683 FilterLibs "${MYTHES_LIBS}"
9684 MYTHES_LIBS="${filteredlibs}"
9686 AC_MSG_RESULT([internal])
9688 BUILD_TYPE="$BUILD_TYPE MYTHES"
9689 if test "$COM" = "MSC"; then
9690 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9692 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9695 AC_SUBST(SYSTEM_MYTHES)
9696 AC_SUBST(MYTHES_CFLAGS)
9697 AC_SUBST(MYTHES_LIBS)
9699 dnl ===================================================================
9700 dnl How should we build the linear programming solver ?
9701 dnl ===================================================================
9704 AC_MSG_CHECKING([whether to build with CoinMP])
9705 if test "$enable_coinmp" != "no"; then
9707 AC_MSG_RESULT([yes])
9708 if test "$with_system_coinmp" = "yes"; then
9710 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
9711 FilterLibs "${COINMP_LIBS}"
9712 COINMP_LIBS="${filteredlibs}"
9714 BUILD_TYPE="$BUILD_TYPE COINMP"
9719 AC_SUBST(ENABLE_COINMP)
9720 AC_SUBST(SYSTEM_COINMP)
9721 AC_SUBST(COINMP_CFLAGS)
9722 AC_SUBST(COINMP_LIBS)
9725 AC_MSG_CHECKING([whether to build with lpsolve])
9726 if test "$enable_lpsolve" != "no"; then
9728 AC_MSG_RESULT([yes])
9732 AC_SUBST(ENABLE_LPSOLVE)
9734 if test "$ENABLE_LPSOLVE" = TRUE; then
9735 AC_MSG_CHECKING([which lpsolve to use])
9736 if test "$with_system_lpsolve" = "yes"; then
9737 AC_MSG_RESULT([external])
9739 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9740 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9742 # some systems need this. Like Ubuntu....
9743 AC_CHECK_LIB(m, floor)
9744 AC_CHECK_LIB(dl, dlopen)
9745 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9746 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9749 AC_MSG_RESULT([internal])
9751 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9754 AC_SUBST(SYSTEM_LPSOLVE)
9756 dnl ===================================================================
9757 dnl Checking for libexttextcat
9758 dnl ===================================================================
9759 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
9760 if test "$with_system_libexttextcat" = "yes"; then
9761 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9763 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9765 dnl ===================================================================
9766 dnl Checking for libnumbertext
9767 dnl ===================================================================
9768 AC_MSG_CHECKING([whether to use libnumbertext])
9769 if test "$enable_libnumbertext" = "no"; then
9771 ENABLE_LIBNUMBERTEXT=
9772 SYSTEM_LIBNUMBERTEXT=
9774 AC_MSG_RESULT([yes])
9775 ENABLE_LIBNUMBERTEXT=TRUE
9776 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
9777 if test "$with_system_libnumbertext" = "yes"; then
9778 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
9779 SYSTEM_LIBNUMBERTEXT=YES
9781 SYSTEM_LIBNUMBERTEXT=
9783 save_CPPFLAGS=$CPPFLAGS
9784 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
9785 AC_CHECK_HEADERS([codecvt regex])
9786 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
9787 [ ENABLE_LIBNUMBERTEXT=''
9788 LIBNUMBERTEXT_CFLAGS=''
9789 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
9790 Enable libnumbertext fallback (missing number to number name conversion).])
9792 CPPFLAGS=$save_CPPFLAGS
9795 if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
9796 AC_DEFINE(ENABLE_LIBNUMBERTEXT)
9799 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
9800 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
9801 AC_SUBST(ENABLE_LIBNUMBERTEXT)
9802 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
9804 dnl ***************************************
9805 dnl testing libc version for Linux...
9806 dnl ***************************************
9807 if test "$_os" = "Linux"; then
9808 AC_MSG_CHECKING([whether libc is >= 2.1.1])
9809 exec 6>/dev/null # no output
9810 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
9811 exec 6>&1 # output on again
9812 if test "$HAVE_LIBC"; then
9813 AC_MSG_RESULT([yes])
9815 AC_MSG_ERROR([no, upgrade libc])
9819 dnl =========================================
9820 dnl Check for uuidgen
9821 dnl =========================================
9822 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9823 # presence is already tested above in the WINDOWS_SDK_HOME check
9827 AC_PATH_PROG([UUIDGEN], [uuidgen])
9828 if test -z "$UUIDGEN"; then
9829 AC_MSG_WARN([uuid is needed for building installation sets])
9833 dnl ***************************************
9834 dnl Checking for bison and flex
9835 dnl ***************************************
9836 AC_PATH_PROG(BISON, bison)
9837 if test -z "$BISON"; then
9838 AC_MSG_ERROR([no bison found in \$PATH, install it])
9840 AC_MSG_CHECKING([the bison version])
9841 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9842 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9843 # Accept newer than 2.0
9844 if test "$_bison_longver" -lt 2000; then
9845 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
9849 AC_PATH_PROG(FLEX, flex)
9850 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9851 FLEX=`cygpath -m $FLEX`
9853 if test -z "$FLEX"; then
9854 AC_MSG_ERROR([no flex found in \$PATH, install it])
9856 AC_MSG_CHECKING([the flex version])
9857 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
9858 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
9859 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
9863 dnl ***************************************
9864 dnl Checking for patch
9865 dnl ***************************************
9866 AC_PATH_PROG(PATCH, patch)
9867 if test -z "$PATCH"; then
9868 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
9871 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9872 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9873 if test -z "$with_gnu_patch"; then
9876 if test -x "$with_gnu_patch"; then
9877 GNUPATCH=$with_gnu_patch
9879 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9883 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9884 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9885 AC_MSG_RESULT([yes])
9887 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9893 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9894 GNUPATCH=`cygpath -m $GNUPATCH`
9897 dnl We also need to check for --with-gnu-cp
9899 if test -z "$with_gnu_cp"; then
9900 # check the place where the good stuff is hidden on Solaris...
9901 if test -x /usr/gnu/bin/cp; then
9902 GNUCP=/usr/gnu/bin/cp
9904 AC_PATH_PROGS(GNUCP, gnucp cp)
9906 if test -z $GNUCP; then
9907 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9910 if test -x "$with_gnu_cp"; then
9913 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9917 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9918 GNUCP=`cygpath -m $GNUCP`
9921 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9922 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9923 AC_MSG_RESULT([yes])
9924 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9925 AC_MSG_RESULT([yes])
9928 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9931 AC_MSG_RESULT([no gnucp found - using the system's cp command])
9934 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9943 dnl ***************************************
9944 dnl testing assembler path
9945 dnl ***************************************
9947 if test "$_os" = "WINNT"; then
9948 if test "$BITNESS_OVERRIDE" = ""; then
9950 assembler_bin=$CL_DIR
9953 assembler_bin=$CL_DIR
9956 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
9957 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
9958 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
9959 AC_MSG_RESULT([found])
9960 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
9962 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9965 PathFormat "$ASM_HOME"
9966 ASM_HOME="$formatted_path"
9973 dnl ===================================================================
9974 dnl We need zip and unzip
9975 dnl ===================================================================
9976 AC_PATH_PROG(ZIP, zip)
9977 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9978 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9979 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],,)
9982 AC_PATH_PROG(UNZIP, unzip)
9983 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9985 dnl ===================================================================
9986 dnl Zip must be a specific type for different build types.
9987 dnl ===================================================================
9988 if test $build_os = cygwin; then
9989 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
9990 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
9994 dnl ===================================================================
9995 dnl We need touch with -h option support.
9996 dnl ===================================================================
9997 AC_PATH_PROG(TOUCH, touch)
9998 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10000 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10001 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],,)
10004 dnl ===================================================================
10005 dnl Check for system epoxy
10006 dnl ===================================================================
10007 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
10009 dnl ===================================================================
10010 dnl Set vcl option: coordinate device in double or sal_Int32
10011 dnl ===================================================================
10013 dnl disabled for now, we don't want subtle differences between OSs
10014 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10015 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
10016 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10017 dnl AC_MSG_RESULT([double])
10019 dnl AC_MSG_RESULT([sal_Int32])
10022 dnl ===================================================================
10023 dnl Test which vclplugs have to be built.
10024 dnl ===================================================================
10026 if test "$USING_X11" != TRUE; then
10033 if test "x$enable_gtk3" = "xyes"; then
10034 if test "$with_system_cairo" = no; then
10035 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10037 : ${with_system_cairo:=yes}
10038 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="")
10039 if test "x$ENABLE_GTK3" = "xTRUE"; then
10041 dnl Avoid installed by unpackaged files for now.
10042 if test -z "$PKGFORMAT"; then
10043 GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
10046 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10048 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10049 FilterLibs "${GTK3_LIBS}"
10050 GTK3_LIBS="${filteredlibs}"
10052 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10053 if test "$with_system_epoxy" != "yes"; then
10054 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10055 AC_CHECK_HEADER(EGL/eglplatform.h, [],
10056 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10059 AC_SUBST(GTK3_LIBS)
10060 AC_SUBST(GTK3_CFLAGS)
10061 AC_SUBST(ENABLE_GTK3)
10064 if test "x$enable_gtk" = "xyes"; then
10065 if test "$with_system_cairo" = no; then
10066 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10068 : ${with_system_cairo:=yes}
10070 AC_DEFINE(ENABLE_GTK)
10073 AC_SUBST(ENABLE_GTK)
10076 if test "x$enable_kde4" = "xyes"; then
10078 AC_DEFINE(ENABLE_KDE4)
10081 AC_SUBST(ENABLE_KDE4)
10084 if test "x$enable_qt5" = "xyes"; then
10086 AC_DEFINE(ENABLE_QT5)
10089 AC_SUBST(ENABLE_QT5)
10092 if test "x$enable_kde5" = "xyes"; then
10094 AC_DEFINE(ENABLE_KDE5)
10097 AC_SUBST(ENABLE_KDE5)
10099 ENABLE_GTK3_KDE5=""
10100 if test "x$enable_gtk3_kde5" = "xyes"; then
10101 ENABLE_GTK3_KDE5="TRUE"
10102 AC_DEFINE(ENABLE_GTK3_KDE5)
10105 AC_SUBST(ENABLE_GTK3_KDE5)
10107 build_vcl_plugins="$R"
10108 if test -z "$build_vcl_plugins"; then
10109 build_vcl_plugins="none"
10111 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10113 dnl ===================================================================
10114 dnl check for dbus support
10115 dnl ===================================================================
10119 DBUS_GLIB_CFLAGS=""
10123 if test "$enable_dbus" = "no"; then
10127 AC_MSG_CHECKING([whether to enable DBUS support])
10128 if test "$test_dbus" = "yes"; then
10130 AC_MSG_RESULT([yes])
10131 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10132 AC_DEFINE(ENABLE_DBUS)
10133 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10134 FilterLibs "${DBUS_LIBS}"
10135 DBUS_LIBS="${filteredlibs}"
10137 # Glib is needed for BluetoothServer
10138 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10139 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10141 DBUS_HAVE_GLIB="TRUE"
10142 AC_DEFINE(DBUS_HAVE_GLIB,1)
10144 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10147 AC_MSG_RESULT([no])
10150 AC_SUBST(ENABLE_DBUS)
10151 AC_SUBST(DBUS_CFLAGS)
10152 AC_SUBST(DBUS_LIBS)
10153 AC_SUBST(DBUS_GLIB_CFLAGS)
10154 AC_SUBST(DBUS_GLIB_LIBS)
10155 AC_SUBST(DBUS_HAVE_GLIB)
10157 AC_MSG_CHECKING([whether to enable Impress remote control])
10158 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10159 AC_MSG_RESULT([yes])
10160 ENABLE_SDREMOTE=TRUE
10161 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10163 # If not explicitly enabled or disabled, default
10164 if test -z "$enable_sdremote_bluetooth"; then
10167 # Default to yes for these
10168 enable_sdremote_bluetooth=yes
10172 enable_sdremote_bluetooth=no
10176 # $enable_sdremote_bluetooth is guaranteed non-empty now
10178 if test "$enable_sdremote_bluetooth" != "no"; then
10179 if test "$OS" = "LINUX"; then
10180 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10181 AC_MSG_RESULT([yes])
10182 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10183 dnl ===================================================================
10184 dnl Check for system bluez
10185 dnl ===================================================================
10186 AC_MSG_CHECKING([which Bluetooth header to use])
10187 if test "$with_system_bluez" = "yes"; then
10188 AC_MSG_RESULT([external])
10189 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10190 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10193 AC_MSG_RESULT([internal])
10197 AC_MSG_RESULT([no, dbus disabled])
10198 ENABLE_SDREMOTE_BLUETOOTH=
10202 AC_MSG_RESULT([yes])
10203 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10207 AC_MSG_RESULT([no])
10208 ENABLE_SDREMOTE_BLUETOOTH=
10214 AC_MSG_RESULT([no])
10216 AC_SUBST(ENABLE_SDREMOTE)
10217 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10218 AC_SUBST(SYSTEM_BLUEZ)
10220 dnl ===================================================================
10221 dnl Check whether the gtk 2.0 libraries are available.
10222 dnl ===================================================================
10226 if test "$test_gtk" = "yes"; then
10228 if test "$ENABLE_GTK" = "TRUE"; then
10229 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]))
10230 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10231 FilterLibs "${GTK_LIBS}"
10232 GTK_LIBS="${filteredlibs}"
10233 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]))
10234 BUILD_TYPE="$BUILD_TYPE GTK"
10235 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10236 FilterLibs "${GTHREAD_LIBS}"
10237 GTHREAD_LIBS="${filteredlibs}"
10239 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10240 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10241 [ENABLE_GTK_PRINT="TRUE"],
10242 [ENABLE_GTK_PRINT=""])
10243 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10244 FilterLibs "${GTK_PRINT_LIBS}"
10245 GTK_PRINT_LIBS="${filteredlibs}"
10248 if test "$ENABLE_GTK" = "TRUE" || test "$ENABLE_GTK3" = "TRUE"; then
10249 AC_MSG_CHECKING([whether to enable GIO support])
10250 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10251 dnl Need at least 2.26 for the dbus support.
10252 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10253 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10254 if test "$ENABLE_GIO" = "TRUE"; then
10255 AC_DEFINE(ENABLE_GIO)
10256 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10257 FilterLibs "${GIO_LIBS}"
10258 GIO_LIBS="${filteredlibs}"
10261 AC_MSG_RESULT([no])
10265 AC_SUBST(ENABLE_GIO)
10266 AC_SUBST(GIO_CFLAGS)
10268 AC_SUBST(GTK_CFLAGS)
10270 AC_SUBST(GTHREAD_CFLAGS)
10271 AC_SUBST(GTHREAD_LIBS)
10272 AC_SUBST([ENABLE_GTK_PRINT])
10273 AC_SUBST([GTK_PRINT_CFLAGS])
10274 AC_SUBST([GTK_PRINT_LIBS])
10277 dnl ===================================================================
10279 SPLIT_APP_MODULES=""
10280 if test "$enable_split_app_modules" = "yes"; then
10281 SPLIT_APP_MODULES="TRUE"
10283 AC_SUBST(SPLIT_APP_MODULES)
10285 SPLIT_OPT_FEATURES=""
10286 if test "$enable_split_opt_features" = "yes"; then
10287 SPLIT_OPT_FEATURES="TRUE"
10289 AC_SUBST(SPLIT_OPT_FEATURES)
10291 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10292 if test "$enable_cairo_canvas" = yes; then
10293 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10295 enable_cairo_canvas=no
10296 elif test -z "$enable_cairo_canvas"; then
10297 enable_cairo_canvas=yes
10300 ENABLE_CAIRO_CANVAS=""
10301 if test "$enable_cairo_canvas" = "yes"; then
10303 ENABLE_CAIRO_CANVAS="TRUE"
10304 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10306 AC_SUBST(ENABLE_CAIRO_CANVAS)
10308 dnl ===================================================================
10309 dnl Check whether the GStreamer libraries are available.
10310 dnl It's possible to build avmedia with both GStreamer backends!
10311 dnl ===================================================================
10313 ENABLE_GSTREAMER_1_0=""
10315 if test "$build_gstreamer_1_0" = "yes"; then
10317 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10318 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10319 ENABLE_GSTREAMER_1_0="TRUE"
10320 AC_MSG_RESULT([yes])
10321 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10322 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10323 FilterLibs "${GSTREAMER_1_0_LIBS}"
10324 GSTREAMER_1_0_LIBS="${filteredlibs}"
10326 AC_MSG_RESULT([no])
10329 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10330 AC_SUBST(GSTREAMER_1_0_LIBS)
10331 AC_SUBST(ENABLE_GSTREAMER_1_0)
10334 ENABLE_GSTREAMER_0_10=""
10335 if test "$build_gstreamer_0_10" = "yes"; then
10337 AC_MSG_CHECKING([whether to enable the GStreamer 0.10 avmedia backend])
10338 if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10339 ENABLE_GSTREAMER_0_10="TRUE"
10340 AC_MSG_RESULT([yes])
10341 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10],, [
10342 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10] )
10344 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10345 FilterLibs "${GSTREAMER_0_10_LIBS}"
10346 GSTREAMER_0_10_LIBS="${filteredlibs}"
10348 AC_MSG_RESULT([no])
10352 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10353 AC_SUBST(GSTREAMER_0_10_LIBS)
10354 AC_SUBST(ENABLE_GSTREAMER_0_10)
10356 dnl ===================================================================
10357 dnl Check whether to build the VLC avmedia backend
10358 dnl ===================================================================
10362 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10363 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10365 AC_MSG_RESULT([yes])
10367 AC_MSG_RESULT([no])
10369 AC_SUBST(ENABLE_VLC)
10371 ENABLE_OPENGL_TRANSITIONS=
10372 ENABLE_OPENGL_CANVAS=
10373 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10375 elif test "$_os" = "Darwin"; then
10376 # We use frameworks on Mac OS X, no need for detail checks
10377 ENABLE_OPENGL_TRANSITIONS=TRUE
10378 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10379 ENABLE_OPENGL_CANVAS=TRUE
10380 elif test $_os = WINNT; then
10381 ENABLE_OPENGL_TRANSITIONS=TRUE
10382 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10383 ENABLE_OPENGL_CANVAS=TRUE
10385 if test "$USING_X11" = TRUE; then
10386 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10387 ENABLE_OPENGL_TRANSITIONS=TRUE
10388 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10389 ENABLE_OPENGL_CANVAS=TRUE
10393 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10394 AC_SUBST(ENABLE_OPENGL_CANVAS)
10396 dnl =================================================
10397 dnl Check whether to build with OpenCL support.
10398 dnl =================================================
10400 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10401 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10402 # platform (optional at run-time, used through clew).
10403 BUILD_TYPE="$BUILD_TYPE OPENCL"
10404 AC_DEFINE(HAVE_FEATURE_OPENCL)
10407 dnl =================================================
10408 dnl Check whether to build with dconf support.
10409 dnl =================================================
10411 if test "$enable_dconf" != no; then
10412 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10413 if test "$enable_dconf" = yes; then
10414 AC_MSG_ERROR([dconf not found])
10419 AC_MSG_CHECKING([whether to enable dconf])
10420 if test "$enable_dconf" = no; then
10424 AC_MSG_RESULT([no])
10427 AC_DEFINE(ENABLE_DCONF)
10428 AC_MSG_RESULT([yes])
10430 AC_SUBST([DCONF_CFLAGS])
10431 AC_SUBST([DCONF_LIBS])
10432 AC_SUBST([ENABLE_DCONF])
10435 AC_MSG_CHECKING([whether to build the PDF import feature])
10437 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10438 AC_MSG_RESULT([yes])
10439 ENABLE_PDFIMPORT=TRUE
10440 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10442 dnl ===================================================================
10443 dnl Check for system poppler
10444 dnl ===================================================================
10445 AC_MSG_CHECKING([which PDF import backend to use])
10446 if test "$with_system_poppler" = "yes"; then
10447 AC_MSG_RESULT([external])
10448 SYSTEM_POPPLER=TRUE
10449 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10450 AC_LANG_PUSH([C++])
10451 save_CXXFLAGS=$CXXFLAGS
10452 save_CPPFLAGS=$CPPFLAGS
10453 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10454 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10455 AC_CHECK_HEADER([cpp/poppler-version.h],
10456 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10458 CXXFLAGS=$save_CXXFLAGS
10459 CPPFLAGS=$save_CPPFLAGS
10461 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10463 FilterLibs "${POPPLER_LIBS}"
10464 POPPLER_LIBS="${filteredlibs}"
10466 AC_MSG_RESULT([internal])
10468 BUILD_TYPE="$BUILD_TYPE POPPLER"
10469 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10471 AC_DEFINE([ENABLE_PDFIMPORT],1)
10473 AC_MSG_RESULT([no])
10475 AC_SUBST(ENABLE_PDFIMPORT)
10476 AC_SUBST(SYSTEM_POPPLER)
10477 AC_SUBST(POPPLER_CFLAGS)
10478 AC_SUBST(POPPLER_LIBS)
10481 AC_MSG_CHECKING([whether to build PDFium])
10483 if test -z "$enable_pdfium" -o "$enable_pdfium" = yes; then
10484 AC_MSG_RESULT([yes])
10486 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10487 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10489 AC_MSG_RESULT([no])
10491 AC_SUBST(ENABLE_PDFIUM)
10495 if test "$build_for_ios" = "YES"; then
10496 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
10497 AC_MSG_RESULT([yes])
10498 elif test "$enable_mpl_subset" = "yes"; then
10499 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
10500 AC_MSG_RESULT([yes])
10501 elif test "$enable_fuzzers" = "yes"; then
10502 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
10503 AC_MSG_RESULT([yes])
10504 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
10505 dnl ===================================================================
10506 dnl Check for system gpgme
10507 dnl ===================================================================
10508 AC_MSG_CHECKING([which gpgmepp to use])
10509 if test "$with_system_gpgmepp" = "yes"; then
10510 AC_MSG_RESULT([external])
10511 SYSTEM_GPGMEPP=TRUE
10513 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
10514 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
10515 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
10516 # progress_callback is the only func with plain C linkage
10517 # checking for it also filters out older, KDE-dependent libgpgmepp versions
10518 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
10519 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
10520 AC_CHECK_HEADER(gpgme.h, [],
10521 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
10523 AC_MSG_RESULT([internal])
10524 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
10525 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
10527 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
10528 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
10529 if test "$_os" != "WINNT"; then
10530 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
10531 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
10532 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
10533 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
10536 ENABLE_GPGMEPP=TRUE
10537 AC_DEFINE([HAVE_FEATURE_GPGME])
10538 AC_PATH_PROG(GPG, gpg)
10539 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
10540 # so let's exclude that manually for the moment
10541 if test -n "$GPG" -a "$_os" != "WINNT"; then
10542 # make sure we not only have a working gpgme, but a full working
10543 # gpg installation to run OpenPGP signature verification
10544 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
10546 if test "$_os" = "Linux"; then
10548 AC_MSG_CHECKING([for /run/user/$uid])
10549 if test -d /run/user/$uid; then
10550 AC_MSG_RESULT([yes])
10551 AC_PATH_PROG(GPGCONF, gpgconf)
10552 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
10553 if $GPGCONF --dump-options > /dev/null ; then
10554 if $GPGCONF --dump-options | grep -q create-socketdir ; then
10555 AC_MSG_RESULT([yes])
10556 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
10558 AC_MSG_RESULT([no])
10561 AC_MSG_RESULT([no. missing or broken gpgconf?])
10564 AC_MSG_RESULT([no])
10568 AC_SUBST(ENABLE_GPGMEPP)
10569 AC_SUBST(SYSTEM_GPGMEPP)
10570 AC_SUBST(GPG_ERROR_CFLAGS)
10571 AC_SUBST(GPG_ERROR_LIBS)
10572 AC_SUBST(LIBASSUAN_CFLAGS)
10573 AC_SUBST(LIBASSUAN_LIBS)
10574 AC_SUBST(GPGMEPP_CFLAGS)
10575 AC_SUBST(GPGMEPP_LIBS)
10577 AC_SUBST(HAVE_GPGCONF_SOCKETDIR)
10579 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10580 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10581 AC_MSG_RESULT([yes])
10582 ENABLE_MEDIAWIKI=TRUE
10583 BUILD_TYPE="$BUILD_TYPE XSLTML"
10584 if test "x$with_java" = "xno"; then
10585 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10588 AC_MSG_RESULT([no])
10590 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10592 AC_SUBST(ENABLE_MEDIAWIKI)
10594 AC_MSG_CHECKING([whether to build the Report Builder])
10595 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10596 AC_MSG_RESULT([yes])
10597 ENABLE_REPORTBUILDER=TRUE
10598 AC_MSG_CHECKING([which jfreereport libs to use])
10599 if test "$with_system_jfreereport" = "yes"; then
10600 SYSTEM_JFREEREPORT=TRUE
10601 AC_MSG_RESULT([external])
10602 if test -z $SAC_JAR; then
10603 SAC_JAR=/usr/share/java/sac.jar
10605 if ! test -f $SAC_JAR; then
10606 AC_MSG_ERROR(sac.jar not found.)
10609 if test -z $LIBXML_JAR; then
10610 if test -f /usr/share/java/libxml-1.0.0.jar; then
10611 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
10612 elif test -f /usr/share/java/libxml.jar; then
10613 LIBXML_JAR=/usr/share/java/libxml.jar
10615 AC_MSG_ERROR(libxml.jar replacement not found.)
10617 elif ! test -f $LIBXML_JAR; then
10618 AC_MSG_ERROR(libxml.jar not found.)
10621 if test -z $FLUTE_JAR; then
10622 if test -f/usr/share/java/flute-1.3.0.jar; then
10623 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
10624 elif test -f /usr/share/java/flute.jar; then
10625 FLUTE_JAR=/usr/share/java/flute.jar
10627 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
10629 elif ! test -f $FLUTE_JAR; then
10630 AC_MSG_ERROR(flute-1.3.0.jar not found.)
10633 if test -z $JFREEREPORT_JAR; then
10634 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
10635 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
10636 elif test -f /usr/share/java/flow-engine.jar; then
10637 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
10639 AC_MSG_ERROR(jfreereport.jar replacement not found.)
10641 elif ! test -f $JFREEREPORT_JAR; then
10642 AC_MSG_ERROR(jfreereport.jar not found.)
10645 if test -z $LIBLAYOUT_JAR; then
10646 if test -f /usr/share/java/liblayout-0.2.9.jar; then
10647 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
10648 elif test -f /usr/share/java/liblayout.jar; then
10649 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
10651 AC_MSG_ERROR(liblayout.jar replacement not found.)
10653 elif ! test -f $LIBLAYOUT_JAR; then
10654 AC_MSG_ERROR(liblayout.jar not found.)
10657 if test -z $LIBLOADER_JAR; then
10658 if test -f /usr/share/java/libloader-1.0.0.jar; then
10659 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
10660 elif test -f /usr/share/java/libloader.jar; then
10661 LIBLOADER_JAR=/usr/share/java/libloader.jar
10663 AC_MSG_ERROR(libloader.jar replacement not found.)
10665 elif ! test -f $LIBLOADER_JAR; then
10666 AC_MSG_ERROR(libloader.jar not found.)
10669 if test -z $LIBFORMULA_JAR; then
10670 if test -f /usr/share/java/libformula-0.2.0.jar; then
10671 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
10672 elif test -f /usr/share/java/libformula.jar; then
10673 LIBFORMULA_JAR=/usr/share/java/libformula.jar
10675 AC_MSG_ERROR(libformula.jar replacement not found.)
10677 elif ! test -f $LIBFORMULA_JAR; then
10678 AC_MSG_ERROR(libformula.jar not found.)
10681 if test -z $LIBREPOSITORY_JAR; then
10682 if test -f /usr/share/java/librepository-1.0.0.jar; then
10683 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
10684 elif test -f /usr/share/java/librepository.jar; then
10685 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
10687 AC_MSG_ERROR(librepository.jar replacement not found.)
10689 elif ! test -f $LIBREPOSITORY_JAR; then
10690 AC_MSG_ERROR(librepository.jar not found.)
10693 if test -z $LIBFONTS_JAR; then
10694 if test -f /usr/share/java/libfonts-1.0.0.jar; then
10695 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
10696 elif test -f /usr/share/java/libfonts.jar; then
10697 LIBFONTS_JAR=/usr/share/java/libfonts.jar
10699 AC_MSG_ERROR(libfonts.jar replacement not found.)
10701 elif ! test -f $LIBFONTS_JAR; then
10702 AC_MSG_ERROR(libfonts.jar not found.)
10705 if test -z $LIBSERIALIZER_JAR; then
10706 if test -f /usr/share/java/libserializer-1.0.0.jar; then
10707 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
10708 elif test -f /usr/share/java/libserializer.jar; then
10709 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
10711 AC_MSG_ERROR(libserializer.jar replacement not found.)
10713 elif ! test -f $LIBSERIALIZER_JAR; then
10714 AC_MSG_ERROR(libserializer.jar not found.)
10717 if test -z $LIBBASE_JAR; then
10718 if test -f /usr/share/java/libbase-1.0.0.jar; then
10719 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
10720 elif test -f /usr/share/java/libbase.jar; then
10721 LIBBASE_JAR=/usr/share/java/libbase.jar
10723 AC_MSG_ERROR(libbase.jar replacement not found.)
10725 elif ! test -f $LIBBASE_JAR; then
10726 AC_MSG_ERROR(libbase.jar not found.)
10730 AC_MSG_RESULT([internal])
10731 SYSTEM_JFREEREPORT=
10732 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10736 AC_MSG_RESULT([no])
10737 ENABLE_REPORTBUILDER=
10738 SYSTEM_JFREEREPORT=
10740 AC_SUBST(ENABLE_REPORTBUILDER)
10741 AC_SUBST(SYSTEM_JFREEREPORT)
10743 AC_SUBST(LIBXML_JAR)
10744 AC_SUBST(FLUTE_JAR)
10745 AC_SUBST(JFREEREPORT_JAR)
10746 AC_SUBST(LIBBASE_JAR)
10747 AC_SUBST(LIBLAYOUT_JAR)
10748 AC_SUBST(LIBLOADER_JAR)
10749 AC_SUBST(LIBFORMULA_JAR)
10750 AC_SUBST(LIBREPOSITORY_JAR)
10751 AC_SUBST(LIBFONTS_JAR)
10752 AC_SUBST(LIBSERIALIZER_JAR)
10754 # this has to be here because both the Wiki Publisher and the SRB use
10756 COMMONS_LOGGING_VERSION=1.2
10757 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
10758 AC_MSG_CHECKING([which Apache commons-* libs to use])
10759 if test "$with_system_apache_commons" = "yes"; then
10760 SYSTEM_APACHE_COMMONS=TRUE
10761 AC_MSG_RESULT([external])
10762 if test -z $COMMONS_LOGGING_JAR; then
10763 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
10764 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
10765 elif test -f /usr/share/java/commons-logging.jar; then
10766 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
10768 AC_MSG_ERROR(commons-logging.jar replacement not found.)
10770 elif ! test -f $COMMONS_LOGGING_JAR; then
10771 AC_MSG_ERROR(commons-logging.jar not found.)
10774 AC_MSG_RESULT([internal])
10775 SYSTEM_APACHE_COMMONS=
10776 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
10780 AC_SUBST(SYSTEM_APACHE_COMMONS)
10781 AC_SUBST(COMMONS_LOGGING_JAR)
10782 AC_SUBST(COMMONS_LOGGING_VERSION)
10784 # scripting provider for BeanShell?
10785 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10786 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10787 AC_MSG_RESULT([yes])
10788 ENABLE_SCRIPTING_BEANSHELL=TRUE
10790 dnl ===================================================================
10791 dnl Check for system beanshell
10792 dnl ===================================================================
10793 AC_MSG_CHECKING([which beanshell to use])
10794 if test "$with_system_beanshell" = "yes"; then
10795 AC_MSG_RESULT([external])
10797 if test -z $BSH_JAR; then
10798 BSH_JAR=/usr/share/java/bsh.jar
10800 if ! test -f $BSH_JAR; then
10801 AC_MSG_ERROR(bsh.jar not found.)
10804 AC_MSG_RESULT([internal])
10806 BUILD_TYPE="$BUILD_TYPE BSH"
10809 AC_MSG_RESULT([no])
10810 ENABLE_SCRIPTING_BEANSHELL=
10811 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10813 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10814 AC_SUBST(SYSTEM_BSH)
10817 # scripting provider for JavaScript?
10818 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10819 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10820 AC_MSG_RESULT([yes])
10821 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10823 dnl ===================================================================
10824 dnl Check for system rhino
10825 dnl ===================================================================
10826 AC_MSG_CHECKING([which rhino to use])
10827 if test "$with_system_rhino" = "yes"; then
10828 AC_MSG_RESULT([external])
10830 if test -z $RHINO_JAR; then
10831 RHINO_JAR=/usr/share/java/js.jar
10833 if ! test -f $RHINO_JAR; then
10834 AC_MSG_ERROR(js.jar not found.)
10837 AC_MSG_RESULT([internal])
10839 BUILD_TYPE="$BUILD_TYPE RHINO"
10843 AC_MSG_RESULT([no])
10844 ENABLE_SCRIPTING_JAVASCRIPT=
10845 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10847 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10848 AC_SUBST(SYSTEM_RHINO)
10849 AC_SUBST(RHINO_JAR)
10851 # This is only used in KDE3/KDE4 checks to determine if /usr/lib64
10852 # paths should be added to library search path. So lets put all 64-bit
10855 case "$host_cpu" in
10856 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
10857 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
10858 supports_multilib="yes"
10865 dnl ===================================================================
10866 dnl KDE4 Integration
10867 dnl ===================================================================
10873 KDE4_GLIB_CFLAGS=""
10876 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10877 qt4_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10878 qt4_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10880 kde4_incdirs="/usr/include /usr/include/kde4 $x_includes"
10881 kde4_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10883 if test -n "$supports_multilib"; then
10884 qt4_libdirs="$qt4_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10885 kde4_libdirs="$kde4_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10888 if test -n "$QTDIR"; then
10889 qt4_incdirs="$QTDIR/include $qt4_incdirs"
10890 if test -z "$supports_multilib"; then
10891 qt4_libdirs="$QTDIR/lib $qt4_libdirs"
10893 qt4_libdirs="$QTDIR/lib64 $QTDIR/lib $qt4_libdirs"
10896 if test -n "$QT4DIR"; then
10897 qt4_incdirs="$QT4DIR/include $qt4_incdirs"
10898 if test -z "$supports_multilib"; then
10899 qt4_libdirs="$QT4DIR/lib $qt4_libdirs"
10901 qt4_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt4_libdirs"
10905 if test -n "$KDEDIR"; then
10906 kde4_incdirs="$KDEDIR/include $kde4_incdirs"
10907 if test -z "$supports_multilib"; then
10908 kde4_libdirs="$KDEDIR/lib $kde4_libdirs"
10910 kde4_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde4_libdirs"
10913 if test -n "$KDE4DIR"; then
10914 kde4_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde4_incdirs"
10915 if test -z "$supports_multilib"; then
10916 kde4_libdirs="$KDE4DIR/lib $kde4_libdirs"
10918 kde4_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde4_libdirs"
10922 qt4_test_include="Qt/qobject.h"
10923 qt4_test_library="libQtNetwork.so"
10924 kde4_test_include="kwindowsystem.h"
10925 kde4_test_library="libsolid.so"
10927 AC_MSG_CHECKING([for Qt4 headers])
10928 qt4_header_dir="no"
10929 for inc_dir in $qt4_incdirs; do
10930 if test -r "$inc_dir/$qt4_test_include"; then
10931 qt4_header_dir="$inc_dir"
10936 AC_MSG_RESULT([$qt4_header_dir])
10937 if test "x$qt4_header_dir" = "xno"; then
10938 AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10941 dnl Check for qmake
10942 AC_PATH_PROGS( QMAKE4, [qmake-qt4 qmake], no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
10943 if test "$QMAKE4" = "no"; then
10944 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10946 qmake4_test_ver="`$QMAKE4 -v 2>&1 | sed -n -e '/^Using Qt version 4\./p'`"
10947 if test -z "$qmake4_test_ver"; then
10948 AC_MSG_ERROR([Wrong qmake for Qt4 found. Please specify the root of your Qt installation by exporting QT4DIR before running "configure".])
10952 qt4_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt4_libdirs"
10953 AC_MSG_CHECKING([for Qt4 libraries])
10955 for lib_dir in $qt4_libdirs; do
10956 if test -r "$lib_dir/$qt4_test_library"; then
10957 qt4_lib_dir="$lib_dir"
10958 PKG_CONFIG_PATH="$qt4_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
10963 AC_MSG_RESULT([$qt4_lib_dir])
10965 if test "x$qt4_lib_dir" = "xno"; then
10966 AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10969 dnl Check for Meta Object Compiler
10971 AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10973 if test "$MOC4" = "no"; then
10974 AC_PATH_PROG( MOC4, moc, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10975 if test "$MOC4" = "no"; then
10976 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
10977 the root of your Qt installation by exporting QT4DIR before running "configure".])
10981 dnl Check for KDE4 headers
10982 AC_MSG_CHECKING([for KDE4 headers])
10984 for kde4_check in $kde4_incdirs; do
10985 if test -r "$kde4_check/$kde4_test_include"; then
10986 kde4_incdir="$kde4_check"
10990 AC_MSG_RESULT([$kde4_incdir])
10991 if test "x$kde4_incdir" = "xno"; then
10992 AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10994 if test "$kde4_incdir" = "/usr/include"; then kde4_incdir=; fi
10996 dnl Check for KDE4 libraries
10997 AC_MSG_CHECKING([for KDE4 libraries])
10999 for kde4_check in $kde4_libdirs; do
11000 if test -r "$kde4_check/$kde4_test_library"; then
11001 kde4_libdir="$kde4_check"
11006 AC_MSG_RESULT([$kde4_libdir])
11007 if test "x$kde4_libdir" = "xno"; then
11008 AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11011 PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
11012 if ! test -z "$kde4_incdir"; then
11013 KDE4_CFLAGS="-I$kde4_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11015 KDE4_CFLAGS="$QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11018 KDE4_LIBS="-L$kde4_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt4_lib_dir $QT4_LIBS"
11019 KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11020 FilterLibs "$KDE4_LIBS"
11021 KDE4_LIBS="$filteredlibs"
11023 AC_LANG_PUSH([C++])
11024 save_CXXFLAGS=$CXXFLAGS
11025 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11026 AC_MSG_CHECKING([whether KDE is >= 4.2])
11027 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11028 #include <kdeversion.h>
11030 int main(int argc, char **argv) {
11031 if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
11034 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
11035 CXXFLAGS=$save_CXXFLAGS
11038 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11039 # Sets also KDE4_GLIB_CFLAGS/KDE4_GLIB_LIBS if successful.
11040 PKG_CHECK_MODULES(KDE4_GLIB,[glib-2.0 >= 2.4],
11042 KDE4_HAVE_GLIB=TRUE
11043 AC_DEFINE(KDE4_HAVE_GLIB,1)
11044 KDE4_GLIB_CFLAGS=$(printf '%s' "$KDE4_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11045 FilterLibs "${KDE4_GLIB_LIBS}"
11046 KDE4_GLIB_LIBS="${filteredlibs}"
11050 AC_LANG_PUSH([C++])
11051 # tst_exclude_socket_notifiers.moc:70:28: runtime error: member access within address 0x60d00000bb20 which does not point to an object of type 'QObjectData'
11052 # 0x60d00000bb20: note: object is of type 'QObjectPrivate'
11053 # 02 00 80 3a 90 8a 4e d2 3a 00 00 00 f0 b4 b9 a7 ff 7f 00 00 00 00 00 00 00 00 00 00 20 d8 4e d2
11054 # ^~~~~~~~~~~~~~~~~~~~~~~
11055 # vptr for 'QObjectPrivate'
11056 # so temporarily ignore here whichever way would be used to make such errors fatal
11057 # (-fno-sanitize-recover=... or UBSAN_OPTIONS halt_on_error=1):
11059 CXX=$(printf %s "$CXX" \
11060 | sed -e 's/-fno-sanitize-recover\(=[[0-9A-Za-z,_-]]*\)*//')
11061 save_UBSAN_OPTIONS=$UBSAN_OPTIONS
11062 UBSAN_OPTIONS=$UBSAN_OPTIONS:halt_on_error=0
11063 save_CXXFLAGS=$CXXFLAGS
11064 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11066 LIBS="$LIBS $KDE4_LIBS"
11067 AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
11069 # Prepare meta object data
11070 TSTBASE="tst_exclude_socket_notifiers"
11071 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11072 ln -fs "${TSTMOC}.hxx"
11073 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11075 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11077 #include "tst_exclude_socket_notifiers.moc"
11079 int main(int argc, char *argv[])
11081 QCoreApplication app(argc, argv);
11082 exit(tst_processEventsExcludeSocket());
11086 AC_MSG_RESULT([yes])
11088 AC_MSG_RESULT([no])
11089 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11090 if test -z "$qt4_fix_warning"; then
11091 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11094 add_warning " https://bugreports.qt.io/browse/QTBUG-37380 (needed)"
11095 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11097 # Remove meta object data
11098 rm -f "${TSTBASE}."*
11100 AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
11102 # Prepare meta object data
11103 TSTBASE="tst_exclude_posted_events"
11104 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11105 ln -fs "${TSTMOC}.hxx"
11106 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11108 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11110 #include "tst_exclude_posted_events.moc"
11112 int main(int argc, char *argv[])
11114 QCoreApplication app(argc, argv);
11115 exit(tst_excludePostedEvents());
11119 AC_MSG_RESULT([yes])
11121 AC_MSG_RESULT([no])
11122 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11123 if test -z "$qt4_fix_warning"; then
11124 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11127 add_warning " https://bugreports.qt.io/browse/QTBUG-34614 (needed)"
11128 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11130 # Remove meta object data
11131 rm -f "${TSTBASE}."*
11133 if test -n "$qt4_fix_warning"; then
11134 add_warning " https://bugreports.qt.io/browse/QTBUG-38585 (recommended)"
11138 CXXFLAGS=$save_CXXFLAGS
11139 UBSAN_OPTIONS=$save_UBSAN_OPTIONS
11143 AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
11145 AC_SUBST(KDE4_CFLAGS)
11146 AC_SUBST(KDE4_LIBS)
11148 AC_SUBST(KDE4_GLIB_CFLAGS)
11149 AC_SUBST(KDE4_GLIB_LIBS)
11150 AC_SUBST(KDE4_HAVE_GLIB)
11152 dnl ===================================================================
11153 dnl QT5 Integration
11154 dnl ===================================================================
11163 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11164 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11165 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11167 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11168 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11170 if test -n "$supports_multilib"; then
11171 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11174 qt5_test_include="QtWidgets/qapplication.h"
11175 qt5_test_library="libQt5Widgets.so"
11177 dnl Check for qmake5
11178 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
11179 if test "$QMAKE5" = "no"; then
11180 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11182 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11183 if test -z "$qmake5_test_ver"; then
11184 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11186 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11187 qt5_minimal_minor="6"
11188 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11189 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11191 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11195 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11196 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11198 AC_MSG_CHECKING([for Qt5 headers])
11200 for inc_dir in $qt5_incdirs; do
11201 if test -r "$inc_dir/$qt5_test_include"; then
11202 qt5_incdir="$inc_dir"
11206 AC_MSG_RESULT([$qt5_incdir])
11207 if test "x$qt5_incdir" = "xno"; then
11208 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11211 AC_MSG_CHECKING([for Qt5 libraries])
11213 for lib_dir in $qt5_libdirs; do
11214 if test -r "$lib_dir/$qt5_test_library"; then
11215 qt5_libdir="$lib_dir"
11219 AC_MSG_RESULT([$qt5_libdir])
11220 if test "x$qt5_libdir" = "xno"; then
11221 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11224 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11225 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11226 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11228 dnl Check for Meta Object Compiler
11230 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH] )
11231 if test "$MOC5" = "no"; then
11232 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11233 the root of your Qt installation by exporting QT5DIR before running "configure".])
11236 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11237 # Sets also QT5_GLIB_CFLAGS/QT5_GLIB_LIBS if successful.
11238 PKG_CHECK_MODULES(QT5_GLIB,[glib-2.0 >= 2.4],
11241 AC_DEFINE(QT5_HAVE_GLIB,1)
11243 AC_MSG_WARN([[No Glib found, Qt5 support will not use native file pickers!]])
11246 AC_SUBST(QT5_CFLAGS)
11249 AC_SUBST(QT5_GLIB_CFLAGS)
11250 AC_SUBST(QT5_GLIB_LIBS)
11251 AC_SUBST(QT5_HAVE_GLIB)
11253 dnl ===================================================================
11254 dnl KDE5 Integration
11255 dnl ===================================================================
11259 KF5_CONFIG="kf5-config"
11260 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11261 \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11262 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11264 if test "$OS" = "HAIKU"; then
11265 haiku_arch="`echo $RTL_ARCH | tr X x`"
11266 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11267 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11270 kf5_incdirs="$KF5INC /usr/include/ $kf5_haiku_incdirs $x_includes"
11271 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11272 if test -n "$supports_multilib"; then
11273 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11276 kf5_test_include="KF5/kcoreaddons_version.h"
11277 kf5_test_library="libKF5CoreAddons.so"
11278 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11280 dnl kf5 KDE4 support compatibility installed
11281 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11282 if test "$KF5_CONFIG" != "no"; then
11283 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11284 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11287 dnl Check for KF5 headers
11288 AC_MSG_CHECKING([for KF5 headers])
11290 for kf5_check in $kf5_incdirs; do
11291 if test -r "$kf5_check/$kf5_test_include"; then
11292 kf5_incdir="$kf5_check/KF5"
11296 AC_MSG_RESULT([$kf5_incdir])
11297 if test "x$kf5_incdir" = "xno"; then
11298 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11301 dnl Check for KF5 libraries
11302 AC_MSG_CHECKING([for KF5 libraries])
11304 for kf5_check in $kf5_libdirs; do
11305 if test -r "$kf5_check/$kf5_test_library"; then
11306 kf5_libdir="$kf5_check"
11311 AC_MSG_RESULT([$kf5_libdir])
11312 if test "x$kf5_libdir" = "xno"; then
11313 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11316 if test "$USING_X11" = TRUE; then
11317 PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])])
11320 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"
11321 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS"
11322 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11324 if test "$USING_X11" = TRUE; then
11325 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11328 AC_LANG_PUSH([C++])
11329 save_CXXFLAGS=$CXXFLAGS
11330 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11331 AC_MSG_CHECKING([whether KDE is >= 5.0])
11332 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11333 #include <kcoreaddons_version.h>
11335 int main(int argc, char **argv) {
11336 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11339 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11340 CXXFLAGS=$save_CXXFLAGS
11343 AC_SUBST(KF5_CFLAGS)
11346 dnl ===================================================================
11347 dnl Test whether to include Evolution 2 support
11348 dnl ===================================================================
11349 AC_MSG_CHECKING([whether to enable evolution 2 support])
11350 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11351 AC_MSG_RESULT([yes])
11352 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11353 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11354 FilterLibs "${GOBJECT_LIBS}"
11355 GOBJECT_LIBS="${filteredlibs}"
11356 ENABLE_EVOAB2="TRUE"
11359 AC_MSG_RESULT([no])
11361 AC_SUBST(ENABLE_EVOAB2)
11362 AC_SUBST(GOBJECT_CFLAGS)
11363 AC_SUBST(GOBJECT_LIBS)
11365 dnl ===================================================================
11366 dnl Test which themes to include
11367 dnl ===================================================================
11368 AC_MSG_CHECKING([which themes to include])
11369 # if none given use default subset of available themes
11370 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11371 with_theme="breeze breeze_dark colibre elementary karasa_jaga sifr sifr_dark tango"
11375 if test "x$with_theme" != "xno"; then
11376 for theme in $with_theme; do
11378 breeze|breeze_dark|colibre|elementary|karasa_jaga|sifr|sifr_dark|tango) real_theme="$theme" ;;
11379 default) real_theme=colibre ;;
11380 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11382 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11385 AC_MSG_RESULT([$WITH_THEMES])
11386 AC_SUBST([WITH_THEMES])
11387 # FIXME: remove this, and the convenience default->colibre remapping after a crace period
11388 for theme in $with_theme; do
11390 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11395 dnl ===================================================================
11396 dnl Test whether to integrate helppacks into the product's installer
11397 dnl ===================================================================
11398 AC_MSG_CHECKING([for helppack integration])
11399 if test "$with_helppack_integration" = "no"; then
11400 AC_MSG_RESULT([no integration])
11402 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11403 AC_MSG_RESULT([integration])
11406 ###############################################################################
11407 # Extensions checking
11408 ###############################################################################
11409 AC_MSG_CHECKING([for extensions integration])
11410 if test "x$enable_extension_integration" != "xno"; then
11411 WITH_EXTENSION_INTEGRATION=TRUE
11412 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11413 AC_MSG_RESULT([yes, use integration])
11415 WITH_EXTENSION_INTEGRATION=
11416 AC_MSG_RESULT([no, do not integrate])
11418 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11420 dnl Should any extra extensions be included?
11421 dnl There are standalone tests for each of these below.
11422 WITH_EXTRA_EXTENSIONS=
11423 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11425 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11426 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11427 if test "x$with_java" != "xno"; then
11428 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11429 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11432 AC_MSG_CHECKING([whether to build opens___.ttf])
11433 if test "$enable_build_opensymbol" = "yes"; then
11434 AC_MSG_RESULT([yes])
11435 AC_PATH_PROG(FONTFORGE, fontforge)
11436 if test -z "$FONTFORGE"; then
11437 AC_MSG_ERROR([fontforge not installed])
11440 AC_MSG_RESULT([no])
11441 OPENSYMBOL_TTF=49a64f3bcf20a7909ba2751349231d6652ded9cd2840e961b5164d09de3ffa63-opens___.ttf
11442 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11444 AC_SUBST(OPENSYMBOL_TTF)
11445 AC_SUBST(FONTFORGE)
11447 dnl ===================================================================
11448 dnl Test whether to include fonts
11449 dnl ===================================================================
11450 AC_MSG_CHECKING([whether to include third-party fonts])
11451 if test "$with_fonts" != "no"; then
11452 AC_MSG_RESULT([yes])
11454 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11455 AC_DEFINE(HAVE_MORE_FONTS)
11457 AC_MSG_RESULT([no])
11459 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11461 AC_SUBST(WITH_FONTS)
11464 dnl ===================================================================
11465 dnl Test whether to enable online update service
11466 dnl ===================================================================
11467 AC_MSG_CHECKING([whether to enable online update])
11468 ENABLE_ONLINE_UPDATE=
11469 ENABLE_ONLINE_UPDATE_MAR=
11471 if test "$enable_online_update" = ""; then
11472 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11473 AC_MSG_RESULT([yes])
11474 ENABLE_ONLINE_UPDATE="TRUE"
11476 AC_MSG_RESULT([no])
11479 if test "$enable_online_update" = "mar"; then
11480 AC_MSG_RESULT([yes - MAR-based online update])
11481 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11482 if test "$with_update_config" = ""; then
11483 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11485 UPDATE_CONFIG="$with_update_config"
11486 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11487 elif test "$enable_online_update" = "yes"; then
11488 AC_MSG_RESULT([yes])
11489 ENABLE_ONLINE_UPDATE="TRUE"
11491 AC_MSG_RESULT([no])
11494 AC_SUBST(ENABLE_ONLINE_UPDATE)
11495 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11496 AC_SUBST(UPDATE_CONFIG)
11498 dnl ===================================================================
11499 dnl Test whether we need bzip2
11500 dnl ===================================================================
11502 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11503 AC_MSG_CHECKING([whether to use system bzip2])
11504 if test "$with_system_bzip2" = yes; then
11506 AC_MSG_RESULT([yes])
11507 PKG_CHECK_MODULES(BZIP2, bzip2)
11508 FilterLibs "${BZIP2_LIBS}"
11509 BZIP2_LIBS="${filteredlibs}"
11511 AC_MSG_RESULT([no])
11512 BUILD_TYPE="$BUILD_TYPE BZIP2"
11515 AC_SUBST(SYSTEM_BZIP2)
11516 AC_SUBST(BZIP2_CFLAGS)
11517 AC_SUBST(BZIP2_LIBS)
11519 dnl ===================================================================
11520 dnl Test whether to enable extension update
11521 dnl ===================================================================
11522 AC_MSG_CHECKING([whether to enable extension update])
11523 ENABLE_EXTENSION_UPDATE=
11524 if test "x$enable_extension_update" = "xno"; then
11525 AC_MSG_RESULT([no])
11527 AC_MSG_RESULT([yes])
11528 ENABLE_EXTENSION_UPDATE="TRUE"
11529 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11530 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11532 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11535 dnl ===================================================================
11536 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11537 dnl ===================================================================
11538 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11539 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11540 AC_MSG_RESULT([no])
11543 AC_MSG_RESULT([yes])
11544 ENABLE_SILENT_MSI=TRUE
11545 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11547 AC_SUBST(ENABLE_SILENT_MSI)
11549 AC_MSG_CHECKING([whether and how to use Xinerama])
11550 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11551 if test "$x_libraries" = "default_x_libraries"; then
11552 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11553 if test "x$XINERAMALIB" = x; then
11554 XINERAMALIB="/usr/lib"
11557 XINERAMALIB="$x_libraries"
11559 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11560 # we have both versions, let the user decide but use the dynamic one
11563 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11564 XINERAMA_LINK=dynamic
11566 XINERAMA_LINK=static
11568 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11569 # we have only the dynamic version
11571 XINERAMA_LINK=dynamic
11572 elif test -e "$XINERAMALIB/libXinerama.a"; then
11574 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11576 XINERAMA_LINK=static
11586 if test "$USE_XINERAMA" = "TRUE"; then
11587 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11588 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11589 [AC_MSG_ERROR(Xinerama header not found.)], [])
11590 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11591 if test "x$XEXTLIB" = x; then
11592 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11594 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11595 if test "$_os" = "FreeBSD"; then
11596 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11598 if test "$_os" = "Linux"; then
11599 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11601 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11602 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11604 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11609 AC_MSG_RESULT([no])
11611 AC_SUBST(USE_XINERAMA)
11612 AC_SUBST(XINERAMA_LINK)
11614 dnl ===================================================================
11615 dnl Test whether to build cairo or rely on the system version
11616 dnl ===================================================================
11618 if test "$USING_X11" = TRUE; then
11619 # Used in vcl/Library_vclplug_gen.mk
11623 if test "$test_cairo" = "yes"; then
11624 AC_MSG_CHECKING([whether to use the system cairo])
11626 : ${with_system_cairo:=$with_system_libs}
11627 if test "$with_system_cairo" = "yes"; then
11629 AC_MSG_RESULT([yes])
11631 PKG_CHECK_MODULES( CAIRO, cairo >= 1.2.0 )
11632 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11633 FilterLibs "${CAIRO_LIBS}"
11634 CAIRO_LIBS="${filteredlibs}"
11636 if test "$test_xrender" = "yes"; then
11637 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11639 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11640 #ifdef PictStandardA8
11644 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11650 AC_MSG_RESULT([no])
11652 BUILD_TYPE="$BUILD_TYPE CAIRO"
11656 AC_SUBST(SYSTEM_CAIRO)
11657 AC_SUBST(CAIRO_CFLAGS)
11658 AC_SUBST(CAIRO_LIBS)
11660 dnl ===================================================================
11661 dnl Test whether to use avahi
11662 dnl ===================================================================
11663 if test "$_os" = "WINNT"; then
11664 # Windows uses bundled mDNSResponder
11665 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11666 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11667 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11668 [ENABLE_AVAHI="TRUE"])
11669 AC_DEFINE(HAVE_FEATURE_AVAHI)
11670 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11671 FilterLibs "${AVAHI_LIBS}"
11672 AVAHI_LIBS="${filteredlibs}"
11675 AC_SUBST(ENABLE_AVAHI)
11676 AC_SUBST(AVAHI_CFLAGS)
11677 AC_SUBST(AVAHI_LIBS)
11679 dnl ===================================================================
11680 dnl Test whether to use liblangtag
11681 dnl ===================================================================
11683 AC_MSG_CHECKING([whether to use system liblangtag])
11684 if test "$with_system_liblangtag" = yes; then
11685 SYSTEM_LIBLANGTAG=TRUE
11686 AC_MSG_RESULT([yes])
11687 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11688 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11689 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11690 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11691 FilterLibs "${LIBLANGTAG_LIBS}"
11692 LIBLANGTAG_LIBS="${filteredlibs}"
11695 AC_MSG_RESULT([no])
11696 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11697 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
11698 if test "$COM" = "MSC"; then
11699 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
11701 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
11704 AC_SUBST(SYSTEM_LIBLANGTAG)
11705 AC_SUBST(LIBLANGTAG_CFLAGS)
11706 AC_SUBST(LIBLANGTAG_LIBS)
11708 dnl ===================================================================
11709 dnl Test whether to build libpng or rely on the system version
11710 dnl ===================================================================
11712 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
11714 dnl ===================================================================
11715 dnl Check for runtime JVM search path
11716 dnl ===================================================================
11717 if test "$ENABLE_JAVA" != ""; then
11718 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11719 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11720 AC_MSG_RESULT([yes])
11721 if ! test -d "$with_jvm_path"; then
11722 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11724 if ! test -d "$with_jvm_path"jvm; then
11725 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11727 JVM_ONE_PATH_CHECK="$with_jvm_path"
11728 AC_SUBST(JVM_ONE_PATH_CHECK)
11730 AC_MSG_RESULT([no])
11734 dnl ===================================================================
11735 dnl Test for the presence of Ant and that it works
11736 dnl ===================================================================
11738 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
11739 ANT_HOME=; export ANT_HOME
11740 WITH_ANT_HOME=; export WITH_ANT_HOME
11741 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11742 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11743 if test "$_os" = "WINNT"; then
11744 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11746 with_ant_home="$LODE_HOME/opt/ant"
11748 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11749 with_ant_home="$LODE_HOME/opt/ant"
11752 if test -z "$with_ant_home"; then
11753 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11755 if test "$_os" = "WINNT"; then
11756 # AC_PATH_PROGS needs unix path
11757 with_ant_home=`cygpath -u "$with_ant_home"`
11759 AbsolutePath "$with_ant_home"
11760 with_ant_home=$absolute_path
11761 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11762 WITH_ANT_HOME=$with_ant_home
11763 ANT_HOME=$with_ant_home
11766 if test -z "$ANT"; then
11767 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11769 # resolve relative or absolute symlink
11770 while test -h "$ANT"; do
11772 a_basename=`basename "$ANT"`
11773 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11774 cd "`dirname "$ANT"`"
11775 cd "`dirname "$a_script"`"
11776 ANT="`pwd`"/"`basename "$a_script"`"
11780 AC_MSG_CHECKING([if $ANT works])
11781 mkdir -p conftest.dir
11784 cat > conftest.java << EOF
11785 public class conftest {
11786 int testmethod(int a, int b) {
11792 cat > conftest.xml << EOF
11793 <project name="conftest" default="conftest">
11794 <target name="conftest">
11795 <javac srcdir="." includes="conftest.java">
11801 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
11802 if test $? = 0 -a -f ./conftest.class; then
11803 AC_MSG_RESULT([Ant works])
11804 if test -z "$WITH_ANT_HOME"; then
11805 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11806 if test -z "$ANT_HOME"; then
11807 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11810 ANT_HOME="$WITH_ANT_HOME"
11813 echo "configure: Ant test failed" >&5
11814 cat conftest.java >&5
11815 cat conftest.xml >&5
11816 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
11819 rm -fr conftest.dir
11821 if test -z "$ANT_HOME"; then
11822 ANT_HOME="NO_ANT_HOME"
11824 PathFormat "$ANT_HOME"
11825 ANT_HOME="$formatted_path"
11827 ANT="$formatted_path"
11832 dnl Checking for ant.jar
11833 if test "$ANT_HOME" != "NO_ANT_HOME"; then
11834 AC_MSG_CHECKING([Ant lib directory])
11835 if test -f $ANT_HOME/lib/ant.jar; then
11836 ANT_LIB="$ANT_HOME/lib"
11838 if test -f $ANT_HOME/ant.jar; then
11839 ANT_LIB="$ANT_HOME"
11841 if test -f /usr/share/java/ant.jar; then
11842 ANT_LIB=/usr/share/java
11844 if test -f /usr/share/ant-core/lib/ant.jar; then
11845 ANT_LIB=/usr/share/ant-core/lib
11847 if test -f $ANT_HOME/lib/ant/ant.jar; then
11848 ANT_LIB="$ANT_HOME/lib/ant"
11850 if test -f /usr/share/lib/ant/ant.jar; then
11851 ANT_LIB=/usr/share/lib/ant
11853 AC_MSG_ERROR([Ant libraries not found!])
11860 PathFormat "$ANT_LIB"
11861 ANT_LIB="$formatted_path"
11862 AC_MSG_RESULT([Ant lib directory found.])
11867 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11869 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11870 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11871 ant_version_major=`echo $ant_version | cut -d. -f1`
11872 ant_version_minor=`echo $ant_version | cut -d. -f2`
11873 echo "configure: ant_version $ant_version " >&5
11874 echo "configure: ant_version_major $ant_version_major " >&5
11875 echo "configure: ant_version_minor $ant_version_minor " >&5
11876 if test "$ant_version_major" -ge "2"; then
11877 AC_MSG_RESULT([yes, $ant_version])
11878 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11879 AC_MSG_RESULT([yes, $ant_version])
11881 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11884 rm -f conftest* core core.* *.core
11888 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11889 AC_MSG_CHECKING([for JUnit 4])
11890 if test "$with_junit" = "yes"; then
11891 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
11892 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
11893 elif test -e /usr/share/java/junit4.jar; then
11894 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11896 if test -e /usr/share/lib/java/junit.jar; then
11897 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11899 OOO_JUNIT_JAR=/usr/share/java/junit.jar
11903 OOO_JUNIT_JAR=$with_junit
11905 if test "$_os" = "WINNT"; then
11906 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11908 printf 'import org.junit.Before;' > conftest.java
11909 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11910 AC_MSG_RESULT([$OOO_JUNIT_JAR])
11913 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
11914 specify its pathname via --with-junit=..., or disable it via --without-junit])
11916 rm -f conftest.class conftest.java
11917 if test $OOO_JUNIT_JAR != ""; then
11918 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11921 AC_SUBST(OOO_JUNIT_JAR)
11924 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11925 AC_MSG_CHECKING([for included Hamcrest])
11926 printf 'import org.hamcrest.BaseDescription;' > conftest.java
11927 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11928 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
11930 AC_MSG_RESULT([Not included])
11931 AC_MSG_CHECKING([for standalone hamcrest jar.])
11932 if test "$with_hamcrest" = "yes"; then
11933 if test -e /usr/share/lib/java/hamcrest.jar; then
11934 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
11935 elif test -e /usr/share/java/hamcrest/core.jar; then
11936 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
11938 HAMCREST_JAR=/usr/share/java/hamcrest.jar
11941 HAMCREST_JAR=$with_hamcrest
11943 if test "$_os" = "WINNT"; then
11944 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
11946 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
11947 AC_MSG_RESULT([$HAMCREST_JAR])
11949 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),
11950 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
11953 rm -f conftest.class conftest.java
11955 AC_SUBST(HAMCREST_JAR)
11961 # check for wget and curl
11966 if test "$enable_fetch_external" != "no"; then
11968 CURL=`which curl 2>/dev/null`
11970 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
11972 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
11973 if test $? -eq 0; then
11979 if test -z "$WGET" -a -z "$CURL"; then
11980 AC_MSG_ERROR([neither wget nor curl found!])
11989 # check for sha256sum
11993 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
11994 eval "$i -a 256 --version" > /dev/null 2>&1
11996 if test $ret -eq 0; then
11997 SHA256SUM="$i -a 256"
12002 if test -z "$SHA256SUM"; then
12003 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
12004 eval "$i --version" > /dev/null 2>&1
12006 if test $ret -eq 0; then
12013 if test -z "$SHA256SUM"; then
12014 AC_MSG_ERROR([no sha256sum found!])
12017 AC_SUBST(SHA256SUM)
12019 dnl ===================================================================
12020 dnl Dealing with l10n options
12021 dnl ===================================================================
12022 AC_MSG_CHECKING([which languages to be built])
12023 # get list of all languages
12024 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12025 # the sed command does the following:
12026 # + if a line ends with a backslash, append the next line to it
12027 # + adds " on the beginning of the value (after =)
12028 # + adds " at the end of the value
12029 # + removes en-US; we want to put it on the beginning
12030 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12031 [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)]
12032 ALL_LANGS="en-US $completelangiso"
12033 # check the configured localizations
12034 WITH_LANG="$with_lang"
12036 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
12037 # (Norwegian is "nb" and "nn".)
12038 if test "$WITH_LANG" = "no"; then
12042 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12043 AC_MSG_RESULT([en-US])
12045 AC_MSG_RESULT([$WITH_LANG])
12046 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12047 if test -z "$MSGFMT"; then
12048 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12049 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12050 elif test -x "/opt/lo/bin/msgfmt"; then
12051 MSGFMT="/opt/lo/bin/msgfmt"
12053 AC_CHECK_PROGS(MSGFMT, [msgfmt])
12054 if test -z "$MSGFMT"; then
12055 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12059 if test -z "$MSGUNIQ"; then
12060 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12061 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12062 elif test -x "/opt/lo/bin/msguniq"; then
12063 MSGUNIQ="/opt/lo/bin/msguniq"
12065 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12066 if test -z "$MSGUNIQ"; then
12067 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12074 # check that the list is valid
12075 for lang in $WITH_LANG; do
12076 test "$lang" = "ALL" && continue
12077 # need to check for the exact string, so add space before and after the list of all languages
12078 for vl in $ALL_LANGS; do
12079 if test "$vl" = "$lang"; then
12083 if test "$vl" != "$lang"; then
12084 # if you're reading this - you prolly quoted your languages remove the quotes ...
12085 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12088 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12089 echo $WITH_LANG | grep -q en-US
12090 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12092 # list with substituted ALL
12093 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12094 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12095 test "$WITH_LANG" = "en-US" && WITH_LANG=
12096 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12097 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12098 ALL_LANGS=`echo $ALL_LANGS qtz`
12100 AC_SUBST(ALL_LANGS)
12101 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12102 AC_SUBST(WITH_LANG)
12103 AC_SUBST(WITH_LANG_LIST)
12104 AC_SUBST(GIT_NEEDED_SUBMODULES)
12106 WITH_POOR_HELP_LOCALIZATIONS=
12107 if test -d "$SRC_ROOT/translations/source"; then
12108 for l in `ls -1 $SRC_ROOT/translations/source`; do
12109 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12110 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12114 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12116 if test -n "$with_locales"; then
12117 WITH_LOCALES="$with_locales"
12119 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12120 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12121 # config_host/config_locales.h.in
12122 for locale in $WITH_LOCALES; do
12125 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12129 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12132 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12137 AC_DEFINE(WITH_LOCALE_ALL)
12139 AC_SUBST(WITH_LOCALES)
12141 dnl git submodule update --reference
12142 dnl ===================================================================
12143 if test -n "${GIT_REFERENCE_SRC}"; then
12144 for repo in ${GIT_NEEDED_SUBMODULES}; do
12145 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12146 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12150 AC_SUBST(GIT_REFERENCE_SRC)
12152 dnl git submodules linked dirs
12153 dnl ===================================================================
12154 if test -n "${GIT_LINK_SRC}"; then
12155 for repo in ${GIT_NEEDED_SUBMODULES}; do
12156 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12157 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12161 AC_SUBST(GIT_LINK_SRC)
12164 dnl ===================================================================
12165 AC_MSG_CHECKING([for alternative branding images directory])
12166 # initialize mapped arrays
12167 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12168 brand_files="$BRAND_INTRO_IMAGES about.svg"
12170 if test -z "$with_branding" -o "$with_branding" = "no"; then
12171 AC_MSG_RESULT([none])
12172 DEFAULT_BRAND_IMAGES="$brand_files"
12174 if ! test -d $with_branding ; then
12175 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12177 AC_MSG_RESULT([$with_branding])
12178 CUSTOM_BRAND_DIR="$with_branding"
12179 for lfile in $brand_files
12181 if ! test -f $with_branding/$lfile ; then
12182 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12183 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12185 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12188 check_for_progress="yes"
12191 AC_SUBST([BRAND_INTRO_IMAGES])
12192 AC_SUBST([CUSTOM_BRAND_DIR])
12193 AC_SUBST([CUSTOM_BRAND_IMAGES])
12194 AC_SUBST([DEFAULT_BRAND_IMAGES])
12197 AC_MSG_CHECKING([for 'intro' progress settings])
12201 PROGRESSFRAMECOLOR=
12203 PROGRESSTEXTBASELINE=
12205 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12206 source "$with_branding/progress.conf"
12207 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12209 AC_MSG_RESULT([none])
12212 AC_SUBST(PROGRESSBARCOLOR)
12213 AC_SUBST(PROGRESSSIZE)
12214 AC_SUBST(PROGRESSPOSITION)
12215 AC_SUBST(PROGRESSFRAMECOLOR)
12216 AC_SUBST(PROGRESSTEXTCOLOR)
12217 AC_SUBST(PROGRESSTEXTBASELINE)
12220 AC_MSG_CHECKING([for extra build ID])
12221 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12222 EXTRA_BUILDID="$with_extra_buildid"
12224 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12225 if test -n "$EXTRA_BUILDID" ; then
12226 AC_MSG_RESULT([$EXTRA_BUILDID])
12228 AC_MSG_RESULT([not set])
12230 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12233 AC_MSG_CHECKING([for vendor])
12234 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12235 OOO_VENDOR="$USERNAME"
12237 if test -z "$OOO_VENDOR"; then
12241 if test -z "$OOO_VENDOR"; then
12242 OOO_VENDOR="`id -u -n`"
12245 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12247 OOO_VENDOR="$with_vendor"
12248 AC_MSG_RESULT([$OOO_VENDOR])
12250 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12251 AC_SUBST(OOO_VENDOR)
12253 if test "$_os" = "Android" ; then
12254 ANDROID_PACKAGE_NAME=
12255 AC_MSG_CHECKING([for Android package name])
12256 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12257 if test -n "$ENABLE_DEBUG"; then
12258 # Default to the package name that makes ndk-gdb happy.
12259 ANDROID_PACKAGE_NAME="org.libreoffice"
12261 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12264 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12266 ANDROID_PACKAGE_NAME="$with_android_package_name"
12267 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12269 AC_SUBST(ANDROID_PACKAGE_NAME)
12272 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12273 if test "$with_compat_oowrappers" = "yes"; then
12274 WITH_COMPAT_OOWRAPPERS=TRUE
12277 WITH_COMPAT_OOWRAPPERS=
12280 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12282 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12283 AC_MSG_CHECKING([for install dirname])
12284 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12285 INSTALLDIRNAME="$with_install_dirname"
12287 AC_MSG_RESULT([$INSTALLDIRNAME])
12288 AC_SUBST(INSTALLDIRNAME)
12290 AC_MSG_CHECKING([for prefix])
12291 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12292 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12293 PREFIXDIR="$prefix"
12294 AC_MSG_RESULT([$PREFIXDIR])
12295 AC_SUBST(PREFIXDIR)
12297 LIBDIR=[$(eval echo $(eval echo $libdir))]
12300 DATADIR=[$(eval echo $(eval echo $datadir))]
12303 MANDIR=[$(eval echo $(eval echo $mandir))]
12306 DOCDIR=[$(eval echo $(eval echo $docdir))]
12309 BINDIR=[$(eval echo $(eval echo $bindir))]
12312 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12313 AC_SUBST(INSTALLDIR)
12315 TESTINSTALLDIR="${BUILDDIR}/test-install"
12316 AC_SUBST(TESTINSTALLDIR)
12319 # ===================================================================
12320 # OAuth2 id and secrets
12321 # ===================================================================
12323 AC_MSG_CHECKING([for Google Drive client id and secret])
12324 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12325 AC_MSG_RESULT([not set])
12326 GDRIVE_CLIENT_ID="\"\""
12327 GDRIVE_CLIENT_SECRET="\"\""
12329 AC_MSG_RESULT([set])
12330 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12331 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12333 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12334 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12336 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12337 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12338 AC_MSG_RESULT([not set])
12339 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12340 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12342 AC_MSG_RESULT([set])
12343 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12344 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12346 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12347 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12349 AC_MSG_CHECKING([for OneDrive client id and secret])
12350 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12351 AC_MSG_RESULT([not set])
12352 ONEDRIVE_CLIENT_ID="\"\""
12353 ONEDRIVE_CLIENT_SECRET="\"\""
12355 AC_MSG_RESULT([set])
12356 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12357 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12359 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12360 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12363 dnl ===================================================================
12364 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12365 dnl --enable-dependency-tracking configure option
12366 dnl ===================================================================
12367 AC_MSG_CHECKING([whether to enable dependency tracking])
12368 if test "$enable_dependency_tracking" = "no"; then
12370 AC_MSG_RESULT([no])
12372 AC_MSG_RESULT([yes])
12376 dnl ===================================================================
12377 dnl Number of CPUs to use during the build
12378 dnl ===================================================================
12379 AC_MSG_CHECKING([for number of processors to use])
12380 # plain --with-parallelism is just the default
12381 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12382 if test "$with_parallelism" = "no"; then
12385 PARALLELISM=$with_parallelism
12388 if test "$enable_icecream" = "yes"; then
12393 Darwin|FreeBSD|NetBSD|OpenBSD)
12394 PARALLELISM=`sysctl -n hw.ncpu`
12398 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12400 # what else than above does profit here *and* has /proc?
12402 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12406 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12407 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12411 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12412 if test -z "$with_parallelism"; then
12413 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12414 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12417 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."
12421 if test $PARALLELISM -eq 0; then
12422 AC_MSG_RESULT([explicit make -j option needed])
12424 AC_MSG_RESULT([$PARALLELISM])
12426 AC_SUBST(PARALLELISM)
12428 IWYU_PATH="$with_iwyu"
12429 AC_SUBST(IWYU_PATH)
12430 if test ! -z "$IWYU_PATH"; then
12431 if test ! -f "$IWYU_PATH"; then
12432 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12437 # Set up ILIB for MSVC build
12440 if test "$build_os" = "cygwin"; then
12442 if test -n "$JAVA_HOME"; then
12443 ILIB="$ILIB;$JAVA_HOME/lib"
12446 if test "$BITNESS_OVERRIDE" = 64; then
12447 ILIB="$ILIB;$COMPATH/lib/x64"
12448 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12449 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12450 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12451 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12452 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12453 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12455 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12456 ucrtlibpath_formatted=$formatted_path
12457 ILIB="$ILIB;$ucrtlibpath_formatted"
12458 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12460 ILIB="$ILIB;$COMPATH/lib/x86"
12461 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12462 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12463 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12464 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12465 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12466 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12468 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12469 ucrtlibpath_formatted=$formatted_path
12470 ILIB="$ILIB;$ucrtlibpath_formatted"
12471 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12473 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12474 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12476 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12482 AC_MSG_CHECKING([whether $CXX supports inline variables])
12483 AC_LANG_PUSH([C++])
12484 save_CXXFLAGS=$CXXFLAGS
12485 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12486 if test "$build_os" = cygwin; then
12490 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
12491 #if !defined __cpp_inline_variables
12492 // This tests for one specific aspect of inline variables that is actually used by
12493 // ORegistry::ROOT (registry/source/regimpl.cxx):
12494 struct S { constexpr S() {} };
12495 struct T { static constexpr S s{}; };
12496 S const * f() { return &T::s; }
12499 AC_DEFINE([HAVE_CPP_INLINE_VARIABLES],[1])
12500 AC_MSG_RESULT([yes])
12501 ], [AC_MSG_RESULT([no])])
12502 CXXFLAGS=$save_CXXFLAGS
12503 if test "$build_os" = cygwin; then
12508 dnl We should be able to drop the below check when bumping the GCC baseline to
12509 dnl 4.9, as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577>
12510 dnl "deque<T>::erase() still takes iterator instead of const_iterator" should be
12511 dnl fixed there with <https://gcc.gnu.org/git/?p=gcc.git;a=commit;
12512 dnl h=6b0e18ca48bb4b4c01e7b5be2b98849943fdcf91>:
12514 [whether C++11 use of const_iterator in standard containers is broken])
12515 save_CXXFLAGS=$CXXFLAGS
12516 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12517 AC_LANG_PUSH([C++])
12518 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12522 l.erase(l.cbegin());
12524 [broken=no], [broken=yes])
12526 CXXFLAGS=$save_CXXFLAGS
12527 AC_MSG_RESULT([$broken])
12528 if test "$broken" = yes; then
12529 AC_DEFINE([HAVE_BROKEN_CONST_ITERATORS])
12533 AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
12534 save_CXXFLAGS=$CXXFLAGS
12535 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12537 if test -n "$ILIB1"; then
12538 LIBS="$LIBS $ILIB1"
12540 AC_LANG_PUSH([C++])
12541 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
12542 // Exit with failure if the static initializer_list is stored on the
12543 // stack (as done by Clang < 3.4):
12544 #include <initializer_list>
12546 bool g(void const * p1, void const * p2) {
12548 return !((p1 > p2 && p2 > &n) || (p1 < p2 && p2 < &n));
12550 bool f(void const * p1) {
12551 static std::initializer_list<S> s { S() };
12552 return g(p1, s.begin());
12556 return f(&n) ? 0 : 1;
12557 ]])], [broken=no], [broken=yes],[broken='assuming not (cross-compiling)'])
12560 CXXFLAGS=$save_CXXFLAGS
12561 AC_MSG_RESULT([$broken])
12562 if test "$broken" = yes -a "$_os" != "iOS"; then
12563 AC_MSG_ERROR([working support for static initializer_list needed])
12567 # ===================================================================
12568 # Creating bigger shared library to link against
12569 # ===================================================================
12570 AC_MSG_CHECKING([whether to create huge library])
12573 if test $_os = iOS -o $_os = Android; then
12574 # Never any point in mergelibs for these as we build just static
12575 # libraries anyway...
12576 enable_mergelibs=no
12579 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12580 if test $_os != Linux -a $_os != WINNT; then
12581 add_warning "--enable-mergelibs is not tested for this platform"
12584 AC_MSG_RESULT([yes])
12586 AC_MSG_RESULT([no])
12588 AC_SUBST([MERGELIBS])
12590 dnl ===================================================================
12591 dnl icerun is a wrapper that stops us spawning tens of processes
12592 dnl locally - for tools that can't be executed on the compile cluster
12593 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12594 dnl ===================================================================
12595 AC_MSG_CHECKING([whether to use icerun wrapper])
12597 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12598 ICECREAM_RUN=icerun
12599 AC_MSG_RESULT([yes])
12601 AC_MSG_RESULT([no])
12603 AC_SUBST(ICECREAM_RUN)
12605 dnl ===================================================================
12606 dnl Setup the ICECC_VERSION for the build the same way it was set for
12607 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12608 dnl ===================================================================
12609 x_ICECC_VERSION=[\#]
12610 if test -n "$ICECC_VERSION" ; then
12613 AC_SUBST(x_ICECC_VERSION)
12614 AC_SUBST(ICECC_VERSION)
12616 dnl ===================================================================
12618 AC_MSG_CHECKING([MPL subset])
12621 if test "$enable_mpl_subset" = "yes"; then
12623 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12625 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12628 if test "$warn_report" = "true"; then
12629 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12631 if test "x$enable_postgresql_sdbc" != "xno"; then
12632 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12634 if test "$enable_lotuswordpro" = "yes"; then
12635 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12637 if test "$WITH_WEBDAV" = "neon"; then
12638 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12640 if test -n "$ENABLE_PDFIMPORT"; then
12641 if test "x$SYSTEM_POPPLER" = "x"; then
12642 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12645 # cf. m4/libo_check_extension.m4
12646 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12647 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12649 for theme in $WITH_THEMES; do
12651 breeze|breeze_dark|sifr|sifr_dark|elementary|karasa_jaga) #blacklist of icon themes under GPL or LGPL
12652 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12657 ENABLE_OPENGL_TRANSITIONS=
12659 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12660 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12664 AC_DEFINE(MPL_HAVE_SUBSET)
12665 AC_MSG_RESULT([only])
12667 AC_MSG_RESULT([no restrictions])
12669 AC_SUBST(MPL_SUBSET)
12671 dnl ===================================================================
12673 AC_MSG_CHECKING([formula logger])
12674 ENABLE_FORMULA_LOGGER=
12676 if test "x$enable_formula_logger" = "xyes"; then
12677 AC_MSG_RESULT([yes])
12678 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12679 ENABLE_FORMULA_LOGGER=TRUE
12680 elif test -n "$ENABLE_DBGUTIL" ; then
12681 AC_MSG_RESULT([yes])
12682 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12683 ENABLE_FORMULA_LOGGER=TRUE
12685 AC_MSG_RESULT([no])
12688 AC_SUBST(ENABLE_FORMULA_LOGGER)
12690 dnl ===================================================================
12691 dnl Setting up the environment.
12692 dnl ===================================================================
12693 AC_MSG_NOTICE([setting up the build environment variables...])
12697 if test "$build_os" = "cygwin"; then
12698 if test -d "$COMPATH/atlmfc/lib"; then
12699 ATL_LIB="$COMPATH/atlmfc/lib"
12700 ATL_INCLUDE="$COMPATH/atlmfc/include"
12702 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12703 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12705 if test "$BITNESS_OVERRIDE" = 64; then
12706 if test $VCVER = "150"; then
12707 ATL_LIB="$ATL_LIB/x64"
12709 ATL_LIB="$ATL_LIB/amd64"
12712 if test $VCVER = "150"; then
12713 ATL_LIB="$ATL_LIB/x86"
12716 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12717 PathFormat "/usr/bin/find.exe"
12718 FIND="$formatted_path"
12719 PathFormat "/usr/bin/sort.exe"
12720 SORT="$formatted_path"
12721 PathFormat "/usr/bin/grep.exe"
12722 WIN_GREP="$formatted_path"
12723 PathFormat "/usr/bin/ls.exe"
12724 WIN_LS="$formatted_path"
12725 PathFormat "/usr/bin/touch.exe"
12726 WIN_TOUCH="$formatted_path"
12732 AC_SUBST(ATL_INCLUDE)
12738 AC_SUBST(WIN_TOUCH)
12740 AC_SUBST(BUILD_TYPE)
12745 PERL="$formatted_path"
12748 if test -n "$TMPDIR"; then
12749 TEMP_DIRECTORY="$TMPDIR"
12751 TEMP_DIRECTORY="/tmp"
12753 if test "$build_os" = "cygwin"; then
12754 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12756 AC_SUBST(TEMP_DIRECTORY)
12758 # setup the PATH for the environment
12759 if test -n "$LO_PATH_FOR_BUILD"; then
12760 LO_PATH="$LO_PATH_FOR_BUILD"
12766 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12767 if test "$ENABLE_JAVA" != ""; then
12768 pathmunge "$JAVA_HOME/bin" "after"
12773 # Win32 make needs native paths
12774 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12775 LO_PATH=`cygpath -p -m "$PATH"`
12777 if test "$BITNESS_OVERRIDE" = 64; then
12778 # needed for msi packaging
12779 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12781 # .NET 4.6 and higher don't have bin directory
12782 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
12783 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12785 pathmunge "$ASM_HOME" "before"
12786 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12787 pathmunge "$CSC_PATH" "before"
12788 pathmunge "$MIDL_PATH" "before"
12789 pathmunge "$AL_PATH" "before"
12790 pathmunge "$MSPDB_PATH" "before"
12791 if test -n "$MSBUILD_PATH" ; then
12792 pathmunge "$MSBUILD_PATH" "before"
12794 if test "$BITNESS_OVERRIDE" = 64; then
12795 pathmunge "$COMPATH/bin/amd64" "before"
12796 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
12798 pathmunge "$COMPATH/bin" "before"
12799 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12801 if test "$ENABLE_JAVA" != ""; then
12802 if test -d "$JAVA_HOME/jre/bin/client"; then
12803 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12805 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12806 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12808 pathmunge "$JAVA_HOME/bin" "before"
12813 pathmunge "/usr/css/bin" "before"
12814 if test "$ENABLE_JAVA" != ""; then
12815 pathmunge "$JAVA_HOME/bin" "after"
12825 # Generate a configuration sha256 we can use for deps
12826 if test -f config_host.mk; then
12827 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
12829 if test -f config_host_lang.mk; then
12830 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
12833 CFLAGS=$my_original_CFLAGS
12834 CXXFLAGS=$my_original_CXXFLAGS
12835 CPPFLAGS=$my_original_CPPFLAGS
12837 AC_CONFIG_FILES([config_host.mk
12838 config_host_lang.mk
12841 bin/bffvalidator.sh
12842 bin/odfvalidator.sh
12844 instsetoo_native/util/openoffice.lst
12845 sysui/desktop/macosx/Info.plist])
12846 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12847 AC_CONFIG_HEADERS([config_host/config_clang.h])
12848 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12849 AC_CONFIG_HEADERS([config_host/config_eot.h])
12850 AC_CONFIG_HEADERS([config_host/config_extensions.h])
12851 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12852 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
12853 AC_CONFIG_HEADERS([config_host/config_dbus.h])
12854 AC_CONFIG_HEADERS([config_host/config_features.h])
12855 AC_CONFIG_HEADERS([config_host/config_firebird.h])
12856 AC_CONFIG_HEADERS([config_host/config_folders.h])
12857 AC_CONFIG_HEADERS([config_host/config_gio.h])
12858 AC_CONFIG_HEADERS([config_host/config_global.h])
12859 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
12860 AC_CONFIG_HEADERS([config_host/config_java.h])
12861 AC_CONFIG_HEADERS([config_host/config_langs.h])
12862 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12863 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
12864 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
12865 AC_CONFIG_HEADERS([config_host/config_libnumbertext.h])
12866 AC_CONFIG_HEADERS([config_host/config_locales.h])
12867 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12868 AC_CONFIG_HEADERS([config_host/config_kde4.h])
12869 AC_CONFIG_HEADERS([config_host/config_qt5.h])
12870 AC_CONFIG_HEADERS([config_host/config_kde5.h])
12871 AC_CONFIG_HEADERS([config_host/config_gtk3_kde5.h])
12872 AC_CONFIG_HEADERS([config_host/config_oox.h])
12873 AC_CONFIG_HEADERS([config_host/config_options.h])
12874 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
12875 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12876 AC_CONFIG_HEADERS([config_host/config_vendor.h])
12877 AC_CONFIG_HEADERS([config_host/config_vcl.h])
12878 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12879 AC_CONFIG_HEADERS([config_host/config_version.h])
12880 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12881 AC_CONFIG_HEADERS([config_host/config_poppler.h])
12882 AC_CONFIG_HEADERS([config_host/config_python.h])
12883 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
12886 if test "$CROSS_COMPILING" = TRUE; then
12887 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12890 # touch the config timestamp file
12891 if test ! -f config_host.mk.stamp; then
12892 echo > config_host.mk.stamp
12893 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
12894 echo "Host Configuration unchanged - avoiding scp2 stamp update"
12896 echo > config_host.mk.stamp
12899 # touch the config lang timestamp file
12900 if test ! -f config_host_lang.mk.stamp; then
12901 echo > config_host_lang.mk.stamp
12902 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
12903 echo "Language Configuration unchanged - avoiding scp2 stamp update"
12905 echo > config_host_lang.mk.stamp
12909 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12912 ****************************************************************************
12914 Your make version is known to be horribly slow, and hard to debug
12915 problems with. To get a reasonably functional make please do:
12917 to install a pre-compiled binary make for Win32
12919 mkdir -p /opt/lo/bin
12921 wget https://dev-www.libreoffice.org/bin/cygwin/make-85047eb-msvc.exe
12922 cp make-85047eb-msvc.exe make
12925 to install from source:
12926 place yourself in a working directory of you choice.
12928 git clone git://git.savannah.gnu.org/make.git
12930 [go to Start menu, open "Visual Studio 2017", click "VS2017 x86 Native Tools Command Prompt" or "VS2017 x64 Native Tools Command Prompt"]
12931 set PATH=%PATH%;C:\Cygwin\bin
12932 [or Cygwin64, if that is what you have]
12933 cd path-to-make-repo-you-cloned-above
12934 build_w32.bat --without-guile
12936 should result in a WinRel/gnumake.exe.
12937 Copy it to the Cygwin /opt/lo/bin directory as make.exe
12939 Then re-run autogen.sh
12941 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12942 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12948 ****************************************************************************
12953 To view some help, run:
12958 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
12960 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
12963 if test $_os = Darwin; then
12964 echo open instdir/$PRODUCTNAME.app
12966 echo instdir/program/soffice
12970 If you want to run the smoketest, run:
12976 if test -f warn; then
12981 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: