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" = "Android" ; then
816 # Verify that the NDK and SDK options are proper
817 if test -z "$with_android_ndk"; then
818 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
819 elif test ! -f "$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}/usr/lib/libc.a"; then
820 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
823 if test -z "$ANDROID_SDK_HOME"; then
824 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
825 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
826 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
829 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
830 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
831 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
832 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
833 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
834 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
835 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
836 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
838 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
839 AC_MSG_WARN([android support repository not found - install with
840 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
841 to allow the build to download the specified version of the android support libraries])
842 add_warning "android support repository not found - install with"
843 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
844 add_warning "to allow the build to download the specified version of the android support libraries"
848 if test "$_os" = "AIX"; then
849 AC_PATH_PROG(GAWK, gawk)
850 if test -z "$GAWK"; then
851 AC_MSG_ERROR([gawk not found in \$PATH])
857 AC_SUBST(PTHREAD_CFLAGS)
858 AC_SUBST(PTHREAD_LIBS)
860 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
861 # By default use the ones specified by our build system,
862 # but explicit override is possible.
863 AC_MSG_CHECKING(for explicit AFLAGS)
864 if test -n "$AFLAGS"; then
865 AC_MSG_RESULT([$AFLAGS])
871 AC_MSG_CHECKING(for explicit CFLAGS)
872 if test -n "$CFLAGS"; then
873 AC_MSG_RESULT([$CFLAGS])
879 AC_MSG_CHECKING(for explicit CXXFLAGS)
880 if test -n "$CXXFLAGS"; then
881 AC_MSG_RESULT([$CXXFLAGS])
887 AC_MSG_CHECKING(for explicit OBJCFLAGS)
888 if test -n "$OBJCFLAGS"; then
889 AC_MSG_RESULT([$OBJCFLAGS])
895 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
896 if test -n "$OBJCXXFLAGS"; then
897 AC_MSG_RESULT([$OBJCXXFLAGS])
903 AC_MSG_CHECKING(for explicit LDFLAGS)
904 if test -n "$LDFLAGS"; then
905 AC_MSG_RESULT([$LDFLAGS])
915 AC_SUBST(OBJCXXFLAGS)
920 AC_SUBST(x_OBJCFLAGS)
921 AC_SUBST(x_OBJCXXFLAGS)
924 dnl These are potentially set for MSVC, in the code checking for UCRT below:
925 my_original_CFLAGS=$CFLAGS
926 my_original_CXXFLAGS=$CXXFLAGS
927 my_original_CPPFLAGS=$CPPFLAGS
929 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
930 dnl Needs to precede the AC_SEARCH_LIBS call below, which apparently calls
931 dnl AC_PROG_CC internally.
932 if test "$_os" != "WINNT"; then
933 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
939 if test $_os != "WINNT"; then
941 AC_SEARCH_LIBS([dlsym], [dl],
942 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
943 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
946 AC_SUBST(DLOPEN_LIBS)
948 AC_ARG_ENABLE(ios-simulator,
949 AS_HELP_STRING([--enable-ios-simulator],
950 [build i386 or x86_64 for ios simulator])
953 AC_ARG_ENABLE(ios-libreofficelight-app,
954 AS_HELP_STRING([--enable-ios-libreofficelight-app],
955 [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
956 (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
957 and also that its actual build (in Xcode) requires some obvious modifications to the project.])
960 ENABLE_IOS_LIBREOFFICELIGHT_APP=
961 if test "$enable_ios_libreofficelight_app" = yes; then
962 ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
964 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
966 ###############################################################################
967 # Extensions switches --enable/--disable
968 ###############################################################################
969 # By default these should be enabled unless having extra dependencies.
970 # If there is extra dependency over configure options then the enable should
971 # be automagic based on whether the requiring feature is enabled or not.
972 # All this options change anything only with --enable-extension-integration.
974 # The name of this option and its help string makes it sound as if
975 # extensions are built anyway, just not integrated in the installer,
976 # if you use --disable-extension-integration. Is that really the
979 libo_FUZZ_ARG_ENABLE(extension-integration,
980 AS_HELP_STRING([--disable-extension-integration],
981 [Disable integration of the built extensions in the installer of the
982 product. Use this switch to disable the integration.])
985 AC_ARG_ENABLE(avmedia,
986 AS_HELP_STRING([--disable-avmedia],
987 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
990 AC_ARG_ENABLE(database-connectivity,
991 AS_HELP_STRING([--disable-database-connectivity],
992 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
995 # This doesn't mean not building (or "integrating") extensions
996 # (although it probably should; i.e. it should imply
997 # --disable-extension-integration I guess), it means not supporting
998 # any extension mechanism at all
999 libo_FUZZ_ARG_ENABLE(extensions,
1000 AS_HELP_STRING([--disable-extensions],
1001 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
1004 AC_ARG_ENABLE(scripting,
1005 AS_HELP_STRING([--disable-scripting],
1006 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1009 # This is mainly for Android and iOS, but could potentially be used in some
1010 # special case otherwise, too, so factored out as a separate setting
1012 AC_ARG_ENABLE(dynamic-loading,
1013 AS_HELP_STRING([--disable-dynamic-loading],
1014 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1017 libo_FUZZ_ARG_ENABLE(report-builder,
1018 AS_HELP_STRING([--disable-report-builder],
1019 [Disable the Report Builder.])
1022 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1023 AS_HELP_STRING([--enable-ext-wiki-publisher],
1024 [Enable the Wiki Publisher extension.])
1027 libo_FUZZ_ARG_ENABLE(lpsolve,
1028 AS_HELP_STRING([--disable-lpsolve],
1029 [Disable compilation of the lp solve solver ])
1031 libo_FUZZ_ARG_ENABLE(coinmp,
1032 AS_HELP_STRING([--disable-coinmp],
1033 [Disable compilation of the CoinMP solver ])
1036 libo_FUZZ_ARG_ENABLE(pdfimport,
1037 AS_HELP_STRING([--disable-pdfimport],
1038 [Disable building the PDF import feature.])
1041 libo_FUZZ_ARG_ENABLE(pdfium,
1042 AS_HELP_STRING([--disable-pdfium],
1043 [Disable building PDFium.])
1046 ###############################################################################
1048 dnl ---------- *** ----------
1050 libo_FUZZ_ARG_ENABLE(mergelibs,
1051 AS_HELP_STRING([--enable-mergelibs],
1052 [Merge several of the smaller libraries into one big, "merged", one.])
1055 libo_FUZZ_ARG_ENABLE(breakpad,
1056 AS_HELP_STRING([--enable-breakpad],
1057 [Enables breakpad for crash reporting.])
1060 AC_ARG_ENABLE(fetch-external,
1061 AS_HELP_STRING([--disable-fetch-external],
1062 [Disables fetching external tarballs from web sources.])
1065 AC_ARG_ENABLE(fuzzers,
1066 AS_HELP_STRING([--enable-fuzzers],
1067 [Enables building libfuzzer targets for fuzz testing.])
1070 libo_FUZZ_ARG_ENABLE(pch,
1071 AS_HELP_STRING([--enable-pch],
1072 [Enables precompiled header support for C++. Forced default on Windows/VC build])
1075 libo_FUZZ_ARG_ENABLE(epm,
1076 AS_HELP_STRING([--enable-epm],
1077 [LibreOffice includes self-packaging code, that requires epm, however epm is
1078 useless for large scale package building.])
1081 libo_FUZZ_ARG_ENABLE(odk,
1082 AS_HELP_STRING([--disable-odk],
1083 [LibreOffice includes an ODK, office development kit which some packagers may
1084 wish to build without.])
1087 AC_ARG_ENABLE(mpl-subset,
1088 AS_HELP_STRING([--enable-mpl-subset],
1089 [Don't compile any pieces which are not MPL or more liberally licensed])
1092 libo_FUZZ_ARG_ENABLE(evolution2,
1093 AS_HELP_STRING([--enable-evolution2],
1094 [Allows the built-in evolution 2 addressbook connectivity build to be
1098 AC_ARG_ENABLE(avahi,
1099 AS_HELP_STRING([--enable-avahi],
1100 [Determines whether to use Avahi to advertise Impress to remote controls.])
1103 libo_FUZZ_ARG_ENABLE(werror,
1104 AS_HELP_STRING([--enable-werror],
1105 [Turn warnings to errors. (Has no effect in modules where the treating
1106 of warnings as errors is disabled explicitly.)]),
1109 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1110 AS_HELP_STRING([--enable-assert-always-abort],
1111 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1114 libo_FUZZ_ARG_ENABLE(dbgutil,
1115 AS_HELP_STRING([--enable-dbgutil],
1116 [Provide debugging support from --enable-debug and include additional debugging
1117 utilities such as object counting or more expensive checks.
1118 This is the recommended option for developers.
1119 Note that this makes the build ABI incompatible, it is not possible to mix object
1120 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1122 libo_FUZZ_ARG_ENABLE(debug,
1123 AS_HELP_STRING([--enable-debug],
1124 [Include debugging information, disable compiler optimization and inlining plus
1125 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1127 libo_FUZZ_ARG_ENABLE(split-debug,
1128 AS_HELP_STRING([--enable-split-debug],
1129 [Uses split debug information (-gsplit-dwarf compile flag). Saves disk space and build time,
1130 but requires tools that support it (both build tools and debuggers).]))
1132 libo_FUZZ_ARG_ENABLE(gdb-index,
1133 AS_HELP_STRING([--enable-gdb-index],
1134 [Creates debug information in the gdb index format, which makes gdb start faster.
1135 Requires the gold or lld linker.]))
1137 libo_FUZZ_ARG_ENABLE(sal-log,
1138 AS_HELP_STRING([--enable-sal-log],
1139 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1141 AC_ARG_ENABLE(selective-debuginfo,
1142 AS_HELP_STRING([--enable-selective-debuginfo],
1143 [If --enable-debug or --enable-dbgutil is used, build debugging information
1144 (-g compiler flag) only for the specified gbuild build targets
1145 (where all means everything, - prepended means not to enable, / appended means
1146 everything in the directory; there is no ordering, more specific overrides
1147 more general, and disabling takes precedence).
1148 Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
1150 libo_FUZZ_ARG_ENABLE(symbols,
1151 AS_HELP_STRING([--enable-symbols],
1152 [Generate debug information.
1153 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1156 libo_FUZZ_ARG_ENABLE(optimized,
1157 AS_HELP_STRING([--disable-optimized],
1158 [Whether to compile with optimization flags.
1159 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1162 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1163 AS_HELP_STRING([--disable-runtime-optimizations],
1164 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1165 JVM JIT) that are known to interact badly with certain dynamic analysis
1166 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1167 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1168 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1170 AC_ARG_WITH(valgrind,
1171 AS_HELP_STRING([--with-valgrind],
1172 [Make availability of Valgrind headers a hard requirement.]))
1174 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1175 AS_HELP_STRING([--enable-compiler-plugins],
1176 [Enable compiler plugins that will perform additional checks during
1177 building. Enabled automatically by --enable-dbgutil.
1178 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1179 COMPILER_PLUGINS_DEBUG=
1180 if test "$enable_compiler_plugins" = debug; then
1181 enable_compiler_plugins=yes
1182 COMPILER_PLUGINS_DEBUG=TRUE
1185 libo_FUZZ_ARG_ENABLE(ooenv,
1186 AS_HELP_STRING([--disable-ooenv],
1187 [Disable ooenv for the instdir installation.]))
1189 libo_FUZZ_ARG_ENABLE(libnumbertext,
1190 AS_HELP_STRING([--disable-libnumbertext],
1191 [Disable use of numbertext external library.]))
1194 AS_HELP_STRING([--enable-lto],
1195 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1196 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1197 linker. For MSVC, this option is broken at the moment. This is experimental work
1198 in progress that shouldn't be used unless you are working on it.)]))
1200 AC_ARG_ENABLE(python,
1201 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1202 [Enables or disables Python support at run-time.
1203 Also specifies what Python to use. 'auto' is the default.
1204 'fully-internal' even forces the internal version for uses of Python
1205 during the build.]))
1207 libo_FUZZ_ARG_ENABLE(gtk,
1208 AS_HELP_STRING([--disable-gtk],
1209 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
1210 ,test "${enable_gtk+set}" = set || enable_gtk=yes)
1212 libo_FUZZ_ARG_ENABLE(gtk3,
1213 AS_HELP_STRING([--disable-gtk3],
1214 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1215 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1217 AC_ARG_ENABLE(split-app-modules,
1218 AS_HELP_STRING([--enable-split-app-modules],
1219 [Split file lists for app modules, e.g. base, calc.
1220 Has effect only with make distro-pack-install]),
1223 AC_ARG_ENABLE(split-opt-features,
1224 AS_HELP_STRING([--enable-split-opt-features],
1225 [Split file lists for some optional features, e.g. pyuno, testtool.
1226 Has effect only with make distro-pack-install]),
1229 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1230 AS_HELP_STRING([--disable-cairo-canvas],
1231 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1234 libo_FUZZ_ARG_ENABLE(dbus,
1235 AS_HELP_STRING([--disable-dbus],
1236 [Determines whether to enable features that depend on dbus.
1237 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1238 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1240 libo_FUZZ_ARG_ENABLE(sdremote,
1241 AS_HELP_STRING([--disable-sdremote],
1242 [Determines whether to enable Impress remote control (i.e. the server component).]),
1243 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1245 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1246 AS_HELP_STRING([--disable-sdremote-bluetooth],
1247 [Determines whether to build sdremote with bluetooth support.
1248 Requires dbus on Linux.]))
1250 libo_FUZZ_ARG_ENABLE(gio,
1251 AS_HELP_STRING([--disable-gio],
1252 [Determines whether to use the GIO support.]),
1253 ,test "${enable_gio+set}" = set || enable_gio=yes)
1256 AS_HELP_STRING([--enable-kde4],
1257 [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
1258 KDE4 are available.]),
1262 AS_HELP_STRING([--enable-qt5],
1263 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1268 AS_HELP_STRING([--enable-kde5],
1269 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1270 KF5 are available.]),
1273 AC_ARG_ENABLE(gtk3_kde5,
1274 AS_HELP_STRING([--enable-gtk3-kde5],
1275 [Determines whether to use Gtk3 vclplug with KDE file dialogs on
1276 platforms where Gtk3, Qt5 and Plasma is available.]),
1279 libo_FUZZ_ARG_ENABLE(gui,
1280 AS_HELP_STRING([--disable-gui],
1281 [Disable use of X11 or Wayland to reduce dependencies. Not related to the --headless
1282 command-line option. Not related to LibreOffice Online functionality. Don't use
1283 unless you are certain you need to. Nobody will help you if you insist on trying
1284 this and run into problems.]),
1285 ,test "${enable_gui+set}" = set || enable_gui=yes)
1287 libo_FUZZ_ARG_ENABLE(randr,
1288 AS_HELP_STRING([--disable-randr],
1289 [Disable RandR support in the vcl project.]),
1290 ,test "${enable_randr+set}" = set || enable_randr=yes)
1292 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1293 AS_HELP_STRING([--disable-gstreamer-1-0],
1294 [Disable building with the new gstreamer 1.0 avmedia backend.]),
1295 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1297 AC_ARG_ENABLE(gstreamer-0-10,
1298 AS_HELP_STRING([--enable-gstreamer-0-10],
1299 [Enable building with the gstreamer 0.10 avmedia backend.]),
1300 ,enable_gstreamer_0_10=no)
1302 libo_FUZZ_ARG_ENABLE(vlc,
1303 AS_HELP_STRING([--enable-vlc],
1304 [Enable building with the (experimental) VLC avmedia backend.]),
1305 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1307 libo_FUZZ_ARG_ENABLE(neon,
1308 AS_HELP_STRING([--disable-neon],
1309 [Disable neon and the compilation of webdav binding.]),
1312 libo_FUZZ_ARG_ENABLE([eot],
1313 [AS_HELP_STRING([--enable-eot],
1314 [Enable support for Embedded OpenType fonts.])],
1315 ,test "${enable_eot+set}" = set || enable_eot=no)
1317 libo_FUZZ_ARG_ENABLE(cve-tests,
1318 AS_HELP_STRING([--disable-cve-tests],
1319 [Prevent CVE tests to be executed]),
1322 libo_FUZZ_ARG_ENABLE(chart-tests,
1323 AS_HELP_STRING([--enable-chart-tests],
1324 [Executes chart XShape tests. In a perfect world these tests would be
1325 stable and everyone could run them, in reality it is best to run them
1326 only on a few machines that are known to work and maintained by people
1327 who can judge if a test failure is a regression or not.]),
1330 AC_ARG_ENABLE(build-unowinreg,
1331 AS_HELP_STRING([--enable-build-unowinreg],
1332 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1333 compiler is needed on Linux.]),
1336 AC_ARG_ENABLE(build-opensymbol,
1337 AS_HELP_STRING([--enable-build-opensymbol],
1338 [Do not use the prebuilt opens___.ttf. Build it instead. This needs
1339 fontforge installed.]),
1342 AC_ARG_ENABLE(dependency-tracking,
1343 AS_HELP_STRING([--enable-dependency-tracking],
1344 [Do not reject slow dependency extractors.])[
1345 --disable-dependency-tracking
1346 Disables generation of dependency information.
1347 Speed up one-time builds.],
1350 AC_ARG_ENABLE(icecream,
1351 AS_HELP_STRING([--enable-icecream],
1352 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1353 It defaults to /opt/icecream for the location of the icecream gcc/g++
1354 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1358 AS_HELP_STRING([--enable-ld=<linker>],
1359 [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.]),
1362 libo_FUZZ_ARG_ENABLE(cups,
1363 AS_HELP_STRING([--disable-cups],
1364 [Do not build cups support.])
1367 AC_ARG_ENABLE(ccache,
1368 AS_HELP_STRING([--disable-ccache],
1369 [Do not try to use ccache automatically.
1370 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1371 CC/CXX are not yet set, and --enable-icecream is not given, we
1372 attempt to use ccache. --disable-ccache disables ccache completely.
1376 AC_ARG_ENABLE(64-bit,
1377 AS_HELP_STRING([--enable-64-bit],
1378 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1379 At the moment meaningful only for Windows.]), ,)
1381 libo_FUZZ_ARG_ENABLE(online-update,
1382 AS_HELP_STRING([--enable-online-update],
1383 [Enable the online update service that will check for new versions of
1384 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1385 If the value is "mar", the experimental Mozilla-like update will be
1386 enabled instead of the traditional update mechanism.]),
1389 AC_ARG_WITH(update-config,
1390 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1391 [Path to the update config ini file]))
1393 libo_FUZZ_ARG_ENABLE(extension-update,
1394 AS_HELP_STRING([--disable-extension-update],
1395 [Disable possibility to update installed extensions.]),
1398 libo_FUZZ_ARG_ENABLE(release-build,
1399 AS_HELP_STRING([--enable-release-build],
1400 [Enable release build. Note that the "release build" choice is orthogonal to
1401 whether symbols are present, debug info is generated, or optimization
1403 See http://wiki.documentfoundation.org/Development/DevBuild]),
1406 AC_ARG_ENABLE(windows-build-signing,
1407 AS_HELP_STRING([--enable-windows-build-signing],
1408 [Enable signing of windows binaries (*.exe, *.dll)]),
1411 AC_ARG_ENABLE(silent-msi,
1412 AS_HELP_STRING([--enable-silent-msi],
1413 [Enable MSI with LIMITUI=1 (silent install).]),
1416 AC_ARG_ENABLE(macosx-code-signing,
1417 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1418 [Sign executables, dylibs, frameworks and the app bundle. If you
1419 don't provide an identity the first suitable certificate
1420 in your keychain is used.]),
1423 AC_ARG_ENABLE(macosx-package-signing,
1424 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1425 [Create a .pkg suitable for uploading to the Mac App Store and sign
1426 it. If you don't provide an identity the first suitable certificate
1427 in your keychain is used.]),
1430 AC_ARG_ENABLE(macosx-sandbox,
1431 AS_HELP_STRING([--enable-macosx-sandbox],
1432 [Make the app bundle run in a sandbox. Requires code signing.
1433 Is required by apps distributed in the Mac App Store, and implies
1434 adherence to App Store rules.]),
1437 AC_ARG_WITH(macosx-bundle-identifier,
1438 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1439 [Define the OS X bundle identifier. Default is the somewhat weird
1440 org.libreoffice.script ("script", huh?).]),
1441 ,with_macosx_bundle_identifier=org.libreoffice.script)
1443 AC_ARG_WITH(product-name,
1444 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1445 [Define the product name. Default is AC_PACKAGE_NAME.]),
1446 ,with_product_name=$PRODUCTNAME)
1448 AC_ARG_WITH(package-version,
1449 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1450 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1453 libo_FUZZ_ARG_ENABLE(readonly-installset,
1454 AS_HELP_STRING([--enable-readonly-installset],
1455 [Prevents any attempts by LibreOffice to write into its installation. That means
1456 at least that no "system-wide" extensions can be added. Partly experimental work in
1457 progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
1460 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1461 AS_HELP_STRING([--disable-postgresql-sdbc],
1462 [Disable the build of the PostgreSQL-SDBC driver.])
1465 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1466 AS_HELP_STRING([--disable-lotuswordpro],
1467 [Disable the build of the Lotus Word Pro filter.]),
1468 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1470 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1471 AS_HELP_STRING([--disable-firebird-sdbc],
1472 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1473 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1475 AC_ARG_ENABLE(bogus-pkg-config,
1476 AS_HELP_STRING([--enable-bogus-pkg-config],
1477 [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.]),
1480 AC_ARG_ENABLE(openssl,
1481 AS_HELP_STRING([--disable-openssl],
1482 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1483 components will either use GNUTLS or NSS. Work in progress,
1484 use only if you are hacking on it.]),
1485 ,enable_openssl=yes)
1487 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
1488 AS_HELP_STRING([--enable-cipher-openssl-backend],
1489 [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
1490 Requires --enable-openssl.]))
1492 AC_ARG_ENABLE(library-bin-tar,
1493 AS_HELP_STRING([--enable-library-bin-tar],
1494 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1495 Some libraries can save their build result in a tarball
1496 stored in TARFILE_LOCATION. That binary tarball is
1497 uniquely identified by the source tarball,
1498 the content of the config_host.mk file and the content
1499 of the top-level directory in core for that library
1500 If this option is enabled, then if such a tarfile exist, it will be untarred
1501 instead of the source tarfile, and the build step will be skipped for that
1503 If a proper tarfile does not exist, then the normal source-based
1504 build is done for that library and a proper binary tarfile is created
1505 for the next time.]),
1508 AC_ARG_ENABLE(dconf,
1509 AS_HELP_STRING([--disable-dconf],
1510 [Disable the dconf configuration backend (enabled by default where
1513 libo_FUZZ_ARG_ENABLE(formula-logger,
1515 [--enable-formula-logger],
1516 [Enable formula logger for logging formula calculation flow in Calc.]
1520 dnl ===================================================================
1521 dnl Optional Packages (--with/without-)
1522 dnl ===================================================================
1524 AC_ARG_WITH(gcc-home,
1525 AS_HELP_STRING([--with-gcc-home],
1526 [Specify the location of gcc/g++ manually. This can be used in conjunction
1527 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1528 non-default path.]),
1531 AC_ARG_WITH(gnu-patch,
1532 AS_HELP_STRING([--with-gnu-patch],
1533 [Specify location of GNU patch on Solaris or FreeBSD.]),
1536 AC_ARG_WITH(build-platform-configure-options,
1537 AS_HELP_STRING([--with-build-platform-configure-options],
1538 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1542 AS_HELP_STRING([--with-gnu-cp],
1543 [Specify location of GNU cp on Solaris or FreeBSD.]),
1546 AC_ARG_WITH(external-tar,
1547 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1548 [Specify an absolute path of where to find (and store) tarfiles.]),
1549 TARFILE_LOCATION=$withval ,
1552 AC_ARG_WITH(referenced-git,
1553 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1554 [Specify another checkout directory to reference. This makes use of
1555 git submodule update --reference, and saves a lot of diskspace
1556 when having multiple trees side-by-side.]),
1557 GIT_REFERENCE_SRC=$withval ,
1560 AC_ARG_WITH(linked-git,
1561 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1562 [Specify a directory where the repositories of submodules are located.
1563 This uses a method similar to git-new-workdir to get submodules.]),
1564 GIT_LINK_SRC=$withval ,
1567 AC_ARG_WITH(galleries,
1568 AS_HELP_STRING([--with-galleries],
1569 [Specify how galleries should be built. It is possible either to
1570 build these internally from source ("build"),
1571 or to disable them ("no")]),
1575 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1576 [Choose which themes to include. By default those themes with an '*' are included.
1577 Possible choices: *breeze, *breeze_dark, *colibre, *elementary, *karasa_jaga, *sifr, *sifr_dark, *tango.]),
1580 libo_FUZZ_ARG_WITH(helppack-integration,
1581 AS_HELP_STRING([--without-helppack-integration],
1582 [It will not integrate the helppacks to the installer
1583 of the product. Please use this switch to use the online help
1584 or separate help packages.]),
1587 libo_FUZZ_ARG_WITH(fonts,
1588 AS_HELP_STRING([--without-fonts],
1589 [LibreOffice includes some third-party fonts to provide a reliable basis for
1590 help content, templates, samples, etc. When these fonts are already
1591 known to be available on the system then you should use this option.]),
1595 AS_HELP_STRING([--with-epm],
1596 [Decides which epm to use. Default is to use the one from the system if
1597 one is built. When either this is not there or you say =internal epm
1601 AC_ARG_WITH(package-format,
1602 AS_HELP_STRING([--with-package-format],
1603 [Specify package format(s) for LibreOffice installation sets. The
1604 implicit --without-package-format leads to no installation sets being
1605 generated. Possible values: aix, archive, bsd, deb, dmg,
1606 installed, msi, pkg, and rpm.
1607 Example: --with-package-format='deb rpm']),
1611 AS_HELP_STRING([--with-tls],
1612 [Decides which TLS/SSL and cryptographic implementations to use for
1613 LibreOffice's code. Notice that this doesn't apply for depending
1614 libraries like "neon", for example. Default is to use OpenSSL
1615 although NSS is also possible. Notice that selecting NSS restricts
1616 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1617 restrict by now the usage of NSS in LO's code. Possible values:
1618 openssl, nss. Example: --with-tls="nss"]),
1621 AC_ARG_WITH(system-libs,
1622 AS_HELP_STRING([--with-system-libs],
1623 [Use libraries already on system -- enables all --with-system-* flags.]),
1626 AC_ARG_WITH(system-bzip2,
1627 AS_HELP_STRING([--with-system-bzip2],
1628 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1629 [with_system_bzip2="$with_system_libs"])
1631 AC_ARG_WITH(system-headers,
1632 AS_HELP_STRING([--with-system-headers],
1633 [Use headers already on system -- enables all --with-system-* flags for
1634 external packages whose headers are the only entities used i.e.
1635 boost/odbc/sane-header(s).]),,
1636 [with_system_headers="$with_system_libs"])
1638 AC_ARG_WITH(system-jars,
1639 AS_HELP_STRING([--without-system-jars],
1640 [When building with --with-system-libs, also the needed jars are expected
1641 on the system. Use this to disable that]),,
1642 [with_system_jars="$with_system_libs"])
1644 AC_ARG_WITH(system-cairo,
1645 AS_HELP_STRING([--with-system-cairo],
1646 [Use cairo libraries already on system. Happens automatically for
1647 (implicit) --enable-gtk and for --enable-gtk3.]))
1649 AC_ARG_WITH(system-epoxy,
1650 AS_HELP_STRING([--with-system-epoxy],
1651 [Use epoxy libraries already on system. Happens automatically for
1653 [with_system_epoxy="$with_system_libs"])
1655 AC_ARG_WITH(myspell-dicts,
1656 AS_HELP_STRING([--with-myspell-dicts],
1657 [Adds myspell dictionaries to the LibreOffice installation set]),
1660 AC_ARG_WITH(system-dicts,
1661 AS_HELP_STRING([--without-system-dicts],
1662 [Do not use dictionaries from system paths.]),
1665 AC_ARG_WITH(external-dict-dir,
1666 AS_HELP_STRING([--with-external-dict-dir],
1667 [Specify external dictionary dir.]),
1670 AC_ARG_WITH(external-hyph-dir,
1671 AS_HELP_STRING([--with-external-hyph-dir],
1672 [Specify external hyphenation pattern dir.]),
1675 AC_ARG_WITH(external-thes-dir,
1676 AS_HELP_STRING([--with-external-thes-dir],
1677 [Specify external thesaurus dir.]),
1680 AC_ARG_WITH(system-zlib,
1681 AS_HELP_STRING([--with-system-zlib],
1682 [Use zlib already on system.]),,
1683 [with_system_zlib=auto])
1685 AC_ARG_WITH(system-jpeg,
1686 AS_HELP_STRING([--with-system-jpeg],
1687 [Use jpeg already on system.]),,
1688 [with_system_jpeg="$with_system_libs"])
1690 AC_ARG_WITH(system-clucene,
1691 AS_HELP_STRING([--with-system-clucene],
1692 [Use clucene already on system.]),,
1693 [with_system_clucene="$with_system_libs"])
1695 AC_ARG_WITH(system-expat,
1696 AS_HELP_STRING([--with-system-expat],
1697 [Use expat already on system.]),,
1698 [with_system_expat="$with_system_libs"])
1700 AC_ARG_WITH(system-libxml,
1701 AS_HELP_STRING([--with-system-libxml],
1702 [Use libxml/libxslt already on system.]),,
1703 [with_system_libxml=auto])
1705 AC_ARG_WITH(system-icu,
1706 AS_HELP_STRING([--with-system-icu],
1707 [Use icu already on system.]),,
1708 [with_system_icu="$with_system_libs"])
1710 AC_ARG_WITH(system-ucpp,
1711 AS_HELP_STRING([--with-system-ucpp],
1712 [Use ucpp already on system.]),,
1715 AC_ARG_WITH(system-openldap,
1716 AS_HELP_STRING([--with-system-openldap],
1717 [Use the OpenLDAP LDAP SDK already on system.]),,
1718 [with_system_openldap="$with_system_libs"])
1720 AC_ARG_WITH(system-poppler,
1721 AS_HELP_STRING([--with-system-poppler],
1722 [Use system poppler (only needed for PDF import).]),,
1723 [with_system_poppler="$with_system_libs"])
1725 AC_ARG_WITH(system-gpgmepp,
1726 AS_HELP_STRING([--with-system-gpgmepp],
1727 [Use gpgmepp already on system]),,
1728 [with_system_gpgmepp="$with_system_libs"])
1730 AC_ARG_WITH(system-apache-commons,
1731 AS_HELP_STRING([--with-system-apache-commons],
1732 [Use Apache commons libraries already on system.]),,
1733 [with_system_apache_commons="$with_system_jars"])
1735 AC_ARG_WITH(system-mariadb,
1736 AS_HELP_STRING([--with-system-mariadb],
1737 [Use MariaDB/MySQL libraries already on system.]),,
1738 [with_system_mariadb="$with_system_libs"])
1740 AC_ARG_ENABLE(bundle-mariadb,
1741 AS_HELP_STRING([--enable-bundle-mariadb],
1742 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
1745 AC_ARG_WITH(system-postgresql,
1746 AS_HELP_STRING([--with-system-postgresql],
1747 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1748 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1749 [with_system_postgresql="$with_system_libs"])
1751 AC_ARG_WITH(libpq-path,
1752 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1753 [Use this PostgreSQL C interface (libpq) installation for building
1754 the PostgreSQL-SDBC extension.]),
1757 AC_ARG_WITH(system-firebird,
1758 AS_HELP_STRING([--with-system-firebird],
1759 [Use Firebird libraries already on system, for building the Firebird-SDBC
1760 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1761 [with_system_firebird="$with_system_libs"])
1763 AC_ARG_WITH(system-libtommath,
1764 AS_HELP_STRING([--with-system-libtommath],
1765 [Use libtommath already on system]),,
1766 [with_system_libtommath="$with_system_libs"])
1768 AC_ARG_WITH(system-hsqldb,
1769 AS_HELP_STRING([--with-system-hsqldb],
1770 [Use hsqldb already on system.]))
1772 AC_ARG_WITH(hsqldb-jar,
1773 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1774 [Specify path to jarfile manually.]),
1775 HSQLDB_JAR=$withval)
1777 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1778 AS_HELP_STRING([--disable-scripting-beanshell],
1779 [Disable support for scripts in BeanShell.]),
1783 AC_ARG_WITH(system-beanshell,
1784 AS_HELP_STRING([--with-system-beanshell],
1785 [Use beanshell already on system.]),,
1786 [with_system_beanshell="$with_system_jars"])
1788 AC_ARG_WITH(beanshell-jar,
1789 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1790 [Specify path to jarfile manually.]),
1793 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1794 AS_HELP_STRING([--disable-scripting-javascript],
1795 [Disable support for scripts in JavaScript.]),
1799 AC_ARG_WITH(system-rhino,
1800 AS_HELP_STRING([--with-system-rhino],
1801 [Use rhino already on system.]),,)
1802 # [with_system_rhino="$with_system_jars"])
1803 # Above is not used as we have different debug interface
1804 # patched into internal rhino. This code needs to be fixed
1805 # before we can enable it by default.
1807 AC_ARG_WITH(rhino-jar,
1808 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1809 [Specify path to jarfile manually.]),
1812 AC_ARG_WITH(commons-logging-jar,
1813 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1814 [Specify path to jarfile manually.]),
1815 COMMONS_LOGGING_JAR=$withval)
1817 AC_ARG_WITH(system-jfreereport,
1818 AS_HELP_STRING([--with-system-jfreereport],
1819 [Use JFreeReport already on system.]),,
1820 [with_system_jfreereport="$with_system_jars"])
1822 AC_ARG_WITH(sac-jar,
1823 AS_HELP_STRING([--with-sac-jar=JARFILE],
1824 [Specify path to jarfile manually.]),
1827 AC_ARG_WITH(libxml-jar,
1828 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1829 [Specify path to jarfile manually.]),
1830 LIBXML_JAR=$withval)
1832 AC_ARG_WITH(flute-jar,
1833 AS_HELP_STRING([--with-flute-jar=JARFILE],
1834 [Specify path to jarfile manually.]),
1837 AC_ARG_WITH(jfreereport-jar,
1838 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1839 [Specify path to jarfile manually.]),
1840 JFREEREPORT_JAR=$withval)
1842 AC_ARG_WITH(liblayout-jar,
1843 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1844 [Specify path to jarfile manually.]),
1845 LIBLAYOUT_JAR=$withval)
1847 AC_ARG_WITH(libloader-jar,
1848 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1849 [Specify path to jarfile manually.]),
1850 LIBLOADER_JAR=$withval)
1852 AC_ARG_WITH(libformula-jar,
1853 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1854 [Specify path to jarfile manually.]),
1855 LIBFORMULA_JAR=$withval)
1857 AC_ARG_WITH(librepository-jar,
1858 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1859 [Specify path to jarfile manually.]),
1860 LIBREPOSITORY_JAR=$withval)
1862 AC_ARG_WITH(libfonts-jar,
1863 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1864 [Specify path to jarfile manually.]),
1865 LIBFONTS_JAR=$withval)
1867 AC_ARG_WITH(libserializer-jar,
1868 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1869 [Specify path to jarfile manually.]),
1870 LIBSERIALIZER_JAR=$withval)
1872 AC_ARG_WITH(libbase-jar,
1873 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1874 [Specify path to jarfile manually.]),
1875 LIBBASE_JAR=$withval)
1877 AC_ARG_WITH(system-odbc,
1878 AS_HELP_STRING([--with-system-odbc],
1879 [Use the odbc headers already on system.]),,
1880 [with_system_odbc="auto"])
1882 AC_ARG_WITH(system-sane,
1883 AS_HELP_STRING([--with-system-sane],
1884 [Use sane.h already on system.]),,
1885 [with_system_sane="$with_system_headers"])
1887 AC_ARG_WITH(system-bluez,
1888 AS_HELP_STRING([--with-system-bluez],
1889 [Use bluetooth.h already on system.]),,
1890 [with_system_bluez="$with_system_headers"])
1892 AC_ARG_WITH(system-curl,
1893 AS_HELP_STRING([--with-system-curl],
1894 [Use curl already on system.]),,
1895 [with_system_curl=auto])
1897 AC_ARG_WITH(system-boost,
1898 AS_HELP_STRING([--with-system-boost],
1899 [Use boost already on system.]),,
1900 [with_system_boost="$with_system_headers"])
1902 AC_ARG_WITH(system-glm,
1903 AS_HELP_STRING([--with-system-glm],
1904 [Use glm already on system.]),,
1905 [with_system_glm="$with_system_headers"])
1907 AC_ARG_WITH(system-hunspell,
1908 AS_HELP_STRING([--with-system-hunspell],
1909 [Use libhunspell already on system.]),,
1910 [with_system_hunspell="$with_system_libs"])
1912 AC_ARG_WITH(system-mythes,
1913 AS_HELP_STRING([--with-system-mythes],
1914 [Use mythes already on system.]),,
1915 [with_system_mythes="$with_system_libs"])
1917 AC_ARG_WITH(system-altlinuxhyph,
1918 AS_HELP_STRING([--with-system-altlinuxhyph],
1919 [Use ALTLinuxhyph already on system.]),,
1920 [with_system_altlinuxhyph="$with_system_libs"])
1922 AC_ARG_WITH(system-lpsolve,
1923 AS_HELP_STRING([--with-system-lpsolve],
1924 [Use lpsolve already on system.]),,
1925 [with_system_lpsolve="$with_system_libs"])
1927 AC_ARG_WITH(system-coinmp,
1928 AS_HELP_STRING([--with-system-coinmp],
1929 [Use CoinMP already on system.]),,
1930 [with_system_coinmp="$with_system_libs"])
1932 AC_ARG_WITH(system-liblangtag,
1933 AS_HELP_STRING([--with-system-liblangtag],
1934 [Use liblangtag library already on system.]),,
1935 [with_system_liblangtag="$with_system_libs"])
1938 AS_HELP_STRING([--with-webdav],
1939 [Specify which library to use for webdav implementation.
1940 Possible values: "neon", "serf", "no". The default value is "neon".
1941 Example: --with-webdav="serf"]),
1942 WITH_WEBDAV=$withval,
1945 AC_ARG_WITH(linker-hash-style,
1946 AS_HELP_STRING([--with-linker-hash-style],
1947 [Use linker with --hash-style=<style> when linking shared objects.
1948 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1949 if supported on the build system, and "sysv" otherwise.]))
1951 AC_ARG_WITH(jdk-home,
1952 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
1953 [If you have installed JDK 1.6 or later on your system please supply the
1954 path here. Note that this is not the location of the java command but the
1955 location of the entire distribution.]),
1959 AS_HELP_STRING([--with-help],
1960 [Enable the build of help. There is a special parameter "common" that
1961 can be used to bundle only the common part, .e.g help-specific icons.
1962 This is useful when you build the helpcontent separately.])
1964 Usage: --with-help build the old local help
1965 --without-help no local help (default)
1966 --with-help=html build the new HTML local help
1967 --with-help=online build the new HTML online help
1971 libo_FUZZ_ARG_WITH(java,
1972 AS_HELP_STRING([--with-java=<java command>],
1973 [Specify the name of the Java interpreter command. Typically "java"
1974 which is the default.
1976 To build without support for Java components, applets, accessibility
1977 or the XML filters written in Java, use --without-java or --with-java=no.]),
1978 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1979 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
1982 AC_ARG_WITH(jvm-path,
1983 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
1984 [Use a specific JVM search path at runtime.
1985 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
1988 AC_ARG_WITH(ant-home,
1989 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
1990 [If you have installed Jakarta Ant on your system, please supply the path here.
1991 Note that this is not the location of the Ant binary but the location
1992 of the entire distribution.]),
1995 AC_ARG_WITH(symbol-config,
1996 AS_HELP_STRING([--with-symbol-config],
1997 [Configuration for the crashreport symbol upload]),
1999 [with_symbol_config=no])
2001 AC_ARG_WITH(export-validation,
2002 AS_HELP_STRING([--without-export-validation],
2003 [Disable validating OOXML and ODF files as exported from in-tree tests.
2004 Use this option e.g. if your system only provides Java 5.]),
2005 ,with_export_validation=auto)
2007 AC_ARG_WITH(bffvalidator,
2008 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2009 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2010 Requires installed Microsoft Office Binary File Format Validator.
2011 Note: export-validation (--with-export-validation) is required to be turned on.
2012 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2013 ,with_bffvalidator=no)
2015 libo_FUZZ_ARG_WITH(junit,
2016 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2017 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2018 --without-junit disables those tests. Not relevant in the --without-java case.]),
2021 AC_ARG_WITH(hamcrest,
2022 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2023 [Specifies the hamcrest jar file to use for JUnit-based tests.
2024 --without-junit disables those tests. Not relevant in the --without-java case.]),
2027 AC_ARG_WITH(perl-home,
2028 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2029 [If you have installed Perl 5 Distribution, on your system, please
2030 supply the path here. Note that this is not the location of the Perl
2031 binary but the location of the entire distribution.]),
2034 libo_FUZZ_ARG_WITH(doxygen,
2036 [--with-doxygen=<absolute path to doxygen executable>],
2037 [Specifies the doxygen executable to use when generating ODK C/C++
2038 documentation. --without-doxygen disables generation of ODK C/C++
2039 documentation. Not relevant in the --disable-odk case.]),
2042 AC_ARG_WITH(visual-studio,
2043 AS_HELP_STRING([--with-visual-studio=<2017>],
2044 [Specify which Visual Studio version to use in case several are
2045 installed. Currently only 2017 is supported.]),
2048 AC_ARG_WITH(windows-sdk,
2049 AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
2050 [Specify which Windows SDK, or "Windows Kit", version to use
2051 in case the one that came with the selected Visual Studio
2052 is not what you want for some reason. Note that not all compiler/SDK
2053 combinations are supported. The intent is that this option should not
2058 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2059 [Use this option to build LibreOffice with additional UI language support.
2060 English (US) is always included by default.
2061 Separate multiple languages with space.
2062 For all languages, use --with-lang=ALL.]),
2065 AC_ARG_WITH(locales,
2066 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2067 [Use this option to limit the locale information built in.
2068 Separate multiple locales with space.
2069 Very experimental and might well break stuff.
2070 Just a desperate measure to shrink code and data size.
2071 By default all the locales available is included.
2072 This option is completely unrelated to --with-lang.])
2074 Affects also our character encoding conversion
2075 tables for encodings mainly targeted for a
2076 particular locale, like EUC-CN and EUC-TW for
2077 zh, ISO-2022-JP for ja.
2079 Affects also our add-on break iterator data for
2082 For the default, all locales, don't use this switch at all.
2083 Specifying just the language part of a locale means all matching
2084 locales will be included.
2088 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2089 libo_FUZZ_ARG_WITH(krb5,
2090 AS_HELP_STRING([--with-krb5],
2091 [Enable MIT Kerberos 5 support in modules that support it.
2092 By default automatically enabled on platforms
2093 where a good system Kerberos 5 is available.]),
2096 libo_FUZZ_ARG_WITH(gssapi,
2097 AS_HELP_STRING([--with-gssapi],
2098 [Enable GSSAPI support in modules that support it.
2099 By default automatically enabled on platforms
2100 where a good system GSSAPI is available.]),
2104 AS_HELP_STRING([--with-iwyu],
2105 [Use given IWYU binary path to check unneeded includes instead of building.
2106 Use only if you are hacking on it.]),
2109 libo_FUZZ_ARG_WITH(lxml,
2110 AS_HELP_STRING([--without-lxml],
2111 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2112 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2113 report widget classes and ids.]),
2116 dnl ===================================================================
2118 dnl ===================================================================
2120 AC_ARG_WITH(branding,
2121 AS_HELP_STRING([--with-branding=/path/to/images],
2122 [Use given path to retrieve branding images set.])
2124 Search for intro.png about.svg and flat_logo.svg.
2125 If any is missing, default ones will be used instead.
2127 Search also progress.conf for progress
2128 settings on intro screen :
2130 PROGRESSBARCOLOR="255,255,255" Set color of
2131 progress bar. Comma separated RGB decimal values.
2132 PROGRESSSIZE="407,6" Set size of progress bar.
2133 Comma separated decimal values (width, height).
2134 PROGRESSPOSITION="61,317" Set position of progress
2135 bar from left,top. Comma separated decimal values.
2136 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2137 bar frame. Comma separated RGB decimal values.
2138 PROGRESSTEXTCOLOR="255,255,255" Set color of progress
2139 bar text. Comma separated RGB decimal values.
2140 PROGRESSTEXTBASELINE="287" Set vertical position of
2141 progress bar text from top. Decimal value.
2143 Default values will be used if not found.
2148 AC_ARG_WITH(extra-buildid,
2149 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2150 [Show addition build identification in about dialog.]),
2155 AS_HELP_STRING([--with-vendor="John the Builder"],
2156 [Set vendor of the build.]),
2159 AC_ARG_WITH(android-package-name,
2160 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2161 [Set Android package name of the build.]),
2164 AC_ARG_WITH(compat-oowrappers,
2165 AS_HELP_STRING([--with-compat-oowrappers],
2166 [Install oo* wrappers in parallel with
2167 lo* ones to keep backward compatibility.
2168 Has effect only with make distro-pack-install]),
2171 AC_ARG_WITH(os-version,
2172 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2173 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2176 AC_ARG_WITH(mingw-cross-compiler,
2177 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2178 [Specify the MinGW cross-compiler to use.
2179 When building on the ODK on Unix and building unowinreg.dll,
2180 specify the MinGW C++ cross-compiler.]),
2183 AC_ARG_WITH(idlc-cpp,
2184 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2185 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2188 AC_ARG_WITH(build-version,
2189 AS_HELP_STRING([--with-build-version="Built by Jim"],
2190 [Allows the builder to add a custom version tag that will appear in the
2191 Help/About box for QA purposes.]),
2192 with_build_version=$withval,
2195 AC_ARG_WITH(parallelism,
2196 AS_HELP_STRING([--with-parallelism],
2197 [Number of jobs to run simultaneously during build. Parallel builds can
2198 save a lot of time on multi-cpu machines. Defaults to the number of
2199 CPUs on the machine, unless you configure --enable-icecream - then to
2203 AC_ARG_WITH(all-tarballs,
2204 AS_HELP_STRING([--with-all-tarballs],
2205 [Download all external tarballs unconditionally]))
2207 AC_ARG_WITH(gdrive-client-id,
2208 AS_HELP_STRING([--with-gdrive-client-id],
2209 [Provides the client id of the application for OAuth2 authentication
2210 on Google Drive. If either this or --with-gdrive-client-secret is
2211 empty, the feature will be disabled]),
2214 AC_ARG_WITH(gdrive-client-secret,
2215 AS_HELP_STRING([--with-gdrive-client-secret],
2216 [Provides the client secret of the application for OAuth2
2217 authentication on Google Drive. If either this or
2218 --with-gdrive-client-id is empty, the feature will be disabled]),
2221 AC_ARG_WITH(alfresco-cloud-client-id,
2222 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2223 [Provides the client id of the application for OAuth2 authentication
2224 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2225 empty, the feature will be disabled]),
2228 AC_ARG_WITH(alfresco-cloud-client-secret,
2229 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2230 [Provides the client secret of the application for OAuth2
2231 authentication on Alfresco Cloud. If either this or
2232 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2235 AC_ARG_WITH(onedrive-client-id,
2236 AS_HELP_STRING([--with-onedrive-client-id],
2237 [Provides the client id of the application for OAuth2 authentication
2238 on OneDrive. If either this or --with-onedrive-client-secret is
2239 empty, the feature will be disabled]),
2242 AC_ARG_WITH(onedrive-client-secret,
2243 AS_HELP_STRING([--with-onedrive-client-secret],
2244 [Provides the client secret of the application for OAuth2
2245 authentication on OneDrive. If either this or
2246 --with-onedrive-client-id is empty, the feature will be disabled]),
2248 dnl ===================================================================
2249 dnl Do we want to use pre-build binary tarball for recompile
2250 dnl ===================================================================
2252 if test "$enable_library_bin_tar" = "yes" ; then
2253 USE_LIBRARY_BIN_TAR=TRUE
2255 USE_LIBRARY_BIN_TAR=
2257 AC_SUBST(USE_LIBRARY_BIN_TAR)
2259 dnl ===================================================================
2260 dnl Test whether build target is Release Build
2261 dnl ===================================================================
2262 AC_MSG_CHECKING([whether build target is Release Build])
2263 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2265 ENABLE_RELEASE_BUILD=
2267 AC_MSG_RESULT([yes])
2268 ENABLE_RELEASE_BUILD=TRUE
2270 AC_SUBST(ENABLE_RELEASE_BUILD)
2272 dnl ===================================================================
2273 dnl Test whether to sign Windows Build
2274 dnl ===================================================================
2275 AC_MSG_CHECKING([whether to sign windows build])
2276 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2277 AC_MSG_RESULT([yes])
2278 WINDOWS_BUILD_SIGNING="TRUE"
2281 WINDOWS_BUILD_SIGNING="FALSE"
2283 AC_SUBST(WINDOWS_BUILD_SIGNING)
2285 dnl ===================================================================
2286 dnl MacOSX build and runtime environment options
2287 dnl ===================================================================
2289 AC_ARG_WITH(macosx-sdk,
2290 AS_HELP_STRING([--with-macosx-sdk=<version>],
2291 [Prefer a specific SDK for building.])
2293 If the requested SDK is not available, a search for the oldest one will be done.
2294 With current Xcode versions, only the latest SDK is included, so this option is
2295 not terribly useful. It works fine to build with a new SDK and run the result
2298 e. g.: --with-macosx-sdk=10.9
2300 there are 3 options to control the MacOSX build:
2301 --with-macosx-sdk (referred as 'sdk' below)
2302 --with-macosx-version-min-required (referred as 'min' below)
2303 --with-macosx-version-max-allowed (referred as 'max' below)
2305 the connection between these value and the default they take is as follow:
2306 ( ? means not specified on the command line, s means the SDK version found,
2307 constraint: 8 <= x <= y <= z)
2309 ==========================================
2310 command line || config result
2311 ==========================================
2312 min | max | sdk || min | max | sdk |
2313 ? | ? | ? || 10.9 | 10.s | 10.s |
2314 ? | ? | 10.x || 10.9 | 10.x | 10.x |
2315 ? | 10.x | ? || 10.9 | 10.s | 10.s |
2316 ? | 10.x | 10.y || 10.9 | 10.x | 10.y |
2317 10.x | ? | ? || 10.x | 10.s | 10.s |
2318 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2319 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2320 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2323 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2324 for a detailed technical explanation of these variables
2326 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2330 AC_ARG_WITH(macosx-version-min-required,
2331 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2332 [set the minimum OS version needed to run the built LibreOffice])
2334 e. g.: --with-macos-version-min-required=10.9
2335 see --with-macosx-sdk for more info
2339 AC_ARG_WITH(macosx-version-max-allowed,
2340 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2341 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2343 e. g.: --with-macos-version-max-allowed=10.9
2344 see --with-macosx-sdk for more info
2349 dnl ===================================================================
2350 dnl options for stuff used during cross-compilation build
2351 dnl Not quite superseded by --with-build-platform-configure-options.
2352 dnl TODO: check, if the "force" option is still needed anywhere.
2353 dnl ===================================================================
2355 AC_ARG_WITH(system-icu-for-build,
2356 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2357 [Use icu already on system for build tools (cross-compilation only).]))
2360 dnl ===================================================================
2361 dnl Check for incompatible options set by fuzzing, and reset those
2362 dnl automatically to working combinations
2363 dnl ===================================================================
2365 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2366 "$enable_dbus" != "$enable_avahi"; then
2367 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2368 enable_avahi=$enable_dbus
2371 dnl ===================================================================
2372 dnl check for required programs (grep, awk, sed, bash)
2373 dnl ===================================================================
2377 if test -n "$1"; then
2378 if test "$build_os" = "cygwin"; then
2379 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2381 new_path=`cygpath -sm "$formatted_path"`
2384 new_path=`cygpath -u "$formatted_path"`
2389 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2390 if test "$2" = "after"; then
2391 LO_PATH="$LO_PATH${P_SEP}$new_path"
2393 LO_PATH="$new_path${P_SEP}$LO_PATH"
2401 AC_PATH_PROG( AWK, $AWK)
2402 if test -z "$AWK"; then
2403 AC_MSG_ERROR([install awk to run this script])
2406 AC_PATH_PROG(BASH, bash)
2407 if test -z "$BASH"; then
2408 AC_MSG_ERROR([bash not found in \$PATH])
2412 AC_MSG_CHECKING([for GNU or BSD tar])
2413 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2414 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2415 if test $? -eq 0; then
2420 AC_MSG_RESULT($GNUTAR)
2421 if test -z "$GNUTAR"; then
2422 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2426 AC_MSG_CHECKING([for tar's option to strip components])
2427 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2428 if test $? -eq 0; then
2429 STRIP_COMPONENTS="--strip-components"
2431 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2432 if test $? -eq 0; then
2433 STRIP_COMPONENTS="--strip-path"
2435 STRIP_COMPONENTS="unsupported"
2438 AC_MSG_RESULT($STRIP_COMPONENTS)
2439 if test x$STRIP_COMPONENTS = xunsupported; then
2440 AC_MSG_ERROR([you need a tar that is able to strip components.])
2442 AC_SUBST(STRIP_COMPONENTS)
2444 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2445 dnl desktop OSes from "mobile" ones.
2447 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2448 dnl In other words, that when building for an OS that is not a
2449 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2451 dnl Note the direction of the implication; there is no assumption that
2452 dnl cross-compiling would imply a non-desktop OS.
2454 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2455 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2456 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2457 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2460 # Whether to build "avmedia" functionality or not.
2462 if test -z "$enable_avmedia"; then
2466 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2467 if test "$enable_avmedia" = yes; then
2468 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2470 USE_AVMEDIA_DUMMY='TRUE'
2472 AC_SUBST(USE_AVMEDIA_DUMMY)
2474 # Decide whether to build database connectivity stuff (including
2475 # Base) or not. We probably don't want to on non-desktop OSes.
2476 if test -z "$enable_database_connectivity"; then
2477 # --disable-database-connectivity is unfinished work in progress
2478 # and the iOS test app doesn't link if we actually try to use it.
2479 # if test $_os != iOS -a $_os != Android; then
2480 if test $_os != iOS; then
2481 enable_database_connectivity=yes
2485 if test "$enable_database_connectivity" = yes; then
2486 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2487 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2490 if test -z "$enable_extensions"; then
2491 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2492 if test $_os != iOS -a $_os != Android; then
2493 enable_extensions=yes
2497 if test "$enable_extensions" = yes; then
2498 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2499 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2502 if test -z "$enable_scripting"; then
2503 # Disable scripting for iOS unless specifically overridden
2504 # with --enable-scripting.
2505 if test $_os != iOS; then
2506 enable_scripting=yes
2510 DISABLE_SCRIPTING=''
2511 if test "$enable_scripting" = yes; then
2512 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2513 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2515 DISABLE_SCRIPTING='TRUE'
2516 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2519 if test $_os = iOS -o $_os = Android; then
2520 # Disable dynamic_loading always for iOS and Android
2521 enable_dynamic_loading=no
2522 elif test -z "$enable_dynamic_loading"; then
2523 # Otherwise enable it unless speficically disabled
2524 enable_dynamic_loading=yes
2527 DISABLE_DYNLOADING=''
2528 if test "$enable_dynamic_loading" = yes; then
2529 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2531 DISABLE_DYNLOADING='TRUE'
2533 AC_SUBST(DISABLE_DYNLOADING)
2535 # remenber SYSBASE value
2538 dnl ===================================================================
2539 dnl Sort out various gallery compilation options
2540 dnl ===================================================================
2541 AC_MSG_CHECKING([how to build and package galleries])
2542 if test -n "${with_galleries}"; then
2543 if test "$with_galleries" = "build"; then
2544 WITH_GALLERY_BUILD=TRUE
2545 AC_MSG_RESULT([build from source images internally])
2546 elif test "$with_galleries" = "no"; then
2548 AC_MSG_RESULT([disable non-internal gallery build])
2550 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2553 if test $_os != iOS -a $_os != Android; then
2554 WITH_GALLERY_BUILD=TRUE
2555 AC_MSG_RESULT([internal src images for desktop])
2558 AC_MSG_RESULT([disable src image build])
2561 AC_SUBST(WITH_GALLERY_BUILD)
2563 dnl ===================================================================
2564 dnl Checks if ccache is available
2565 dnl ===================================================================
2566 if test "$_os" = "WINNT"; then
2567 # on windows/VC build do not use ccache
2569 elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2570 case "%$CC%$CXX%" in
2571 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2572 # assume that's good then
2573 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2574 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2577 AC_PATH_PROG([CCACHE],[ccache],[not found])
2578 if test "$CCACHE" = "not found"; then
2581 # Need to check for ccache version: otherwise prevents
2582 # caching of the results (like "-x objective-c++" for Mac)
2583 if test $_os = Darwin -o $_os = iOS; then
2584 # Check ccache version
2585 AC_MSG_CHECKING([whether version of ccache is suitable])
2586 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2587 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2588 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2589 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2591 AC_MSG_RESULT([no, $CCACHE_VERSION])
2602 if test "$CCACHE" != ""; then
2603 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2604 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2605 if test "$ccache_size" = ""; then
2606 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2607 if test "$ccache_size" = ""; then
2610 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2611 if test $ccache_size -lt 1024; then
2613 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2614 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2616 # warn that ccache may be too small for debug build
2617 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2618 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2621 if test $ccache_size -lt 5; then
2622 #warn that ccache may be too small for debug build
2623 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2624 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2629 dnl ===================================================================
2630 dnl Checks for C compiler,
2631 dnl The check for the C++ compiler is later on.
2632 dnl ===================================================================
2633 if test "$_os" != "WINNT"; then
2635 AC_MSG_CHECKING([gcc home])
2636 if test -z "$with_gcc_home"; then
2637 if test "$enable_icecream" = "yes"; then
2638 if test -d "/usr/lib/icecc/bin"; then
2639 GCC_HOME="/usr/lib/icecc/"
2640 elif test -d "/usr/libexec/icecc/bin"; then
2641 GCC_HOME="/usr/libexec/icecc/"
2642 elif test -d "/opt/icecream/bin"; then
2643 GCC_HOME="/opt/icecream/"
2645 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
2649 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2650 GCC_HOME_SET="false"
2653 GCC_HOME="$with_gcc_home"
2655 AC_MSG_RESULT($GCC_HOME)
2658 if test "$GCC_HOME_SET" = "true"; then
2659 if test -z "$CC"; then
2660 CC="$GCC_HOME/bin/gcc"
2662 if test -z "$CXX"; then
2663 CXX="$GCC_HOME/bin/g++"
2668 COMPATH=`dirname "$CC"`
2669 if test "$COMPATH" = "."; then
2670 AC_PATH_PROGS(COMPATH, $CC)
2671 dnl double square bracket to get single because of M4 quote...
2672 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2674 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2676 dnl ===================================================================
2678 dnl ===================================================================
2679 AC_MSG_CHECKING([whether to build with Java support])
2680 if test "$with_java" != "no"; then
2681 if test "$DISABLE_SCRIPTING" = TRUE; then
2682 AC_MSG_RESULT([no, overridden by --disable-scripting])
2686 AC_MSG_RESULT([yes])
2688 AC_DEFINE(HAVE_FEATURE_JAVA)
2695 AC_SUBST(ENABLE_JAVA)
2697 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2699 dnl ENABLE_JAVA="" indicate no Java support at all
2701 dnl ===================================================================
2702 dnl Check OS X SDK and compiler
2703 dnl ===================================================================
2705 if test $_os = Darwin -o $_os = iOS; then
2707 # If no --with-macosx-sdk option is given, look for one
2709 # The intent is that for "most" Mac-based developers, a suitable
2710 # SDK will be found automatically without any configure options.
2712 # For developers with a current Xcode, the lowest-numbered SDK
2713 # higher than or equal to the minimum required should be found.
2715 AC_MSG_CHECKING([what Mac OS X SDK to use])
2716 for _macosx_sdk in $with_macosx_sdk 10.13 10.12; do
2717 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2718 if test -d "$MACOSX_SDK_PATH"; then
2719 with_macosx_sdk="${_macosx_sdk}"
2722 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2723 if test -d "$MACOSX_SDK_PATH"; then
2724 with_macosx_sdk="${_macosx_sdk}"
2729 if test ! -d "$MACOSX_SDK_PATH"; then
2730 AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2733 if test $_os = iOS; then
2734 if test "$enable_ios_simulator" = "yes"; then
2735 useos=iphonesimulator
2739 MACOSX_SDK_PATH=`xcrun --sdk ${useos} --show-sdk-path 2> /dev/null`
2741 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2744 case $with_macosx_sdk in
2746 MACOSX_SDK_VERSION=1090
2749 MACOSX_SDK_VERSION=101000
2752 MACOSX_SDK_VERSION=101100
2755 MACOSX_SDK_VERSION=101200
2758 MACOSX_SDK_VERSION=101300
2761 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.9--13])
2765 if test "$with_macosx_version_min_required" = "" ; then
2766 with_macosx_version_min_required="10.9";
2769 if test "$with_macosx_version_max_allowed" = "" ; then
2770 with_macosx_version_max_allowed="$with_macosx_sdk"
2773 # export this so that "xcrun" invocations later return matching values
2774 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2775 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2776 export DEVELOPER_DIR
2777 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2778 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2780 case "$with_macosx_version_min_required" in
2782 MAC_OS_X_VERSION_MIN_REQUIRED="1090"
2785 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2788 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2791 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2794 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2797 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.9--13])
2800 MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
2802 LIBTOOL=/usr/bin/libtool
2803 INSTALL_NAME_TOOL=install_name_tool
2804 if test -z "$save_CC"; then
2805 AC_MSG_CHECKING([what compiler to use])
2806 stdlib=-stdlib=libc++
2807 if test "$ENABLE_LTO" = TRUE; then
2810 CC="`xcrun -find clang` -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2811 CXX="`xcrun -find clang++` -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2812 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2815 STRIP=`xcrun -find strip`
2816 LIBTOOL=`xcrun -find libtool`
2817 RANLIB=`xcrun -find ranlib`
2818 AC_MSG_RESULT([$CC and $CXX])
2821 case "$with_macosx_version_max_allowed" in
2823 MAC_OS_X_VERSION_MAX_ALLOWED="1090"
2826 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2829 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2832 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2835 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2838 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.9--13])
2842 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2843 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2844 AC_MSG_RESULT([$MAC_OS_X_VERSION_MIN_REQUIRED])
2845 AC_MSG_RESULT([$MAC_OS_X_VERSION_MAX_REQUIRED])
2846 AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2851 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2852 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2853 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2857 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2858 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2860 AC_MSG_CHECKING([whether to do code signing])
2862 if test "$enable_macosx_code_signing" = yes; then
2863 # By default use the first suitable certificate (?).
2865 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2866 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2867 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2868 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2869 # "Developer ID Application" one.
2871 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2872 if test -n "$identity"; then
2873 MACOSX_CODESIGNING_IDENTITY=$identity
2874 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2875 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2877 AC_MSG_ERROR([cannot determine identity to use])
2879 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2880 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2881 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2882 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2887 AC_MSG_CHECKING([whether to create a Mac App Store package])
2889 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2890 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2891 elif test "$enable_macosx_package_signing" = yes; then
2892 # By default use the first suitable certificate.
2893 # It should be a "3rd Party Mac Developer Installer" one
2895 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2896 if test -n "$identity"; then
2897 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2898 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2899 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2901 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2903 elif test -n "$enable_macosx_package_signing"; then
2904 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2905 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2906 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2911 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2912 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2915 AC_MSG_CHECKING([whether to sandbox the application])
2917 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2918 AC_MSG_ERROR([OS X sandboxing requires code signing])
2919 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
2920 AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
2921 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2922 ENABLE_MACOSX_SANDBOX=TRUE
2923 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
2924 AC_MSG_RESULT([yes])
2929 AC_MSG_CHECKING([what OS X app bundle identifier to use])
2930 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
2931 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
2933 AC_SUBST(MACOSX_SDK_PATH)
2934 AC_SUBST(MACOSX_SDK_VERSION)
2935 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2936 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2937 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
2938 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2939 AC_SUBST(INSTALL_NAME_TOOL)
2940 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
2941 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2942 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
2943 AC_SUBST(ENABLE_MACOSX_SANDBOX)
2944 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
2946 dnl ===================================================================
2947 dnl Check iOS SDK and compiler
2948 dnl ===================================================================
2950 if test $_os = iOS; then
2951 AC_MSG_CHECKING([what iOS SDK to use])
2952 current_sdk_ver=11.4
2953 if test "$enable_ios_simulator" = "yes"; then
2954 platform=iPhoneSimulator
2955 versionmin=-mios-simulator-version-min=$current_sdk_ver
2958 versionmin=-miphoneos-version-min=$current_sdk_ver
2960 xcode_developer=`xcode-select -print-path`
2962 for sdkver in $current_sdk_ver; do
2963 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
2971 if test -z "$sysroot"; then
2972 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
2975 AC_MSG_RESULT($sysroot)
2977 IOS_SDK=`echo $platform | tr A-Z a-z`$ios_sdk
2978 IOS_DEPLOYMENT_VERSION=$current_sdk_ver
2980 # LTO is not really recommended for iOS builds,
2981 # the link time will be astronomical
2982 if test "$ENABLE_LTO" = TRUE; then
2986 stdlib="-stdlib=libc++"
2988 CC="`xcrun -find clang` -arch $host_cpu -isysroot $sysroot $lto $versionmin"
2989 CXX="`xcrun -find clang++` -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
2991 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2994 STRIP=`xcrun -find strip`
2995 LIBTOOL=`xcrun -find libtool`
2996 RANLIB=`xcrun -find ranlib`
3000 AC_SUBST(IOS_DEPLOYMENT_VERSION)
3002 AC_MSG_CHECKING([whether to treat the installation as read-only])
3004 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3005 "$enable_extensions" != yes; then
3006 enable_readonly_installset=yes
3008 if test "$enable_readonly_installset" = yes; then
3009 AC_MSG_RESULT([yes])
3010 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3015 dnl ===================================================================
3016 dnl Structure of install set
3017 dnl ===================================================================
3019 if test $_os = Darwin; then
3020 LIBO_BIN_FOLDER=MacOS
3021 LIBO_ETC_FOLDER=Resources
3022 LIBO_LIBEXEC_FOLDER=MacOS
3023 LIBO_LIB_FOLDER=Frameworks
3024 LIBO_LIB_PYUNO_FOLDER=Resources
3025 LIBO_SHARE_FOLDER=Resources
3026 LIBO_SHARE_HELP_FOLDER=Resources/help
3027 LIBO_SHARE_JAVA_FOLDER=Resources/java
3028 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3029 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3030 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3031 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3032 LIBO_URE_BIN_FOLDER=MacOS
3033 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3034 LIBO_URE_LIB_FOLDER=Frameworks
3035 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3036 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3037 elif test $_os = WINNT; then
3038 LIBO_BIN_FOLDER=program
3039 LIBO_ETC_FOLDER=program
3040 LIBO_LIBEXEC_FOLDER=program
3041 LIBO_LIB_FOLDER=program
3042 LIBO_LIB_PYUNO_FOLDER=program
3043 LIBO_SHARE_FOLDER=share
3044 LIBO_SHARE_HELP_FOLDER=help
3045 LIBO_SHARE_JAVA_FOLDER=program/classes
3046 LIBO_SHARE_PRESETS_FOLDER=presets
3047 LIBO_SHARE_READMES_FOLDER=readmes
3048 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3049 LIBO_SHARE_SHELL_FOLDER=program/shell
3050 LIBO_URE_BIN_FOLDER=program
3051 LIBO_URE_ETC_FOLDER=program
3052 LIBO_URE_LIB_FOLDER=program
3053 LIBO_URE_MISC_FOLDER=program
3054 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3056 LIBO_BIN_FOLDER=program
3057 LIBO_ETC_FOLDER=program
3058 LIBO_LIBEXEC_FOLDER=program
3059 LIBO_LIB_FOLDER=program
3060 LIBO_LIB_PYUNO_FOLDER=program
3061 LIBO_SHARE_FOLDER=share
3062 LIBO_SHARE_HELP_FOLDER=help
3063 LIBO_SHARE_JAVA_FOLDER=program/classes
3064 LIBO_SHARE_PRESETS_FOLDER=presets
3065 LIBO_SHARE_READMES_FOLDER=readmes
3066 if test "$enable_fuzzers" != yes; then
3067 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3069 LIBO_SHARE_RESOURCE_FOLDER=resource
3071 LIBO_SHARE_SHELL_FOLDER=program/shell
3072 LIBO_URE_BIN_FOLDER=program
3073 LIBO_URE_ETC_FOLDER=program
3074 LIBO_URE_LIB_FOLDER=program
3075 LIBO_URE_MISC_FOLDER=program
3076 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3078 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3079 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3080 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3081 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3082 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3083 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3084 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3085 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3086 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3087 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3088 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3089 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3090 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3091 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3092 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3093 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3095 # Not all of them needed in config_host.mk, add more if need arises
3096 AC_SUBST(LIBO_BIN_FOLDER)
3097 AC_SUBST(LIBO_ETC_FOLDER)
3098 AC_SUBST(LIBO_LIB_FOLDER)
3099 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3100 AC_SUBST(LIBO_SHARE_FOLDER)
3101 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3102 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3103 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3104 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3105 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3106 AC_SUBST(LIBO_URE_BIN_FOLDER)
3107 AC_SUBST(LIBO_URE_ETC_FOLDER)
3108 AC_SUBST(LIBO_URE_LIB_FOLDER)
3109 AC_SUBST(LIBO_URE_MISC_FOLDER)
3110 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3112 dnl ===================================================================
3113 dnl Windows specific tests and stuff
3114 dnl ===================================================================
3118 # Return value: $regvalue
3121 local _regentry="/proc/registry${1}/${2}"
3122 if test -f "$_regentry"; then
3123 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3124 # Registry keys read via /proc/registry* are always \0 terminated!
3125 local _regvalue=$(tr -d '\0' < "$_regentry")
3126 if test $? -eq 0; then
3132 # Get a value from the 32-bit side of the Registry
3135 reg_get_value "32" "$1"
3138 # Get a value from the 64-bit side of the Registry
3141 reg_get_value "64" "$1"
3144 if test "$_os" = "WINNT"; then
3145 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3146 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3148 WINDOWS_SDK_ARCH="x86"
3150 AC_MSG_RESULT([yes])
3151 WINDOWS_SDK_ARCH="x64"
3155 if test "$_os" = "iOS"; then
3156 cross_compiling="yes"
3159 if test "$cross_compiling" = "yes"; then
3160 export CROSS_COMPILING=TRUE
3163 BUILD_TYPE="$BUILD_TYPE NATIVE"
3165 AC_SUBST(CROSS_COMPILING)
3168 if test -n "$enable_ld" -a "$enable_ld" != "no"; then
3169 AC_MSG_CHECKING([for -fuse-ld=$enable_ld linker support])
3170 if test "$GCC" = "yes"; then
3171 ldflags_save=$LDFLAGS
3172 LDFLAGS="$LDFLAGS -fuse-ld=$enable_ld"
3173 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3176 printf ("hello world\n");
3177 ])], USE_LD=$enable_ld, [])
3178 if test -n "$USE_LD"; then
3179 AC_MSG_RESULT( yes )
3180 LDFLAGS="$ldflags_save -fuse-ld=$enable_ld"
3185 AC_MSG_ERROR( not supported )
3191 if test "$enable_gdb_index" = "yes"; then
3192 AC_MSG_CHECKING([whether $CC supports -ggnu-pubnames])
3194 CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
3195 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ AC_MSG_RESULT( yes )],[ AC_MSG_ERROR( no )])
3197 AC_MSG_CHECKING([whether $CC supports -Wl,--gdb-index])
3198 ldflags_save=$LDFLAGS
3199 LDFLAGS="$LDFLAGS -Wl,--gdb-index"
3200 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3203 printf ("hello world\n");
3204 ])], ENABLE_GDB_INDEX=TRUE, [])
3205 if test "$ENABLE_GDB_INDEX" = "TRUE"; then
3206 AC_MSG_RESULT( yes )
3211 LDFLAGS=$ldflags_save
3213 AC_SUBST(ENABLE_GDB_INDEX)
3215 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3216 if test "$GCC" = "yes"; then
3217 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
3218 bsymbolic_functions_ldflags_save=$LDFLAGS
3219 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
3220 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3223 printf ("hello world\n");
3224 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3225 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3226 AC_MSG_RESULT( found )
3228 AC_MSG_RESULT( not found )
3230 LDFLAGS=$bsymbolic_functions_ldflags_save
3232 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3234 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
3235 # NOTE: must _not_ be used for bundled external libraries!
3237 if test "$GCC" = "yes"; then
3238 AC_MSG_CHECKING( for -isystem )
3240 CFLAGS="$CFLAGS -Werror"
3241 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3243 if test -n "$ISYSTEM"; then
3249 if test -z "$ISYSTEM"; then
3250 # fall back to using -I
3255 dnl ===================================================================
3256 dnl Check which Visual Studio compiler is used
3257 dnl ===================================================================
3259 map_vs_year_to_version()
3261 # Return value: $vsversion
3269 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3273 vs_versions_to_check()
3275 # Args: $1 (optional) : versions to check, in the order of preference
3276 # Return value: $vsversions
3280 if test -n "$1"; then
3281 map_vs_year_to_version "$1"
3282 vsversions=$vsversion
3284 # We accept only 2017
3289 win_get_env_from_vsvars32bat()
3291 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3292 # Also seems to be located in another directory under the same name: vsvars32.bat
3293 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3294 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3295 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3296 chmod +x $WRAPPERBATCHFILEPATH
3297 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3298 rm -f $WRAPPERBATCHFILEPATH
3299 printf '%s' "$_win_get_env_from_vsvars32bat"
3304 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3305 if test -n "$regvalue"; then
3306 PathFormat "$regvalue"
3307 UCRTSDKDIR=$formatted_path
3308 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3309 UCRTVERSION=$regvalue
3311 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3315 if test -z "$UCRTSDKDIR"; then
3316 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3317 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3318 if test -f "$ide_env_file"; then
3319 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3320 UCRTSDKDIR=$formatted_path
3321 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3322 dnl Hack needed at least by tml:
3323 if test "$UCRTVERSION" = 10.0.15063.0 \
3324 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3325 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3327 UCRTVERSION=10.0.14393.0
3330 AC_MSG_ERROR([No UCRT found])
3337 # Find Visual C++ 2017
3338 # Args: $1 (optional) : The VS version year
3339 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3341 unset vctest vcnum vcnumwithdot vcbuildnumber
3343 vs_versions_to_check "$1"
3345 for ver in $vsversions; do
3346 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3347 if test -n "$regvalue"; then
3351 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver
3352 if test -n "$regvalue"; then
3353 AC_MSG_RESULT([found: $regvalue])
3354 PathFormat "$regvalue"
3355 vctest=$formatted_path
3359 if test -n "$vctest"; then
3361 case "$vcnumwithdot" in
3365 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3374 if test "$_os" = "WINNT"; then
3375 AC_MSG_CHECKING([Visual C++])
3377 find_msvc "$with_visual_studio"
3378 if test -z "$vctest"; then
3379 if test -n "$with_visual_studio"; then
3380 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3382 AC_MSG_ERROR([No Visual Studio 2017 installation found])
3386 if test "$BITNESS_OVERRIDE" = ""; then
3387 if test -f "$vctest/bin/cl.exe"; then
3388 VC_PRODUCT_DIR=$vctest
3389 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3390 VC_PRODUCT_DIR=$vctest/VC
3392 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3395 if test -f "$vctest/bin/amd64/cl.exe"; then
3396 VC_PRODUCT_DIR=$vctest
3397 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3398 VC_PRODUCT_DIR=$vctest/VC
3400 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])
3404 AC_MSG_CHECKING([for short pathname of VC product directory])
3405 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3406 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3411 AC_MSG_CHECKING([for UCRT location])
3413 # find_ucrt errors out if it doesn't find it
3414 AC_MSG_RESULT([found])
3415 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3416 ucrtincpath_formatted=$formatted_path
3417 # SOLARINC is used for external modules and must be set too.
3418 # And no, it's not sufficient to set SOLARINC only, as configure
3419 # itself doesn't honour it.
3420 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3421 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3422 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3423 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3425 AC_SUBST(UCRTSDKDIR)
3426 AC_SUBST(UCRTVERSION)
3428 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3429 # Find the proper version of MSBuild.exe to use based on the VS version
3430 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3431 if test -n "$regvalue" ; then
3432 AC_MSG_RESULT([found: $regvalue])
3433 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3435 if test "$BITNESS_OVERRIDE" = ""; then
3436 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3438 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3440 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3441 AC_MSG_RESULT([$regvalue])
3444 # Find the version of devenv.exe
3445 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3446 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3447 if test ! -e "$DEVENV"; then
3448 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3451 dnl ===========================================================
3452 dnl Check for the corresponding mspdb*.dll
3453 dnl ===========================================================
3459 if test "$BITNESS_OVERRIDE" = ""; then
3460 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86"
3461 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX86/x86
3463 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64"
3464 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX64/x64
3467 # MSVC 15.0 has libraries from 14.0?
3470 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3471 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3474 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3475 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3477 dnl The path needs to be added before cl is called
3478 PATH="$MSPDB_PATH:$PATH"
3480 AC_MSG_CHECKING([cl.exe])
3482 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3483 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3484 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3487 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3488 dnl needed when building CLR code:
3489 if test -z "$MSVC_CXX"; then
3490 if test "$BITNESS_OVERRIDE" = ""; then
3491 if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
3492 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
3495 if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
3496 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
3500 # This gives us a posix path with 8.3 filename restrictions
3501 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3504 if test -z "$CC"; then
3507 if test "$BITNESS_OVERRIDE" = ""; then
3508 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3509 MSVC_CXX="$MSVC_CXX -arch:SSE"
3512 if test -n "$CC"; then
3513 # Remove /cl.exe from CC case insensitive
3514 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3515 if test "$BITNESS_OVERRIDE" = ""; then
3516 COMPATH="$VC_PRODUCT_DIR"
3518 if test -n "$VC_PRODUCT_DIR"; then
3519 COMPATH=$VC_PRODUCT_DIR
3522 if test "$BITNESS_OVERRIDE" = ""; then
3523 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3527 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3529 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3531 PathFormat "$COMPATH"
3532 COMPATH="$formatted_path"
3537 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3538 # are always "better", we list them in reverse chronological order.
3543 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
3547 # The expectation is that --with-windows-sdk should not need to be used
3548 if test -n "$with_windows_sdk"; then
3549 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3550 *" "$with_windows_sdk" "*)
3551 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3554 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3559 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3564 AC_MSG_ERROR([Visual C++ not found after all, huh])
3567 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3568 # version of the Explorer extension (and maybe other small
3569 # bits, too) needed when installing a 32-bit LibreOffice on a
3570 # 64-bit OS. The 64-bit Explorer extension is a feature that
3571 # has been present since long in OOo. Don't confuse it with
3572 # building LibreOffice itself as 64-bit code.
3578 if test "$BITNESS_OVERRIDE" = ""; then
3579 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3580 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3581 # Prefer native x64 compiler to cross-compiler, in case we are running
3582 # the build on a 64-bit OS.
3583 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3585 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3586 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3587 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3589 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3590 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3592 elif test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib"; then
3593 # nobody uses 32-bit OS to build, just pick the 64-bit compiler
3594 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3596 CXX_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"
3597 LINK_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/link.exe"
3600 if test "$BUILD_X64" = TRUE; then
3601 AC_MSG_RESULT([found])
3603 AC_MSG_RESULT([not found])
3604 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3609 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3610 AC_SUBST(CXX_X64_BINARY)
3611 AC_SUBST(LINK_X64_BINARY)
3615 PathFormat "$MSPDB_PATH"
3616 MSPDB_PATH="$formatted_path"
3622 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3623 AC_SUBST(UNOWINREG_DLL)
3626 AC_MSG_CHECKING([whether the compiler is actually Clang])
3627 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3633 [AC_MSG_RESULT([yes])
3635 [AC_MSG_RESULT([no])])
3638 if test "$COM_IS_CLANG" = TRUE; then
3639 AC_MSG_CHECKING([the Clang version])
3640 if test "$_os" = WINNT; then
3641 dnl In which case, assume clang-cl:
3643 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3651 CC_PLAIN="$CC_PLAIN $i"
3658 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
3659 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3660 CLANGVER=`echo $clang_version \
3661 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3662 AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3663 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3664 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3666 AC_SUBST(COM_IS_CLANG)
3669 SHOWINCLUDES_PREFIX=
3670 if test "$_os" = WINNT; then
3671 dnl We need to guess the prefix of the -showIncludes output, it can be
3673 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3674 echo "#include <stdlib.h>" > conftest.c
3675 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3676 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3677 rm -f conftest.c conftest.obj
3678 if test -z "$SHOWINCLUDES_PREFIX"; then
3679 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3681 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3684 AC_SUBST(SHOWINCLUDES_PREFIX)
3687 # prefix C with ccache if needed
3689 if test "$CCACHE" != ""; then
3690 AC_MSG_CHECKING([whether $CC is already ccached])
3694 CFLAGS="$CFLAGS --ccache-skip -O2"
3695 dnl an empty program will do, we're checking the compiler flags
3696 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3697 [use_ccache=yes], [use_ccache=no])
3698 if test $use_ccache = yes; then
3699 AC_MSG_RESULT([yes])
3708 # ===================================================================
3709 # check various GCC options that Clang does not support now but maybe
3710 # will somewhen in the future, check them even for GCC, so that the
3712 # ===================================================================
3715 HAVE_GCC_FINLINE_LIMIT=
3716 HAVE_GCC_FNO_INLINE=
3717 if test "$GCC" = "yes"; then
3718 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3720 CFLAGS="$CFLAGS -Werror -ggdb2"
3721 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3723 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3724 AC_MSG_RESULT([yes])
3729 AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3731 CFLAGS="$CFLAGS -Werror -finline-limit=0"
3732 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3734 if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3735 AC_MSG_RESULT([yes])
3740 AC_MSG_CHECKING([whether $CC supports -fno-inline])
3742 CFLAGS="$CFLAGS -Werror -fno-inline"
3743 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3745 if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3746 AC_MSG_RESULT([yes])
3751 if test "$host_cpu" = "m68k"; then
3752 AC_MSG_CHECKING([whether $CC supports -mlong-jump-table-offsets])
3754 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3755 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3757 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3758 AC_MSG_RESULT([yes])
3764 AC_SUBST(HAVE_GCC_GGDB2)
3765 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3766 AC_SUBST(HAVE_GCC_FNO_INLINE)
3768 dnl ===================================================================
3769 dnl Test the gcc version
3770 dnl ===================================================================
3771 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3772 AC_MSG_CHECKING([the GCC version])
3773 _gcc_version=`$CC -dumpversion`
3774 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3775 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3776 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3778 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3780 if test "$gcc_full_version" -lt 40801; then
3781 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.8.1])
3784 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3785 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3786 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3787 # (which reports itself as GCC 4.2.1).
3790 AC_SUBST(GCC_VERSION)
3792 dnl Set the ENABLE_DBGUTIL variable
3793 dnl ===================================================================
3794 AC_MSG_CHECKING([whether to build with additional debug utilities])
3795 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3796 ENABLE_DBGUTIL="TRUE"
3797 # this is an extra var so it can have different default on different MSVC
3798 # versions (in case there are version specific problems with it)
3799 MSVC_USE_DEBUG_RUNTIME="TRUE"
3801 AC_MSG_RESULT([yes])
3802 # cppunit and graphite expose STL in public headers
3803 if test "$with_system_cppunit" = "yes"; then
3804 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3806 with_system_cppunit=no
3808 if test "$with_system_graphite" = "yes"; then
3809 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3811 with_system_graphite=no
3813 if test "$with_system_orcus" = "yes"; then
3814 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3816 with_system_orcus=no
3818 if test "$with_system_libcmis" = "yes"; then
3819 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3821 with_system_libcmis=no
3823 if test "$with_system_hunspell" = "yes"; then
3824 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3826 with_system_hunspell=no
3828 if test "$with_system_gpgmepp" = "yes"; then
3829 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3831 with_system_gpgmepp=no
3833 # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
3834 # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
3835 # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
3836 # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
3837 # of those two is using the system variant:
3838 if test "$with_system_libnumbertext" = "yes"; then
3839 AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
3841 with_system_libnumbertext=no
3843 if test "$with_system_libwps" = "yes"; then
3844 AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
3846 with_system_libwps=no
3850 MSVC_USE_DEBUG_RUNTIME=""
3853 AC_SUBST(ENABLE_DBGUTIL)
3854 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3856 dnl Set the ENABLE_DEBUG variable.
3857 dnl ===================================================================
3858 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3859 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3861 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3862 if test -z "$libo_fuzzed_enable_debug"; then
3863 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3865 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3870 AC_MSG_CHECKING([whether to do a debug build])
3871 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3873 if test -n "$ENABLE_DBGUTIL" ; then
3874 AC_MSG_RESULT([yes (dbgutil)])
3876 AC_MSG_RESULT([yes])
3882 AC_SUBST(ENABLE_DEBUG)
3884 if test "$enable_split_debug" = yes; then
3886 if test "$GCC" = "yes"; then
3887 AC_MSG_CHECKING([whether $CC supports -gsplit-dwarf])
3889 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
3890 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
3892 if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
3893 AC_MSG_RESULT([yes])
3898 AC_SUBST(HAVE_GCC_SPLIT_DWARF)
3901 if test "$enable_sal_log" = yes; then
3904 AC_SUBST(ENABLE_SAL_LOG)
3906 dnl Selective debuginfo
3907 ENABLE_DEBUGINFO_FOR=
3908 if test -n "$ENABLE_DEBUG"; then
3909 AC_MSG_CHECKING([whether to use selective debuginfo])
3910 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3911 if test "$enable_selective_debuginfo" = "yes"; then
3912 AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
3914 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3915 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3917 ENABLE_DEBUGINFO_FOR=all
3918 AC_MSG_RESULT([no, for all])
3921 if test -n "$enable_selective_debuginfo"; then
3922 AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
3925 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3927 dnl Check for enable symbols option
3928 dnl ===================================================================
3929 AC_MSG_CHECKING([whether to generate debug information])
3930 if test -z "$enable_symbols"; then
3931 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3937 if test "$enable_symbols" != no; then
3939 AC_MSG_RESULT([yes])
3944 AC_SUBST(ENABLE_SYMBOLS)
3946 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
3947 # Building on Android with full symbols: without enough memory the linker never finishes currently.
3948 AC_MSG_CHECKING([whether enough memory is available for linking])
3949 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
3950 # Check for 15GB, as Linux reports a bit less than the physical memory size.
3951 if test -n "$mem_size" -a $mem_size -lt 15728640; then
3952 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
3954 AC_MSG_RESULT([yes])
3958 AC_MSG_CHECKING([whether to compile with optimization flags])
3959 if test -z "$enable_optimized"; then
3960 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3963 enable_optimized=yes
3966 if test "$enable_optimized" != no; then
3967 ENABLE_OPTIMIZED=TRUE
3968 AC_MSG_RESULT([yes])
3973 AC_SUBST(ENABLE_OPTIMIZED)
3976 # determine CPUNAME, OS, ...
3977 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
3988 PLATFORMID=aix_powerpc
3997 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4004 if test "$BITNESS_OVERRIDE" = 64; then
4007 PLATFORMID=windows_x86_64
4009 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4013 PLATFORMID=windows_x86
4017 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4020 SCPDEFS="$SCPDEFS -D_MSC_VER"
4032 AC_MSG_ERROR([Can't build 32-bit code for iOS])
4036 if test "$enable_ios_simulator" = "yes"; then
4037 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
4041 PLATFORMID=ios_arm64
4045 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4048 if test "$enable_ios_simulator" = "yes"; then
4053 PLATFORMID=macosx_x86_64
4056 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4072 PLATFORMID=dragonfly_x86
4077 PLATFORMID=dragonfly_x86_64
4080 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4096 PLATFORMID=freebsd_x86
4101 PLATFORMID=freebsd_x86_64
4104 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4121 PLATFORMID=haiku_x86
4126 PLATFORMID=haiku_x86_64
4129 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4146 PLATFORMID=kfreebsd_x86
4151 PLATFORMID=kfreebsd_x86_64
4154 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4170 PLATFORMID=linux_aarch64
4176 PLATFORMID=linux_alpha
4182 PLATFORMID=linux_arm_eabi
4186 PLATFORMID=linux_arm_oabi
4194 PLATFORMID=linux_hppa
4199 PLATFORMID=linux_x86
4204 PLATFORMID=linux_ia64
4210 PLATFORMID=linux_mips_eb
4215 EPM_FLAGS="-a mips64"
4216 PLATFORMID=linux_mips64_eb
4221 EPM_FLAGS="-a mips64el"
4222 PLATFORMID=linux_mips64_el
4227 EPM_FLAGS="-a mipsel"
4228 PLATFORMID=linux_mips_el
4233 PLATFORMID=linux_m68k
4238 PLATFORMID=linux_powerpc
4243 PLATFORMID=linux_powerpc64
4247 RTL_ARCH=PowerPC_64_LE
4248 PLATFORMID=linux_powerpc64_le
4253 PLATFORMID=linux_sparc
4258 PLATFORMID=linux_sparc64
4263 PLATFORMID=linux_s390
4268 PLATFORMID=linux_s390x
4273 PLATFORMID=linux_x86_64
4276 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4293 PLATFORMID=android_arm_eabi
4298 PLATFORMID=android_aarch64
4301 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4303 PLATFORMID=android_mips_el
4308 PLATFORMID=android_x86
4311 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4327 PLATFORMID=netbsd_x86
4332 PLATFORMID=netbsd_powerpc
4337 PLATFORMID=netbsd_sparc
4342 PLATFORMID=netbsd_x86_64
4345 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4361 PLATFORMID=openbsd_x86
4366 PLATFORMID=openbsd_x86_64
4369 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4372 SOLARINC="$SOLARINC -I/usr/local/include"
4386 PLATFORMID=solaris_x86
4391 PLATFORMID=solaris_sparc
4396 PLATFORMID=solaris_sparc64
4399 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4402 SOLARINC="$SOLARINC -I/usr/local/include"
4406 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4410 if test "$with_x" = "no"; then
4411 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4415 if test "$enable_gui" = "no"; then
4416 if test "$USING_X11" != TRUE; then
4417 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4421 AC_DEFINE(HAVE_FEATURE_UI,0)
4424 AC_SUBST(DISABLE_GUI)
4426 WORKDIR="${BUILDDIR}/workdir"
4427 INSTDIR="${BUILDDIR}/instdir"
4428 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4429 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4430 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4438 AC_SUBST([INSTROOT])
4439 AC_SUBST([INSTROOTBASE])
4443 AC_SUBST(PLATFORMID)
4444 AC_SUBST(WINDOWS_X64)
4445 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4447 dnl ===================================================================
4448 dnl Test which package format to use
4449 dnl ===================================================================
4450 AC_MSG_CHECKING([which package format to use])
4451 if test -n "$with_package_format" -a "$with_package_format" != no; then
4452 for i in $with_package_format; do
4454 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4457 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4458 aix - AIX software distribution
4459 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4460 deb - Debian software distribution
4461 pkg - Solaris software distribution
4462 rpm - RedHat software distribution
4464 LibreOffice additionally supports:
4465 archive - .tar.gz or .zip
4467 installed - installation tree
4473 # fakeroot is needed to ensure correct file ownerships/permissions
4474 # inside deb packages and tar archives created on Linux and Solaris.
4475 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4476 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4477 if test "$FAKEROOT" = "no"; then
4479 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4482 PKGFORMAT="$with_package_format"
4483 AC_MSG_RESULT([$PKGFORMAT])
4486 AC_MSG_RESULT([none])
4490 dnl ===================================================================
4491 dnl Set up a different compiler to produce tools to run on the build
4492 dnl machine when doing cross-compilation
4493 dnl ===================================================================
4495 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4496 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4497 if test "$cross_compiling" = "yes"; then
4498 AC_MSG_CHECKING([for BUILD platform configuration])
4500 rm -rf CONF-FOR-BUILD config_build.mk
4501 mkdir CONF-FOR-BUILD
4502 # Here must be listed all files needed when running the configure script. In particular, also
4503 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4504 # keep them in the same order as there.
4505 (cd $SRC_ROOT && tar cf - \
4507 bin/get_config_variables \
4508 solenv/bin/getcompver.awk \
4509 solenv/inc/langlist.mk \
4512 config_host_lang.mk.in \
4515 bin/bffvalidator.sh.in \
4516 bin/odfvalidator.sh.in \
4517 bin/officeotron.sh.in \
4518 instsetoo_native/util/openoffice.lst.in \
4520 sysui/desktop/macosx/Info.plist.in) \
4521 | (cd CONF-FOR-BUILD && tar xf -)
4522 cp configure CONF-FOR-BUILD
4523 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4525 unset COM USING_X11 OS CPUNAME
4526 unset CC CXX SYSBASE CFLAGS
4527 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4528 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4529 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4530 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4531 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4532 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4535 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4536 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4537 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4538 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4539 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4540 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4541 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4542 # Don't bother having configure look for stuff not needed for the build platform anyway
4546 --disable-pdfimport \
4547 --disable-postgresql-sdbc \
4548 --with-parallelism="$with_parallelism" \
4553 2>&1 | sed -e 's/^/ /'
4554 test -f ./config_host.mk 2>/dev/null || exit
4555 cp config_host.mk ../config_build.mk
4556 cp config_host_lang.mk ../config_build_lang.mk
4557 mv config.log ../config.Build.log
4558 mkdir -p ../config_build
4559 mv config_host/*.h ../config_build
4560 . ./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
4562 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
4564 VV=`eval "echo $VV"`
4565 if test -n "$VV"; then
4566 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4567 echo "$line" >>build-config
4571 for V in INSTDIR INSTROOT WORKDIR; do
4573 VV=`eval "echo $VV"`
4574 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4575 if test -n "$VV"; then
4576 line="${V}_FOR_BUILD='$VV'"
4577 echo "$line" >>build-config
4581 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4582 echo "$line" >>build-config
4585 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4586 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])
4587 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4588 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4590 eval `cat CONF-FOR-BUILD/build-config`
4592 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4594 rm -rf CONF-FOR-BUILD
4598 CXX_FOR_BUILD="$CXX"
4599 INSTDIR_FOR_BUILD="$INSTDIR"
4600 INSTROOT_FOR_BUILD="$INSTROOT"
4601 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4602 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4603 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4604 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4605 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4606 WORKDIR_FOR_BUILD="$WORKDIR"
4608 AC_SUBST(OS_FOR_BUILD)
4609 AC_SUBST(INSTDIR_FOR_BUILD)
4610 AC_SUBST(INSTROOT_FOR_BUILD)
4611 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4612 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4613 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4614 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4615 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4616 AC_SUBST(WORKDIR_FOR_BUILD)
4618 dnl ===================================================================
4619 dnl Check for syslog header
4620 dnl ===================================================================
4621 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4623 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4624 dnl ===================================================================
4625 AC_MSG_CHECKING([whether to turn warnings to errors])
4626 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4627 ENABLE_WERROR="TRUE"
4628 AC_MSG_RESULT([yes])
4630 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4631 ENABLE_WERROR="TRUE"
4632 AC_MSG_RESULT([yes])
4637 AC_SUBST(ENABLE_WERROR)
4639 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4640 dnl ===================================================================
4641 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4642 if test -z "$enable_assert_always_abort"; then
4643 if test "$ENABLE_DEBUG" = TRUE; then
4644 enable_assert_always_abort=yes
4646 enable_assert_always_abort=no
4649 if test "$enable_assert_always_abort" = "yes"; then
4650 ASSERT_ALWAYS_ABORT="TRUE"
4651 AC_MSG_RESULT([yes])
4653 ASSERT_ALWAYS_ABORT="FALSE"
4656 AC_SUBST(ASSERT_ALWAYS_ABORT)
4658 # Determine whether to use ooenv for the instdir installation
4659 # ===================================================================
4660 if test $_os != "WINNT" -a $_os != "Darwin"; then
4661 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4662 if test "$enable_ooenv" = "no"; then
4666 AC_MSG_RESULT([yes])
4669 AC_SUBST(ENABLE_OOENV)
4671 if test "$USING_X11" != TRUE; then
4672 # be sure to do not mess with unneeded stuff
4678 build_gstreamer_1_0=no
4679 build_gstreamer_0_10=no
4684 enable_cairo_canvas=no
4687 if test "$OS" = "HAIKU"; then
4688 enable_cairo_canvas=yes
4693 dnl ===================================================================
4694 dnl check for cups support
4695 dnl ===================================================================
4698 if test "$enable_cups" = "no"; then
4702 AC_MSG_CHECKING([whether to enable CUPS support])
4703 if test "$test_cups" = "yes"; then
4705 AC_MSG_RESULT([yes])
4707 AC_MSG_CHECKING([whether cups support is present])
4708 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4709 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4710 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4711 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4718 AC_SUBST(ENABLE_CUPS)
4721 if test "$test_fontconfig" = "yes"; then
4722 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4723 SYSTEM_FONTCONFIG=TRUE
4724 FilterLibs "${FONTCONFIG_LIBS}"
4725 FONTCONFIG_LIBS="${filteredlibs}"
4727 AC_SUBST(FONTCONFIG_CFLAGS)
4728 AC_SUBST(FONTCONFIG_LIBS)
4729 AC_SUBST([SYSTEM_FONTCONFIG])
4731 dnl whether to find & fetch external tarballs?
4732 dnl ===================================================================
4733 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4734 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4735 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4737 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4740 if test -z "$TARFILE_LOCATION"; then
4741 if test -d "$SRC_ROOT/src" ; then
4742 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4743 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4745 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4747 AbsolutePath "$TARFILE_LOCATION"
4748 PathFormat "${absolute_path}"
4749 TARFILE_LOCATION="${formatted_path}"
4751 AC_SUBST(TARFILE_LOCATION)
4753 AC_MSG_CHECKING([whether we want to fetch tarballs])
4754 if test "$enable_fetch_external" != "no"; then
4755 if test "$with_all_tarballs" = "yes"; then
4756 AC_MSG_RESULT([yes, all of them])
4757 DO_FETCH_TARBALLS="ALL"
4759 AC_MSG_RESULT([yes, if we use them])
4760 DO_FETCH_TARBALLS="TRUE"
4766 AC_SUBST(DO_FETCH_TARBALLS)
4768 AC_MSG_CHECKING([whether to build help])
4769 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4770 BUILD_TYPE="$BUILD_TYPE HELP"
4771 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4772 case "$with_help" in
4774 ENABLE_HTMLHELP=TRUE
4775 SCPDEFS="$SCPDEFS -DWITH_HELP"
4776 AC_MSG_RESULT([HTML])
4779 ENABLE_HTMLHELP=TRUE
4781 AC_MSG_RESULT([HTML])
4784 SCPDEFS="$SCPDEFS -DWITH_HELP"
4785 AC_MSG_RESULT([yes])
4788 AC_MSG_ERROR([Unknown --with-help=$with_help])
4794 AC_SUBST([ENABLE_HTMLHELP])
4795 AC_SUBST([HELP_ONLINE])
4797 dnl Test whether to include MySpell dictionaries
4798 dnl ===================================================================
4799 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4800 if test "$with_myspell_dicts" = "yes"; then
4801 AC_MSG_RESULT([yes])
4802 WITH_MYSPELL_DICTS=TRUE
4803 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4804 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4809 AC_SUBST(WITH_MYSPELL_DICTS)
4811 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
4812 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4813 if test "$with_system_dicts" = yes; then
4814 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4816 with_system_dicts=no
4819 AC_MSG_CHECKING([whether to use dicts from external paths])
4820 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4821 AC_MSG_RESULT([yes])
4823 AC_MSG_CHECKING([for spelling dictionary directory])
4824 if test -n "$with_external_dict_dir"; then
4825 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4827 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4828 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4829 DICT_SYSTEM_DIR=file:///usr/share/myspell
4832 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4833 AC_MSG_CHECKING([for hyphenation patterns directory])
4834 if test -n "$with_external_hyph_dir"; then
4835 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4837 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4839 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4840 AC_MSG_CHECKING([for thesaurus directory])
4841 if test -n "$with_external_thes_dir"; then
4842 THES_SYSTEM_DIR=file://$with_external_thes_dir
4844 THES_SYSTEM_DIR=file:///usr/share/mythes
4846 AC_MSG_RESULT([$THES_SYSTEM_DIR])
4851 AC_SUBST(SYSTEM_DICTS)
4852 AC_SUBST(DICT_SYSTEM_DIR)
4853 AC_SUBST(HYPH_SYSTEM_DIR)
4854 AC_SUBST(THES_SYSTEM_DIR)
4856 dnl ===================================================================
4857 dnl enable pch by default on windows
4858 dnl enable it explicitly otherwise
4860 if test "$enable_pch" = yes -a "$enable_compiler_plugins" = yes; then
4861 if test -z "$libo_fuzzed_enable_pch"; then
4862 AC_MSG_ERROR([--enable-pch cannot be used with --enable-compiler-plugins])
4864 AC_MSG_NOTICE([Resetting --enable-pch=no])
4869 AC_MSG_CHECKING([whether to enable pch feature])
4870 if test "$enable_pch" != "no"; then
4871 if test "$_os" = "WINNT"; then
4873 AC_MSG_RESULT([yes])
4874 elif test -n "$enable_pch" && test "$GCC" = "yes"; then
4876 AC_MSG_RESULT([yes])
4877 elif test -n "$enable_pch"; then
4878 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
4885 AC_SUBST(ENABLE_PCH)
4889 AC_MSG_CHECKING([the GNU Make version])
4890 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4891 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4892 if test "$_make_longver" -ge "038200"; then
4893 AC_MSG_RESULT([$GNUMAKE $_make_version])
4895 elif test "$_make_longver" -ge "038100"; then
4896 if test "$build_os" = "cygwin"; then
4897 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4899 AC_MSG_RESULT([$GNUMAKE $_make_version])
4901 dnl ===================================================================
4902 dnl Search all the common names for sha1sum
4903 dnl ===================================================================
4904 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
4905 if test -z "$SHA1SUM"; then
4906 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
4907 elif test "$SHA1SUM" = "openssl"; then
4908 SHA1SUM="openssl sha1"
4910 AC_MSG_CHECKING([for GNU Make bug 20033])
4911 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4912 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
4913 A := \$(wildcard *.a)
4917 <TAB>@echo survived bug20033.
4921 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
4934 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
4935 <TAB>\$(call d1,\$(CHECKSUM)),\
4936 <TAB>\$(call d2,\$(CHECKSUM)))
4938 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
4939 no_parallelism_make="YES"
4940 AC_MSG_RESULT([yes, disable parallelism])
4942 AC_MSG_RESULT([no, keep parallelism enabled])
4944 rm -rf $TESTGMAKEBUG20033
4946 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
4949 # find if gnumake support file function
4950 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
4951 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
4952 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4953 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
4955 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
4956 \$(file >test.txt,Success )
4963 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
4964 if test -f $TESTGMAKEFILEFUNC/test.txt; then
4965 HAVE_GNUMAKE_FILE_FUNC=TRUE
4966 AC_MSG_RESULT([yes])
4970 rm -rf $TESTGMAKEFILEFUNC
4971 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
4972 AC_SUBST(GNUMAKE_WIN_NATIVE)
4974 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
4976 if test "$_make_ver_check" = ""; then
4980 HAVE_LD_HASH_STYLE=FALSE
4981 WITH_LINKER_HASH_STYLE=
4982 AC_MSG_CHECKING([for --hash-style gcc linker support])
4983 if test "$GCC" = "yes"; then
4984 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
4985 hash_styles="gnu sysv"
4986 elif test "$with_linker_hash_style" = "no"; then
4989 hash_styles="$with_linker_hash_style"
4992 for hash_style in $hash_styles; do
4993 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4994 hash_style_ldflags_save=$LDFLAGS
4995 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
4997 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5004 HAVE_LD_HASH_STYLE=TRUE
5005 WITH_LINKER_HASH_STYLE=$hash_style
5007 [HAVE_LD_HASH_STYLE=FALSE],
5008 [HAVE_LD_HASH_STYLE=FALSE])
5009 LDFLAGS=$hash_style_ldflags_save
5012 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5013 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5017 LDFLAGS=$hash_style_ldflags_save
5021 AC_SUBST(HAVE_LD_HASH_STYLE)
5022 AC_SUBST(WITH_LINKER_HASH_STYLE)
5024 dnl ===================================================================
5025 dnl Check whether there's a Perl version available.
5026 dnl ===================================================================
5027 if test -z "$with_perl_home"; then
5028 AC_PATH_PROG(PERL, perl)
5030 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5031 _perl_path="$with_perl_home/bin/perl"
5032 if test -x "$_perl_path"; then
5035 AC_MSG_ERROR([$_perl_path not found])
5039 dnl ===================================================================
5040 dnl Testing for Perl version 5 or greater.
5041 dnl $] is the Perl version variable, it is returned as an integer
5042 dnl ===================================================================
5043 if test "$PERL"; then
5044 AC_MSG_CHECKING([the Perl version])
5045 ${PERL} -e "exit($]);"
5047 if test "$_perl_version" -lt 5; then
5048 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
5050 AC_MSG_RESULT([Perl $_perl_version])
5052 AC_MSG_ERROR([Perl not found, install Perl 5])
5055 dnl ===================================================================
5056 dnl Testing for required Perl modules
5057 dnl ===================================================================
5059 AC_MSG_CHECKING([for required Perl modules])
5060 perl_use_string="use Cwd ; use Digest::MD5"
5061 if test "$_os" = "WINNT"; then
5062 if test -n "$PKGFORMAT"; then
5063 for i in $PKGFORMAT; do
5066 # for getting fonts versions to use in MSI
5067 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5073 if test "$with_system_hsqldb" = "yes"; then
5074 perl_use_string="$perl_use_string ; use Archive::Zip"
5076 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
5077 AC_MSG_RESULT([all modules found])
5079 AC_MSG_RESULT([failed to find some modules])
5080 # Find out which modules are missing.
5081 for i in $perl_use_string; do
5082 if test "$i" != "use" -a "$i" != ";"; then
5083 if ! $PERL -e "use $i;">/dev/null 2>&1; then
5084 missing_perl_modules="$missing_perl_modules $i"
5089 The missing Perl modules are: $missing_perl_modules
5090 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5093 dnl ===================================================================
5094 dnl Check for pkg-config
5095 dnl ===================================================================
5096 if test "$_os" != "WINNT"; then
5100 if test "$_os" != "WINNT"; then
5102 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5103 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5104 # explicitly. Or put /path/to/compiler in PATH yourself.
5106 # Use wrappers for LTO
5107 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5108 AC_CHECK_TOOL(AR,gcc-ar)
5109 AC_CHECK_TOOL(NM,gcc-nm)
5110 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5112 AC_CHECK_TOOL(AR,ar)
5113 AC_CHECK_TOOL(NM,nm)
5114 AC_CHECK_TOOL(RANLIB,ranlib)
5116 AC_CHECK_TOOL(OBJDUMP,objdump)
5117 AC_CHECK_TOOL(READELF,readelf)
5118 AC_CHECK_TOOL(STRIP,strip)
5119 if test "$_os" = "WINNT"; then
5120 AC_CHECK_TOOL(DLLTOOL,dlltool)
5121 AC_CHECK_TOOL(WINDRES,windres)
5128 AC_SUBST(PKG_CONFIG)
5134 dnl ===================================================================
5135 dnl pkg-config checks on Mac OS X
5136 dnl ===================================================================
5138 if test $_os = Darwin; then
5139 AC_MSG_CHECKING([for bogus pkg-config])
5140 if test -n "$PKG_CONFIG"; then
5141 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5142 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5144 if test "$enable_bogus_pkg_config" = "yes"; then
5145 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5147 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.])
5151 AC_MSG_RESULT([no, good])
5157 # Return value: $csctest
5161 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5162 if test -n "$regvalue"; then
5170 # Return value: $altest
5174 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5175 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5176 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5182 # We need this additional check to detect 4.6.1 or above.
5183 for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
5184 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5185 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5190 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools"
5191 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5202 for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
5203 reg_get_value_64 "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5204 if test -n "$regvalue"; then
5208 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5209 if test -n "$regvalue"; then
5216 find_winsdk_version()
5218 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5219 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5221 unset winsdktest winsdkbinsubdir winsdklibsubdir
5225 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5226 if test -n "$regvalue"; then
5227 winsdktest=$regvalue
5233 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5234 if test -n "$regvalue"; then
5235 winsdktest=$regvalue
5236 winsdklibsubdir=win8
5241 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5242 if test -n "$regvalue"; then
5243 winsdktest=$regvalue
5244 winsdklibsubdir=winv6.3
5249 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5250 if test -n "$regvalue"; then
5251 winsdktest=$regvalue
5252 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5253 if test -n "$regvalue"; then
5254 winsdkbinsubdir="$regvalue".0
5256 winsdklibsubdir=$regvalue
5257 if test "$regvalue" = "10.0.14393"; then
5258 winsdklibsubdir="10.0.14393.0"
5259 elif test "$regvalue" = "10.0.16299"; then
5260 winsdklibsubdir="10.0.16299.0"
5261 elif test "$regvalue" = "10.0.15063"; then
5262 winsdklibsubdir="10.0.15063.0"
5263 elif test "$regvalue" = "10.0.17134"; then
5264 winsdklibsubdir="$regvalue.0"
5274 # Return value: From find_winsdk_version
5278 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5279 find_winsdk_version $ver
5280 if test -n "$winsdktest"; then
5288 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5289 if test $VCVER = 150; then
5290 my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
5292 AC_MSG_CHECKING([for ${my_msm_files}])
5294 for ver in 14.0 15.0; do
5295 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5296 if test -n "$regvalue"; then
5297 for f in ${my_msm_files}; do
5298 if test -e "$regvalue/${f}"; then
5305 dnl Is the following fallback really necessary, or was it added in response
5306 dnl to never having started Visual Studio on a given machine, so the
5307 dnl registry keys checked above had presumably not yet been created?
5308 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5309 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5310 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5311 dnl expanding to "C:\Program Files\Common Files"), which would need
5312 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5313 dnl obtain its value from cygwin:
5314 if test -z "$msmdir"; then
5315 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5316 for f in ${my_msm_files}; do
5317 if test -e "$my_msm_dir/${f}"; then
5323 dnl Starting from MSVC 15.0, merge modules are located in different directory
5324 if test $VCVER = 150; then
5325 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5326 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])
5327 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5328 for f in ${my_msm_files}; do
5329 if test -e "$my_msm_dir/${f}"; then
5337 if test -n "$msmdir"; then
5338 msmdir=`cygpath -m "$msmdir"`
5339 AC_MSG_RESULT([$msmdir])
5341 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5342 AC_MSG_ERROR([not found])
5344 AC_MSG_WARN([not found])
5345 add_warning "MSM none of ${my_msm_files} found"
5350 find_msvc_x64_dlls()
5352 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5353 if test "$VCVER" = 150; then
5354 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5355 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT])
5356 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5357 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5360 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
5361 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
5366 msvcdlls="msvcp140.dll vcruntime140.dll"
5367 for dll in $msvcdlls; do
5368 if ! test -f "$msvcdllpath/$dll"; then
5369 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5374 dnl =========================================
5375 dnl Check for the Windows SDK.
5376 dnl =========================================
5377 if test "$_os" = "WINNT"; then
5378 AC_MSG_CHECKING([for Windows SDK])
5379 if test "$build_os" = "cygwin"; then
5381 WINDOWS_SDK_HOME=$winsdktest
5383 # normalize if found
5384 if test -n "$WINDOWS_SDK_HOME"; then
5385 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5386 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5389 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5392 if test -n "$WINDOWS_SDK_HOME"; then
5393 # Remove a possible trailing backslash
5394 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5396 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5397 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5398 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5399 have_windows_sdk_headers=yes
5400 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5401 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5402 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5403 have_windows_sdk_headers=yes
5404 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5405 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5406 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5407 have_windows_sdk_headers=yes
5409 have_windows_sdk_headers=no
5412 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5413 have_windows_sdk_libs=yes
5414 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5415 have_windows_sdk_libs=yes
5417 have_windows_sdk_libs=no
5420 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5421 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5422 the Windows SDK are installed.])
5426 if test -z "$WINDOWS_SDK_HOME"; then
5427 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5428 elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
5429 WINDOWS_SDK_VERSION=70
5430 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
5431 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5432 WINDOWS_SDK_VERSION=80
5433 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5434 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5435 WINDOWS_SDK_VERSION=81
5436 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5437 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5438 WINDOWS_SDK_VERSION=10
5439 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5441 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5443 PathFormat "$WINDOWS_SDK_HOME"
5444 WINDOWS_SDK_HOME="$formatted_path"
5445 if test "$build_os" = "cygwin"; then
5446 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5447 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5448 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5449 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5450 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5454 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5455 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5456 dnl but not in v8.0), so allow this to be overridden with a
5457 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5458 dnl and configuration error if no WiLangId.vbs is found would arguably be
5459 dnl better, but I do not know under which conditions exactly it is needed by
5461 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5462 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5463 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5464 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5466 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5467 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5469 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5470 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5473 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5474 if test -n "$with_package_format" -a "$with_package_format" != no; then
5475 for i in "$with_package_format"; do
5476 if test "$i" = "msi"; then
5477 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5478 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5485 AC_SUBST(WINDOWS_SDK_HOME)
5486 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5487 AC_SUBST(WINDOWS_SDK_VERSION)
5488 AC_SUBST(WINDOWS_SDK_WILANGID)
5490 if test "$build_os" = "cygwin"; then
5491 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5492 dnl dir, it also determines that dir's path w/o an arch segment if any,
5493 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5494 AC_MSG_CHECKING([for midl.exe])
5497 if test -n "$winsdkbinsubdir" \
5498 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5500 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5501 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5502 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5503 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5504 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5505 elif test -f "$winsdktest/Bin/midl.exe"; then
5506 MIDL_PATH=$winsdktest/Bin
5507 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5509 if test ! -f "$MIDL_PATH/midl.exe"; then
5510 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5512 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5515 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5516 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5518 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5519 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5520 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5521 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5522 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5523 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5524 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5525 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5526 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5527 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5528 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5529 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5531 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5535 AC_MSG_CHECKING([for csc.exe])
5537 if test -f "$csctest/csc.exe"; then
5540 if test ! -f "$CSC_PATH/csc.exe"; then
5541 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5543 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5546 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5549 AC_MSG_CHECKING([for al.exe])
5551 if test -n "$winsdkbinsubdir" \
5552 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5554 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5555 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5556 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5557 elif test -f "$winsdktest/Bin/al.exe"; then
5558 AL_PATH="$winsdktest/Bin"
5561 if test -z "$AL_PATH"; then
5563 if test -f "$altest/bin/al.exe"; then
5564 AL_PATH="$altest/bin"
5565 elif test -f "$altest/al.exe"; then
5569 if test ! -f "$AL_PATH/al.exe"; then
5570 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5572 AC_MSG_RESULT([$AL_PATH/al.exe])
5575 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5577 dnl Check mscoree.lib / .NET Framework dir
5578 AC_MSG_CHECKING(.NET Framework)
5580 PathFormat "$frametest"
5581 frametest="$formatted_path"
5582 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5583 DOTNET_FRAMEWORK_HOME="$frametest"
5586 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5587 DOTNET_FRAMEWORK_HOME="$winsdktest"
5590 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
5591 AC_MSG_ERROR([mscoree.lib not found])
5593 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5595 PathFormat "$MIDL_PATH"
5596 MIDL_PATH="$formatted_path"
5598 PathFormat "$AL_PATH"
5599 AL_PATH="$formatted_path"
5601 PathFormat "$DOTNET_FRAMEWORK_HOME"
5602 DOTNET_FRAMEWORK_HOME="$formatted_path"
5604 PathFormat "$CSC_PATH"
5605 CSC_PATH="$formatted_path"
5608 dnl ===================================================================
5609 dnl Check if stdc headers are available excluding MSVC.
5610 dnl ===================================================================
5611 if test "$_os" != "WINNT"; then
5615 dnl ===================================================================
5616 dnl Testing for C++ compiler and version...
5617 dnl ===================================================================
5619 if test "$_os" != "WINNT"; then
5620 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5621 save_CXXFLAGS=$CXXFLAGS
5623 CXXFLAGS=$save_CXXFLAGS
5625 if test -n "$CC" -a -z "$CXX"; then
5630 dnl check for GNU C++ compiler version
5631 if test "$GXX" = "yes"; then
5632 AC_MSG_CHECKING([the GNU C++ compiler version])
5634 _gpp_version=`$CXX -dumpversion`
5635 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5637 if test "$_gpp_majmin" -lt "401"; then
5638 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
5640 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5643 dnl see https://code.google.com/p/android/issues/detail?id=41770
5644 if test "$_gpp_majmin" -ge "401"; then
5648 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5649 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5650 #include <bits/c++config.h>]],[[
5651 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5652 && !defined(_GLIBCXX__PTHREADS) \
5653 && !defined(_GLIBCXX_HAS_GTHREADS)
5656 ]])],[AC_MSG_RESULT([yes])
5657 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5659 if test $glibcxx_threads = yes; then
5660 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5664 AC_SUBST(BOOST_CXXFLAGS)
5667 # prefx CXX with ccache if needed
5669 if test "$CCACHE" != ""; then
5670 AC_MSG_CHECKING([whether $CXX is already ccached])
5672 save_CXXFLAGS=$CXXFLAGS
5673 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5674 dnl an empty program will do, we're checking the compiler flags
5675 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5676 [use_ccache=yes], [use_ccache=no])
5677 if test $use_ccache = yes; then
5678 AC_MSG_RESULT([yes])
5683 CXXFLAGS=$save_CXXFLAGS
5687 dnl ===================================================================
5688 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5689 dnl ===================================================================
5691 if test "$_os" != "WINNT"; then
5694 dnl Check whether there's a C pre-processor.
5699 dnl ===================================================================
5700 dnl Find integral type sizes and alignments
5701 dnl ===================================================================
5703 if test "$_os" != "WINNT"; then
5705 if test "$_os" == "iOS"; then
5706 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
5708 ac_cv_sizeof_short=2
5710 ac_cv_sizeof_long_long=8
5711 ac_cv_sizeof_double=8
5712 ac_cv_sizeof_voidp=8
5714 AC_CHECK_SIZEOF(long)
5715 AC_CHECK_SIZEOF(short)
5716 AC_CHECK_SIZEOF(int)
5717 AC_CHECK_SIZEOF(long long)
5718 AC_CHECK_SIZEOF(double)
5719 AC_CHECK_SIZEOF(void*)
5722 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5723 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5724 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5725 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5726 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5728 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5729 m4_pattern_allow([AC_CHECK_ALIGNOF])
5730 m4_ifdef([AC_CHECK_ALIGNOF],
5732 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5733 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5734 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5735 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5738 case "$_os-$host_cpu" in
5740 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5741 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5742 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5743 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5746 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5747 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5748 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5749 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5752 if test -z "$ac_cv_alignof_short" -o \
5753 -z "$ac_cv_alignof_int" -o \
5754 -z "$ac_cv_alignof_long" -o \
5755 -z "$ac_cv_alignof_double"; then
5756 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.])
5762 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5763 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5764 if test $ac_cv_sizeof_long -eq 8; then
5765 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5766 elif test $ac_cv_sizeof_double -eq 8; then
5767 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5769 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5772 dnl Check for large file support
5774 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5775 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5777 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5778 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5782 SAL_TYPES_SIZEOFSHORT=2
5783 SAL_TYPES_SIZEOFINT=4
5784 SAL_TYPES_SIZEOFLONG=4
5785 SAL_TYPES_SIZEOFLONGLONG=8
5786 if test "$BITNESS_OVERRIDE" = ""; then
5787 SAL_TYPES_SIZEOFPOINTER=4
5789 SAL_TYPES_SIZEOFPOINTER=8
5791 SAL_TYPES_ALIGNMENT2=2
5792 SAL_TYPES_ALIGNMENT4=4
5793 SAL_TYPES_ALIGNMENT8=8
5796 AC_SUBST(LFS_CFLAGS)
5798 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5799 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5800 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5801 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5802 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5803 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5804 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5805 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5807 dnl ===================================================================
5808 dnl Check whether to enable runtime optimizations
5809 dnl ===================================================================
5810 ENABLE_RUNTIME_OPTIMIZATIONS=
5811 AC_MSG_CHECKING([whether to enable runtime optimizations])
5812 if test -z "$enable_runtime_optimizations"; then
5816 enable_runtime_optimizations=no
5822 if test "$enable_runtime_optimizations" != no; then
5823 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
5824 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
5825 AC_MSG_RESULT([yes])
5829 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
5831 dnl ===================================================================
5832 dnl Check if valgrind headers are available
5833 dnl ===================================================================
5835 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
5836 prev_cppflags=$CPPFLAGS
5837 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5838 # or where does it come from?
5839 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5840 AC_CHECK_HEADER([valgrind/valgrind.h],
5841 [ENABLE_VALGRIND=TRUE])
5842 CPPFLAGS=$prev_cppflags
5844 AC_SUBST([ENABLE_VALGRIND])
5845 if test -z "$ENABLE_VALGRIND"; then
5846 if test "$with_valgrind" = yes; then
5847 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
5851 AC_SUBST([VALGRIND_CFLAGS])
5854 dnl ===================================================================
5855 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
5856 dnl ===================================================================
5858 # We need at least the sys/sdt.h include header.
5859 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
5860 if test "$SDT_H_FOUND" = "TRUE"; then
5861 # Found sys/sdt.h header, now make sure the c++ compiler works.
5862 # Old g++ versions had problems with probes in constructors/destructors.
5863 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
5865 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5866 #include <sys/sdt.h>
5874 ProbeClass(int& v, const char *n) : ref(v), name(n)
5876 DTRACE_PROBE2(_test_, cons, name, ref);
5879 void method(int min)
5881 DTRACE_PROBE3(_test_, meth, name, ref, min);
5887 DTRACE_PROBE2(_test_, dest, name, ref);
5892 DTRACE_PROBE1(_test_, call, i);
5893 ProbeClass inst = ProbeClass(i, "call");
5895 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
5896 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
5899 AC_CONFIG_HEADERS([config_host/config_probes.h])
5901 dnl ===================================================================
5903 dnl ===================================================================
5904 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
5905 AC_MSG_CHECKING([whether $CC supports -mno-avx])
5907 CFLAGS="$CFLAGS -Werror -mno-avx"
5908 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5910 if test "$HAVE_GCC_AVX" = "TRUE"; then
5911 AC_MSG_RESULT([yes])
5916 AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong])
5918 CFLAGS="$CFLAGS -Werror -fstack-protector-strong"
5919 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; return 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
5921 if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
5922 AC_MSG_RESULT([yes])
5927 AC_MSG_CHECKING([whether $CC supports atomic functions])
5928 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5930 if (__sync_add_and_fetch(&v, 1) != 1 ||
5931 __sync_sub_and_fetch(&v, 1) != 0)
5933 __sync_synchronize();
5934 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
5938 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
5939 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
5940 AC_MSG_RESULT([yes])
5941 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
5946 AC_MSG_CHECKING([whether $CC supports __builtin_ffs])
5947 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
5948 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
5949 AC_MSG_RESULT([yes])
5950 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
5955 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
5957 CFLAGS="$CFLAGS -Werror"
5958 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5959 __attribute__((deprecated("test"))) void f();
5961 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
5962 AC_MSG_RESULT([yes])
5963 ], [AC_MSG_RESULT([no])])
5966 AC_MSG_CHECKING([whether $CXX defines __base_class_type_info in cxxabi.h])
5968 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5971 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
5973 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
5974 AC_MSG_RESULT([yes])
5975 ], [AC_MSG_RESULT([no])])
5978 AC_MSG_CHECKING([whether $CXX defines __class_type_info in cxxabi.h])
5980 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5983 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
5985 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
5986 AC_MSG_RESULT([yes])
5987 ], [AC_MSG_RESULT([no])])
5990 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
5992 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5994 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
5996 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
5997 AC_MSG_RESULT([yes])
5998 ], [AC_MSG_RESULT([no])])
6001 AC_MSG_CHECKING([whether $CXX defines __cxa_eh_globals in cxxabi.h])
6003 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6006 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6008 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6009 AC_MSG_RESULT([yes])
6010 ], [AC_MSG_RESULT([no])])
6013 AC_MSG_CHECKING([whether $CXX defines __cxa_exceptions in cxxabi.h])
6015 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6018 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6020 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6021 AC_MSG_RESULT([yes])
6022 ], [AC_MSG_RESULT([no])])
6025 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
6027 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6029 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6031 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6032 AC_MSG_RESULT([yes])
6033 ], [AC_MSG_RESULT([no])])
6036 AC_MSG_CHECKING([whether $CXX declares __cxa_current_exception_type in cxxabi.h])
6038 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6040 void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
6042 AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
6043 AC_MSG_RESULT([yes])
6044 ], [AC_MSG_RESULT([no])])
6047 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6049 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6051 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6053 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6054 AC_MSG_RESULT([yes])
6055 ], [AC_MSG_RESULT([no])])
6058 AC_MSG_CHECKING([whether $CXX defines __si_class_type_info in cxxabi.h])
6060 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6063 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6065 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6066 AC_MSG_RESULT([yes])
6067 ], [AC_MSG_RESULT([no])])
6070 AC_MSG_CHECKING([whether $CXX defines __vmi_class_type_info in cxxabi.h])
6072 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6075 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6077 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6078 AC_MSG_RESULT([yes])
6079 ], [AC_MSG_RESULT([no])])
6082 dnl Available in GCC 4.9 and at least since Clang 3.4:
6083 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6085 save_CXXFLAGS=$CXXFLAGS
6086 CXXFLAGS="$CXXFLAGS -Werror"
6087 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6088 struct __attribute__((warn_unused)) dummy {};
6090 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6091 AC_MSG_RESULT([yes])
6092 ], [AC_MSG_RESULT([no])])
6093 CXXFLAGS=$save_CXXFLAGS
6097 AC_SUBST(HAVE_GCC_AVX)
6098 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
6099 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6100 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6102 dnl ===================================================================
6103 dnl Identify the C++ library
6104 dnl ===================================================================
6106 AC_MSG_CHECKING([what the C++ library is])
6108 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6114 [CPP_LIBRARY=GLIBCXX
6115 cpp_library_name="GNU libstdc++"
6117 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6119 #ifndef _LIBCPP_VERSION
6124 cpp_library_name="LLVM libc++"
6125 AC_DEFINE([HAVE_LIBCXX])
6127 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6134 cpp_library_name="Microsoft"
6136 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6137 AC_MSG_RESULT([$cpp_library_name])
6140 dnl ===================================================================
6142 dnl ===================================================================
6143 AC_PATH_PROG(GPERF, gperf)
6144 if test -z "$GPERF"; then
6145 AC_MSG_ERROR([gperf not found but needed. Install it.])
6147 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6148 GPERF=`cygpath -m $GPERF`
6150 AC_MSG_CHECKING([gperf version])
6151 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
6154 AC_MSG_ERROR([too old, you need at least 3.0.0])
6158 dnl ===================================================================
6159 dnl Check for system libcmis
6160 dnl ===================================================================
6161 # libcmis requires curl and we can't build curl for iOS
6162 if test $_os != iOS; then
6163 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.0])
6168 AC_SUBST(ENABLE_LIBCMIS)
6170 dnl ===================================================================
6172 dnl ===================================================================
6175 libo_FUZZ_ARG_ENABLE(c++17,
6176 AS_HELP_STRING([--disable-c++17],
6177 [Do not attempt to run GCC/Clang in C++17 mode (needed for Coverity).])
6181 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6182 AC_MSG_CHECKING([whether $CXX supports C++11])
6184 # MSVC supports (a subset of) CXX11 without any switch
6185 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6187 AC_MSG_CHECKING([whether $CXX supports C++17, C++14, or C++11])
6188 dnl But only use C++17 if the gperf that is being used knows not to emit
6189 dnl "register" in C++ output:
6190 printf 'foo\n' | $GPERF -L C++ > conftest.inc
6191 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'
6192 if test "$enable_c__17" != no; then
6193 my_flags="-std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z $my_flags"
6195 for flag in $my_flags; do
6196 if test "$COM" = MSC; then
6197 flag="-Xclang $flag"
6199 save_CXXFLAGS=$CXXFLAGS
6200 CXXFLAGS="$CXXFLAGS $flag -Werror"
6201 if test "$SYSTEM_LIBCMIS" = TRUE; then
6202 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6205 dnl Clang 3.9 supports __float128 since
6206 dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
6207 dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
6208 dnl hacky workaround to be able to include <vector> (as is done in the main check whether
6209 dnl $flag is supported below, so check this first):
6211 my_float128hack_impl=-D__float128=void
6212 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6214 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6218 dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
6219 dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
6220 dnl is available during its build, but it's usually built using GCC, and so c++config.h
6221 dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
6222 dnl place where __float128 is used is in a template specialization, -D__float128=void
6223 dnl will avoid the problem there while still causing a problem if somebody actually uses
6224 dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
6225 dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
6226 dnl "fixed" with this hack):
6227 CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
6228 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6230 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6233 ],[my_float128hack=$my_float128hack_impl])
6235 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6236 #include <algorithm>
6237 #include <functional>
6241 #pragma GCC diagnostic push
6242 #pragma GCC diagnostic ignored "-Wpragmas"
6243 // make GCC not warn about next pragma
6244 #pragma GCC diagnostic ignored "-Wdeprecated-register"
6245 // make Clang with -std < C++17 not even warn about register
6246 #include "conftest.inc"
6247 #pragma GCC diagnostic pop
6249 #if defined SYSTEM_LIBCMIS
6250 // See ucb/source/ucp/cmis/auth_provider.hxx:
6252 #pragma GCC diagnostic push
6253 #pragma GCC diagnostic ignored "-Wdeprecated"
6254 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6256 #include <libcmis/libcmis.hxx>
6258 #pragma GCC diagnostic pop
6262 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6263 std::sort(v.begin(), v.end(), fn);
6265 ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
6267 CXXFLAGS=$save_CXXFLAGS
6268 if test -n "$CXXFLAGS_CXX11"; then
6274 if test "$HAVE_CXX11" = TRUE; then
6275 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6280 AC_SUBST(CXXFLAGS_CXX11)
6282 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6283 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6284 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6285 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6286 dnl again towards 4.7.2:
6287 if test $CPP_LIBRARY = GLIBCXX; then
6288 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6290 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6292 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6293 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6294 // GCC 4.7.0: 20120322
6295 // GCC 4.7.1: 20120614
6296 // and using a range check is not possible as the mapping between
6297 // __GLIBCXX__ values and GCC versions is not monotonic
6302 ]])], [AC_MSG_RESULT(no, ok)],
6303 [AC_MSG_ERROR(yes)])
6307 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6308 save_CXXFLAGS=$CXXFLAGS
6309 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6312 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6315 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6331 a thinga[]={{0,0}, {1,1}};
6332 b thingb[]={{0,0}, {1,1}};
6333 size_t i = sizeof(sal_n_array_size(thinga));
6334 size_t j = sizeof(sal_n_array_size(thingb));
6335 return !(i != 0 && j != 0);
6337 ], [ AC_MSG_RESULT(yes) ],
6338 [ AC_MSG_ERROR(no)])
6340 CXXFLAGS=$save_CXXFLAGS
6342 AC_MSG_CHECKING([whether $CXX supports C++14 constexpr])
6343 save_CXXFLAGS=$CXXFLAGS
6344 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6346 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6347 // A somewhat over-complicated way of checking for
6348 // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "ICE using __func__
6349 // in constexpr function":
6351 template<typename T> inline constexpr T f(T x) { return x; }
6352 template<typename T> inline constexpr T g(T x) {
6353 assert(f(static_cast<int>(x)));
6361 constexpr bool f() {
6364 while (n > 0) { --n; ++i; }
6369 constexpr auto v2 = S{10}.f();
6370 ]])], [cxx14_constexpr=yes], [cxx14_constexpr=no])
6372 CXXFLAGS=$save_CXXFLAGS
6373 AC_MSG_RESULT([$cxx14_constexpr])
6374 if test "$cxx14_constexpr" = yes; then
6375 AC_DEFINE([HAVE_CXX14_CONSTEXPR])
6378 dnl _Pragma support (may require C++11)
6379 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6380 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6382 save_CXXFLAGS=$CXXFLAGS
6383 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6384 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6385 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6387 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6388 AC_MSG_RESULT([yes])
6389 ], [AC_MSG_RESULT([no])])
6391 CXXFLAGS=$save_CXXFLAGS
6394 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6395 if test "$GCC" = yes; then
6396 AC_MSG_CHECKING([whether $CXX supports -fno-sized-deallocation])
6398 save_CXXFLAGS=$CXXFLAGS
6399 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6400 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6401 CXXFLAGS=$save_CXXFLAGS
6403 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6404 AC_MSG_RESULT([yes])
6409 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6411 AC_MSG_CHECKING([whether $CXX supports guaranteed copy elision])
6413 save_CXXFLAGS=$CXXFLAGS
6414 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6415 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6416 #if !defined __cpp_guaranteed_copy_elision
6421 S copy() const { return *this; }
6423 void f(S & s) { S c(s.copy()); }
6426 AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
6427 AC_MSG_RESULT([yes])
6428 ], [AC_MSG_RESULT([no])])
6429 CXXFLAGS=$save_CXXFLAGS
6432 AC_MSG_CHECKING([whether $CXX supports inline variables])
6434 save_CXXFLAGS=$CXXFLAGS
6435 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6436 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6437 #if !defined __cpp_inline_variables
6438 // This tests for one specific aspect of inline variables that is actually used by
6439 // ORegistry::ROOT (registry/source/regimpl.cxx):
6440 struct S { constexpr S() {} };
6441 struct T { static constexpr S s{}; };
6442 S const * f() { return &T::s; }
6445 AC_DEFINE([HAVE_CPP_INLINE_VARIABLES],[1])
6446 AC_MSG_RESULT([yes])
6447 ], [AC_MSG_RESULT([no])])
6448 CXXFLAGS=$save_CXXFLAGS
6451 AC_MSG_CHECKING([whether $CXX has a fix for CWG1579])
6453 save_CXXFLAGS=$CXXFLAGS
6454 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6455 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6459 std::unique_ptr<S1> f() {
6460 std::unique_ptr<S2> s2(new S2);
6464 AC_DEFINE([HAVE_CXX_CWG1579_FIX],[1])
6465 AC_MSG_RESULT([yes])
6466 ], [AC_MSG_RESULT([no])])
6467 CXXFLAGS=$save_CXXFLAGS
6470 AC_MSG_CHECKING([whether $CXX has GCC bug 87150])
6472 save_CXXFLAGS=$CXXFLAGS
6473 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6474 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6475 struct S1 { S1(S1 &&); };
6477 S1 f(S2 s) { return s; }
6479 AC_DEFINE([HAVE_GCC_BUG_87150],[1])
6480 AC_MSG_RESULT([yes])
6481 ], [AC_MSG_RESULT([no])])
6482 CXXFLAGS=$save_CXXFLAGS
6485 dnl ===================================================================
6486 dnl system stl sanity tests
6487 dnl ===================================================================
6488 if test "$_os" != "WINNT"; then
6492 save_CPPFLAGS="$CPPFLAGS"
6493 if test -n "$MACOSX_SDK_PATH"; then
6494 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6497 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6499 if test "$CPP_LIBRARY" = GLIBCXX; then
6500 dnl gcc#19664, gcc#22482, rhbz#162935
6501 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6502 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6503 AC_MSG_RESULT([$stlvisok])
6504 if test "$stlvisok" = "no"; then
6505 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
6509 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6510 # when we don't make any dynamic libraries?
6511 if test "$DISABLE_DYNLOADING" = ""; then
6512 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6513 cat > conftestlib1.cc <<_ACEOF
6514 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6515 struct S2: S1<int> { virtual ~S2(); };
6518 cat > conftestlib2.cc <<_ACEOF
6519 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6520 struct S2: S1<int> { virtual ~S2(); };
6521 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6523 gccvisinlineshiddenok=yes
6524 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6525 gccvisinlineshiddenok=no
6527 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6528 dnl known to not work with -z defs (unsetting which makes the test
6530 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6531 if test "$COM_IS_CLANG" = TRUE; then
6532 for i in $CXX $CXXFLAGS; do
6535 my_linkflagsnoundefs=
6541 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6542 gccvisinlineshiddenok=no
6547 AC_MSG_RESULT([$gccvisinlineshiddenok])
6548 if test "$gccvisinlineshiddenok" = "no"; then
6549 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6553 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6554 cat >visibility.cxx <<_ACEOF
6555 #pragma GCC visibility push(hidden)
6556 struct __attribute__ ((visibility ("default"))) TestStruct {
6559 __attribute__ ((visibility ("default"))) void TestFunc() {
6563 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
6568 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
6571 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
6583 rm -f visibility.s visibility.cxx
6585 AC_MSG_RESULT([$gccvisbroken])
6586 if test "$gccvisbroken" = "yes"; then
6587 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
6590 CPPFLAGS="$save_CPPFLAGS"
6595 dnl ===================================================================
6597 dnl ===================================================================
6599 HAVE_GCC_FNO_DEFAULT_INLINE=
6600 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6601 if test "$GCC" = "yes"; then
6602 AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
6604 save_CXXFLAGS=$CXXFLAGS
6605 CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
6606 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
6607 CXXFLAGS=$save_CXXFLAGS
6609 if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
6610 AC_MSG_RESULT([yes])
6615 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6617 save_CXXFLAGS=$CXXFLAGS
6618 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6619 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6620 CXXFLAGS=$save_CXXFLAGS
6622 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6623 AC_MSG_RESULT([yes])
6628 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
6629 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6631 dnl ===================================================================
6632 dnl Compiler plugins
6633 dnl ===================================================================
6636 # currently only Clang
6638 if test "$COM_IS_CLANG" != "TRUE"; then
6639 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
6640 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
6641 enable_compiler_plugins=no
6645 if test "$COM_IS_CLANG" = "TRUE"; then
6646 if test -n "$enable_compiler_plugins"; then
6647 compiler_plugins="$enable_compiler_plugins"
6648 elif test -n "$ENABLE_DBGUTIL"; then
6649 compiler_plugins=test
6653 if test "$compiler_plugins" != no -a "$CLANGVER" -lt 30800; then
6654 if test "$compiler_plugins" = yes; then
6655 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 3.8.0.])
6660 if test "$compiler_plugins" != "no"; then
6661 dnl The prefix where Clang resides, override to where Clang resides if
6662 dnl using a source build:
6663 if test -z "$CLANGDIR"; then
6667 save_CPPFLAGS=$CPPFLAGS
6669 # compiler plugins must be built with "native" compiler that was used to build Clang itself:
6670 : "${COMPILER_PLUGINS_CXX=g++}"
6671 CXX=$COMPILER_PLUGINS_CXX
6672 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
6673 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
6674 [COMPILER_PLUGINS=TRUE],
6676 if test "$compiler_plugins" = "yes"; then
6677 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
6679 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
6680 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
6684 CPPFLAGS=$save_CPPFLAGS
6688 if test "$enable_compiler_plugins" = "yes"; then
6689 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
6692 AC_SUBST(COMPILER_PLUGINS)
6693 AC_SUBST(COMPILER_PLUGINS_CXX)
6694 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
6695 AC_SUBST(COMPILER_PLUGINS_DEBUG)
6697 AC_SUBST(CLANGLIBDIR)
6699 # Plugin to help linker.
6700 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
6701 # This makes --enable-lto build with clang work.
6704 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6705 AC_SUBST(HAVE_POSIX_FALLOCATE)
6707 dnl ===================================================================
6708 dnl Custom build version
6709 dnl ===================================================================
6711 AC_MSG_CHECKING([whether to add custom build version])
6712 if test "$with_build_version" != ""; then
6713 BUILD_VER_STRING=$with_build_version
6714 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6719 AC_SUBST(BUILD_VER_STRING)
6721 JITC_PROCESSOR_TYPE=""
6722 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6723 # IBMs JDK needs this...
6724 JITC_PROCESSOR_TYPE=6
6725 export JITC_PROCESSOR_TYPE
6727 AC_SUBST([JITC_PROCESSOR_TYPE])
6729 # Misc Windows Stuff
6730 AC_ARG_WITH(ucrt-dir,
6731 AS_HELP_STRING([--with-ucrt-dir],
6732 [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
6733 (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
6734 the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
6735 Windows6.1-KB2999226-x64.msu
6736 Windows6.1-KB2999226-x86.msu
6737 Windows8.1-KB2999226-x64.msu
6738 Windows8.1-KB2999226-x86.msu
6739 Windows8-RT-KB2999226-x64.msu
6740 Windows8-RT-KB2999226-x86.msu
6741 A zip archive including those files is available from Microsoft site:
6742 https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
6744 UCRT_REDISTDIR="$with_ucrt_dir"
6745 if test $_os = "WINNT"; then
6748 MSVC_DLL_PATH="$msvcdllpath"
6749 MSVC_DLLS="$msvcdlls"
6751 # MSVC 15.3 changed it to VC141
6752 if echo "$MSVC_DLL_PATH" | grep -q "VC141.CRT$"; then
6753 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
6755 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6757 if test "$UCRT_REDISTDIR" = "no"; then
6758 dnl explicitly disabled
6761 if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
6762 -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
6763 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
6764 -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
6765 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
6766 -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
6768 if test -n "$PKGFORMAT"; then
6769 for i in $PKGFORMAT; do
6772 AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
6773 add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
6782 AC_SUBST(UCRT_REDISTDIR)
6783 AC_SUBST(MSVC_DLL_PATH)
6787 dnl ===================================================================
6789 dnl ===================================================================
6790 if test "$ENABLE_JAVA" != ""; then
6792 # Windows-specific tests
6793 if test "$build_os" = "cygwin"; then
6794 if test "$BITNESS_OVERRIDE" = 64; then
6800 if test -z "$with_jdk_home"; then
6801 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
6802 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
6803 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
6804 if test -n "$regvalue"; then
6806 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
6809 if test -z "$with_jdk_home"; then
6810 for ver in 1.8 1.7 1.6; do
6811 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
6812 if test -n "$regvalue"; then
6818 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
6819 with_jdk_home="$_jdk_home"
6820 howfound="found automatically"
6822 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
6825 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
6826 howfound="you passed"
6830 # 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.
6831 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
6832 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
6833 with_jdk_home=`/usr/libexec/java_home`
6836 JAVA_HOME=; export JAVA_HOME
6837 if test -z "$with_jdk_home"; then
6838 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
6840 _java_path="$with_jdk_home/bin/$with_java"
6841 dnl Check if there is a Java interpreter at all.
6842 if test -x "$_java_path"; then
6843 JAVAINTERPRETER=$_java_path
6845 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
6849 dnl Check that the JDK found is correct architecture (at least 2 reasons to
6850 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
6851 dnl loaded by java to run JunitTests:
6852 if test "$build_os" = "cygwin"; then
6853 shortjdkhome=`cygpath -d "$with_jdk_home"`
6854 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
6855 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
6856 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6857 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
6858 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6859 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6862 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6863 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6865 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
6866 elif test "$cross_compiling" != "yes"; then
6868 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
6869 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
6870 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
6871 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6874 *) # assumption: everything else 32-bit
6875 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
6876 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6877 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6885 dnl ===================================================================
6887 dnl ===================================================================
6889 # Note that JAVA_HOME as for now always means the *build* platform's
6890 # JAVA_HOME. Whether all the complexity here actually is needed any
6891 # more or not, no idea.
6893 if test "$ENABLE_JAVA" != ""; then
6895 AC_MSG_CHECKING([the installed JDK])
6896 if test -n "$JAVAINTERPRETER"; then
6897 dnl java -version sends output to stderr!
6898 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6899 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6900 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6901 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6902 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6903 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6904 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6907 dnl IBM JDK specific tests
6908 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6909 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6911 if test "$_jdk_ver" -lt 10600; then
6912 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.6])
6915 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6917 if test "$with_jdk_home" = ""; then
6918 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6919 you must use the "--with-jdk-home" configure option explicitly])
6922 JAVA_HOME=$with_jdk_home
6926 dnl Sun JDK specific tests
6927 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
6928 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6930 if test "$_jdk_ver" -lt 10600; then
6931 AC_MSG_ERROR([JDK is too old, you need at least 1.6])
6933 if test "$_jdk_ver" -gt 10600; then
6934 JAVA_CLASSPATH_NOT_SET=TRUE
6936 if test "$_jdk_ver" -ge 10900; then
6940 AC_MSG_RESULT([checked (JDK $_jdk)])
6941 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6942 if test "$_os" = "WINNT"; then
6943 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6946 # set to limit VM usage for JunitTests
6948 # set to limit VM usage for javac
6949 JAVAFLAGS=-J-Xmx128M
6952 AC_MSG_ERROR([Java not found. You need at least jdk-1.6])
6960 dnl ===================================================================
6961 dnl Set target Java bytecode version
6962 dnl ===================================================================
6963 if test "$ENABLE_JAVA" != ""; then
6964 if test "$HAVE_JAVA9" = "TRUE"; then
6965 _java_target_ver="1.6"
6967 _java_target_ver="1.5"
6969 JAVA_SOURCE_VER="$_java_target_ver"
6970 JAVA_TARGET_VER="$_java_target_ver"
6973 dnl ===================================================================
6974 dnl Checks for javac
6975 dnl ===================================================================
6976 if test "$ENABLE_JAVA" != ""; then
6977 javacompiler="javac"
6978 if test -z "$with_jdk_home"; then
6979 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
6981 _javac_path="$with_jdk_home/bin/$javacompiler"
6982 dnl Check if there is a Java compiler at all.
6983 if test -x "$_javac_path"; then
6984 JAVACOMPILER=$_javac_path
6987 if test -z "$JAVACOMPILER"; then
6988 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
6990 if test "$build_os" = "cygwin"; then
6991 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
6992 JAVACOMPILER="${JAVACOMPILER}.exe"
6994 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
6998 dnl ===================================================================
6999 dnl Checks for javadoc
7000 dnl ===================================================================
7001 if test "$ENABLE_JAVA" != ""; then
7002 if test -z "$with_jdk_home"; then
7003 AC_PATH_PROG(JAVADOC, javadoc)
7005 _javadoc_path="$with_jdk_home/bin/javadoc"
7006 dnl Check if there is a javadoc at all.
7007 if test -x "$_javadoc_path"; then
7008 JAVADOC=$_javadoc_path
7010 AC_PATH_PROG(JAVADOC, javadoc)
7013 if test -z "$JAVADOC"; then
7014 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7016 if test "$build_os" = "cygwin"; then
7017 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7018 JAVADOC="${JAVADOC}.exe"
7020 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7023 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7024 JAVADOCISGJDOC="yes"
7027 AC_SUBST(JAVADOCISGJDOC)
7029 if test "$ENABLE_JAVA" != ""; then
7030 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7031 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7032 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7033 # try to recover first by looking whether we have a alternatives
7034 # system as in Debian or newer SuSEs where following /usr/bin/javac
7035 # over /etc/alternatives/javac leads to the right bindir where we
7036 # just need to strip a bit away to get a valid JAVA_HOME
7037 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7038 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7039 # maybe only one level of symlink (e.g. on Mac)
7040 JAVA_HOME=$(readlink $JAVACOMPILER)
7041 if test "$(dirname $JAVA_HOME)" = "."; then
7042 # we've got no path to trim back
7047 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7048 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7049 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7050 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7052 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
7053 if test "$JAVA_HOME" != "/usr"; then
7054 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7055 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7056 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7057 dnl Tiger already returns a JDK path..
7058 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7060 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7061 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7062 dnl that checks which version to run
7063 if test -f "$JAVA_HOME"; then
7064 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7069 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7071 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7072 if test -z "$JAVA_HOME"; then
7073 if test "x$with_jdk_home" = "x"; then
7074 cat > findhome.java <<_ACEOF
7075 [import java.io.File;
7079 public static void main(String args[])
7081 String jrelocation = System.getProperty("java.home");
7082 File jre = new File(jrelocation);
7083 System.out.println(jre.getParent());
7087 AC_MSG_CHECKING([if javac works])
7088 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7089 AC_TRY_EVAL(javac_cmd)
7090 if test $? = 0 -a -f ./findhome.class; then
7091 AC_MSG_RESULT([javac works])
7093 echo "configure: javac test failed" >&5
7094 cat findhome.java >&5
7095 AC_MSG_ERROR([javac does not work - java projects will not build!])
7097 AC_MSG_CHECKING([if gij knows its java.home])
7098 JAVA_HOME=`$JAVAINTERPRETER findhome`
7099 if test $? = 0 -a "$JAVA_HOME" != ""; then
7100 AC_MSG_RESULT([$JAVA_HOME])
7102 echo "configure: java test failed" >&5
7103 cat findhome.java >&5
7104 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7106 # clean-up after ourselves
7107 rm -f ./findhome.java ./findhome.class
7109 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7113 # now check if $JAVA_HOME is really valid
7114 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7115 case "${JAVA_HOME}" in
7116 /Library/Java/JavaVirtualMachines/*)
7119 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7122 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7125 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7128 if test "$JAVA_HOME_OK" = "NO"; then
7129 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7130 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7131 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
7132 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7133 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7134 add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
7136 PathFormat "$JAVA_HOME"
7137 JAVA_HOME="$formatted_path"
7140 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7143 AC_MSG_CHECKING([for JAWT lib])
7144 if test "$_os" = WINNT; then
7145 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7150 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7151 JAVA_ARCH=$my_java_arch
7166 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7167 JAVA_ARCH=$my_java_arch
7170 my_java_arch=sparcv9
7176 my_java_arch=$host_cpu
7179 # This is where JDK9 puts the library
7180 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7181 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7183 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7185 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7187 AC_MSG_RESULT([$JAWTLIB])
7191 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7195 JAVAINC="-I$JAVA_HOME/include"
7196 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7197 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7201 JAVAINC="-I$JAVA_HOME/include/win32"
7202 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7206 if test -d "$JAVA_HOME/include/darwin"; then
7207 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7209 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7214 JAVAINC="-I$JAVA_HOME/include"
7215 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7219 JAVAINC="-I$JAVA_HOME/include"
7220 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7221 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7222 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7223 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7227 JAVAINC="-I$JAVA_HOME/include"
7228 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7229 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7233 JAVAINC="-I$JAVA_HOME/include"
7234 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7235 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7239 JAVAINC="-I$JAVA_HOME/include"
7240 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7241 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7245 JAVAINC="-I$JAVA_HOME/include"
7246 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7247 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7251 JAVAINC="-I$JAVA_HOME/include"
7252 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7253 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7257 SOLARINC="$SOLARINC $JAVAINC"
7259 AC_SUBST(JAVACOMPILER)
7261 AC_SUBST(JAVAINTERPRETER)
7262 AC_SUBST(JAVAIFLAGS)
7264 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7266 AC_SUBST(JAVA_SOURCE_VER)
7267 AC_SUBST(JAVA_TARGET_VER)
7271 dnl ===================================================================
7272 dnl Export file validation
7273 dnl ===================================================================
7274 AC_MSG_CHECKING([whether to enable export file validation])
7275 if test "$with_export_validation" != "no"; then
7276 if test -z "$ENABLE_JAVA"; then
7277 if test "$with_export_validation" = "yes"; then
7278 AC_MSG_ERROR([requested, but Java is disabled])
7280 AC_MSG_RESULT([no, as Java is disabled])
7282 elif test "$_jdk_ver" -lt 10800; then
7283 if test "$with_export_validation" = "yes"; then
7284 AC_MSG_ERROR([requested, but Java is too old, need Java 8])
7286 AC_MSG_RESULT([no, as Java is too old, need Java 8])
7289 AC_MSG_RESULT([yes])
7290 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7292 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7293 if test -z "$ODFVALIDATOR"; then
7294 # remember to download the ODF toolkit with validator later
7295 AC_MSG_NOTICE([no odfvalidator found, will download it])
7296 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7297 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7299 # and fetch name of odfvalidator jar name from download.lst
7300 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7301 AC_SUBST(ODFVALIDATOR_JAR)
7303 if test -z "$ODFVALIDATOR_JAR"; then
7304 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7307 if test "$build_os" = "cygwin"; then
7308 # In case of Cygwin it will be executed from Windows,
7309 # so we need to run bash and absolute path to validator
7310 # so instead of "odfvalidator" it will be
7311 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7312 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7314 ODFVALIDATOR="sh $ODFVALIDATOR"
7316 AC_SUBST(ODFVALIDATOR)
7319 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7320 if test -z "$OFFICEOTRON"; then
7321 # remember to download the officeotron with validator later
7322 AC_MSG_NOTICE([no officeotron found, will download it])
7323 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7324 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7326 # and fetch name of officeotron jar name from download.lst
7327 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7328 AC_SUBST(OFFICEOTRON_JAR)
7330 if test -z "$OFFICEOTRON_JAR"; then
7331 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7334 # check version of existing officeotron
7335 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7336 if test 0"$OFFICEOTRON_VER" -lt 704; then
7337 AC_MSG_ERROR([officeotron too old])
7340 if test "$build_os" = "cygwin"; then
7341 # In case of Cygwin it will be executed from Windows,
7342 # so we need to run bash and absolute path to validator
7343 # so instead of "odfvalidator" it will be
7344 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7345 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7347 OFFICEOTRON="sh $OFFICEOTRON"
7350 AC_SUBST(OFFICEOTRON)
7355 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7356 if test "$with_bffvalidator" != "no"; then
7357 AC_DEFINE(HAVE_BFFVALIDATOR)
7359 if test "$with_export_validation" = "no"; then
7360 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7363 if test "$with_bffvalidator" = "yes"; then
7364 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7366 BFFVALIDATOR="$with_bffvalidator"
7369 if test "$build_os" = "cygwin"; then
7370 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7371 AC_MSG_RESULT($BFFVALIDATOR)
7373 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7375 elif test -n "$BFFVALIDATOR"; then
7376 # We are not in Cygwin but need to run Windows binary with wine
7377 AC_PATH_PROGS(WINE, wine)
7379 # so swap in a shell wrapper that converts paths transparently
7380 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7381 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7382 AC_SUBST(BFFVALIDATOR_EXE)
7383 AC_MSG_RESULT($BFFVALIDATOR)
7385 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7387 AC_SUBST(BFFVALIDATOR)
7392 dnl ===================================================================
7393 dnl Check for C preprocessor to use
7394 dnl ===================================================================
7395 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7396 if test -n "$with_idlc_cpp"; then
7397 AC_MSG_RESULT([$with_idlc_cpp])
7398 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7400 AC_MSG_RESULT([ucpp])
7401 AC_MSG_CHECKING([which ucpp tp use])
7402 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7403 AC_MSG_RESULT([external])
7404 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7406 AC_MSG_RESULT([internal])
7407 BUILD_TYPE="$BUILD_TYPE UCPP"
7410 AC_SUBST(SYSTEM_UCPP)
7412 dnl ===================================================================
7413 dnl Check for epm (not needed for Windows)
7414 dnl ===================================================================
7415 AC_MSG_CHECKING([whether to enable EPM for packing])
7416 if test "$enable_epm" = "yes"; then
7417 AC_MSG_RESULT([yes])
7418 if test "$_os" != "WINNT"; then
7419 if test $_os = Darwin; then
7421 elif test -n "$with_epm"; then
7424 AC_PATH_PROG(EPM, epm, no)
7426 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7427 AC_MSG_NOTICE([EPM will be built.])
7428 BUILD_TYPE="$BUILD_TYPE EPM"
7429 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7431 # Gentoo has some epm which is something different...
7432 AC_MSG_CHECKING([whether the found epm is the right epm])
7433 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7434 AC_MSG_RESULT([yes])
7436 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7438 AC_MSG_CHECKING([epm version])
7439 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7440 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7441 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7442 AC_MSG_RESULT([OK, >= 3.7])
7444 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7445 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7450 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7451 AC_MSG_CHECKING([for rpm])
7452 for a in "$RPM" rpmbuild rpm; do
7453 $a --usage >/dev/null 2> /dev/null
7454 if test $? -eq 0; then
7458 $a --version >/dev/null 2> /dev/null
7459 if test $? -eq 0; then
7465 if test -z "$RPM"; then
7466 AC_MSG_ERROR([not found])
7467 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7468 RPM_PATH=`which $RPM`
7469 AC_MSG_RESULT([$RPM_PATH])
7470 SCPDEFS="$SCPDEFS -DWITH_RPM"
7472 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7475 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7476 AC_PATH_PROG(DPKG, dpkg, no)
7477 if test "$DPKG" = "no"; then
7478 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7481 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7482 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7483 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7484 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7485 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7486 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
7487 AC_MSG_RESULT([yes])
7490 if echo "$PKGFORMAT" | $GREP -q rpm; then
7492 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7493 add_warning "the rpms will need to be installed with --nodeps"
7497 AC_MSG_WARN([the ${_pt}s will not be relocatable])
7498 add_warning "the ${_pt}s will not be relocatable"
7499 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7500 relocation will work, you need to patch your epm with the
7501 patch in epm/epm-3.7.patch or build with
7502 --with-epm=internal which will build a suitable epm])
7507 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7508 AC_PATH_PROG(PKGMK, pkgmk, no)
7509 if test "$PKGMK" = "no"; then
7510 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7517 for i in $PKGFORMAT; do
7519 aix | bsd | deb | pkg | rpm | native | portable)
7521 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7531 if test "$enable_lotuswordpro" = "yes"; then
7534 AC_SUBST(ENABLE_LWP)
7536 dnl ===================================================================
7537 dnl Check for building ODK
7538 dnl ===================================================================
7539 if test "$enable_odk" = no; then
7542 if test "$with_doxygen" = no; then
7543 AC_MSG_CHECKING([for doxygen])
7547 if test "$with_doxygen" = yes; then
7548 AC_PATH_PROG([DOXYGEN], [doxygen])
7549 if test -z "$DOXYGEN"; then
7550 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7552 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
7553 if ! dot -V 2>/dev/null; then
7554 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
7558 AC_MSG_CHECKING([for doxygen])
7559 DOXYGEN=$with_doxygen
7560 AC_MSG_RESULT([$DOXYGEN])
7562 if test -n "$DOXYGEN"; then
7563 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7564 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7565 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7566 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7573 AC_MSG_CHECKING([whether to build the ODK])
7574 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7575 AC_MSG_RESULT([yes])
7577 if test "$with_java" != "no"; then
7578 AC_MSG_CHECKING([whether to build unowinreg.dll])
7579 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7580 # build on Win by default
7581 enable_build_unowinreg=yes
7583 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7587 AC_MSG_RESULT([yes])
7588 BUILD_UNOWINREG=TRUE
7590 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7591 if test -z "$with_mingw_cross_compiler"; then
7593 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7594 elif test -x "$with_mingw_cross_compiler"; then
7595 MINGWCXX="$with_mingw_cross_compiler"
7597 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7600 if test "$MINGWCXX" = "false"; then
7601 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7604 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7605 if test -x "$mingwstrip_test"; then
7606 MINGWSTRIP="$mingwstrip_test"
7608 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7611 if test "$MINGWSTRIP" = "false"; then
7612 AC_MSG_ERROR(MinGW32 binutils not found.)
7616 BUILD_TYPE="$BUILD_TYPE ODK"
7621 AC_SUBST(BUILD_UNOWINREG)
7623 AC_SUBST(MINGWSTRIP)
7625 dnl ===================================================================
7626 dnl Check for system zlib
7627 dnl ===================================================================
7628 if test "$with_system_zlib" = "auto"; then
7631 with_system_zlib="$with_system_libs"
7634 if test "$enable_fuzzers" != "yes"; then
7635 with_system_zlib=yes
7643 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
7644 dnl and has no pkg-config for it at least on some tinderboxes,
7645 dnl so leaving that out for now
7646 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7647 AC_MSG_CHECKING([which zlib to use])
7648 if test "$with_system_zlib" = "yes"; then
7649 AC_MSG_RESULT([external])
7651 AC_CHECK_HEADER(zlib.h, [],
7652 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7653 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
7654 [AC_MSG_ERROR(zlib not found or functional)], [])
7656 AC_MSG_RESULT([internal])
7658 BUILD_TYPE="$BUILD_TYPE ZLIB"
7659 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7660 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
7662 AC_SUBST(ZLIB_CFLAGS)
7664 AC_SUBST(SYSTEM_ZLIB)
7666 dnl ===================================================================
7667 dnl Check for system jpeg
7668 dnl ===================================================================
7669 AC_MSG_CHECKING([which libjpeg to use])
7670 if test "$with_system_jpeg" = "yes"; then
7671 AC_MSG_RESULT([external])
7673 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
7674 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7675 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
7676 [AC_MSG_ERROR(jpeg library not found or fuctional)], [])
7679 AC_MSG_RESULT([internal, libjpeg-turbo])
7680 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
7681 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
7682 if test "$COM" = "MSC"; then
7683 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
7685 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
7689 x86_64 | amd64 | i*86 | x86 | ia32)
7690 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
7691 if test -z "$NASM" -a "$build_os" = "cygwin"; then
7692 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
7693 NASM="$LODE_HOME/opt/bin/nasm"
7694 elif test -x "/opt/lo/bin/nasm"; then
7695 NASM="/opt/lo/bin/nasm"
7699 if test -n "$NASM"; then
7700 AC_MSG_CHECKING([for object file format of host system])
7702 cygwin* | mingw* | pw32* | interix*)
7712 msdosdjgpp* | go32*)
7715 os2-emx*) # not tested
7716 objfmt='MSOMF' # obj
7718 linux*coff* | linux*oldld*)
7734 kfreebsd* | freebsd* | netbsd* | openbsd*)
7735 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7748 solaris* | sunos* | sysv* | sco*)
7758 darwin* | rhapsody* | nextstep* | openstep* | macos*)
7773 AC_MSG_RESULT([$objfmt])
7774 if test "$objfmt" = 'ELF ?'; then
7776 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
7779 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
7781 MSOMF) NAFLAGS='-fobj -DOBJ32';;
7782 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
7783 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
7784 COFF) NAFLAGS='-fcoff -DCOFF';;
7785 a.out) NAFLAGS='-faout -DAOUT';;
7786 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
7787 ELF) NAFLAGS='-felf -DELF';;
7788 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
7789 RDF) NAFLAGS='-frdf -DRDF';;
7790 Mach-O) NAFLAGS='-fmacho -DMACHO';;
7791 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
7793 AC_MSG_RESULT([$NAFLAGS])
7795 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
7796 cat > conftest.asm << EOF
7797 [%line __oline__ "configure"
7805 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
7806 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
7809 echo "configure: failed program was:" >&AC_FD_CC
7810 cat conftest.asm >&AC_FD_CC
7813 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
7819 if test -z "$NASM"; then
7821 ****************************************************************************
7822 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
7826 if test "$build_os" = "cygwin"; then
7828 install a pre-compiled binary for Win32
7830 mkdir -p /opt/lo/bin
7832 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
7835 or get and install one from http://www.nasm.us/
7837 Then re-run autogen.sh
7839 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
7840 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
7845 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
7849 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
7850 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
7857 AC_SUBST(LIBJPEG_CFLAGS)
7858 AC_SUBST(LIBJPEG_LIBS)
7859 AC_SUBST(SYSTEM_LIBJPEG)
7861 dnl ===================================================================
7862 dnl Check for system clucene
7863 dnl ===================================================================
7864 dnl we should rather be using
7865 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
7866 dnl but the contribs-lib check seems tricky
7867 AC_MSG_CHECKING([which clucene to use])
7868 if test "$with_system_clucene" = "yes"; then
7869 AC_MSG_RESULT([external])
7871 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
7872 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
7873 FilterLibs "${CLUCENE_LIBS}"
7874 CLUCENE_LIBS="${filteredlibs}"
7876 save_CXXFLAGS=$CXXFLAGS
7877 save_CPPFLAGS=$CPPFLAGS
7878 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
7879 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
7880 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
7881 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
7882 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
7883 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
7884 CXXFLAGS=$save_CXXFLAGS
7885 CPPFLAGS=$save_CPPFLAGS
7888 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
7890 AC_MSG_RESULT([internal])
7892 BUILD_TYPE="$BUILD_TYPE CLUCENE"
7894 AC_SUBST(SYSTEM_CLUCENE)
7895 AC_SUBST(CLUCENE_CFLAGS)
7896 AC_SUBST(CLUCENE_LIBS)
7898 dnl ===================================================================
7899 dnl Check for system expat
7900 dnl ===================================================================
7901 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
7903 dnl ===================================================================
7904 dnl Check for system xmlsec
7905 dnl ===================================================================
7906 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
7908 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
7909 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
7911 AC_DEFINE([ENABLE_EOT])
7912 AC_MSG_RESULT([yes])
7914 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
7919 AC_SUBST([ENABLE_EOT])
7921 dnl ===================================================================
7922 dnl Check for DLP libs
7923 dnl ===================================================================
7924 AS_IF([test "$COM" = "MSC"],
7925 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
7926 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
7928 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
7930 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
7932 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
7934 AS_IF([test "$COM" = "MSC"],
7935 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
7936 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
7938 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
7940 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
7942 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
7943 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
7945 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
7947 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
7949 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
7951 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
7952 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.14])
7954 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
7955 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
7957 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
7959 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
7960 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
7962 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
7964 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
7966 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
7968 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
7970 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
7971 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
7973 dnl ===================================================================
7974 dnl Check for system lcms2
7975 dnl ===================================================================
7976 if test "$with_system_lcms2" != "yes"; then
7979 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
7980 if test "$GCC" = "yes"; then
7981 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7983 if test "$COM" = "MSC"; then # override the above
7984 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
7987 dnl ===================================================================
7988 dnl Check for system cppunit
7989 dnl ===================================================================
7990 if test "$cross_compiling" != "yes"; then
7991 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
7994 dnl ===================================================================
7995 dnl Check whether freetype is available
7996 dnl ===================================================================
7997 if test "$test_freetype" = "yes"; then
7998 AC_MSG_CHECKING([whether freetype is available])
7999 # FreeType has 3 different kinds of versions
8000 # * release, like 2.4.10
8001 # * libtool, like 13.0.7 (this what pkg-config returns)
8003 # FreeType's docs/VERSION.DLL provides a table mapping between the three
8006 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
8007 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8008 FilterLibs "${FREETYPE_LIBS}"
8009 FREETYPE_LIBS="${filteredlibs}"
8010 SYSTEM_FREETYPE=TRUE
8012 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
8013 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
8015 AC_SUBST(FREETYPE_CFLAGS)
8016 AC_SUBST(FREETYPE_LIBS)
8017 AC_SUBST([SYSTEM_FREETYPE])
8019 # ===================================================================
8020 # Check for system libxslt
8021 # to prevent incompatibilities between internal libxml2 and external libxslt,
8022 # or vice versa, use with_system_libxml here
8023 # ===================================================================
8024 if test "$with_system_libxml" = "auto"; then
8027 with_system_libxml="$with_system_libs"
8030 if test "$enable_fuzzers" != "yes"; then
8031 with_system_libxml=yes
8033 with_system_libxml=no
8039 AC_MSG_CHECKING([which libxslt to use])
8040 if test "$with_system_libxml" = "yes"; then
8041 AC_MSG_RESULT([external])
8043 if test "$_os" = "Darwin"; then
8044 dnl make sure to use SDK path
8045 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8046 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8048 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8049 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8051 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8052 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8053 FilterLibs "${LIBXSLT_LIBS}"
8054 LIBXSLT_LIBS="${filteredlibs}"
8055 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8056 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8057 FilterLibs "${LIBEXSLT_LIBS}"
8058 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8061 dnl Check for xsltproc
8062 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8063 if test "$XSLTPROC" = "no"; then
8064 AC_MSG_ERROR([xsltproc is required])
8067 AC_MSG_RESULT([internal])
8069 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8071 if test "$cross_compiling" = "yes"; then
8072 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8073 if test "$XSLTPROC" = "no"; then
8074 AC_MSG_ERROR([xsltproc is required])
8078 AC_SUBST(SYSTEM_LIBXSLT)
8079 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8080 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8082 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8084 AC_SUBST(LIBEXSLT_CFLAGS)
8085 AC_SUBST(LIBEXSLT_LIBS)
8086 AC_SUBST(LIBXSLT_CFLAGS)
8087 AC_SUBST(LIBXSLT_LIBS)
8090 # ===================================================================
8091 # Check for system libxml
8092 # ===================================================================
8093 AC_MSG_CHECKING([which libxml to use])
8094 if test "$with_system_libxml" = "yes"; then
8095 AC_MSG_RESULT([external])
8097 if test "$_os" = "Darwin"; then
8098 dnl make sure to use SDK path
8099 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8101 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8102 elif test $_os = iOS; then
8103 dnl make sure to use SDK path
8104 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8105 LIBXML_CFLAGS="-I$usr/include/libxml2"
8106 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8108 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8109 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8110 FilterLibs "${LIBXML_LIBS}"
8111 LIBXML_LIBS="${filteredlibs}"
8114 dnl Check for xmllint
8115 AC_PATH_PROG(XMLLINT, xmllint, no)
8116 if test "$XMLLINT" = "no"; then
8117 AC_MSG_ERROR([xmllint is required])
8120 AC_MSG_RESULT([internal])
8122 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8123 if test "$COM" = "MSC"; then
8124 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8126 if test "$COM" = "MSC"; then
8127 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8129 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8131 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8133 AC_SUBST(SYSTEM_LIBXML)
8134 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8135 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8137 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8138 AC_SUBST(LIBXML_CFLAGS)
8139 AC_SUBST(LIBXML_LIBS)
8142 # =====================================================================
8143 # Checking for a Python interpreter with version >= 2.7.
8144 # Build and runtime requires Python 3 compatible version (>= 2.7).
8145 # Optionally user can pass an option to configure, i. e.
8146 # ./configure PYTHON=/usr/bin/python
8147 # =====================================================================
8148 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8149 # This allows a lack of system python with no error, we use internal one in that case.
8150 AM_PATH_PYTHON([2.7],, [:])
8151 # Clean PYTHON_VERSION checked below if cross-compiling
8153 if test "$PYTHON" != ":"; then
8154 PYTHON_FOR_BUILD=$PYTHON
8157 AC_SUBST(PYTHON_FOR_BUILD)
8159 # Checks for Python to use for Pyuno
8160 AC_MSG_CHECKING([which Python to use for Pyuno])
8161 case "$enable_python" in
8163 if test -z $PYTHON_FOR_BUILD; then
8164 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8165 # requirement from the choice whether to include Python stuff in the installer, but why
8167 AC_MSG_ERROR([Python is required at build time.])
8170 AC_MSG_RESULT([none])
8173 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8174 AC_MSG_RESULT([no, overridden by --disable-scripting])
8176 elif test $build_os = cygwin; then
8177 dnl When building on Windows we don't attempt to use any installed
8178 dnl "system" Python.
8179 AC_MSG_RESULT([fully internal])
8180 enable_python=internal
8181 elif test "$cross_compiling" = yes; then
8182 AC_MSG_RESULT([system])
8183 enable_python=system
8185 # Unset variables set by the above AM_PATH_PYTHON so that
8186 # we actually do check anew.
8187 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
8188 AM_PATH_PYTHON([3.3],, [:])
8189 if test "$PYTHON" = ":"; then
8190 if test -z "$PYTHON_FOR_BUILD"; then
8191 AC_MSG_RESULT([fully internal])
8193 AC_MSG_RESULT([internal])
8195 enable_python=internal
8197 AC_MSG_RESULT([system])
8198 enable_python=system
8203 AC_MSG_RESULT([internal])
8206 AC_MSG_RESULT([fully internal])
8207 enable_python=internal
8210 AC_MSG_RESULT([system])
8213 AC_MSG_ERROR([Incorrect --enable-python option])
8217 if test $enable_python != no; then
8218 BUILD_TYPE="$BUILD_TYPE PYUNO"
8221 if test $enable_python = system; then
8222 if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
8224 PYTHON=python$python_version
8225 if test -d "$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"; then
8226 PYTHON_CFLAGS="-I$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"
8227 PYTHON_LIBS="-framework Python"
8229 PYTHON_CFLAGS="`$PYTHON-config --includes`"
8230 PYTHON_LIBS="`$PYTHON-config --libs`"
8233 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8234 # Fallback: Accept these in the environment, or as set above
8237 elif test "$cross_compiling" != yes; then
8238 # Unset variables set by the above AM_PATH_PYTHON so that
8239 # we actually do check anew.
8240 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
8241 # This causes an error if no python command is found
8242 AM_PATH_PYTHON([3.3])
8243 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8244 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8245 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8246 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8247 if test -z "$PKG_CONFIG"; then
8248 PYTHON_CFLAGS="-I$python_include"
8249 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8250 elif $PKG_CONFIG --exists python-$python_version; then
8251 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8252 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8254 PYTHON_CFLAGS="-I$python_include"
8255 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8257 FilterLibs "${PYTHON_LIBS}"
8258 PYTHON_LIBS="${filteredlibs}"
8260 dnl How to find out the cross-compilation Python installation path?
8261 AC_MSG_CHECKING([for python version])
8262 AS_IF([test -n "$PYTHON_VERSION"],
8263 [AC_MSG_RESULT([$PYTHON_VERSION])],
8264 [AC_MSG_RESULT([not found])
8265 AC_MSG_ERROR([no usable python found])])
8266 test -n "$PYTHON_CFLAGS" && break
8269 dnl Check if the headers really work
8270 save_CPPFLAGS="$CPPFLAGS"
8271 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8272 AC_CHECK_HEADER(Python.h)
8273 CPPFLAGS="$save_CPPFLAGS"
8275 # let the PYTHON_FOR_BUILD match the same python installation that
8276 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8277 # better for PythonTests.
8278 PYTHON_FOR_BUILD=$PYTHON
8281 if test "$with_lxml" != no; then
8282 if test -z "$PYTHON_FOR_BUILD"; then
8285 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8288 if test "$cross_compiling" != yes ; then
8289 BUILD_TYPE="$BUILD_TYPE LXML"
8294 AC_MSG_CHECKING([for python lxml])
8295 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8296 AC_MSG_RESULT([yes])
8300 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8303 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8304 BUILD_TYPE="$BUILD_TYPE LXML"
8305 AC_MSG_RESULT([no, using internal lxml])
8307 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8315 dnl By now enable_python should be "system", "internal" or "no"
8316 case $enable_python in
8320 if test "x$ac_cv_header_Python_h" != "xyes"; then
8321 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8325 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8326 AC_MSG_CHECKING([for correct python library version])
8327 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8330 int main(int argc, char **argv) {
8331 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
8332 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8335 ]])],[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])])
8339 dnl FIXME Check if the Python library can be linked with, too?
8344 PYTHON_VERSION_MAJOR=3
8345 PYTHON_VERSION_MINOR=5
8346 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.5
8347 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
8348 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
8350 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8351 BUILD_TYPE="$BUILD_TYPE PYTHON"
8352 # Embedded Python dies without Home set
8353 if test "$HOME" = ""; then
8362 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8366 AC_SUBST(DISABLE_PYTHON)
8367 AC_SUBST(SYSTEM_PYTHON)
8368 AC_SUBST(PYTHON_CFLAGS)
8369 AC_SUBST(PYTHON_LIBS)
8370 AC_SUBST(PYTHON_VERSION)
8371 AC_SUBST(PYTHON_VERSION_MAJOR)
8372 AC_SUBST(PYTHON_VERSION_MINOR)
8374 ENABLE_MARIADBC=TRUE
8375 if test "$_os" = "Android" -o "$_os" = "iOS"; then
8381 if test "$ENABLE_MARIADBC" = "TRUE"; then
8382 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8385 AC_SUBST(ENABLE_MARIADBC)
8386 AC_SUBST(MARIADBC_MAJOR)
8387 AC_SUBST(MARIADBC_MINOR)
8388 AC_SUBST(MARIADBC_MICRO)
8390 if test "$ENABLE_MARIADBC" = "TRUE"; then
8391 dnl ===================================================================
8392 dnl Check for system MariaDB
8393 dnl ===================================================================
8394 AC_MSG_CHECKING([which MariaDB to use])
8395 if test "$with_system_mariadb" = "yes"; then
8396 AC_MSG_RESULT([external])
8397 SYSTEM_MARIADB_CONNECTOR_C=TRUE
8398 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8399 if test -z "$MARIADBCONFIG"; then
8400 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8401 if test -z "$MARIADBCONFIG"; then
8402 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8403 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8406 AC_MSG_CHECKING([MariaDB version])
8407 MARIADB_VERSION=`$MARIADBCONFIG --version`
8408 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8409 if test "$MARIADB_MAJOR" -ge "5"; then
8412 AC_MSG_ERROR([too old, use 5.0.x or later])
8414 AC_MSG_CHECKING([for MariaDB Client library])
8415 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8416 if test "$COM_IS_CLANG" = TRUE; then
8417 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8419 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8420 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8421 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8423 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8424 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8425 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8426 | sed -e 's|/lib64/|/lib/|')
8428 FilterLibs "${MARIADB_LIBS}"
8429 MARIADB_LIBS="${filteredlibs}"
8430 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8431 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8432 if test "$enable_bundle_mariadb" = "yes"; then
8433 AC_MSG_RESULT([yes])
8434 BUNDLE_MARIADB_CONNECTOR_C=TRUE
8435 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8437 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8439 /g' | grep -E '(mysqlclient|mariadb)')
8440 if test "$_os" = "Darwin"; then
8441 LIBMARIADB=${LIBMARIADB}.dylib
8442 elif test "$_os" = "WINNT"; then
8443 LIBMARIADB=${LIBMARIADB}.dll
8445 LIBMARIADB=${LIBMARIADB}.so
8447 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8448 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8449 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8450 AC_MSG_RESULT([found.])
8451 PathFormat "$LIBMARIADB_PATH"
8452 LIBMARIADB_PATH="$formatted_path"
8454 AC_MSG_ERROR([not found.])
8458 BUNDLE_MARIADB_CONNECTOR_C=
8461 AC_MSG_RESULT([internal])
8462 SYSTEM_MARIADB_CONNECTOR_C=
8463 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
8464 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
8465 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
8468 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
8469 AC_SUBST(MARIADB_CFLAGS)
8470 AC_SUBST(MARIADB_LIBS)
8471 AC_SUBST(LIBMARIADB)
8472 AC_SUBST(LIBMARIADB_PATH)
8473 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
8476 dnl ===================================================================
8477 dnl Check for system hsqldb
8478 dnl ===================================================================
8479 if test "$with_java" != "no"; then
8480 HSQLDB_USE_JDBC_4_1=
8481 AC_MSG_CHECKING([which hsqldb to use])
8482 if test "$with_system_hsqldb" = "yes"; then
8483 AC_MSG_RESULT([external])
8485 if test -z $HSQLDB_JAR; then
8486 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8488 if ! test -f $HSQLDB_JAR; then
8489 AC_MSG_ERROR(hsqldb.jar not found.)
8491 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8495 my $file = "$ENV{'HSQLDB_JAR'}";
8496 my $zip = Archive::Zip->new( $file );
8497 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8498 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8500 push @l, split(/\n/, $mf);
8501 foreach my $line (@l)
8503 if ($line =~ m/Specification-Version:/)
8505 ($t, $version) = split (/:/,$line);
8506 $version =~ s/^\s//;
8507 ($a, $b, $c, $d) = split (/\./,$version);
8508 if ($c == "0" && $d > "8")
8523 AC_MSG_RESULT([yes])
8525 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8528 AC_MSG_RESULT([internal])
8530 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8532 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8533 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8534 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8535 AC_MSG_RESULT([yes])
8536 HSQLDB_USE_JDBC_4_1=TRUE
8541 AC_SUBST(SYSTEM_HSQLDB)
8542 AC_SUBST(HSQLDB_JAR)
8543 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8546 dnl ===================================================================
8547 dnl Check for PostgreSQL stuff
8548 dnl ===================================================================
8549 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
8550 if test "x$enable_postgresql_sdbc" != "xno"; then
8551 AC_MSG_RESULT([yes])
8552 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8554 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8555 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8557 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8558 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8561 postgres_interface=""
8562 if test "$with_system_postgresql" = "yes"; then
8563 postgres_interface="external PostgreSQL"
8564 SYSTEM_POSTGRESQL=TRUE
8565 if test "$_os" = Darwin; then
8567 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8568 pg_supp_path="$P_SEP$d$pg_supp_path"
8571 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8572 if test -z "$PGCONFIG"; then
8573 AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
8575 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8576 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8577 FilterLibs "${POSTGRESQL_LIB}"
8578 POSTGRESQL_LIB="${filteredlibs}"
8580 # if/when anything else than PostgreSQL uses Kerberos,
8581 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8586 # MacOS X has system MIT Kerberos 5 since 10.4
8587 if test "$with_krb5" != "no"; then
8590 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
8591 # that the libraries where these functions are located on macOS will change, is it?
8592 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8593 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8596 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8597 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8598 KRB5_LIBS="$KRB5_LIBS $LIBS"
8601 if test "$with_gssapi" != "no"; then
8604 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8605 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8611 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8612 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8615 Linux|GNU|*BSD|DragonFly)
8616 if test "$with_krb5" != "no"; then
8619 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8620 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8623 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8624 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8625 KRB5_LIBS="$KRB5_LIBS $LIBS"
8628 if test "$with_gssapi" != "no"; then
8631 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8632 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8638 if test "$with_krb5" = "yes"; then
8641 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8642 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8645 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8646 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8647 KRB5_LIBS="$KRB5_LIBS $LIBS"
8650 if test "$with_gssapi" = "yes"; then
8653 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8654 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8660 if test -n "$with_libpq_path"; then
8661 SYSTEM_POSTGRESQL=TRUE
8662 postgres_interface="external libpq"
8663 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8664 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8667 postgres_interface="internal"
8669 POSTGRESQL_INC="%OVERRIDE_ME%"
8670 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8674 AC_MSG_CHECKING([PostgreSQL C interface])
8675 AC_MSG_RESULT([$postgres_interface])
8677 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
8678 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8680 save_CPPFLAGS=$CPPFLAGS
8682 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8683 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8684 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8685 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8686 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8688 CPPFLAGS=$save_CPPFLAGS
8691 BUILD_POSTGRESQL_SDBC=TRUE
8696 AC_SUBST(WITH_GSSAPI)
8697 AC_SUBST(GSSAPI_LIBS)
8699 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8700 AC_SUBST(SYSTEM_POSTGRESQL)
8701 AC_SUBST(POSTGRESQL_INC)
8702 AC_SUBST(POSTGRESQL_LIB)
8704 dnl ===================================================================
8705 dnl Check for Firebird stuff
8706 dnl ===================================================================
8707 ENABLE_FIREBIRD_SDBC=""
8708 if test "$enable_firebird_sdbc" = "yes" ; then
8709 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8711 dnl ===================================================================
8712 dnl Check for system Firebird
8713 dnl ===================================================================
8714 AC_MSG_CHECKING([which Firebird to use])
8715 if test "$with_system_firebird" = "yes"; then
8716 AC_MSG_RESULT([external])
8717 SYSTEM_FIREBIRD=TRUE
8718 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8719 if test -z "$FIREBIRDCONFIG"; then
8720 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8721 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
8722 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
8724 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
8726 AC_MSG_NOTICE([fb_config found])
8727 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8728 AC_MSG_CHECKING([for Firebird Client library])
8729 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8730 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8731 FilterLibs "${FIREBIRD_LIBS}"
8732 FIREBIRD_LIBS="${filteredlibs}"
8734 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8735 AC_MSG_CHECKING([Firebird version])
8736 if test -n "${FIREBIRD_VERSION}"; then
8737 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8738 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8739 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
8742 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
8745 __save_CFLAGS="${CFLAGS}"
8746 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
8747 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
8748 #if defined(FB_API_VER) && FB_API_VER == 30
8749 int fb_api_is_30(void) { return 0; }
8751 #error "Wrong Firebird API version"
8752 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
8753 CFLAGS="${__save_CFLAGS}"
8755 ENABLE_FIREBIRD_SDBC="TRUE"
8756 elif test "$enable_database_connectivity" != yes; then
8757 AC_MSG_RESULT([none])
8758 elif test "$cross_compiling" = "yes"; then
8759 AC_MSG_RESULT([none])
8761 dnl Embedded Firebird has version 3.0
8762 AC_DEFINE(HAVE_FIREBIRD_30, 1)
8763 dnl We need libatomic-ops for any non X86/X64 system
8764 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
8765 dnl ===================================================================
8766 dnl Check for system libatomic-ops
8767 dnl ===================================================================
8768 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
8769 if test "$with_system_libatomic_ops" = "yes"; then
8770 SYSTEM_LIBATOMIC_OPS=TRUE
8771 AC_CHECK_HEADERS(atomic_ops.h, [],
8772 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
8774 SYSTEM_LIBATOMIC_OPS=
8775 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
8776 LIBATOMIC_OPS_LIBS="-latomic_ops"
8777 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
8781 AC_MSG_RESULT([internal])
8783 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
8784 FIREBIRD_LIBS="-lfbclient"
8786 if test "$with_system_libtommath" = "yes"; then
8787 SYSTEM_LIBTOMMATH=TRUE
8788 dnl check for tommath presence
8790 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
8791 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
8795 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
8796 LIBTOMMATH_LIBS="-ltommath"
8797 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
8800 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
8801 ENABLE_FIREBIRD_SDBC="TRUE"
8802 AC_DEFINE(ENABLE_FIREBIRD_SDBC)
8805 AC_SUBST(ENABLE_FIREBIRD_SDBC)
8806 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
8807 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
8808 AC_SUBST(LIBATOMIC_OPS_LIBS)
8809 AC_SUBST(SYSTEM_FIREBIRD)
8810 AC_SUBST(FIREBIRD_CFLAGS)
8811 AC_SUBST(FIREBIRD_LIBS)
8812 AC_SUBST([TOMMATH_CFLAGS])
8813 AC_SUBST([TOMMATH_LIBS])
8815 dnl ===================================================================
8816 dnl Check for system curl
8817 dnl ===================================================================
8818 AC_MSG_CHECKING([which libcurl to use])
8819 if test "$with_system_curl" = "auto"; then
8820 with_system_curl="$with_system_libs"
8823 if test "$with_system_curl" = "yes"; then
8824 AC_MSG_RESULT([external])
8827 # First try PKGCONFIG and then fall back
8828 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
8830 if test -n "$CURL_PKG_ERRORS"; then
8831 AC_PATH_PROG(CURLCONFIG, curl-config)
8832 if test -z "$CURLCONFIG"; then
8833 AC_MSG_ERROR([curl development files not found])
8835 CURL_LIBS=`$CURLCONFIG --libs`
8836 FilterLibs "${CURL_LIBS}"
8837 CURL_LIBS="${filteredlibs}"
8838 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
8839 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
8841 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
8842 case $curl_version in
8843 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
8844 dnl so they need to be doubled to end up in the configure script
8845 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
8846 AC_MSG_RESULT([yes])
8849 AC_MSG_ERROR([no, you have $curl_version])
8855 elif test $_os = iOS; then
8856 # Let's see if we need curl, I think not?
8857 AC_MSG_RESULT([none])
8860 AC_MSG_RESULT([internal])
8862 BUILD_TYPE="$BUILD_TYPE CURL"
8865 AC_SUBST(SYSTEM_CURL)
8866 AC_SUBST(CURL_CFLAGS)
8868 AC_SUBST(ENABLE_CURL)
8870 dnl ===================================================================
8871 dnl Check for system boost
8872 dnl ===================================================================
8873 AC_MSG_CHECKING([which boost to use])
8874 if test "$with_system_boost" = "yes"; then
8875 AC_MSG_RESULT([external])
8883 save_CXXFLAGS=$CXXFLAGS
8884 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
8885 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
8886 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
8887 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
8888 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
8889 CXXFLAGS=$save_CXXFLAGS
8891 # this is in m4/ax_boost_base.m4
8892 FilterLibs "${BOOST_LDFLAGS}"
8893 BOOST_LDFLAGS="${filteredlibs}"
8895 AC_MSG_RESULT([internal])
8896 BUILD_TYPE="$BUILD_TYPE BOOST"
8898 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
8899 # use warning-suppressing wrapper headers
8900 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
8902 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
8905 AC_SUBST(SYSTEM_BOOST)
8907 dnl ===================================================================
8908 dnl Check for system mdds
8909 dnl ===================================================================
8910 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.4 >= 1.4.1], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
8912 dnl ===================================================================
8913 dnl Check for system glm
8914 dnl ===================================================================
8915 AC_MSG_CHECKING([which glm to use])
8916 if test "$with_system_glm" = "yes"; then
8917 AC_MSG_RESULT([external])
8920 AC_CHECK_HEADER([glm/glm.hpp], [],
8921 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
8924 AC_MSG_RESULT([internal])
8925 BUILD_TYPE="$BUILD_TYPE GLM"
8927 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
8929 AC_SUBST([GLM_CFLAGS])
8930 AC_SUBST([SYSTEM_GLM])
8932 dnl ===================================================================
8933 dnl Check for system odbc
8934 dnl ===================================================================
8935 AC_MSG_CHECKING([which odbc headers to use])
8936 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
8937 AC_MSG_RESULT([external])
8938 SYSTEM_ODBC_HEADERS=TRUE
8940 if test "$build_os" = "cygwin"; then
8941 save_CPPFLAGS=$CPPFLAGS
8943 PathFormat "$winsdktest"
8944 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"
8945 AC_CHECK_HEADER(sqlext.h, [],
8946 [AC_MSG_ERROR(odbc not found. install odbc)],
8947 [#include <windows.h>])
8948 CPPFLAGS=$save_CPPFLAGS
8950 AC_CHECK_HEADER(sqlext.h, [],
8951 [AC_MSG_ERROR(odbc not found. install odbc)],[])
8953 elif test "$enable_database_connectivity" != yes; then
8954 AC_MSG_RESULT([none])
8956 AC_MSG_RESULT([internal])
8957 SYSTEM_ODBC_HEADERS=
8959 AC_SUBST(SYSTEM_ODBC_HEADERS)
8962 dnl ===================================================================
8963 dnl Check for system openldap
8964 dnl ===================================================================
8966 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
8967 AC_MSG_CHECKING([which openldap library to use])
8968 if test "$with_system_openldap" = "yes"; then
8969 AC_MSG_RESULT([external])
8970 SYSTEM_OPENLDAP=TRUE
8971 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
8972 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8973 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8975 AC_MSG_RESULT([internal])
8977 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
8980 AC_SUBST(SYSTEM_OPENLDAP)
8982 dnl ===================================================================
8983 dnl Check for system NSS
8984 dnl ===================================================================
8985 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
8986 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
8987 AC_DEFINE(HAVE_FEATURE_NSS)
8989 AC_DEFINE(ENABLE_NSS)
8990 elif test $_os != iOS ; then
8993 AC_SUBST(ENABLE_NSS)
8995 dnl ===================================================================
8996 dnl Check for TLS/SSL and cryptographic implementation to use
8997 dnl ===================================================================
8998 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
8999 if test -n "$with_tls"; then
9002 AC_DEFINE(USE_TLS_OPENSSL)
9005 if test "$enable_openssl" != "yes"; then
9006 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9009 # warn that OpenSSL has been selected but not all TLS code has this option
9010 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
9011 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
9014 AC_DEFINE(USE_TLS_NSS)
9018 AC_MSG_WARN([Skipping TLS/SSL])
9021 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9023 nss - Mozilla's Network Security Services (NSS)
9028 # default to using NSS, it results in smaller oox lib
9029 AC_DEFINE(USE_TLS_NSS)
9032 AC_MSG_RESULT([$TLS])
9035 dnl ===================================================================
9036 dnl Check for system sane
9037 dnl ===================================================================
9038 AC_MSG_CHECKING([which sane header to use])
9039 if test "$with_system_sane" = "yes"; then
9040 AC_MSG_RESULT([external])
9041 AC_CHECK_HEADER(sane/sane.h, [],
9042 [AC_MSG_ERROR(sane not found. install sane)], [])
9044 AC_MSG_RESULT([internal])
9045 BUILD_TYPE="$BUILD_TYPE SANE"
9048 dnl ===================================================================
9049 dnl Check for system icu
9050 dnl ===================================================================
9057 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9058 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9059 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9060 AC_MSG_CHECKING([which icu to use])
9061 if test "$with_system_icu" = "yes"; then
9062 AC_MSG_RESULT([external])
9065 AC_MSG_CHECKING([for unicode/rbbi.h])
9066 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
9069 if test "$cross_compiling" != "yes"; then
9070 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9071 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9072 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9073 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9076 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9077 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9078 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9079 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9080 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9081 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9082 AC_MSG_RESULT([yes])
9085 if test "$with_system_icu_for_build" != "force"; then
9086 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9087 You can use --with-system-icu-for-build=force to use it anyway.])
9092 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9093 # using the system icu tools can lead to version confusion, use the
9094 # ones from the build environment when cross-compiling
9095 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9096 if test -z "$SYSTEM_GENBRK"; then
9097 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9099 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9100 if test -z "$SYSTEM_GENCCODE"; then
9101 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9103 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9104 if test -z "$SYSTEM_GENCMN"; then
9105 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9107 if test "$ICU_MAJOR" -ge "49"; then
9108 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9109 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9110 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9112 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9113 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9114 ICU_RECLASSIFIED_HEBREW_LETTER=
9118 if test "$cross_compiling" = "yes"; then
9119 if test "$ICU_MAJOR" -ge "50"; then
9120 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9125 AC_MSG_RESULT([internal])
9127 BUILD_TYPE="$BUILD_TYPE ICU"
9128 # surprisingly set these only for "internal" (to be used by various other
9129 # external libs): the system icu-config is quite unhelpful and spits out
9130 # dozens of weird flags and also default path -I/usr/include
9131 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9132 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9134 if test "$ICU_MAJOR" -ge "59"; then
9135 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9136 # with -std=c++11 but not all external libraries can be built with that,
9137 # for those use a bit-compatible typedef uint16_t UChar; see
9138 # icu/source/common/unicode/umachine.h
9139 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9143 AC_SUBST(SYSTEM_ICU)
9144 AC_SUBST(SYSTEM_GENBRK)
9145 AC_SUBST(SYSTEM_GENCCODE)
9146 AC_SUBST(SYSTEM_GENCMN)
9149 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9150 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9151 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9152 AC_SUBST(ICU_CFLAGS)
9154 AC_SUBST(ICU_UCHAR_TYPE)
9156 dnl ==================================================================
9158 dnl ==================================================================
9159 AC_MSG_CHECKING([whether to enable breakpad])
9160 if test "$enable_breakpad" != yes; then
9163 AC_MSG_RESULT([yes])
9164 ENABLE_BREAKPAD="TRUE"
9165 AC_DEFINE(ENABLE_BREAKPAD)
9166 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9167 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9169 AC_MSG_CHECKING([for crashreport config])
9170 if test "$with_symbol_config" = "no"; then
9171 BREAKPAD_SYMBOL_CONFIG="invalid"
9174 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9175 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9176 AC_MSG_RESULT([yes])
9178 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9180 AC_SUBST(ENABLE_BREAKPAD)
9182 dnl ==================================================================
9184 dnl ==================================================================
9185 AC_MSG_CHECKING([whether to enable fuzzers])
9186 if test "$enable_fuzzers" != yes; then
9189 AC_MSG_RESULT([yes])
9190 ENABLE_FUZZERS="TRUE"
9191 AC_DEFINE(ENABLE_FUZZERS)
9192 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9194 AC_SUBST(ENABLE_FUZZERS)
9196 dnl ===================================================================
9198 dnl ===================================================================
9199 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.14 >= 0.14.0])
9200 if test "$with_system_orcus" != "yes"; then
9201 if test "$SYSTEM_BOOST" = "TRUE"; then
9202 # ===========================================================
9203 # Determine if we are going to need to link with Boost.System
9204 # ===========================================================
9205 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9206 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9207 dnl in documentation has no effect.
9208 AC_MSG_CHECKING([if we need to link with Boost.System])
9210 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9211 @%:@include <boost/version.hpp>
9213 #if BOOST_VERSION >= 105000
9214 # error yes, we need to link with Boost.System
9219 AC_MSG_RESULT([yes])
9225 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9226 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9227 AC_SUBST([BOOST_SYSTEM_LIB])
9228 AC_SUBST(SYSTEM_LIBORCUS)
9230 dnl ===================================================================
9232 dnl ===================================================================
9233 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9234 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9235 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9237 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9238 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9239 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9241 if test "$COM" = "MSC"; then # override the above
9242 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9243 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9246 if test "$with_system_harfbuzz" = "yes"; then
9247 if test "$with_system_graphite" = "no"; then
9248 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9250 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9252 _save_cflags="$CFLAGS"
9253 LIBS="$LIBS $HARFBUZZ_LIBS"
9254 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9255 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9257 CFLAGS="$_save_cflags"
9259 if test "$with_system_graphite" = "yes"; then
9260 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9264 AC_MSG_CHECKING([whether to use X11])
9265 dnl ***************************************
9266 dnl testing for X libraries and includes...
9267 dnl ***************************************
9268 if test "$USING_X11" = TRUE; then
9269 AC_DEFINE(HAVE_FEATURE_X11)
9271 AC_MSG_RESULT([$USING_X11])
9273 if test "$USING_X11" = TRUE; then
9276 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9278 if test -z "$x_includes"; then
9279 x_includes="default_x_includes"
9281 if test -z "$x_libraries"; then
9282 x_libraries="default_x_libraries"
9284 CFLAGS="$CFLAGS $X_CFLAGS"
9285 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9286 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9288 x_includes="no_x_includes"
9289 x_libraries="no_x_libraries"
9292 if test "$USING_X11" = TRUE; then
9293 dnl ===================================================================
9294 dnl Check for extension headers
9295 dnl ===================================================================
9296 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9297 [#include <X11/extensions/shape.h>])
9299 # vcl needs ICE and SM
9300 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9301 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9302 [AC_MSG_ERROR(ICE library not found)])
9303 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9304 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9305 [AC_MSG_ERROR(SM library not found)])
9308 dnl ===================================================================
9309 dnl Check for system Xrender
9310 dnl ===================================================================
9311 AC_MSG_CHECKING([whether to use Xrender])
9312 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9313 AC_MSG_RESULT([yes])
9314 PKG_CHECK_MODULES(XRENDER, xrender)
9315 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9316 FilterLibs "${XRENDER_LIBS}"
9317 XRENDER_LIBS="${filteredlibs}"
9318 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9319 [AC_MSG_ERROR(libXrender not found or functional)], [])
9320 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9321 [AC_MSG_ERROR(Xrender not found. install X)], [])
9325 AC_SUBST(XRENDER_CFLAGS)
9326 AC_SUBST(XRENDER_LIBS)
9328 dnl ===================================================================
9329 dnl Check for XRandr
9330 dnl ===================================================================
9331 AC_MSG_CHECKING([whether to enable RandR support])
9332 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9333 AC_MSG_RESULT([yes])
9334 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9335 if test "$ENABLE_RANDR" != "TRUE"; then
9336 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9337 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9339 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9340 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9341 XRANDR_LIBS="-lXrandr "
9344 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9345 FilterLibs "${XRANDR_LIBS}"
9346 XRANDR_LIBS="${filteredlibs}"
9351 AC_SUBST(XRANDR_CFLAGS)
9352 AC_SUBST(XRANDR_LIBS)
9353 AC_SUBST(ENABLE_RANDR)
9355 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9358 if test $_os = iOS -o $_os = Android; then
9361 AC_MSG_CHECKING([for webdav library])
9362 case "$WITH_WEBDAV" in
9364 AC_MSG_RESULT([serf])
9365 # Check for system apr-util
9366 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9367 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9368 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9369 if test "$COM" = "MSC"; then
9371 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9372 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9375 # Check for system serf
9376 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9377 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9378 if test "$COM" = "MSC"; then
9379 SERF_LIB_DIR="Release"
9380 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9381 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9385 AC_MSG_RESULT([neon])
9386 # Check for system neon
9387 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9388 if test "$with_system_neon" = "yes"; then
9389 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9393 AC_SUBST(NEON_VERSION)
9396 AC_MSG_RESULT([none, disabled])
9400 AC_SUBST(WITH_WEBDAV)
9402 dnl ===================================================================
9403 dnl Check for disabling cve_tests
9404 dnl ===================================================================
9405 AC_MSG_CHECKING([whether to execute CVE tests])
9406 # If not explicitly enabled or disabled, default
9407 if test -z "$enable_cve_tests"; then
9410 # Default cves off for windows with its wild and wonderful
9411 # varienty of AV software kicking in and panicking
9416 enable_cve_tests=yes
9420 if test "$enable_cve_tests" = "no"; then
9422 DISABLE_CVE_TESTS=TRUE
9423 AC_SUBST(DISABLE_CVE_TESTS)
9425 AC_MSG_RESULT([yes])
9428 dnl ===================================================================
9429 dnl Check for enabling chart XShape tests
9430 dnl ===================================================================
9431 AC_MSG_CHECKING([whether to execute chart XShape tests])
9432 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
9433 AC_MSG_RESULT([yes])
9434 ENABLE_CHART_TESTS=TRUE
9435 AC_SUBST(ENABLE_CHART_TESTS)
9440 dnl ===================================================================
9441 dnl Check for system openssl
9442 dnl ===================================================================
9444 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9445 if test "$enable_openssl" = "yes"; then
9447 if test "$_os" = Darwin ; then
9448 # OpenSSL is deprecated when building for 10.7 or later.
9450 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9451 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9453 with_system_openssl=no
9454 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9455 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9456 && test "$with_system_openssl" != "no"; then
9457 with_system_openssl=yes
9460 OPENSSL_LIBS="-lssl -lcrypto"
9462 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9464 if test "$with_system_openssl" = "yes"; then
9465 AC_MSG_CHECKING([whether openssl supports SHA512])
9467 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9469 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9473 AC_MSG_RESULT([yes])
9474 DISABLE_OPENSSL=TRUE
9476 # warn that although OpenSSL is disabled, system libraries may depend on it
9477 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9478 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9481 AC_SUBST([DISABLE_OPENSSL])
9483 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
9484 if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
9485 AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
9486 enable_cipher_openssl_backend=no
9488 AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
9491 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
9492 ENABLE_CIPHER_OPENSSL_BACKEND=
9493 if test "$enable_cipher_openssl_backend" = yes; then
9494 AC_MSG_RESULT([yes])
9495 ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
9499 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
9501 dnl ===================================================================
9502 dnl Check for building gnutls
9503 dnl ===================================================================
9504 AC_MSG_CHECKING([whether to use gnutls])
9505 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
9506 AC_MSG_RESULT([yes])
9508 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9509 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9510 available in the system to use as replacement.]]))
9511 FilterLibs "${LIBGCRYPT_LIBS}"
9512 LIBGCRYPT_LIBS="${filteredlibs}"
9517 AC_SUBST([LIBGCRYPT_CFLAGS])
9518 AC_SUBST([LIBGCRYPT_LIBS])
9520 dnl ===================================================================
9521 dnl Check for system redland
9522 dnl ===================================================================
9523 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9524 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9525 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9526 if test "$with_system_redland" = "yes"; then
9527 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9528 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9534 AC_SUBST(RAPTOR_MAJOR)
9535 AC_SUBST(RASQAL_MAJOR)
9536 AC_SUBST(REDLAND_MAJOR)
9538 dnl ===================================================================
9539 dnl Check for system hunspell
9540 dnl ===================================================================
9541 AC_MSG_CHECKING([which libhunspell to use])
9542 if test "$with_system_hunspell" = "yes"; then
9543 AC_MSG_RESULT([external])
9544 SYSTEM_HUNSPELL=TRUE
9546 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9547 if test "$HUNSPELL_PC" != "TRUE"; then
9548 AC_CHECK_HEADER(hunspell.hxx, [],
9550 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9551 [AC_MSG_ERROR(hunspell headers not found.)], [])
9553 AC_CHECK_LIB([hunspell], [main], [:],
9554 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9555 HUNSPELL_LIBS=-lhunspell
9558 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9559 FilterLibs "${HUNSPELL_LIBS}"
9560 HUNSPELL_LIBS="${filteredlibs}"
9562 AC_MSG_RESULT([internal])
9564 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9565 if test "$COM" = "MSC"; then
9566 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9568 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.6"
9570 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9572 AC_SUBST(SYSTEM_HUNSPELL)
9573 AC_SUBST(HUNSPELL_CFLAGS)
9574 AC_SUBST(HUNSPELL_LIBS)
9576 dnl ===================================================================
9577 dnl Checking for altlinuxhyph
9578 dnl ===================================================================
9579 AC_MSG_CHECKING([which altlinuxhyph to use])
9580 if test "$with_system_altlinuxhyph" = "yes"; then
9581 AC_MSG_RESULT([external])
9583 AC_CHECK_HEADER(hyphen.h, [],
9584 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9585 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9586 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9587 [#include <hyphen.h>])
9588 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9589 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9590 if test -z "$HYPHEN_LIB"; then
9591 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9592 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9594 if test -z "$HYPHEN_LIB"; then
9595 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9596 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9599 AC_MSG_RESULT([internal])
9601 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9602 if test "$COM" = "MSC"; then
9603 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9605 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9608 AC_SUBST(SYSTEM_HYPH)
9609 AC_SUBST(HYPHEN_LIB)
9611 dnl ===================================================================
9612 dnl Checking for mythes
9613 dnl ===================================================================
9614 AC_MSG_CHECKING([which mythes to use])
9615 if test "$with_system_mythes" = "yes"; then
9616 AC_MSG_RESULT([external])
9619 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9620 if test "$MYTHES_PKGCONFIG" = "no"; then
9621 AC_CHECK_HEADER(mythes.hxx, [],
9622 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9623 AC_CHECK_LIB([mythes-1.2], [main], [:],
9624 [ MYTHES_FOUND=no], [])
9625 if test "$MYTHES_FOUND" = "no"; then
9626 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9627 [ MYTHES_FOUND=no], [])
9629 if test "$MYTHES_FOUND" = "no"; then
9630 AC_MSG_ERROR([mythes library not found!.])
9634 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9635 FilterLibs "${MYTHES_LIBS}"
9636 MYTHES_LIBS="${filteredlibs}"
9638 AC_MSG_RESULT([internal])
9640 BUILD_TYPE="$BUILD_TYPE MYTHES"
9641 if test "$COM" = "MSC"; then
9642 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9644 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9647 AC_SUBST(SYSTEM_MYTHES)
9648 AC_SUBST(MYTHES_CFLAGS)
9649 AC_SUBST(MYTHES_LIBS)
9651 dnl ===================================================================
9652 dnl How should we build the linear programming solver ?
9653 dnl ===================================================================
9656 AC_MSG_CHECKING([whether to build with CoinMP])
9657 if test "$enable_coinmp" != "no"; then
9659 AC_MSG_RESULT([yes])
9660 if test "$with_system_coinmp" = "yes"; then
9662 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
9663 FilterLibs "${COINMP_LIBS}"
9664 COINMP_LIBS="${filteredlibs}"
9666 BUILD_TYPE="$BUILD_TYPE COINMP"
9671 AC_SUBST(ENABLE_COINMP)
9672 AC_SUBST(SYSTEM_COINMP)
9673 AC_SUBST(COINMP_CFLAGS)
9674 AC_SUBST(COINMP_LIBS)
9677 AC_MSG_CHECKING([whether to build with lpsolve])
9678 if test "$enable_lpsolve" != "no"; then
9680 AC_MSG_RESULT([yes])
9684 AC_SUBST(ENABLE_LPSOLVE)
9686 if test "$ENABLE_LPSOLVE" = TRUE; then
9687 AC_MSG_CHECKING([which lpsolve to use])
9688 if test "$with_system_lpsolve" = "yes"; then
9689 AC_MSG_RESULT([external])
9691 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9692 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9694 # some systems need this. Like Ubuntu....
9695 AC_CHECK_LIB(m, floor)
9696 AC_CHECK_LIB(dl, dlopen)
9697 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9698 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9701 AC_MSG_RESULT([internal])
9703 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9706 AC_SUBST(SYSTEM_LPSOLVE)
9708 dnl ===================================================================
9709 dnl Checking for libexttextcat
9710 dnl ===================================================================
9711 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
9712 if test "$with_system_libexttextcat" = "yes"; then
9713 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9715 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9717 dnl ===================================================================
9718 dnl Checking for libnumbertext
9719 dnl ===================================================================
9720 AC_MSG_CHECKING([whether to use libnumbertext])
9721 if test "$enable_libnumbertext" = "no"; then
9723 ENABLE_LIBNUMBERTEXT=
9724 SYSTEM_LIBNUMBERTEXT=
9726 AC_MSG_RESULT([yes])
9727 ENABLE_LIBNUMBERTEXT=TRUE
9728 libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
9729 if test "$with_system_libnumbertext" = "yes"; then
9730 SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
9731 SYSTEM_LIBNUMBERTEXT=YES
9733 SYSTEM_LIBNUMBERTEXT=
9735 save_CPPFLAGS=$CPPFLAGS
9736 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
9737 AC_CHECK_HEADERS([codecvt regex])
9738 AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
9739 [ ENABLE_LIBNUMBERTEXT=''
9740 LIBNUMBERTEXT_CFLAGS=''
9741 AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
9742 Enable libnumbertext fallback (missing number to number name conversion).])
9744 CPPFLAGS=$save_CPPFLAGS
9747 if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
9748 AC_DEFINE(ENABLE_LIBNUMBERTEXT)
9751 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
9752 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
9753 AC_SUBST(ENABLE_LIBNUMBERTEXT)
9754 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
9756 dnl ***************************************
9757 dnl testing libc version for Linux...
9758 dnl ***************************************
9759 if test "$_os" = "Linux"; then
9760 AC_MSG_CHECKING([whether libc is >= 2.1.1])
9761 exec 6>/dev/null # no output
9762 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
9763 exec 6>&1 # output on again
9764 if test "$HAVE_LIBC"; then
9765 AC_MSG_RESULT([yes])
9767 AC_MSG_ERROR([no, upgrade libc])
9771 dnl =========================================
9772 dnl Check for uuidgen
9773 dnl =========================================
9774 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9775 # presence is already tested above in the WINDOWS_SDK_HOME check
9779 AC_PATH_PROG([UUIDGEN], [uuidgen])
9780 if test -z "$UUIDGEN"; then
9781 AC_MSG_WARN([uuid is needed for building installation sets])
9785 dnl ***************************************
9786 dnl Checking for bison and flex
9787 dnl ***************************************
9788 AC_PATH_PROG(BISON, bison)
9789 if test -z "$BISON"; then
9790 AC_MSG_ERROR([no bison found in \$PATH, install it])
9792 AC_MSG_CHECKING([the bison version])
9793 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9794 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9795 # Accept newer than 2.0
9796 if test "$_bison_longver" -lt 2000; then
9797 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
9801 AC_PATH_PROG(FLEX, flex)
9802 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9803 FLEX=`cygpath -m $FLEX`
9805 if test -z "$FLEX"; then
9806 AC_MSG_ERROR([no flex found in \$PATH, install it])
9808 AC_MSG_CHECKING([the flex version])
9809 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
9810 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
9811 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
9815 dnl ***************************************
9816 dnl Checking for patch
9817 dnl ***************************************
9818 AC_PATH_PROG(PATCH, patch)
9819 if test -z "$PATCH"; then
9820 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
9823 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9824 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9825 if test -z "$with_gnu_patch"; then
9828 if test -x "$with_gnu_patch"; then
9829 GNUPATCH=$with_gnu_patch
9831 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9835 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9836 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9837 AC_MSG_RESULT([yes])
9839 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9845 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9846 GNUPATCH=`cygpath -m $GNUPATCH`
9849 dnl We also need to check for --with-gnu-cp
9851 if test -z "$with_gnu_cp"; then
9852 # check the place where the good stuff is hidden on Solaris...
9853 if test -x /usr/gnu/bin/cp; then
9854 GNUCP=/usr/gnu/bin/cp
9856 AC_PATH_PROGS(GNUCP, gnucp cp)
9858 if test -z $GNUCP; then
9859 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9862 if test -x "$with_gnu_cp"; then
9865 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9869 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9870 GNUCP=`cygpath -m $GNUCP`
9873 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9874 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9875 AC_MSG_RESULT([yes])
9876 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9877 AC_MSG_RESULT([yes])
9880 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9883 AC_MSG_RESULT([no gnucp found - using the system's cp command])
9886 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9895 dnl ***************************************
9896 dnl testing assembler path
9897 dnl ***************************************
9899 if test "$_os" = "WINNT"; then
9900 if test "$BITNESS_OVERRIDE" = ""; then
9902 assembler_bin=$CL_DIR
9905 assembler_bin=$CL_DIR
9908 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
9909 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
9910 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
9911 AC_MSG_RESULT([found])
9912 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
9914 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9917 PathFormat "$ASM_HOME"
9918 ASM_HOME="$formatted_path"
9925 dnl ===================================================================
9926 dnl We need zip and unzip
9927 dnl ===================================================================
9928 AC_PATH_PROG(ZIP, zip)
9929 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9930 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9931 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],,)
9934 AC_PATH_PROG(UNZIP, unzip)
9935 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9937 dnl ===================================================================
9938 dnl Zip must be a specific type for different build types.
9939 dnl ===================================================================
9940 if test $build_os = cygwin; then
9941 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
9942 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
9946 dnl ===================================================================
9947 dnl We need touch with -h option support.
9948 dnl ===================================================================
9949 AC_PATH_PROG(TOUCH, touch)
9950 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
9952 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
9953 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],,)
9956 dnl ===================================================================
9957 dnl Check for system epoxy
9958 dnl ===================================================================
9959 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
9961 dnl ===================================================================
9962 dnl Set vcl option: coordinate device in double or sal_Int32
9963 dnl ===================================================================
9965 dnl disabled for now, we don't want subtle differences between OSs
9966 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
9967 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
9968 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
9969 dnl AC_MSG_RESULT([double])
9971 dnl AC_MSG_RESULT([sal_Int32])
9974 dnl ===================================================================
9975 dnl Test which vclplugs have to be built.
9976 dnl ===================================================================
9978 if test "$USING_X11" != TRUE; then
9985 if test "x$enable_gtk3" = "xyes"; then
9986 if test "$with_system_cairo" = no; then
9987 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
9989 : ${with_system_cairo:=yes}
9990 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="")
9991 if test "x$ENABLE_GTK3" = "xTRUE"; then
9993 dnl Avoid installed by unpackaged files for now.
9994 if test -z "$PKGFORMAT"; then
9995 GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
9998 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10000 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10001 FilterLibs "${GTK3_LIBS}"
10002 GTK3_LIBS="${filteredlibs}"
10004 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10005 if test "$with_system_epoxy" != "yes"; then
10006 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10007 AC_CHECK_HEADER(EGL/eglplatform.h, [],
10008 [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10011 AC_SUBST(GTK3_LIBS)
10012 AC_SUBST(GTK3_CFLAGS)
10013 AC_SUBST(ENABLE_GTK3)
10016 if test "x$enable_gtk" = "xyes"; then
10017 if test "$with_system_cairo" = no; then
10018 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10020 : ${with_system_cairo:=yes}
10022 AC_DEFINE(ENABLE_GTK)
10025 AC_SUBST(ENABLE_GTK)
10028 if test "x$enable_kde4" = "xyes"; then
10030 AC_DEFINE(ENABLE_KDE4)
10033 AC_SUBST(ENABLE_KDE4)
10036 if test "x$enable_qt5" = "xyes"; then
10038 AC_DEFINE(ENABLE_QT5)
10041 AC_SUBST(ENABLE_QT5)
10044 if test "x$enable_kde5" = "xyes"; then
10046 AC_DEFINE(ENABLE_KDE5)
10049 AC_SUBST(ENABLE_KDE5)
10051 ENABLE_GTK3_KDE5=""
10052 if test "x$enable_gtk3_kde5" = "xyes"; then
10053 ENABLE_GTK3_KDE5="TRUE"
10054 AC_DEFINE(ENABLE_GTK3_KDE5)
10057 AC_SUBST(ENABLE_GTK3_KDE5)
10059 build_vcl_plugins="$R"
10060 if test -z "$build_vcl_plugins"; then
10061 build_vcl_plugins="none"
10063 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10065 dnl ===================================================================
10066 dnl check for dbus support
10067 dnl ===================================================================
10071 DBUS_GLIB_CFLAGS=""
10075 if test "$enable_dbus" = "no"; then
10079 AC_MSG_CHECKING([whether to enable DBUS support])
10080 if test "$test_dbus" = "yes"; then
10082 AC_MSG_RESULT([yes])
10083 PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10084 AC_DEFINE(ENABLE_DBUS)
10085 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10086 FilterLibs "${DBUS_LIBS}"
10087 DBUS_LIBS="${filteredlibs}"
10089 # Glib is needed for BluetoothServer
10090 # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10091 PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10093 DBUS_HAVE_GLIB="TRUE"
10094 AC_DEFINE(DBUS_HAVE_GLIB,1)
10096 AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10099 AC_MSG_RESULT([no])
10102 AC_SUBST(ENABLE_DBUS)
10103 AC_SUBST(DBUS_CFLAGS)
10104 AC_SUBST(DBUS_LIBS)
10105 AC_SUBST(DBUS_GLIB_CFLAGS)
10106 AC_SUBST(DBUS_GLIB_LIBS)
10107 AC_SUBST(DBUS_HAVE_GLIB)
10109 AC_MSG_CHECKING([whether to enable Impress remote control])
10110 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10111 AC_MSG_RESULT([yes])
10112 ENABLE_SDREMOTE=TRUE
10113 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10115 # If not explicitly enabled or disabled, default
10116 if test -z "$enable_sdremote_bluetooth"; then
10119 # Default to yes for these
10120 enable_sdremote_bluetooth=yes
10124 enable_sdremote_bluetooth=no
10128 # $enable_sdremote_bluetooth is guaranteed non-empty now
10130 if test "$enable_sdremote_bluetooth" != "no"; then
10131 if test "$OS" = "LINUX"; then
10132 if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10133 AC_MSG_RESULT([yes])
10134 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10135 dnl ===================================================================
10136 dnl Check for system bluez
10137 dnl ===================================================================
10138 AC_MSG_CHECKING([which Bluetooth header to use])
10139 if test "$with_system_bluez" = "yes"; then
10140 AC_MSG_RESULT([external])
10141 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10142 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10145 AC_MSG_RESULT([internal])
10149 AC_MSG_RESULT([no, dbus disabled])
10150 ENABLE_SDREMOTE_BLUETOOTH=
10154 AC_MSG_RESULT([yes])
10155 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10159 AC_MSG_RESULT([no])
10160 ENABLE_SDREMOTE_BLUETOOTH=
10166 AC_MSG_RESULT([no])
10168 AC_SUBST(ENABLE_SDREMOTE)
10169 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10170 AC_SUBST(SYSTEM_BLUEZ)
10172 dnl ===================================================================
10173 dnl Check whether the gtk 2.0 libraries are available.
10174 dnl ===================================================================
10178 if test "$test_gtk" = "yes"; then
10180 if test "$ENABLE_GTK" = "TRUE"; then
10181 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]))
10182 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10183 FilterLibs "${GTK_LIBS}"
10184 GTK_LIBS="${filteredlibs}"
10185 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]))
10186 BUILD_TYPE="$BUILD_TYPE GTK"
10187 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10188 FilterLibs "${GTHREAD_LIBS}"
10189 GTHREAD_LIBS="${filteredlibs}"
10191 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10192 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10193 [ENABLE_GTK_PRINT="TRUE"],
10194 [ENABLE_GTK_PRINT=""])
10195 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10196 FilterLibs "${GTK_PRINT_LIBS}"
10197 GTK_PRINT_LIBS="${filteredlibs}"
10200 if test "$ENABLE_GTK" = "TRUE" || test "$ENABLE_GTK3" = "TRUE"; then
10201 AC_MSG_CHECKING([whether to enable GIO support])
10202 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10203 dnl Need at least 2.26 for the dbus support.
10204 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10205 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10206 if test "$ENABLE_GIO" = "TRUE"; then
10207 AC_DEFINE(ENABLE_GIO)
10208 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10209 FilterLibs "${GIO_LIBS}"
10210 GIO_LIBS="${filteredlibs}"
10213 AC_MSG_RESULT([no])
10217 AC_SUBST(ENABLE_GIO)
10218 AC_SUBST(GIO_CFLAGS)
10220 AC_SUBST(GTK_CFLAGS)
10222 AC_SUBST(GTHREAD_CFLAGS)
10223 AC_SUBST(GTHREAD_LIBS)
10224 AC_SUBST([ENABLE_GTK_PRINT])
10225 AC_SUBST([GTK_PRINT_CFLAGS])
10226 AC_SUBST([GTK_PRINT_LIBS])
10229 dnl ===================================================================
10231 SPLIT_APP_MODULES=""
10232 if test "$enable_split_app_modules" = "yes"; then
10233 SPLIT_APP_MODULES="TRUE"
10235 AC_SUBST(SPLIT_APP_MODULES)
10237 SPLIT_OPT_FEATURES=""
10238 if test "$enable_split_opt_features" = "yes"; then
10239 SPLIT_OPT_FEATURES="TRUE"
10241 AC_SUBST(SPLIT_OPT_FEATURES)
10243 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10244 if test "$enable_cairo_canvas" = yes; then
10245 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10247 enable_cairo_canvas=no
10248 elif test -z "$enable_cairo_canvas"; then
10249 enable_cairo_canvas=yes
10252 ENABLE_CAIRO_CANVAS=""
10253 if test "$enable_cairo_canvas" = "yes"; then
10255 ENABLE_CAIRO_CANVAS="TRUE"
10256 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10258 AC_SUBST(ENABLE_CAIRO_CANVAS)
10260 dnl ===================================================================
10261 dnl Check whether the GStreamer libraries are available.
10262 dnl It's possible to build avmedia with both GStreamer backends!
10263 dnl ===================================================================
10265 ENABLE_GSTREAMER_1_0=""
10267 if test "$build_gstreamer_1_0" = "yes"; then
10269 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10270 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10271 ENABLE_GSTREAMER_1_0="TRUE"
10272 AC_MSG_RESULT([yes])
10273 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10274 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10275 FilterLibs "${GSTREAMER_1_0_LIBS}"
10276 GSTREAMER_1_0_LIBS="${filteredlibs}"
10278 AC_MSG_RESULT([no])
10281 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10282 AC_SUBST(GSTREAMER_1_0_LIBS)
10283 AC_SUBST(ENABLE_GSTREAMER_1_0)
10286 ENABLE_GSTREAMER_0_10=""
10287 if test "$build_gstreamer_0_10" = "yes"; then
10289 AC_MSG_CHECKING([whether to enable the GStreamer 0.10 avmedia backend])
10290 if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10291 ENABLE_GSTREAMER_0_10="TRUE"
10292 AC_MSG_RESULT([yes])
10293 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10],, [
10294 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10] )
10296 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10297 FilterLibs "${GSTREAMER_0_10_LIBS}"
10298 GSTREAMER_0_10_LIBS="${filteredlibs}"
10300 AC_MSG_RESULT([no])
10304 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10305 AC_SUBST(GSTREAMER_0_10_LIBS)
10306 AC_SUBST(ENABLE_GSTREAMER_0_10)
10308 dnl ===================================================================
10309 dnl Check whether to build the VLC avmedia backend
10310 dnl ===================================================================
10314 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10315 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10317 AC_MSG_RESULT([yes])
10319 AC_MSG_RESULT([no])
10321 AC_SUBST(ENABLE_VLC)
10323 ENABLE_OPENGL_TRANSITIONS=
10324 ENABLE_OPENGL_CANVAS=
10325 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10327 elif test "$_os" = "Darwin"; then
10328 # We use frameworks on Mac OS X, no need for detail checks
10329 ENABLE_OPENGL_TRANSITIONS=TRUE
10330 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10331 ENABLE_OPENGL_CANVAS=TRUE
10332 elif test $_os = WINNT; then
10333 ENABLE_OPENGL_TRANSITIONS=TRUE
10334 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10335 ENABLE_OPENGL_CANVAS=TRUE
10337 if test "$USING_X11" = TRUE; then
10338 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10339 ENABLE_OPENGL_TRANSITIONS=TRUE
10340 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10341 ENABLE_OPENGL_CANVAS=TRUE
10345 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10346 AC_SUBST(ENABLE_OPENGL_CANVAS)
10348 dnl =================================================
10349 dnl Check whether to build with OpenCL support.
10350 dnl =================================================
10352 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10353 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10354 # platform (optional at run-time, used through clew).
10355 BUILD_TYPE="$BUILD_TYPE OPENCL"
10356 AC_DEFINE(HAVE_FEATURE_OPENCL)
10359 dnl =================================================
10360 dnl Check whether to build with dconf support.
10361 dnl =================================================
10363 if test "$enable_dconf" != no; then
10364 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10365 if test "$enable_dconf" = yes; then
10366 AC_MSG_ERROR([dconf not found])
10371 AC_MSG_CHECKING([whether to enable dconf])
10372 if test "$enable_dconf" = no; then
10376 AC_MSG_RESULT([no])
10379 AC_DEFINE(ENABLE_DCONF)
10380 AC_MSG_RESULT([yes])
10382 AC_SUBST([DCONF_CFLAGS])
10383 AC_SUBST([DCONF_LIBS])
10384 AC_SUBST([ENABLE_DCONF])
10387 AC_MSG_CHECKING([whether to build the PDF import feature])
10389 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10390 AC_MSG_RESULT([yes])
10391 ENABLE_PDFIMPORT=TRUE
10392 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10394 dnl ===================================================================
10395 dnl Check for system poppler
10396 dnl ===================================================================
10397 AC_MSG_CHECKING([which PDF import backend to use])
10398 if test "$with_system_poppler" = "yes"; then
10399 AC_MSG_RESULT([external])
10400 SYSTEM_POPPLER=TRUE
10401 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10402 AC_LANG_PUSH([C++])
10403 save_CXXFLAGS=$CXXFLAGS
10404 save_CPPFLAGS=$CPPFLAGS
10405 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10406 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10407 AC_CHECK_HEADER([cpp/poppler-version.h],
10408 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10410 CXXFLAGS=$save_CXXFLAGS
10411 CPPFLAGS=$save_CPPFLAGS
10413 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10415 FilterLibs "${POPPLER_LIBS}"
10416 POPPLER_LIBS="${filteredlibs}"
10418 AC_MSG_RESULT([internal])
10420 BUILD_TYPE="$BUILD_TYPE POPPLER"
10421 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10423 AC_DEFINE([ENABLE_PDFIMPORT],1)
10425 AC_MSG_RESULT([no])
10427 AC_SUBST(ENABLE_PDFIMPORT)
10428 AC_SUBST(SYSTEM_POPPLER)
10429 AC_SUBST(POPPLER_CFLAGS)
10430 AC_SUBST(POPPLER_LIBS)
10433 AC_MSG_CHECKING([whether to build PDFium])
10435 if test -z "$enable_pdfium" -o "$enable_pdfium" = yes; then
10436 AC_MSG_RESULT([yes])
10438 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10439 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10441 AC_MSG_RESULT([no])
10443 AC_SUBST(ENABLE_PDFIUM)
10447 if test "$build_for_ios" = "YES"; then
10448 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
10449 AC_MSG_RESULT([yes])
10450 elif test "$enable_mpl_subset" = "yes"; then
10451 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
10452 AC_MSG_RESULT([yes])
10453 elif test "$enable_fuzzers" = "yes"; then
10454 AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
10455 AC_MSG_RESULT([yes])
10456 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
10457 dnl ===================================================================
10458 dnl Check for system gpgme
10459 dnl ===================================================================
10460 AC_MSG_CHECKING([which gpgmepp to use])
10461 if test "$with_system_gpgmepp" = "yes"; then
10462 AC_MSG_RESULT([external])
10463 SYSTEM_GPGMEPP=TRUE
10465 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
10466 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
10467 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
10468 # progress_callback is the only func with plain C linkage
10469 # checking for it also filters out older, KDE-dependent libgpgmepp versions
10470 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
10471 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
10472 AC_CHECK_HEADER(gpgme.h, [],
10473 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
10475 AC_MSG_RESULT([internal])
10476 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
10477 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
10479 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
10480 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
10481 if test "$_os" != "WINNT"; then
10482 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
10483 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
10484 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
10485 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
10488 ENABLE_GPGMEPP=TRUE
10489 AC_DEFINE([HAVE_FEATURE_GPGME])
10490 AC_PATH_PROG(GPG, gpg)
10491 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
10492 # so let's exclude that manually for the moment
10493 if test -n "$GPG" -a "$_os" != "WINNT"; then
10494 # make sure we not only have a working gpgme, but a full working
10495 # gpg installation to run OpenPGP signature verification
10496 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
10498 if test "$_os" = "Linux"; then
10500 AC_MSG_CHECKING([for /run/user/$uid])
10501 if test -d /run/user/$uid; then
10502 AC_MSG_RESULT([yes])
10503 AC_PATH_PROG(GPGCONF, gpgconf)
10504 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
10505 if $GPGCONF --dump-options > /dev/null ; then
10506 if $GPGCONF --dump-options | grep -q create-socketdir ; then
10507 AC_MSG_RESULT([yes])
10508 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
10510 AC_MSG_RESULT([no])
10513 AC_MSG_RESULT([no. missing or broken gpgconf?])
10516 AC_MSG_RESULT([no])
10520 AC_SUBST(ENABLE_GPGMEPP)
10521 AC_SUBST(SYSTEM_GPGMEPP)
10522 AC_SUBST(GPG_ERROR_CFLAGS)
10523 AC_SUBST(GPG_ERROR_LIBS)
10524 AC_SUBST(LIBASSUAN_CFLAGS)
10525 AC_SUBST(LIBASSUAN_LIBS)
10526 AC_SUBST(GPGMEPP_CFLAGS)
10527 AC_SUBST(GPGMEPP_LIBS)
10529 AC_SUBST(HAVE_GPGCONF_SOCKETDIR)
10531 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10532 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10533 AC_MSG_RESULT([yes])
10534 ENABLE_MEDIAWIKI=TRUE
10535 BUILD_TYPE="$BUILD_TYPE XSLTML"
10536 if test "x$with_java" = "xno"; then
10537 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10540 AC_MSG_RESULT([no])
10542 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10544 AC_SUBST(ENABLE_MEDIAWIKI)
10546 AC_MSG_CHECKING([whether to build the Report Builder])
10547 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10548 AC_MSG_RESULT([yes])
10549 ENABLE_REPORTBUILDER=TRUE
10550 AC_MSG_CHECKING([which jfreereport libs to use])
10551 if test "$with_system_jfreereport" = "yes"; then
10552 SYSTEM_JFREEREPORT=TRUE
10553 AC_MSG_RESULT([external])
10554 if test -z $SAC_JAR; then
10555 SAC_JAR=/usr/share/java/sac.jar
10557 if ! test -f $SAC_JAR; then
10558 AC_MSG_ERROR(sac.jar not found.)
10561 if test -z $LIBXML_JAR; then
10562 if test -f /usr/share/java/libxml-1.0.0.jar; then
10563 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
10564 elif test -f /usr/share/java/libxml.jar; then
10565 LIBXML_JAR=/usr/share/java/libxml.jar
10567 AC_MSG_ERROR(libxml.jar replacement not found.)
10569 elif ! test -f $LIBXML_JAR; then
10570 AC_MSG_ERROR(libxml.jar not found.)
10573 if test -z $FLUTE_JAR; then
10574 if test -f/usr/share/java/flute-1.3.0.jar; then
10575 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
10576 elif test -f /usr/share/java/flute.jar; then
10577 FLUTE_JAR=/usr/share/java/flute.jar
10579 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
10581 elif ! test -f $FLUTE_JAR; then
10582 AC_MSG_ERROR(flute-1.3.0.jar not found.)
10585 if test -z $JFREEREPORT_JAR; then
10586 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
10587 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
10588 elif test -f /usr/share/java/flow-engine.jar; then
10589 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
10591 AC_MSG_ERROR(jfreereport.jar replacement not found.)
10593 elif ! test -f $JFREEREPORT_JAR; then
10594 AC_MSG_ERROR(jfreereport.jar not found.)
10597 if test -z $LIBLAYOUT_JAR; then
10598 if test -f /usr/share/java/liblayout-0.2.9.jar; then
10599 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
10600 elif test -f /usr/share/java/liblayout.jar; then
10601 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
10603 AC_MSG_ERROR(liblayout.jar replacement not found.)
10605 elif ! test -f $LIBLAYOUT_JAR; then
10606 AC_MSG_ERROR(liblayout.jar not found.)
10609 if test -z $LIBLOADER_JAR; then
10610 if test -f /usr/share/java/libloader-1.0.0.jar; then
10611 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
10612 elif test -f /usr/share/java/libloader.jar; then
10613 LIBLOADER_JAR=/usr/share/java/libloader.jar
10615 AC_MSG_ERROR(libloader.jar replacement not found.)
10617 elif ! test -f $LIBLOADER_JAR; then
10618 AC_MSG_ERROR(libloader.jar not found.)
10621 if test -z $LIBFORMULA_JAR; then
10622 if test -f /usr/share/java/libformula-0.2.0.jar; then
10623 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
10624 elif test -f /usr/share/java/libformula.jar; then
10625 LIBFORMULA_JAR=/usr/share/java/libformula.jar
10627 AC_MSG_ERROR(libformula.jar replacement not found.)
10629 elif ! test -f $LIBFORMULA_JAR; then
10630 AC_MSG_ERROR(libformula.jar not found.)
10633 if test -z $LIBREPOSITORY_JAR; then
10634 if test -f /usr/share/java/librepository-1.0.0.jar; then
10635 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
10636 elif test -f /usr/share/java/librepository.jar; then
10637 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
10639 AC_MSG_ERROR(librepository.jar replacement not found.)
10641 elif ! test -f $LIBREPOSITORY_JAR; then
10642 AC_MSG_ERROR(librepository.jar not found.)
10645 if test -z $LIBFONTS_JAR; then
10646 if test -f /usr/share/java/libfonts-1.0.0.jar; then
10647 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
10648 elif test -f /usr/share/java/libfonts.jar; then
10649 LIBFONTS_JAR=/usr/share/java/libfonts.jar
10651 AC_MSG_ERROR(libfonts.jar replacement not found.)
10653 elif ! test -f $LIBFONTS_JAR; then
10654 AC_MSG_ERROR(libfonts.jar not found.)
10657 if test -z $LIBSERIALIZER_JAR; then
10658 if test -f /usr/share/java/libserializer-1.0.0.jar; then
10659 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
10660 elif test -f /usr/share/java/libserializer.jar; then
10661 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
10663 AC_MSG_ERROR(libserializer.jar replacement not found.)
10665 elif ! test -f $LIBSERIALIZER_JAR; then
10666 AC_MSG_ERROR(libserializer.jar not found.)
10669 if test -z $LIBBASE_JAR; then
10670 if test -f /usr/share/java/libbase-1.0.0.jar; then
10671 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
10672 elif test -f /usr/share/java/libbase.jar; then
10673 LIBBASE_JAR=/usr/share/java/libbase.jar
10675 AC_MSG_ERROR(libbase.jar replacement not found.)
10677 elif ! test -f $LIBBASE_JAR; then
10678 AC_MSG_ERROR(libbase.jar not found.)
10682 AC_MSG_RESULT([internal])
10683 SYSTEM_JFREEREPORT=
10684 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10688 AC_MSG_RESULT([no])
10689 ENABLE_REPORTBUILDER=
10690 SYSTEM_JFREEREPORT=
10692 AC_SUBST(ENABLE_REPORTBUILDER)
10693 AC_SUBST(SYSTEM_JFREEREPORT)
10695 AC_SUBST(LIBXML_JAR)
10696 AC_SUBST(FLUTE_JAR)
10697 AC_SUBST(JFREEREPORT_JAR)
10698 AC_SUBST(LIBBASE_JAR)
10699 AC_SUBST(LIBLAYOUT_JAR)
10700 AC_SUBST(LIBLOADER_JAR)
10701 AC_SUBST(LIBFORMULA_JAR)
10702 AC_SUBST(LIBREPOSITORY_JAR)
10703 AC_SUBST(LIBFONTS_JAR)
10704 AC_SUBST(LIBSERIALIZER_JAR)
10706 # this has to be here because both the Wiki Publisher and the SRB use
10708 COMMONS_LOGGING_VERSION=1.2
10709 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
10710 AC_MSG_CHECKING([which Apache commons-* libs to use])
10711 if test "$with_system_apache_commons" = "yes"; then
10712 SYSTEM_APACHE_COMMONS=TRUE
10713 AC_MSG_RESULT([external])
10714 if test -z $COMMONS_LOGGING_JAR; then
10715 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
10716 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
10717 elif test -f /usr/share/java/commons-logging.jar; then
10718 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
10720 AC_MSG_ERROR(commons-logging.jar replacement not found.)
10722 elif ! test -f $COMMONS_LOGGING_JAR; then
10723 AC_MSG_ERROR(commons-logging.jar not found.)
10726 AC_MSG_RESULT([internal])
10727 SYSTEM_APACHE_COMMONS=
10728 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
10732 AC_SUBST(SYSTEM_APACHE_COMMONS)
10733 AC_SUBST(COMMONS_LOGGING_JAR)
10734 AC_SUBST(COMMONS_LOGGING_VERSION)
10736 # scripting provider for BeanShell?
10737 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10738 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10739 AC_MSG_RESULT([yes])
10740 ENABLE_SCRIPTING_BEANSHELL=TRUE
10742 dnl ===================================================================
10743 dnl Check for system beanshell
10744 dnl ===================================================================
10745 AC_MSG_CHECKING([which beanshell to use])
10746 if test "$with_system_beanshell" = "yes"; then
10747 AC_MSG_RESULT([external])
10749 if test -z $BSH_JAR; then
10750 BSH_JAR=/usr/share/java/bsh.jar
10752 if ! test -f $BSH_JAR; then
10753 AC_MSG_ERROR(bsh.jar not found.)
10756 AC_MSG_RESULT([internal])
10758 BUILD_TYPE="$BUILD_TYPE BSH"
10761 AC_MSG_RESULT([no])
10762 ENABLE_SCRIPTING_BEANSHELL=
10763 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10765 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10766 AC_SUBST(SYSTEM_BSH)
10769 # scripting provider for JavaScript?
10770 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10771 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10772 AC_MSG_RESULT([yes])
10773 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10775 dnl ===================================================================
10776 dnl Check for system rhino
10777 dnl ===================================================================
10778 AC_MSG_CHECKING([which rhino to use])
10779 if test "$with_system_rhino" = "yes"; then
10780 AC_MSG_RESULT([external])
10782 if test -z $RHINO_JAR; then
10783 RHINO_JAR=/usr/share/java/js.jar
10785 if ! test -f $RHINO_JAR; then
10786 AC_MSG_ERROR(js.jar not found.)
10789 AC_MSG_RESULT([internal])
10791 BUILD_TYPE="$BUILD_TYPE RHINO"
10795 AC_MSG_RESULT([no])
10796 ENABLE_SCRIPTING_JAVASCRIPT=
10797 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10799 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10800 AC_SUBST(SYSTEM_RHINO)
10801 AC_SUBST(RHINO_JAR)
10803 # This is only used in KDE3/KDE4 checks to determine if /usr/lib64
10804 # paths should be added to library search path. So lets put all 64-bit
10807 case "$host_cpu" in
10808 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
10809 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
10810 supports_multilib="yes"
10817 dnl ===================================================================
10818 dnl KDE4 Integration
10819 dnl ===================================================================
10825 KDE4_GLIB_CFLAGS=""
10828 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10829 qt4_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10830 qt4_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10832 kde4_incdirs="/usr/include /usr/include/kde4 $x_includes"
10833 kde4_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10835 if test -n "$supports_multilib"; then
10836 qt4_libdirs="$qt4_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10837 kde4_libdirs="$kde4_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10840 if test -n "$QTDIR"; then
10841 qt4_incdirs="$QTDIR/include $qt4_incdirs"
10842 if test -z "$supports_multilib"; then
10843 qt4_libdirs="$QTDIR/lib $qt4_libdirs"
10845 qt4_libdirs="$QTDIR/lib64 $QTDIR/lib $qt4_libdirs"
10848 if test -n "$QT4DIR"; then
10849 qt4_incdirs="$QT4DIR/include $qt4_incdirs"
10850 if test -z "$supports_multilib"; then
10851 qt4_libdirs="$QT4DIR/lib $qt4_libdirs"
10853 qt4_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt4_libdirs"
10857 if test -n "$KDEDIR"; then
10858 kde4_incdirs="$KDEDIR/include $kde4_incdirs"
10859 if test -z "$supports_multilib"; then
10860 kde4_libdirs="$KDEDIR/lib $kde4_libdirs"
10862 kde4_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde4_libdirs"
10865 if test -n "$KDE4DIR"; then
10866 kde4_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde4_incdirs"
10867 if test -z "$supports_multilib"; then
10868 kde4_libdirs="$KDE4DIR/lib $kde4_libdirs"
10870 kde4_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde4_libdirs"
10874 qt4_test_include="Qt/qobject.h"
10875 qt4_test_library="libQtNetwork.so"
10876 kde4_test_include="kwindowsystem.h"
10877 kde4_test_library="libsolid.so"
10879 AC_MSG_CHECKING([for Qt4 headers])
10880 qt4_header_dir="no"
10881 for inc_dir in $qt4_incdirs; do
10882 if test -r "$inc_dir/$qt4_test_include"; then
10883 qt4_header_dir="$inc_dir"
10888 AC_MSG_RESULT([$qt4_header_dir])
10889 if test "x$qt4_header_dir" = "xno"; then
10890 AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10893 dnl Check for qmake
10894 AC_PATH_PROGS( QMAKE4, [qmake-qt4 qmake], no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
10895 if test "$QMAKE4" = "no"; then
10896 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10898 qmake4_test_ver="`$QMAKE4 -v 2>&1 | sed -n -e '/^Using Qt version 4\./p'`"
10899 if test -z "$qmake4_test_ver"; then
10900 AC_MSG_ERROR([Wrong qmake for Qt4 found. Please specify the root of your Qt installation by exporting QT4DIR before running "configure".])
10904 qt4_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt4_libdirs"
10905 AC_MSG_CHECKING([for Qt4 libraries])
10907 for lib_dir in $qt4_libdirs; do
10908 if test -r "$lib_dir/$qt4_test_library"; then
10909 qt4_lib_dir="$lib_dir"
10910 PKG_CONFIG_PATH="$qt4_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
10915 AC_MSG_RESULT([$qt4_lib_dir])
10917 if test "x$qt4_lib_dir" = "xno"; then
10918 AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10921 dnl Check for Meta Object Compiler
10923 AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10925 if test "$MOC4" = "no"; then
10926 AC_PATH_PROG( MOC4, moc, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10927 if test "$MOC4" = "no"; then
10928 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
10929 the root of your Qt installation by exporting QT4DIR before running "configure".])
10933 dnl Check for KDE4 headers
10934 AC_MSG_CHECKING([for KDE4 headers])
10936 for kde4_check in $kde4_incdirs; do
10937 if test -r "$kde4_check/$kde4_test_include"; then
10938 kde4_incdir="$kde4_check"
10942 AC_MSG_RESULT([$kde4_incdir])
10943 if test "x$kde4_incdir" = "xno"; then
10944 AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10946 if test "$kde4_incdir" = "/usr/include"; then kde4_incdir=; fi
10948 dnl Check for KDE4 libraries
10949 AC_MSG_CHECKING([for KDE4 libraries])
10951 for kde4_check in $kde4_libdirs; do
10952 if test -r "$kde4_check/$kde4_test_library"; then
10953 kde4_libdir="$kde4_check"
10958 AC_MSG_RESULT([$kde4_libdir])
10959 if test "x$kde4_libdir" = "xno"; then
10960 AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10963 PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
10964 if ! test -z "$kde4_incdir"; then
10965 KDE4_CFLAGS="-I$kde4_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10967 KDE4_CFLAGS="$QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10970 KDE4_LIBS="-L$kde4_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt4_lib_dir $QT4_LIBS"
10971 KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10972 FilterLibs "$KDE4_LIBS"
10973 KDE4_LIBS="$filteredlibs"
10975 AC_LANG_PUSH([C++])
10976 save_CXXFLAGS=$CXXFLAGS
10977 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
10978 AC_MSG_CHECKING([whether KDE is >= 4.2])
10979 AC_RUN_IFELSE([AC_LANG_SOURCE([[
10980 #include <kdeversion.h>
10982 int main(int argc, char **argv) {
10983 if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
10986 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
10987 CXXFLAGS=$save_CXXFLAGS
10990 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
10991 # Sets also KDE4_GLIB_CFLAGS/KDE4_GLIB_LIBS if successful.
10992 PKG_CHECK_MODULES(KDE4_GLIB,[glib-2.0 >= 2.4],
10994 KDE4_HAVE_GLIB=TRUE
10995 AC_DEFINE(KDE4_HAVE_GLIB,1)
10996 KDE4_GLIB_CFLAGS=$(printf '%s' "$KDE4_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10997 FilterLibs "${KDE4_GLIB_LIBS}"
10998 KDE4_GLIB_LIBS="${filteredlibs}"
11002 AC_LANG_PUSH([C++])
11003 # tst_exclude_socket_notifiers.moc:70:28: runtime error: member access within address 0x60d00000bb20 which does not point to an object of type 'QObjectData'
11004 # 0x60d00000bb20: note: object is of type 'QObjectPrivate'
11005 # 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
11006 # ^~~~~~~~~~~~~~~~~~~~~~~
11007 # vptr for 'QObjectPrivate'
11008 # so temporarily ignore here whichever way would be used to make such errors fatal
11009 # (-fno-sanitize-recover=... or UBSAN_OPTIONS halt_on_error=1):
11011 CXX=$(printf %s "$CXX" \
11012 | sed -e 's/-fno-sanitize-recover\(=[[0-9A-Za-z,_-]]*\)*//')
11013 save_UBSAN_OPTIONS=$UBSAN_OPTIONS
11014 UBSAN_OPTIONS=$UBSAN_OPTIONS:halt_on_error=0
11015 save_CXXFLAGS=$CXXFLAGS
11016 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11018 LIBS="$LIBS $KDE4_LIBS"
11019 AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
11021 # Prepare meta object data
11022 TSTBASE="tst_exclude_socket_notifiers"
11023 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11024 ln -fs "${TSTMOC}.hxx"
11025 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11027 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11029 #include "tst_exclude_socket_notifiers.moc"
11031 int main(int argc, char *argv[])
11033 QCoreApplication app(argc, argv);
11034 exit(tst_processEventsExcludeSocket());
11038 AC_MSG_RESULT([yes])
11040 AC_MSG_RESULT([no])
11041 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11042 if test -z "$qt4_fix_warning"; then
11043 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11046 add_warning " https://bugreports.qt.io/browse/QTBUG-37380 (needed)"
11047 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11049 # Remove meta object data
11050 rm -f "${TSTBASE}."*
11052 AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
11054 # Prepare meta object data
11055 TSTBASE="tst_exclude_posted_events"
11056 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11057 ln -fs "${TSTMOC}.hxx"
11058 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11060 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11062 #include "tst_exclude_posted_events.moc"
11064 int main(int argc, char *argv[])
11066 QCoreApplication app(argc, argv);
11067 exit(tst_excludePostedEvents());
11071 AC_MSG_RESULT([yes])
11073 AC_MSG_RESULT([no])
11074 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11075 if test -z "$qt4_fix_warning"; then
11076 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11079 add_warning " https://bugreports.qt.io/browse/QTBUG-34614 (needed)"
11080 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11082 # Remove meta object data
11083 rm -f "${TSTBASE}."*
11085 if test -n "$qt4_fix_warning"; then
11086 add_warning " https://bugreports.qt.io/browse/QTBUG-38585 (recommended)"
11090 CXXFLAGS=$save_CXXFLAGS
11091 UBSAN_OPTIONS=$save_UBSAN_OPTIONS
11095 AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
11097 AC_SUBST(KDE4_CFLAGS)
11098 AC_SUBST(KDE4_LIBS)
11100 AC_SUBST(KDE4_GLIB_CFLAGS)
11101 AC_SUBST(KDE4_GLIB_LIBS)
11102 AC_SUBST(KDE4_HAVE_GLIB)
11104 dnl ===================================================================
11105 dnl QT5 Integration
11106 dnl ===================================================================
11115 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11116 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11117 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11119 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11120 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11122 if test -n "$supports_multilib"; then
11123 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11126 qt5_test_include="QtWidgets/qapplication.h"
11127 qt5_test_library="libQt5Widgets.so"
11129 dnl Check for qmake5
11130 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
11131 if test "$QMAKE5" = "no"; then
11132 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11134 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11135 if test -z "$qmake5_test_ver"; then
11136 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11138 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11139 qt5_minimal_minor="6"
11140 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11141 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11143 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11147 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11148 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11150 AC_MSG_CHECKING([for Qt5 headers])
11152 for inc_dir in $qt5_incdirs; do
11153 if test -r "$inc_dir/$qt5_test_include"; then
11154 qt5_incdir="$inc_dir"
11158 AC_MSG_RESULT([$qt5_incdir])
11159 if test "x$qt5_incdir" = "xno"; then
11160 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11163 AC_MSG_CHECKING([for Qt5 libraries])
11165 for lib_dir in $qt5_libdirs; do
11166 if test -r "$lib_dir/$qt5_test_library"; then
11167 qt5_libdir="$lib_dir"
11171 AC_MSG_RESULT([$qt5_libdir])
11172 if test "x$qt5_libdir" = "xno"; then
11173 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11176 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11177 QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11178 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11180 dnl Check for Meta Object Compiler
11182 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH] )
11183 if test "$MOC5" = "no"; then
11184 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11185 the root of your Qt installation by exporting QT5DIR before running "configure".])
11188 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11189 # Sets also QT5_GLIB_CFLAGS/QT5_GLIB_LIBS if successful.
11190 PKG_CHECK_MODULES(QT5_GLIB,[glib-2.0 >= 2.4],
11193 AC_DEFINE(QT5_HAVE_GLIB,1)
11195 AC_MSG_WARN([[No Glib found, Qt5 support will not use native file pickers!]])
11198 AC_SUBST(QT5_CFLAGS)
11201 AC_SUBST(QT5_GLIB_CFLAGS)
11202 AC_SUBST(QT5_GLIB_LIBS)
11203 AC_SUBST(QT5_HAVE_GLIB)
11205 dnl ===================================================================
11206 dnl KDE5 Integration
11207 dnl ===================================================================
11211 KF5_CONFIG="kf5-config"
11212 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11213 \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11214 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11216 if test "$OS" = "HAIKU"; then
11217 haiku_arch="`echo $RTL_ARCH | tr X x`"
11218 kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11219 kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11222 kf5_incdirs="$KF5INC /usr/include/ $kf5_haiku_incdirs $x_includes"
11223 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11224 if test -n "$supports_multilib"; then
11225 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11228 kf5_test_include="KF5/kcoreaddons_version.h"
11229 kf5_test_library="libKF5CoreAddons.so"
11230 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11232 dnl kf5 KDE4 support compatibility installed
11233 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11234 if test "$KF5_CONFIG" != "no"; then
11235 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11236 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11239 dnl Check for KF5 headers
11240 AC_MSG_CHECKING([for KF5 headers])
11242 for kf5_check in $kf5_incdirs; do
11243 if test -r "$kf5_check/$kf5_test_include"; then
11244 kf5_incdir="$kf5_check/KF5"
11248 AC_MSG_RESULT([$kf5_incdir])
11249 if test "x$kf5_incdir" = "xno"; then
11250 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11253 dnl Check for KF5 libraries
11254 AC_MSG_CHECKING([for KF5 libraries])
11256 for kf5_check in $kf5_libdirs; do
11257 if test -r "$kf5_check/$kf5_test_library"; then
11258 kf5_libdir="$kf5_check"
11263 AC_MSG_RESULT([$kf5_libdir])
11264 if test "x$kf5_libdir" = "xno"; then
11265 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11268 if test "$USING_X11" = TRUE; then
11269 PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])])
11272 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"
11273 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS"
11274 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11276 if test "$USING_X11" = TRUE; then
11277 KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11280 AC_LANG_PUSH([C++])
11281 save_CXXFLAGS=$CXXFLAGS
11282 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11283 AC_MSG_CHECKING([whether KDE is >= 5.0])
11284 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11285 #include <kcoreaddons_version.h>
11287 int main(int argc, char **argv) {
11288 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11291 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11292 CXXFLAGS=$save_CXXFLAGS
11295 AC_SUBST(KF5_CFLAGS)
11298 dnl ===================================================================
11299 dnl Test whether to include Evolution 2 support
11300 dnl ===================================================================
11301 AC_MSG_CHECKING([whether to enable evolution 2 support])
11302 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11303 AC_MSG_RESULT([yes])
11304 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11305 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11306 FilterLibs "${GOBJECT_LIBS}"
11307 GOBJECT_LIBS="${filteredlibs}"
11308 ENABLE_EVOAB2="TRUE"
11311 AC_MSG_RESULT([no])
11313 AC_SUBST(ENABLE_EVOAB2)
11314 AC_SUBST(GOBJECT_CFLAGS)
11315 AC_SUBST(GOBJECT_LIBS)
11317 dnl ===================================================================
11318 dnl Test which themes to include
11319 dnl ===================================================================
11320 AC_MSG_CHECKING([which themes to include])
11321 # if none given use default subset of available themes
11322 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11323 with_theme="breeze breeze_dark colibre elementary karasa_jaga sifr sifr_dark tango"
11327 if test "x$with_theme" != "xno"; then
11328 for theme in $with_theme; do
11330 breeze|breeze_dark|colibre|elementary|karasa_jaga|sifr|sifr_dark|tango) real_theme="$theme" ;;
11331 default) real_theme=colibre ;;
11332 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11334 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11337 AC_MSG_RESULT([$WITH_THEMES])
11338 AC_SUBST([WITH_THEMES])
11339 # FIXME: remove this, and the convenience default->colibre remapping after a crace period
11340 for theme in $with_theme; do
11342 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11347 dnl ===================================================================
11348 dnl Test whether to integrate helppacks into the product's installer
11349 dnl ===================================================================
11350 AC_MSG_CHECKING([for helppack integration])
11351 if test "$with_helppack_integration" = "no"; then
11352 AC_MSG_RESULT([no integration])
11354 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11355 AC_MSG_RESULT([integration])
11358 ###############################################################################
11359 # Extensions checking
11360 ###############################################################################
11361 AC_MSG_CHECKING([for extensions integration])
11362 if test "x$enable_extension_integration" != "xno"; then
11363 WITH_EXTENSION_INTEGRATION=TRUE
11364 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11365 AC_MSG_RESULT([yes, use integration])
11367 WITH_EXTENSION_INTEGRATION=
11368 AC_MSG_RESULT([no, do not integrate])
11370 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11372 dnl Should any extra extensions be included?
11373 dnl There are standalone tests for each of these below.
11374 WITH_EXTRA_EXTENSIONS=
11375 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11377 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11378 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11379 if test "x$with_java" != "xno"; then
11380 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11381 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11384 AC_MSG_CHECKING([whether to build opens___.ttf])
11385 if test "$enable_build_opensymbol" = "yes"; then
11386 AC_MSG_RESULT([yes])
11387 AC_PATH_PROG(FONTFORGE, fontforge)
11388 if test -z "$FONTFORGE"; then
11389 AC_MSG_ERROR([fontforge not installed])
11392 AC_MSG_RESULT([no])
11393 OPENSYMBOL_TTF=49a64f3bcf20a7909ba2751349231d6652ded9cd2840e961b5164d09de3ffa63-opens___.ttf
11394 BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11396 AC_SUBST(OPENSYMBOL_TTF)
11397 AC_SUBST(FONTFORGE)
11399 dnl ===================================================================
11400 dnl Test whether to include fonts
11401 dnl ===================================================================
11402 AC_MSG_CHECKING([whether to include third-party fonts])
11403 if test "$with_fonts" != "no"; then
11404 AC_MSG_RESULT([yes])
11406 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11407 AC_DEFINE(HAVE_MORE_FONTS)
11409 AC_MSG_RESULT([no])
11411 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11413 AC_SUBST(WITH_FONTS)
11416 dnl ===================================================================
11417 dnl Test whether to enable online update service
11418 dnl ===================================================================
11419 AC_MSG_CHECKING([whether to enable online update])
11420 ENABLE_ONLINE_UPDATE=
11421 ENABLE_ONLINE_UPDATE_MAR=
11423 if test "$enable_online_update" = ""; then
11424 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11425 AC_MSG_RESULT([yes])
11426 ENABLE_ONLINE_UPDATE="TRUE"
11428 AC_MSG_RESULT([no])
11431 if test "$enable_online_update" = "mar"; then
11432 AC_MSG_RESULT([yes - MAR-based online update])
11433 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11434 if test "$with_update_config" = ""; then
11435 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11437 UPDATE_CONFIG="$with_update_config"
11438 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11439 elif test "$enable_online_update" = "yes"; then
11440 AC_MSG_RESULT([yes])
11441 ENABLE_ONLINE_UPDATE="TRUE"
11443 AC_MSG_RESULT([no])
11446 AC_SUBST(ENABLE_ONLINE_UPDATE)
11447 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11448 AC_SUBST(UPDATE_CONFIG)
11450 dnl ===================================================================
11451 dnl Test whether we need bzip2
11452 dnl ===================================================================
11454 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11455 AC_MSG_CHECKING([whether to use system bzip2])
11456 if test "$with_system_bzip2" = yes; then
11458 AC_MSG_RESULT([yes])
11459 PKG_CHECK_MODULES(BZIP2, bzip2)
11460 FilterLibs "${BZIP2_LIBS}"
11461 BZIP2_LIBS="${filteredlibs}"
11463 AC_MSG_RESULT([no])
11464 BUILD_TYPE="$BUILD_TYPE BZIP2"
11467 AC_SUBST(SYSTEM_BZIP2)
11468 AC_SUBST(BZIP2_CFLAGS)
11469 AC_SUBST(BZIP2_LIBS)
11471 dnl ===================================================================
11472 dnl Test whether to enable extension update
11473 dnl ===================================================================
11474 AC_MSG_CHECKING([whether to enable extension update])
11475 ENABLE_EXTENSION_UPDATE=
11476 if test "x$enable_extension_update" = "xno"; then
11477 AC_MSG_RESULT([no])
11479 AC_MSG_RESULT([yes])
11480 ENABLE_EXTENSION_UPDATE="TRUE"
11481 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11482 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11484 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11487 dnl ===================================================================
11488 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11489 dnl ===================================================================
11490 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11491 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11492 AC_MSG_RESULT([no])
11495 AC_MSG_RESULT([yes])
11496 ENABLE_SILENT_MSI=TRUE
11497 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11499 AC_SUBST(ENABLE_SILENT_MSI)
11501 AC_MSG_CHECKING([whether and how to use Xinerama])
11502 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11503 if test "$x_libraries" = "default_x_libraries"; then
11504 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11505 if test "x$XINERAMALIB" = x; then
11506 XINERAMALIB="/usr/lib"
11509 XINERAMALIB="$x_libraries"
11511 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11512 # we have both versions, let the user decide but use the dynamic one
11515 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11516 XINERAMA_LINK=dynamic
11518 XINERAMA_LINK=static
11520 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11521 # we have only the dynamic version
11523 XINERAMA_LINK=dynamic
11524 elif test -e "$XINERAMALIB/libXinerama.a"; then
11526 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11528 XINERAMA_LINK=static
11538 if test "$USE_XINERAMA" = "TRUE"; then
11539 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11540 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11541 [AC_MSG_ERROR(Xinerama header not found.)], [])
11542 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11543 if test "x$XEXTLIB" = x; then
11544 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11546 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11547 if test "$_os" = "FreeBSD"; then
11548 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11550 if test "$_os" = "Linux"; then
11551 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11553 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11554 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11556 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11561 AC_MSG_RESULT([no])
11563 AC_SUBST(USE_XINERAMA)
11564 AC_SUBST(XINERAMA_LINK)
11566 dnl ===================================================================
11567 dnl Test whether to build cairo or rely on the system version
11568 dnl ===================================================================
11570 if test "$USING_X11" = TRUE; then
11571 # Used in vcl/Library_vclplug_gen.mk
11575 if test "$test_cairo" = "yes"; then
11576 AC_MSG_CHECKING([whether to use the system cairo])
11578 : ${with_system_cairo:=$with_system_libs}
11579 if test "$with_system_cairo" = "yes"; then
11581 AC_MSG_RESULT([yes])
11583 PKG_CHECK_MODULES( CAIRO, cairo >= 1.2.0 )
11584 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11585 FilterLibs "${CAIRO_LIBS}"
11586 CAIRO_LIBS="${filteredlibs}"
11588 if test "$test_xrender" = "yes"; then
11589 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11591 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11592 #ifdef PictStandardA8
11596 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11602 AC_MSG_RESULT([no])
11604 BUILD_TYPE="$BUILD_TYPE CAIRO"
11608 AC_SUBST(SYSTEM_CAIRO)
11609 AC_SUBST(CAIRO_CFLAGS)
11610 AC_SUBST(CAIRO_LIBS)
11612 dnl ===================================================================
11613 dnl Test whether to use avahi
11614 dnl ===================================================================
11615 if test "$_os" = "WINNT"; then
11616 # Windows uses bundled mDNSResponder
11617 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11618 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11619 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11620 [ENABLE_AVAHI="TRUE"])
11621 AC_DEFINE(HAVE_FEATURE_AVAHI)
11622 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11623 FilterLibs "${AVAHI_LIBS}"
11624 AVAHI_LIBS="${filteredlibs}"
11627 AC_SUBST(ENABLE_AVAHI)
11628 AC_SUBST(AVAHI_CFLAGS)
11629 AC_SUBST(AVAHI_LIBS)
11631 dnl ===================================================================
11632 dnl Test whether to use liblangtag
11633 dnl ===================================================================
11635 AC_MSG_CHECKING([whether to use system liblangtag])
11636 if test "$with_system_liblangtag" = yes; then
11637 SYSTEM_LIBLANGTAG=TRUE
11638 AC_MSG_RESULT([yes])
11639 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11640 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11641 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11642 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11643 FilterLibs "${LIBLANGTAG_LIBS}"
11644 LIBLANGTAG_LIBS="${filteredlibs}"
11647 AC_MSG_RESULT([no])
11648 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11649 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
11650 if test "$COM" = "MSC"; then
11651 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
11653 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
11656 AC_SUBST(SYSTEM_LIBLANGTAG)
11657 AC_SUBST(LIBLANGTAG_CFLAGS)
11658 AC_SUBST(LIBLANGTAG_LIBS)
11660 dnl ===================================================================
11661 dnl Test whether to build libpng or rely on the system version
11662 dnl ===================================================================
11664 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
11666 dnl ===================================================================
11667 dnl Check for runtime JVM search path
11668 dnl ===================================================================
11669 if test "$ENABLE_JAVA" != ""; then
11670 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11671 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11672 AC_MSG_RESULT([yes])
11673 if ! test -d "$with_jvm_path"; then
11674 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11676 if ! test -d "$with_jvm_path"jvm; then
11677 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11679 JVM_ONE_PATH_CHECK="$with_jvm_path"
11680 AC_SUBST(JVM_ONE_PATH_CHECK)
11682 AC_MSG_RESULT([no])
11686 dnl ===================================================================
11687 dnl Test for the presence of Ant and that it works
11688 dnl ===================================================================
11690 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
11691 ANT_HOME=; export ANT_HOME
11692 WITH_ANT_HOME=; export WITH_ANT_HOME
11693 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11694 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11695 if test "$_os" = "WINNT"; then
11696 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11698 with_ant_home="$LODE_HOME/opt/ant"
11700 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11701 with_ant_home="$LODE_HOME/opt/ant"
11704 if test -z "$with_ant_home"; then
11705 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11707 if test "$_os" = "WINNT"; then
11708 # AC_PATH_PROGS needs unix path
11709 with_ant_home=`cygpath -u "$with_ant_home"`
11711 AbsolutePath "$with_ant_home"
11712 with_ant_home=$absolute_path
11713 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11714 WITH_ANT_HOME=$with_ant_home
11715 ANT_HOME=$with_ant_home
11718 if test -z "$ANT"; then
11719 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11721 # resolve relative or absolute symlink
11722 while test -h "$ANT"; do
11724 a_basename=`basename "$ANT"`
11725 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11726 cd "`dirname "$ANT"`"
11727 cd "`dirname "$a_script"`"
11728 ANT="`pwd`"/"`basename "$a_script"`"
11732 AC_MSG_CHECKING([if $ANT works])
11733 mkdir -p conftest.dir
11736 cat > conftest.java << EOF
11737 public class conftest {
11738 int testmethod(int a, int b) {
11744 cat > conftest.xml << EOF
11745 <project name="conftest" default="conftest">
11746 <target name="conftest">
11747 <javac srcdir="." includes="conftest.java">
11753 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
11754 if test $? = 0 -a -f ./conftest.class; then
11755 AC_MSG_RESULT([Ant works])
11756 if test -z "$WITH_ANT_HOME"; then
11757 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11758 if test -z "$ANT_HOME"; then
11759 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11762 ANT_HOME="$WITH_ANT_HOME"
11765 echo "configure: Ant test failed" >&5
11766 cat conftest.java >&5
11767 cat conftest.xml >&5
11768 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
11771 rm -fr conftest.dir
11773 if test -z "$ANT_HOME"; then
11774 ANT_HOME="NO_ANT_HOME"
11776 PathFormat "$ANT_HOME"
11777 ANT_HOME="$formatted_path"
11779 ANT="$formatted_path"
11784 dnl Checking for ant.jar
11785 if test "$ANT_HOME" != "NO_ANT_HOME"; then
11786 AC_MSG_CHECKING([Ant lib directory])
11787 if test -f $ANT_HOME/lib/ant.jar; then
11788 ANT_LIB="$ANT_HOME/lib"
11790 if test -f $ANT_HOME/ant.jar; then
11791 ANT_LIB="$ANT_HOME"
11793 if test -f /usr/share/java/ant.jar; then
11794 ANT_LIB=/usr/share/java
11796 if test -f /usr/share/ant-core/lib/ant.jar; then
11797 ANT_LIB=/usr/share/ant-core/lib
11799 if test -f $ANT_HOME/lib/ant/ant.jar; then
11800 ANT_LIB="$ANT_HOME/lib/ant"
11802 if test -f /usr/share/lib/ant/ant.jar; then
11803 ANT_LIB=/usr/share/lib/ant
11805 AC_MSG_ERROR([Ant libraries not found!])
11812 PathFormat "$ANT_LIB"
11813 ANT_LIB="$formatted_path"
11814 AC_MSG_RESULT([Ant lib directory found.])
11819 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11821 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11822 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11823 ant_version_major=`echo $ant_version | cut -d. -f1`
11824 ant_version_minor=`echo $ant_version | cut -d. -f2`
11825 echo "configure: ant_version $ant_version " >&5
11826 echo "configure: ant_version_major $ant_version_major " >&5
11827 echo "configure: ant_version_minor $ant_version_minor " >&5
11828 if test "$ant_version_major" -ge "2"; then
11829 AC_MSG_RESULT([yes, $ant_version])
11830 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11831 AC_MSG_RESULT([yes, $ant_version])
11833 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11836 rm -f conftest* core core.* *.core
11840 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11841 AC_MSG_CHECKING([for JUnit 4])
11842 if test "$with_junit" = "yes"; then
11843 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
11844 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
11845 elif test -e /usr/share/java/junit4.jar; then
11846 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11848 if test -e /usr/share/lib/java/junit.jar; then
11849 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11851 OOO_JUNIT_JAR=/usr/share/java/junit.jar
11855 OOO_JUNIT_JAR=$with_junit
11857 if test "$_os" = "WINNT"; then
11858 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11860 printf 'import org.junit.Before;' > conftest.java
11861 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11862 AC_MSG_RESULT([$OOO_JUNIT_JAR])
11865 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
11866 specify its pathname via --with-junit=..., or disable it via --without-junit])
11868 rm -f conftest.class conftest.java
11869 if test $OOO_JUNIT_JAR != ""; then
11870 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11873 AC_SUBST(OOO_JUNIT_JAR)
11876 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11877 AC_MSG_CHECKING([for included Hamcrest])
11878 printf 'import org.hamcrest.BaseDescription;' > conftest.java
11879 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11880 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
11882 AC_MSG_RESULT([Not included])
11883 AC_MSG_CHECKING([for standalone hamcrest jar.])
11884 if test "$with_hamcrest" = "yes"; then
11885 if test -e /usr/share/lib/java/hamcrest.jar; then
11886 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
11887 elif test -e /usr/share/java/hamcrest/core.jar; then
11888 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
11890 HAMCREST_JAR=/usr/share/java/hamcrest.jar
11893 HAMCREST_JAR=$with_hamcrest
11895 if test "$_os" = "WINNT"; then
11896 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
11898 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
11899 AC_MSG_RESULT([$HAMCREST_JAR])
11901 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),
11902 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
11905 rm -f conftest.class conftest.java
11907 AC_SUBST(HAMCREST_JAR)
11913 # check for wget and curl
11918 if test "$enable_fetch_external" != "no"; then
11920 CURL=`which curl 2>/dev/null`
11922 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
11924 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
11925 if test $? -eq 0; then
11931 if test -z "$WGET" -a -z "$CURL"; then
11932 AC_MSG_ERROR([neither wget nor curl found!])
11941 # check for sha256sum
11945 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
11946 eval "$i -a 256 --version" > /dev/null 2>&1
11948 if test $ret -eq 0; then
11949 SHA256SUM="$i -a 256"
11954 if test -z "$SHA256SUM"; then
11955 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
11956 eval "$i --version" > /dev/null 2>&1
11958 if test $ret -eq 0; then
11965 if test -z "$SHA256SUM"; then
11966 AC_MSG_ERROR([no sha256sum found!])
11969 AC_SUBST(SHA256SUM)
11971 dnl ===================================================================
11972 dnl Dealing with l10n options
11973 dnl ===================================================================
11974 AC_MSG_CHECKING([which languages to be built])
11975 # get list of all languages
11976 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
11977 # the sed command does the following:
11978 # + if a line ends with a backslash, append the next line to it
11979 # + adds " on the beginning of the value (after =)
11980 # + adds " at the end of the value
11981 # + removes en-US; we want to put it on the beginning
11982 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
11983 [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)]
11984 ALL_LANGS="en-US $completelangiso"
11985 # check the configured localizations
11986 WITH_LANG="$with_lang"
11988 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
11989 # (Norwegian is "nb" and "nn".)
11990 if test "$WITH_LANG" = "no"; then
11994 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
11995 AC_MSG_RESULT([en-US])
11997 AC_MSG_RESULT([$WITH_LANG])
11998 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
11999 if test -z "$MSGFMT"; then
12000 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12001 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12002 elif test -x "/opt/lo/bin/msgfmt"; then
12003 MSGFMT="/opt/lo/bin/msgfmt"
12005 AC_CHECK_PROGS(MSGFMT, [msgfmt])
12006 if test -z "$MSGFMT"; then
12007 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12011 if test -z "$MSGUNIQ"; then
12012 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12013 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12014 elif test -x "/opt/lo/bin/msguniq"; then
12015 MSGUNIQ="/opt/lo/bin/msguniq"
12017 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12018 if test -z "$MSGUNIQ"; then
12019 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12026 # check that the list is valid
12027 for lang in $WITH_LANG; do
12028 test "$lang" = "ALL" && continue
12029 # need to check for the exact string, so add space before and after the list of all languages
12030 for vl in $ALL_LANGS; do
12031 if test "$vl" = "$lang"; then
12035 if test "$vl" != "$lang"; then
12036 # if you're reading this - you prolly quoted your languages remove the quotes ...
12037 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12040 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12041 echo $WITH_LANG | grep -q en-US
12042 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12044 # list with substituted ALL
12045 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12046 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12047 test "$WITH_LANG" = "en-US" && WITH_LANG=
12048 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12049 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12050 ALL_LANGS=`echo $ALL_LANGS qtz`
12052 AC_SUBST(ALL_LANGS)
12053 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12054 AC_SUBST(WITH_LANG)
12055 AC_SUBST(WITH_LANG_LIST)
12056 AC_SUBST(GIT_NEEDED_SUBMODULES)
12058 WITH_POOR_HELP_LOCALIZATIONS=
12059 if test -d "$SRC_ROOT/translations/source"; then
12060 for l in `ls -1 $SRC_ROOT/translations/source`; do
12061 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12062 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12066 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12068 if test -n "$with_locales"; then
12069 WITH_LOCALES="$with_locales"
12071 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12072 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12073 # config_host/config_locales.h.in
12074 for locale in $WITH_LOCALES; do
12077 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12081 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12084 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12089 AC_DEFINE(WITH_LOCALE_ALL)
12091 AC_SUBST(WITH_LOCALES)
12093 dnl git submodule update --reference
12094 dnl ===================================================================
12095 if test -n "${GIT_REFERENCE_SRC}"; then
12096 for repo in ${GIT_NEEDED_SUBMODULES}; do
12097 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12098 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12102 AC_SUBST(GIT_REFERENCE_SRC)
12104 dnl git submodules linked dirs
12105 dnl ===================================================================
12106 if test -n "${GIT_LINK_SRC}"; then
12107 for repo in ${GIT_NEEDED_SUBMODULES}; do
12108 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12109 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12113 AC_SUBST(GIT_LINK_SRC)
12116 dnl ===================================================================
12117 AC_MSG_CHECKING([for alternative branding images directory])
12118 # initialize mapped arrays
12119 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12120 brand_files="$BRAND_INTRO_IMAGES about.svg"
12122 if test -z "$with_branding" -o "$with_branding" = "no"; then
12123 AC_MSG_RESULT([none])
12124 DEFAULT_BRAND_IMAGES="$brand_files"
12126 if ! test -d $with_branding ; then
12127 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12129 AC_MSG_RESULT([$with_branding])
12130 CUSTOM_BRAND_DIR="$with_branding"
12131 for lfile in $brand_files
12133 if ! test -f $with_branding/$lfile ; then
12134 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12135 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12137 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12140 check_for_progress="yes"
12143 AC_SUBST([BRAND_INTRO_IMAGES])
12144 AC_SUBST([CUSTOM_BRAND_DIR])
12145 AC_SUBST([CUSTOM_BRAND_IMAGES])
12146 AC_SUBST([DEFAULT_BRAND_IMAGES])
12149 AC_MSG_CHECKING([for 'intro' progress settings])
12153 PROGRESSFRAMECOLOR=
12155 PROGRESSTEXTBASELINE=
12157 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12158 source "$with_branding/progress.conf"
12159 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12161 AC_MSG_RESULT([none])
12164 AC_SUBST(PROGRESSBARCOLOR)
12165 AC_SUBST(PROGRESSSIZE)
12166 AC_SUBST(PROGRESSPOSITION)
12167 AC_SUBST(PROGRESSFRAMECOLOR)
12168 AC_SUBST(PROGRESSTEXTCOLOR)
12169 AC_SUBST(PROGRESSTEXTBASELINE)
12172 AC_MSG_CHECKING([for extra build ID])
12173 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12174 EXTRA_BUILDID="$with_extra_buildid"
12176 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12177 if test -n "$EXTRA_BUILDID" ; then
12178 AC_MSG_RESULT([$EXTRA_BUILDID])
12180 AC_MSG_RESULT([not set])
12182 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12185 AC_MSG_CHECKING([for vendor])
12186 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12187 OOO_VENDOR="$USERNAME"
12189 if test -z "$OOO_VENDOR"; then
12193 if test -z "$OOO_VENDOR"; then
12194 OOO_VENDOR="`id -u -n`"
12197 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12199 OOO_VENDOR="$with_vendor"
12200 AC_MSG_RESULT([$OOO_VENDOR])
12202 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12203 AC_SUBST(OOO_VENDOR)
12205 if test "$_os" = "Android" ; then
12206 ANDROID_PACKAGE_NAME=
12207 AC_MSG_CHECKING([for Android package name])
12208 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12209 if test -n "$ENABLE_DEBUG"; then
12210 # Default to the package name that makes ndk-gdb happy.
12211 ANDROID_PACKAGE_NAME="org.libreoffice"
12213 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12216 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12218 ANDROID_PACKAGE_NAME="$with_android_package_name"
12219 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12221 AC_SUBST(ANDROID_PACKAGE_NAME)
12224 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12225 if test "$with_compat_oowrappers" = "yes"; then
12226 WITH_COMPAT_OOWRAPPERS=TRUE
12229 WITH_COMPAT_OOWRAPPERS=
12232 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12234 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12235 AC_MSG_CHECKING([for install dirname])
12236 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12237 INSTALLDIRNAME="$with_install_dirname"
12239 AC_MSG_RESULT([$INSTALLDIRNAME])
12240 AC_SUBST(INSTALLDIRNAME)
12242 AC_MSG_CHECKING([for prefix])
12243 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12244 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12245 PREFIXDIR="$prefix"
12246 AC_MSG_RESULT([$PREFIXDIR])
12247 AC_SUBST(PREFIXDIR)
12249 LIBDIR=[$(eval echo $(eval echo $libdir))]
12252 DATADIR=[$(eval echo $(eval echo $datadir))]
12255 MANDIR=[$(eval echo $(eval echo $mandir))]
12258 DOCDIR=[$(eval echo $(eval echo $docdir))]
12261 BINDIR=[$(eval echo $(eval echo $bindir))]
12264 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12265 AC_SUBST(INSTALLDIR)
12267 TESTINSTALLDIR="${BUILDDIR}/test-install"
12268 AC_SUBST(TESTINSTALLDIR)
12271 # ===================================================================
12272 # OAuth2 id and secrets
12273 # ===================================================================
12275 AC_MSG_CHECKING([for Google Drive client id and secret])
12276 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12277 AC_MSG_RESULT([not set])
12278 GDRIVE_CLIENT_ID="\"\""
12279 GDRIVE_CLIENT_SECRET="\"\""
12281 AC_MSG_RESULT([set])
12282 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12283 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12285 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12286 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12288 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12289 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12290 AC_MSG_RESULT([not set])
12291 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12292 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12294 AC_MSG_RESULT([set])
12295 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12296 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12298 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12299 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12301 AC_MSG_CHECKING([for OneDrive client id and secret])
12302 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12303 AC_MSG_RESULT([not set])
12304 ONEDRIVE_CLIENT_ID="\"\""
12305 ONEDRIVE_CLIENT_SECRET="\"\""
12307 AC_MSG_RESULT([set])
12308 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12309 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12311 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12312 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12315 dnl ===================================================================
12316 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12317 dnl --enable-dependency-tracking configure option
12318 dnl ===================================================================
12319 AC_MSG_CHECKING([whether to enable dependency tracking])
12320 if test "$enable_dependency_tracking" = "no"; then
12322 AC_MSG_RESULT([no])
12324 AC_MSG_RESULT([yes])
12328 dnl ===================================================================
12329 dnl Number of CPUs to use during the build
12330 dnl ===================================================================
12331 AC_MSG_CHECKING([for number of processors to use])
12332 # plain --with-parallelism is just the default
12333 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12334 if test "$with_parallelism" = "no"; then
12337 PARALLELISM=$with_parallelism
12340 if test "$enable_icecream" = "yes"; then
12345 Darwin|FreeBSD|NetBSD|OpenBSD)
12346 PARALLELISM=`sysctl -n hw.ncpu`
12350 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12352 # what else than above does profit here *and* has /proc?
12354 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12358 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12359 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12363 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12364 if test -z "$with_parallelism"; then
12365 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12366 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12369 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."
12373 if test $PARALLELISM -eq 0; then
12374 AC_MSG_RESULT([explicit make -j option needed])
12376 AC_MSG_RESULT([$PARALLELISM])
12378 AC_SUBST(PARALLELISM)
12380 IWYU_PATH="$with_iwyu"
12381 AC_SUBST(IWYU_PATH)
12382 if test ! -z "$IWYU_PATH"; then
12383 if test ! -f "$IWYU_PATH"; then
12384 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12389 # Set up ILIB for MSVC build
12392 if test "$build_os" = "cygwin"; then
12394 if test -n "$JAVA_HOME"; then
12395 ILIB="$ILIB;$JAVA_HOME/lib"
12398 if test "$BITNESS_OVERRIDE" = 64; then
12399 ILIB="$ILIB;$COMPATH/lib/x64"
12400 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12401 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12402 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12403 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12404 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12405 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12407 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12408 ucrtlibpath_formatted=$formatted_path
12409 ILIB="$ILIB;$ucrtlibpath_formatted"
12410 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12412 ILIB="$ILIB;$COMPATH/lib/x86"
12413 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12414 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12415 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12416 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12417 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12418 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12420 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12421 ucrtlibpath_formatted=$formatted_path
12422 ILIB="$ILIB;$ucrtlibpath_formatted"
12423 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12425 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12426 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12428 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12434 dnl We should be able to drop the below check when bumping the GCC baseline to
12435 dnl 4.9, as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577>
12436 dnl "deque<T>::erase() still takes iterator instead of const_iterator" should be
12437 dnl fixed there with <https://gcc.gnu.org/git/?p=gcc.git;a=commit;
12438 dnl h=6b0e18ca48bb4b4c01e7b5be2b98849943fdcf91>:
12440 [whether C++11 use of const_iterator in standard containers is broken])
12441 save_CXXFLAGS=$CXXFLAGS
12442 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12443 AC_LANG_PUSH([C++])
12444 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12448 l.erase(l.cbegin());
12450 [broken=no], [broken=yes])
12452 CXXFLAGS=$save_CXXFLAGS
12453 AC_MSG_RESULT([$broken])
12454 if test "$broken" = yes; then
12455 AC_DEFINE([HAVE_BROKEN_CONST_ITERATORS])
12459 AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
12460 save_CXXFLAGS=$CXXFLAGS
12461 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12463 if test -n "$ILIB1"; then
12464 LIBS="$LIBS $ILIB1"
12466 AC_LANG_PUSH([C++])
12467 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
12468 // Exit with failure if the static initializer_list is stored on the
12469 // stack (as done by Clang < 3.4):
12470 #include <initializer_list>
12472 bool g(void const * p1, void const * p2) {
12474 return !((p1 > p2 && p2 > &n) || (p1 < p2 && p2 < &n));
12476 bool f(void const * p1) {
12477 static std::initializer_list<S> s { S() };
12478 return g(p1, s.begin());
12482 return f(&n) ? 0 : 1;
12483 ]])], [broken=no], [broken=yes],[broken='assuming not (cross-compiling)'])
12486 CXXFLAGS=$save_CXXFLAGS
12487 AC_MSG_RESULT([$broken])
12488 if test "$broken" = yes -a "$_os" != "iOS"; then
12489 AC_MSG_ERROR([working support for static initializer_list needed])
12493 # ===================================================================
12494 # Creating bigger shared library to link against
12495 # ===================================================================
12496 AC_MSG_CHECKING([whether to create huge library])
12499 if test $_os = iOS -o $_os = Android; then
12500 # Never any point in mergelibs for these as we build just static
12501 # libraries anyway...
12502 enable_mergelibs=no
12505 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12506 if test $_os != Linux -a $_os != WINNT; then
12507 add_warning "--enable-mergelibs is not tested for this platform"
12510 AC_MSG_RESULT([yes])
12512 AC_MSG_RESULT([no])
12514 AC_SUBST([MERGELIBS])
12516 dnl ===================================================================
12517 dnl icerun is a wrapper that stops us spawning tens of processes
12518 dnl locally - for tools that can't be executed on the compile cluster
12519 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12520 dnl ===================================================================
12521 AC_MSG_CHECKING([whether to use icerun wrapper])
12523 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12524 ICECREAM_RUN=icerun
12525 AC_MSG_RESULT([yes])
12527 AC_MSG_RESULT([no])
12529 AC_SUBST(ICECREAM_RUN)
12531 dnl ===================================================================
12532 dnl Setup the ICECC_VERSION for the build the same way it was set for
12533 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12534 dnl ===================================================================
12535 x_ICECC_VERSION=[\#]
12536 if test -n "$ICECC_VERSION" ; then
12539 AC_SUBST(x_ICECC_VERSION)
12540 AC_SUBST(ICECC_VERSION)
12542 dnl ===================================================================
12544 AC_MSG_CHECKING([MPL subset])
12547 if test "$enable_mpl_subset" = "yes"; then
12549 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12551 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12554 if test "$warn_report" = "true"; then
12555 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12557 if test "x$enable_postgresql_sdbc" != "xno"; then
12558 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12560 if test "$enable_lotuswordpro" = "yes"; then
12561 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12563 if test "$WITH_WEBDAV" = "neon"; then
12564 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12566 if test -n "$ENABLE_PDFIMPORT"; then
12567 if test "x$SYSTEM_POPPLER" = "x"; then
12568 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12571 # cf. m4/libo_check_extension.m4
12572 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12573 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12575 for theme in $WITH_THEMES; do
12577 breeze|breeze_dark|sifr|sifr_dark|elementary|karasa_jaga) #blacklist of icon themes under GPL or LGPL
12578 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12583 ENABLE_OPENGL_TRANSITIONS=
12585 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12586 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12590 AC_DEFINE(MPL_HAVE_SUBSET)
12591 AC_MSG_RESULT([only])
12593 AC_MSG_RESULT([no restrictions])
12595 AC_SUBST(MPL_SUBSET)
12597 dnl ===================================================================
12599 AC_MSG_CHECKING([formula logger])
12600 ENABLE_FORMULA_LOGGER=
12602 if test "x$enable_formula_logger" = "xyes"; then
12603 AC_MSG_RESULT([yes])
12604 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12605 ENABLE_FORMULA_LOGGER=TRUE
12606 elif test -n "$ENABLE_DBGUTIL" ; then
12607 AC_MSG_RESULT([yes])
12608 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12609 ENABLE_FORMULA_LOGGER=TRUE
12611 AC_MSG_RESULT([no])
12614 AC_SUBST(ENABLE_FORMULA_LOGGER)
12616 dnl ===================================================================
12617 dnl Setting up the environment.
12618 dnl ===================================================================
12619 AC_MSG_NOTICE([setting up the build environment variables...])
12623 if test "$build_os" = "cygwin"; then
12624 if test -d "$COMPATH/atlmfc/lib"; then
12625 ATL_LIB="$COMPATH/atlmfc/lib"
12626 ATL_INCLUDE="$COMPATH/atlmfc/include"
12628 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12629 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12631 if test "$BITNESS_OVERRIDE" = 64; then
12632 if test $VCVER = "150"; then
12633 ATL_LIB="$ATL_LIB/x64"
12635 ATL_LIB="$ATL_LIB/amd64"
12638 if test $VCVER = "150"; then
12639 ATL_LIB="$ATL_LIB/x86"
12642 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12643 PathFormat "/usr/bin/find.exe"
12644 FIND="$formatted_path"
12645 PathFormat "/usr/bin/sort.exe"
12646 SORT="$formatted_path"
12647 PathFormat "/usr/bin/grep.exe"
12648 WIN_GREP="$formatted_path"
12649 PathFormat "/usr/bin/ls.exe"
12650 WIN_LS="$formatted_path"
12651 PathFormat "/usr/bin/touch.exe"
12652 WIN_TOUCH="$formatted_path"
12658 AC_SUBST(ATL_INCLUDE)
12664 AC_SUBST(WIN_TOUCH)
12666 AC_SUBST(BUILD_TYPE)
12671 PERL="$formatted_path"
12674 if test -n "$TMPDIR"; then
12675 TEMP_DIRECTORY="$TMPDIR"
12677 TEMP_DIRECTORY="/tmp"
12679 if test "$build_os" = "cygwin"; then
12680 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12682 AC_SUBST(TEMP_DIRECTORY)
12684 # setup the PATH for the environment
12685 if test -n "$LO_PATH_FOR_BUILD"; then
12686 LO_PATH="$LO_PATH_FOR_BUILD"
12692 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12693 if test "$ENABLE_JAVA" != ""; then
12694 pathmunge "$JAVA_HOME/bin" "after"
12699 # Win32 make needs native paths
12700 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12701 LO_PATH=`cygpath -p -m "$PATH"`
12703 if test "$BITNESS_OVERRIDE" = 64; then
12704 # needed for msi packaging
12705 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12707 # .NET 4.6 and higher don't have bin directory
12708 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
12709 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12711 pathmunge "$ASM_HOME" "before"
12712 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12713 pathmunge "$CSC_PATH" "before"
12714 pathmunge "$MIDL_PATH" "before"
12715 pathmunge "$AL_PATH" "before"
12716 pathmunge "$MSPDB_PATH" "before"
12717 if test -n "$MSBUILD_PATH" ; then
12718 pathmunge "$MSBUILD_PATH" "before"
12720 if test "$BITNESS_OVERRIDE" = 64; then
12721 pathmunge "$COMPATH/bin/amd64" "before"
12722 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
12724 pathmunge "$COMPATH/bin" "before"
12725 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12727 if test "$ENABLE_JAVA" != ""; then
12728 if test -d "$JAVA_HOME/jre/bin/client"; then
12729 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12731 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12732 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12734 pathmunge "$JAVA_HOME/bin" "before"
12739 pathmunge "/usr/css/bin" "before"
12740 if test "$ENABLE_JAVA" != ""; then
12741 pathmunge "$JAVA_HOME/bin" "after"
12751 # Generate a configuration sha256 we can use for deps
12752 if test -f config_host.mk; then
12753 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
12755 if test -f config_host_lang.mk; then
12756 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
12759 CFLAGS=$my_original_CFLAGS
12760 CXXFLAGS=$my_original_CXXFLAGS
12761 CPPFLAGS=$my_original_CPPFLAGS
12763 AC_CONFIG_FILES([config_host.mk
12764 config_host_lang.mk
12767 bin/bffvalidator.sh
12768 bin/odfvalidator.sh
12770 instsetoo_native/util/openoffice.lst
12771 sysui/desktop/macosx/Info.plist])
12772 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12773 AC_CONFIG_HEADERS([config_host/config_clang.h])
12774 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12775 AC_CONFIG_HEADERS([config_host/config_eot.h])
12776 AC_CONFIG_HEADERS([config_host/config_extensions.h])
12777 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12778 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
12779 AC_CONFIG_HEADERS([config_host/config_dbus.h])
12780 AC_CONFIG_HEADERS([config_host/config_features.h])
12781 AC_CONFIG_HEADERS([config_host/config_firebird.h])
12782 AC_CONFIG_HEADERS([config_host/config_folders.h])
12783 AC_CONFIG_HEADERS([config_host/config_gio.h])
12784 AC_CONFIG_HEADERS([config_host/config_global.h])
12785 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
12786 AC_CONFIG_HEADERS([config_host/config_java.h])
12787 AC_CONFIG_HEADERS([config_host/config_langs.h])
12788 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12789 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
12790 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
12791 AC_CONFIG_HEADERS([config_host/config_libnumbertext.h])
12792 AC_CONFIG_HEADERS([config_host/config_locales.h])
12793 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12794 AC_CONFIG_HEADERS([config_host/config_kde4.h])
12795 AC_CONFIG_HEADERS([config_host/config_qt5.h])
12796 AC_CONFIG_HEADERS([config_host/config_kde5.h])
12797 AC_CONFIG_HEADERS([config_host/config_gtk3_kde5.h])
12798 AC_CONFIG_HEADERS([config_host/config_oox.h])
12799 AC_CONFIG_HEADERS([config_host/config_options.h])
12800 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
12801 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12802 AC_CONFIG_HEADERS([config_host/config_vendor.h])
12803 AC_CONFIG_HEADERS([config_host/config_vcl.h])
12804 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12805 AC_CONFIG_HEADERS([config_host/config_version.h])
12806 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12807 AC_CONFIG_HEADERS([config_host/config_poppler.h])
12808 AC_CONFIG_HEADERS([config_host/config_python.h])
12809 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
12812 if test "$CROSS_COMPILING" = TRUE; then
12813 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12816 # touch the config timestamp file
12817 if test ! -f config_host.mk.stamp; then
12818 echo > config_host.mk.stamp
12819 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
12820 echo "Host Configuration unchanged - avoiding scp2 stamp update"
12822 echo > config_host.mk.stamp
12825 # touch the config lang timestamp file
12826 if test ! -f config_host_lang.mk.stamp; then
12827 echo > config_host_lang.mk.stamp
12828 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
12829 echo "Language Configuration unchanged - avoiding scp2 stamp update"
12831 echo > config_host_lang.mk.stamp
12835 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12838 ****************************************************************************
12840 Your make version is known to be horribly slow, and hard to debug
12841 problems with. To get a reasonably functional make please do:
12843 to install a pre-compiled binary make for Win32
12845 mkdir -p /opt/lo/bin
12847 wget https://dev-www.libreoffice.org/bin/cygwin/make-85047eb-msvc.exe
12848 cp make-85047eb-msvc.exe make
12851 to install from source:
12852 place yourself in a working directory of you choice.
12854 git clone git://git.savannah.gnu.org/make.git
12856 [go to Start menu, open "Visual Studio 2017", click "VS2017 x86 Native Tools Command Prompt" or "VS2017 x64 Native Tools Command Prompt"]
12857 set PATH=%PATH%;C:\Cygwin\bin
12858 [or Cygwin64, if that is what you have]
12859 cd path-to-make-repo-you-cloned-above
12860 build_w32.bat --without-guile
12862 should result in a WinRel/gnumake.exe.
12863 Copy it to the Cygwin /opt/lo/bin directory as make.exe
12865 Then re-run autogen.sh
12867 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12868 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12874 ****************************************************************************
12879 To view some help, run:
12884 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
12886 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
12889 if test $_os = Darwin; then
12890 echo open instdir/$PRODUCTNAME.app
12892 echo instdir/program/soffice
12896 If you want to run the smoketest, run:
12902 if test -f warn; then
12907 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: