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.1.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".])
89 # There appears to be no simple and portable method to get an absolute and
90 # canonical path, so we try creating the directory if does not exist and
91 # utilizing the shell and pwd.
94 test ! -e "$rel" && mkdir -p "$rel"
95 if test -d "$rel" ; then
96 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
97 absolute_path="$(pwd)"
100 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
108 if test "$have_WARNINGS" = "no"; then
109 echo "*************************************" > warn
111 if which tput >/dev/null 2>/dev/null && test `tput colors` -ge 8; then
112 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
113 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
115 COLORWARN="* WARNING :"
118 echo "$COLORWARN $@" >> warn
121 dnl Some Mac User have the bad habbit of letting a lot fo crap
122 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
123 dnl that confuse the build.
124 dnl For the ones that use LODE, let's be nice and protect them
129 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
130 dnl a common but nevertheless necessary thing that may be in a fancy
131 dnl path location is git, so make sure we have it
132 mac_git_path=`which git 2>/dev/null`
133 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
134 mac_path="$mac_path:`dirname $mac_git_path`"
136 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
137 dnl path location is gpg, so make sure we find it
138 mac_gpg_path=`which gpg 2>/dev/null`
139 if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
140 mac_path="$mac_path:`dirname $mac_gpg_path`"
148 echo "********************************************************************"
150 echo "* Running ${PACKAGE_NAME} build configuration."
152 echo "********************************************************************"
155 dnl ===================================================================
156 dnl checks build and host OSes
157 dnl do this before argument processing to allow for platform dependent defaults
158 dnl ===================================================================
161 AC_MSG_CHECKING([for product name])
162 PRODUCTNAME="AC_PACKAGE_NAME"
163 if test -n "$with_product_name" -a "$with_product_name" != no; then
164 PRODUCTNAME="$with_product_name"
166 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
167 PRODUCTNAME="${PRODUCTNAME}Dev"
169 AC_MSG_RESULT([$PRODUCTNAME])
170 AC_SUBST(PRODUCTNAME)
171 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
172 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
174 dnl ===================================================================
175 dnl Our version is defined by the AC_INIT() at the top of this script.
176 dnl ===================================================================
178 AC_MSG_CHECKING([for package version])
179 if test -n "$with_package_version" -a "$with_package_version" != no; then
180 PACKAGE_VERSION="$with_package_version"
182 AC_MSG_RESULT([$PACKAGE_VERSION])
184 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
186 LIBO_VERSION_MAJOR=$1
187 LIBO_VERSION_MINOR=$2
188 LIBO_VERSION_MICRO=$3
189 LIBO_VERSION_PATCH=$4
191 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
192 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
193 # no way to encode that into an integer in general.
194 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
196 LIBO_VERSION_SUFFIX=$5
197 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
198 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
199 # they get undoubled before actually passed to sed.
200 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
201 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
202 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
203 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
205 AC_SUBST(LIBO_VERSION_MAJOR)
206 AC_SUBST(LIBO_VERSION_MINOR)
207 AC_SUBST(LIBO_VERSION_MICRO)
208 AC_SUBST(LIBO_VERSION_PATCH)
209 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
210 AC_SUBST(LIBO_VERSION_SUFFIX)
211 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
213 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
214 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
215 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
216 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
218 LIBO_THIS_YEAR=`date +%Y`
219 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
221 dnl ===================================================================
223 dnl ===================================================================
224 AC_MSG_CHECKING([for product version])
225 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
226 AC_MSG_RESULT([$PRODUCTVERSION])
227 AC_SUBST(PRODUCTVERSION)
230 # AC_PROG_EGREP doesn't set GREP on all systems as well
231 AC_PATH_PROG(GREP, grep)
239 dnl ======================================
240 dnl Required GObject introspection version
241 dnl ======================================
242 INTROSPECTION_REQUIRED_VERSION=1.32.0
244 dnl ===================================================================
245 dnl Search all the common names for GNU Make
246 dnl ===================================================================
247 AC_MSG_CHECKING([for GNU Make])
249 # try to use our own make if it is available and GNUMAKE was not already defined
250 if test -z "$GNUMAKE"; then
251 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
252 GNUMAKE="$LODE_HOME/opt/bin/make"
253 elif test -x "/opt/lo/bin/make"; then
254 GNUMAKE="/opt/lo/bin/make"
259 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
260 if test -n "$a"; then
261 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
262 if test $? -eq 0; then
263 if test "$build_os" = "cygwin"; then
264 if test -n "$($a -v | grep 'Built for Windows')" ; then
265 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
266 GNUMAKE_WIN_NATIVE="TRUE"
277 AC_MSG_RESULT($GNUMAKE)
278 if test -z "$GNUMAKE"; then
279 AC_MSG_ERROR([not found. install GNU Make.])
281 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
282 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
286 win_short_path_for_make()
288 local_short_path="$1"
289 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
290 cygpath -sm "$local_short_path"
292 cygpath -u "$(cygpath -d "$local_short_path")"
297 if test "$build_os" = "cygwin"; then
298 PathFormat "$SRC_ROOT"
299 SRC_ROOT="$formatted_path"
300 PathFormat "$BUILDDIR"
301 BUILDDIR="$formatted_path"
303 AC_MSG_CHECKING(for explicit COMSPEC)
304 if test -z "$COMSPEC"; then
305 AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
307 AC_MSG_RESULT([found: $COMSPEC])
314 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
315 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
317 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
318 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
321 # need sed in os checks...
322 AC_PATH_PROGS(SED, sed)
323 if test -z "$SED"; then
324 AC_MSG_ERROR([install sed to run this script])
327 # Set the ENABLE_LTO variable
328 # ===================================================================
329 AC_MSG_CHECKING([whether to use link-time optimization])
330 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
333 AC_DEFINE(STATIC_LINKING)
340 AC_ARG_ENABLE(fuzz-options,
341 AS_HELP_STRING([--enable-fuzz-options],
342 [Randomly enable or disable each of those configurable options
343 that are supposed to be freely selectable without interdependencies,
344 or where bad interaction from interdependencies is automatically avoided.])
347 dnl ===================================================================
348 dnl When building for Android, --with-android-ndk,
349 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
351 dnl ===================================================================
353 AC_ARG_WITH(android-ndk,
354 AS_HELP_STRING([--with-android-ndk],
355 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
358 AC_ARG_WITH(android-ndk-toolchain-version,
359 AS_HELP_STRING([--with-android-ndk-toolchain-version],
360 [Specify which toolchain version to use, of those present in the
361 Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
362 with_android_ndk_toolchain_version=clang5.0)
364 AC_ARG_WITH(android-sdk,
365 AS_HELP_STRING([--with-android-sdk],
366 [Specify location of the Android SDK. Mandatory when building for Android.]),
370 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
371 with_android_ndk="$SRC_ROOT/external/android-ndk"
373 if test -n "$with_android_ndk"; then
374 ANDROID_NDK_HOME=$with_android_ndk
376 # Set up a lot of pre-canned defaults
378 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
379 if test ! -f $ANDROID_NDK_HOME/source.properties; then
380 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
382 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
384 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
386 if test -z "$ANDROID_NDK_VERSION"; then
387 AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
389 case $ANDROID_NDK_VERSION in
391 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
393 11.1.*|12.1.*|13.1.*|14.1.*)
394 AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
399 AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk.])
400 add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk."
405 android_cpu=$host_cpu
406 ANDROID_ARCH=$android_cpu
407 if test $host_cpu = arm; then
408 android_platform_prefix=$android_cpu-linux-androideabi
409 android_gnu_prefix=$android_platform_prefix
410 LLVM_TRIPLE=armv7-none-linux-androideabi
411 ANDROID_APP_ABI=armeabi-v7a
412 ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
413 elif test $host_cpu = aarch64; then
414 android_platform_prefix=$android_cpu-linux-android
415 android_gnu_prefix=$android_platform_prefix
416 LLVM_TRIPLE=aarch64-none-linux-android
417 # minimum android version that supports aarch64
419 ANDROID_APP_ABI=arm64-v8a
421 elif test $host_cpu = mips; then
422 android_platform_prefix=mipsel-linux-android
423 android_gnu_prefix=$android_platform_prefix
424 LLVM_TRIPLE=mipsel-none-linux-android
427 # host_cpu is something like "i386" or "i686" I guess, NDK uses
428 # "x86" in some contexts
430 android_platform_prefix=$android_cpu
431 android_gnu_prefix=i686-linux-android
432 LLVM_TRIPLE=i686-none-linux-android
434 ANDROID_ARCH=$android_cpu
435 ANDROIDCFLAGS="-march=atom"
438 case "$with_android_ndk_toolchain_version" in
440 ANDROID_GCC_TOOLCHAIN_VERSION=4.9
441 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION
442 ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm
445 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
448 if test ! -d $ANDROID_BINUTILS_DIR; then
449 AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
450 elif test ! -d $ANDROID_COMPILER_DIR; then
451 AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
454 # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
455 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
456 # manage to link the (app-specific) single huge .so that is built for the app in
457 # android/source/ if there is debug information in a significant part of the object files.
458 # (A 64-bit ld.gold grows to much over 10 gigabytes of virtual space when linking such a .so if
459 # all objects have been built with debug information.)
468 AC_MSG_ERROR([We only support building for Android from Linux or OS X])
471 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64/bin
472 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64
473 AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
475 test -z "$SYSBASE" && SYSBASE=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}
476 test -z "$AR" && AR=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ar
477 test -z "$NM" && NM=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-nm
478 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-objdump
479 test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ranlib
480 test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-strip
482 ANDROIDCFLAGS="$ANDROIDCFLAGS -gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT -target $LLVM_TRIPLE$ANDROID_API_LEVEL -no-canonical-prefixes"
483 # android is using different sysroots for compilation and linking, but as
484 # there is no full separation in configure and elsewhere, use isystem for
485 # compilation stuff and sysroot for linking
486 ANDROIDCFLAGS="$ANDROIDCFLAGS -D__ANDROID_API__=$ANDROID_API_LEVEL -isystem $ANDROID_NDK_HOME/sysroot/usr/include"
487 ANDROIDCFLAGS="$ANDROIDCFLAGS -isystem $ANDROID_NDK_HOME/sysroot/usr/include/$android_gnu_prefix"
488 ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$SYSBASE -ffunction-sections -fdata-sections -Qunused-arguments"
489 if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
490 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI -D_GTHREAD_USE_MUTEX_INIT_FUNC=1"
492 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/$ANDROID_APP_ABI"
494 if test "$ENABLE_LTO" = TRUE; then
495 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
496 # $CC and $CXX when building external libraries
497 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
500 if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
501 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"
503 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"
506 if test -z "$CC"; then
507 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
509 if test -z "$CXX"; then
510 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
513 # remember to download the ownCloud Android library later
514 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
516 AC_SUBST(ANDROID_NDK_HOME)
517 AC_SUBST(ANDROID_APP_ABI)
518 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
520 dnl ===================================================================
521 dnl --with-android-sdk
522 dnl ===================================================================
524 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
525 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
527 if test -n "$with_android_sdk"; then
528 ANDROID_SDK_HOME=$with_android_sdk
529 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
531 AC_SUBST(ANDROID_SDK_HOME)
533 dnl ===================================================================
534 dnl The following is a list of supported systems.
535 dnl Sequential to keep the logic very simple
536 dnl These values may be checked and reset later.
537 dnl ===================================================================
538 #defaults unless the os test overrides this:
546 # Default values, as such probably valid just for Linux, set
547 # differently below just for Mac OSX,but at least better than
548 # hardcoding these as we used to do. Much of this is duplicated also
549 # in solenv for old build system and for gbuild, ideally we should
550 # perhaps define stuff like this only here in configure.ac?
552 LINKFLAGSSHL="-shared"
556 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
559 INSTROOTCONTENTSUFFIX=
566 build_gstreamer_1_0=yes
567 build_gstreamer_0_10=yes
571 dnl ===========================================================
572 dnl Check whether we're using Solaris 10 - SPARC or Intel.
573 dnl ===========================================================
574 AC_MSG_CHECKING([the Solaris operating system release])
575 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
576 if test "$_os_release" -lt "10"; then
577 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
579 AC_MSG_RESULT([ok ($_os_release)])
582 dnl Check whether we're using a SPARC or i386 processor
583 AC_MSG_CHECKING([the processor type])
584 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
585 AC_MSG_RESULT([ok ($host_cpu)])
587 AC_MSG_ERROR([only SPARC and i386 processors are supported])
591 linux-gnu*|k*bsd*-gnu*)
593 build_gstreamer_1_0=yes
594 build_gstreamer_0_10=yes
599 if test "$enable_fuzzers" != yes; then
605 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
618 # When building on Windows normally with MSVC under Cygwin,
619 # configure thinks that the host platform (the platform the
620 # built code will run on) is Cygwin, even if it obviously is
621 # Windows, which in Autoconf terminology is called
622 # "mingw32". (Which is misleading as MinGW is the name of the
623 # tool-chain, not an operating system.)
625 # Somewhat confusing, yes. But this configure script doesn't
626 # look at $host etc that much, it mostly uses its own $_os
627 # variable, set here in this case statement.
641 darwin*) # Mac OS X or iOS
648 if test -n "$LODE_HOME" ; then
650 AC_MSG_NOTICE([sanitized the PATH to $PATH])
652 if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
657 enable_mpl_subset=yes
658 enable_lotuswordpro=no
661 enable_postgresql_sdbc=no
662 enable_extension_integration=no
663 enable_report_builder=no
666 if test "$enable_ios_simulator" = "yes"; then
667 host=x86_64-apple-darwin
671 INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
672 INSTROOTCONTENTSUFFIX=/Contents
673 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
676 # See comment above the case "$host_os"
677 LINKFLAGSSHL="-dynamiclib -single_module"
684 # -undefined error is the default
690 build_gstreamer_1_0=yes
691 build_gstreamer_0_10=yes
697 AC_MSG_CHECKING([the FreeBSD operating system release])
698 if test -n "$with_os_version"; then
699 OSVERSION="$with_os_version"
701 OSVERSION=`/sbin/sysctl -n kern.osreldate`
703 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
704 AC_MSG_CHECKING([which thread library to use])
705 if test "$OSVERSION" -lt "500016"; then
706 PTHREAD_CFLAGS="-D_THREAD_SAFE"
707 PTHREAD_LIBS="-pthread"
708 elif test "$OSVERSION" -lt "502102"; then
709 PTHREAD_CFLAGS="-D_THREAD_SAFE"
713 PTHREAD_LIBS="-pthread"
715 AC_MSG_RESULT([$PTHREAD_LIBS])
721 build_gstreamer_1_0=yes
722 build_gstreamer_0_10=yes
728 PTHREAD_LIBS="-pthread -lpthread"
735 PTHREAD_LIBS=-pthread
742 PTHREAD_CFLAGS="-D_THREAD_SAFE"
743 PTHREAD_LIBS="-pthread"
749 build_gstreamer_1_0=yes
750 build_gstreamer_0_10=yes
756 PTHREAD_LIBS="-pthread"
761 build_gstreamer_1_0=no
762 build_gstreamer_0_10=no
763 enable_lotuswordpro=no
764 enable_mpl_subset=yes
767 enable_report_builder=no
769 enable_postgresql_sdbc=no
785 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
786 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
806 enable_postgresql_sdbc=no
807 enable_firebird_sdbc=no
812 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
816 if test "$_os" = "Android" ; then
817 # Verify that the NDK and SDK options are proper
818 if test -z "$with_android_ndk"; then
819 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
820 elif test ! -f "$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}/usr/lib/libc.a"; then
821 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
824 if test -z "$ANDROID_SDK_HOME"; then
825 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
826 elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
827 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
830 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
831 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
832 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
833 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
834 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
835 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
836 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
837 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
839 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
840 AC_MSG_WARN([android support repository not found - install with
841 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
842 to allow the build to download the specified version of the android support libraries])
843 add_warning "android support repository not found - install with"
844 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
845 add_warning "to allow the build to download the specified version of the android support libraries"
849 if test "$_os" = "AIX"; then
850 AC_PATH_PROG(GAWK, gawk)
851 if test -z "$GAWK"; then
852 AC_MSG_ERROR([gawk not found in \$PATH])
858 AC_SUBST(PTHREAD_CFLAGS)
859 AC_SUBST(PTHREAD_LIBS)
861 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
862 # By default use the ones specified by our build system,
863 # but explicit override is possible.
864 AC_MSG_CHECKING(for explicit AFLAGS)
865 if test -n "$AFLAGS"; then
866 AC_MSG_RESULT([$AFLAGS])
872 AC_MSG_CHECKING(for explicit CFLAGS)
873 if test -n "$CFLAGS"; then
874 AC_MSG_RESULT([$CFLAGS])
880 AC_MSG_CHECKING(for explicit CXXFLAGS)
881 if test -n "$CXXFLAGS"; then
882 AC_MSG_RESULT([$CXXFLAGS])
888 AC_MSG_CHECKING(for explicit OBJCFLAGS)
889 if test -n "$OBJCFLAGS"; then
890 AC_MSG_RESULT([$OBJCFLAGS])
896 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
897 if test -n "$OBJCXXFLAGS"; then
898 AC_MSG_RESULT([$OBJCXXFLAGS])
904 AC_MSG_CHECKING(for explicit LDFLAGS)
905 if test -n "$LDFLAGS"; then
906 AC_MSG_RESULT([$LDFLAGS])
916 AC_SUBST(OBJCXXFLAGS)
921 AC_SUBST(x_OBJCFLAGS)
922 AC_SUBST(x_OBJCXXFLAGS)
925 dnl These are potentially set for MSVC, in the code checking for UCRT below:
926 my_original_CFLAGS=$CFLAGS
927 my_original_CXXFLAGS=$CXXFLAGS
928 my_original_CPPFLAGS=$CPPFLAGS
930 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
931 dnl Needs to precede the AC_SEARCH_LIBS call below, which apparently calls
932 dnl AC_PROG_CC internally.
933 if test "$_os" != "WINNT"; then
934 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
940 if test $_os != "WINNT"; then
942 AC_SEARCH_LIBS([dlsym], [dl],
943 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
944 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
947 AC_SUBST(DLOPEN_LIBS)
949 ###############################################################################
950 # Extensions switches --enable/--disable
951 ###############################################################################
952 # By default these should be enabled unless having extra dependencies.
953 # If there is extra dependency over configure options then the enable should
954 # be automagic based on whether the requiring feature is enabled or not.
955 # All this options change anything only with --enable-extension-integration.
957 # The name of this option and its help string makes it sound as if
958 # extensions are built anyway, just not integrated in the installer,
959 # if you use --disable-extension-integration. Is that really the
962 AC_ARG_ENABLE(ios-simulator,
963 AS_HELP_STRING([--enable-ios-simulator],
964 [build i386 or x86_64 for ios simulator])
967 libo_FUZZ_ARG_ENABLE(extension-integration,
968 AS_HELP_STRING([--disable-extension-integration],
969 [Disable integration of the built extensions in the installer of the
970 product. Use this switch to disable the integration.])
973 AC_ARG_ENABLE(avmedia,
974 AS_HELP_STRING([--disable-avmedia],
975 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
978 AC_ARG_ENABLE(database-connectivity,
979 AS_HELP_STRING([--disable-database-connectivity],
980 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
983 # This doesn't mean not building (or "integrating") extensions
984 # (although it probably should; i.e. it should imply
985 # --disable-extension-integration I guess), it means not supporting
986 # any extension mechanism at all
987 libo_FUZZ_ARG_ENABLE(extensions,
988 AS_HELP_STRING([--disable-extensions],
989 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
992 AC_ARG_ENABLE(scripting,
993 AS_HELP_STRING([--disable-scripting],
994 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
997 # This is mainly for Android and iOS, but could potentially be used in some
998 # special case otherwise, too, so factored out as a separate setting
1000 AC_ARG_ENABLE(dynamic-loading,
1001 AS_HELP_STRING([--disable-dynamic-loading],
1002 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1005 libo_FUZZ_ARG_ENABLE(ext-mariadb-connector,
1006 AS_HELP_STRING([--enable-ext-mariadb-connector],
1007 [Enable the build of the MariaDB/MySQL Connector extension.])
1010 libo_FUZZ_ARG_ENABLE(report-builder,
1011 AS_HELP_STRING([--disable-report-builder],
1012 [Disable the Report Builder.])
1015 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
1016 AS_HELP_STRING([--enable-ext-wiki-publisher],
1017 [Enable the Wiki Publisher extension.])
1020 libo_FUZZ_ARG_ENABLE(lpsolve,
1021 AS_HELP_STRING([--disable-lpsolve],
1022 [Disable compilation of the lp solve solver ])
1024 libo_FUZZ_ARG_ENABLE(coinmp,
1025 AS_HELP_STRING([--disable-coinmp],
1026 [Disable compilation of the CoinMP solver ])
1029 libo_FUZZ_ARG_ENABLE(pdfimport,
1030 AS_HELP_STRING([--disable-pdfimport],
1031 [Disable building the PDF import feature.])
1034 libo_FUZZ_ARG_ENABLE(pdfium,
1035 AS_HELP_STRING([--disable-pdfium],
1036 [Disable building PDFium.])
1039 ###############################################################################
1041 dnl ---------- *** ----------
1043 libo_FUZZ_ARG_ENABLE(mergelibs,
1044 AS_HELP_STRING([--enable-mergelibs],
1045 [Merge several of the smaller libraries into one big, "merged", one.])
1048 libo_FUZZ_ARG_ENABLE(breakpad,
1049 AS_HELP_STRING([--enable-breakpad],
1050 [Enables breakpad for crash reporting.])
1053 AC_ARG_ENABLE(fetch-external,
1054 AS_HELP_STRING([--disable-fetch-external],
1055 [Disables fetching external tarballs from web sources.])
1058 AC_ARG_ENABLE(fuzzers,
1059 AS_HELP_STRING([--enable-fuzzers],
1060 [Enables building libfuzzer targets for fuzz testing.])
1063 libo_FUZZ_ARG_ENABLE(pch,
1064 AS_HELP_STRING([--enable-pch],
1065 [Enables precompiled header support for C++. Forced default on Windows/VC build])
1068 libo_FUZZ_ARG_ENABLE(epm,
1069 AS_HELP_STRING([--enable-epm],
1070 [LibreOffice includes self-packaging code, that requires epm, however epm is
1071 useless for large scale package building.])
1074 libo_FUZZ_ARG_ENABLE(odk,
1075 AS_HELP_STRING([--disable-odk],
1076 [LibreOffice includes an ODK, office development kit which some packagers may
1077 wish to build without.])
1080 AC_ARG_ENABLE(mpl-subset,
1081 AS_HELP_STRING([--enable-mpl-subset],
1082 [Don't compile any pieces which are not MPL or more liberally licensed])
1085 libo_FUZZ_ARG_ENABLE(evolution2,
1086 AS_HELP_STRING([--enable-evolution2],
1087 [Allows the built-in evolution 2 addressbook connectivity build to be
1091 AC_ARG_ENABLE(avahi,
1092 AS_HELP_STRING([--enable-avahi],
1093 [Determines whether to use Avahi to advertise Impress to remote controls.])
1096 libo_FUZZ_ARG_ENABLE(werror,
1097 AS_HELP_STRING([--enable-werror],
1098 [Turn warnings to errors. (Has no effect in modules where the treating
1099 of warnings as errors is disabled explicitly.)]),
1102 libo_FUZZ_ARG_ENABLE(assert-always-abort,
1103 AS_HELP_STRING([--enable-assert-always-abort],
1104 [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
1107 libo_FUZZ_ARG_ENABLE(dbgutil,
1108 AS_HELP_STRING([--enable-dbgutil],
1109 [Provide debugging support from --enable-debug and include additional debugging
1110 utilities such as object counting or more expensive checks.
1111 This is the recommended option for developers.
1112 Note that this makes the build ABI incompatible, it is not possible to mix object
1113 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1115 libo_FUZZ_ARG_ENABLE(debug,
1116 AS_HELP_STRING([--enable-debug],
1117 [Include debugging information, disable compiler optimization and inlining plus
1118 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1120 libo_FUZZ_ARG_ENABLE(sal-log,
1121 AS_HELP_STRING([--enable-sal-log],
1122 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1124 AC_ARG_ENABLE(selective-debuginfo,
1125 AS_HELP_STRING([--enable-selective-debuginfo],
1126 [If --enable-debug or --enable-dbgutil is used, build debugging information
1127 (-g compiler flag) only for the specified gbuild build targets
1128 (where all means everything, - prepended means not to enable, / appended means
1129 everything in the directory; there is no ordering, more specific overrides
1130 more general, and disabling takes precedence).
1131 Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
1133 libo_FUZZ_ARG_ENABLE(symbols,
1134 AS_HELP_STRING([--enable-symbols],
1135 [Generate debug information.
1136 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1139 libo_FUZZ_ARG_ENABLE(optimized,
1140 AS_HELP_STRING([--disable-optimized],
1141 [Whether to compile with optimization flags.
1142 By default, disabled for --enable-debug and --enable-dbgutil, enabled
1145 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
1146 AS_HELP_STRING([--disable-runtime-optimizations],
1147 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1148 JVM JIT) that are known to interact badly with certain dynamic analysis
1149 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1150 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1151 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1153 AC_ARG_WITH(valgrind,
1154 AS_HELP_STRING([--with-valgrind],
1155 [Make availability of Valgrind headers a hard requirement.]))
1157 libo_FUZZ_ARG_ENABLE(compiler-plugins,
1158 AS_HELP_STRING([--enable-compiler-plugins],
1159 [Enable compiler plugins that will perform additional checks during
1160 building. Enabled automatically by --enable-dbgutil.
1161 Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
1162 COMPILER_PLUGINS_DEBUG=
1163 if test "$enable_compiler_plugins" = debug; then
1164 enable_compiler_plugins=yes
1165 COMPILER_PLUGINS_DEBUG=TRUE
1168 libo_FUZZ_ARG_ENABLE(ooenv,
1169 AS_HELP_STRING([--disable-ooenv],
1170 [Disable ooenv for the instdir installation.]))
1173 AS_HELP_STRING([--enable-lto],
1174 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1175 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1176 linker. For MSVC, this option is broken at the moment. This is experimental work
1177 in progress that shouldn't be used unless you are working on it.)]))
1179 AC_ARG_ENABLE(python,
1180 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1181 [Enables or disables Python support at run-time.
1182 Also specifies what Python to use. 'auto' is the default.
1183 'fully-internal' even forces the internal version for uses of Python
1184 during the build.]))
1186 libo_FUZZ_ARG_ENABLE(gtk,
1187 AS_HELP_STRING([--disable-gtk],
1188 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
1189 ,test "${enable_gtk+set}" = set || enable_gtk=yes)
1191 libo_FUZZ_ARG_ENABLE(gtk3,
1192 AS_HELP_STRING([--disable-gtk3],
1193 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1194 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
1196 libo_FUZZ_ARG_ENABLE(systray,
1197 AS_HELP_STRING([--disable-systray],
1198 [Determines whether to build the systray quickstarter.]),
1199 ,test "${enable_systray+set}" = set || enable_systray=yes)
1201 AC_ARG_ENABLE(split-app-modules,
1202 AS_HELP_STRING([--enable-split-app-modules],
1203 [Split file lists for app modules, e.g. base, calc.
1204 Has effect only with make distro-pack-install]),
1207 AC_ARG_ENABLE(split-opt-features,
1208 AS_HELP_STRING([--enable-split-opt-features],
1209 [Split file lists for some optional features, e.g. pyuno, testtool.
1210 Has effect only with make distro-pack-install]),
1213 libo_FUZZ_ARG_ENABLE(cairo-canvas,
1214 AS_HELP_STRING([--disable-cairo-canvas],
1215 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1218 libo_FUZZ_ARG_ENABLE(dbus,
1219 AS_HELP_STRING([--disable-dbus],
1220 [Determines whether to enable features that depend on dbus.
1221 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1222 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
1224 libo_FUZZ_ARG_ENABLE(sdremote,
1225 AS_HELP_STRING([--disable-sdremote],
1226 [Determines whether to enable Impress remote control (i.e. the server component).]),
1227 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
1229 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
1230 AS_HELP_STRING([--disable-sdremote-bluetooth],
1231 [Determines whether to build sdremote with bluetooth support.
1232 Requires dbus on Linux.]))
1234 libo_FUZZ_ARG_ENABLE(gio,
1235 AS_HELP_STRING([--disable-gio],
1236 [Determines whether to use the GIO support.]),
1237 ,test "${enable_gio+set}" = set || enable_gio=yes)
1240 AS_HELP_STRING([--enable-kde4],
1241 [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
1242 KDE4 are available.]),
1246 AS_HELP_STRING([--enable-qt5],
1247 [Determines whether to use Qt5 vclplug on platforms where Qt5 is
1252 AS_HELP_STRING([--enable-kde5],
1253 [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
1254 KF5 are available.]),
1257 AC_ARG_ENABLE(gtk3_kde5,
1258 AS_HELP_STRING([--enable-gtk3-kde5],
1259 [Determines whether to use Gtk3 vclplug with KDE file dialogs on
1260 platforms where Gtk3, Qt5 and Plasma is available.]),
1263 libo_FUZZ_ARG_ENABLE(gui,
1264 AS_HELP_STRING([--disable-gui],
1265 [Disable use of X11 or Wayland to reduce dependencies. Not related to the --headless
1266 command-line option. Not related to LibreOffice Online functionality. Don't use
1267 unless you are certain you need to. Nobody will help you if you insist on trying
1268 this and run into problems.]),
1269 ,test "${enable_gui+set}" = set || enable_gui=yes)
1271 libo_FUZZ_ARG_ENABLE(randr,
1272 AS_HELP_STRING([--disable-randr],
1273 [Disable RandR support in the vcl project.]),
1274 ,test "${enable_randr+set}" = set || enable_randr=yes)
1276 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
1277 AS_HELP_STRING([--disable-gstreamer-1-0],
1278 [Disable building with the new gstreamer 1.0 avmedia backend.]),
1279 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
1281 AC_ARG_ENABLE(gstreamer-0-10,
1282 AS_HELP_STRING([--enable-gstreamer-0-10],
1283 [Enable building with the gstreamer 0.10 avmedia backend.]),
1284 ,enable_gstreamer_0_10=no)
1286 libo_FUZZ_ARG_ENABLE(vlc,
1287 AS_HELP_STRING([--enable-vlc],
1288 [Enable building with the (experimental) VLC avmedia backend.]),
1289 ,test "${enable_vlc+set}" = set || enable_vlc=no)
1291 libo_FUZZ_ARG_ENABLE(neon,
1292 AS_HELP_STRING([--disable-neon],
1293 [Disable neon and the compilation of webdav binding.]),
1296 libo_FUZZ_ARG_ENABLE([eot],
1297 [AS_HELP_STRING([--enable-eot],
1298 [Enable support for Embedded OpenType fonts.])],
1299 ,test "${enable_eot+set}" = set || enable_eot=no)
1301 libo_FUZZ_ARG_ENABLE(cve-tests,
1302 AS_HELP_STRING([--disable-cve-tests],
1303 [Prevent CVE tests to be executed]),
1306 libo_FUZZ_ARG_ENABLE(chart-tests,
1307 AS_HELP_STRING([--enable-chart-tests],
1308 [Executes chart XShape tests. In a perfect world these tests would be
1309 stable and everyone could run them, in reality it is best to run them
1310 only on a few machines that are known to work and maintained by people
1311 who can judge if a test failure is a regression or not.]),
1314 AC_ARG_ENABLE(build-unowinreg,
1315 AS_HELP_STRING([--enable-build-unowinreg],
1316 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1317 compiler is needed on Linux.]),
1320 AC_ARG_ENABLE(dependency-tracking,
1321 AS_HELP_STRING([--enable-dependency-tracking],
1322 [Do not reject slow dependency extractors.])[
1323 --disable-dependency-tracking
1324 Disables generation of dependency information.
1325 Speed up one-time builds.],
1328 AC_ARG_ENABLE(icecream,
1329 AS_HELP_STRING([--enable-icecream],
1330 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1331 It defaults to /opt/icecream for the location of the icecream gcc/g++
1332 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1335 libo_FUZZ_ARG_ENABLE(cups,
1336 AS_HELP_STRING([--disable-cups],
1337 [Do not build cups support.])
1340 AC_ARG_ENABLE(ccache,
1341 AS_HELP_STRING([--disable-ccache],
1342 [Do not try to use ccache automatically.
1343 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1344 CC/CXX are not yet set, and --enable-icecream is not given, we
1345 attempt to use ccache. --disable-ccache disables ccache completely.
1349 AC_ARG_ENABLE(64-bit,
1350 AS_HELP_STRING([--enable-64-bit],
1351 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1352 At the moment meaningful only for Windows.]), ,)
1354 libo_FUZZ_ARG_ENABLE(online-update,
1355 AS_HELP_STRING([--enable-online-update],
1356 [Enable the online update service that will check for new versions of
1357 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1358 If the value is "mar", the experimental Mozilla-like update will be
1359 enabled instead of the traditional update mechanism.]),
1362 AC_ARG_WITH(update-config,
1363 AS_HELP_STRING([--with-update-config=/tmp/update.ini],
1364 [Path to the update config ini file]))
1366 libo_FUZZ_ARG_ENABLE(extension-update,
1367 AS_HELP_STRING([--disable-extension-update],
1368 [Disable possibility to update installed extensions.]),
1371 libo_FUZZ_ARG_ENABLE(release-build,
1372 AS_HELP_STRING([--enable-release-build],
1373 [Enable release build. Note that the "release build" choice is orthogonal to
1374 whether symbols are present, debug info is generated, or optimization
1376 See http://wiki.documentfoundation.org/Development/DevBuild]),
1379 AC_ARG_ENABLE(windows-build-signing,
1380 AS_HELP_STRING([--enable-windows-build-signing],
1381 [Enable signing of windows binaries (*.exe, *.dll)]),
1384 AC_ARG_ENABLE(silent-msi,
1385 AS_HELP_STRING([--enable-silent-msi],
1386 [Enable MSI with LIMITUI=1 (silent install).]),
1389 AC_ARG_ENABLE(macosx-code-signing,
1390 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1391 [Sign executables, dylibs, frameworks and the app bundle. If you
1392 don't provide an identity the first suitable certificate
1393 in your keychain is used.]),
1396 AC_ARG_ENABLE(macosx-package-signing,
1397 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1398 [Create a .pkg suitable for uploading to the Mac App Store and sign
1399 it. If you don't provide an identity the first suitable certificate
1400 in your keychain is used.]),
1403 AC_ARG_ENABLE(macosx-sandbox,
1404 AS_HELP_STRING([--enable-macosx-sandbox],
1405 [Make the app bundle run in a sandbox. Requires code signing.
1406 Is required by apps distributed in the Mac App Store, and implies
1407 adherence to App Store rules.]),
1410 AC_ARG_WITH(macosx-bundle-identifier,
1411 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1412 [Define the OS X bundle identifier. Default is the somewhat weird
1413 org.libreoffice.script ("script", huh?).]),
1414 ,with_macosx_bundle_identifier=org.libreoffice.script)
1416 AC_ARG_WITH(product-name,
1417 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1418 [Define the product name. Default is AC_PACKAGE_NAME.]),
1419 ,with_product_name=$PRODUCTNAME)
1421 AC_ARG_WITH(package-version,
1422 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1423 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1426 libo_FUZZ_ARG_ENABLE(readonly-installset,
1427 AS_HELP_STRING([--enable-readonly-installset],
1428 [Prevents any attempts by LibreOffice to write into its installation. That means
1429 at least that no "system-wide" extensions can be added. Experimental work in
1433 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
1434 AS_HELP_STRING([--disable-postgresql-sdbc],
1435 [Disable the build of the PostgreSQL-SDBC driver.])
1438 libo_FUZZ_ARG_ENABLE(lotuswordpro,
1439 AS_HELP_STRING([--disable-lotuswordpro],
1440 [Disable the build of the Lotus Word Pro filter.]),
1441 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
1443 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
1444 AS_HELP_STRING([--disable-firebird-sdbc],
1445 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1446 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
1448 AC_ARG_ENABLE(bogus-pkg-config,
1449 AS_HELP_STRING([--enable-bogus-pkg-config],
1450 [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.]),
1453 AC_ARG_ENABLE(openssl,
1454 AS_HELP_STRING([--disable-openssl],
1455 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1456 components will either use GNUTLS or NSS. Work in progress,
1457 use only if you are hacking on it.]),
1458 ,enable_openssl=yes)
1460 AC_ARG_ENABLE(library-bin-tar,
1461 AS_HELP_STRING([--enable-library-bin-tar],
1462 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1463 Some libraries can save their build result in a tarball
1464 stored in TARFILE_LOCATION. That binary tarball is
1465 uniquely identified by the source tarball,
1466 the content of the config_host.mk file and the content
1467 of the top-level directory in core for that library
1468 If this option is enabled, then if such a tarfile exist, it will be untarred
1469 instead of the source tarfile, and the build step will be skipped for that
1471 If a proper tarfile does not exist, then the normal source-based
1472 build is done for that library and a proper binary tarfile is created
1473 for the next time.]),
1476 AC_ARG_ENABLE(dconf,
1477 AS_HELP_STRING([--disable-dconf],
1478 [Disable the dconf configuration backend (enabled by default where
1481 libo_FUZZ_ARG_ENABLE(formula-logger,
1483 [--enable-formula-logger],
1484 [Enable formula logger for logging formula calculation flow in Calc.]
1488 dnl ===================================================================
1489 dnl Optional Packages (--with/without-)
1490 dnl ===================================================================
1492 AC_ARG_WITH(gcc-home,
1493 AS_HELP_STRING([--with-gcc-home],
1494 [Specify the location of gcc/g++ manually. This can be used in conjunction
1495 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1496 non-default path.]),
1499 AC_ARG_WITH(gnu-patch,
1500 AS_HELP_STRING([--with-gnu-patch],
1501 [Specify location of GNU patch on Solaris or FreeBSD.]),
1504 AC_ARG_WITH(build-platform-configure-options,
1505 AS_HELP_STRING([--with-build-platform-configure-options],
1506 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1510 AS_HELP_STRING([--with-gnu-cp],
1511 [Specify location of GNU cp on Solaris or FreeBSD.]),
1514 AC_ARG_WITH(external-tar,
1515 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1516 [Specify an absolute path of where to find (and store) tarfiles.]),
1517 TARFILE_LOCATION=$withval ,
1520 AC_ARG_WITH(referenced-git,
1521 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1522 [Specify another checkout directory to reference. This makes use of
1523 git submodule update --reference, and saves a lot of diskspace
1524 when having multiple trees side-by-side.]),
1525 GIT_REFERENCE_SRC=$withval ,
1528 AC_ARG_WITH(linked-git,
1529 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1530 [Specify a directory where the repositories of submodules are located.
1531 This uses a method similar to git-new-workdir to get submodules.]),
1532 GIT_LINK_SRC=$withval ,
1535 AC_ARG_WITH(galleries,
1536 AS_HELP_STRING([--with-galleries],
1537 [Specify how galleries should be built. It is possible either to
1538 build these internally from source ("build"),
1539 or to disable them ("no")]),
1543 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1544 [Choose which themes to include. By default those themes with an '*' are included.
1545 Possible choices: *breeze, *breeze_dark, crystal, *colibre, *elementary, *galaxy, *hicontrast, oxygen, *sifr, *sifr_dark, *tango, tango_testing.]),
1548 libo_FUZZ_ARG_WITH(helppack-integration,
1549 AS_HELP_STRING([--without-helppack-integration],
1550 [It will not integrate the helppacks to the installer
1551 of the product. Please use this switch to use the online help
1552 or separate help packages.]),
1555 libo_FUZZ_ARG_WITH(fonts,
1556 AS_HELP_STRING([--without-fonts],
1557 [LibreOffice includes some third-party fonts to provide a reliable basis for
1558 help content, templates, samples, etc. When these fonts are already
1559 known to be available on the system then you should use this option.]),
1563 AS_HELP_STRING([--with-epm],
1564 [Decides which epm to use. Default is to use the one from the system if
1565 one is built. When either this is not there or you say =internal epm
1569 AC_ARG_WITH(package-format,
1570 AS_HELP_STRING([--with-package-format],
1571 [Specify package format(s) for LibreOffice installation sets. The
1572 implicit --without-package-format leads to no installation sets being
1573 generated. Possible values: aix, archive, bsd, deb, dmg,
1574 installed, msi, pkg, and rpm.
1575 Example: --with-package-format='deb rpm']),
1579 AS_HELP_STRING([--with-tls],
1580 [Decides which TLS/SSL and cryptographic implementations to use for
1581 LibreOffice's code. Notice that this doesn't apply for depending
1582 libraries like "neon", for example. Default is to use OpenSSL
1583 although NSS is also possible. Notice that selecting NSS restricts
1584 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1585 restrict by now the usage of NSS in LO's code. Possible values:
1586 openssl, nss. Example: --with-tls="nss"]),
1589 AC_ARG_WITH(system-libs,
1590 AS_HELP_STRING([--with-system-libs],
1591 [Use libraries already on system -- enables all --with-system-* flags.]),
1594 AC_ARG_WITH(system-bzip2,
1595 AS_HELP_STRING([--with-system-bzip2],
1596 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1597 [with_system_bzip2="$with_system_libs"])
1599 AC_ARG_WITH(system-headers,
1600 AS_HELP_STRING([--with-system-headers],
1601 [Use headers already on system -- enables all --with-system-* flags for
1602 external packages whose headers are the only entities used i.e.
1603 boost/odbc/sane-header(s).]),,
1604 [with_system_headers="$with_system_libs"])
1606 AC_ARG_WITH(system-jars,
1607 AS_HELP_STRING([--without-system-jars],
1608 [When building with --with-system-libs, also the needed jars are expected
1609 on the system. Use this to disable that]),,
1610 [with_system_jars="$with_system_libs"])
1612 AC_ARG_WITH(system-cairo,
1613 AS_HELP_STRING([--with-system-cairo],
1614 [Use cairo libraries already on system. Happens automatically for
1615 (implicit) --enable-gtk and for --enable-gtk3.]))
1617 AC_ARG_WITH(system-epoxy,
1618 AS_HELP_STRING([--with-system-epoxy],
1619 [Use epoxy libraries already on system. Happens automatically for
1621 [with_system_epoxy="$with_system_libs"])
1623 AC_ARG_WITH(myspell-dicts,
1624 AS_HELP_STRING([--with-myspell-dicts],
1625 [Adds myspell dictionaries to the LibreOffice installation set]),
1628 AC_ARG_WITH(system-dicts,
1629 AS_HELP_STRING([--without-system-dicts],
1630 [Do not use dictionaries from system paths.]),
1633 AC_ARG_WITH(external-dict-dir,
1634 AS_HELP_STRING([--with-external-dict-dir],
1635 [Specify external dictionary dir.]),
1638 AC_ARG_WITH(external-hyph-dir,
1639 AS_HELP_STRING([--with-external-hyph-dir],
1640 [Specify external hyphenation pattern dir.]),
1643 AC_ARG_WITH(external-thes-dir,
1644 AS_HELP_STRING([--with-external-thes-dir],
1645 [Specify external thesaurus dir.]),
1648 AC_ARG_WITH(system-zlib,
1649 AS_HELP_STRING([--with-system-zlib],
1650 [Use zlib already on system.]),,
1651 [with_system_zlib=auto])
1653 AC_ARG_WITH(system-jpeg,
1654 AS_HELP_STRING([--with-system-jpeg],
1655 [Use jpeg already on system.]),,
1656 [with_system_jpeg="$with_system_libs"])
1658 AC_ARG_WITH(system-clucene,
1659 AS_HELP_STRING([--with-system-clucene],
1660 [Use clucene already on system.]),,
1661 [with_system_clucene="$with_system_libs"])
1663 AC_ARG_WITH(system-expat,
1664 AS_HELP_STRING([--with-system-expat],
1665 [Use expat already on system.]),,
1666 [with_system_expat="$with_system_libs"])
1668 AC_ARG_WITH(system-libxml,
1669 AS_HELP_STRING([--with-system-libxml],
1670 [Use libxml/libxslt already on system.]),,
1671 [with_system_libxml=auto])
1673 AC_ARG_WITH(system-icu,
1674 AS_HELP_STRING([--with-system-icu],
1675 [Use icu already on system.]),,
1676 [with_system_icu="$with_system_libs"])
1678 AC_ARG_WITH(system-ucpp,
1679 AS_HELP_STRING([--with-system-ucpp],
1680 [Use ucpp already on system.]),,
1683 AC_ARG_WITH(system-openldap,
1684 AS_HELP_STRING([--with-system-openldap],
1685 [Use the OpenLDAP LDAP SDK already on system.]),,
1686 [with_system_openldap="$with_system_libs"])
1688 AC_ARG_WITH(system-poppler,
1689 AS_HELP_STRING([--with-system-poppler],
1690 [Use system poppler (only needed for PDF import).]),,
1691 [with_system_poppler="$with_system_libs"])
1693 AC_ARG_WITH(system-gpgmepp,
1694 AS_HELP_STRING([--with-system-gpgmepp],
1695 [Use gpgmepp already on system]),,
1696 [with_system_gpgmepp="$with_system_libs"])
1698 AC_ARG_WITH(system-apache-commons,
1699 AS_HELP_STRING([--with-system-apache-commons],
1700 [Use Apache commons libraries already on system.]),,
1701 [with_system_apache_commons="$with_system_jars"])
1703 AC_ARG_WITH(system-mariadb,
1704 AS_HELP_STRING([--with-system-mariadb],
1705 [Use MariaDB/MySQL libraries already on system, for building the MariaDB Connector/LibreOffice
1707 [with_system_mariadb="$with_system_libs"])
1709 AC_ARG_ENABLE(bundle-mariadb,
1710 AS_HELP_STRING([--enable-bundle-mariadb],
1711 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice extension.])
1714 AC_ARG_WITH(system-mysql-cppconn,
1715 AS_HELP_STRING([--with-system-mysql-cppconn],
1716 [Use MySQL C++ Connector libraries already on system.]),,
1717 [with_system_mysql_cppconn="$with_system_libs"])
1719 AC_ARG_WITH(system-postgresql,
1720 AS_HELP_STRING([--with-system-postgresql],
1721 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1722 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1723 [with_system_postgresql="$with_system_libs"])
1725 AC_ARG_WITH(libpq-path,
1726 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1727 [Use this PostgreSQL C interface (libpq) installation for building
1728 the PostgreSQL-SDBC extension.]),
1731 AC_ARG_WITH(system-firebird,
1732 AS_HELP_STRING([--with-system-firebird],
1733 [Use Firebird libraries already on system, for building the Firebird-SDBC
1734 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1735 [with_system_firebird="$with_system_libs"])
1737 AC_ARG_WITH(system-libtommath,
1738 AS_HELP_STRING([--with-system-libtommath],
1739 [Use libtommath already on system]),,
1740 [with_system_libtommath="$with_system_libs"])
1742 AC_ARG_WITH(system-hsqldb,
1743 AS_HELP_STRING([--with-system-hsqldb],
1744 [Use hsqldb already on system.]))
1746 AC_ARG_WITH(hsqldb-jar,
1747 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1748 [Specify path to jarfile manually.]),
1749 HSQLDB_JAR=$withval)
1751 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
1752 AS_HELP_STRING([--disable-scripting-beanshell],
1753 [Disable support for scripts in BeanShell.]),
1757 AC_ARG_WITH(system-beanshell,
1758 AS_HELP_STRING([--with-system-beanshell],
1759 [Use beanshell already on system.]),,
1760 [with_system_beanshell="$with_system_jars"])
1762 AC_ARG_WITH(beanshell-jar,
1763 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1764 [Specify path to jarfile manually.]),
1767 libo_FUZZ_ARG_ENABLE(scripting-javascript,
1768 AS_HELP_STRING([--disable-scripting-javascript],
1769 [Disable support for scripts in JavaScript.]),
1773 AC_ARG_WITH(system-rhino,
1774 AS_HELP_STRING([--with-system-rhino],
1775 [Use rhino already on system.]),,)
1776 # [with_system_rhino="$with_system_jars"])
1777 # Above is not used as we have different debug interface
1778 # patched into internal rhino. This code needs to be fixed
1779 # before we can enable it by default.
1781 AC_ARG_WITH(rhino-jar,
1782 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1783 [Specify path to jarfile manually.]),
1786 AC_ARG_WITH(commons-logging-jar,
1787 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1788 [Specify path to jarfile manually.]),
1789 COMMONS_LOGGING_JAR=$withval)
1791 AC_ARG_WITH(system-jfreereport,
1792 AS_HELP_STRING([--with-system-jfreereport],
1793 [Use JFreeReport already on system.]),,
1794 [with_system_jfreereport="$with_system_jars"])
1796 AC_ARG_WITH(sac-jar,
1797 AS_HELP_STRING([--with-sac-jar=JARFILE],
1798 [Specify path to jarfile manually.]),
1801 AC_ARG_WITH(libxml-jar,
1802 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1803 [Specify path to jarfile manually.]),
1804 LIBXML_JAR=$withval)
1806 AC_ARG_WITH(flute-jar,
1807 AS_HELP_STRING([--with-flute-jar=JARFILE],
1808 [Specify path to jarfile manually.]),
1811 AC_ARG_WITH(jfreereport-jar,
1812 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1813 [Specify path to jarfile manually.]),
1814 JFREEREPORT_JAR=$withval)
1816 AC_ARG_WITH(liblayout-jar,
1817 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1818 [Specify path to jarfile manually.]),
1819 LIBLAYOUT_JAR=$withval)
1821 AC_ARG_WITH(libloader-jar,
1822 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1823 [Specify path to jarfile manually.]),
1824 LIBLOADER_JAR=$withval)
1826 AC_ARG_WITH(libformula-jar,
1827 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1828 [Specify path to jarfile manually.]),
1829 LIBFORMULA_JAR=$withval)
1831 AC_ARG_WITH(librepository-jar,
1832 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1833 [Specify path to jarfile manually.]),
1834 LIBREPOSITORY_JAR=$withval)
1836 AC_ARG_WITH(libfonts-jar,
1837 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1838 [Specify path to jarfile manually.]),
1839 LIBFONTS_JAR=$withval)
1841 AC_ARG_WITH(libserializer-jar,
1842 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1843 [Specify path to jarfile manually.]),
1844 LIBSERIALIZER_JAR=$withval)
1846 AC_ARG_WITH(libbase-jar,
1847 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1848 [Specify path to jarfile manually.]),
1849 LIBBASE_JAR=$withval)
1851 AC_ARG_WITH(system-odbc,
1852 AS_HELP_STRING([--with-system-odbc],
1853 [Use the odbc headers already on system.]),,
1854 [with_system_odbc="auto"])
1856 AC_ARG_WITH(system-sane,
1857 AS_HELP_STRING([--with-system-sane],
1858 [Use sane.h already on system.]),,
1859 [with_system_sane="$with_system_headers"])
1861 AC_ARG_WITH(system-bluez,
1862 AS_HELP_STRING([--with-system-bluez],
1863 [Use bluetooth.h already on system.]),,
1864 [with_system_bluez="$with_system_headers"])
1866 AC_ARG_WITH(system-curl,
1867 AS_HELP_STRING([--with-system-curl],
1868 [Use curl already on system.]),,
1869 [with_system_curl=auto])
1871 AC_ARG_WITH(system-boost,
1872 AS_HELP_STRING([--with-system-boost],
1873 [Use boost already on system.]),,
1874 [with_system_boost="$with_system_headers"])
1876 AC_ARG_WITH(system-glm,
1877 AS_HELP_STRING([--with-system-glm],
1878 [Use glm already on system.]),,
1879 [with_system_glm="$with_system_headers"])
1881 AC_ARG_WITH(system-hunspell,
1882 AS_HELP_STRING([--with-system-hunspell],
1883 [Use libhunspell already on system.]),,
1884 [with_system_hunspell="$with_system_libs"])
1886 AC_ARG_WITH(system-mythes,
1887 AS_HELP_STRING([--with-system-mythes],
1888 [Use mythes already on system.]),,
1889 [with_system_mythes="$with_system_libs"])
1891 AC_ARG_WITH(system-altlinuxhyph,
1892 AS_HELP_STRING([--with-system-altlinuxhyph],
1893 [Use ALTLinuxhyph already on system.]),,
1894 [with_system_altlinuxhyph="$with_system_libs"])
1896 AC_ARG_WITH(system-lpsolve,
1897 AS_HELP_STRING([--with-system-lpsolve],
1898 [Use lpsolve already on system.]),,
1899 [with_system_lpsolve="$with_system_libs"])
1901 AC_ARG_WITH(system-coinmp,
1902 AS_HELP_STRING([--with-system-coinmp],
1903 [Use CoinMP already on system.]),,
1904 [with_system_coinmp="$with_system_libs"])
1906 AC_ARG_WITH(system-liblangtag,
1907 AS_HELP_STRING([--with-system-liblangtag],
1908 [Use liblangtag library already on system.]),,
1909 [with_system_liblangtag="$with_system_libs"])
1912 AS_HELP_STRING([--with-webdav],
1913 [Specify which library to use for webdav implementation.
1914 Possible values: "neon", "serf", "no". The default value is "neon".
1915 Example: --with-webdav="serf"]),
1916 WITH_WEBDAV=$withval,
1919 AC_ARG_WITH(linker-hash-style,
1920 AS_HELP_STRING([--with-linker-hash-style],
1921 [Use linker with --hash-style=<style> when linking shared objects.
1922 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1923 if supported on the build system, and "sysv" otherwise.]))
1925 AC_ARG_WITH(jdk-home,
1926 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
1927 [If you have installed JDK 1.6 or later on your system please supply the
1928 path here. Note that this is not the location of the java command but the
1929 location of the entire distribution.]),
1933 AS_HELP_STRING([--with-help],
1934 [Enable the build of help. There is a special parameter "common" that
1935 can be used to bundle only the common part, .e.g help-specific icons.
1936 This is useful when you build the helpcontent separately.])
1938 Usage: --with-help build the old local help
1939 --without-help no local help (default)
1940 --with-help=html build the new HTML local help
1941 --with-help=online build the new HTML online help
1942 --with-help=common bundle common files for the local
1943 help but do not build the whole help
1947 libo_FUZZ_ARG_WITH(java,
1948 AS_HELP_STRING([--with-java=<java command>],
1949 [Specify the name of the Java interpreter command. Typically "java"
1950 which is the default.
1952 To build without support for Java components, applets, accessibility
1953 or the XML filters written in Java, use --without-java or --with-java=no.]),
1954 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1955 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
1958 AC_ARG_WITH(jvm-path,
1959 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
1960 [Use a specific JVM search path at runtime.
1961 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
1964 AC_ARG_WITH(ant-home,
1965 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
1966 [If you have installed Jakarta Ant on your system, please supply the path here.
1967 Note that this is not the location of the Ant binary but the location
1968 of the entire distribution.]),
1971 AC_ARG_WITH(symbol-config,
1972 AS_HELP_STRING([--with-symbol-config],
1973 [Configuration for the crashreport symbol upload]),
1975 [with_symbol_config=no])
1977 AC_ARG_WITH(export-validation,
1978 AS_HELP_STRING([--without-export-validation],
1979 [Disable validating OOXML and ODF files as exported from in-tree tests.
1980 Use this option e.g. if your system only provides Java 5.]),
1981 ,with_export_validation=auto)
1983 AC_ARG_WITH(bffvalidator,
1984 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
1985 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
1986 Requires installed Microsoft Office Binary File Format Validator.
1987 Note: export-validation (--with-export-validation) is required to be turned on.
1988 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
1989 ,with_bffvalidator=no)
1991 libo_FUZZ_ARG_WITH(junit,
1992 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
1993 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1994 --without-junit disables those tests. Not relevant in the --without-java case.]),
1997 AC_ARG_WITH(hamcrest,
1998 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
1999 [Specifies the hamcrest jar file to use for JUnit-based tests.
2000 --without-junit disables those tests. Not relevant in the --without-java case.]),
2003 AC_ARG_WITH(perl-home,
2004 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2005 [If you have installed Perl 5 Distribution, on your system, please
2006 supply the path here. Note that this is not the location of the Perl
2007 binary but the location of the entire distribution.]),
2010 libo_FUZZ_ARG_WITH(doxygen,
2012 [--with-doxygen=<absolute path to doxygen executable>],
2013 [Specifies the doxygen executable to use when generating ODK C/C++
2014 documentation. --without-doxygen disables generation of ODK C/C++
2015 documentation. Not relevant in the --disable-odk case.]),
2018 AC_ARG_WITH(visual-studio,
2019 AS_HELP_STRING([--with-visual-studio=<2015/2017>],
2020 [Specify which Visual Studio version to use in case several are
2021 installed. If not specified, defaults to 2015.]),
2024 AC_ARG_WITH(windows-sdk,
2025 AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
2026 [Specify which Windows SDK, or "Windows Kit", version to use
2027 in case the one that came with the selected Visual Studio
2028 is not what you want for some reason. Note that not all compiler/SDK
2029 combinations are supported. The intent is that this option should not
2034 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2035 [Use this option to build LibreOffice with additional UI language support.
2036 English (US) is always included by default.
2037 Separate multiple languages with space.
2038 For all languages, use --with-lang=ALL.]),
2041 AC_ARG_WITH(locales,
2042 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2043 [Use this option to limit the locale information built in.
2044 Separate multiple locales with space.
2045 Very experimental and might well break stuff.
2046 Just a desperate measure to shrink code and data size.
2047 By default all the locales available is included.
2048 This option is completely unrelated to --with-lang.])
2050 Affects also our character encoding conversion
2051 tables for encodings mainly targeted for a
2052 particular locale, like EUC-CN and EUC-TW for
2053 zh, ISO-2022-JP for ja.
2055 Affects also our add-on break iterator data for
2058 For the default, all locales, don't use this switch at all.
2059 Specifying just the language part of a locale means all matching
2060 locales will be included.
2064 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2065 libo_FUZZ_ARG_WITH(krb5,
2066 AS_HELP_STRING([--with-krb5],
2067 [Enable MIT Kerberos 5 support in modules that support it.
2068 By default automatically enabled on platforms
2069 where a good system Kerberos 5 is available.]),
2072 libo_FUZZ_ARG_WITH(gssapi,
2073 AS_HELP_STRING([--with-gssapi],
2074 [Enable GSSAPI support in modules that support it.
2075 By default automatically enabled on platforms
2076 where a good system GSSAPI is available.]),
2080 AS_HELP_STRING([--with-iwyu],
2081 [Use given IWYU binary path to check unneeded includes instead of building.
2082 Use only if you are hacking on it.]),
2085 libo_FUZZ_ARG_WITH(lxml,
2086 AS_HELP_STRING([--without-lxml],
2087 [gla11y will use python lxml when available, potentially building a local copy if necessary.
2088 --without-lxml tells it to not use python lxml at all, which means that gla11y will only
2089 report widget classes and ids.]),
2092 dnl ===================================================================
2094 dnl ===================================================================
2096 AC_ARG_WITH(branding,
2097 AS_HELP_STRING([--with-branding=/path/to/images],
2098 [Use given path to retrieve branding images set.])
2100 Search for intro.png about.svg and flat_logo.svg.
2101 If any is missing, default ones will be used instead.
2103 Search also progress.conf for progress
2104 settings on intro screen :
2106 PROGRESSBARCOLOR="255,255,255" Set color of
2107 progress bar. Comma separated RGB decimal values.
2108 PROGRESSSIZE="407,6" Set size of progress bar.
2109 Comma separated decimal values (width, height).
2110 PROGRESSPOSITION="61,317" Set position of progress
2111 bar from left,top. Comma separated decimal values.
2112 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2113 bar frame. Comma separated RGB decimal values.
2114 PROGRESSTEXTCOLOR="255,255,255" Set color of progress
2115 bar text. Comma separated RGB decimal values.
2116 PROGRESSTEXTBASELINE="287" Set vertical position of
2117 progress bar text from top. Decimal value.
2119 Default values will be used if not found.
2124 AC_ARG_WITH(extra-buildid,
2125 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2126 [Show addition build identification in about dialog.]),
2131 AS_HELP_STRING([--with-vendor="John the Builder"],
2132 [Set vendor of the build.]),
2135 AC_ARG_WITH(android-package-name,
2136 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2137 [Set Android package name of the build.]),
2140 AC_ARG_WITH(compat-oowrappers,
2141 AS_HELP_STRING([--with-compat-oowrappers],
2142 [Install oo* wrappers in parallel with
2143 lo* ones to keep backward compatibility.
2144 Has effect only with make distro-pack-install]),
2147 AC_ARG_WITH(os-version,
2148 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2149 [For FreeBSD users, use this option to override the detected OSVERSION.]),
2152 AC_ARG_WITH(mingw-cross-compiler,
2153 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2154 [Specify the MinGW cross-compiler to use.
2155 When building on the ODK on Unix and building unowinreg.dll,
2156 specify the MinGW C++ cross-compiler.]),
2159 AC_ARG_WITH(idlc-cpp,
2160 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2161 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2164 AC_ARG_WITH(build-version,
2165 AS_HELP_STRING([--with-build-version="Built by Jim"],
2166 [Allows the builder to add a custom version tag that will appear in the
2167 Help/About box for QA purposes.]),
2168 with_build_version=$withval,
2172 AS_HELP_STRING([--with-alloc],
2173 [Define which allocator to build with (choices are internal, system).]),
2176 AC_ARG_WITH(parallelism,
2177 AS_HELP_STRING([--with-parallelism],
2178 [Number of jobs to run simultaneously during build. Parallel builds can
2179 save a lot of time on multi-cpu machines. Defaults to the number of
2180 CPUs on the machine, unless you configure --enable-icecream - then to
2184 AC_ARG_WITH(all-tarballs,
2185 AS_HELP_STRING([--with-all-tarballs],
2186 [Download all external tarballs unconditionally]))
2188 AC_ARG_WITH(gdrive-client-id,
2189 AS_HELP_STRING([--with-gdrive-client-id],
2190 [Provides the client id of the application for OAuth2 authentication
2191 on Google Drive. If either this or --with-gdrive-client-secret is
2192 empty, the feature will be disabled]),
2195 AC_ARG_WITH(gdrive-client-secret,
2196 AS_HELP_STRING([--with-gdrive-client-secret],
2197 [Provides the client secret of the application for OAuth2
2198 authentication on Google Drive. If either this or
2199 --with-gdrive-client-id is empty, the feature will be disabled]),
2202 AC_ARG_WITH(alfresco-cloud-client-id,
2203 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2204 [Provides the client id of the application for OAuth2 authentication
2205 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2206 empty, the feature will be disabled]),
2209 AC_ARG_WITH(alfresco-cloud-client-secret,
2210 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2211 [Provides the client secret of the application for OAuth2
2212 authentication on Alfresco Cloud. If either this or
2213 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2216 AC_ARG_WITH(onedrive-client-id,
2217 AS_HELP_STRING([--with-onedrive-client-id],
2218 [Provides the client id of the application for OAuth2 authentication
2219 on OneDrive. If either this or --with-onedrive-client-secret is
2220 empty, the feature will be disabled]),
2223 AC_ARG_WITH(onedrive-client-secret,
2224 AS_HELP_STRING([--with-onedrive-client-secret],
2225 [Provides the client secret of the application for OAuth2
2226 authentication on OneDrive. If either this or
2227 --with-onedrive-client-id is empty, the feature will be disabled]),
2229 dnl ===================================================================
2230 dnl Do we want to use pre-build binary tarball for recompile
2231 dnl ===================================================================
2233 if test "$enable_library_bin_tar" = "yes" ; then
2234 USE_LIBRARY_BIN_TAR=TRUE
2236 USE_LIBRARY_BIN_TAR=
2238 AC_SUBST(USE_LIBRARY_BIN_TAR)
2240 dnl ===================================================================
2241 dnl Test whether build target is Release Build
2242 dnl ===================================================================
2243 AC_MSG_CHECKING([whether build target is Release Build])
2244 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2246 ENABLE_RELEASE_BUILD=
2248 AC_MSG_RESULT([yes])
2249 ENABLE_RELEASE_BUILD=TRUE
2251 AC_SUBST(ENABLE_RELEASE_BUILD)
2253 dnl ===================================================================
2254 dnl Test whether to sign Windows Build
2255 dnl ===================================================================
2256 AC_MSG_CHECKING([whether to sign windows build])
2257 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
2258 AC_MSG_RESULT([yes])
2259 WINDOWS_BUILD_SIGNING="TRUE"
2262 WINDOWS_BUILD_SIGNING="FALSE"
2264 AC_SUBST(WINDOWS_BUILD_SIGNING)
2266 dnl ===================================================================
2267 dnl MacOSX build and runtime environment options
2268 dnl ===================================================================
2270 AC_ARG_WITH(macosx-sdk,
2271 AS_HELP_STRING([--with-macosx-sdk=<version>],
2272 [Prefer a specific SDK for building.])
2274 If the requested SDK is not available, a search for the oldest one will be done.
2275 With current Xcode versions, only the latest SDK is included, so this option is
2276 not terribly useful. It works fine to build with a new SDK and run the result
2279 e. g.: --with-macosx-sdk=10.9
2281 there are 3 options to control the MacOSX build:
2282 --with-macosx-sdk (referred as 'sdk' below)
2283 --with-macosx-version-min-required (referred as 'min' below)
2284 --with-macosx-version-max-allowed (referred as 'max' below)
2286 the connection between these value and the default they take is as follow:
2287 ( ? means not specified on the command line, s means the SDK version found,
2288 constraint: 8 <= x <= y <= z)
2290 ==========================================
2291 command line || config result
2292 ==========================================
2293 min | max | sdk || min | max | sdk |
2294 ? | ? | ? || 10.9 | 10.s | 10.s |
2295 ? | ? | 10.x || 10.9 | 10.x | 10.x |
2296 ? | 10.x | ? || 10.9 | 10.s | 10.s |
2297 ? | 10.x | 10.y || 10.9 | 10.x | 10.y |
2298 10.x | ? | ? || 10.x | 10.s | 10.s |
2299 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2300 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2301 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2304 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2305 for a detailed technical explanation of these variables
2307 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2311 AC_ARG_WITH(macosx-version-min-required,
2312 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2313 [set the minimum OS version needed to run the built LibreOffice])
2315 e. g.: --with-macos-version-min-required=10.9
2316 see --with-macosx-sdk for more info
2320 AC_ARG_WITH(macosx-version-max-allowed,
2321 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2322 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2324 e. g.: --with-macos-version-max-allowed=10.9
2325 see --with-macosx-sdk for more info
2330 dnl ===================================================================
2331 dnl options for stuff used during cross-compilation build
2332 dnl Not quite superseded by --with-build-platform-configure-options.
2333 dnl TODO: check, if the "force" option is still needed anywhere.
2334 dnl ===================================================================
2336 AC_ARG_WITH(system-icu-for-build,
2337 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2338 [Use icu already on system for build tools (cross-compilation only).]))
2341 dnl ===================================================================
2342 dnl Check for incompatible options set by fuzzing, and reset those
2343 dnl automatically to working combinations
2344 dnl ===================================================================
2346 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
2347 "$enable_dbus" != "$enable_avahi"; then
2348 AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
2349 enable_avahi=$enable_dbus
2352 dnl ===================================================================
2353 dnl check for required programs (grep, awk, sed, bash)
2354 dnl ===================================================================
2358 if test -n "$1"; then
2359 if test "$build_os" = "cygwin"; then
2360 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2362 new_path=`cygpath -sm "$formatted_path"`
2365 new_path=`cygpath -u "$formatted_path"`
2370 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2371 if test "$2" = "after"; then
2372 LO_PATH="$LO_PATH${P_SEP}$new_path"
2374 LO_PATH="$new_path${P_SEP}$LO_PATH"
2382 AC_PATH_PROG( AWK, $AWK)
2383 if test -z "$AWK"; then
2384 AC_MSG_ERROR([install awk to run this script])
2387 AC_PATH_PROG(BASH, bash)
2388 if test -z "$BASH"; then
2389 AC_MSG_ERROR([bash not found in \$PATH])
2393 AC_MSG_CHECKING([for GNU or BSD tar])
2394 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2395 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2396 if test $? -eq 0; then
2401 AC_MSG_RESULT($GNUTAR)
2402 if test -z "$GNUTAR"; then
2403 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2407 AC_MSG_CHECKING([for tar's option to strip components])
2408 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2409 if test $? -eq 0; then
2410 STRIP_COMPONENTS="--strip-components"
2412 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2413 if test $? -eq 0; then
2414 STRIP_COMPONENTS="--strip-path"
2416 STRIP_COMPONENTS="unsupported"
2419 AC_MSG_RESULT($STRIP_COMPONENTS)
2420 if test x$STRIP_COMPONENTS = xunsupported; then
2421 AC_MSG_ERROR([you need a tar that is able to strip components.])
2423 AC_SUBST(STRIP_COMPONENTS)
2425 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2426 dnl desktop OSes from "mobile" ones.
2428 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2429 dnl In other words, that when building for an OS that is not a
2430 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2432 dnl Note the direction of the implication; there is no assumption that
2433 dnl cross-compiling would imply a non-desktop OS.
2435 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
2436 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2437 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2438 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2441 # Whether to build "avmedia" functionality or not.
2443 if test -z "$enable_avmedia"; then
2447 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2448 if test "$enable_avmedia" = yes; then
2449 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2451 USE_AVMEDIA_DUMMY='TRUE'
2453 AC_SUBST(USE_AVMEDIA_DUMMY)
2455 # Decide whether to build database connectivity stuff (including
2456 # Base) or not. We probably don't want to on non-desktop OSes.
2457 if test -z "$enable_database_connectivity"; then
2458 # --disable-database-connectivity is unfinished work in progress
2459 # and the iOS test app doesn't link if we actually try to use it.
2460 # if test $_os != iOS -a $_os != Android; then
2461 if test $_os != iOS; then
2462 enable_database_connectivity=yes
2466 if test "$enable_database_connectivity" = yes; then
2467 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2468 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2471 if test -z "$enable_extensions"; then
2472 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2473 if test $_os != iOS -a $_os != Android; then
2474 enable_extensions=yes
2478 if test "$enable_extensions" = yes; then
2479 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2480 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2483 if test -z "$enable_scripting"; then
2484 # Disable scripting for iOS unless specifically overridden
2485 # with --enable-scripting.
2486 if test $_os != iOS; then
2487 enable_scripting=yes
2491 DISABLE_SCRIPTING=''
2492 if test "$enable_scripting" = yes; then
2493 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2494 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2496 DISABLE_SCRIPTING='TRUE'
2497 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2500 if test $_os = iOS -o $_os = Android; then
2501 # Disable dynamic_loading always for iOS and Android
2502 enable_dynamic_loading=no
2503 elif test -z "$enable_dynamic_loading"; then
2504 # Otherwise enable it unless speficically disabled
2505 enable_dynamic_loading=yes
2508 DISABLE_DYNLOADING=''
2509 if test "$enable_dynamic_loading" = yes; then
2510 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2512 DISABLE_DYNLOADING='TRUE'
2514 AC_SUBST(DISABLE_DYNLOADING)
2516 # remenber SYSBASE value
2519 dnl ===================================================================
2520 dnl Sort out various gallery compilation options
2521 dnl ===================================================================
2522 AC_MSG_CHECKING([how to build and package galleries])
2523 if test -n "${with_galleries}"; then
2524 if test "$with_galleries" = "build"; then
2525 WITH_GALLERY_BUILD=TRUE
2526 AC_MSG_RESULT([build from source images internally])
2527 elif test "$with_galleries" = "no"; then
2529 AC_MSG_RESULT([disable non-internal gallery build])
2531 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2534 if test $_os != iOS -a $_os != Android; then
2535 WITH_GALLERY_BUILD=TRUE
2536 AC_MSG_RESULT([internal src images for desktop])
2539 AC_MSG_RESULT([disable src image build])
2542 AC_SUBST(WITH_GALLERY_BUILD)
2544 dnl ===================================================================
2545 dnl Checks if ccache is available
2546 dnl ===================================================================
2547 if test "$_os" = "WINNT"; then
2548 # on windows/VC build do not use ccache
2550 elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2551 case "%$CC%$CXX%" in
2552 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2553 # assume that's good then
2554 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2555 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2558 AC_PATH_PROG([CCACHE],[ccache],[not found])
2559 if test "$CCACHE" = "not found"; then
2562 # Need to check for ccache version: otherwise prevents
2563 # caching of the results (like "-x objective-c++" for Mac)
2564 if test $_os = Darwin -o $_os = iOS; then
2565 # Check ccache version
2566 AC_MSG_CHECKING([whether version of ccache is suitable])
2567 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2568 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2569 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2570 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2572 AC_MSG_RESULT([no, $CCACHE_VERSION])
2583 if test "$CCACHE" != ""; then
2584 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2585 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2586 if test "$ccache_size" = ""; then
2587 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2588 if test "$ccache_size" = ""; then
2591 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2592 if test $ccache_size -lt 1024; then
2594 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2595 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2597 # warn that ccache may be too small for debug build
2598 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2599 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2602 if test $ccache_size -lt 5; then
2603 #warn that ccache may be too small for debug build
2604 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2605 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2610 dnl ===================================================================
2611 dnl Checks for C compiler,
2612 dnl The check for the C++ compiler is later on.
2613 dnl ===================================================================
2614 if test "$_os" != "WINNT"; then
2616 AC_MSG_CHECKING([gcc home])
2617 if test -z "$with_gcc_home"; then
2618 if test "$enable_icecream" = "yes"; then
2619 if test -d "/usr/lib/icecc/bin"; then
2620 GCC_HOME="/usr/lib/icecc/"
2622 GCC_HOME="/opt/icecream/"
2625 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2626 GCC_HOME_SET="false"
2629 GCC_HOME="$with_gcc_home"
2631 AC_MSG_RESULT($GCC_HOME)
2634 if test "$GCC_HOME_SET" = "true"; then
2635 if test -z "$CC"; then
2636 CC="$GCC_HOME/bin/gcc"
2638 if test -z "$CXX"; then
2639 CXX="$GCC_HOME/bin/g++"
2644 COMPATH=`dirname "$CC"`
2645 if test "$COMPATH" = "."; then
2646 AC_PATH_PROGS(COMPATH, $CC)
2647 dnl double square bracket to get single because of M4 quote...
2648 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2650 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2652 dnl ===================================================================
2654 dnl ===================================================================
2655 AC_MSG_CHECKING([whether to build with Java support])
2656 if test "$with_java" != "no"; then
2657 if test "$DISABLE_SCRIPTING" = TRUE; then
2658 AC_MSG_RESULT([no, overridden by --disable-scripting])
2662 AC_MSG_RESULT([yes])
2664 AC_DEFINE(HAVE_FEATURE_JAVA)
2671 AC_SUBST(ENABLE_JAVA)
2673 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2675 dnl ENABLE_JAVA="" indicate no Java support at all
2677 dnl ===================================================================
2678 dnl Check OS X SDK and compiler
2679 dnl ===================================================================
2681 if test $_os = Darwin -o $_os = iOS; then
2683 # If no --with-macosx-sdk option is given, look for one
2685 # The intent is that for "most" Mac-based developers, a suitable
2686 # SDK will be found automatically without any configure options.
2688 # For developers with a current Xcode, the lowest-numbered SDK
2689 # higher than or equal to the minimum required should be found.
2691 AC_MSG_CHECKING([what Mac OS X SDK to use])
2692 for _macosx_sdk in $with_macosx_sdk 10.13 10.12; do
2693 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2694 if test -d "$MACOSX_SDK_PATH"; then
2695 with_macosx_sdk="${_macosx_sdk}"
2698 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2699 if test -d "$MACOSX_SDK_PATH"; then
2700 with_macosx_sdk="${_macosx_sdk}"
2705 if test ! -d "$MACOSX_SDK_PATH"; then
2706 AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2709 if test $_os = iOS; then
2710 if test "$enable_ios_simulator" = "yes"; then
2711 useos=iphonesimulator
2715 MACOSX_SDK_PATH=`xcrun --sdk ${useos} --show-sdk-path 2> /dev/null`
2717 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2720 case $with_macosx_sdk in
2722 MACOSX_SDK_VERSION=1090
2725 MACOSX_SDK_VERSION=101000
2728 MACOSX_SDK_VERSION=101100
2731 MACOSX_SDK_VERSION=101200
2734 MACOSX_SDK_VERSION=101300
2737 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.9--13])
2741 if test "$with_macosx_version_min_required" = "" ; then
2742 with_macosx_version_min_required="10.9";
2745 if test "$with_macosx_version_max_allowed" = "" ; then
2746 with_macosx_version_max_allowed="$with_macosx_sdk"
2749 # export this so that "xcrun" invocations later return matching values
2750 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2751 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2752 export DEVELOPER_DIR
2753 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2754 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2756 case "$with_macosx_version_min_required" in
2758 MAC_OS_X_VERSION_MIN_REQUIRED="1090"
2761 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2764 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2767 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2770 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2773 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.9--13])
2776 MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
2778 LIBTOOL=/usr/bin/libtool
2779 INSTALL_NAME_TOOL=install_name_tool
2780 if test -z "$save_CC"; then
2781 AC_MSG_CHECKING([what compiler to use])
2782 stdlib=-stdlib=libc++
2783 if test "$ENABLE_LTO" = TRUE; then
2786 CC="`xcrun -find clang` -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2787 CXX="`xcrun -find clang++` -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2788 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2791 STRIP=`xcrun -find strip`
2792 LIBTOOL=`xcrun -find libtool`
2793 RANLIB=`xcrun -find ranlib`
2794 AC_MSG_RESULT([$CC and $CXX])
2797 case "$with_macosx_version_max_allowed" in
2799 MAC_OS_X_VERSION_MAX_ALLOWED="1090"
2802 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2805 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2808 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2811 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2814 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.9--13])
2818 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2819 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2820 AC_MSG_RESULT([$MAC_OS_X_VERSION_MIN_REQUIRED])
2821 AC_MSG_RESULT([$MAC_OS_X_VERSION_MAX_REQUIRED])
2822 AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2827 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2828 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2829 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2833 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2834 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2836 AC_MSG_CHECKING([whether to do code signing])
2838 if test "$enable_macosx_code_signing" = yes; then
2839 # By default use the first suitable certificate (?).
2841 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2842 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2843 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2844 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2845 # "Developer ID Application" one.
2847 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2848 if test -n "$identity"; then
2849 MACOSX_CODESIGNING_IDENTITY=$identity
2850 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2851 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2853 AC_MSG_ERROR([cannot determine identity to use])
2855 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2856 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2857 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2858 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2863 AC_MSG_CHECKING([whether to create a Mac App Store package])
2865 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2866 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2867 elif test "$enable_macosx_package_signing" = yes; then
2868 # By default use the first suitable certificate.
2869 # It should be a "3rd Party Mac Developer Installer" one
2871 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2872 if test -n "$identity"; then
2873 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2874 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2875 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2877 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2879 elif test -n "$enable_macosx_package_signing"; then
2880 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2881 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2882 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2887 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2888 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2891 AC_MSG_CHECKING([whether to sandbox the application])
2893 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2894 AC_MSG_ERROR([OS X sandboxing requires code signing])
2895 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
2896 AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
2897 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2898 ENABLE_MACOSX_SANDBOX=TRUE
2899 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
2900 AC_MSG_RESULT([yes])
2905 AC_MSG_CHECKING([what OS X app bundle identifier to use])
2906 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
2907 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
2909 AC_SUBST(MACOSX_SDK_PATH)
2910 AC_SUBST(MACOSX_SDK_VERSION)
2911 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2912 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2913 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
2914 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2915 AC_SUBST(INSTALL_NAME_TOOL)
2916 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
2917 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2918 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
2919 AC_SUBST(ENABLE_MACOSX_SANDBOX)
2920 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
2922 dnl ===================================================================
2923 dnl Check iOS SDK and compiler
2924 dnl ===================================================================
2926 if test $_os = iOS; then
2927 AC_MSG_CHECKING([what iOS SDK to use])
2928 current_sdk_ver=11.2
2929 if test "$enable_ios_simulator" = "yes"; then
2930 platform=iPhoneSimulator
2931 versionmin=-mios-simulator-version-min=$current_sdk_ver
2934 versionmin=-miphoneos-version-min=$current_sdk_ver
2936 xcode_developer=`xcode-select -print-path`
2938 for sdkver in $current_sdk_ver; do
2939 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
2947 if test -z "$sysroot"; then
2948 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
2951 AC_MSG_RESULT($sysroot)
2953 IOS_SDK=`echo $platform | tr A-Z a-z`$ios_sdk
2954 IOS_DEPLOYMENT_VERSION=$current_sdk_ver
2956 # LTO is not really recommended for iOS builds,
2957 # the link time will be astronomical
2958 if test "$ENABLE_LTO" = TRUE; then
2962 stdlib="-stdlib=libc++"
2964 CC="`xcrun -find clang` -arch $host_cpu -isysroot $sysroot $lto $versionmin"
2965 CXX="`xcrun -find clang++` -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
2967 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2970 STRIP=`xcrun -find strip`
2971 LIBTOOL=`xcrun -find libtool`
2972 RANLIB=`xcrun -find ranlib`
2976 AC_SUBST(IOS_DEPLOYMENT_VERSION)
2978 AC_MSG_CHECKING([whether to treat the installation as read-only])
2980 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
2981 "$enable_extensions" != yes; then
2982 enable_readonly_installset=yes
2984 if test "$enable_readonly_installset" = yes; then
2985 AC_MSG_RESULT([yes])
2986 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
2991 dnl ===================================================================
2992 dnl Structure of install set
2993 dnl ===================================================================
2995 if test $_os = Darwin; then
2996 LIBO_BIN_FOLDER=MacOS
2997 LIBO_ETC_FOLDER=Resources
2998 LIBO_LIBEXEC_FOLDER=MacOS
2999 LIBO_LIB_FOLDER=Frameworks
3000 LIBO_LIB_PYUNO_FOLDER=Resources
3001 LIBO_SHARE_FOLDER=Resources
3002 LIBO_SHARE_HELP_FOLDER=Resources/help
3003 LIBO_SHARE_JAVA_FOLDER=Resources/java
3004 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3005 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3006 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3007 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3008 LIBO_URE_BIN_FOLDER=MacOS
3009 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3010 LIBO_URE_LIB_FOLDER=Frameworks
3011 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3012 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3013 elif test $_os = WINNT; then
3014 LIBO_BIN_FOLDER=program
3015 LIBO_ETC_FOLDER=program
3016 LIBO_LIBEXEC_FOLDER=program
3017 LIBO_LIB_FOLDER=program
3018 LIBO_LIB_PYUNO_FOLDER=program
3019 LIBO_SHARE_FOLDER=share
3020 LIBO_SHARE_HELP_FOLDER=help
3021 LIBO_SHARE_JAVA_FOLDER=program/classes
3022 LIBO_SHARE_PRESETS_FOLDER=presets
3023 LIBO_SHARE_READMES_FOLDER=readmes
3024 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3025 LIBO_SHARE_SHELL_FOLDER=program/shell
3026 LIBO_URE_BIN_FOLDER=program
3027 LIBO_URE_ETC_FOLDER=program
3028 LIBO_URE_LIB_FOLDER=program
3029 LIBO_URE_MISC_FOLDER=program
3030 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3032 LIBO_BIN_FOLDER=program
3033 LIBO_ETC_FOLDER=program
3034 LIBO_LIBEXEC_FOLDER=program
3035 LIBO_LIB_FOLDER=program
3036 LIBO_LIB_PYUNO_FOLDER=program
3037 LIBO_SHARE_FOLDER=share
3038 LIBO_SHARE_HELP_FOLDER=help
3039 LIBO_SHARE_JAVA_FOLDER=program/classes
3040 LIBO_SHARE_PRESETS_FOLDER=presets
3041 LIBO_SHARE_READMES_FOLDER=readmes
3042 if test "$enable_fuzzers" != yes; then
3043 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3045 LIBO_SHARE_RESOURCE_FOLDER=resource
3047 LIBO_SHARE_SHELL_FOLDER=program/shell
3048 LIBO_URE_BIN_FOLDER=program
3049 LIBO_URE_ETC_FOLDER=program
3050 LIBO_URE_LIB_FOLDER=program
3051 LIBO_URE_MISC_FOLDER=program
3052 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3054 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3055 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3056 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3057 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3058 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3059 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3060 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3061 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3062 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3063 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3064 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3065 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3066 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3067 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3068 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3069 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3071 # Not all of them needed in config_host.mk, add more if need arises
3072 AC_SUBST(LIBO_BIN_FOLDER)
3073 AC_SUBST(LIBO_ETC_FOLDER)
3074 AC_SUBST(LIBO_LIB_FOLDER)
3075 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3076 AC_SUBST(LIBO_SHARE_FOLDER)
3077 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3078 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3079 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3080 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3081 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3082 AC_SUBST(LIBO_URE_BIN_FOLDER)
3083 AC_SUBST(LIBO_URE_ETC_FOLDER)
3084 AC_SUBST(LIBO_URE_LIB_FOLDER)
3085 AC_SUBST(LIBO_URE_MISC_FOLDER)
3086 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3088 dnl ===================================================================
3089 dnl Windows specific tests and stuff
3090 dnl ===================================================================
3094 # Return value: $regvalue
3097 local _regentry="/proc/registry${1}/${2}"
3098 if test -f "$_regentry"; then
3099 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3100 # Registry keys read via /proc/registry* are always \0 terminated!
3101 local _regvalue=$(tr -d '\0' < "$_regentry")
3102 if test $? -eq 0; then
3108 # Get a value from the 32-bit side of the Registry
3111 reg_get_value "32" "$1"
3114 # Get a value from the 64-bit side of the Registry
3117 reg_get_value "64" "$1"
3120 if test "$_os" = "WINNT"; then
3121 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3122 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3124 WINDOWS_SDK_ARCH="x86"
3126 AC_MSG_RESULT([yes])
3127 WINDOWS_SDK_ARCH="x64"
3131 if test "$_os" = "iOS"; then
3132 cross_compiling="yes"
3135 if test "$cross_compiling" = "yes"; then
3136 export CROSS_COMPILING=TRUE
3139 BUILD_TYPE="$BUILD_TYPE NATIVE"
3141 AC_SUBST(CROSS_COMPILING)
3143 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3144 if test "$GCC" = "yes"; then
3145 AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
3146 bsymbolic_functions_ldflags_save=$LDFLAGS
3147 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
3148 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3151 printf ("hello world\n");
3152 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3153 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3154 AC_MSG_RESULT( found )
3156 AC_MSG_RESULT( not found )
3158 LDFLAGS=$bsymbolic_functions_ldflags_save
3160 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3162 # Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers.
3163 # NOTE: must _not_ be used for bundled external libraries!
3165 if test "$GCC" = "yes"; then
3166 AC_MSG_CHECKING( for -isystem )
3168 CFLAGS="$CFLAGS -Werror"
3169 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3171 if test -n "$ISYSTEM"; then
3177 if test -z "$ISYSTEM"; then
3178 # fall back to using -I
3183 dnl ===================================================================
3184 dnl Check which Visual Studio compiler is used
3185 dnl ===================================================================
3187 map_vs_year_to_version()
3189 # Return value: $vsversion
3199 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3203 vs_versions_to_check()
3205 # Args: $1 (optional) : versions to check, in the order of preference
3206 # Return value: $vsversions
3210 if test -n "$1"; then
3211 map_vs_year_to_version "$1"
3212 vsversions=$vsversion
3214 # By default we prefer 2015/2017, in this order
3215 vsversions="14.0 15.0"
3219 win_get_env_from_vsvars32bat()
3221 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3222 if test $vcnum = "150"; then
3223 # Also seems to be located in another directory under the same name: vsvars32.bat
3224 # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
3225 printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3227 printf '@call "%s/../Common7/Tools/vsvars32.bat"\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
3229 printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
3230 chmod +x $WRAPPERBATCHFILEPATH
3231 _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
3232 rm -f $WRAPPERBATCHFILEPATH
3233 printf '%s' "$_win_get_env_from_vsvars32bat"
3238 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3239 if test -n "$regvalue"; then
3240 PathFormat "$regvalue"
3241 UCRTSDKDIR=$formatted_path
3242 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3243 UCRTVERSION=$regvalue
3245 if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
3249 if test -z "$UCRTSDKDIR"; then
3250 ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
3251 if test "$vcnum" = "150"; then
3252 ide_env_file="${ide_env_dir}VsDevCmd.bat"
3254 ide_env_file="${ide_env_dir}/vsvars32.bat"
3256 if test -f "$ide_env_file"; then
3257 PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
3258 UCRTSDKDIR=$formatted_path
3259 UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
3260 dnl Hack needed at least by tml:
3261 if test "$UCRTVERSION" = 10.0.15063.0 \
3262 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
3263 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
3265 UCRTVERSION=10.0.14393.0
3268 AC_MSG_ERROR([No UCRT found])
3275 # Find Visual C++ 2015/2017
3276 # Args: $1 (optional) : The VS version year
3277 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
3279 unset vctest vcnum vcnumwithdot vcbuildnumber
3281 vs_versions_to_check "$1"
3283 for ver in $vsversions; do
3284 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3285 if test -n "$regvalue"; then
3289 # As always MSVC 15.0 is special here
3290 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver
3291 if test -n "$regvalue"; then
3292 AC_MSG_RESULT([found: $regvalue])
3293 PathFormat "$regvalue"
3294 vctest=$formatted_path
3298 if test -n "$vctest"; then
3300 case "$vcnumwithdot" in
3308 vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
3317 if test "$_os" = "WINNT"; then
3318 AC_MSG_CHECKING([Visual C++])
3320 find_msvc "$with_visual_studio"
3321 if test -z "$vctest"; then
3322 if test -n "$with_visual_studio"; then
3323 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3325 AC_MSG_ERROR([No Visual Studio 2015/2017 installation found])
3329 if test "$BITNESS_OVERRIDE" = ""; then
3330 if test -f "$vctest/bin/cl.exe"; then
3331 VC_PRODUCT_DIR=$vctest
3332 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
3333 VC_PRODUCT_DIR=$vctest/VC
3335 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3338 if test -f "$vctest/bin/amd64/cl.exe"; then
3339 VC_PRODUCT_DIR=$vctest
3340 elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
3341 VC_PRODUCT_DIR=$vctest/VC
3343 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])
3347 AC_MSG_CHECKING([for short pathname of VC product directory])
3348 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3349 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3354 AC_MSG_CHECKING([for UCRT location])
3356 # find_ucrt errors out if it doesn't find it
3357 AC_MSG_RESULT([found])
3358 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3359 ucrtincpath_formatted=$formatted_path
3360 # SOLARINC is used for external modules and must be set too.
3361 # And no, it's not sufficient to set SOLARINC only, as configure
3362 # itself doesn't honour it.
3363 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3364 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3365 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3366 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3368 AC_SUBST(UCRTSDKDIR)
3369 AC_SUBST(UCRTVERSION)
3371 AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
3372 # Find the proper version of MSBuild.exe to use based on the VS version
3373 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3374 if test -n "$regvalue" ; then
3375 AC_MSG_RESULT([found: $regvalue])
3376 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3378 if test $vcnum = "150"; then
3379 if test "$BITNESS_OVERRIDE" = ""; then
3380 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
3382 regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
3384 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3386 AC_MSG_ERROR([No msbuild found, Visual Studio installation broken?])
3388 AC_MSG_RESULT([$regvalue])
3391 # Find the version of devenv.exe
3392 # MSVC 2017 devenv does not start properly from a DOS 8.3 path
3393 DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
3394 if test ! -e "$DEVENV"; then
3395 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3398 dnl ===========================================================
3399 dnl Check for the corresponding mspdb*.dll
3400 dnl ===========================================================
3406 if test "$BITNESS_OVERRIDE" = ""; then
3407 if test "$vcnum" = "150"; then
3408 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86"
3409 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX86/x86
3411 MSPDB_PATH="$VC_PRODUCT_DIR/../Common7/IDE"
3415 if test "$vcnum" = "150"; then
3416 MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64"
3417 CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX64/x64
3419 MSPDB_PATH="$VC_PRODUCT_DIR/bin/amd64"
3424 # MSVC 15.0 has libraries from 14.0?
3425 if test "$vcnum" = "150"; then
3431 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3432 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3435 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3436 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3438 dnl The path needs to be added before cl is called
3439 PATH="$MSPDB_PATH:$PATH"
3441 AC_MSG_CHECKING([cl.exe])
3443 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3444 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3445 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3448 dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
3449 dnl needed when building CLR code:
3450 if test -z "$MSVC_CXX"; then
3451 if test "$BITNESS_OVERRIDE" = ""; then
3452 if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
3453 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
3456 if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
3457 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
3461 # This gives us a posix path with 8.3 filename restrictions
3462 MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
3465 if test -z "$CC"; then
3468 if test "$BITNESS_OVERRIDE" = ""; then
3469 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3470 MSVC_CXX="$MSVC_CXX -arch:SSE"
3473 if test -n "$CC"; then
3474 # Remove /cl.exe from CC case insensitive
3475 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3476 if test "$BITNESS_OVERRIDE" = ""; then
3477 if test "$vcnum" = "150"; then
3478 COMPATH="$VC_PRODUCT_DIR"
3480 COMPATH=`echo "$CC" | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
3483 if test -n "$VC_PRODUCT_DIR"; then
3484 COMPATH=$VC_PRODUCT_DIR
3487 if test "$BITNESS_OVERRIDE" = ""; then
3488 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3492 if test "$vcnum" = "150"; then
3493 COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
3496 export INCLUDE=`cygpath -d "$COMPATH\Include"`
3498 PathFormat "$COMPATH"
3499 COMPATH="$formatted_path"
3504 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3505 # are always "better", we list them in reverse chronological order.
3510 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
3514 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
3518 # The expectation is that --with-windows-sdk should not need to be used
3519 if test -n "$with_windows_sdk"; then
3520 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3521 *" "$with_windows_sdk" "*)
3522 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3525 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3530 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3535 AC_MSG_ERROR([Visual C++ not found after all, huh])
3538 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3539 # version of the Explorer extension (and maybe other small
3540 # bits, too) needed when installing a 32-bit LibreOffice on a
3541 # 64-bit OS. The 64-bit Explorer extension is a feature that
3542 # has been present since long in OOo. Don't confuse it with
3543 # building LibreOffice itself as 64-bit code.
3549 if test "$BITNESS_OVERRIDE" = ""; then
3550 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3551 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3552 # Prefer native x64 compiler to cross-compiler, in case we are running
3553 # the build on a 64-bit OS.
3554 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3556 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3557 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3558 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3560 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3561 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3563 elif test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib"; then
3564 # nobody uses 32-bit OS to build, just pick the 64-bit compiler
3565 if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3567 CXX_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"
3568 LINK_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/link.exe"
3571 if test "$BUILD_X64" = TRUE; then
3572 AC_MSG_RESULT([found])
3574 AC_MSG_RESULT([not found])
3575 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3580 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3581 AC_SUBST(CXX_X64_BINARY)
3582 AC_SUBST(LINK_X64_BINARY)
3586 PathFormat "$MSPDB_PATH"
3587 MSPDB_PATH="$formatted_path"
3593 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3594 AC_SUBST(UNOWINREG_DLL)
3597 AC_MSG_CHECKING([whether the compiler is actually Clang])
3598 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3604 [AC_MSG_RESULT([yes])
3606 [AC_MSG_RESULT([no])])
3609 if test "$COM_IS_CLANG" = TRUE; then
3610 AC_MSG_CHECKING([the Clang version])
3611 if test "$_os" = WINNT; then
3612 dnl In which case, assume clang-cl:
3614 dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
3622 CC_PLAIN="$CC_PLAIN $i"
3629 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
3630 CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
3631 CLANGVER=`echo $clang_version \
3632 | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
3633 AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3634 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3635 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3637 AC_SUBST(COM_IS_CLANG)
3639 SHOWINCLUDES_PREFIX=
3640 if test "$_os" = WINNT; then
3641 dnl We need to guess the prefix of the -showIncludes output, it can be
3643 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3644 echo "#include <stdlib.h>" > conftest.c
3645 SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3646 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3647 rm -f conftest.c conftest.obj
3648 if test -z "$SHOWINCLUDES_PREFIX"; then
3649 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3651 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3654 AC_SUBST(SHOWINCLUDES_PREFIX)
3657 # prefix C with ccache if needed
3659 if test "$CCACHE" != ""; then
3660 AC_MSG_CHECKING([whether $CC is already ccached])
3664 CFLAGS="$CFLAGS --ccache-skip -O2"
3665 dnl an empty program will do, we're checking the compiler flags
3666 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3667 [use_ccache=yes], [use_ccache=no])
3668 if test $use_ccache = yes; then
3669 AC_MSG_RESULT([yes])
3678 # ===================================================================
3679 # check various GCC options that Clang does not support now but maybe
3680 # will somewhen in the future, check them even for GCC, so that the
3682 # ===================================================================
3685 HAVE_GCC_FINLINE_LIMIT=
3686 HAVE_GCC_FNO_INLINE=
3687 if test "$GCC" = "yes"; then
3688 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3690 CFLAGS="$CFLAGS -Werror -ggdb2"
3691 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3693 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3694 AC_MSG_RESULT([yes])
3699 AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3701 CFLAGS="$CFLAGS -Werror -finline-limit=0"
3702 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3704 if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3705 AC_MSG_RESULT([yes])
3710 AC_MSG_CHECKING([whether $CC supports -fno-inline])
3712 CFLAGS="$CFLAGS -Werror -fno-inline"
3713 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3715 if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3716 AC_MSG_RESULT([yes])
3721 if test "$host_cpu" = "m68k"; then
3722 AC_MSG_CHECKING([whether $CC supports -mlong-jump-table-offsets])
3724 CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
3725 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
3727 if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
3728 AC_MSG_RESULT([yes])
3734 AC_SUBST(HAVE_GCC_GGDB2)
3735 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3736 AC_SUBST(HAVE_GCC_FNO_INLINE)
3738 dnl ===================================================================
3739 dnl Test the gcc version
3740 dnl ===================================================================
3741 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3742 AC_MSG_CHECKING([the GCC version])
3743 _gcc_version=`$CC -dumpversion`
3744 gcc_full_version=$(printf '%s' "$_gcc_version" | \
3745 $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
3746 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3748 AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
3750 if test "$gcc_full_version" -lt 40801; then
3751 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.8.1])
3754 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3755 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3756 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3757 # (which reports itself as GCC 4.2.1).
3760 AC_SUBST(GCC_VERSION)
3762 dnl Set the ENABLE_DBGUTIL variable
3763 dnl ===================================================================
3764 AC_MSG_CHECKING([whether to build with additional debug utilities])
3765 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3766 ENABLE_DBGUTIL="TRUE"
3767 # this is an extra var so it can have different default on different MSVC
3768 # versions (in case there are version specific problems with it)
3769 MSVC_USE_DEBUG_RUNTIME="TRUE"
3771 AC_MSG_RESULT([yes])
3772 # cppunit and graphite expose STL in public headers
3773 if test "$with_system_cppunit" = "yes"; then
3774 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3776 with_system_cppunit=no
3778 if test "$with_system_graphite" = "yes"; then
3779 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3781 with_system_graphite=no
3783 if test "$with_system_mysql_cppconn" = "yes"; then
3784 AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
3786 with_system_mysql_cppconn=no
3788 if test "$with_system_orcus" = "yes"; then
3789 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3791 with_system_orcus=no
3793 if test "$with_system_libcmis" = "yes"; then
3794 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3796 with_system_libcmis=no
3798 if test "$with_system_hunspell" = "yes"; then
3799 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3801 with_system_hunspell=no
3803 if test "$with_system_gpgmepp" = "yes"; then
3804 AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
3806 with_system_gpgmepp=no
3810 MSVC_USE_DEBUG_RUNTIME=""
3813 AC_SUBST(ENABLE_DBGUTIL)
3814 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3816 dnl Set the ENABLE_DEBUG variable.
3817 dnl ===================================================================
3818 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3819 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3821 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3822 if test -z "$libo_fuzzed_enable_debug"; then
3823 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3825 AC_MSG_NOTICE([Resetting --enable-debug=yes])
3830 AC_MSG_CHECKING([whether to do a debug build])
3831 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3833 if test -n "$ENABLE_DBGUTIL" ; then
3834 AC_MSG_RESULT([yes (dbgutil)])
3836 AC_MSG_RESULT([yes])
3842 AC_SUBST(ENABLE_DEBUG)
3844 if test "$enable_sal_log" = yes; then
3847 AC_SUBST(ENABLE_SAL_LOG)
3849 dnl Selective debuginfo
3850 ENABLE_DEBUGINFO_FOR=
3851 if test -n "$ENABLE_DEBUG"; then
3852 AC_MSG_CHECKING([whether to use selective debuginfo])
3853 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3854 if test "$enable_selective_debuginfo" = "yes"; then
3855 AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
3857 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3858 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3860 ENABLE_DEBUGINFO_FOR=all
3861 AC_MSG_RESULT([no, for all])
3864 if test -n "$enable_selective_debuginfo"; then
3865 AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
3868 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3870 dnl Check for enable symbols option
3871 dnl ===================================================================
3872 AC_MSG_CHECKING([whether to generate debug information])
3873 if test -z "$enable_symbols"; then
3874 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3880 if test "$enable_symbols" != no; then
3882 AC_MSG_RESULT([yes])
3887 AC_SUBST(ENABLE_SYMBOLS)
3889 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
3890 # Building on Android with full symbols: without enough memory the linker never finishes currently.
3891 AC_MSG_CHECKING([whether enough memory is available for linking])
3892 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
3893 # Check for 15GB, as Linux reports a bit less than the physical memory size.
3894 if test -n "$mem_size" -a $mem_size -lt 15728640; then
3895 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
3897 AC_MSG_RESULT([yes])
3901 AC_MSG_CHECKING([whether to compile with optimization flags])
3902 if test -z "$enable_optimized"; then
3903 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3906 enable_optimized=yes
3909 if test "$enable_optimized" != no; then
3910 ENABLE_OPTIMIZED=TRUE
3911 AC_MSG_RESULT([yes])
3916 AC_SUBST(ENABLE_OPTIMIZED)
3919 # determine CPUNAME, OS, ...
3920 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
3931 PLATFORMID=aix_powerpc
3940 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
3947 if test "$BITNESS_OVERRIDE" = 64; then
3950 PLATFORMID=windows_x86_64
3952 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
3956 PLATFORMID=windows_x86
3960 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3963 SCPDEFS="$SCPDEFS -D_MSC_VER"
3975 AC_MSG_ERROR([Can't build 32-bit code for iOS])
3979 if test "$enable_ios_simulator" = "yes"; then
3980 AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
3984 PLATFORMID=ios_arm64
3988 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
3991 if test "$enable_ios_simulator" = "yes"; then
3996 PLATFORMID=macosx_x86_64
3999 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4015 PLATFORMID=dragonfly_x86
4020 PLATFORMID=dragonfly_x86_64
4023 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4039 PLATFORMID=freebsd_x86
4044 PLATFORMID=freebsd_x86_64
4047 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4064 PLATFORMID=haiku_x86
4069 PLATFORMID=haiku_x86_64
4072 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4089 PLATFORMID=kfreebsd_x86
4094 PLATFORMID=kfreebsd_x86_64
4097 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4113 PLATFORMID=linux_aarch64
4119 PLATFORMID=linux_alpha
4125 PLATFORMID=linux_arm_eabi
4129 PLATFORMID=linux_arm_oabi
4137 PLATFORMID=linux_hppa
4142 PLATFORMID=linux_x86
4147 PLATFORMID=linux_ia64
4153 PLATFORMID=linux_mips_eb
4158 EPM_FLAGS="-a mips64"
4159 PLATFORMID=linux_mips64_eb
4164 EPM_FLAGS="-a mips64el"
4165 PLATFORMID=linux_mips64_el
4170 EPM_FLAGS="-a mipsel"
4171 PLATFORMID=linux_mips_el
4176 PLATFORMID=linux_m68k
4181 PLATFORMID=linux_powerpc
4186 PLATFORMID=linux_powerpc64
4190 RTL_ARCH=PowerPC_64_LE
4191 PLATFORMID=linux_powerpc64_le
4196 PLATFORMID=linux_sparc
4201 PLATFORMID=linux_sparc64
4206 PLATFORMID=linux_s390
4211 PLATFORMID=linux_s390x
4216 PLATFORMID=linux_x86_64
4219 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4236 PLATFORMID=android_arm_eabi
4241 PLATFORMID=android_aarch64
4244 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4246 PLATFORMID=android_mips_el
4251 PLATFORMID=android_x86
4254 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4270 PLATFORMID=netbsd_x86
4275 PLATFORMID=netbsd_powerpc
4280 PLATFORMID=netbsd_sparc
4285 PLATFORMID=netbsd_x86_64
4288 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4304 PLATFORMID=openbsd_x86
4309 PLATFORMID=openbsd_x86_64
4312 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4315 SOLARINC="$SOLARINC -I/usr/local/include"
4329 PLATFORMID=solaris_x86
4334 PLATFORMID=solaris_sparc
4339 PLATFORMID=solaris_sparc64
4342 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4345 SOLARINC="$SOLARINC -I/usr/local/include"
4349 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4353 if test "$with_x" = "no"; then
4354 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4358 if test "$enable_gui" = "no"; then
4359 if test "$USING_X11" != TRUE; then
4360 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4363 ENABLE_HEADLESS=TRUE
4364 AC_DEFINE(HAVE_FEATURE_UI,0)
4367 AC_SUBST(ENABLE_HEADLESS)
4369 WORKDIR="${BUILDDIR}/workdir"
4370 INSTDIR="${BUILDDIR}/instdir"
4371 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
4372 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
4373 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
4381 AC_SUBST([INSTROOT])
4382 AC_SUBST([INSTROOTBASE])
4386 AC_SUBST(PLATFORMID)
4387 AC_SUBST(WINDOWS_X64)
4388 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4390 dnl ===================================================================
4391 dnl Test which package format to use
4392 dnl ===================================================================
4393 AC_MSG_CHECKING([which package format to use])
4394 if test -n "$with_package_format" -a "$with_package_format" != no; then
4395 for i in $with_package_format; do
4397 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4400 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4401 aix - AIX software distribution
4402 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4403 deb - Debian software distribution
4404 pkg - Solaris software distribution
4405 rpm - RedHat software distribution
4407 LibreOffice additionally supports:
4408 archive - .tar.gz or .zip
4410 installed - installation tree
4416 # fakeroot is needed to ensure correct file ownerships/permissions
4417 # inside deb packages and tar archives created on Linux and Solaris.
4418 if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
4419 AC_PATH_PROG(FAKEROOT, fakeroot, no)
4420 if test "$FAKEROOT" = "no"; then
4422 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
4425 PKGFORMAT="$with_package_format"
4426 AC_MSG_RESULT([$PKGFORMAT])
4429 AC_MSG_RESULT([none])
4433 dnl ===================================================================
4434 dnl Set up a different compiler to produce tools to run on the build
4435 dnl machine when doing cross-compilation
4436 dnl ===================================================================
4438 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4439 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4440 if test "$cross_compiling" = "yes"; then
4441 AC_MSG_CHECKING([for BUILD platform configuration])
4443 rm -rf CONF-FOR-BUILD config_build.mk
4444 mkdir CONF-FOR-BUILD
4445 # Here must be listed all files needed when running the configure script. In particular, also
4446 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4447 # keep them in the same order as there.
4448 (cd $SRC_ROOT && tar cf - \
4450 bin/get_config_variables \
4451 solenv/bin/getcompver.awk \
4452 solenv/inc/langlist.mk \
4455 config_host_lang.mk.in \
4458 bin/bffvalidator.sh.in \
4459 bin/odfvalidator.sh.in \
4460 bin/officeotron.sh.in \
4461 instsetoo_native/util/openoffice.lst.in \
4463 sysui/desktop/macosx/Info.plist.in) \
4464 | (cd CONF-FOR-BUILD && tar xf -)
4465 cp configure CONF-FOR-BUILD
4466 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4468 unset COM USING_X11 OS CPUNAME
4469 unset CC CXX SYSBASE CFLAGS
4470 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4471 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4472 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4473 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4474 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4475 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4478 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4479 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4480 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4481 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4482 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4483 test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
4484 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4485 # Don't bother having configure look for stuff not needed for the build platform anyway
4489 --disable-pdfimport \
4490 --disable-postgresql-sdbc \
4491 --with-parallelism="$with_parallelism" \
4496 2>&1 | sed -e 's/^/ /'
4497 test -f ./config_host.mk 2>/dev/null || exit
4498 cp config_host.mk ../config_build.mk
4499 cp config_host_lang.mk ../config_build_lang.mk
4500 mv config.log ../config.Build.log
4501 mkdir -p ../config_build
4502 mv config_host/*.h ../config_build
4503 . ./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
4505 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
4507 VV=`eval "echo $VV"`
4508 if test -n "$VV"; then
4509 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4510 echo "$line" >>build-config
4514 for V in INSTDIR INSTROOT WORKDIR; do
4516 VV=`eval "echo $VV"`
4517 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4518 if test -n "$VV"; then
4519 line="${V}_FOR_BUILD='$VV'"
4520 echo "$line" >>build-config
4524 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4525 echo "$line" >>build-config
4528 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4529 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])
4530 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4531 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4533 eval `cat CONF-FOR-BUILD/build-config`
4535 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4537 rm -rf CONF-FOR-BUILD
4541 CXX_FOR_BUILD="$CXX"
4542 INSTDIR_FOR_BUILD="$INSTDIR"
4543 INSTROOT_FOR_BUILD="$INSTROOT"
4544 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4545 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4546 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4547 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4548 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4549 WORKDIR_FOR_BUILD="$WORKDIR"
4551 AC_SUBST(OS_FOR_BUILD)
4552 AC_SUBST(INSTDIR_FOR_BUILD)
4553 AC_SUBST(INSTROOT_FOR_BUILD)
4554 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4555 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4556 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4557 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4558 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4559 AC_SUBST(WORKDIR_FOR_BUILD)
4561 dnl ===================================================================
4562 dnl Check for syslog header
4563 dnl ===================================================================
4564 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4566 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4567 dnl ===================================================================
4568 AC_MSG_CHECKING([whether to turn warnings to errors])
4569 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4570 ENABLE_WERROR="TRUE"
4571 AC_MSG_RESULT([yes])
4573 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4574 ENABLE_WERROR="TRUE"
4575 AC_MSG_RESULT([yes])
4580 AC_SUBST(ENABLE_WERROR)
4582 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
4583 dnl ===================================================================
4584 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
4585 if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
4586 ASSERT_ALWAYS_ABORT="TRUE"
4587 AC_MSG_RESULT([yes])
4589 ASSERT_ALWAYS_ABORT="FALSE"
4592 AC_SUBST(ASSERT_ALWAYS_ABORT)
4594 # Determine whether to use ooenv for the instdir installation
4595 # ===================================================================
4596 if test $_os != "WINNT" -a $_os != "Darwin"; then
4597 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4598 if test "$enable_ooenv" = "no"; then
4602 AC_MSG_RESULT([yes])
4605 AC_SUBST(ENABLE_OOENV)
4607 if test "$USING_X11" != TRUE; then
4608 # be sure to do not mess with unneeded stuff
4614 build_gstreamer_1_0=no
4615 build_gstreamer_0_10=no
4620 enable_cairo_canvas=no
4623 if test "$OS" = "HAIKU"; then
4624 enable_cairo_canvas=yes
4627 dnl ===================================================================
4628 dnl check for cups support
4629 dnl ===================================================================
4632 if test "$enable_cups" = "no"; then
4636 AC_MSG_CHECKING([whether to enable CUPS support])
4637 if test "$test_cups" = "yes"; then
4639 AC_MSG_RESULT([yes])
4641 AC_MSG_CHECKING([whether cups support is present])
4642 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4643 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4644 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4645 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4652 AC_SUBST(ENABLE_CUPS)
4655 if test "$test_fontconfig" = "yes"; then
4656 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4657 SYSTEM_FONTCONFIG=TRUE
4658 FilterLibs "${FONTCONFIG_LIBS}"
4659 FONTCONFIG_LIBS="${filteredlibs}"
4661 AC_SUBST(FONTCONFIG_CFLAGS)
4662 AC_SUBST(FONTCONFIG_LIBS)
4663 AC_SUBST([SYSTEM_FONTCONFIG])
4665 dnl whether to find & fetch external tarballs?
4666 dnl ===================================================================
4667 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4668 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4669 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4671 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4674 if test -z "$TARFILE_LOCATION"; then
4675 if test -d "$SRC_ROOT/src" ; then
4676 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4677 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4679 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4681 AbsolutePath "$TARFILE_LOCATION"
4682 PathFormat "${absolute_path}"
4683 TARFILE_LOCATION="${formatted_path}"
4685 AC_SUBST(TARFILE_LOCATION)
4687 AC_MSG_CHECKING([whether we want to fetch tarballs])
4688 if test "$enable_fetch_external" != "no"; then
4689 if test "$with_all_tarballs" = "yes"; then
4690 AC_MSG_RESULT([yes, all of them])
4691 DO_FETCH_TARBALLS="ALL"
4693 AC_MSG_RESULT([yes, if we use them])
4694 DO_FETCH_TARBALLS="TRUE"
4700 AC_SUBST(DO_FETCH_TARBALLS)
4702 AC_MSG_CHECKING([whether to build help])
4703 HELP_COMMON_ONLY=FALSE
4704 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4705 BUILD_TYPE="$BUILD_TYPE HELP"
4706 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4707 case "$with_help" in
4709 HELP_COMMON_ONLY=TRUE
4710 AC_MSG_RESULT([common only])
4713 ENABLE_HTMLHELP=TRUE
4714 AC_MSG_RESULT([HTML])
4717 ENABLE_HTMLHELP=TRUE
4719 AC_MSG_RESULT([HTML])
4722 SCPDEFS="$SCPDEFS -DWITH_HELP"
4723 AC_MSG_RESULT([yes])
4729 AC_SUBST([ENABLE_HTMLHELP])
4730 AC_SUBST(HELP_COMMON_ONLY)
4731 AC_SUBST([HELP_ONLINE])
4733 dnl Test whether to include MySpell dictionaries
4734 dnl ===================================================================
4735 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4736 if test "$with_myspell_dicts" = "yes"; then
4737 AC_MSG_RESULT([yes])
4738 WITH_MYSPELL_DICTS=TRUE
4739 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4740 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4745 AC_SUBST(WITH_MYSPELL_DICTS)
4747 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
4748 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4749 if test "$with_system_dicts" = yes; then
4750 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4752 with_system_dicts=no
4755 AC_MSG_CHECKING([whether to use dicts from external paths])
4756 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4757 AC_MSG_RESULT([yes])
4759 AC_MSG_CHECKING([for spelling dictionary directory])
4760 if test -n "$with_external_dict_dir"; then
4761 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4763 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4764 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4765 DICT_SYSTEM_DIR=file:///usr/share/myspell
4768 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4769 AC_MSG_CHECKING([for hyphenation patterns directory])
4770 if test -n "$with_external_hyph_dir"; then
4771 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4773 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4775 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4776 AC_MSG_CHECKING([for thesaurus directory])
4777 if test -n "$with_external_thes_dir"; then
4778 THES_SYSTEM_DIR=file://$with_external_thes_dir
4780 THES_SYSTEM_DIR=file:///usr/share/mythes
4782 AC_MSG_RESULT([$THES_SYSTEM_DIR])
4787 AC_SUBST(SYSTEM_DICTS)
4788 AC_SUBST(DICT_SYSTEM_DIR)
4789 AC_SUBST(HYPH_SYSTEM_DIR)
4790 AC_SUBST(THES_SYSTEM_DIR)
4792 dnl ===================================================================
4793 dnl enable pch by default on windows
4794 dnl enable it explicitly otherwise
4796 if test "$enable_pch" = yes -a "$enable_compiler_plugins" = yes; then
4797 if test -z "$libo_fuzzed_enable_pch"; then
4798 AC_MSG_ERROR([--enable-pch cannot be used with --enable-compiler-plugins])
4800 AC_MSG_NOTICE([Resetting --enable-pch=no])
4805 AC_MSG_CHECKING([whether to enable pch feature])
4806 if test "$enable_pch" != "no"; then
4807 if test "$_os" = "WINNT"; then
4809 AC_MSG_RESULT([yes])
4810 elif test -n "$enable_pch" && test "$GCC" = "yes"; then
4812 AC_MSG_RESULT([yes])
4813 elif test -n "$enable_pch"; then
4814 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
4821 AC_SUBST(ENABLE_PCH)
4825 AC_MSG_CHECKING([the GNU Make version])
4826 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4827 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4828 if test "$_make_longver" -ge "038200"; then
4829 AC_MSG_RESULT([$GNUMAKE $_make_version])
4831 elif test "$_make_longver" -ge "038100"; then
4832 if test "$build_os" = "cygwin"; then
4833 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4835 AC_MSG_RESULT([$GNUMAKE $_make_version])
4837 dnl ===================================================================
4838 dnl Search all the common names for sha1sum
4839 dnl ===================================================================
4840 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
4841 if test -z "$SHA1SUM"; then
4842 AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
4843 elif test "$SHA1SUM" = "openssl"; then
4844 SHA1SUM="openssl sha1"
4846 AC_MSG_CHECKING([for GNU Make bug 20033])
4847 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4848 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
4849 A := \$(wildcard *.a)
4853 <TAB>@echo survived bug20033.
4857 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
4870 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
4871 <TAB>\$(call d1,\$(CHECKSUM)),\
4872 <TAB>\$(call d2,\$(CHECKSUM)))
4874 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
4875 no_parallelism_make="YES"
4876 AC_MSG_RESULT([yes, disable parallelism])
4878 AC_MSG_RESULT([no, keep parallelism enabled])
4880 rm -rf $TESTGMAKEBUG20033
4882 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
4885 # find if gnumake support file function
4886 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
4887 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
4888 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4889 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
4891 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
4892 \$(file >test.txt,Success )
4899 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
4900 if test -f $TESTGMAKEFILEFUNC/test.txt; then
4901 HAVE_GNUMAKE_FILE_FUNC=TRUE
4902 AC_MSG_RESULT([yes])
4906 rm -rf $TESTGMAKEFILEFUNC
4907 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
4908 AC_SUBST(GNUMAKE_WIN_NATIVE)
4910 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
4912 if test "$_make_ver_check" = ""; then
4916 HAVE_LD_HASH_STYLE=FALSE
4917 WITH_LINKER_HASH_STYLE=
4918 AC_MSG_CHECKING([for --hash-style gcc linker support])
4919 if test "$GCC" = "yes"; then
4920 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
4921 hash_styles="gnu sysv"
4922 elif test "$with_linker_hash_style" = "no"; then
4925 hash_styles="$with_linker_hash_style"
4928 for hash_style in $hash_styles; do
4929 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4930 hash_style_ldflags_save=$LDFLAGS
4931 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
4933 AC_RUN_IFELSE([AC_LANG_PROGRAM(
4940 HAVE_LD_HASH_STYLE=TRUE
4941 WITH_LINKER_HASH_STYLE=$hash_style
4943 [HAVE_LD_HASH_STYLE=FALSE],
4944 [HAVE_LD_HASH_STYLE=FALSE])
4945 LDFLAGS=$hash_style_ldflags_save
4948 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
4949 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
4953 LDFLAGS=$hash_style_ldflags_save
4957 AC_SUBST(HAVE_LD_HASH_STYLE)
4958 AC_SUBST(WITH_LINKER_HASH_STYLE)
4960 dnl ===================================================================
4961 dnl Check whether there's a Perl version available.
4962 dnl ===================================================================
4963 if test -z "$with_perl_home"; then
4964 AC_PATH_PROG(PERL, perl)
4966 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
4967 _perl_path="$with_perl_home/bin/perl"
4968 if test -x "$_perl_path"; then
4971 AC_MSG_ERROR([$_perl_path not found])
4975 dnl ===================================================================
4976 dnl Testing for Perl version 5 or greater.
4977 dnl $] is the Perl version variable, it is returned as an integer
4978 dnl ===================================================================
4979 if test "$PERL"; then
4980 AC_MSG_CHECKING([the Perl version])
4981 ${PERL} -e "exit($]);"
4983 if test "$_perl_version" -lt 5; then
4984 AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
4986 AC_MSG_RESULT([Perl $_perl_version])
4988 AC_MSG_ERROR([Perl not found, install Perl 5])
4991 dnl ===================================================================
4992 dnl Testing for required Perl modules
4993 dnl ===================================================================
4995 AC_MSG_CHECKING([for required Perl modules])
4996 perl_use_string="use Cwd ; use Digest::MD5"
4997 if test "$_os" = "WINNT"; then
4998 if test -n "$PKGFORMAT"; then
4999 for i in "$PKGFORMAT"; do
5002 # for getting fonts versions to use in MSI
5003 perl_use_string="$perl_use_string ; use Font::TTF::Font"
5009 if `$PERL -e '$perl_use_string'>/dev/null 2>&1`; then
5010 AC_MSG_RESULT([all modules found])
5012 AC_MSG_RESULT([failed to find some modules])
5013 # Find out which modules are missing.
5014 for i in "$perl_use_string"; do
5015 if test "$i" != "use" -a "$i" != ";"; then
5016 if ! `$PERL -e 'use $i;'>/dev/null 2>&1`; then
5017 missing_perl_modules="$missing_perl_modules $i"
5022 The missing Perl modules are: $missing_perl_modules
5023 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5026 dnl ===================================================================
5027 dnl Check for pkg-config
5028 dnl ===================================================================
5029 if test "$_os" != "WINNT"; then
5033 if test "$_os" != "WINNT"; then
5035 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5036 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5037 # explicitly. Or put /path/to/compiler in PATH yourself.
5039 # Use wrappers for LTO
5040 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5041 AC_CHECK_TOOL(AR,gcc-ar)
5042 AC_CHECK_TOOL(NM,gcc-nm)
5043 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5045 AC_CHECK_TOOL(AR,ar)
5046 AC_CHECK_TOOL(NM,nm)
5047 AC_CHECK_TOOL(RANLIB,ranlib)
5049 AC_CHECK_TOOL(OBJDUMP,objdump)
5050 AC_CHECK_TOOL(READELF,readelf)
5051 AC_CHECK_TOOL(STRIP,strip)
5052 if test "$_os" = "WINNT"; then
5053 AC_CHECK_TOOL(DLLTOOL,dlltool)
5054 AC_CHECK_TOOL(WINDRES,windres)
5061 AC_SUBST(PKG_CONFIG)
5067 dnl ===================================================================
5068 dnl pkg-config checks on Mac OS X
5069 dnl ===================================================================
5071 if test $_os = Darwin; then
5072 AC_MSG_CHECKING([for bogus pkg-config])
5073 if test -n "$PKG_CONFIG"; then
5074 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5075 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5077 if test "$enable_bogus_pkg_config" = "yes"; then
5078 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5080 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.])
5084 AC_MSG_RESULT([no, good])
5090 # Return value: $csctest
5094 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5095 if test -n "$regvalue"; then
5103 # Return value: $altest
5107 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5108 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5109 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5115 # We need this additional check to detect 4.6.1 or above.
5116 for ver in 4.7 4.6.2 4.6.1; do
5117 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
5118 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5123 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools"
5124 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5133 # Return value: $frametest (that's a silly name...)
5137 for ver in 1.1 2.0; do
5138 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv$ver
5139 if test -n "$regvalue"; then
5150 for ver in 4.7 4.6.2 4.6.1 4.6; do
5151 reg_get_value_64 "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5152 if test -n "$regvalue"; then
5156 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5157 if test -n "$regvalue"; then
5164 find_winsdk_version()
5166 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5167 # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
5169 unset winsdktest winsdkbinsubdir winsdklibsubdir
5173 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5174 if test -n "$regvalue"; then
5175 winsdktest=$regvalue
5181 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5182 if test -n "$regvalue"; then
5183 winsdktest=$regvalue
5184 winsdklibsubdir=win8
5189 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5190 if test -n "$regvalue"; then
5191 winsdktest=$regvalue
5192 winsdklibsubdir=winv6.3
5197 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5198 if test -n "$regvalue"; then
5199 winsdktest=$regvalue
5200 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5201 if test -n "$regvalue"; then
5202 winsdkbinsubdir="$regvalue".0
5204 winsdklibsubdir=$regvalue
5205 if test "$regvalue" = "10.0.14393"; then
5206 winsdklibsubdir="10.0.14393.0"
5207 elif test "$regvalue" = "10.0.16299"; then
5208 winsdklibsubdir="10.0.16299.0"
5209 elif test "$regvalue" = "10.0.15063"; then
5210 winsdklibsubdir="10.0.15063.0"
5211 dnl Hack needed at least by tml:
5212 if test ! -f "${winsdktest}/Include/10.0.15063.0/um/sqlext.h" \
5213 -a -f "${winsdktest}/Include/10.0.14393.0/um/sqlext.h"
5215 winsdklibsubdir="10.0.14393.0"
5226 # Return value: From find_winsdk_version
5230 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5231 find_winsdk_version $ver
5232 if test -n "$winsdktest"; then
5240 my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
5241 if test $VCVER = 150; then
5242 my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
5244 AC_MSG_CHECKING([for ${my_msm_files}])
5246 for ver in 14.0 15.0; do
5247 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5248 if test -n "$regvalue"; then
5249 for f in ${my_msm_files}; do
5250 if test -e "$regvalue/${f}"; then
5257 dnl Is the following fallback really necessary, or was it added in response
5258 dnl to never having started Visual Studio on a given machine, so the
5259 dnl registry keys checked above had presumably not yet been created?
5260 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5261 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5262 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5263 dnl expanding to "C:\Program Files\Common Files"), which would need
5264 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5265 dnl obtain its value from cygwin:
5266 if test -z "$msmdir"; then
5267 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5268 for f in ${my_msm_files}; do
5269 if test -e "$my_msm_dir/${f}"; then
5275 dnl Starting from MSVC 15.0, merge modules are located in different directory
5276 if test $VCVER = 150; then
5277 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5278 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])
5279 my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
5280 for f in ${my_msm_files}; do
5281 if test -e "$my_msm_dir/${f}"; then
5289 if test -n "$msmdir"; then
5290 msmdir=`cygpath -m "$msmdir"`
5291 AC_MSG_RESULT([$msmdir])
5293 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5294 AC_MSG_ERROR([not found])
5296 AC_MSG_WARN([not found])
5297 add_warning "MSM none of ${my_msm_files} found"
5302 find_msvc_x64_dlls()
5304 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5305 if test "$VCVER" = 150; then
5306 for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
5307 AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT])
5308 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
5309 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
5312 if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
5313 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
5318 msvcdlls="msvcp140.dll vcruntime140.dll"
5319 for dll in $msvcdlls; do
5320 if ! test -f "$msvcdllpath/$dll"; then
5321 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5326 dnl =========================================
5327 dnl Check for the Windows SDK.
5328 dnl =========================================
5329 if test "$_os" = "WINNT"; then
5330 AC_MSG_CHECKING([for Windows SDK])
5331 if test "$build_os" = "cygwin"; then
5333 WINDOWS_SDK_HOME=$winsdktest
5335 # normalize if found
5336 if test -n "$WINDOWS_SDK_HOME"; then
5337 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
5338 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
5341 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
5344 if test -n "$WINDOWS_SDK_HOME"; then
5345 # Remove a possible trailing backslash
5346 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
5348 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
5349 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
5350 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
5351 have_windows_sdk_headers=yes
5352 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
5353 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
5354 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
5355 have_windows_sdk_headers=yes
5356 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
5357 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
5358 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
5359 have_windows_sdk_headers=yes
5361 have_windows_sdk_headers=no
5364 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
5365 have_windows_sdk_libs=yes
5366 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
5367 have_windows_sdk_libs=yes
5369 have_windows_sdk_libs=no
5372 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
5373 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
5374 the Windows SDK are installed.])
5378 if test -z "$WINDOWS_SDK_HOME"; then
5379 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
5380 elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
5381 WINDOWS_SDK_VERSION=70
5382 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
5383 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
5384 WINDOWS_SDK_VERSION=80
5385 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
5386 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
5387 WINDOWS_SDK_VERSION=81
5388 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
5389 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
5390 WINDOWS_SDK_VERSION=10
5391 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
5393 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
5395 PathFormat "$WINDOWS_SDK_HOME"
5396 WINDOWS_SDK_HOME="$formatted_path"
5397 if test "$build_os" = "cygwin"; then
5398 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
5399 if test -d "$WINDOWS_SDK_HOME/include/um"; then
5400 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
5401 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
5402 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
5406 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
5407 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
5408 dnl but not in v8.0), so allow this to be overridden with a
5409 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
5410 dnl and configuration error if no WiLangId.vbs is found would arguably be
5411 dnl better, but I do not know under which conditions exactly it is needed by
5413 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
5414 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
5415 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5416 WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
5418 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5419 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
5421 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5422 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
5425 if test -n "$with_lang" -a "$with_lang" != "en-US"; then
5426 if test -n "$with_package_format" -a "$with_package_format" != no; then
5427 for i in "$with_package_format"; do
5428 if test "$i" = "msi"; then
5429 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
5430 AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
5437 AC_SUBST(WINDOWS_SDK_HOME)
5438 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
5439 AC_SUBST(WINDOWS_SDK_VERSION)
5440 AC_SUBST(WINDOWS_SDK_WILANGID)
5442 if test "$build_os" = "cygwin"; then
5443 dnl Check midl.exe; this being the first check for a tool in the SDK bin
5444 dnl dir, it also determines that dir's path w/o an arch segment if any,
5445 dnl WINDOWS_SDK_BINDIR_NO_ARCH:
5446 AC_MSG_CHECKING([for midl.exe])
5449 if test -n "$winsdkbinsubdir" \
5450 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
5452 MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
5453 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
5454 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5455 MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
5456 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5457 elif test -f "$winsdktest/Bin/midl.exe"; then
5458 MIDL_PATH=$winsdktest/Bin
5459 WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
5461 if test ! -f "$MIDL_PATH/midl.exe"; then
5462 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5464 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5467 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5468 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5470 if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
5471 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
5472 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
5473 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
5474 elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
5475 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
5476 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5477 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
5478 elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
5479 -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
5480 -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
5481 -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
5483 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
5487 AC_MSG_CHECKING([for csc.exe])
5489 if test -f "$csctest/csc.exe"; then
5492 if test ! -f "$CSC_PATH/csc.exe"; then
5493 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5495 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5498 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5501 AC_MSG_CHECKING([for al.exe])
5503 if test -n "$winsdkbinsubdir" \
5504 -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
5506 AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
5507 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5508 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5509 elif test -f "$winsdktest/Bin/al.exe"; then
5510 AL_PATH="$winsdktest/Bin"
5513 if test -z "$AL_PATH"; then
5515 if test -f "$altest/bin/al.exe"; then
5516 AL_PATH="$altest/bin"
5517 elif test -f "$altest/al.exe"; then
5521 if test ! -f "$AL_PATH/al.exe"; then
5522 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5524 AC_MSG_RESULT([$AL_PATH/al.exe])
5527 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5529 dnl Check mscoree.lib / .NET Framework dir
5530 AC_MSG_CHECKING(.NET Framework)
5532 if test -f "$frametest/lib/mscoree.lib"; then
5533 DOTNET_FRAMEWORK_HOME="$frametest"
5536 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5537 DOTNET_FRAMEWORK_HOME="$winsdktest"
5540 PathFormat "$frametest"
5541 frametest="$formatted_path"
5542 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5543 DOTNET_FRAMEWORK_HOME="$frametest"
5548 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
5549 AC_MSG_ERROR([mscoree.lib not found])
5551 AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
5553 PathFormat "$MIDL_PATH"
5554 MIDL_PATH="$formatted_path"
5556 PathFormat "$AL_PATH"
5557 AL_PATH="$formatted_path"
5559 PathFormat "$DOTNET_FRAMEWORK_HOME"
5560 DOTNET_FRAMEWORK_HOME="$formatted_path"
5562 PathFormat "$CSC_PATH"
5563 CSC_PATH="$formatted_path"
5566 dnl ===================================================================
5567 dnl Check if stdc headers are available excluding MSVC.
5568 dnl ===================================================================
5569 if test "$_os" != "WINNT"; then
5573 dnl ===================================================================
5574 dnl Testing for C++ compiler and version...
5575 dnl ===================================================================
5577 if test "$_os" != "WINNT"; then
5578 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5579 save_CXXFLAGS=$CXXFLAGS
5581 CXXFLAGS=$save_CXXFLAGS
5583 if test -n "$CC" -a -z "$CXX"; then
5588 dnl At least MSVC 2015 Update 1 is known to sporadically emit warning C4592
5589 dnl ("implementation limitation" when defining OUStringLiteral variables in
5590 dnl vcl/source/app/IconThemeInfo.cxx), while Update 3 is known good, and it is
5591 dnl probably a good idea to require that anyway. A reliable way to check for
5592 dnl MSVC 2015 Update 3 appears to be to check for support of C++17 nested
5593 dnl namespace definitions (which requires /std:c++latest to be enabled):
5594 if test "$COM" = MSC -a "$VCVER" = 140; then
5595 AC_MSG_CHECKING([whether MSVC 2015 compiler $MSVC_CXX is at least Update 3])
5597 save_CXXFLAGS=$CXXFLAGS
5599 CXXFLAGS="$CXXFLAGS /std:c++latest"
5601 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5603 ]])], [good=yes], [good=no])
5606 CXXFLAGS=$save_CXXFLAGS
5607 AC_MSG_RESULT([$good])
5608 if test "$good" = no; then
5609 AC_MSG_ERROR([When using MSVC 2015, at least Update 3 must be installed])
5613 dnl check for GNU C++ compiler version
5614 if test "$GXX" = "yes"; then
5615 AC_MSG_CHECKING([the GNU C++ compiler version])
5617 _gpp_version=`$CXX -dumpversion`
5618 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5620 if test "$_gpp_majmin" -lt "401"; then
5621 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
5623 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5626 dnl see https://code.google.com/p/android/issues/detail?id=41770
5627 if test "$_gpp_majmin" -ge "401"; then
5631 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5632 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5633 #include <bits/c++config.h>]],[[
5634 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5635 && !defined(_GLIBCXX__PTHREADS) \
5636 && !defined(_GLIBCXX_HAS_GTHREADS)
5639 ]])],[AC_MSG_RESULT([yes])
5640 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5642 if test $glibcxx_threads = yes; then
5643 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5647 AC_SUBST(BOOST_CXXFLAGS)
5650 # prefx CXX with ccache if needed
5652 if test "$CCACHE" != ""; then
5653 AC_MSG_CHECKING([whether $CXX is already ccached])
5655 save_CXXFLAGS=$CXXFLAGS
5656 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5657 dnl an empty program will do, we're checking the compiler flags
5658 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5659 [use_ccache=yes], [use_ccache=no])
5660 if test $use_ccache = yes; then
5661 AC_MSG_RESULT([yes])
5666 CXXFLAGS=$save_CXXFLAGS
5670 dnl ===================================================================
5671 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5672 dnl ===================================================================
5674 if test "$_os" != "WINNT"; then
5677 dnl Check whether there's a C pre-processor.
5682 dnl ===================================================================
5683 dnl Find integral type sizes and alignments
5684 dnl ===================================================================
5686 if test "$_os" != "WINNT"; then
5688 if test "$_os" == "iOS"; then
5689 AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
5691 ac_cv_sizeof_short=2
5693 ac_cv_sizeof_long_long=8
5694 ac_cv_sizeof_double=8
5695 ac_cv_sizeof_voidp=8
5697 AC_CHECK_SIZEOF(long)
5698 AC_CHECK_SIZEOF(short)
5699 AC_CHECK_SIZEOF(int)
5700 AC_CHECK_SIZEOF(long long)
5701 AC_CHECK_SIZEOF(double)
5702 AC_CHECK_SIZEOF(void*)
5705 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5706 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5707 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5708 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5709 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5711 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5712 m4_pattern_allow([AC_CHECK_ALIGNOF])
5713 m4_ifdef([AC_CHECK_ALIGNOF],
5715 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5716 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5717 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5718 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5721 case "$_os-$host_cpu" in
5723 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5724 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5725 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5726 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5729 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5730 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5731 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5732 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5735 if test -z "$ac_cv_alignof_short" -o \
5736 -z "$ac_cv_alignof_int" -o \
5737 -z "$ac_cv_alignof_long" -o \
5738 -z "$ac_cv_alignof_double"; then
5739 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.])
5745 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5746 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5747 if test $ac_cv_sizeof_long -eq 8; then
5748 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5749 elif test $ac_cv_sizeof_double -eq 8; then
5750 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5752 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5755 dnl Check for large file support
5757 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5758 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5760 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5761 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5765 SAL_TYPES_SIZEOFSHORT=2
5766 SAL_TYPES_SIZEOFINT=4
5767 SAL_TYPES_SIZEOFLONG=4
5768 SAL_TYPES_SIZEOFLONGLONG=8
5769 if test "$BITNESS_OVERRIDE" = ""; then
5770 SAL_TYPES_SIZEOFPOINTER=4
5772 SAL_TYPES_SIZEOFPOINTER=8
5774 SAL_TYPES_ALIGNMENT2=2
5775 SAL_TYPES_ALIGNMENT4=4
5776 SAL_TYPES_ALIGNMENT8=8
5779 AC_SUBST(LFS_CFLAGS)
5781 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5782 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5783 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5784 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5785 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5786 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5787 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5788 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5790 dnl ===================================================================
5791 dnl Check whether to enable runtime optimizations
5792 dnl ===================================================================
5793 ENABLE_RUNTIME_OPTIMIZATIONS=
5794 AC_MSG_CHECKING([whether to enable runtime optimizations])
5795 if test -z "$enable_runtime_optimizations"; then
5799 enable_runtime_optimizations=no
5805 if test "$enable_runtime_optimizations" != no; then
5806 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
5807 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
5808 AC_MSG_RESULT([yes])
5812 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
5814 dnl ===================================================================
5815 dnl Check if valgrind headers are available
5816 dnl ===================================================================
5818 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
5819 prev_cppflags=$CPPFLAGS
5820 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5821 # or where does it come from?
5822 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5823 AC_CHECK_HEADER([valgrind/valgrind.h],
5824 [ENABLE_VALGRIND=TRUE])
5825 CPPFLAGS=$prev_cppflags
5827 AC_SUBST([ENABLE_VALGRIND])
5828 if test -z "$ENABLE_VALGRIND"; then
5829 if test "$with_valgrind" = yes; then
5830 AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
5834 AC_SUBST([VALGRIND_CFLAGS])
5837 dnl ===================================================================
5838 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
5839 dnl ===================================================================
5841 # We need at least the sys/sdt.h include header.
5842 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
5843 if test "$SDT_H_FOUND" = "TRUE"; then
5844 # Found sys/sdt.h header, now make sure the c++ compiler works.
5845 # Old g++ versions had problems with probes in constructors/destructors.
5846 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
5848 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5849 #include <sys/sdt.h>
5857 ProbeClass(int& v, const char *n) : ref(v), name(n)
5859 DTRACE_PROBE2(_test_, cons, name, ref);
5862 void method(int min)
5864 DTRACE_PROBE3(_test_, meth, name, ref, min);
5870 DTRACE_PROBE2(_test_, dest, name, ref);
5875 DTRACE_PROBE1(_test_, call, i);
5876 ProbeClass inst = ProbeClass(i, "call");
5878 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
5879 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
5882 AC_CONFIG_HEADERS([config_host/config_probes.h])
5884 dnl ===================================================================
5886 dnl ===================================================================
5887 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
5888 AC_MSG_CHECKING([whether $CC supports -mno-avx])
5890 CFLAGS="$CFLAGS -Werror -mno-avx"
5891 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5893 if test "$HAVE_GCC_AVX" = "TRUE"; then
5894 AC_MSG_RESULT([yes])
5899 AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong])
5901 CFLAGS="$CFLAGS -Werror -fstack-protector-strong"
5902 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
5904 if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
5905 AC_MSG_RESULT([yes])
5910 AC_MSG_CHECKING([whether $CC supports atomic functions])
5911 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5913 if (__sync_add_and_fetch(&v, 1) != 1 ||
5914 __sync_sub_and_fetch(&v, 1) != 0)
5916 __sync_synchronize();
5917 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
5921 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
5922 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
5923 AC_MSG_RESULT([yes])
5924 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
5929 AC_MSG_CHECKING([whether $CC supports __builtin_ffs])
5930 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
5931 if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
5932 AC_MSG_RESULT([yes])
5933 AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
5938 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
5940 CFLAGS="$CFLAGS -Werror"
5941 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5942 __attribute__((deprecated("test"))) void f();
5944 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
5945 AC_MSG_RESULT([yes])
5946 ], [AC_MSG_RESULT([no])])
5949 AC_MSG_CHECKING([whether $CXX defines __base_class_type_info in cxxabi.h])
5951 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5954 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
5956 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
5957 AC_MSG_RESULT([yes])
5958 ], [AC_MSG_RESULT([no])])
5961 AC_MSG_CHECKING([whether $CXX defines __class_type_info in cxxabi.h])
5963 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5966 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
5968 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
5969 AC_MSG_RESULT([yes])
5970 ], [AC_MSG_RESULT([no])])
5973 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
5975 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5977 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
5979 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
5980 AC_MSG_RESULT([yes])
5981 ], [AC_MSG_RESULT([no])])
5984 AC_MSG_CHECKING([whether $CXX defines __cxa_eh_globals in cxxabi.h])
5986 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5989 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
5991 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
5992 AC_MSG_RESULT([yes])
5993 ], [AC_MSG_RESULT([no])])
5996 AC_MSG_CHECKING([whether $CXX defines __cxa_exceptions in cxxabi.h])
5998 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6001 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6003 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6004 AC_MSG_RESULT([yes])
6005 ], [AC_MSG_RESULT([no])])
6008 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
6010 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6012 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6014 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6015 AC_MSG_RESULT([yes])
6016 ], [AC_MSG_RESULT([no])])
6019 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6021 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6023 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6025 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6026 AC_MSG_RESULT([yes])
6027 ], [AC_MSG_RESULT([no])])
6030 AC_MSG_CHECKING([whether $CXX defines __si_class_type_info in cxxabi.h])
6032 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6035 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6037 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6038 AC_MSG_RESULT([yes])
6039 ], [AC_MSG_RESULT([no])])
6042 AC_MSG_CHECKING([whether $CXX defines __vmi_class_type_info in cxxabi.h])
6044 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6047 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6049 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6050 AC_MSG_RESULT([yes])
6051 ], [AC_MSG_RESULT([no])])
6054 dnl Available in GCC 4.9 and at least since Clang 3.4:
6055 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6057 save_CXXFLAGS=$CXXFLAGS
6058 CXXFLAGS="$CXXFLAGS -Werror"
6059 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6060 struct __attribute__((warn_unused)) dummy {};
6062 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6063 AC_MSG_RESULT([yes])
6064 ], [AC_MSG_RESULT([no])])
6065 CXXFLAGS=$save_CXXFLAGS
6069 AC_SUBST(HAVE_GCC_AVX)
6070 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
6071 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6072 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
6074 dnl ===================================================================
6075 dnl Identify the C++ library
6076 dnl ===================================================================
6078 AC_MSG_CHECKING([What the C++ library is])
6080 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6086 [CPP_LIBRARY=GLIBCXX
6087 cpp_library_name="GNU libstdc++"
6089 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6091 #ifndef _LIBCPP_VERSION
6096 cpp_library_name="LLVM libc++"
6097 AC_DEFINE([HAVE_LIBCXX])
6099 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6106 cpp_library_name="Microsoft"
6108 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6109 AC_MSG_RESULT([$cpp_library_name])
6112 dnl ===================================================================
6114 dnl ===================================================================
6115 AC_PATH_PROG(GPERF, gperf)
6116 if test -z "$GPERF"; then
6117 AC_MSG_ERROR([gperf not found but needed. Install it.])
6119 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
6120 GPERF=`cygpath -m $GPERF`
6122 AC_MSG_CHECKING([gperf version])
6123 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
6126 AC_MSG_ERROR([too old, you need at least 3.0.0])
6130 dnl ===================================================================
6131 dnl Check for system libcmis
6132 dnl ===================================================================
6133 # libcmis requires curl and we can't build curl for iOS
6134 if test $_os != iOS; then
6135 libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.0])
6140 AC_SUBST(ENABLE_LIBCMIS)
6142 dnl ===================================================================
6144 dnl ===================================================================
6147 libo_FUZZ_ARG_ENABLE(c++17,
6148 AS_HELP_STRING([--disable-c++17],
6149 [Do not attempt to run GCC/Clang in C++17 mode (needed for Coverity).])
6153 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
6154 AC_MSG_CHECKING([whether $CXX supports C++11])
6156 # MSVC supports (a subset of) CXX11 without any switch
6157 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6159 AC_MSG_CHECKING([whether $CXX supports C++17, C++14, or C++11])
6160 dnl But only use C++17 if the gperf that is being used knows not to emit
6161 dnl "register" in C++ output:
6162 printf 'foo\n' | $GPERF -L C++ > conftest.inc
6163 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'
6164 if test "$enable_c__17" != no; then
6165 my_flags="-std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z $my_flags"
6167 for flag in $my_flags; do
6168 if test "$COM" = MSC; then
6169 flag="-Xclang $flag"
6171 save_CXXFLAGS=$CXXFLAGS
6172 CXXFLAGS="$CXXFLAGS $flag -Werror"
6173 if test "$SYSTEM_LIBCMIS" = TRUE; then
6174 CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
6177 dnl Clang 3.9 supports __float128 since
6178 dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
6179 dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
6180 dnl hacky workaround to be able to include <vector> (as is done in the main check whether
6181 dnl $flag is supported below, so check this first):
6183 my_float128hack_impl=-D__float128=void
6184 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6186 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6190 dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
6191 dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
6192 dnl is available during its build, but it's usually built using GCC, and so c++config.h
6193 dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
6194 dnl place where __float128 is used is in a template specialization, -D__float128=void
6195 dnl will avoid the problem there while still causing a problem if somebody actually uses
6196 dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
6197 dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
6198 dnl "fixed" with this hack):
6199 CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
6200 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6202 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6205 ],[my_float128hack=$my_float128hack_impl])
6207 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6208 #include <algorithm>
6209 #include <functional>
6213 #pragma GCC diagnostic push
6214 #pragma GCC diagnostic ignored "-Wpragmas"
6215 // make GCC not warn about next pragma
6216 #pragma GCC diagnostic ignored "-Wdeprecated-register"
6217 // make Clang with -std < C++17 not even warn about register
6218 #include "conftest.inc"
6219 #pragma GCC diagnostic pop
6221 #if defined SYSTEM_LIBCMIS
6222 // See ucb/source/ucp/cmis/auth_provider.hxx:
6224 #pragma GCC diagnostic push
6225 #pragma GCC diagnostic ignored "-Wdeprecated"
6226 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
6228 #include <libcmis/libcmis.hxx>
6230 #pragma GCC diagnostic pop
6234 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6235 std::sort(v.begin(), v.end(), fn);
6237 ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
6239 CXXFLAGS=$save_CXXFLAGS
6240 if test -n "$CXXFLAGS_CXX11"; then
6246 if test "$HAVE_CXX11" = TRUE; then
6247 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6252 AC_SUBST(CXXFLAGS_CXX11)
6254 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6255 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6256 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6257 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6258 dnl again towards 4.7.2:
6259 if test $CPP_LIBRARY = GLIBCXX; then
6260 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6262 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6264 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6265 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6266 // GCC 4.7.0: 20120322
6267 // GCC 4.7.1: 20120614
6268 // and using a range check is not possible as the mapping between
6269 // __GLIBCXX__ values and GCC versions is not monotonic
6274 ]])], [AC_MSG_RESULT(no, ok)],
6275 [AC_MSG_ERROR(yes)])
6279 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6280 save_CXXFLAGS=$CXXFLAGS
6281 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6284 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6287 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6303 a thinga[]={{0,0}, {1,1}};
6304 b thingb[]={{0,0}, {1,1}};
6305 size_t i = sizeof(sal_n_array_size(thinga));
6306 size_t j = sizeof(sal_n_array_size(thingb));
6307 return !(i != 0 && j != 0);
6309 ], [ AC_MSG_RESULT(yes) ],
6310 [ AC_MSG_ERROR(no)])
6312 CXXFLAGS=$save_CXXFLAGS
6314 AC_MSG_CHECKING([whether $CXX supports C++14 constexpr])
6315 save_CXXFLAGS=$CXXFLAGS
6316 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6318 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6319 // A somewhat over-complicated way of checking for
6320 // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "ICE using __func__
6321 // in constexpr function":
6323 template<typename T> inline constexpr T f(T x) { return x; }
6324 template<typename T> inline constexpr T g(T x) {
6325 assert(f(static_cast<int>(x)));
6333 constexpr bool f() {
6336 while (n > 0) { --n; ++i; }
6341 constexpr auto v2 = S{10}.f();
6342 ]])], [cxx14_constexpr=yes], [cxx14_constexpr=no])
6344 CXXFLAGS=$save_CXXFLAGS
6345 AC_MSG_RESULT([$cxx14_constexpr])
6346 if test "$cxx14_constexpr" = yes; then
6347 AC_DEFINE([HAVE_CXX14_CONSTEXPR])
6350 dnl _Pragma support (may require C++11)
6351 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6352 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6354 save_CXXFLAGS=$CXXFLAGS
6355 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6356 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6357 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6359 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6360 AC_MSG_RESULT([yes])
6361 ], [AC_MSG_RESULT([no])])
6363 CXXFLAGS=$save_CXXFLAGS
6366 HAVE_GCC_FNO_SIZED_DEALLOCATION=
6367 if test "$GCC" = yes; then
6368 AC_MSG_CHECKING([whether $CXX supports -fno-sized-deallocation])
6370 save_CXXFLAGS=$CXXFLAGS
6371 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6372 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6373 CXXFLAGS=$save_CXXFLAGS
6375 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6376 AC_MSG_RESULT([yes])
6381 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6383 dnl ===================================================================
6384 dnl system stl sanity tests
6385 dnl ===================================================================
6386 if test "$_os" != "WINNT"; then
6390 save_CPPFLAGS="$CPPFLAGS"
6391 if test -n "$MACOSX_SDK_PATH"; then
6392 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6395 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6397 if test "$CPP_LIBRARY" = GLIBCXX; then
6398 dnl gcc#19664, gcc#22482, rhbz#162935
6399 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6400 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6401 AC_MSG_RESULT([$stlvisok])
6402 if test "$stlvisok" = "no"; then
6403 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
6407 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6408 # when we don't make any dynamic libraries?
6409 if test "$DISABLE_DYNLOADING" = ""; then
6410 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6411 cat > conftestlib1.cc <<_ACEOF
6412 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6413 struct S2: S1<int> { virtual ~S2(); };
6416 cat > conftestlib2.cc <<_ACEOF
6417 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6418 struct S2: S1<int> { virtual ~S2(); };
6419 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6421 gccvisinlineshiddenok=yes
6422 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6423 gccvisinlineshiddenok=no
6425 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6426 dnl known to not work with -z defs (unsetting which makes the test
6428 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6429 if test "$COM_IS_CLANG" = TRUE; then
6430 for i in $CXX $CXXFLAGS; do
6433 my_linkflagsnoundefs=
6439 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6440 gccvisinlineshiddenok=no
6445 AC_MSG_RESULT([$gccvisinlineshiddenok])
6446 if test "$gccvisinlineshiddenok" = "no"; then
6447 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6451 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6452 cat >visibility.cxx <<_ACEOF
6453 #pragma GCC visibility push(hidden)
6454 struct __attribute__ ((visibility ("default"))) TestStruct {
6457 __attribute__ ((visibility ("default"))) void TestFunc() {
6461 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
6466 if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
6469 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
6481 rm -f visibility.s visibility.cxx
6483 AC_MSG_RESULT([$gccvisbroken])
6484 if test "$gccvisbroken" = "yes"; then
6485 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
6488 CPPFLAGS="$save_CPPFLAGS"
6493 dnl ===================================================================
6495 dnl ===================================================================
6497 HAVE_GCC_FNO_DEFAULT_INLINE=
6498 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6499 if test "$GCC" = "yes"; then
6500 AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
6502 save_CXXFLAGS=$CXXFLAGS
6503 CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
6504 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
6505 CXXFLAGS=$save_CXXFLAGS
6507 if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
6508 AC_MSG_RESULT([yes])
6513 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6515 save_CXXFLAGS=$CXXFLAGS
6516 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6517 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6518 CXXFLAGS=$save_CXXFLAGS
6520 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6521 AC_MSG_RESULT([yes])
6526 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
6527 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6529 dnl ===================================================================
6530 dnl Compiler plugins
6531 dnl ===================================================================
6534 # currently only Clang
6536 if test "$COM_IS_CLANG" != "TRUE"; then
6537 if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
6538 AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
6539 enable_compiler_plugins=no
6543 if test "$COM_IS_CLANG" = "TRUE"; then
6544 if test -n "$enable_compiler_plugins"; then
6545 compiler_plugins="$enable_compiler_plugins"
6546 elif test -n "$ENABLE_DBGUTIL"; then
6547 compiler_plugins=test
6551 if test "$compiler_plugins" != no -a "$CLANGVER" -lt 30800; then
6552 if test "$compiler_plugins" = yes; then
6553 AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 3.8.0.])
6558 if test "$compiler_plugins" != "no"; then
6559 dnl The prefix where Clang resides, override to where Clang resides if
6560 dnl using a source build:
6561 if test -z "$CLANGDIR"; then
6565 save_CPPFLAGS=$CPPFLAGS
6567 # compiler plugins must be built with "native" compiler that was used to build Clang itself:
6568 : "${COMPILER_PLUGINS_CXX=g++}"
6569 CXX=$COMPILER_PLUGINS_CXX
6570 CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
6571 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
6572 [COMPILER_PLUGINS=TRUE],
6574 if test "$compiler_plugins" = "yes"; then
6575 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
6577 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
6578 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
6582 CPPFLAGS=$save_CPPFLAGS
6586 if test "$enable_compiler_plugins" = "yes"; then
6587 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
6590 AC_SUBST(COMPILER_PLUGINS)
6591 AC_SUBST(COMPILER_PLUGINS_CXX)
6592 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
6593 AC_SUBST(COMPILER_PLUGINS_DEBUG)
6595 AC_SUBST(CLANGLIBDIR)
6597 # Plugin to help linker.
6598 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
6599 # This makes --enable-lto build with clang work.
6602 dnl ===================================================================
6604 dnl ===================================================================
6605 AC_MSG_CHECKING([which memory allocator to use])
6606 if test "$with_alloc" = "system"; then
6607 AC_MSG_RESULT([system])
6610 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
6611 AC_MSG_RESULT([internal])
6613 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6614 AC_SUBST(HAVE_POSIX_FALLOCATE)
6617 dnl ===================================================================
6618 dnl Custom build version
6619 dnl ===================================================================
6621 AC_MSG_CHECKING([whether to add custom build version])
6622 if test "$with_build_version" != ""; then
6623 BUILD_VER_STRING=$with_build_version
6624 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6629 AC_SUBST(BUILD_VER_STRING)
6631 JITC_PROCESSOR_TYPE=""
6632 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6633 # IBMs JDK needs this...
6634 JITC_PROCESSOR_TYPE=6
6635 export JITC_PROCESSOR_TYPE
6637 AC_SUBST([JITC_PROCESSOR_TYPE])
6639 # Misc Windows Stuff
6640 AC_ARG_WITH(vcredist-dir,
6641 AS_HELP_STRING([--with-vcredist-dir],
6642 [path to the directory with the arch-specific executables (vc_redist.x64.exe, vc_redist.x86.exe)
6643 for packaging into the installsets (without those the target system needs to install
6644 the Visual C++ Runtimes manually)]),
6646 VCREDIST_DIR="$with_vcredist_dir"
6647 if test $_os = "WINNT"; then
6650 MSVC_DLL_PATH="$msvcdllpath"
6651 MSVC_DLLS="$msvcdlls"
6653 # MSVC 15.3 changed it to VC141
6654 if echo "$MSVC_DLL_PATH" | grep -q "VC141.CRT$"; then
6655 SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
6657 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6659 if test "$VCREDIST_DIR" = "no"; then
6660 dnl explicitly disabled
6663 if test -f "$VCREDIST_DIR/vc_redist.$WINDOWS_SDK_ARCH.exe"; then
6664 VCREDIST_EXE="vc_redist.$WINDOWS_SDK_ARCH.exe"
6667 if test -n "$PKGFORMAT"; then
6668 for i in "$PKGFORMAT"; do
6671 AC_MSG_WARN([--without-vcredist-dir not specified or exe not found - installer will have runtime dependency])
6672 add_warning "--without-vcredist-dir not specified or exe not found - installer will have runtime dependency"
6681 AC_SUBST(VCREDIST_DIR)
6682 AC_SUBST(VCREDIST_EXE)
6683 AC_SUBST(MSVC_DLL_PATH)
6687 dnl ===================================================================
6689 dnl ===================================================================
6690 if test "$ENABLE_JAVA" != ""; then
6692 # Windows-specific tests
6693 if test "$build_os" = "cygwin"; then
6694 if test "$BITNESS_OVERRIDE" = 64; then
6700 if test -z "$with_jdk_home"; then
6701 dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
6702 dnl AB10-49F82F720027> section "Windows Registry Key Changes":
6703 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
6704 if test -n "$regvalue"; then
6706 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
6709 if test -z "$with_jdk_home"; then
6710 for ver in 1.8 1.7 1.6; do
6711 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
6712 if test -n "$regvalue"; then
6718 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
6719 with_jdk_home="$_jdk_home"
6720 howfound="found automatically"
6722 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
6725 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
6726 howfound="you passed"
6730 # 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.
6731 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
6732 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
6733 with_jdk_home=`/usr/libexec/java_home`
6736 JAVA_HOME=; export JAVA_HOME
6737 if test -z "$with_jdk_home"; then
6738 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
6740 _java_path="$with_jdk_home/bin/$with_java"
6741 dnl Check if there is a Java interpreter at all.
6742 if test -x "$_java_path"; then
6743 JAVAINTERPRETER=$_java_path
6745 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
6749 dnl Check that the JDK found is correct architecture (at least 2 reasons to
6750 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
6751 dnl loaded by java to run JunitTests:
6752 if test "$build_os" = "cygwin"; then
6753 shortjdkhome=`cygpath -d "$with_jdk_home"`
6754 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
6755 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
6756 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6757 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
6758 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6759 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6762 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6763 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6765 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
6766 elif test "$cross_compiling" != "yes"; then
6768 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
6769 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
6770 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
6771 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6774 *) # assumption: everything else 32-bit
6775 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
6776 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6777 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6785 dnl ===================================================================
6787 dnl ===================================================================
6789 # Note that JAVA_HOME as for now always means the *build* platform's
6790 # JAVA_HOME. Whether all the complexity here actually is needed any
6791 # more or not, no idea.
6793 if test "$ENABLE_JAVA" != ""; then
6795 AC_MSG_CHECKING([the installed JDK])
6796 if test -n "$JAVAINTERPRETER"; then
6797 dnl java -version sends output to stderr!
6798 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6799 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6800 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6801 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6802 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6803 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6804 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6807 dnl IBM JDK specific tests
6808 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6809 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6811 if test "$_jdk_ver" -lt 10600; then
6812 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.6])
6815 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6817 if test "$with_jdk_home" = ""; then
6818 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6819 you must use the "--with-jdk-home" configure option explicitly])
6822 JAVA_HOME=$with_jdk_home
6826 dnl Sun JDK specific tests
6827 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6828 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6830 if test "$_jdk_ver" -lt 10600; then
6831 AC_MSG_ERROR([JDK is too old, you need at least 1.6])
6833 if test "$_jdk_ver" -gt 10600; then
6834 JAVA_CLASSPATH_NOT_SET=TRUE
6836 if test "$_jdk_ver" -ge 10900; then
6840 AC_MSG_RESULT([checked (JDK $_jdk)])
6841 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6842 if test "$_os" = "WINNT"; then
6843 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6846 # set to limit VM usage for JunitTests
6848 # set to limit VM usage for javac
6849 JAVAFLAGS=-J-Xmx128M
6852 AC_MSG_ERROR([Java not found. You need at least jdk-1.6])
6860 dnl ===================================================================
6861 dnl Set target Java bytecode version
6862 dnl ===================================================================
6863 if test "$ENABLE_JAVA" != ""; then
6864 if test "$HAVE_JAVA9" = "TRUE"; then
6865 _java_target_ver="1.6"
6867 _java_target_ver="1.5"
6869 JAVA_SOURCE_VER="$_java_target_ver"
6870 JAVA_TARGET_VER="$_java_target_ver"
6873 dnl ===================================================================
6874 dnl Checks for javac
6875 dnl ===================================================================
6876 if test "$ENABLE_JAVA" != ""; then
6877 javacompiler="javac"
6878 if test -z "$with_jdk_home"; then
6879 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
6881 _javac_path="$with_jdk_home/bin/$javacompiler"
6882 dnl Check if there is a Java compiler at all.
6883 if test -x "$_javac_path"; then
6884 JAVACOMPILER=$_javac_path
6887 if test -z "$JAVACOMPILER"; then
6888 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
6890 if test "$build_os" = "cygwin"; then
6891 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
6892 JAVACOMPILER="${JAVACOMPILER}.exe"
6894 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
6898 dnl ===================================================================
6899 dnl Checks for javadoc
6900 dnl ===================================================================
6901 if test "$ENABLE_JAVA" != ""; then
6902 if test -z "$with_jdk_home"; then
6903 AC_PATH_PROG(JAVADOC, javadoc)
6905 _javadoc_path="$with_jdk_home/bin/javadoc"
6906 dnl Check if there is a javadoc at all.
6907 if test -x "$_javadoc_path"; then
6908 JAVADOC=$_javadoc_path
6910 AC_PATH_PROG(JAVADOC, javadoc)
6913 if test -z "$JAVADOC"; then
6914 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
6916 if test "$build_os" = "cygwin"; then
6917 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
6918 JAVADOC="${JAVADOC}.exe"
6920 JAVADOC=`win_short_path_for_make "$JAVADOC"`
6923 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
6924 JAVADOCISGJDOC="yes"
6927 AC_SUBST(JAVADOCISGJDOC)
6929 if test "$ENABLE_JAVA" != ""; then
6930 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
6931 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
6932 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
6933 # try to recover first by looking whether we have a alternatives
6934 # system as in Debian or newer SuSEs where following /usr/bin/javac
6935 # over /etc/alternatives/javac leads to the right bindir where we
6936 # just need to strip a bit away to get a valid JAVA_HOME
6937 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
6938 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
6939 # maybe only one level of symlink (e.g. on Mac)
6940 JAVA_HOME=$(readlink $JAVACOMPILER)
6941 if test "$(dirname $JAVA_HOME)" = "."; then
6942 # we've got no path to trim back
6947 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
6948 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
6949 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
6950 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
6952 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
6953 if test "$JAVA_HOME" != "/usr"; then
6954 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6955 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
6956 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
6957 dnl Tiger already returns a JDK path..
6958 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
6960 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
6961 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
6962 dnl that checks which version to run
6963 if test -f "$JAVA_HOME"; then
6964 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
6969 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
6971 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
6972 if test -z "$JAVA_HOME"; then
6973 if test "x$with_jdk_home" = "x"; then
6974 cat > findhome.java <<_ACEOF
6975 [import java.io.File;
6979 public static void main(String args[])
6981 String jrelocation = System.getProperty("java.home");
6982 File jre = new File(jrelocation);
6983 System.out.println(jre.getParent());
6987 AC_MSG_CHECKING([if javac works])
6988 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
6989 AC_TRY_EVAL(javac_cmd)
6990 if test $? = 0 -a -f ./findhome.class; then
6991 AC_MSG_RESULT([javac works])
6993 echo "configure: javac test failed" >&5
6994 cat findhome.java >&5
6995 AC_MSG_ERROR([javac does not work - java projects will not build!])
6997 AC_MSG_CHECKING([if gij knows its java.home])
6998 JAVA_HOME=`$JAVAINTERPRETER findhome`
6999 if test $? = 0 -a "$JAVA_HOME" != ""; then
7000 AC_MSG_RESULT([$JAVA_HOME])
7002 echo "configure: java test failed" >&5
7003 cat findhome.java >&5
7004 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7006 # clean-up after ourselves
7007 rm -f ./findhome.java ./findhome.class
7009 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7013 # now check if $JAVA_HOME is really valid
7014 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7015 case "${JAVA_HOME}" in
7016 /Library/Java/JavaVirtualMachines/*)
7019 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7022 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7025 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7028 if test "$JAVA_HOME_OK" = "NO"; then
7029 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7030 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7031 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
7032 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7033 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7034 add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
7036 PathFormat "$JAVA_HOME"
7037 JAVA_HOME="$formatted_path"
7040 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7043 AC_MSG_CHECKING([for JAWT lib])
7044 if test "$_os" = WINNT; then
7045 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7050 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7051 JAVA_ARCH=$my_java_arch
7066 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7067 JAVA_ARCH=$my_java_arch
7070 my_java_arch=sparcv9
7076 my_java_arch=$host_cpu
7079 # This is where JDK9 puts the library
7080 if test -e "$JAVA_HOME/lib/libjawt.so"; then
7081 JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
7083 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7085 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7087 AC_MSG_RESULT([$JAWTLIB])
7091 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7095 JAVAINC="-I$JAVA_HOME/include"
7096 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7097 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7101 JAVAINC="-I$JAVA_HOME/include/win32"
7102 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7106 if test -d "$JAVA_HOME/include/darwin"; then
7107 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7109 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7114 JAVAINC="-I$JAVA_HOME/include"
7115 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7119 JAVAINC="-I$JAVA_HOME/include"
7120 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7121 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7122 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7123 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7127 JAVAINC="-I$JAVA_HOME/include"
7128 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7129 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7133 JAVAINC="-I$JAVA_HOME/include"
7134 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7135 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7139 JAVAINC="-I$JAVA_HOME/include"
7140 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7141 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7145 JAVAINC="-I$JAVA_HOME/include"
7146 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7147 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7151 JAVAINC="-I$JAVA_HOME/include"
7152 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7153 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7157 SOLARINC="$SOLARINC $JAVAINC"
7159 AC_SUBST(JAVACOMPILER)
7161 AC_SUBST(JAVAINTERPRETER)
7162 AC_SUBST(JAVAIFLAGS)
7164 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7166 AC_SUBST(JAVA_SOURCE_VER)
7167 AC_SUBST(JAVA_TARGET_VER)
7171 dnl ===================================================================
7172 dnl Export file validation
7173 dnl ===================================================================
7174 AC_MSG_CHECKING([whether to enable export file validation])
7175 if test "$with_export_validation" != "no"; then
7176 if test -z "$ENABLE_JAVA"; then
7177 if test "$with_export_validation" = "yes"; then
7178 AC_MSG_ERROR([requested, but Java is disabled])
7180 AC_MSG_RESULT([no, as Java is disabled])
7182 elif test "$_jdk_ver" -lt 10800; then
7183 if test "$with_export_validation" = "yes"; then
7184 AC_MSG_ERROR([requested, but Java is too old, need Java 8])
7186 AC_MSG_RESULT([no, as Java is too old, need Java 8])
7189 AC_MSG_RESULT([yes])
7190 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7192 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7193 if test -z "$ODFVALIDATOR"; then
7194 # remember to download the ODF toolkit with validator later
7195 AC_MSG_NOTICE([no odfvalidator found, will download it])
7196 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7197 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7199 # and fetch name of odfvalidator jar name from download.lst
7200 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7201 AC_SUBST(ODFVALIDATOR_JAR)
7203 if test -z "$ODFVALIDATOR_JAR"; then
7204 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7207 if test "$build_os" = "cygwin"; then
7208 # In case of Cygwin it will be executed from Windows,
7209 # so we need to run bash and absolute path to validator
7210 # so instead of "odfvalidator" it will be
7211 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7212 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7214 ODFVALIDATOR="sh $ODFVALIDATOR"
7216 AC_SUBST(ODFVALIDATOR)
7219 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7220 if test -z "$OFFICEOTRON"; then
7221 # remember to download the officeotron with validator later
7222 AC_MSG_NOTICE([no officeotron found, will download it])
7223 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7224 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7226 # and fetch name of officeotron jar name from download.lst
7227 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7228 AC_SUBST(OFFICEOTRON_JAR)
7230 if test -z "$OFFICEOTRON_JAR"; then
7231 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7234 # check version of existing officeotron
7235 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7236 if test 0"$OFFICEOTRON_VER" -lt 704; then
7237 AC_MSG_ERROR([officeotron too old])
7240 if test "$build_os" = "cygwin"; then
7241 # In case of Cygwin it will be executed from Windows,
7242 # so we need to run bash and absolute path to validator
7243 # so instead of "odfvalidator" it will be
7244 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7245 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7247 OFFICEOTRON="sh $OFFICEOTRON"
7250 AC_SUBST(OFFICEOTRON)
7255 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7256 if test "$with_bffvalidator" != "no"; then
7257 AC_DEFINE(HAVE_BFFVALIDATOR)
7259 if test "$with_export_validation" = "no"; then
7260 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7263 if test "$with_bffvalidator" = "yes"; then
7264 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7266 BFFVALIDATOR="$with_bffvalidator"
7269 if test "$build_os" = "cygwin"; then
7270 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7271 AC_MSG_RESULT($BFFVALIDATOR)
7273 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7275 elif test -n "$BFFVALIDATOR"; then
7276 # We are not in Cygwin but need to run Windows binary with wine
7277 AC_PATH_PROGS(WINE, wine)
7279 # so swap in a shell wrapper that converts paths transparently
7280 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7281 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7282 AC_SUBST(BFFVALIDATOR_EXE)
7283 AC_MSG_RESULT($BFFVALIDATOR)
7285 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7287 AC_SUBST(BFFVALIDATOR)
7292 dnl ===================================================================
7293 dnl Check for C preprocessor to use
7294 dnl ===================================================================
7295 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7296 if test -n "$with_idlc_cpp"; then
7297 AC_MSG_RESULT([$with_idlc_cpp])
7298 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7300 AC_MSG_RESULT([ucpp])
7301 AC_MSG_CHECKING([which ucpp tp use])
7302 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7303 AC_MSG_RESULT([external])
7304 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7306 AC_MSG_RESULT([internal])
7307 BUILD_TYPE="$BUILD_TYPE UCPP"
7310 AC_SUBST(SYSTEM_UCPP)
7312 dnl ===================================================================
7313 dnl Check for epm (not needed for Windows)
7314 dnl ===================================================================
7315 AC_MSG_CHECKING([whether to enable EPM for packing])
7316 if test "$enable_epm" = "yes"; then
7317 AC_MSG_RESULT([yes])
7318 if test "$_os" != "WINNT"; then
7319 if test $_os = Darwin; then
7321 elif test -n "$with_epm"; then
7324 AC_PATH_PROG(EPM, epm, no)
7326 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7327 AC_MSG_NOTICE([EPM will be built.])
7328 BUILD_TYPE="$BUILD_TYPE EPM"
7329 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7331 # Gentoo has some epm which is something different...
7332 AC_MSG_CHECKING([whether the found epm is the right epm])
7333 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7334 AC_MSG_RESULT([yes])
7336 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7338 AC_MSG_CHECKING([epm version])
7339 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7340 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7341 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7342 AC_MSG_RESULT([OK, >= 3.7])
7344 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7345 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7350 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7351 AC_MSG_CHECKING([for rpm])
7352 for a in "$RPM" rpmbuild rpm; do
7353 $a --usage >/dev/null 2> /dev/null
7354 if test $? -eq 0; then
7358 $a --version >/dev/null 2> /dev/null
7359 if test $? -eq 0; then
7365 if test -z "$RPM"; then
7366 AC_MSG_ERROR([not found])
7367 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7368 RPM_PATH=`which $RPM`
7369 AC_MSG_RESULT([$RPM_PATH])
7370 SCPDEFS="$SCPDEFS -DWITH_RPM"
7372 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7375 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7376 AC_PATH_PROG(DPKG, dpkg, no)
7377 if test "$DPKG" = "no"; then
7378 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7381 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7382 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7383 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7384 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7385 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7386 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
7387 AC_MSG_RESULT([yes])
7390 if echo "$PKGFORMAT" | $GREP -q rpm; then
7392 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7393 add_warning "the rpms will need to be installed with --nodeps"
7397 AC_MSG_WARN([the ${_pt}s will not be relocatable])
7398 add_warning "the ${_pt}s will not be relocatable"
7399 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7400 relocation will work, you need to patch your epm with the
7401 patch in epm/epm-3.7.patch or build with
7402 --with-epm=internal which will build a suitable epm])
7407 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7408 AC_PATH_PROG(PKGMK, pkgmk, no)
7409 if test "$PKGMK" = "no"; then
7410 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7417 for i in $PKGFORMAT; do
7419 aix | bsd | deb | pkg | rpm | native | portable)
7421 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7431 if test "$enable_lotuswordpro" = "yes"; then
7434 AC_SUBST(ENABLE_LWP)
7436 dnl ===================================================================
7437 dnl Check for building ODK
7438 dnl ===================================================================
7439 if test "$enable_odk" = no; then
7442 if test "$with_doxygen" = no; then
7443 AC_MSG_CHECKING([for doxygen])
7447 if test "$with_doxygen" = yes; then
7448 AC_PATH_PROG([DOXYGEN], [doxygen])
7449 if test -z "$DOXYGEN"; then
7450 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7452 if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
7453 if ! dot -V 2>/dev/null; then
7454 AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
7458 AC_MSG_CHECKING([for doxygen])
7459 DOXYGEN=$with_doxygen
7460 AC_MSG_RESULT([$DOXYGEN])
7462 if test -n "$DOXYGEN"; then
7463 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7464 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7465 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7466 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7473 AC_MSG_CHECKING([whether to build the ODK])
7474 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7475 AC_MSG_RESULT([yes])
7477 if test "$with_java" != "no"; then
7478 AC_MSG_CHECKING([whether to build unowinreg.dll])
7479 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7480 # build on Win by default
7481 enable_build_unowinreg=yes
7483 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7487 AC_MSG_RESULT([yes])
7488 BUILD_UNOWINREG=TRUE
7490 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7491 if test -z "$with_mingw_cross_compiler"; then
7493 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7494 elif test -x "$with_mingw_cross_compiler"; then
7495 MINGWCXX="$with_mingw_cross_compiler"
7497 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7500 if test "$MINGWCXX" = "false"; then
7501 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7504 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7505 if test -x "$mingwstrip_test"; then
7506 MINGWSTRIP="$mingwstrip_test"
7508 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7511 if test "$MINGWSTRIP" = "false"; then
7512 AC_MSG_ERROR(MinGW32 binutils not found.)
7516 BUILD_TYPE="$BUILD_TYPE ODK"
7521 AC_SUBST(BUILD_UNOWINREG)
7523 AC_SUBST(MINGWSTRIP)
7525 dnl ===================================================================
7526 dnl Check for system zlib
7527 dnl ===================================================================
7528 if test "$with_system_zlib" = "auto"; then
7531 with_system_zlib="$with_system_libs"
7534 if test "$enable_fuzzers" != "yes"; then
7535 with_system_zlib=yes
7543 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
7544 dnl and has no pkg-config for it at least on some tinderboxes,
7545 dnl so leaving that out for now
7546 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7547 AC_MSG_CHECKING([which zlib to use])
7548 if test "$with_system_zlib" = "yes"; then
7549 AC_MSG_RESULT([external])
7551 AC_CHECK_HEADER(zlib.h, [],
7552 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7553 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
7554 [AC_MSG_ERROR(zlib not found or functional)], [])
7556 AC_MSG_RESULT([internal])
7558 BUILD_TYPE="$BUILD_TYPE ZLIB"
7559 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7560 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
7562 AC_SUBST(ZLIB_CFLAGS)
7564 AC_SUBST(SYSTEM_ZLIB)
7566 dnl ===================================================================
7567 dnl Check for system jpeg
7568 dnl ===================================================================
7569 AC_MSG_CHECKING([which libjpeg to use])
7570 if test "$with_system_jpeg" = "yes"; then
7571 AC_MSG_RESULT([external])
7573 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
7574 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7575 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
7576 [AC_MSG_ERROR(jpeg library not found or fuctional)], [])
7579 AC_MSG_RESULT([internal, libjpeg-turbo])
7580 BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
7581 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
7582 if test "$COM" = "MSC"; then
7583 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
7585 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
7589 x86_64 | amd64 | i*86 | x86 | ia32)
7590 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
7591 if test -z "$NASM" -a "$build_os" = "cygwin"; then
7592 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
7593 NASM="$LODE_HOME/opt/bin/nasm"
7594 elif test -x "/opt/lo/bin/nasm"; then
7595 NASM="/opt/lo/bin/nasm"
7599 if test -n "$NASM"; then
7600 AC_MSG_CHECKING([for object file format of host system])
7602 cygwin* | mingw* | pw32* | interix*)
7612 msdosdjgpp* | go32*)
7615 os2-emx*) # not tested
7616 objfmt='MSOMF' # obj
7618 linux*coff* | linux*oldld*)
7634 kfreebsd* | freebsd* | netbsd* | openbsd*)
7635 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
7648 solaris* | sunos* | sysv* | sco*)
7658 darwin* | rhapsody* | nextstep* | openstep* | macos*)
7673 AC_MSG_RESULT([$objfmt])
7674 if test "$objfmt" = 'ELF ?'; then
7676 AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
7679 AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
7681 MSOMF) NAFLAGS='-fobj -DOBJ32';;
7682 Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
7683 Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
7684 COFF) NAFLAGS='-fcoff -DCOFF';;
7685 a.out) NAFLAGS='-faout -DAOUT';;
7686 BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
7687 ELF) NAFLAGS='-felf -DELF';;
7688 ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
7689 RDF) NAFLAGS='-frdf -DRDF';;
7690 Mach-O) NAFLAGS='-fmacho -DMACHO';;
7691 Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
7693 AC_MSG_RESULT([$NAFLAGS])
7695 AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
7696 cat > conftest.asm << EOF
7697 [%line __oline__ "configure"
7705 try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
7706 if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
7709 echo "configure: failed program was:" >&AC_FD_CC
7710 cat conftest.asm >&AC_FD_CC
7713 AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
7719 if test -z "$NASM"; then
7721 ****************************************************************************
7722 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
7726 if test "$build_os" = "cygwin"; then
7728 install a pre-compiled binary for Win32
7730 mkdir -p /opt/lo/bin
7732 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
7735 or get and install one from http://www.nasm.us/
7737 Then re-run autogen.sh
7739 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
7740 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
7745 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
7749 AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
7750 add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
7757 AC_SUBST(LIBJPEG_CFLAGS)
7758 AC_SUBST(LIBJPEG_LIBS)
7759 AC_SUBST(SYSTEM_LIBJPEG)
7761 dnl ===================================================================
7762 dnl Check for system clucene
7763 dnl ===================================================================
7764 dnl we should rather be using
7765 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
7766 dnl but the contribs-lib check seems tricky
7767 AC_MSG_CHECKING([which clucene to use])
7768 if test "$with_system_clucene" = "yes"; then
7769 AC_MSG_RESULT([external])
7771 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
7772 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
7773 FilterLibs "${CLUCENE_LIBS}"
7774 CLUCENE_LIBS="${filteredlibs}"
7776 save_CXXFLAGS=$CXXFLAGS
7777 save_CPPFLAGS=$CPPFLAGS
7778 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
7779 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
7780 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
7781 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
7782 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
7783 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
7784 CXXFLAGS=$save_CXXFLAGS
7785 CPPFLAGS=$save_CPPFLAGS
7788 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
7790 AC_MSG_RESULT([internal])
7792 BUILD_TYPE="$BUILD_TYPE CLUCENE"
7794 AC_SUBST(SYSTEM_CLUCENE)
7795 AC_SUBST(CLUCENE_CFLAGS)
7796 AC_SUBST(CLUCENE_LIBS)
7798 dnl ===================================================================
7799 dnl Check for system expat
7800 dnl ===================================================================
7801 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
7803 dnl ===================================================================
7804 dnl Check for system xmlsec
7805 dnl ===================================================================
7806 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
7808 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
7809 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
7811 AC_DEFINE([ENABLE_EOT])
7812 AC_MSG_RESULT([yes])
7814 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
7819 AC_SUBST([ENABLE_EOT])
7821 dnl ===================================================================
7822 dnl Check for DLP libs
7823 dnl ===================================================================
7824 AS_IF([test "$COM" = "MSC"],
7825 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
7826 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
7828 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
7830 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
7832 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
7834 AS_IF([test "$COM" = "MSC"],
7835 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
7836 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
7838 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
7840 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
7842 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
7843 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.8])
7845 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
7847 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
7849 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
7851 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
7852 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.13])
7854 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
7855 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.7])
7857 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
7859 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
7860 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
7862 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
7864 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
7866 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
7868 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
7870 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
7871 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.4])
7873 dnl ===================================================================
7874 dnl Check for system lcms2
7875 dnl ===================================================================
7876 if test "$with_system_lcms2" != "yes"; then
7879 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
7880 if test "$GCC" = "yes"; then
7881 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7883 if test "$COM" = "MSC"; then # override the above
7884 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
7887 dnl ===================================================================
7888 dnl Check for system cppunit
7889 dnl ===================================================================
7890 if test "$cross_compiling" != "yes"; then
7891 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
7894 dnl ===================================================================
7895 dnl Check whether freetype is available
7896 dnl ===================================================================
7897 if test "$test_freetype" = "yes"; then
7898 AC_MSG_CHECKING([whether freetype is available])
7899 # FreeType has 3 different kinds of versions
7900 # * release, like 2.4.10
7901 # * libtool, like 13.0.7 (this what pkg-config returns)
7903 # FreeType's docs/VERSION.DLL provides a table mapping between the three
7906 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
7907 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7908 FilterLibs "${FREETYPE_LIBS}"
7909 FREETYPE_LIBS="${filteredlibs}"
7910 SYSTEM_FREETYPE=TRUE
7912 FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
7913 FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
7915 AC_SUBST(FREETYPE_CFLAGS)
7916 AC_SUBST(FREETYPE_LIBS)
7917 AC_SUBST([SYSTEM_FREETYPE])
7919 # ===================================================================
7920 # Check for system libxslt
7921 # to prevent incompatibilities between internal libxml2 and external libxslt,
7922 # or vice versa, use with_system_libxml here
7923 # ===================================================================
7924 if test "$with_system_libxml" = "auto"; then
7927 with_system_libxml="$with_system_libs"
7930 if test "$enable_fuzzers" != "yes"; then
7931 with_system_libxml=yes
7933 with_system_libxml=no
7939 AC_MSG_CHECKING([which libxslt to use])
7940 if test "$with_system_libxml" = "yes"; then
7941 AC_MSG_RESULT([external])
7943 if test "$_os" = "Darwin"; then
7944 dnl make sure to use SDK path
7945 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7946 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
7948 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
7949 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
7951 PKG_CHECK_MODULES(LIBXSLT, libxslt)
7952 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7953 FilterLibs "${LIBXSLT_LIBS}"
7954 LIBXSLT_LIBS="${filteredlibs}"
7955 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
7956 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7957 FilterLibs "${LIBEXSLT_LIBS}"
7958 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
7961 dnl Check for xsltproc
7962 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7963 if test "$XSLTPROC" = "no"; then
7964 AC_MSG_ERROR([xsltproc is required])
7967 AC_MSG_RESULT([internal])
7969 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
7971 if test "$cross_compiling" = "yes"; then
7972 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7973 if test "$XSLTPROC" = "no"; then
7974 AC_MSG_ERROR([xsltproc is required])
7978 AC_SUBST(SYSTEM_LIBXSLT)
7979 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
7980 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
7982 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
7984 AC_SUBST(LIBEXSLT_CFLAGS)
7985 AC_SUBST(LIBEXSLT_LIBS)
7986 AC_SUBST(LIBXSLT_CFLAGS)
7987 AC_SUBST(LIBXSLT_LIBS)
7990 # ===================================================================
7991 # Check for system libxml
7992 # ===================================================================
7993 AC_MSG_CHECKING([which libxml to use])
7994 if test "$with_system_libxml" = "yes"; then
7995 AC_MSG_RESULT([external])
7997 if test "$_os" = "Darwin"; then
7998 dnl make sure to use SDK path
7999 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8001 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8002 elif test $_os = iOS; then
8003 dnl make sure to use SDK path
8004 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8005 LIBXML_CFLAGS="-I$usr/include/libxml2"
8006 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8008 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8009 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8010 FilterLibs "${LIBXML_LIBS}"
8011 LIBXML_LIBS="${filteredlibs}"
8014 dnl Check for xmllint
8015 AC_PATH_PROG(XMLLINT, xmllint, no)
8016 if test "$XMLLINT" = "no"; then
8017 AC_MSG_ERROR([xmllint is required])
8020 AC_MSG_RESULT([internal])
8022 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
8023 if test "$COM" = "MSC"; then
8024 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8026 if test "$COM" = "MSC"; then
8027 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
8029 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
8031 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8033 AC_SUBST(SYSTEM_LIBXML)
8034 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8035 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8037 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8038 AC_SUBST(LIBXML_CFLAGS)
8039 AC_SUBST(LIBXML_LIBS)
8042 # =====================================================================
8043 # Checking for a Python interpreter with version >= 2.6.
8044 # Build and runtime requires Python 3 compatible version (>= 2.6).
8045 # Optionally user can pass an option to configure, i. e.
8046 # ./configure PYTHON=/usr/bin/python
8047 # =====================================================================
8048 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8049 # This allows a lack of system python with no error, we use internal one in that case.
8050 AM_PATH_PYTHON([2.6],, [:])
8051 # Clean PYTHON_VERSION checked below if cross-compiling
8053 if test "$PYTHON" != ":"; then
8054 PYTHON_FOR_BUILD=$PYTHON
8057 AC_SUBST(PYTHON_FOR_BUILD)
8059 # Checks for Python to use for Pyuno
8060 AC_MSG_CHECKING([which Python to use for Pyuno])
8061 case "$enable_python" in
8063 if test -z $PYTHON_FOR_BUILD; then
8064 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8065 # requirement from the choice whether to include Python stuff in the installer, but why
8067 AC_MSG_ERROR([Python is required at build time.])
8070 AC_MSG_RESULT([none])
8073 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8074 AC_MSG_RESULT([no, overridden by --disable-scripting])
8076 elif test $build_os = cygwin; then
8077 dnl When building on Windows we don't attempt to use any installed
8078 dnl "system" Python.
8079 AC_MSG_RESULT([fully internal])
8080 enable_python=internal
8081 elif test "$cross_compiling" = yes; then
8082 AC_MSG_RESULT([system])
8083 enable_python=system
8085 # Unset variables set by the above AM_PATH_PYTHON so that
8086 # we actually do check anew.
8087 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
8088 AM_PATH_PYTHON([3.3],, [:])
8089 if test "$PYTHON" = ":"; then
8090 if test -z "$PYTHON_FOR_BUILD"; then
8091 AC_MSG_RESULT([fully internal])
8093 AC_MSG_RESULT([internal])
8095 enable_python=internal
8097 AC_MSG_RESULT([system])
8098 enable_python=system
8103 AC_MSG_RESULT([internal])
8106 AC_MSG_RESULT([fully internal])
8107 enable_python=internal
8110 AC_MSG_RESULT([system])
8113 AC_MSG_ERROR([Incorrect --enable-python option])
8117 if test $enable_python != no; then
8118 BUILD_TYPE="$BUILD_TYPE PYUNO"
8121 if test $enable_python = system; then
8122 if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
8124 PYTHON=python$python_version
8125 if test -d "$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"; then
8126 PYTHON_CFLAGS="-I$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"
8127 PYTHON_LIBS="-framework Python"
8129 PYTHON_CFLAGS="`$PYTHON-config --includes`"
8130 PYTHON_LIBS="`$PYTHON-config --libs`"
8133 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8134 # Fallback: Accept these in the environment, or as set above
8137 elif test "$cross_compiling" != yes; then
8138 # Unset variables set by the above AM_PATH_PYTHON so that
8139 # we actually do check anew.
8140 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
8141 # This causes an error if no python command is found
8142 AM_PATH_PYTHON([3.3])
8143 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8144 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8145 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8146 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8147 if test -z "$PKG_CONFIG"; then
8148 PYTHON_CFLAGS="-I$python_include"
8149 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8150 elif $PKG_CONFIG --exists python-$python_version; then
8151 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8152 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8154 PYTHON_CFLAGS="-I$python_include"
8155 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8157 FilterLibs "${PYTHON_LIBS}"
8158 PYTHON_LIBS="${filteredlibs}"
8160 dnl How to find out the cross-compilation Python installation path?
8161 AC_MSG_CHECKING([for python version])
8162 AS_IF([test -n "$PYTHON_VERSION"],
8163 [AC_MSG_RESULT([$PYTHON_VERSION])],
8164 [AC_MSG_RESULT([not found])
8165 AC_MSG_ERROR([no usable python found])])
8166 test -n "$PYTHON_CFLAGS" && break
8169 dnl Check if the headers really work
8170 save_CPPFLAGS="$CPPFLAGS"
8171 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8172 AC_CHECK_HEADER(Python.h)
8173 CPPFLAGS="$save_CPPFLAGS"
8175 # let the PYTHON_FOR_BUILD match the same python installation that
8176 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8177 # better for PythonTests.
8178 PYTHON_FOR_BUILD=$PYTHON
8181 if test "$with_lxml" != no; then
8182 if test -z "$PYTHON_FOR_BUILD"; then
8185 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
8188 if test "$cross_compiling" != yes ; then
8189 BUILD_TYPE="$BUILD_TYPE LXML"
8194 AC_MSG_CHECKING([for python lxml])
8195 if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
8196 AC_MSG_RESULT([yes])
8200 AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
8203 if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
8204 BUILD_TYPE="$BUILD_TYPE LXML"
8205 AC_MSG_RESULT([no, using internal lxml])
8207 AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
8215 dnl By now enable_python should be "system", "internal" or "no"
8216 case $enable_python in
8220 if test "x$ac_cv_header_Python_h" != "xyes"; then
8221 AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
8225 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8226 AC_MSG_CHECKING([for correct python library version])
8227 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8230 int main(int argc, char **argv) {
8231 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
8232 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8235 ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.6 when building with Python 2])],[AC_MSG_RESULT([skipped; cross-compiling])])
8239 dnl FIXME Check if the Python library can be linked with, too?
8244 PYTHON_VERSION_MAJOR=3
8245 PYTHON_VERSION_MINOR=5
8246 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.4
8247 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
8248 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
8250 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8251 BUILD_TYPE="$BUILD_TYPE PYTHON"
8252 # Embedded Python dies without Home set
8253 if test "$HOME" = ""; then
8256 # bz2 tarball and bzip2 is not standard
8257 if test -z "$BZIP2"; then
8258 AC_PATH_PROG( BZIP2, bzip2)
8259 if test -z "$BZIP2"; then
8260 AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
8269 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8273 AC_SUBST(DISABLE_PYTHON)
8274 AC_SUBST(SYSTEM_PYTHON)
8275 AC_SUBST(PYTHON_CFLAGS)
8276 AC_SUBST(PYTHON_LIBS)
8277 AC_SUBST(PYTHON_VERSION)
8278 AC_SUBST(PYTHON_VERSION_MAJOR)
8279 AC_SUBST(PYTHON_VERSION_MINOR)
8281 AC_MSG_CHECKING([whether to build the MariaDB/MySQL Connector extension])
8282 if test "x$enable_ext_mariadb_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8283 AC_MSG_RESULT([yes])
8284 ENABLE_MARIADBC=TRUE
8288 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8293 AC_SUBST(ENABLE_MARIADBC)
8294 AC_SUBST(MARIADBC_MAJOR)
8295 AC_SUBST(MARIADBC_MINOR)
8296 AC_SUBST(MARIADBC_MICRO)
8298 if test "$ENABLE_MARIADBC" = "TRUE"; then
8300 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MARIADBC"
8302 dnl ===================================================================
8303 dnl Check for system MariaDB
8304 dnl ===================================================================
8305 AC_MSG_CHECKING([which MariaDB to use])
8306 if test "$with_system_mariadb" = "yes"; then
8307 AC_MSG_RESULT([external])
8308 SYSTEM_MARIADB_CONNECTOR_C=TRUE
8309 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8310 if test -z "$MARIADBCONFIG"; then
8311 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8312 if test -z "$MARIADBCONFIG"; then
8313 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8314 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8317 AC_MSG_CHECKING([MariaDB version])
8318 MARIADB_VERSION=`$MARIADBCONFIG --version`
8319 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8320 if test "$MARIADB_MAJOR" -ge "5"; then
8323 AC_MSG_ERROR([too old, use 5.0.x or later])
8325 AC_MSG_CHECKING([for MariaDB Client library])
8326 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8327 if test "$COM_IS_CLANG" = TRUE; then
8328 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8330 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8331 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8332 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8334 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8335 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8336 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8337 | sed -e 's|/lib64/|/lib/|')
8339 FilterLibs "${MARIADB_LIBS}"
8340 MARIADB_LIBS="${filteredlibs}"
8341 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8342 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8343 if test "$enable_bundle_mariadb" = "yes"; then
8344 AC_MSG_RESULT([yes])
8345 BUNDLE_MARIADB_CONNECTOR_C=TRUE
8346 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8348 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8350 /g' | grep -E '(mysqlclient|mariadb)')
8351 if test "$_os" = "Darwin"; then
8352 LIBMARIADB=${LIBMARIADB}.dylib
8353 elif test "$_os" = "WINNT"; then
8354 LIBMARIADB=${LIBMARIADB}.dll
8356 LIBMARIADB=${LIBMARIADB}.so
8358 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8359 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8360 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8361 AC_MSG_RESULT([found.])
8362 PathFormat "$LIBMARIADB_PATH"
8363 LIBMARIADB_PATH="$formatted_path"
8365 AC_MSG_ERROR([not found.])
8369 BUNDLE_MARIADB_CONNECTOR_C=
8372 AC_MSG_RESULT([internal])
8373 SYSTEM_MARIADB_CONNECTOR_C=
8374 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
8375 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
8376 BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
8379 AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
8380 AC_SUBST(MARIADB_CFLAGS)
8381 AC_SUBST(MARIADB_LIBS)
8382 AC_SUBST(LIBMARIADB)
8383 AC_SUBST(LIBMARIADB_PATH)
8384 AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
8387 dnl ===================================================================
8388 dnl Check for system MySQL C++ Connector
8389 dnl ===================================================================
8391 # who thought this too-generic cppconn dir was a good idea?
8392 AC_MSG_CHECKING([MySQL Connector/C++])
8393 if test "$with_system_mysql_cppconn" = "yes"; then
8394 AC_MSG_RESULT([external])
8395 SYSTEM_MYSQL_CONNECTOR_CPP=TRUE
8397 AC_CHECK_HEADER(mysql_driver.h, [],
8398 [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
8399 AC_CHECK_LIB([mysqlcppconn], [main], [:],
8400 [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
8402 LIBS="$LIBS -lmysqlcppconn"
8403 AC_MSG_CHECKING([version])
8404 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8405 #include <mysql_driver.h>
8407 int main(int argc, char **argv) {
8408 sql::Driver *driver;
8409 driver = get_driver_instance();
8410 if (driver->getMajorVersion() > 1 || \
8411 (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
8412 (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
8417 ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[AC_MSG_ERROR([MySQL C++ Connecter not tested with cross-compilation])])
8422 AC_MSG_RESULT([internal])
8423 BUILD_TYPE="$BUILD_TYPE MYSQL_CONNECTOR_CPP"
8424 SYSTEM_MYSQL_CONNECTOR_CPP=
8428 AC_SUBST(SYSTEM_MYSQL_CONNECTOR_CPP)
8430 dnl ===================================================================
8431 dnl Check for system hsqldb
8432 dnl ===================================================================
8433 if test "$with_java" != "no"; then
8434 HSQLDB_USE_JDBC_4_1=
8435 AC_MSG_CHECKING([which hsqldb to use])
8436 if test "$with_system_hsqldb" = "yes"; then
8437 AC_MSG_RESULT([external])
8439 if test -z $HSQLDB_JAR; then
8440 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8442 if ! test -f $HSQLDB_JAR; then
8443 AC_MSG_ERROR(hsqldb.jar not found.)
8445 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8449 my $file = "$ENV{'HSQLDB_JAR'}";
8450 my $zip = Archive::Zip->new( $file );
8451 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8452 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8454 push @l, split(/\n/, $mf);
8455 foreach my $line (@l)
8457 if ($line =~ m/Specification-Version:/)
8459 ($t, $version) = split (/:/,$line);
8460 $version =~ s/^\s//;
8461 ($a, $b, $c, $d) = split (/\./,$version);
8462 if ($c == "0" && $d > "8")
8477 AC_MSG_RESULT([yes])
8479 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8482 AC_MSG_RESULT([internal])
8484 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8485 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8486 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8487 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8488 AC_MSG_RESULT([yes])
8489 HSQLDB_USE_JDBC_4_1=TRUE
8494 AC_SUBST(SYSTEM_HSQLDB)
8495 AC_SUBST(HSQLDB_JAR)
8496 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8499 dnl ===================================================================
8500 dnl Check for PostgreSQL stuff
8501 dnl ===================================================================
8502 if test "x$enable_postgresql_sdbc" != "xno"; then
8503 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8505 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8506 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8508 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8509 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8512 postgres_interface=""
8513 if test "$with_system_postgresql" = "yes"; then
8514 postgres_interface="external PostgreSQL"
8515 SYSTEM_POSTGRESQL=TRUE
8516 if test "$_os" = Darwin; then
8518 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8519 pg_supp_path="$P_SEP$d$pg_supp_path"
8522 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8523 if test -z "$PGCONFIG"; then
8524 AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
8526 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8527 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8528 FilterLibs "${POSTGRESQL_LIB}"
8529 POSTGRESQL_LIB="${filteredlibs}"
8531 # if/when anything else than PostgreSQL uses Kerberos,
8532 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8537 # MacOS X has system MIT Kerberos 5 since 10.4
8538 if test "$with_krb5" != "no"; then
8541 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
8542 # that the libraries where these functions are located on macOS will change, is it?
8543 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8544 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8547 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8548 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8549 KRB5_LIBS="$KRB5_LIBS $LIBS"
8552 if test "$with_gssapi" != "no"; then
8555 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8556 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8562 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8563 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8566 Linux|GNU|*BSD|DragonFly)
8567 if test "$with_krb5" != "no"; then
8570 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8571 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8574 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8575 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8576 KRB5_LIBS="$KRB5_LIBS $LIBS"
8579 if test "$with_gssapi" != "no"; then
8582 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8583 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8589 if test "$with_krb5" = "yes"; then
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" = "yes"; 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 -n "$with_libpq_path"; then
8612 SYSTEM_POSTGRESQL=TRUE
8613 postgres_interface="external libpq"
8614 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8615 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8618 postgres_interface="internal"
8620 POSTGRESQL_INC="%OVERRIDE_ME%"
8621 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8625 AC_MSG_CHECKING([PostgreSQL C interface])
8626 AC_MSG_RESULT([$postgres_interface])
8628 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
8629 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8631 save_CPPFLAGS=$CPPFLAGS
8633 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8634 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8635 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8636 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8637 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8639 CPPFLAGS=$save_CPPFLAGS
8642 BUILD_POSTGRESQL_SDBC=TRUE
8645 AC_SUBST(WITH_GSSAPI)
8646 AC_SUBST(GSSAPI_LIBS)
8648 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8649 AC_SUBST(SYSTEM_POSTGRESQL)
8650 AC_SUBST(POSTGRESQL_INC)
8651 AC_SUBST(POSTGRESQL_LIB)
8653 dnl ===================================================================
8654 dnl Check for Firebird stuff
8655 dnl ===================================================================
8656 ENABLE_FIREBIRD_SDBC=""
8657 if test "$enable_firebird_sdbc" = "yes" ; then
8658 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8660 dnl ===================================================================
8661 dnl Check for system Firebird
8662 dnl ===================================================================
8663 AC_MSG_CHECKING([which Firebird to use])
8664 if test "$with_system_firebird" = "yes"; then
8665 AC_MSG_RESULT([external])
8666 SYSTEM_FIREBIRD=TRUE
8667 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8668 if test -z "$FIREBIRDCONFIG"; then
8669 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8670 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
8671 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
8673 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
8675 AC_MSG_NOTICE([fb_config found])
8676 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8677 AC_MSG_CHECKING([for Firebird Client library])
8678 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8679 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8680 FilterLibs "${FIREBIRD_LIBS}"
8681 FIREBIRD_LIBS="${filteredlibs}"
8683 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8684 AC_MSG_CHECKING([Firebird version])
8685 if test -n "${FIREBIRD_VERSION}"; then
8686 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8687 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8688 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
8691 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
8694 __save_CFLAGS="${CFLAGS}"
8695 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
8696 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
8697 #if defined(FB_API_VER) && FB_API_VER == 30
8698 int fb_api_is_30(void) { return 0; }
8700 #error "Wrong Firebird API version"
8701 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
8702 CFLAGS="${__save_CFLAGS}"
8704 ENABLE_FIREBIRD_SDBC="TRUE"
8705 elif test "$enable_database_connectivity" != yes; then
8706 AC_MSG_RESULT([none])
8707 elif test "$cross_compiling" = "yes"; then
8708 AC_MSG_RESULT([none])
8710 dnl Embedded Firebird has version 3.0
8711 AC_DEFINE(HAVE_FIREBIRD_30, 1)
8712 dnl We need libatomic-ops for any non X86/X64 system
8713 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
8714 dnl ===================================================================
8715 dnl Check for system libatomic-ops
8716 dnl ===================================================================
8717 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
8718 if test "$with_system_libatomic_ops" = "yes"; then
8719 SYSTEM_LIBATOMIC_OPS=TRUE
8720 AC_CHECK_HEADERS(atomic_ops.h, [],
8721 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
8723 SYSTEM_LIBATOMIC_OPS=
8724 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
8725 LIBATOMIC_OPS_LIBS="-latomic_ops"
8726 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
8730 AC_MSG_RESULT([internal])
8732 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
8733 FIREBIRD_LIBS="-lfbclient"
8735 if test "$with_system_libtommath" = "yes"; then
8736 SYSTEM_LIBTOMMATH=TRUE
8737 dnl check for tommath presence
8739 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
8740 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
8744 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
8745 LIBTOMMATH_LIBS="-ltommath"
8746 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
8749 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
8750 ENABLE_FIREBIRD_SDBC="TRUE"
8753 AC_SUBST(ENABLE_FIREBIRD_SDBC)
8754 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
8755 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
8756 AC_SUBST(LIBATOMIC_OPS_LIBS)
8757 AC_SUBST(SYSTEM_FIREBIRD)
8758 AC_SUBST(FIREBIRD_CFLAGS)
8759 AC_SUBST(FIREBIRD_LIBS)
8760 AC_SUBST([TOMMATH_CFLAGS])
8761 AC_SUBST([TOMMATH_LIBS])
8763 dnl ===================================================================
8764 dnl Check for system curl
8765 dnl ===================================================================
8766 AC_MSG_CHECKING([which libcurl to use])
8767 if test "$with_system_curl" = "auto"; then
8768 with_system_curl="$with_system_libs"
8771 if test "$with_system_curl" = "yes"; then
8772 AC_MSG_RESULT([external])
8775 # First try PKGCONFIG and then fall back
8776 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
8778 if test -n "$CURL_PKG_ERRORS"; then
8779 AC_PATH_PROG(CURLCONFIG, curl-config)
8780 if test -z "$CURLCONFIG"; then
8781 AC_MSG_ERROR([curl development files not found])
8783 CURL_LIBS=`$CURLCONFIG --libs`
8784 FilterLibs "${CURL_LIBS}"
8785 CURL_LIBS="${filteredlibs}"
8786 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
8787 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
8789 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
8790 case $curl_version in
8791 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
8792 dnl so they need to be doubled to end up in the configure script
8793 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
8794 AC_MSG_RESULT([yes])
8797 AC_MSG_ERROR([no, you have $curl_version])
8803 elif test $_os = iOS; then
8804 # Let's see if we need curl, I think not?
8805 AC_MSG_RESULT([none])
8808 AC_MSG_RESULT([internal])
8810 BUILD_TYPE="$BUILD_TYPE CURL"
8813 AC_SUBST(SYSTEM_CURL)
8814 AC_SUBST(CURL_CFLAGS)
8816 AC_SUBST(ENABLE_CURL)
8818 dnl ===================================================================
8819 dnl Check for system boost
8820 dnl ===================================================================
8821 AC_MSG_CHECKING([which boost to use])
8822 if test "$with_system_boost" = "yes"; then
8823 AC_MSG_RESULT([external])
8831 save_CXXFLAGS=$CXXFLAGS
8832 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
8833 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
8834 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
8835 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
8836 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
8837 CXXFLAGS=$save_CXXFLAGS
8839 # this is in m4/ax_boost_base.m4
8840 FilterLibs "${BOOST_LDFLAGS}"
8841 BOOST_LDFLAGS="${filteredlibs}"
8843 AC_MSG_RESULT([internal])
8844 BUILD_TYPE="$BUILD_TYPE BOOST"
8846 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
8847 # use warning-suppressing wrapper headers
8848 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
8850 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
8853 AC_SUBST(SYSTEM_BOOST)
8855 dnl ===================================================================
8856 dnl Check for system mdds
8857 dnl ===================================================================
8858 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.2 >= 1.2.3], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
8860 dnl ===================================================================
8861 dnl Check for system glm
8862 dnl ===================================================================
8863 AC_MSG_CHECKING([which glm to use])
8864 if test "$with_system_glm" = "yes"; then
8865 AC_MSG_RESULT([external])
8868 AC_CHECK_HEADER([glm/glm.hpp], [],
8869 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
8872 AC_MSG_RESULT([internal])
8873 BUILD_TYPE="$BUILD_TYPE GLM"
8875 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
8877 AC_SUBST([GLM_CFLAGS])
8878 AC_SUBST([SYSTEM_GLM])
8880 dnl ===================================================================
8881 dnl Check for system odbc
8882 dnl ===================================================================
8883 AC_MSG_CHECKING([which odbc headers to use])
8884 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
8885 AC_MSG_RESULT([external])
8886 SYSTEM_ODBC_HEADERS=TRUE
8888 if test "$build_os" = "cygwin"; then
8889 save_CPPFLAGS=$CPPFLAGS
8891 PathFormat "$winsdktest"
8892 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"
8893 AC_CHECK_HEADER(sqlext.h, [],
8894 [AC_MSG_ERROR(odbc not found. install odbc)],
8895 [#include <windows.h>])
8896 CPPFLAGS=$save_CPPFLAGS
8898 AC_CHECK_HEADER(sqlext.h, [],
8899 [AC_MSG_ERROR(odbc not found. install odbc)],[])
8901 elif test "$enable_database_connectivity" != yes; then
8902 AC_MSG_RESULT([none])
8904 AC_MSG_RESULT([internal])
8905 SYSTEM_ODBC_HEADERS=
8907 AC_SUBST(SYSTEM_ODBC_HEADERS)
8910 dnl ===================================================================
8911 dnl Check for system openldap
8912 dnl ===================================================================
8914 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
8915 AC_MSG_CHECKING([which openldap library to use])
8916 if test "$with_system_openldap" = "yes"; then
8917 AC_MSG_RESULT([external])
8918 SYSTEM_OPENLDAP=TRUE
8919 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
8920 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8921 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8923 AC_MSG_RESULT([internal])
8925 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
8928 AC_SUBST(SYSTEM_OPENLDAP)
8930 dnl ===================================================================
8931 dnl Check for system NSS
8932 dnl ===================================================================
8933 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
8934 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
8935 AC_DEFINE(HAVE_FEATURE_NSS)
8937 AC_DEFINE(ENABLE_NSS)
8938 elif test $_os != iOS ; then
8941 AC_SUBST(ENABLE_NSS)
8943 dnl ===================================================================
8944 dnl Check for TLS/SSL and cryptographic implementation to use
8945 dnl ===================================================================
8946 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
8947 if test -n "$with_tls"; then
8950 AC_DEFINE(USE_TLS_OPENSSL)
8953 if test "$enable_openssl" != "yes"; then
8954 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
8957 # warn that OpenSSL has been selected but not all TLS code has this option
8958 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
8959 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
8962 AC_DEFINE(USE_TLS_NSS)
8966 AC_MSG_WARN([Skipping TLS/SSL])
8969 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
8971 nss - Mozilla's Network Security Services (NSS)
8976 # default to using NSS, it results in smaller oox lib
8977 AC_DEFINE(USE_TLS_NSS)
8980 AC_MSG_RESULT([$TLS])
8983 dnl ===================================================================
8984 dnl Check for system sane
8985 dnl ===================================================================
8986 AC_MSG_CHECKING([which sane header to use])
8987 if test "$with_system_sane" = "yes"; then
8988 AC_MSG_RESULT([external])
8989 AC_CHECK_HEADER(sane/sane.h, [],
8990 [AC_MSG_ERROR(sane not found. install sane)], [])
8992 AC_MSG_RESULT([internal])
8993 BUILD_TYPE="$BUILD_TYPE SANE"
8996 dnl ===================================================================
8997 dnl Check for system icu
8998 dnl ===================================================================
9005 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9006 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9007 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9008 AC_MSG_CHECKING([which icu to use])
9009 if test "$with_system_icu" = "yes"; then
9010 AC_MSG_RESULT([external])
9013 AC_MSG_CHECKING([for unicode/rbbi.h])
9014 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
9017 if test "$cross_compiling" != "yes"; then
9018 PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
9019 ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9020 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9021 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9024 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9025 ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
9026 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9027 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9028 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9029 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9030 AC_MSG_RESULT([yes])
9033 if test "$with_system_icu_for_build" != "force"; then
9034 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9035 You can use --with-system-icu-for-build=force to use it anyway.])
9040 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9041 # using the system icu tools can lead to version confusion, use the
9042 # ones from the build environment when cross-compiling
9043 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9044 if test -z "$SYSTEM_GENBRK"; then
9045 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9047 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9048 if test -z "$SYSTEM_GENCCODE"; then
9049 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9051 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9052 if test -z "$SYSTEM_GENCMN"; then
9053 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9055 if test "$ICU_MAJOR" -ge "49"; then
9056 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9057 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9058 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9060 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9061 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9062 ICU_RECLASSIFIED_HEBREW_LETTER=
9066 if test "$cross_compiling" = "yes"; then
9067 if test "$ICU_MAJOR" -ge "50"; then
9068 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9073 AC_MSG_RESULT([internal])
9075 BUILD_TYPE="$BUILD_TYPE ICU"
9076 # surprisingly set these only for "internal" (to be used by various other
9077 # external libs): the system icu-config is quite unhelpful and spits out
9078 # dozens of weird flags and also default path -I/usr/include
9079 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9080 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9082 if test "$ICU_MAJOR" -ge "59"; then
9083 # As of ICU 59 it defaults to typedef char16_t UChar; which is available
9084 # with -std=c++11 but not all external libraries can be built with that,
9085 # for those use a bit-compatible typedef uint16_t UChar; see
9086 # icu/source/common/unicode/umachine.h
9087 ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
9091 AC_SUBST(SYSTEM_ICU)
9092 AC_SUBST(SYSTEM_GENBRK)
9093 AC_SUBST(SYSTEM_GENCCODE)
9094 AC_SUBST(SYSTEM_GENCMN)
9097 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9098 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9099 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9100 AC_SUBST(ICU_CFLAGS)
9102 AC_SUBST(ICU_UCHAR_TYPE)
9104 dnl ==================================================================
9106 dnl ==================================================================
9107 AC_MSG_CHECKING([whether to enable breakpad])
9108 if test "$enable_breakpad" != yes; then
9111 AC_MSG_RESULT([yes])
9112 ENABLE_BREAKPAD="TRUE"
9113 AC_DEFINE(ENABLE_BREAKPAD)
9114 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9115 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9117 AC_MSG_CHECKING([for crashreport config])
9118 if test "$with_symbol_config" = "no"; then
9119 BREAKPAD_SYMBOL_CONFIG="invalid"
9122 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9123 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9124 AC_MSG_RESULT([yes])
9126 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9128 AC_SUBST(ENABLE_BREAKPAD)
9130 dnl ==================================================================
9132 dnl ==================================================================
9133 AC_MSG_CHECKING([whether to enable fuzzers])
9134 if test "$enable_fuzzers" != yes; then
9137 AC_MSG_RESULT([yes])
9138 ENABLE_FUZZERS="TRUE"
9139 AC_DEFINE(ENABLE_FUZZERS)
9140 BUILD_TYPE="$BUILD_TYPE FUZZERS"
9142 AC_SUBST(ENABLE_FUZZERS)
9144 dnl ===================================================================
9146 dnl ===================================================================
9147 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.13 >= 0.13.3])
9148 if test "$with_system_orcus" != "yes"; then
9149 if test "$SYSTEM_BOOST" = "TRUE"; then
9150 # ===========================================================
9151 # Determine if we are going to need to link with Boost.System
9152 # ===========================================================
9153 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9154 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9155 dnl in documentation has no effect.
9156 AC_MSG_CHECKING([if we need to link with Boost.System])
9158 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9159 @%:@include <boost/version.hpp>
9161 #if BOOST_VERSION >= 105000
9162 # error yes, we need to link with Boost.System
9167 AC_MSG_RESULT([yes])
9173 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9174 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9175 AC_SUBST([BOOST_SYSTEM_LIB])
9176 AC_SUBST(SYSTEM_LIBORCUS)
9178 dnl ===================================================================
9180 dnl ===================================================================
9181 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
9182 ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
9183 ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9185 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
9186 ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
9187 ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9189 if test "$COM" = "MSC"; then # override the above
9190 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9191 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9194 if test "$with_system_harfbuzz" = "yes"; then
9195 if test "$with_system_graphite" = "no"; then
9196 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9198 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9200 _save_cflags="$CFLAGS"
9201 LIBS="$LIBS $HARFBUZZ_LIBS"
9202 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9203 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9205 CFLAGS="$_save_cflags"
9207 if test "$with_system_graphite" = "yes"; then
9208 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9212 AC_MSG_CHECKING([whether to use X11])
9213 dnl ***************************************
9214 dnl testing for X libraries and includes...
9215 dnl ***************************************
9216 if test "$USING_X11" = TRUE; then
9217 AC_DEFINE(HAVE_FEATURE_X11)
9219 AC_MSG_RESULT([$USING_X11])
9221 if test "$USING_X11" = TRUE; then
9224 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9226 if test -z "$x_includes"; then
9227 x_includes="default_x_includes"
9229 if test -z "$x_libraries"; then
9230 x_libraries="default_x_libraries"
9232 CFLAGS="$CFLAGS $X_CFLAGS"
9233 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9234 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9236 x_includes="no_x_includes"
9237 x_libraries="no_x_libraries"
9240 if test "$USING_X11" = TRUE; then
9241 dnl ===================================================================
9242 dnl Check for extension headers
9243 dnl ===================================================================
9244 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9245 [#include <X11/extensions/shape.h>])
9247 # vcl needs ICE and SM
9248 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9249 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9250 [AC_MSG_ERROR(ICE library not found)])
9251 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9252 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9253 [AC_MSG_ERROR(SM library not found)])
9256 dnl ===================================================================
9257 dnl Check for system Xrender
9258 dnl ===================================================================
9259 AC_MSG_CHECKING([whether to use Xrender])
9260 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9261 AC_MSG_RESULT([yes])
9262 PKG_CHECK_MODULES(XRENDER, xrender)
9263 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9264 FilterLibs "${XRENDER_LIBS}"
9265 XRENDER_LIBS="${filteredlibs}"
9266 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9267 [AC_MSG_ERROR(libXrender not found or functional)], [])
9268 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9269 [AC_MSG_ERROR(Xrender not found. install X)], [])
9273 AC_SUBST(XRENDER_CFLAGS)
9274 AC_SUBST(XRENDER_LIBS)
9276 dnl ===================================================================
9277 dnl Check for XRandr
9278 dnl ===================================================================
9279 AC_MSG_CHECKING([whether to enable RandR support])
9280 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9281 AC_MSG_RESULT([yes])
9282 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9283 if test "$ENABLE_RANDR" != "TRUE"; then
9284 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9285 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9287 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9288 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9289 XRANDR_LIBS="-lXrandr "
9292 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9293 FilterLibs "${XRANDR_LIBS}"
9294 XRANDR_LIBS="${filteredlibs}"
9299 AC_SUBST(XRANDR_CFLAGS)
9300 AC_SUBST(XRANDR_LIBS)
9301 AC_SUBST(ENABLE_RANDR)
9303 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9306 if test $_os = iOS -o $_os = Android; then
9309 AC_MSG_CHECKING([for webdav library])
9310 case "$WITH_WEBDAV" in
9312 AC_MSG_RESULT([serf])
9313 # Check for system apr-util
9314 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9315 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9316 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9317 if test "$COM" = "MSC"; then
9319 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9320 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9323 # Check for system serf
9324 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9325 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9326 if test "$COM" = "MSC"; then
9327 SERF_LIB_DIR="Release"
9328 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9329 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9333 AC_MSG_RESULT([neon])
9334 # Check for system neon
9335 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9336 if test "$with_system_neon" = "yes"; then
9337 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9341 AC_SUBST(NEON_VERSION)
9344 AC_MSG_RESULT([none, disabled])
9348 AC_SUBST(WITH_WEBDAV)
9350 dnl ===================================================================
9351 dnl Check for disabling cve_tests
9352 dnl ===================================================================
9353 AC_MSG_CHECKING([whether to execute CVE tests])
9354 # If not explicitly enabled or disabled, default
9355 if test -z "$enable_cve_tests"; then
9358 # Default cves off for windows with its wild and wonderful
9359 # varienty of AV software kicking in and panicking
9364 enable_cve_tests=yes
9368 if test "$enable_cve_tests" = "no"; then
9370 DISABLE_CVE_TESTS=TRUE
9371 AC_SUBST(DISABLE_CVE_TESTS)
9373 AC_MSG_RESULT([yes])
9376 dnl ===================================================================
9377 dnl Check for enabling chart XShape tests
9378 dnl ===================================================================
9379 AC_MSG_CHECKING([whether to execute chart XShape tests])
9380 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
9381 AC_MSG_RESULT([yes])
9382 ENABLE_CHART_TESTS=TRUE
9383 AC_SUBST(ENABLE_CHART_TESTS)
9388 dnl ===================================================================
9389 dnl Check for system openssl
9390 dnl ===================================================================
9392 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9393 if test "$enable_openssl" = "yes"; then
9395 if test "$_os" = Darwin ; then
9396 # OpenSSL is deprecated when building for 10.7 or later.
9398 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9399 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9401 with_system_openssl=no
9402 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9403 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9404 && test "$with_system_openssl" != "no"; then
9405 with_system_openssl=yes
9408 OPENSSL_LIBS="-lssl -lcrypto"
9410 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9412 if test "$with_system_openssl" = "yes"; then
9413 AC_MSG_CHECKING([whether openssl supports SHA512])
9415 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9417 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9421 AC_MSG_RESULT([yes])
9422 DISABLE_OPENSSL=TRUE
9424 # warn that although OpenSSL is disabled, system libraries may depend on it
9425 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9426 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9429 AC_SUBST([DISABLE_OPENSSL])
9431 dnl ===================================================================
9432 dnl Check for building gnutls
9433 dnl ===================================================================
9434 AC_MSG_CHECKING([whether to use gnutls])
9435 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
9436 AC_MSG_RESULT([yes])
9438 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9439 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9440 available in the system to use as replacement.]]))
9441 FilterLibs "${LIBGCRYPT_LIBS}"
9442 LIBGCRYPT_LIBS="${filteredlibs}"
9447 AC_SUBST([LIBGCRYPT_CFLAGS])
9448 AC_SUBST([LIBGCRYPT_LIBS])
9450 dnl ===================================================================
9451 dnl Check for system redland
9452 dnl ===================================================================
9453 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9454 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9455 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9456 if test "$with_system_redland" = "yes"; then
9457 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9458 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9464 AC_SUBST(RAPTOR_MAJOR)
9465 AC_SUBST(RASQAL_MAJOR)
9466 AC_SUBST(REDLAND_MAJOR)
9468 dnl ===================================================================
9469 dnl Check for system hunspell
9470 dnl ===================================================================
9471 AC_MSG_CHECKING([which libhunspell to use])
9472 if test "$with_system_hunspell" = "yes"; then
9473 AC_MSG_RESULT([external])
9474 SYSTEM_HUNSPELL=TRUE
9476 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9477 if test "$HUNSPELL_PC" != "TRUE"; then
9478 AC_CHECK_HEADER(hunspell.hxx, [],
9480 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9481 [AC_MSG_ERROR(hunspell headers not found.)], [])
9483 AC_CHECK_LIB([hunspell], [main], [:],
9484 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9485 HUNSPELL_LIBS=-lhunspell
9488 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9489 FilterLibs "${HUNSPELL_LIBS}"
9490 HUNSPELL_LIBS="${filteredlibs}"
9492 AC_MSG_RESULT([internal])
9494 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9495 if test "$COM" = "MSC"; then
9496 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9498 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.6"
9500 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9502 AC_SUBST(SYSTEM_HUNSPELL)
9503 AC_SUBST(HUNSPELL_CFLAGS)
9504 AC_SUBST(HUNSPELL_LIBS)
9506 dnl ===================================================================
9507 dnl Checking for altlinuxhyph
9508 dnl ===================================================================
9509 AC_MSG_CHECKING([which altlinuxhyph to use])
9510 if test "$with_system_altlinuxhyph" = "yes"; then
9511 AC_MSG_RESULT([external])
9513 AC_CHECK_HEADER(hyphen.h, [],
9514 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9515 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9516 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9517 [#include <hyphen.h>])
9518 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9519 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9520 if test -z "$HYPHEN_LIB"; then
9521 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9522 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9524 if test -z "$HYPHEN_LIB"; then
9525 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9526 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9529 AC_MSG_RESULT([internal])
9531 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9532 if test "$COM" = "MSC"; then
9533 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9535 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9538 AC_SUBST(SYSTEM_HYPH)
9539 AC_SUBST(HYPHEN_LIB)
9541 dnl ===================================================================
9542 dnl Checking for mythes
9543 dnl ===================================================================
9544 AC_MSG_CHECKING([which mythes to use])
9545 if test "$with_system_mythes" = "yes"; then
9546 AC_MSG_RESULT([external])
9549 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9550 if test "$MYTHES_PKGCONFIG" = "no"; then
9551 AC_CHECK_HEADER(mythes.hxx, [],
9552 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9553 AC_CHECK_LIB([mythes-1.2], [main], [:],
9554 [ MYTHES_FOUND=no], [])
9555 if test "$MYTHES_FOUND" = "no"; then
9556 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9557 [ MYTHES_FOUND=no], [])
9559 if test "$MYTHES_FOUND" = "no"; then
9560 AC_MSG_ERROR([mythes library not found!.])
9564 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9565 FilterLibs "${MYTHES_LIBS}"
9566 MYTHES_LIBS="${filteredlibs}"
9568 AC_MSG_RESULT([internal])
9570 BUILD_TYPE="$BUILD_TYPE MYTHES"
9571 if test "$COM" = "MSC"; then
9572 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9574 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9577 AC_SUBST(SYSTEM_MYTHES)
9578 AC_SUBST(MYTHES_CFLAGS)
9579 AC_SUBST(MYTHES_LIBS)
9581 dnl ===================================================================
9582 dnl How should we build the linear programming solver ?
9583 dnl ===================================================================
9586 AC_MSG_CHECKING([whether to build with CoinMP])
9587 if test "$enable_coinmp" != "no"; then
9589 AC_MSG_RESULT([yes])
9590 if test "$with_system_coinmp" = "yes"; then
9592 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
9593 FilterLibs "${COINMP_LIBS}"
9594 COINMP_LIBS="${filteredlibs}"
9596 BUILD_TYPE="$BUILD_TYPE COINMP"
9601 AC_SUBST(ENABLE_COINMP)
9602 AC_SUBST(SYSTEM_COINMP)
9603 AC_SUBST(COINMP_CFLAGS)
9604 AC_SUBST(COINMP_LIBS)
9607 AC_MSG_CHECKING([whether to build with lpsolve])
9608 if test "$enable_lpsolve" != "no"; then
9610 AC_MSG_RESULT([yes])
9614 AC_SUBST(ENABLE_LPSOLVE)
9616 if test "$ENABLE_LPSOLVE" = TRUE; then
9617 AC_MSG_CHECKING([which lpsolve to use])
9618 if test "$with_system_lpsolve" = "yes"; then
9619 AC_MSG_RESULT([external])
9621 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9622 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9624 # some systems need this. Like Ubuntu....
9625 AC_CHECK_LIB(m, floor)
9626 AC_CHECK_LIB(dl, dlopen)
9627 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9628 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9631 AC_MSG_RESULT([internal])
9633 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9636 AC_SUBST(SYSTEM_LPSOLVE)
9638 dnl ===================================================================
9639 dnl Checking for libexttextcat
9640 dnl ===================================================================
9641 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
9642 if test "$with_system_libexttextcat" = "yes"; then
9643 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9645 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9647 dnl ***************************************
9648 dnl testing libc version for Linux...
9649 dnl ***************************************
9650 if test "$_os" = "Linux"; then
9651 AC_MSG_CHECKING([whether libc is >= 2.1.1])
9652 exec 6>/dev/null # no output
9653 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
9654 exec 6>&1 # output on again
9655 if test "$HAVE_LIBC"; then
9656 AC_MSG_RESULT([yes])
9658 AC_MSG_ERROR([no, upgrade libc])
9662 dnl =========================================
9663 dnl Check for uuidgen
9664 dnl =========================================
9665 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9666 # presence is already tested above in the WINDOWS_SDK_HOME check
9670 AC_PATH_PROG([UUIDGEN], [uuidgen])
9671 if test -z "$UUIDGEN"; then
9672 AC_MSG_WARN([uuid is needed for building installation sets])
9676 dnl ***************************************
9677 dnl Checking for bison and flex
9678 dnl ***************************************
9679 AC_PATH_PROG(BISON, bison)
9680 if test -z "$BISON"; then
9681 AC_MSG_ERROR([no bison found in \$PATH, install it])
9683 AC_MSG_CHECKING([the bison version])
9684 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9685 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9686 # Accept newer than 2.0
9687 if test "$_bison_longver" -lt 2000; then
9688 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
9692 AC_PATH_PROG(FLEX, flex)
9693 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9694 FLEX=`cygpath -m $FLEX`
9696 if test -z "$FLEX"; then
9697 AC_MSG_ERROR([no flex found in \$PATH, install it])
9699 AC_MSG_CHECKING([the flex version])
9700 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
9701 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
9702 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
9706 dnl ***************************************
9707 dnl Checking for patch
9708 dnl ***************************************
9709 AC_PATH_PROG(PATCH, patch)
9710 if test -z "$PATCH"; then
9711 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
9714 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9715 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9716 if test -z "$with_gnu_patch"; then
9719 if test -x "$with_gnu_patch"; then
9720 GNUPATCH=$with_gnu_patch
9722 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9726 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9727 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9728 AC_MSG_RESULT([yes])
9730 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9736 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9737 GNUPATCH=`cygpath -m $GNUPATCH`
9740 dnl We also need to check for --with-gnu-cp
9742 if test -z "$with_gnu_cp"; then
9743 # check the place where the good stuff is hidden on Solaris...
9744 if test -x /usr/gnu/bin/cp; then
9745 GNUCP=/usr/gnu/bin/cp
9747 AC_PATH_PROGS(GNUCP, gnucp cp)
9749 if test -z $GNUCP; then
9750 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9753 if test -x "$with_gnu_cp"; then
9756 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9760 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9761 GNUCP=`cygpath -m $GNUCP`
9764 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9765 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9766 AC_MSG_RESULT([yes])
9767 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9768 AC_MSG_RESULT([yes])
9771 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9774 AC_MSG_RESULT([no gnucp found - using the system's cp command])
9777 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9786 dnl ***************************************
9787 dnl testing assembler path
9788 dnl ***************************************
9790 if test "$_os" = "WINNT"; then
9791 if test "$BITNESS_OVERRIDE" = ""; then
9793 assembler_bin=$CL_DIR
9796 assembler_bin=$CL_DIR
9799 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
9800 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
9801 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
9802 AC_MSG_RESULT([found])
9803 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
9805 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9808 PathFormat "$ASM_HOME"
9809 ASM_HOME="$formatted_path"
9816 dnl ===================================================================
9817 dnl We need zip and unzip
9818 dnl ===================================================================
9819 AC_PATH_PROG(ZIP, zip)
9820 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9821 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9822 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],,)
9825 AC_PATH_PROG(UNZIP, unzip)
9826 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9828 dnl ===================================================================
9829 dnl Zip must be a specific type for different build types.
9830 dnl ===================================================================
9831 if test $build_os = cygwin; then
9832 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
9833 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
9837 dnl ===================================================================
9838 dnl We need touch with -h option support.
9839 dnl ===================================================================
9840 AC_PATH_PROG(TOUCH, touch)
9841 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
9843 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
9844 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],,)
9847 dnl ===================================================================
9848 dnl Check for system epoxy
9849 dnl ===================================================================
9850 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
9852 dnl ===================================================================
9853 dnl Set vcl option: coordinate device in double or sal_Int32
9854 dnl ===================================================================
9856 dnl disabled for now, we don't want subtle differences between OSs
9857 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
9858 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
9859 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
9860 dnl AC_MSG_RESULT([double])
9862 dnl AC_MSG_RESULT([sal_Int32])
9865 dnl ===================================================================
9866 dnl Test which vclplugs have to be built.
9867 dnl ===================================================================
9869 if test "$USING_X11" != TRUE; then
9876 if test "x$enable_gtk3" = "xyes"; then
9877 if test "$with_system_cairo" = no; then
9878 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
9880 : ${with_system_cairo:=yes}
9881 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="")
9882 if test "x$ENABLE_GTK3" = "xTRUE"; then
9884 dnl Avoid installed by unpackaged files for now.
9885 if test -z "$PKGFORMAT"; then
9886 GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
9889 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
9891 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9892 FilterLibs "${GTK3_LIBS}"
9893 GTK3_LIBS="${filteredlibs}"
9895 dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
9896 if test "$with_system_epoxy" != "yes"; then
9897 AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
9901 AC_SUBST(GTK3_CFLAGS)
9902 AC_SUBST(ENABLE_GTK3)
9905 if test "x$enable_gtk" = "xyes"; then
9906 if test "$with_system_cairo" = no; then
9907 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
9909 : ${with_system_cairo:=yes}
9911 AC_DEFINE(ENABLE_GTK)
9914 AC_SUBST(ENABLE_GTK)
9917 if test "x$enable_kde4" = "xyes"; then
9919 AC_DEFINE(ENABLE_KDE4)
9922 AC_SUBST(ENABLE_KDE4)
9925 if test "x$enable_qt5" = "xyes"; then
9927 AC_DEFINE(ENABLE_QT5)
9930 AC_SUBST(ENABLE_QT5)
9933 if test "x$enable_kde5" = "xyes"; then
9935 AC_DEFINE(ENABLE_KDE5)
9938 AC_SUBST(ENABLE_KDE5)
9941 if test "x$enable_gtk3_kde5" = "xyes"; then
9942 ENABLE_GTK3_KDE5="TRUE"
9943 AC_DEFINE(ENABLE_GTK3_KDE5)
9946 AC_SUBST(ENABLE_GTK3_KDE5)
9948 build_vcl_plugins="$R"
9949 if test -z "$build_vcl_plugins"; then
9950 build_vcl_plugins="none"
9952 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
9954 dnl ===================================================================
9955 dnl check for dbus support
9956 dnl ===================================================================
9961 if test "$enable_dbus" = "no"; then
9965 AC_MSG_CHECKING([whether to enable DBUS support])
9966 if test "$test_dbus" = "yes"; then
9968 AC_MSG_RESULT([yes])
9969 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
9970 AC_DEFINE(ENABLE_DBUS)
9971 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9972 FilterLibs "${DBUS_LIBS}"
9973 DBUS_LIBS="${filteredlibs}"
9978 AC_SUBST(ENABLE_DBUS)
9979 AC_SUBST(DBUS_CFLAGS)
9982 AC_MSG_CHECKING([whether to enable Impress remote control])
9983 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
9984 AC_MSG_RESULT([yes])
9985 ENABLE_SDREMOTE=TRUE
9986 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
9988 # If not explicitly enabled or disabled, default
9989 if test -z "$enable_sdremote_bluetooth"; then
9992 # Default to yes for these
9993 enable_sdremote_bluetooth=yes
9997 enable_sdremote_bluetooth=no
10001 # $enable_sdremote_bluetooth is guaranteed non-empty now
10003 if test "$enable_sdremote_bluetooth" != "no"; then
10004 if test "$OS" = "LINUX"; then
10005 if test "$ENABLE_DBUS" = "TRUE"; then
10006 AC_MSG_RESULT([yes])
10007 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10008 dnl ===================================================================
10009 dnl Check for system bluez
10010 dnl ===================================================================
10011 AC_MSG_CHECKING([which Bluetooth header to use])
10012 if test "$with_system_bluez" = "yes"; then
10013 AC_MSG_RESULT([external])
10014 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10015 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10018 AC_MSG_RESULT([internal])
10022 AC_MSG_RESULT([no, dbus disabled])
10023 ENABLE_SDREMOTE_BLUETOOTH=
10027 AC_MSG_RESULT([yes])
10028 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10032 AC_MSG_RESULT([no])
10033 ENABLE_SDREMOTE_BLUETOOTH=
10039 AC_MSG_RESULT([no])
10041 AC_SUBST(ENABLE_SDREMOTE)
10042 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10043 AC_SUBST(SYSTEM_BLUEZ)
10045 dnl ===================================================================
10046 dnl Check whether the gtk 2.0 libraries are available.
10047 dnl ===================================================================
10051 ENABLE_SYSTRAY_GTK=""
10052 if test "$test_gtk" = "yes"; then
10054 if test "$ENABLE_GTK" = "TRUE"; then
10055 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]))
10056 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10057 FilterLibs "${GTK_LIBS}"
10058 GTK_LIBS="${filteredlibs}"
10059 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]))
10060 BUILD_TYPE="$BUILD_TYPE GTK"
10061 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10062 FilterLibs "${GTHREAD_LIBS}"
10063 GTHREAD_LIBS="${filteredlibs}"
10065 if test "x$enable_systray" = "xyes"; then
10066 ENABLE_SYSTRAY_GTK="TRUE"
10069 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10070 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10071 [ENABLE_GTK_PRINT="TRUE"],
10072 [ENABLE_GTK_PRINT=""])
10073 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10074 FilterLibs "${GTK_PRINT_LIBS}"
10075 GTK_PRINT_LIBS="${filteredlibs}"
10077 AC_MSG_CHECKING([whether to enable GIO support])
10078 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10079 dnl Need at least 2.26 for the dbus support.
10080 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10081 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10082 if test "$ENABLE_GIO" = "TRUE"; then
10083 AC_DEFINE(ENABLE_GIO)
10084 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10085 FilterLibs "${GIO_LIBS}"
10086 GIO_LIBS="${filteredlibs}"
10089 AC_MSG_RESULT([no])
10093 AC_SUBST(ENABLE_GIO)
10094 AC_SUBST(GIO_CFLAGS)
10096 AC_SUBST(ENABLE_SYSTRAY_GTK)
10097 AC_SUBST(GTK_CFLAGS)
10099 AC_SUBST(GTHREAD_CFLAGS)
10100 AC_SUBST(GTHREAD_LIBS)
10101 AC_SUBST([ENABLE_GTK_PRINT])
10102 AC_SUBST([GTK_PRINT_CFLAGS])
10103 AC_SUBST([GTK_PRINT_LIBS])
10106 dnl ===================================================================
10108 SPLIT_APP_MODULES=""
10109 if test "$enable_split_app_modules" = "yes"; then
10110 SPLIT_APP_MODULES="TRUE"
10112 AC_SUBST(SPLIT_APP_MODULES)
10114 SPLIT_OPT_FEATURES=""
10115 if test "$enable_split_opt_features" = "yes"; then
10116 SPLIT_OPT_FEATURES="TRUE"
10118 AC_SUBST(SPLIT_OPT_FEATURES)
10120 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10121 if test "$enable_cairo_canvas" = yes; then
10122 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10124 enable_cairo_canvas=no
10125 elif test -z "$enable_cairo_canvas"; then
10126 enable_cairo_canvas=yes
10129 ENABLE_CAIRO_CANVAS=""
10130 if test "$enable_cairo_canvas" = "yes"; then
10132 ENABLE_CAIRO_CANVAS="TRUE"
10133 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10135 AC_SUBST(ENABLE_CAIRO_CANVAS)
10137 dnl ===================================================================
10138 dnl Check whether the GStreamer libraries are available.
10139 dnl It's possible to build avmedia with both GStreamer backends!
10140 dnl ===================================================================
10142 ENABLE_GSTREAMER_1_0=""
10144 if test "$build_gstreamer_1_0" = "yes"; then
10146 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10147 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10148 ENABLE_GSTREAMER_1_0="TRUE"
10149 AC_MSG_RESULT([yes])
10150 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10151 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10152 FilterLibs "${GSTREAMER_1_0_LIBS}"
10153 GSTREAMER_1_0_LIBS="${filteredlibs}"
10155 AC_MSG_RESULT([no])
10158 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10159 AC_SUBST(GSTREAMER_1_0_LIBS)
10160 AC_SUBST(ENABLE_GSTREAMER_1_0)
10163 ENABLE_GSTREAMER_0_10=""
10164 if test "$build_gstreamer_0_10" = "yes"; then
10166 AC_MSG_CHECKING([whether to enable the GStreamer 0.10 avmedia backend])
10167 if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10168 ENABLE_GSTREAMER_0_10="TRUE"
10169 AC_MSG_RESULT([yes])
10170 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10],, [
10171 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10] )
10173 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10174 FilterLibs "${GSTREAMER_0_10_LIBS}"
10175 GSTREAMER_0_10_LIBS="${filteredlibs}"
10177 AC_MSG_RESULT([no])
10181 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10182 AC_SUBST(GSTREAMER_0_10_LIBS)
10183 AC_SUBST(ENABLE_GSTREAMER_0_10)
10185 dnl ===================================================================
10186 dnl Check whether to build the VLC avmedia backend
10187 dnl ===================================================================
10191 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10192 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10194 AC_MSG_RESULT([yes])
10196 AC_MSG_RESULT([no])
10198 AC_SUBST(ENABLE_VLC)
10200 ENABLE_OPENGL_TRANSITIONS=
10201 ENABLE_OPENGL_CANVAS=
10202 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10204 elif test "$_os" = "Darwin"; then
10205 # We use frameworks on Mac OS X, no need for detail checks
10206 ENABLE_OPENGL_TRANSITIONS=TRUE
10207 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10208 ENABLE_OPENGL_CANVAS=TRUE
10209 elif test $_os = WINNT; then
10210 ENABLE_OPENGL_TRANSITIONS=TRUE
10211 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10212 ENABLE_OPENGL_CANVAS=TRUE
10214 if test "$USING_X11" = TRUE; then
10215 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10216 ENABLE_OPENGL_TRANSITIONS=TRUE
10217 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10218 ENABLE_OPENGL_CANVAS=TRUE
10222 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10223 AC_SUBST(ENABLE_OPENGL_CANVAS)
10225 dnl =================================================
10226 dnl Check whether to build with OpenCL support.
10227 dnl =================================================
10229 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10230 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10231 # platform (optional at run-time, used through clew).
10232 BUILD_TYPE="$BUILD_TYPE OPENCL"
10233 AC_DEFINE(HAVE_FEATURE_OPENCL)
10236 dnl =================================================
10237 dnl Check whether to build with dconf support.
10238 dnl =================================================
10240 if test "$enable_dconf" != no; then
10241 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10242 if test "$enable_dconf" = yes; then
10243 AC_MSG_ERROR([dconf not found])
10248 AC_MSG_CHECKING([whether to enable dconf])
10249 if test "$enable_dconf" = no; then
10253 AC_MSG_RESULT([no])
10256 AC_DEFINE(ENABLE_DCONF)
10257 AC_MSG_RESULT([yes])
10259 AC_SUBST([DCONF_CFLAGS])
10260 AC_SUBST([DCONF_LIBS])
10261 AC_SUBST([ENABLE_DCONF])
10264 AC_MSG_CHECKING([whether to build the PDF import feature])
10266 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10267 AC_MSG_RESULT([yes])
10268 ENABLE_PDFIMPORT=TRUE
10269 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10271 dnl ===================================================================
10272 dnl Check for system poppler
10273 dnl ===================================================================
10274 AC_MSG_CHECKING([which PDF import backend to use])
10275 if test "$with_system_poppler" = "yes"; then
10276 AC_MSG_RESULT([external])
10277 SYSTEM_POPPLER=TRUE
10278 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10279 AC_LANG_PUSH([C++])
10280 save_CXXFLAGS=$CXXFLAGS
10281 save_CPPFLAGS=$CPPFLAGS
10282 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10283 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10284 AC_CHECK_HEADER([cpp/poppler-version.h],
10285 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10287 CXXFLAGS=$save_CXXFLAGS
10288 CPPFLAGS=$save_CPPFLAGS
10290 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10292 FilterLibs "${POPPLER_LIBS}"
10293 POPPLER_LIBS="${filteredlibs}"
10295 AC_MSG_RESULT([internal])
10297 BUILD_TYPE="$BUILD_TYPE POPPLER"
10298 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10300 AC_DEFINE([ENABLE_PDFIMPORT],1)
10302 AC_MSG_RESULT([no])
10304 AC_SUBST(ENABLE_PDFIMPORT)
10305 AC_SUBST(SYSTEM_POPPLER)
10306 AC_SUBST(POPPLER_CFLAGS)
10307 AC_SUBST(POPPLER_LIBS)
10310 AC_MSG_CHECKING([whether to build PDFium])
10312 if test -z "$enable_pdfium" -o "$enable_pdfium" = yes; then
10313 AC_MSG_RESULT([yes])
10315 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10316 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10318 AC_MSG_RESULT([no])
10320 AC_SUBST(ENABLE_PDFIUM)
10324 if test "$build_for_ios" = "YES"; then
10325 AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
10326 AC_MSG_RESULT([yes])
10327 elif test "$enable_mpl_subset" = "yes"; then
10328 AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
10329 AC_MSG_RESULT([yes])
10330 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
10331 dnl ===================================================================
10332 dnl Check for system gpgme
10333 dnl ===================================================================
10334 AC_MSG_CHECKING([which gpgmepp to use])
10335 if test "$with_system_gpgmepp" = "yes"; then
10336 AC_MSG_RESULT([external])
10337 SYSTEM_GPGMEPP=TRUE
10339 # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
10340 AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
10341 [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
10342 # progress_callback is the only func with plain C linkage
10343 # checking for it also filters out older, KDE-dependent libgpgmepp versions
10344 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
10345 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
10346 AC_CHECK_HEADER(gpgme.h, [],
10347 [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
10349 AC_MSG_RESULT([internal])
10350 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
10351 AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
10353 GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
10354 LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
10355 if test "$_os" != "WINNT"; then
10356 GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
10357 LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
10358 elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
10359 AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
10362 ENABLE_GPGMEPP=TRUE
10363 AC_DEFINE([HAVE_FEATURE_GPGME])
10364 AC_PATH_PROG(GPG, gpg)
10365 # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
10366 # so let's exclude that manually for the moment
10367 if test -n "$GPG" -a "$_os" != "WINNT"; then
10368 # make sure we not only have a working gpgme, but a full working
10369 # gpg installation to run OpenPGP signature verification
10370 AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
10372 if test "$_os" = "Linux"; then
10374 AC_MSG_CHECKING([for /run/user/$uid])
10375 if test -d /run/user/$uid; then
10376 AC_MSG_RESULT([yes])
10377 AC_PATH_PROG(GPGCONF, gpgconf)
10378 AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
10379 if $GPGCONF --dump-options > /dev/null ; then
10380 if $GPGCONF --dump-options | grep -q create-socketdir ; then
10381 AC_MSG_RESULT([yes])
10382 AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
10384 AC_MSG_RESULT([no])
10387 AC_MSG_RESULT([no. missing or broken gpgconf?])
10390 AC_MSG_RESULT([no])
10394 AC_SUBST(ENABLE_GPGMEPP)
10395 AC_SUBST(SYSTEM_GPGMEPP)
10396 AC_SUBST(GPG_ERROR_CFLAGS)
10397 AC_SUBST(GPG_ERROR_LIBS)
10398 AC_SUBST(LIBASSUAN_CFLAGS)
10399 AC_SUBST(LIBASSUAN_LIBS)
10400 AC_SUBST(GPGMEPP_CFLAGS)
10401 AC_SUBST(GPGMEPP_LIBS)
10403 AC_SUBST(HAVE_GPGCONF_SOCKETDIR)
10405 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10406 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10407 AC_MSG_RESULT([yes])
10408 ENABLE_MEDIAWIKI=TRUE
10409 BUILD_TYPE="$BUILD_TYPE XSLTML"
10410 if test "x$with_java" = "xno"; then
10411 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10414 AC_MSG_RESULT([no])
10416 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10418 AC_SUBST(ENABLE_MEDIAWIKI)
10420 AC_MSG_CHECKING([whether to build the Report Builder])
10421 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10422 AC_MSG_RESULT([yes])
10423 ENABLE_REPORTBUILDER=TRUE
10424 AC_MSG_CHECKING([which jfreereport libs to use])
10425 if test "$with_system_jfreereport" = "yes"; then
10426 SYSTEM_JFREEREPORT=TRUE
10427 AC_MSG_RESULT([external])
10428 if test -z $SAC_JAR; then
10429 SAC_JAR=/usr/share/java/sac.jar
10431 if ! test -f $SAC_JAR; then
10432 AC_MSG_ERROR(sac.jar not found.)
10435 if test -z $LIBXML_JAR; then
10436 if test -f /usr/share/java/libxml-1.0.0.jar; then
10437 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
10438 elif test -f /usr/share/java/libxml.jar; then
10439 LIBXML_JAR=/usr/share/java/libxml.jar
10441 AC_MSG_ERROR(libxml.jar replacement not found.)
10443 elif ! test -f $LIBXML_JAR; then
10444 AC_MSG_ERROR(libxml.jar not found.)
10447 if test -z $FLUTE_JAR; then
10448 if test -f/usr/share/java/flute-1.3.0.jar; then
10449 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
10450 elif test -f /usr/share/java/flute.jar; then
10451 FLUTE_JAR=/usr/share/java/flute.jar
10453 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
10455 elif ! test -f $FLUTE_JAR; then
10456 AC_MSG_ERROR(flute-1.3.0.jar not found.)
10459 if test -z $JFREEREPORT_JAR; then
10460 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
10461 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
10462 elif test -f /usr/share/java/flow-engine.jar; then
10463 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
10465 AC_MSG_ERROR(jfreereport.jar replacement not found.)
10467 elif ! test -f $JFREEREPORT_JAR; then
10468 AC_MSG_ERROR(jfreereport.jar not found.)
10471 if test -z $LIBLAYOUT_JAR; then
10472 if test -f /usr/share/java/liblayout-0.2.9.jar; then
10473 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
10474 elif test -f /usr/share/java/liblayout.jar; then
10475 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
10477 AC_MSG_ERROR(liblayout.jar replacement not found.)
10479 elif ! test -f $LIBLAYOUT_JAR; then
10480 AC_MSG_ERROR(liblayout.jar not found.)
10483 if test -z $LIBLOADER_JAR; then
10484 if test -f /usr/share/java/libloader-1.0.0.jar; then
10485 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
10486 elif test -f /usr/share/java/libloader.jar; then
10487 LIBLOADER_JAR=/usr/share/java/libloader.jar
10489 AC_MSG_ERROR(libloader.jar replacement not found.)
10491 elif ! test -f $LIBLOADER_JAR; then
10492 AC_MSG_ERROR(libloader.jar not found.)
10495 if test -z $LIBFORMULA_JAR; then
10496 if test -f /usr/share/java/libformula-0.2.0.jar; then
10497 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
10498 elif test -f /usr/share/java/libformula.jar; then
10499 LIBFORMULA_JAR=/usr/share/java/libformula.jar
10501 AC_MSG_ERROR(libformula.jar replacement not found.)
10503 elif ! test -f $LIBFORMULA_JAR; then
10504 AC_MSG_ERROR(libformula.jar not found.)
10507 if test -z $LIBREPOSITORY_JAR; then
10508 if test -f /usr/share/java/librepository-1.0.0.jar; then
10509 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
10510 elif test -f /usr/share/java/librepository.jar; then
10511 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
10513 AC_MSG_ERROR(librepository.jar replacement not found.)
10515 elif ! test -f $LIBREPOSITORY_JAR; then
10516 AC_MSG_ERROR(librepository.jar not found.)
10519 if test -z $LIBFONTS_JAR; then
10520 if test -f /usr/share/java/libfonts-1.0.0.jar; then
10521 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
10522 elif test -f /usr/share/java/libfonts.jar; then
10523 LIBFONTS_JAR=/usr/share/java/libfonts.jar
10525 AC_MSG_ERROR(libfonts.jar replacement not found.)
10527 elif ! test -f $LIBFONTS_JAR; then
10528 AC_MSG_ERROR(libfonts.jar not found.)
10531 if test -z $LIBSERIALIZER_JAR; then
10532 if test -f /usr/share/java/libserializer-1.0.0.jar; then
10533 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
10534 elif test -f /usr/share/java/libserializer.jar; then
10535 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
10537 AC_MSG_ERROR(libserializer.jar replacement not found.)
10539 elif ! test -f $LIBSERIALIZER_JAR; then
10540 AC_MSG_ERROR(libserializer.jar not found.)
10543 if test -z $LIBBASE_JAR; then
10544 if test -f /usr/share/java/libbase-1.0.0.jar; then
10545 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
10546 elif test -f /usr/share/java/libbase.jar; then
10547 LIBBASE_JAR=/usr/share/java/libbase.jar
10549 AC_MSG_ERROR(libbase.jar replacement not found.)
10551 elif ! test -f $LIBBASE_JAR; then
10552 AC_MSG_ERROR(libbase.jar not found.)
10556 AC_MSG_RESULT([internal])
10557 SYSTEM_JFREEREPORT=
10558 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10561 AC_MSG_RESULT([no])
10562 ENABLE_REPORTBUILDER=
10563 SYSTEM_JFREEREPORT=
10565 AC_SUBST(ENABLE_REPORTBUILDER)
10566 AC_SUBST(SYSTEM_JFREEREPORT)
10568 AC_SUBST(LIBXML_JAR)
10569 AC_SUBST(FLUTE_JAR)
10570 AC_SUBST(JFREEREPORT_JAR)
10571 AC_SUBST(LIBBASE_JAR)
10572 AC_SUBST(LIBLAYOUT_JAR)
10573 AC_SUBST(LIBLOADER_JAR)
10574 AC_SUBST(LIBFORMULA_JAR)
10575 AC_SUBST(LIBREPOSITORY_JAR)
10576 AC_SUBST(LIBFONTS_JAR)
10577 AC_SUBST(LIBSERIALIZER_JAR)
10579 # this has to be here because both the Wiki Publisher and the SRB use
10581 COMMONS_LOGGING_VERSION=1.2
10582 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
10583 AC_MSG_CHECKING([which Apache commons-* libs to use])
10584 if test "$with_system_apache_commons" = "yes"; then
10585 SYSTEM_APACHE_COMMONS=TRUE
10586 AC_MSG_RESULT([external])
10587 if test -z $COMMONS_LOGGING_JAR; then
10588 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
10589 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
10590 elif test -f /usr/share/java/commons-logging.jar; then
10591 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
10593 AC_MSG_ERROR(commons-logging.jar replacement not found.)
10595 elif ! test -f $COMMONS_LOGGING_JAR; then
10596 AC_MSG_ERROR(commons-logging.jar not found.)
10599 AC_MSG_RESULT([internal])
10600 SYSTEM_APACHE_COMMONS=
10601 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
10604 AC_SUBST(SYSTEM_APACHE_COMMONS)
10605 AC_SUBST(COMMONS_LOGGING_JAR)
10606 AC_SUBST(COMMONS_LOGGING_VERSION)
10608 # scripting provider for BeanShell?
10609 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10610 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10611 AC_MSG_RESULT([yes])
10612 ENABLE_SCRIPTING_BEANSHELL=TRUE
10614 dnl ===================================================================
10615 dnl Check for system beanshell
10616 dnl ===================================================================
10617 AC_MSG_CHECKING([which beanshell to use])
10618 if test "$with_system_beanshell" = "yes"; then
10619 AC_MSG_RESULT([external])
10621 if test -z $BSH_JAR; then
10622 BSH_JAR=/usr/share/java/bsh.jar
10624 if ! test -f $BSH_JAR; then
10625 AC_MSG_ERROR(bsh.jar not found.)
10628 AC_MSG_RESULT([internal])
10630 BUILD_TYPE="$BUILD_TYPE BSH"
10633 AC_MSG_RESULT([no])
10634 ENABLE_SCRIPTING_BEANSHELL=
10635 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10637 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10638 AC_SUBST(SYSTEM_BSH)
10641 # scripting provider for JavaScript?
10642 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10643 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10644 AC_MSG_RESULT([yes])
10645 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10647 dnl ===================================================================
10648 dnl Check for system rhino
10649 dnl ===================================================================
10650 AC_MSG_CHECKING([which rhino to use])
10651 if test "$with_system_rhino" = "yes"; then
10652 AC_MSG_RESULT([external])
10654 if test -z $RHINO_JAR; then
10655 RHINO_JAR=/usr/share/java/js.jar
10657 if ! test -f $RHINO_JAR; then
10658 AC_MSG_ERROR(js.jar not found.)
10661 AC_MSG_RESULT([internal])
10663 BUILD_TYPE="$BUILD_TYPE RHINO"
10666 AC_MSG_RESULT([no])
10667 ENABLE_SCRIPTING_JAVASCRIPT=
10668 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10670 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10671 AC_SUBST(SYSTEM_RHINO)
10672 AC_SUBST(RHINO_JAR)
10674 # This is only used in KDE3/KDE4 checks to determine if /usr/lib64
10675 # paths should be added to library search path. So lets put all 64-bit
10678 case "$host_cpu" in
10679 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
10680 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
10681 supports_multilib="yes"
10688 dnl ===================================================================
10689 dnl KDE4 Integration
10690 dnl ===================================================================
10696 KDE4_GLIB_CFLAGS=""
10699 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10700 qt4_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10701 qt4_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10703 kde4_incdirs="/usr/include /usr/include/kde4 $x_includes"
10704 kde4_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10706 if test -n "$supports_multilib"; then
10707 qt4_libdirs="$qt4_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10708 kde4_libdirs="$kde4_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10711 if test -n "$QTDIR"; then
10712 qt4_incdirs="$QTDIR/include $qt4_incdirs"
10713 if test -z "$supports_multilib"; then
10714 qt4_libdirs="$QTDIR/lib $qt4_libdirs"
10716 qt4_libdirs="$QTDIR/lib64 $QTDIR/lib $qt4_libdirs"
10719 if test -n "$QT4DIR"; then
10720 qt4_incdirs="$QT4DIR/include $qt4_incdirs"
10721 if test -z "$supports_multilib"; then
10722 qt4_libdirs="$QT4DIR/lib $qt4_libdirs"
10724 qt4_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt4_libdirs"
10728 if test -n "$KDEDIR"; then
10729 kde4_incdirs="$KDEDIR/include $kde4_incdirs"
10730 if test -z "$supports_multilib"; then
10731 kde4_libdirs="$KDEDIR/lib $kde4_libdirs"
10733 kde4_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde4_libdirs"
10736 if test -n "$KDE4DIR"; then
10737 kde4_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde4_incdirs"
10738 if test -z "$supports_multilib"; then
10739 kde4_libdirs="$KDE4DIR/lib $kde4_libdirs"
10741 kde4_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde4_libdirs"
10745 qt4_test_include="Qt/qobject.h"
10746 qt4_test_library="libQtNetwork.so"
10747 kde4_test_include="kwindowsystem.h"
10748 kde4_test_library="libsolid.so"
10750 AC_MSG_CHECKING([for Qt4 headers])
10751 qt4_header_dir="no"
10752 for inc_dir in $qt4_incdirs; do
10753 if test -r "$inc_dir/$qt4_test_include"; then
10754 qt4_header_dir="$inc_dir"
10759 AC_MSG_RESULT([$qt4_header_dir])
10760 if test "x$qt4_header_dir" = "xno"; then
10761 AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10764 dnl Check for qmake
10765 AC_PATH_PROGS( QMAKE4, [qmake-qt4 qmake], no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
10766 if test "$QMAKE4" = "no"; then
10767 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10769 qmake4_test_ver="`$QMAKE4 -v 2>&1 | sed -n -e '/^Using Qt version 4\./p'`"
10770 if test -z "$qmake4_test_ver"; then
10771 AC_MSG_ERROR([Wrong qmake for Qt4 found. Please specify the root of your Qt installation by exporting QT4DIR before running "configure".])
10775 qt4_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt4_libdirs"
10776 AC_MSG_CHECKING([for Qt4 libraries])
10778 for lib_dir in $qt4_libdirs; do
10779 if test -r "$lib_dir/$qt4_test_library"; then
10780 qt4_lib_dir="$lib_dir"
10781 PKG_CONFIG_PATH="$qt4_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
10786 AC_MSG_RESULT([$qt4_lib_dir])
10788 if test "x$qt4_lib_dir" = "xno"; then
10789 AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10792 dnl Check for Meta Object Compiler
10794 AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10796 if test "$MOC4" = "no"; then
10797 AC_PATH_PROG( MOC4, moc, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10798 if test "$MOC4" = "no"; then
10799 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
10800 the root of your Qt installation by exporting QT4DIR before running "configure".])
10804 dnl Check for KDE4 headers
10805 AC_MSG_CHECKING([for KDE4 headers])
10807 for kde4_check in $kde4_incdirs; do
10808 if test -r "$kde4_check/$kde4_test_include"; then
10809 kde4_incdir="$kde4_check"
10813 AC_MSG_RESULT([$kde4_incdir])
10814 if test "x$kde4_incdir" = "xno"; then
10815 AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10817 if test "$kde4_incdir" = "/usr/include"; then kde4_incdir=; fi
10819 dnl Check for KDE4 libraries
10820 AC_MSG_CHECKING([for KDE4 libraries])
10822 for kde4_check in $kde4_libdirs; do
10823 if test -r "$kde4_check/$kde4_test_library"; then
10824 kde4_libdir="$kde4_check"
10829 AC_MSG_RESULT([$kde4_libdir])
10830 if test "x$kde4_libdir" = "xno"; then
10831 AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10834 PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
10835 if ! test -z "$kde4_incdir"; then
10836 KDE4_CFLAGS="-I$kde4_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10838 KDE4_CFLAGS="$QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10841 KDE4_LIBS="-L$kde4_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt4_lib_dir $QT4_LIBS"
10842 KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10843 FilterLibs "$KDE4_LIBS"
10844 KDE4_LIBS="$filteredlibs"
10846 AC_LANG_PUSH([C++])
10847 save_CXXFLAGS=$CXXFLAGS
10848 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
10849 AC_MSG_CHECKING([whether KDE is >= 4.2])
10850 AC_RUN_IFELSE([AC_LANG_SOURCE([[
10851 #include <kdeversion.h>
10853 int main(int argc, char **argv) {
10854 if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
10857 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
10858 CXXFLAGS=$save_CXXFLAGS
10861 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
10862 # Sets also KDE4_GLIB_CFLAGS/KDE4_GLIB_LIBS if successful.
10863 PKG_CHECK_MODULES(KDE4_GLIB,[glib-2.0 >= 2.4],
10865 KDE4_HAVE_GLIB=TRUE
10866 AC_DEFINE(KDE4_HAVE_GLIB,1)
10867 KDE4_GLIB_CFLAGS=$(printf '%s' "$KDE4_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10868 FilterLibs "${KDE4_GLIB_LIBS}"
10869 KDE4_GLIB_LIBS="${filteredlibs}"
10873 AC_LANG_PUSH([C++])
10874 # tst_exclude_socket_notifiers.moc:70:28: runtime error: member access within address 0x60d00000bb20 which does not point to an object of type 'QObjectData'
10875 # 0x60d00000bb20: note: object is of type 'QObjectPrivate'
10876 # 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
10877 # ^~~~~~~~~~~~~~~~~~~~~~~
10878 # vptr for 'QObjectPrivate'
10879 # so temporarily ignore here whichever way would be used to make such errors fatal
10880 # (-fno-sanitize-recover=... or UBSAN_OPTIONS halt_on_error=1):
10882 CXX=$(printf %s "$CXX" \
10883 | sed -e 's/-fno-sanitize-recover\(=[[0-9A-Za-z,_-]]*\)*//')
10884 save_UBSAN_OPTIONS=$UBSAN_OPTIONS
10885 UBSAN_OPTIONS=$UBSAN_OPTIONS:halt_on_error=0
10886 save_CXXFLAGS=$CXXFLAGS
10887 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
10889 LIBS="$LIBS $KDE4_LIBS"
10890 AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
10892 # Prepare meta object data
10893 TSTBASE="tst_exclude_socket_notifiers"
10894 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
10895 ln -fs "${TSTMOC}.hxx"
10896 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
10898 AC_RUN_IFELSE([AC_LANG_SOURCE([[
10900 #include "tst_exclude_socket_notifiers.moc"
10902 int main(int argc, char *argv[])
10904 QCoreApplication app(argc, argv);
10905 exit(tst_processEventsExcludeSocket());
10909 AC_MSG_RESULT([yes])
10911 AC_MSG_RESULT([no])
10912 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
10913 if test -z "$qt4_fix_warning"; then
10914 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
10917 add_warning " https://bugreports.qt.io/browse/QTBUG-37380 (needed)"
10918 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
10920 # Remove meta object data
10921 rm -f "${TSTBASE}."*
10923 AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
10925 # Prepare meta object data
10926 TSTBASE="tst_exclude_posted_events"
10927 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
10928 ln -fs "${TSTMOC}.hxx"
10929 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
10931 AC_RUN_IFELSE([AC_LANG_SOURCE([[
10933 #include "tst_exclude_posted_events.moc"
10935 int main(int argc, char *argv[])
10937 QCoreApplication app(argc, argv);
10938 exit(tst_excludePostedEvents());
10942 AC_MSG_RESULT([yes])
10944 AC_MSG_RESULT([no])
10945 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
10946 if test -z "$qt4_fix_warning"; then
10947 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
10950 add_warning " https://bugreports.qt.io/browse/QTBUG-34614 (needed)"
10951 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
10953 # Remove meta object data
10954 rm -f "${TSTBASE}."*
10956 if test -n "$qt4_fix_warning"; then
10957 add_warning " https://bugreports.qt.io/browse/QTBUG-38585 (recommended)"
10961 CXXFLAGS=$save_CXXFLAGS
10962 UBSAN_OPTIONS=$save_UBSAN_OPTIONS
10966 AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
10968 AC_SUBST(KDE4_CFLAGS)
10969 AC_SUBST(KDE4_LIBS)
10971 AC_SUBST(KDE4_GLIB_CFLAGS)
10972 AC_SUBST(KDE4_GLIB_LIBS)
10973 AC_SUBST(KDE4_HAVE_GLIB)
10975 dnl ===================================================================
10976 dnl QT5 Integration
10977 dnl ===================================================================
10986 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
10987 \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
10988 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
10990 qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
10991 qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
10993 if test -n "$supports_multilib"; then
10994 qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
10997 qt5_test_include="QtWidgets/qapplication.h"
10998 qt5_test_library="libQt5Widgets.so"
11000 dnl Check for qmake5
11001 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
11002 if test "$QMAKE5" = "no"; then
11003 AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11005 qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11006 if test -z "$qmake5_test_ver"; then
11007 AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11009 qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11010 qt5_minimal_minor="6"
11011 if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11012 AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11014 AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11018 qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11019 qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11021 AC_MSG_CHECKING([for Qt5 headers])
11023 for inc_dir in $qt5_incdirs; do
11024 if test -r "$inc_dir/$qt5_test_include"; then
11025 qt5_incdir="$inc_dir"
11029 AC_MSG_RESULT([$qt5_incdir])
11030 if test "x$qt5_incdir" = "xno"; then
11031 AC_MSG_ERROR([Qt5 headers not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11034 AC_MSG_CHECKING([for Qt5 libraries])
11036 for lib_dir in $qt5_libdirs; do
11037 if test -r "$lib_dir/$qt5_test_library"; then
11038 qt5_libdir="$lib_dir"
11042 AC_MSG_RESULT([$qt5_libdir])
11043 if test "x$qt5_libdir" = "xno"; then
11044 AC_MSG_ERROR([Qt5 libraries not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11047 QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11048 QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11050 dnl Check for Meta Object Compiler
11052 AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH] )
11053 if test "$MOC5" = "no"; then
11054 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11055 the root of your Qt installation by exporting QT5DIR before running "configure".])
11058 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11059 # Sets also QT5_GLIB_CFLAGS/QT5_GLIB_LIBS if successful.
11060 PKG_CHECK_MODULES(QT5_GLIB,[glib-2.0 >= 2.4],
11063 AC_DEFINE(QT5_HAVE_GLIB,1)
11065 AC_MSG_WARN([[No Glib found, Qt5 support will not use native file pickers!]])
11068 AC_SUBST(QT5_CFLAGS)
11071 AC_SUBST(QT5_GLIB_CFLAGS)
11072 AC_SUBST(QT5_GLIB_LIBS)
11073 AC_SUBST(QT5_HAVE_GLIB)
11075 dnl ===================================================================
11076 dnl KDE5 Integration
11077 dnl ===================================================================
11081 KF5_CONFIG="kf5-config"
11082 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11083 \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11084 \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11086 kf5_incdirs="$KF5INC /usr/include/ $x_includes"
11087 kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $x_libraries"
11088 if test -n "$supports_multilib"; then
11089 kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11092 kf5_test_include="KF5/kcoreaddons_version.h"
11093 kf5_test_library="libKF5CoreAddons.so"
11094 kf5_libdirs="$qt5_libdir $kf5_libdirs"
11096 dnl kf5 KDE4 support compatibility installed
11097 AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11098 if test "$KF5_CONFIG" != "no"; then
11099 kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11100 kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11103 dnl Check for KF5 headers
11104 AC_MSG_CHECKING([for KF5 headers])
11106 for kf5_check in $kf5_incdirs; do
11107 if test -r "$kf5_check/$kf5_test_include"; then
11108 kf5_incdir="$kf5_check/KF5"
11112 AC_MSG_RESULT([$kf5_incdir])
11113 if test "x$kf5_incdir" = "xno"; then
11114 AC_MSG_ERROR([KF5 headers not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11117 dnl Check for KF5 libraries
11118 AC_MSG_CHECKING([for KF5 libraries])
11120 for kf5_check in $kf5_libdirs; do
11121 if test -r "$kf5_check/$kf5_test_library"; then
11122 kf5_libdir="$kf5_check"
11127 AC_MSG_RESULT([$kf5_libdir])
11128 if test "x$kf5_libdir" = "xno"; then
11129 AC_MSG_ERROR([KF5 libraries not found. Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11132 PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])])
11134 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"
11135 KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network -lQt5X11Extras $KF5_XCB_LIBS"
11136 KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11138 AC_LANG_PUSH([C++])
11139 save_CXXFLAGS=$CXXFLAGS
11140 CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11141 AC_MSG_CHECKING([whether KDE is >= 5.0])
11142 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11143 #include <kcoreaddons_version.h>
11145 int main(int argc, char **argv) {
11146 if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11149 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11150 CXXFLAGS=$save_CXXFLAGS
11153 AC_SUBST(KF5_CFLAGS)
11156 dnl ===================================================================
11157 dnl Test whether to include Evolution 2 support
11158 dnl ===================================================================
11159 AC_MSG_CHECKING([whether to enable evolution 2 support])
11160 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11161 AC_MSG_RESULT([yes])
11162 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11163 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11164 FilterLibs "${GOBJECT_LIBS}"
11165 GOBJECT_LIBS="${filteredlibs}"
11166 ENABLE_EVOAB2="TRUE"
11169 AC_MSG_RESULT([no])
11171 AC_SUBST(ENABLE_EVOAB2)
11172 AC_SUBST(GOBJECT_CFLAGS)
11173 AC_SUBST(GOBJECT_LIBS)
11175 dnl ===================================================================
11176 dnl Test which themes to include
11177 dnl ===================================================================
11178 AC_MSG_CHECKING([which themes to include])
11179 # if none given use default subset of available themes
11180 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11181 with_theme="breeze breeze_dark colibre elementary galaxy hicontrast sifr sifr_dark tango"
11182 # test -z "$ENABLE_RELEASE_BUILD" && with_theme="$with_theme tango_testing"
11186 if test "x$with_theme" != "xno"; then
11187 for theme in $with_theme; do
11189 breeze|breeze_dark|crystal|colibre|elementary|galaxy|hicontrast|oxygen|sifr|sifr_dark|tango|tango_testing) real_theme="$theme" ;;
11190 default) real_theme=galaxy ;;
11191 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11193 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11196 AC_MSG_RESULT([$WITH_THEMES])
11197 AC_SUBST([WITH_THEMES])
11198 # FIXME: remove this, and the convenience default->galaxy remapping after a crace period
11199 for theme in $with_theme; do
11201 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=galaxy]) ;;
11206 dnl ===================================================================
11207 dnl Test whether to integrate helppacks into the product's installer
11208 dnl ===================================================================
11209 AC_MSG_CHECKING([for helppack integration])
11210 if test "$with_helppack_integration" = "no"; then
11211 WITH_HELPPACK_INTEGRATION=
11212 AC_MSG_RESULT([no integration])
11214 WITH_HELPPACK_INTEGRATION=TRUE
11215 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11216 AC_MSG_RESULT([integration])
11218 AC_SUBST(WITH_HELPPACK_INTEGRATION)
11220 ###############################################################################
11221 # Extensions checking
11222 ###############################################################################
11223 AC_MSG_CHECKING([for extensions integration])
11224 if test "x$enable_extension_integration" != "xno"; then
11225 WITH_EXTENSION_INTEGRATION=TRUE
11226 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11227 AC_MSG_RESULT([yes, use integration])
11229 WITH_EXTENSION_INTEGRATION=
11230 AC_MSG_RESULT([no, do not integrate])
11232 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11234 dnl Should any extra extensions be included?
11235 dnl There are standalone tests for each of these below.
11236 WITH_EXTRA_EXTENSIONS=
11237 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11239 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11240 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11241 if test "x$with_java" != "xno"; then
11242 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11243 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11246 TEST_FONTS_MISSING=0
11249 # $2+ = accepted font mappings
11253 AC_MSG_CHECKING([font mapping for '$FONT'])
11254 FONTFILE="$(basename `$FCMATCH -f '%{file}' "$FONT"`)"
11255 FONTFILE_LOWER="$(echo $FONTFILE | $AWK '{print tolower($0)}')"
11257 TESTEXPR="'${FONTFILE_LOWER}' = '$(echo $FONT | $AWK '{print tolower($0)}').ttf'"
11258 while test "$#" -ge 1 ; do
11259 MAPPING="$(echo $1 | $AWK '{print tolower($0)}')"; shift
11260 TESTEXPR="${TESTEXPR} -o '${FONTFILE_LOWER}' = '$MAPPING-regular.ttf'"
11264 AC_MSG_RESULT([ok])
11266 AC_MSG_WARN([unknown ($FONTFILE)])
11267 add_warning "unknown ($FONTFILE)"
11268 TEST_FONTS_MISSING=1
11272 dnl ===================================================================
11273 dnl Test whether to include fonts
11274 dnl ===================================================================
11275 AC_MSG_CHECKING([whether to include third-party fonts])
11276 if test "$with_fonts" != "no"; then
11277 AC_MSG_RESULT([yes])
11279 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11280 AC_DEFINE(HAVE_MORE_FONTS)
11282 AC_MSG_RESULT([no])
11284 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11285 if test "$test_fontconfig" = "yes"; then
11286 AC_PATH_PROG([FCMATCH], [fc-match])
11287 if test -z "$FCMATCH"; then
11288 AC_MSG_WARN([Unable to query installed fonts - unit tests disabled.])
11289 TEST_FONTS_MISSING=1
11291 test_font_map 'Calibri' 'Carlito'
11292 test_font_map 'DejaVuSans' 'DejaVuSans'
11293 if test ${TEST_FONTS_MISSING} -eq 1
11295 AC_MSG_WARN([Unknown font mappings - unit tests disabled.])
11296 add_warning "Unknown font mappings - unit tests disabled."
11300 TEST_FONTS_MISSING=1
11303 AC_SUBST(WITH_FONTS)
11304 AC_DEFINE_UNQUOTED([TEST_FONTS_MISSING], $TEST_FONTS_MISSING)
11307 dnl ===================================================================
11308 dnl Test whether to enable online update service
11309 dnl ===================================================================
11310 AC_MSG_CHECKING([whether to enable online update])
11311 ENABLE_ONLINE_UPDATE=
11312 ENABLE_ONLINE_UPDATE_MAR=
11314 if test "$enable_online_update" = ""; then
11315 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11316 AC_MSG_RESULT([yes])
11317 ENABLE_ONLINE_UPDATE="TRUE"
11319 AC_MSG_RESULT([no])
11322 if test "$enable_online_update" = "mar"; then
11323 AC_MSG_RESULT([yes - MAR-based online update])
11324 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11325 if test "$with_update_config" = ""; then
11326 AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11328 UPDATE_CONFIG="$with_update_config"
11329 AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11330 elif test "$enable_online_update" = "yes"; then
11331 AC_MSG_RESULT([yes])
11332 ENABLE_ONLINE_UPDATE="TRUE"
11334 AC_MSG_RESULT([no])
11337 AC_SUBST(ENABLE_ONLINE_UPDATE)
11338 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11339 AC_SUBST(UPDATE_CONFIG)
11341 dnl ===================================================================
11342 dnl Test whether we need bzip2
11343 dnl ===================================================================
11345 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11346 AC_MSG_CHECKING([whether to use system bzip2])
11347 if test "$with_system_bzip2" = yes; then
11349 AC_MSG_RESULT([yes])
11350 PKG_CHECK_MODULES(BZIP2, bzip2)
11351 FilterLibs "${BZIP2_LIBS}"
11352 BZIP2_LIBS="${filteredlibs}"
11354 AC_MSG_RESULT([no])
11355 BUILD_TYPE="$BUILD_TYPE BZIP2"
11358 AC_SUBST(SYSTEM_BZIP2)
11359 AC_SUBST(BZIP2_CFLAGS)
11360 AC_SUBST(BZIP2_LIBS)
11362 dnl ===================================================================
11363 dnl Test whether to enable extension update
11364 dnl ===================================================================
11365 AC_MSG_CHECKING([whether to enable extension update])
11366 ENABLE_EXTENSION_UPDATE=
11367 if test "x$enable_extension_update" = "xno"; then
11368 AC_MSG_RESULT([no])
11370 AC_MSG_RESULT([yes])
11371 ENABLE_EXTENSION_UPDATE="TRUE"
11372 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11373 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11375 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11378 dnl ===================================================================
11379 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11380 dnl ===================================================================
11381 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11382 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11383 AC_MSG_RESULT([no])
11386 AC_MSG_RESULT([yes])
11387 ENABLE_SILENT_MSI=TRUE
11388 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11390 AC_SUBST(ENABLE_SILENT_MSI)
11392 AC_MSG_CHECKING([whether and how to use Xinerama])
11393 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11394 if test "$x_libraries" = "default_x_libraries"; then
11395 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11396 if test "x$XINERAMALIB" = x; then
11397 XINERAMALIB="/usr/lib"
11400 XINERAMALIB="$x_libraries"
11402 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11403 # we have both versions, let the user decide but use the dynamic one
11406 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11407 XINERAMA_LINK=dynamic
11409 XINERAMA_LINK=static
11411 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11412 # we have only the dynamic version
11414 XINERAMA_LINK=dynamic
11415 elif test -e "$XINERAMALIB/libXinerama.a"; then
11417 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11419 XINERAMA_LINK=static
11429 if test "$USE_XINERAMA" = "TRUE"; then
11430 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11431 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11432 [AC_MSG_ERROR(Xinerama header not found.)], [])
11433 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11434 if test "x$XEXTLIB" = x; then
11435 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11437 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11438 if test "$_os" = "FreeBSD"; then
11439 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11441 if test "$_os" = "Linux"; then
11442 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11444 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11445 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11447 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11452 AC_MSG_RESULT([no])
11454 AC_SUBST(USE_XINERAMA)
11455 AC_SUBST(XINERAMA_LINK)
11457 dnl ===================================================================
11458 dnl Test whether to build cairo or rely on the system version
11459 dnl ===================================================================
11461 if test "$USING_X11" = TRUE; then
11462 # Used in vcl/Library_vclplug_gen.mk
11466 if test "$test_cairo" = "yes"; then
11467 AC_MSG_CHECKING([whether to use the system cairo])
11469 : ${with_system_cairo:=$with_system_libs}
11470 if test "$with_system_cairo" = "yes"; then
11472 AC_MSG_RESULT([yes])
11474 PKG_CHECK_MODULES( CAIRO, cairo >= 1.2.0 )
11475 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11476 FilterLibs "${CAIRO_LIBS}"
11477 CAIRO_LIBS="${filteredlibs}"
11479 if test "$test_xrender" = "yes"; then
11480 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11482 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11483 #ifdef PictStandardA8
11487 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11493 AC_MSG_RESULT([no])
11495 BUILD_TYPE="$BUILD_TYPE CAIRO"
11499 AC_SUBST(SYSTEM_CAIRO)
11500 AC_SUBST(CAIRO_CFLAGS)
11501 AC_SUBST(CAIRO_LIBS)
11503 dnl ===================================================================
11504 dnl Test whether to use avahi
11505 dnl ===================================================================
11506 if test "$_os" = "WINNT"; then
11507 # Windows uses bundled mDNSResponder
11508 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11509 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11510 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11511 [ENABLE_AVAHI="TRUE"])
11512 AC_DEFINE(HAVE_FEATURE_AVAHI)
11513 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11514 FilterLibs "${AVAHI_LIBS}"
11515 AVAHI_LIBS="${filteredlibs}"
11518 AC_SUBST(ENABLE_AVAHI)
11519 AC_SUBST(AVAHI_CFLAGS)
11520 AC_SUBST(AVAHI_LIBS)
11522 dnl ===================================================================
11523 dnl Test whether to use liblangtag
11524 dnl ===================================================================
11526 AC_MSG_CHECKING([whether to use system liblangtag])
11527 if test "$with_system_liblangtag" = yes; then
11528 SYSTEM_LIBLANGTAG=TRUE
11529 AC_MSG_RESULT([yes])
11530 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11531 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11532 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11533 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11534 FilterLibs "${LIBLANGTAG_LIBS}"
11535 LIBLANGTAG_LIBS="${filteredlibs}"
11538 AC_MSG_RESULT([no])
11539 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11540 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
11541 if test "$COM" = "MSC"; then
11542 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
11544 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
11547 AC_SUBST(SYSTEM_LIBLANGTAG)
11548 AC_SUBST(LIBLANGTAG_CFLAGS)
11549 AC_SUBST(LIBLANGTAG_LIBS)
11551 dnl ===================================================================
11552 dnl Test whether to build libpng or rely on the system version
11553 dnl ===================================================================
11555 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
11557 dnl ===================================================================
11558 dnl Check for runtime JVM search path
11559 dnl ===================================================================
11560 if test "$ENABLE_JAVA" != ""; then
11561 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11562 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11563 AC_MSG_RESULT([yes])
11564 if ! test -d "$with_jvm_path"; then
11565 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11567 if ! test -d "$with_jvm_path"jvm; then
11568 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11570 JVM_ONE_PATH_CHECK="$with_jvm_path"
11571 AC_SUBST(JVM_ONE_PATH_CHECK)
11573 AC_MSG_RESULT([no])
11577 dnl ===================================================================
11578 dnl Test for the presence of Ant and that it works
11579 dnl ===================================================================
11581 if test "$ENABLE_JAVA" != ""; then
11582 ANT_HOME=; export ANT_HOME
11583 WITH_ANT_HOME=; export WITH_ANT_HOME
11584 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11585 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11586 if test "$_os" = "WINNT"; then
11587 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11589 with_ant_home="$LODE_HOME/opt/ant"
11591 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11592 with_ant_home="$LODE_HOME/opt/ant"
11595 if test -z "$with_ant_home"; then
11596 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11598 if test "$_os" = "WINNT"; then
11599 # AC_PATH_PROGS needs unix path
11600 with_ant_home=`cygpath -u "$with_ant_home"`
11602 AbsolutePath "$with_ant_home"
11603 with_ant_home=$absolute_path
11604 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11605 WITH_ANT_HOME=$with_ant_home
11606 ANT_HOME=$with_ant_home
11609 if test -z "$ANT"; then
11610 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11612 # resolve relative or absolute symlink
11613 while test -h "$ANT"; do
11615 a_basename=`basename "$ANT"`
11616 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11617 cd "`dirname "$ANT"`"
11618 cd "`dirname "$a_script"`"
11619 ANT="`pwd`"/"`basename "$a_script"`"
11623 AC_MSG_CHECKING([if $ANT works])
11624 cat > conftest.java << EOF
11625 public class conftest {
11626 int testmethod(int a, int b) {
11632 cat > conftest.xml << EOF
11633 <project name="conftest" default="conftest">
11634 <target name="conftest">
11635 <javac srcdir="." includes="conftest.java">
11641 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
11642 if test $? = 0 -a -f ./conftest.class; then
11643 AC_MSG_RESULT([Ant works])
11644 if test -z "$WITH_ANT_HOME"; then
11645 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11646 if test -z "$ANT_HOME"; then
11647 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11650 ANT_HOME="$WITH_ANT_HOME"
11653 echo "configure: Ant test failed" >&5
11654 cat conftest.java >&5
11655 cat conftest.xml >&5
11656 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
11658 rm -f conftest* core core.* *.core
11660 if test -z "$ANT_HOME"; then
11661 ANT_HOME="NO_ANT_HOME"
11663 PathFormat "$ANT_HOME"
11664 ANT_HOME="$formatted_path"
11666 ANT="$formatted_path"
11671 dnl Checking for ant.jar
11672 if test "$ANT_HOME" != "NO_ANT_HOME"; then
11673 AC_MSG_CHECKING([Ant lib directory])
11674 if test -f $ANT_HOME/lib/ant.jar; then
11675 ANT_LIB="$ANT_HOME/lib"
11677 if test -f $ANT_HOME/ant.jar; then
11678 ANT_LIB="$ANT_HOME"
11680 if test -f /usr/share/java/ant.jar; then
11681 ANT_LIB=/usr/share/java
11683 if test -f /usr/share/ant-core/lib/ant.jar; then
11684 ANT_LIB=/usr/share/ant-core/lib
11686 if test -f $ANT_HOME/lib/ant/ant.jar; then
11687 ANT_LIB="$ANT_HOME/lib/ant"
11689 if test -f /usr/share/lib/ant/ant.jar; then
11690 ANT_LIB=/usr/share/lib/ant
11692 AC_MSG_ERROR([Ant libraries not found!])
11699 PathFormat "$ANT_LIB"
11700 ANT_LIB="$formatted_path"
11701 AC_MSG_RESULT([Ant lib directory found.])
11706 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11708 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11709 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11710 ant_version_major=`echo $ant_version | cut -d. -f1`
11711 ant_version_minor=`echo $ant_version | cut -d. -f2`
11712 echo "configure: ant_version $ant_version " >&5
11713 echo "configure: ant_version_major $ant_version_major " >&5
11714 echo "configure: ant_version_minor $ant_version_minor " >&5
11715 if test "$ant_version_major" -ge "2"; then
11716 AC_MSG_RESULT([yes, $ant_version])
11717 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11718 AC_MSG_RESULT([yes, $ant_version])
11720 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11723 rm -f conftest* core core.* *.core
11727 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11728 AC_MSG_CHECKING([for JUnit 4])
11729 if test "$with_junit" = "yes"; then
11730 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
11731 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
11732 elif test -e /usr/share/java/junit4.jar; then
11733 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11735 if test -e /usr/share/lib/java/junit.jar; then
11736 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11738 OOO_JUNIT_JAR=/usr/share/java/junit.jar
11742 OOO_JUNIT_JAR=$with_junit
11744 if test "$_os" = "WINNT"; then
11745 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11747 printf 'import org.junit.Before;' > conftest.java
11748 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11749 AC_MSG_RESULT([$OOO_JUNIT_JAR])
11752 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
11753 specify its pathname via --with-junit=..., or disable it via --without-junit])
11755 rm -f conftest.class conftest.java
11756 if test $OOO_JUNIT_JAR != ""; then
11757 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11760 AC_SUBST(OOO_JUNIT_JAR)
11763 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11764 AC_MSG_CHECKING([for included Hamcrest])
11765 printf 'import org.hamcrest.BaseDescription;' > conftest.java
11766 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11767 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
11769 AC_MSG_RESULT([Not included])
11770 AC_MSG_CHECKING([for standalone hamcrest jar.])
11771 if test "$with_hamcrest" = "yes"; then
11772 if test -e /usr/share/lib/java/hamcrest.jar; then
11773 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
11774 elif test -e /usr/share/java/hamcrest/core.jar; then
11775 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
11777 HAMCREST_JAR=/usr/share/java/hamcrest.jar
11780 HAMCREST_JAR=$with_hamcrest
11782 if test "$_os" = "WINNT"; then
11783 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
11785 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
11786 AC_MSG_RESULT([$HAMCREST_JAR])
11788 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),
11789 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
11792 rm -f conftest.class conftest.java
11794 AC_SUBST(HAMCREST_JAR)
11800 # check for wget and curl
11805 if test "$enable_fetch_external" != "no"; then
11807 CURL=`which curl 2>/dev/null`
11809 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
11811 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
11812 if test $? -eq 0; then
11818 if test -z "$WGET" -a -z "$CURL"; then
11819 AC_MSG_ERROR([neither wget nor curl found!])
11828 # check for sha256sum
11832 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
11833 eval "$i -a 256 --version" > /dev/null 2>&1
11835 if test $ret -eq 0; then
11836 SHA256SUM="$i -a 256"
11841 if test -z "$SHA256SUM"; then
11842 for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
11843 eval "$i --version" > /dev/null 2>&1
11845 if test $ret -eq 0; then
11852 if test -z "$SHA256SUM"; then
11853 AC_MSG_ERROR([no sha256sum found!])
11856 AC_SUBST(SHA256SUM)
11858 dnl ===================================================================
11859 dnl Dealing with l10n options
11860 dnl ===================================================================
11861 AC_MSG_CHECKING([which languages to be built])
11862 # get list of all languages
11863 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
11864 # the sed command does the following:
11865 # + if a line ends with a backslash, append the next line to it
11866 # + adds " on the beginning of the value (after =)
11867 # + adds " at the end of the value
11868 # + removes en-US; we want to put it on the beginning
11869 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
11870 [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)]
11871 ALL_LANGS="en-US $completelangiso"
11872 # check the configured localizations
11873 WITH_LANG="$with_lang"
11874 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
11875 AC_MSG_RESULT([en-US])
11877 AC_MSG_RESULT([$WITH_LANG])
11878 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
11879 if test -z "$MSGFMT"; then
11880 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
11881 MSGFMT="$LODE_HOME/opt/bin/msgfmt"
11882 elif test -x "/opt/lo/bin/msgfmt"; then
11883 MSGFMT="/opt/lo/bin/msgfmt"
11885 AC_CHECK_PROGS(MSGFMT, [msgfmt])
11886 if test -z "$MSGFMT"; then
11887 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
11891 if test -z "$MSGUNIQ"; then
11892 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
11893 MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
11894 elif test -x "/opt/lo/bin/msguniq"; then
11895 MSGUNIQ="/opt/lo/bin/msguniq"
11897 AC_CHECK_PROGS(MSGUNIQ, [msguniq])
11898 if test -z "$MSGUNIQ"; then
11899 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
11906 # check that the list is valid
11907 for lang in $WITH_LANG; do
11908 test "$lang" = "ALL" && continue
11909 # need to check for the exact string, so add space before and after the list of all languages
11910 for vl in $ALL_LANGS; do
11911 if test "$vl" = "$lang"; then
11915 if test "$vl" != "$lang"; then
11916 # if you're reading this - you prolly quoted your languages remove the quotes ...
11917 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
11920 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
11921 echo $WITH_LANG | grep -q en-US
11922 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
11924 # list with substituted ALL
11925 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
11926 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
11927 test "$WITH_LANG" = "en-US" && WITH_LANG=
11928 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
11929 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
11930 ALL_LANGS=`echo $ALL_LANGS qtz`
11932 AC_SUBST(ALL_LANGS)
11933 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
11934 AC_SUBST(WITH_LANG)
11935 AC_SUBST(WITH_LANG_LIST)
11936 AC_SUBST(GIT_NEEDED_SUBMODULES)
11938 WITH_POOR_HELP_LOCALIZATIONS=
11939 if test -d "$SRC_ROOT/translations/source"; then
11940 for l in `ls -1 $SRC_ROOT/translations/source`; do
11941 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
11942 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
11946 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
11948 if test -n "$with_locales"; then
11949 WITH_LOCALES="$with_locales"
11951 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
11952 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
11953 # config_host/config_locales.h.in
11954 for locale in $WITH_LOCALES; do
11957 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
11961 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
11964 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
11969 AC_DEFINE(WITH_LOCALE_ALL)
11971 AC_SUBST(WITH_LOCALES)
11973 dnl git submodule update --reference
11974 dnl ===================================================================
11975 if test -n "${GIT_REFERENCE_SRC}"; then
11976 for repo in ${GIT_NEEDED_SUBMODULES}; do
11977 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
11978 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
11982 AC_SUBST(GIT_REFERENCE_SRC)
11984 dnl git submodules linked dirs
11985 dnl ===================================================================
11986 if test -n "${GIT_LINK_SRC}"; then
11987 for repo in ${GIT_NEEDED_SUBMODULES}; do
11988 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
11989 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
11993 AC_SUBST(GIT_LINK_SRC)
11996 dnl ===================================================================
11997 AC_MSG_CHECKING([for alternative branding images directory])
11998 # initialize mapped arrays
11999 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12000 brand_files="$BRAND_INTRO_IMAGES about.svg"
12002 if test -z "$with_branding" -o "$with_branding" = "no"; then
12003 AC_MSG_RESULT([none])
12004 DEFAULT_BRAND_IMAGES="$brand_files"
12006 if ! test -d $with_branding ; then
12007 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12009 AC_MSG_RESULT([$with_branding])
12010 CUSTOM_BRAND_DIR="$with_branding"
12011 for lfile in $brand_files
12013 if ! test -f $with_branding/$lfile ; then
12014 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12015 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12017 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12020 check_for_progress="yes"
12023 AC_SUBST([BRAND_INTRO_IMAGES])
12024 AC_SUBST([CUSTOM_BRAND_DIR])
12025 AC_SUBST([CUSTOM_BRAND_IMAGES])
12026 AC_SUBST([DEFAULT_BRAND_IMAGES])
12029 AC_MSG_CHECKING([for 'intro' progress settings])
12033 PROGRESSFRAMECOLOR=
12035 PROGRESSTEXTBASELINE=
12037 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12038 source "$with_branding/progress.conf"
12039 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12041 AC_MSG_RESULT([none])
12044 AC_SUBST(PROGRESSBARCOLOR)
12045 AC_SUBST(PROGRESSSIZE)
12046 AC_SUBST(PROGRESSPOSITION)
12047 AC_SUBST(PROGRESSFRAMECOLOR)
12048 AC_SUBST(PROGRESSTEXTCOLOR)
12049 AC_SUBST(PROGRESSTEXTBASELINE)
12052 AC_MSG_CHECKING([for extra build ID])
12053 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12054 EXTRA_BUILDID="$with_extra_buildid"
12056 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12057 if test -n "$EXTRA_BUILDID" ; then
12058 AC_MSG_RESULT([$EXTRA_BUILDID])
12060 AC_MSG_RESULT([not set])
12062 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12065 AC_MSG_CHECKING([for vendor])
12066 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12067 OOO_VENDOR="$USERNAME"
12069 if test -z "$OOO_VENDOR"; then
12073 if test -z "$OOO_VENDOR"; then
12074 OOO_VENDOR="`id -u -n`"
12077 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12079 OOO_VENDOR="$with_vendor"
12080 AC_MSG_RESULT([$OOO_VENDOR])
12082 AC_DEFINE_UNQUOTED(OOO_VENDOR,"$OOO_VENDOR")
12083 AC_SUBST(OOO_VENDOR)
12085 if test "$_os" = "Android" ; then
12086 ANDROID_PACKAGE_NAME=
12087 AC_MSG_CHECKING([for Android package name])
12088 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12089 if test -n "$ENABLE_DEBUG"; then
12090 # Default to the package name that makes ndk-gdb happy.
12091 ANDROID_PACKAGE_NAME="org.libreoffice"
12093 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12096 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12098 ANDROID_PACKAGE_NAME="$with_android_package_name"
12099 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12101 AC_SUBST(ANDROID_PACKAGE_NAME)
12104 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12105 if test "$with_compat_oowrappers" = "yes"; then
12106 WITH_COMPAT_OOWRAPPERS=TRUE
12109 WITH_COMPAT_OOWRAPPERS=
12112 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12114 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12115 AC_MSG_CHECKING([for install dirname])
12116 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12117 INSTALLDIRNAME="$with_install_dirname"
12119 AC_MSG_RESULT([$INSTALLDIRNAME])
12120 AC_SUBST(INSTALLDIRNAME)
12122 AC_MSG_CHECKING([for prefix])
12123 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12124 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12125 PREFIXDIR="$prefix"
12126 AC_MSG_RESULT([$PREFIXDIR])
12127 AC_SUBST(PREFIXDIR)
12129 LIBDIR=[$(eval echo $(eval echo $libdir))]
12132 DATADIR=[$(eval echo $(eval echo $datadir))]
12135 MANDIR=[$(eval echo $(eval echo $mandir))]
12138 DOCDIR=[$(eval echo $(eval echo $docdir))]
12141 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12142 AC_SUBST(INSTALLDIR)
12144 TESTINSTALLDIR="${BUILDDIR}/test-install"
12145 AC_SUBST(TESTINSTALLDIR)
12148 # ===================================================================
12149 # OAuth2 id and secrets
12150 # ===================================================================
12152 AC_MSG_CHECKING([for Google Drive client id and secret])
12153 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12154 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12155 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12156 GDRIVE_CLIENT_ID="\"\""
12159 if test "$with_gdrive_client_secret" = "no" -o -z "$with_gdrive_client_secret"; then
12160 GDRIVE_CLIENT_SECRET="\"\""
12163 if test -z "$GDRIVE_CLIENT_ID" -o -z "$GDRIVE_CLIENT_SECRET"; then
12164 AC_MSG_RESULT([not set])
12166 AC_MSG_RESULT([set])
12169 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12170 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12172 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12173 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12174 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12175 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12176 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12179 if test "$with_alfresco_cloud_client_secret" = "no" -o -z "$with_alfresco_cloud_client_secret"; then
12180 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12183 if test -z "$ALFRESCO_CLOUD_CLIENT_ID" -o -z "$ALFRESCO_CLOUD_CLIENT_SECRET"; then
12184 AC_MSG_RESULT([not set])
12186 AC_MSG_RESULT([set])
12188 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12189 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12191 AC_MSG_CHECKING([for OneDrive client id and secret])
12192 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12193 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12194 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12195 ONEDRIVE_CLIENT_ID="\"\""
12198 if test "$with_onedrive_client_secret" = "no" -o -z "$with_onedrive_client_secret"; then
12199 ONEDRIVE_CLIENT_SECRET="\"\""
12202 if test -z "$ONEDRIVE_CLIENT_ID" -o -z "$ONEDRIVE_CLIENT_SECRET"; then
12203 AC_MSG_RESULT([not set])
12205 AC_MSG_RESULT([set])
12207 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12208 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12211 dnl ===================================================================
12212 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12213 dnl --enable-dependency-tracking configure option
12214 dnl ===================================================================
12215 AC_MSG_CHECKING([whether to enable dependency tracking])
12216 if test "$enable_dependency_tracking" = "no"; then
12218 AC_MSG_RESULT([no])
12220 AC_MSG_RESULT([yes])
12224 dnl ===================================================================
12225 dnl Number of CPUs to use during the build
12226 dnl ===================================================================
12227 AC_MSG_CHECKING([for number of processors to use])
12228 # plain --with-parallelism is just the default
12229 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12230 if test "$with_parallelism" = "no"; then
12233 PARALLELISM=$with_parallelism
12236 if test "$enable_icecream" = "yes"; then
12241 Darwin|FreeBSD|NetBSD|OpenBSD)
12242 PARALLELISM=`sysctl -n hw.ncpu`
12246 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12248 # what else than above does profit here *and* has /proc?
12250 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12254 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12255 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12259 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12260 if test -z "$with_parallelism"; then
12261 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12262 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12265 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."
12269 if test $PARALLELISM -eq 0; then
12270 AC_MSG_RESULT([explicit make -j option needed])
12272 AC_MSG_RESULT([$PARALLELISM])
12274 AC_SUBST(PARALLELISM)
12276 IWYU_PATH="$with_iwyu"
12277 AC_SUBST(IWYU_PATH)
12278 if test ! -z "$IWYU_PATH"; then
12279 if test ! -f "$IWYU_PATH"; then
12280 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12285 # Set up ILIB for MSVC build
12288 if test "$build_os" = "cygwin"; then
12290 if test -n "$JAVA_HOME"; then
12291 ILIB="$ILIB;$JAVA_HOME/lib"
12294 if test "$BITNESS_OVERRIDE" = 64; then
12295 if test $vcnum = "150"; then
12296 ILIB="$ILIB;$COMPATH/lib/x64"
12297 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
12299 ILIB="$ILIB;$COMPATH/lib/amd64"
12300 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/amd64"
12302 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12303 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12304 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12305 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12306 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12308 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12309 ucrtlibpath_formatted=$formatted_path
12310 ILIB="$ILIB;$ucrtlibpath_formatted"
12311 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12313 if test $vcnum = "150"; then
12314 ILIB="$ILIB;$COMPATH/lib/x86"
12315 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
12317 ILIB="$ILIB;$COMPATH/lib"
12318 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib"
12320 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12321 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12322 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12323 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12324 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12326 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12327 ucrtlibpath_formatted=$formatted_path
12328 ILIB="$ILIB;$ucrtlibpath_formatted"
12329 ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
12331 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12332 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12334 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12340 dnl We should be able to drop the below check when bumping the GCC baseline to
12341 dnl 4.9, as <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54577>
12342 dnl "deque<T>::erase() still takes iterator instead of const_iterator" should be
12343 dnl fixed there with <https://gcc.gnu.org/git/?p=gcc.git;a=commit;
12344 dnl h=6b0e18ca48bb4b4c01e7b5be2b98849943fdcf91>:
12346 [whether C++11 use of const_iterator in standard containers is broken])
12347 save_CXXFLAGS=$CXXFLAGS
12348 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12349 AC_LANG_PUSH([C++])
12350 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12354 l.erase(l.cbegin());
12356 [broken=no], [broken=yes])
12358 CXXFLAGS=$save_CXXFLAGS
12359 AC_MSG_RESULT([$broken])
12360 if test "$broken" = yes; then
12361 AC_DEFINE([HAVE_BROKEN_CONST_ITERATORS])
12365 AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
12366 save_CXXFLAGS=$CXXFLAGS
12367 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12369 if test -n "$ILIB1"; then
12370 LIBS="$LIBS $ILIB1"
12372 AC_LANG_PUSH([C++])
12373 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
12374 // Exit with failure if the static initializer_list is stored on the
12375 // stack (as done by Clang < 3.4):
12376 #include <initializer_list>
12378 bool g(void const * p1, void const * p2) {
12380 return !((p1 > p2 && p2 > &n) || (p1 < p2 && p2 < &n));
12382 bool f(void const * p1) {
12383 static std::initializer_list<S> s { S() };
12384 return g(p1, s.begin());
12388 return f(&n) ? 0 : 1;
12389 ]])], [broken=no], [broken=yes],[broken='assuming not (cross-compiling)'])
12392 CXXFLAGS=$save_CXXFLAGS
12393 AC_MSG_RESULT([$broken])
12394 if test "$broken" = yes -a "$_os" != "iOS"; then
12395 AC_MSG_ERROR([working support for static initializer_list needed])
12399 # ===================================================================
12400 # Creating bigger shared library to link against
12401 # ===================================================================
12402 AC_MSG_CHECKING([whether to create huge library])
12405 if test $_os = iOS -o $_os = Android; then
12406 # Never any point in mergelibs for these as we build just static
12407 # libraries anyway...
12408 enable_mergelibs=no
12411 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12412 if test $_os != Linux -a $_os != WINNT; then
12413 add_warning "--enable-mergelibs is not tested for this platform"
12416 AC_MSG_RESULT([yes])
12418 AC_MSG_RESULT([no])
12420 AC_SUBST([MERGELIBS])
12422 dnl ===================================================================
12423 dnl icerun is a wrapper that stops us spawning tens of processes
12424 dnl locally - for tools that can't be executed on the compile cluster
12425 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12426 dnl ===================================================================
12427 AC_MSG_CHECKING([whether to use icerun wrapper])
12429 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12430 ICECREAM_RUN=icerun
12431 AC_MSG_RESULT([yes])
12433 AC_MSG_RESULT([no])
12435 AC_SUBST(ICECREAM_RUN)
12437 dnl ===================================================================
12438 dnl Setup the ICECC_VERSION for the build the same way it was set for
12439 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12440 dnl ===================================================================
12441 x_ICECC_VERSION=[\#]
12442 if test -n "$ICECC_VERSION" ; then
12445 AC_SUBST(x_ICECC_VERSION)
12446 AC_SUBST(ICECC_VERSION)
12448 dnl ===================================================================
12450 AC_MSG_CHECKING([MPL subset])
12453 if test "$enable_mpl_subset" = "yes"; then
12455 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12457 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12460 if test "$warn_report" = "true"; then
12461 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12463 if test "x$enable_postgresql_sdbc" != "xno"; then
12464 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the PostgreSQL database backend.])
12466 if test "$enable_lotuswordpro" = "yes"; then
12467 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12469 if test "$WITH_WEBDAV" = "neon"; then
12470 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12472 if test "x$enable_ext_mariadb_connector" = "xyes"; then
12473 AC_MSG_ERROR([need to --disable-ext-mariadb-connector - mariadb/mysql support.])
12475 if test -n "$ENABLE_PDFIMPORT"; then
12476 if test "x$SYSTEM_POPPLER" = "x"; then
12477 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12480 # cf. m4/libo_check_extension.m4
12481 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12482 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12484 for theme in $WITH_THEMES; do
12486 breeze|crystal|default|hicontrast|oxygen|sifr)
12487 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12492 ENABLE_OPENGL_TRANSITIONS=
12494 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12495 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12499 AC_DEFINE(MPL_HAVE_SUBSET)
12500 AC_MSG_RESULT([only])
12502 AC_MSG_RESULT([no restrictions])
12504 AC_SUBST(MPL_SUBSET)
12506 dnl ===================================================================
12508 AC_MSG_CHECKING([formula logger])
12509 ENABLE_FORMULA_LOGGER=
12511 if test "x$enable_formula_logger" = "xyes"; then
12512 AC_MSG_RESULT([yes])
12513 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12514 ENABLE_FORMULA_LOGGER=TRUE
12515 elif test -n "$ENABLE_DBGUTIL" ; then
12516 AC_MSG_RESULT([yes])
12517 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12518 ENABLE_FORMULA_LOGGER=TRUE
12520 AC_MSG_RESULT([no])
12523 AC_SUBST(ENABLE_FORMULA_LOGGER)
12525 dnl ===================================================================
12526 dnl Setting up the environment.
12527 dnl ===================================================================
12528 AC_MSG_NOTICE([setting up the build environment variables...])
12532 if test "$build_os" = "cygwin"; then
12533 if test -d "$COMPATH/atlmfc/lib"; then
12534 ATL_LIB="$COMPATH/atlmfc/lib"
12535 ATL_INCLUDE="$COMPATH/atlmfc/include"
12537 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12538 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12540 if test "$BITNESS_OVERRIDE" = 64; then
12541 if test $VCVER = "150"; then
12542 ATL_LIB="$ATL_LIB/x64"
12544 ATL_LIB="$ATL_LIB/amd64"
12547 if test $VCVER = "150"; then
12548 ATL_LIB="$ATL_LIB/x86"
12551 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12552 PathFormat "/usr/bin/find.exe"
12553 FIND="$formatted_path"
12554 PathFormat "/usr/bin/sort.exe"
12555 SORT="$formatted_path"
12556 PathFormat "/usr/bin/grep.exe"
12557 WIN_GREP="$formatted_path"
12558 PathFormat "/usr/bin/ls.exe"
12559 WIN_LS="$formatted_path"
12560 PathFormat "/usr/bin/touch.exe"
12561 WIN_TOUCH="$formatted_path"
12567 AC_SUBST(ATL_INCLUDE)
12573 AC_SUBST(WIN_TOUCH)
12575 AC_SUBST(BUILD_TYPE)
12580 PERL="$formatted_path"
12583 if test -n "$TMPDIR"; then
12584 TEMP_DIRECTORY="$TMPDIR"
12586 TEMP_DIRECTORY="/tmp"
12588 if test "$build_os" = "cygwin"; then
12589 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12591 AC_SUBST(TEMP_DIRECTORY)
12593 # setup the PATH for the environment
12594 if test -n "$LO_PATH_FOR_BUILD"; then
12595 LO_PATH="$LO_PATH_FOR_BUILD"
12601 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12602 if test "$ENABLE_JAVA" != ""; then
12603 pathmunge "$JAVA_HOME/bin" "after"
12608 # Win32 make needs native paths
12609 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12610 LO_PATH=`cygpath -p -m "$PATH"`
12612 if test "$BITNESS_OVERRIDE" = 64; then
12613 # needed for msi packaging
12614 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12616 # .NET 4.6 and higher don't have bin directory
12617 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
12618 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12620 pathmunge "$ASM_HOME" "before"
12621 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12622 pathmunge "$CSC_PATH" "before"
12623 pathmunge "$MIDL_PATH" "before"
12624 pathmunge "$AL_PATH" "before"
12625 pathmunge "$MSPDB_PATH" "before"
12626 if test -n "$MSBUILD_PATH" ; then
12627 pathmunge "$MSBUILD_PATH" "before"
12629 if test "$BITNESS_OVERRIDE" = 64; then
12630 pathmunge "$COMPATH/bin/amd64" "before"
12631 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
12633 pathmunge "$COMPATH/bin" "before"
12634 pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
12636 if test "$ENABLE_JAVA" != ""; then
12637 if test -d "$JAVA_HOME/jre/bin/client"; then
12638 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12640 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12641 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12643 pathmunge "$JAVA_HOME/bin" "before"
12648 pathmunge "/usr/css/bin" "before"
12649 if test "$ENABLE_JAVA" != ""; then
12650 pathmunge "$JAVA_HOME/bin" "after"
12660 # Generate a configuration sha256 we can use for deps
12661 if test -f config_host.mk; then
12662 config_sha256=`$SHA256SUM config_host.mk | sed "s/ .*//"`
12664 if test -f config_host_lang.mk; then
12665 config_lang_sha256=`$SHA256SUM config_host_lang.mk | sed "s/ .*//"`
12668 CFLAGS=$my_original_CFLAGS
12669 CXXFLAGS=$my_original_CXXFLAGS
12670 CPPFLAGS=$my_original_CPPFLAGS
12672 AC_CONFIG_FILES([config_host.mk
12673 config_host_lang.mk
12676 bin/bffvalidator.sh
12677 bin/odfvalidator.sh
12679 instsetoo_native/util/openoffice.lst
12680 sysui/desktop/macosx/Info.plist])
12681 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12682 AC_CONFIG_HEADERS([config_host/config_clang.h])
12683 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12684 AC_CONFIG_HEADERS([config_host/config_eot.h])
12685 AC_CONFIG_HEADERS([config_host/config_extension_update.h])
12686 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12687 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
12688 AC_CONFIG_HEADERS([config_host/config_dbus.h])
12689 AC_CONFIG_HEADERS([config_host/config_features.h])
12690 AC_CONFIG_HEADERS([config_host/config_firebird.h])
12691 AC_CONFIG_HEADERS([config_host/config_folders.h])
12692 AC_CONFIG_HEADERS([config_host/config_gio.h])
12693 AC_CONFIG_HEADERS([config_host/config_global.h])
12694 AC_CONFIG_HEADERS([config_host/config_gpgme.h])
12695 AC_CONFIG_HEADERS([config_host/config_java.h])
12696 AC_CONFIG_HEADERS([config_host/config_langs.h])
12697 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12698 AC_CONFIG_HEADERS([config_host/config_libcxx.h])
12699 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
12700 AC_CONFIG_HEADERS([config_host/config_locales.h])
12701 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12702 AC_CONFIG_HEADERS([config_host/config_kde4.h])
12703 AC_CONFIG_HEADERS([config_host/config_qt5.h])
12704 AC_CONFIG_HEADERS([config_host/config_kde5.h])
12705 AC_CONFIG_HEADERS([config_host/config_gtk3_kde5.h])
12706 AC_CONFIG_HEADERS([config_host/config_oox.h])
12707 AC_CONFIG_HEADERS([config_host/config_options.h])
12708 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
12709 AC_CONFIG_HEADERS([config_host/config_test.h])
12710 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12711 AC_CONFIG_HEADERS([config_host/config_vendor.h])
12712 AC_CONFIG_HEADERS([config_host/config_vcl.h])
12713 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12714 AC_CONFIG_HEADERS([config_host/config_version.h])
12715 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12716 AC_CONFIG_HEADERS([config_host/config_poppler.h])
12717 AC_CONFIG_HEADERS([config_host/config_python.h])
12718 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
12721 if test "$CROSS_COMPILING" = TRUE; then
12722 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12725 # touch the config timestamp file
12726 if test ! -f config_host.mk.stamp; then
12727 echo > config_host.mk.stamp
12728 elif test "$config_sha256" = `$SHA256SUM config_host.mk | sed "s/ .*//"`; then
12729 echo "Host Configuration unchanged - avoiding scp2 stamp update"
12731 echo > config_host.mk.stamp
12734 # touch the config lang timestamp file
12735 if test ! -f config_host_lang.mk.stamp; then
12736 echo > config_host_lang.mk.stamp
12737 elif test "$config_lang_sha256" = `$SHA256SUM config_host_lang.mk | sed "s/ .*//"`; then
12738 echo "Language Configuration unchanged - avoiding scp2 stamp update"
12740 echo > config_host_lang.mk.stamp
12744 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12747 ****************************************************************************
12749 Your make version is known to be horribly slow, and hard to debug
12750 problems with. To get a reasonably functional make please do:
12752 to install a pre-compiled binary make for Win32
12754 mkdir -p /opt/lo/bin
12756 wget https://dev-www.libreoffice.org/bin/cygwin/make-85047eb-msvc.exe
12757 cp make-85047eb-msvc.exe make
12760 to install from source:
12761 place yourself in a working directory of you choice.
12763 git clone git://git.savannah.gnu.org/make.git
12765 [go to Start menu, click "All Programs", click "Visual Studio 2015", click "Visual Studio Tools", double-click "VS2015 x86 Native Tools Command Prompt" or "VS2015 x64 Native Tools Command Prompt"]
12766 set PATH=%PATH%;C:\Cygwin\bin
12767 [or Cygwin64, if that is what you have]
12768 cd path-to-make-repo-you-cloned-above
12769 build_w32.bat --without-guile
12771 should result in a WinRel/gnumake.exe.
12772 Copy it to the Cygwin /opt/lo/bin directory as make.exe
12774 Then re-run autogen.sh
12776 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12777 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12783 ****************************************************************************
12788 To view some help, run:
12793 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
12795 After the build of LibreOffice has finished successfully, you can immediately run LibreOffice using the command:
12798 if test $_os = Darwin; then
12799 echo open instdir/$PRODUCTNAME.app
12801 echo instdir/program/soffice
12805 If you want to run the smoketest, run:
12811 if test -f warn; then
12816 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: