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 argumemnt 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([Collabora Office],[5.3.10.67],[],[],[https://collaboraoffice.com/])
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`"
141 echo "********************************************************************"
143 echo "* Running ${PACKAGE_NAME} build configuration."
145 echo "********************************************************************"
148 dnl ===================================================================
149 dnl checks build and host OSes
150 dnl do this before argument processing to allow for platform dependent defaults
151 dnl ===================================================================
154 AC_MSG_CHECKING([for product name])
155 PRODUCTNAME="AC_PACKAGE_NAME"
156 if test -n "$with_product_name" -a "$with_product_name" != no; then
157 PRODUCTNAME="$with_product_name"
159 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
160 PRODUCTNAME="${PRODUCTNAME}Dev"
161 PRODUCTNAME=AC_PACKAGE_NAME
163 AC_MSG_RESULT([$PRODUCTNAME])
164 AC_SUBST(PRODUCTNAME)
165 PRODUCTNAME_WITHOUT_SPACES=${PRODUCTNAME// /}
166 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
168 dnl ===================================================================
169 dnl Our version is defined by the AC_INIT() at the top of this script.
170 dnl ===================================================================
172 AC_MSG_CHECKING([for package version])
173 if test -n "$with_package_version" -a "$with_package_version" != no; then
174 PACKAGE_VERSION="$with_package_version"
176 AC_MSG_RESULT([$PACKAGE_VERSION])
178 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
180 LIBO_VERSION_MAJOR=$1
181 LIBO_VERSION_MINOR=$2
182 LIBO_VERSION_MICRO=$3
183 LIBO_VERSION_PATCH=$4
185 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
186 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
187 # no way to encode that into an integer in general.
188 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
190 LIBO_VERSION_SUFFIX=$5
191 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
192 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
193 # they get undoubled before actually passed to sed.
194 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
195 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
196 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
197 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
199 AC_SUBST(LIBO_VERSION_MAJOR)
200 AC_SUBST(LIBO_VERSION_MINOR)
201 AC_SUBST(LIBO_VERSION_MICRO)
202 AC_SUBST(LIBO_VERSION_PATCH)
203 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
204 AC_SUBST(LIBO_VERSION_SUFFIX)
205 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
207 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
208 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
209 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
210 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
212 LIBO_THIS_YEAR=`date +%Y`
213 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
215 dnl ===================================================================
217 dnl ===================================================================
218 AC_MSG_CHECKING([for product version])
219 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
220 AC_MSG_RESULT([$PRODUCTVERSION])
221 AC_SUBST(PRODUCTVERSION)
224 # AC_PROG_EGREP doesn't set GREP on all systems as well
225 AC_PATH_PROG(GREP, grep)
233 dnl ======================================
234 dnl Required GObject introspection version
235 dnl ======================================
236 INTROSPECTION_REQUIRED_VERSION=1.32.0
238 dnl ===================================================================
239 dnl Search all the common names for GNU Make
240 dnl ===================================================================
241 AC_MSG_CHECKING([for GNU Make])
243 # try to use our own make if it is available and GNUMAKE was not already defined
244 if test -z "$GNUMAKE"; then
245 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
246 GNUMAKE="$LODE_HOME/opt/bin/make"
247 elif test -x "/opt/lo/bin/make"; then
248 GNUMAKE="/opt/lo/bin/make"
253 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
254 if test -n "$a"; then
255 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
256 if test $? -eq 0; then
257 if test "$build_os" = "cygwin"; then
258 if test -n "$($a -v | grep 'Built for Windows')" ; then
259 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
260 GNUMAKE_WIN_NATIVE="TRUE"
271 AC_MSG_RESULT($GNUMAKE)
272 if test -z "$GNUMAKE"; then
273 AC_MSG_ERROR([not found. install GNU Make.])
275 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
276 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
280 win_short_path_for_make()
282 local_short_path="$1"
283 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
284 cygpath -sm "$local_short_path"
286 cygpath -u "$(cygpath -d "$local_short_path")"
291 if test "$build_os" = "cygwin"; then
292 PathFormat "$SRC_ROOT"
293 SRC_ROOT="$formatted_path"
294 PathFormat "$BUILDDIR"
295 BUILDDIR="$formatted_path"
297 AC_MSG_CHECKING(for explicit COMSPEC)
298 if test -z "$COMSPEC"; then
299 AC_MSG_ERROR([COMSPEC not set in Environment, please set it an rerun])
306 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
307 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
309 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
310 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
313 # need sed in os checks...
314 AC_PATH_PROGS(SED, sed)
315 if test -z "$SED"; then
316 AC_MSG_ERROR([install sed to run this script])
319 # Set the ENABLE_LTO variable
320 # ===================================================================
321 AC_MSG_CHECKING([whether to use link-time optimization])
322 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
325 AC_DEFINE(STATIC_LINKING)
332 dnl ===================================================================
333 dnl When building for Android, --with-android-ndk,
334 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
336 dnl ===================================================================
338 AC_ARG_WITH(android-ndk,
339 AS_HELP_STRING([--with-android-ndk],
340 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
343 AC_ARG_WITH(android-ndk-toolchain-version,
344 AS_HELP_STRING([--with-android-ndk-toolchain-version],
345 [Specify which toolchain version to use, of those present in the
346 Android NDK you are using. The default is 4.9 currently.]), ,)
348 AC_ARG_WITH(android-sdk,
349 AS_HELP_STRING([--with-android-sdk],
350 [Specify location of the Android SDK. Mandatory when building for Android,
351 or when building the Impress Remote Android app.]),
355 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
356 with_android_ndk="$SRC_ROOT/external/android-ndk"
358 if test -n "$with_android_ndk"; then
359 ANDROID_NDK_HOME=$with_android_ndk
361 # Set up a lot of pre-canned defaults
363 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
364 if test ! -f $ANDROID_NDK_HOME/source.properties; then
365 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
367 ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
369 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
371 if test -z "$ANDROID_NDK_VERSION"; then
372 AC_MSG_ERROR([Failed to determine android NDK version. Please check your installation.])
374 case $ANDROID_NDK_VERSION in
377 11.1.*|12.1.*|13.1.*)
380 AC_MSG_WARN([Untested android NDK version $ANDROID_NDK_VERSION, only versions r9* til 13.1.* have been used successfully. Proceed at your own risk.])
381 add_warning "Untested android NDK version $ANDROID_NDK_VERSION, only versions r9* til 13.1.* have been used successfully. Proceed at your own risk."
385 if test $host_cpu = arm; then
387 android_platform_prefix=$android_cpu-linux-androideabi
388 elif test $host_cpu = aarch64; then
390 android_platform_prefix=$android_cpu-linux-android
391 elif test $host_cpu = mips; then
393 android_platform_prefix=$android_cpu-linux-androideabi
395 # host_cpu is something like "i386" or "i686" I guess, NDK uses
396 # "x86" in some contexts
398 android_platform_prefix=$android_cpu
401 if test -z "$with_android_ndk_toolchain_version"; then
403 with_android_ndk_toolchain_version=4.9
406 case "$with_android_ndk_toolchain_version" in
408 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$with_android_ndk_toolchain_version
409 ANDROID_COMPILER_DIR=$ANDROID_BINUTILS_DIR
412 AC_MSG_WARN([Building with the Clang tool-chain is known to break in the bridges module, fix that please])
413 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-4.8
414 ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm-${with_android_ndk_toolchain_version#clang}
415 ANDROID_USING_CLANG=true
418 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option])
421 if test ! -d $ANDROID_BINUTILS_DIR; then
422 AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
423 elif test $ANDROID_COMPILER_DIR != $ANDROID_BINUTILS_DIR -a ! -d $ANDROID_COMPILER_DIR; then
424 AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
427 # Check if there is a 64-bit tool-chain. Google provides a NDK with 64-bit tool-chain binaries in
428 # NDK r8e and later, and for earlier NDKs it was possible to build one yourself. Using a 64-bit
429 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
430 # manage to link the (app-specific) single huge .so that is built for the app in
431 # android/source/ if there is debug information in a significant part of the object files.
432 # (A 64-bit ld.gold grows to much over 10 gigabytes of virtual space when linking such a .so if
433 # all objects have been built with debug information.)
443 AC_MSG_ERROR([We only support building for Android from Linux or OS X])
447 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86/bin
448 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86
449 if test $build_cpu = x86_64; then
450 if test -d $ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64; then
451 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64/bin
453 if test -d $ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64; then
454 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64
457 ANDROID_BINUTILS_BIN=$ANDROID_BINUTILS_PREBUILT_ROOT/bin
459 # This stays empty if there is just one version of the toolchain in the NDK
460 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=
461 if test ! -d "$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs" ; then
462 # nope, won't work if empty...
463 # as is the case when using the ndk-bundle as installed with android studio
464 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
465 if test -n "$ANDROID_USING_CLANG"; then
466 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=4.8/
471 if test $host_cpu = arm; then
472 android_gnu_prefix=arm-linux-androideabi
473 elif test $host_cpu = aarch64; then
474 android_gnu_prefix=aarch64-linux-android
475 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
477 elif test $host_cpu = mips; then
478 android_gnu_prefix=mipsel-linux-android
479 elif test $ANDROID_NDK_VERSION = r8; then
480 # The prefix used for the x86 tool-chain changed between NDK r8 and r8b
481 android_gnu_prefix=i686-android-linux
483 android_gnu_prefix=i686-linux-android
486 ANDROID_ARCH=$android_cpu
487 if test $host_cpu = arm; then
488 ANDROID_APP_ABI=armeabi-v7a
489 if test -n "$ANDROID_USING_CLANG"; then
490 ANDROIDCFLAGS="-gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT"
491 ANDROIDCFLAGS="$ANDROIDCFLAGS -target armv7-none-linux-androideabi"
492 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes"
496 ANDROIDCFLAGS="$ANDROIDCFLAGS -mthumb"
497 ANDROIDCFLAGS="$ANDROIDCFLAGS -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
498 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wl,--fix-cortex-a8"
499 elif test $host_cpu = aarch64; then
500 ANDROID_APP_ABI=arm64-v8a
502 elif test $host_cpu = mips; then
507 ANDROIDCFLAGS="-march=atom"
509 ANDROIDCFLAGS="$ANDROIDCFLAGS -ffunction-sections -fdata-sections"
510 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/$ANDROID_APP_ABI"
511 ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}"
512 export PKG_CONFIG_LIBDIR="$ANDROID_BINUTILS_PREBUILT_ROOT/lib/pkgconfig"
514 if test -n "$ANDROID_USING_CLANG"; then
515 ANDROIDCFLAGS="$ANDROIDCFLAGS -Qunused-arguments"
517 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wno-psabi"
520 test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}
521 test -z "$AR" && AR=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ar
522 test -z "$NM" && NM=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-nm
523 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-objdump
524 test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ranlib
525 test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-strip
527 # When using the 4.6 or newer toolchain, use the gold linker
528 case "$with_android_ndk_toolchain_version" in
529 4.[[6789]]*|[[56789]].*|clang*)
530 if test "$host_cpu" = arm -a "$ENABLE_LTO" != TRUE; then
531 ANDROIDCFLAGS="$ANDROIDCFLAGS -fuse-ld=gold"
536 if test "$ENABLE_LTO" = TRUE; then
537 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
538 # $CC and $CXX when building external libraries
539 if test "$COM_IS_CLANG" = TRUE; then
540 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto"
542 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
546 # gdbserver can be in different locations
547 if test -f $ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver; then
548 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver
549 elif test -f $ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver; then
550 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver
551 elif test $android_cpu = aarch64; then
552 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-arm64/gdbserver/gdbserver
554 AC_MSG_ERROR([Can't find gdbserver for your Android target])
557 if test $host_cpu = arm; then
558 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/armeabi-v7a/include"
559 elif test $host_cpu = mips; then
560 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/mips/include"
562 ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/x86/include"
565 if test -z "$CC"; then
566 case "$with_android_ndk_toolchain_version" in
568 CC="$ANDROID_COMPILER_BIN/$android_gnu_prefix-gcc $ANDROIDCFLAGS"
571 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
574 if test -z "$CXX"; then
575 case "$with_android_ndk_toolchain_version" in
577 CXX="$ANDROID_COMPILER_BIN/$android_gnu_prefix-g++ $ANDROIDCXXFLAGS"
580 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
585 # remember to download the ownCloud Android library later
586 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
588 AC_SUBST(ANDROID_NDK_GDBSERVER)
589 AC_SUBST(ANDROID_APP_ABI)
591 dnl ===================================================================
592 dnl --with-android-sdk
593 dnl ===================================================================
595 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
596 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
598 if test -n "$with_android_sdk"; then
599 ANDROID_SDK_HOME=$with_android_sdk
600 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
602 AC_SUBST(ANDROID_SDK_HOME)
604 dnl ===================================================================
605 dnl The following is a list of supported systems.
606 dnl Sequential to keep the logic very simple
607 dnl These values may be checked and reset later.
608 dnl ===================================================================
609 #defaults unless the os test overrides this:
617 # Default values, as such probably valid just for Linux, set
618 # differently below just for Mac OSX,but at least better than
619 # hardcoding these as we used to do. Much of this is duplicated also
620 # in solenv for old build system and for gbuild, ideally we should
621 # perhaps define stuff like this only here in configure.ac?
623 LINKFLAGSSHL="-shared"
627 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
636 build_gstreamer_1_0=yes
637 build_gstreamer_0_10=yes
642 dnl ===========================================================
643 dnl Check whether we're using Solaris 10 - SPARC or Intel.
644 dnl ===========================================================
645 AC_MSG_CHECKING([the Solaris operating system release])
646 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
647 if test "$_os_release" -lt "10"; then
648 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
650 AC_MSG_RESULT([ok ($_os_release)])
653 dnl Check whether we're using a SPARC or i386 processor
654 AC_MSG_CHECKING([the processor type])
655 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
656 AC_MSG_RESULT([ok ($host_cpu)])
658 AC_MSG_ERROR([only SPARC and i386 processors are supported])
662 linux-gnu*|k*bsd*-gnu*)
664 build_gstreamer_1_0=yes
665 build_gstreamer_0_10=yes
678 cygwin*|interix*|mingw32*)
680 # When building on Windows normally with MSVC under Cygwin,
681 # configure thinks that the host platform (the platform the
682 # built code will run on) is Cygwin, even if it obviously is
683 # Windows, which in Autoconf terminology is called
684 # "mingw32". (Which is misleading as MinGW is the name of the
685 # tool-chain, not an operating system.)
687 # Somewhat confusing, yes. But this configure script doesn't
688 # look at $host etc that much, it mostly uses its own $_os
689 # variable, set here in this case statement.
691 # When cross-compiling to Windows from Unix, the host platform
692 # is "mingw32" (because in that case it is the MinGW
693 # tool-chain that is used).
706 # If the host OS matches "mingw32*", that means we are using the
707 # MinGW cross-compiler, because we don't see the point in building
708 # LibreOffice using MinGW on Windows. If you want to build on
709 # Windows, use MSVC. If you want to use MinGW, surely you want to
710 # cross-compile (from Linux or some other Unix).
715 if test -z "$CC"; then
716 CC="$host_cpu-$host_vendor-$host_os-gcc"
718 if test -z "$CXX"; then
719 CXX="$host_cpu-$host_vendor-$host_os-g++"
725 darwin*) # Mac OS X or iOS
732 if test "$host_cpu" = "arm"; then
738 if test -n "$LODE_HOME" ; then
740 AC_MSG_NOTICE([sanitized the PATH to $PATH])
742 INSTROOTSUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app/Contents
743 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
746 # See comment above the case "$host_os"
747 LINKFLAGSSHL="-dynamiclib -single_module"
754 # -undefined error is the default
760 build_gstreamer_1_0=yes
761 build_gstreamer_0_10=yes
765 AC_MSG_CHECKING([the FreeBSD operating system release])
766 if test -n "$with_os_version"; then
767 OSVERSION="$with_os_version"
769 OSVERSION=`/sbin/sysctl -n kern.osreldate`
771 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
772 AC_MSG_CHECKING([which thread library to use])
773 if test "$OSVERSION" -lt "500016"; then
774 PTHREAD_CFLAGS="-D_THREAD_SAFE"
775 PTHREAD_LIBS="-pthread"
776 elif test "$OSVERSION" -lt "502102"; then
777 PTHREAD_CFLAGS="-D_THREAD_SAFE"
781 PTHREAD_LIBS="-pthread"
783 AC_MSG_RESULT([$PTHREAD_LIBS])
789 build_gstreamer_1_0=yes
790 build_gstreamer_0_10=yes
794 PTHREAD_LIBS="-pthread -lpthread"
801 PTHREAD_LIBS=-pthread
809 PTHREAD_CFLAGS="-D_THREAD_SAFE"
810 PTHREAD_LIBS="-pthread"
816 build_gstreamer_1_0=yes
817 build_gstreamer_0_10=yes
821 PTHREAD_LIBS="-pthread"
826 build_gstreamer_1_0=no
827 build_gstreamer_0_10=no
828 enable_lotuswordpro=no
829 enable_mpl_subset=yes
832 enable_report_builder=no
834 enable_postgresql_sdbc=no
848 if test -z "$with_android_ndk"; then
849 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
852 if test -z "$with_android_ndk_toolchain_version"; then
853 AC_MSG_ERROR([the --with-android-ndk-toolchain-version option is mandatory])
856 # Verify that the NDK and SDK options are proper
857 if test ! -f "$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}/usr/lib/libc.a"; then
858 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
861 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
862 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
866 build_gstreamer_1_0=no
867 build_gstreamer_0_10=no
868 enable_lotuswordpro=no
869 enable_mpl_subset=yes
872 enable_report_builder=no
887 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
891 if echo "$host_os" | grep -q linux-android ; then
892 if test -z "$with_android_sdk"; then
893 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
896 if test ! -d "$ANDROID_SDK_HOME/platforms"; then
897 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
900 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
901 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
902 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
903 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
904 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
905 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
906 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
907 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
909 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
910 AC_MSG_WARN([android support repository not found - install with
911 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
912 to allow the build to download the specified version of the android support libraries])
913 add_warning "android support repository not found - install with"
914 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
915 add_warning "to allow the build to download the specified version of the android support libraries"
919 if test "$_os" = "AIX"; then
920 AC_PATH_PROG(GAWK, gawk)
921 if test -z "$GAWK"; then
922 AC_MSG_ERROR([gawk not found in \$PATH])
929 AC_SUBST(PTHREAD_CFLAGS)
930 AC_SUBST(PTHREAD_LIBS)
932 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
933 dnl Needs to precede the AC_SEARCH_LIBS call below, which apparently calls
934 dnl AC_PROG_CC internally.
935 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
936 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
942 if test $_os != "WINNT"; then
944 AC_SEARCH_LIBS([dlsym], [dl],
945 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
946 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
949 AC_SUBST(DLOPEN_LIBS)
951 ###############################################################################
952 # Extensions switches --enable/--disable
953 ###############################################################################
954 # By default these should be enabled unless having extra dependencies.
955 # If there is extra dependency over configure options then the enable should
956 # be automagic based on whether the requiring feature is enabled or not.
957 # All this options change anything only with --enable-extension-integration.
959 # The name of this option and its help string makes it sound as if
960 # extensions are built anyway, just not integrated in the installer,
961 # if you use --disable-extension-integration. Is that really the
964 AC_ARG_ENABLE(extension-integration,
965 AS_HELP_STRING([--disable-extension-integration],
966 [Disable integration of the built extensions in the installer of the
967 product. Use this switch to disable the integration.])
970 AC_ARG_ENABLE(export,
971 AS_HELP_STRING([--disable-export],
972 [Disable (some) code for document export. Useful when building viewer-only apps that lack
973 save/export functionality, to avoid having an excessive amount of code and data used
974 only for exporrt linked in. Work in progress, use only if you are hacking on it.])
977 AC_ARG_ENABLE(avmedia,
978 AS_HELP_STRING([--disable-avmedia],
979 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
982 AC_ARG_ENABLE(database-connectivity,
983 AS_HELP_STRING([--disable-database-connectivity],
984 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
987 # This doesn't mean not building (or "integrating") extensions
988 # (although it probably should; i.e. it should imply
989 # --disable-extension-integration I guess), it means not supporting
990 # any extension mechanism at all
991 AC_ARG_ENABLE(extensions,
992 AS_HELP_STRING([--disable-extensions],
993 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
996 AC_ARG_ENABLE(scripting,
997 AS_HELP_STRING([--disable-scripting],
998 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
1001 # This is mainly for Android and iOS, but could potentially be used in some
1002 # special case otherwise, too, so factored out as a separate setting
1004 AC_ARG_ENABLE(dynamic-loading,
1005 AS_HELP_STRING([--disable-dynamic-loading],
1006 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
1009 AC_ARG_ENABLE(ext-mariadb-connector,
1010 AS_HELP_STRING([--enable-ext-mariadb-connector],
1011 [Enable the build of the MariaDB/MySQL Connector extension.])
1014 AC_ARG_ENABLE(report-builder,
1015 AS_HELP_STRING([--disable-report-builder],
1016 [Disable the Report Builder.])
1019 AC_ARG_ENABLE(ext-wiki-publisher,
1020 AS_HELP_STRING([--enable-ext-wiki-publisher],
1021 [Enable the Wiki Publisher extension.])
1024 AC_ARG_ENABLE(lpsolve,
1025 AS_HELP_STRING([--disable-lpsolve],
1026 [Disable compilation of the lp solve solver ])
1028 AC_ARG_ENABLE(coinmp,
1029 AS_HELP_STRING([--disable-coinmp],
1030 [Disable compilation of the CoinMP solver ])
1033 AC_ARG_ENABLE(pdfimport,
1034 AS_HELP_STRING([--disable-pdfimport],
1035 [Disable building the PDF import feature.])
1038 AC_ARG_ENABLE(pdfium,
1039 AS_HELP_STRING([--disable-pdfium],
1040 [Disable building PDFium.])
1043 ###############################################################################
1045 dnl ---------- *** ----------
1047 AC_ARG_ENABLE(mergelibs,
1048 AS_HELP_STRING([--enable-mergelibs],
1049 [Merge several of the smaller libraries into one big, "merged", one.])
1052 AC_ARG_ENABLE(graphite,
1053 AS_HELP_STRING([--disable-graphite],
1054 [Disables the compilation of Graphite smart font rendering.])
1057 AC_ARG_ENABLE(breakpad,
1058 AS_HELP_STRING([--enable-breakpad],
1059 [Enables breakpad for crash reporting.])
1062 AC_ARG_ENABLE(orcus,
1063 AS_HELP_STRING([--enable-orcus],
1064 [Enables orcus for extra file import filters for Calc.])
1067 AC_ARG_ENABLE(fetch-external,
1068 AS_HELP_STRING([--disable-fetch-external],
1069 [Disables fetching external tarballs from web sources.])
1073 AS_HELP_STRING([--enable-pch],
1074 [Enables precompiled header support for C++. Forced default on Windows/VC build])
1078 AS_HELP_STRING([--enable-epm],
1079 [LibreOffice includes self-packaging code, that requires epm, however epm is
1080 useless for large scale package building.])
1084 AS_HELP_STRING([--disable-odk],
1085 [LibreOffice includes an ODK, office development kit which some packagers may
1086 wish to build without.])
1089 AC_ARG_ENABLE(mpl-subset,
1090 AS_HELP_STRING([--enable-mpl-subset],
1091 [Don't compile any pieces which are not MPL or more liberally licensed])
1094 AC_ARG_ENABLE(evolution2,
1095 AS_HELP_STRING([--enable-evolution2],
1096 [Allows the built-in evolution 2 addressbook connectivity build to be
1100 AC_ARG_ENABLE(directx,
1101 AS_HELP_STRING([--disable-directx],
1102 [Remove DirectX implementation for the new XCanvas interface.
1103 The DirectX support requires more stuff installed on Windows to
1104 compile. (DirectX SDK, GDI+ libs)])
1107 AC_ARG_ENABLE(activex,
1108 AS_HELP_STRING([--disable-activex],
1109 [Disable the use of ActiveX for a Windows build.
1110 This switch is mandatory when using an Express edition of Visual Studio.])
1114 AS_HELP_STRING([--disable-atl],
1115 [Disable the use of ATL for a Windows build.])
1117 This switch is mandatory when using an Express edition of Visual Studio.
1121 AC_ARG_ENABLE(avahi,
1122 AS_HELP_STRING([--enable-avahi],
1123 [Determines whether to use Avahi to advertise Impress to remote controls.]),
1126 AC_ARG_ENABLE(werror,
1127 AS_HELP_STRING([--enable-werror],
1128 [Turn warnings to errors. (Has no effect in modules where the treating
1129 of warnings as errors is disabled explicitly.)]),
1132 AC_ARG_ENABLE(assert-always-abort,
1133 AS_HELP_STRING([--enable-assert-always-abort],
1134 [make assert() abort even in release code.]),
1137 AC_ARG_ENABLE(dbgutil,
1138 AS_HELP_STRING([--enable-dbgutil],
1139 [Provide debugging support from --enable-debug and include additional debugging
1140 utilities such as object counting or more expensive checks.
1141 This is the recommended option for developers.
1142 Note that this makes the build ABI incompatible, it is not possible to mix object
1143 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1145 AC_ARG_ENABLE(debug,
1146 AS_HELP_STRING([--enable-debug],
1147 [Include debugging information, disable compiler optimization and inlining plus
1148 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1150 AC_ARG_ENABLE(sal-log,
1151 AS_HELP_STRING([--enable-sal-log],
1152 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1154 AC_ARG_ENABLE(selective-debuginfo,
1155 AS_HELP_STRING([--enable-selective-debuginfo],
1156 [If --enable-debug or --enable-dbgutil is used, build debugging information
1157 (-g compiler flag) only for the specified gbuild build targets
1158 (where all means everything, - prepended means not to enable, / appended means
1159 everything in the directory; there is no ordering, more specific overrides
1160 more general, and disabling takes precedence).
1161 Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
1163 AC_ARG_ENABLE(symbols,
1164 AS_HELP_STRING([--enable-symbols],
1165 [Generate debug information.
1166 By default, enabled for --enable-debug and --enable-dbgutil, disabled
1169 AC_ARG_ENABLE(runtime-optimizations,
1170 AS_HELP_STRING([--disable-runtime-optimizations],
1171 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1172 JVM JIT) that are known to interact badly with certain dynamic analysis
1173 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1174 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1175 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1177 AC_ARG_ENABLE(compiler-plugins,
1178 AS_HELP_STRING([--enable-compiler-plugins],
1179 [Enable compiler plugins that will perform additional checks during
1180 building. Enabled automatically by --enable-dbgutil.]))
1182 AC_ARG_ENABLE(ooenv,
1183 AS_HELP_STRING([--disable-ooenv],
1184 [Disable ooenv for the instdir installation.]))
1187 AS_HELP_STRING([--enable-lto],
1188 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1189 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1190 linker. For MSVC, this option is broken at the moment. This is experimental work
1191 in progress that shouldn't be used unless you are working on it.)]))
1193 AC_ARG_ENABLE(python,
1194 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1195 [Enables or disables Python support at run-time and build-time.
1196 Also specifies what Python to use. 'auto' is the default.
1197 'fully-internal' even forces the internal version for uses of Python
1198 during the build.]))
1201 AS_HELP_STRING([--disable-gtk],
1202 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
1206 AS_HELP_STRING([--disable-gtk3],
1207 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.
1208 This is experimental and may not work.]),
1211 AC_ARG_ENABLE(systray,
1212 AS_HELP_STRING([--disable-systray],
1213 [Determines whether to build the systray quickstarter.]),
1214 ,enable_systray=yes)
1216 AC_ARG_ENABLE(split-app-modules,
1217 AS_HELP_STRING([--enable-split-app-modules],
1218 [Split file lists for app modules, e.g. base, calc.
1219 Has effect only with make distro-pack-install]),
1222 AC_ARG_ENABLE(split-opt-features,
1223 AS_HELP_STRING([--enable-split-opt-features],
1224 [Split file lists for some optional features, e.g. pyuno, testtool.
1225 Has effect only with make distro-pack-install]),
1228 AC_ARG_ENABLE(cairo-canvas,
1229 AS_HELP_STRING([--disable-cairo-canvas],
1230 [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
1234 AS_HELP_STRING([--disable-dbus],
1235 [Determines whether to enable features that depend on dbus.
1236 e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
1239 AC_ARG_ENABLE(sdremote,
1240 AS_HELP_STRING([--disable-sdremote],
1241 [Determines whether to enable Impress remote control (i.e. the server component).]),
1242 ,enable_sdremote=yes)
1244 AC_ARG_ENABLE(sdremote-bluetooth,
1245 AS_HELP_STRING([--disable-sdremote-bluetooth],
1246 [Determines whether to build sdremote with bluetooth support.
1247 Requires dbus on Linux.]))
1250 AS_HELP_STRING([--disable-gio],
1251 [Determines whether to use the GIO support.]),
1254 AC_ARG_ENABLE(telepathy,
1255 AS_HELP_STRING([--enable-telepathy],
1256 [Determines whether to enable Telepathy for collaboration.]),
1257 ,enable_telepathy=no)
1260 AS_HELP_STRING([--enable-tde],
1261 [Determines whether to use TQt/TDE vclplug on platforms where TQt and
1262 TDE are available.]),
1265 AC_ARG_ENABLE(tdeab,
1266 AS_HELP_STRING([--disable-tdeab],
1267 [Disable the TDE address book support.]),
1269 if test "$enable_tde" = "yes"; then
1275 AS_HELP_STRING([--enable-kde4],
1276 [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
1277 KDE4 are available.]),
1281 AS_HELP_STRING([--disable-gui],
1282 [Disable X11/Wayland support to reduce dependencies. Maybe useful for
1283 headless servers, but soffice --headless works just fine without it.
1284 Work in progress, use only if you are hacking on it.]),
1287 AC_ARG_ENABLE(randr,
1288 AS_HELP_STRING([--disable-randr],
1289 [Disable RandR support in the vcl project.]),
1292 AC_ARG_ENABLE(gstreamer-1-0,
1293 AS_HELP_STRING([--disable-gstreamer-1-0],
1294 [Disable building with the new gstreamer 1.0 avmedia backend.]),
1295 ,enable_gstreamer_1_0=yes)
1297 AC_ARG_ENABLE(gstreamer-0-10,
1298 AS_HELP_STRING([--enable-gstreamer-0-10],
1299 [Enable building with the gstreamer 0.10 avmedia backend.]),
1300 ,enable_gstreamer_0_10=no)
1303 AS_HELP_STRING([--enable-vlc],
1304 [Enable building with the (experimental) VLC avmedia backend.]),
1308 AS_HELP_STRING([--disable-neon],
1309 [Disable neon and the compilation of webdav binding.]),
1312 AC_ARG_ENABLE([eot],
1313 [AS_HELP_STRING([--enable-eot],
1314 [Enable support for Embedded OpenType fonts.])],
1317 AC_ARG_ENABLE(cve-tests,
1318 AS_HELP_STRING([--disable-cve-tests],
1319 [Prevent CVE tests to be executed]),
1322 AC_ARG_ENABLE(chart-tests,
1323 AS_HELP_STRING([--enable-chart-tests],
1324 [Executes chart XShape tests. In a perfect world these tests would be
1325 stable and everyone could run them, in reality it is best to run them
1326 only on a few machines that are known to work and maintained by people
1327 who can judge if a test failure is a regression or not.]),
1330 AC_ARG_ENABLE(build-unowinreg,
1331 AS_HELP_STRING([--enable-build-unowinreg],
1332 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1333 compiler is needed on Linux.]),
1336 AC_ARG_ENABLE(dependency-tracking,
1337 AS_HELP_STRING([--enable-dependency-tracking],
1338 [Do not reject slow dependency extractors.])[
1339 --disable-dependency-tracking
1340 Disables generation of dependency information.
1341 Speed up one-time builds.],
1344 AC_ARG_ENABLE(icecream,
1345 AS_HELP_STRING([--enable-icecream],
1346 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1347 It defaults to /opt/icecream for the location of the icecream gcc/g++
1348 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1352 AS_HELP_STRING([--disable-cups],
1353 [Do not build cups support.])
1356 AC_ARG_ENABLE(ccache,
1357 AS_HELP_STRING([--disable-ccache],
1358 [Do not try to use ccache automatically.
1359 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1360 CC/CXX are not yet set, and --enable-icecream is not given, we
1361 attempt to use ccache. --disable-ccache disables ccache completely.
1365 AC_ARG_ENABLE(64-bit,
1366 AS_HELP_STRING([--enable-64-bit],
1367 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1368 At the moment meaningful only for iOS and Windows.]), ,)
1370 AC_ARG_ENABLE(online-update,
1371 AS_HELP_STRING([--enable-online-update],
1372 [Enable the online update service that will check for new versions of
1373 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1374 If the value is "mar", the experimental Mozilla-like update will be
1375 enabled instead of the traditional update mechanism.]),
1378 AC_ARG_ENABLE(extension-update,
1379 AS_HELP_STRING([--disable-extension-update],
1380 [Disable possibility to update installed extensions.]),
1383 AC_ARG_ENABLE(release-build,
1384 AS_HELP_STRING([--enable-release-build],
1385 [Enable release build.
1386 See http://wiki.documentfoundation.org/Development/DevBuild]),
1389 AC_ARG_ENABLE(windows-build-signing,
1390 AS_HELP_STRING([--enable-windows-build-signing],
1391 [Enable signing of windows binaries (*.exe, *.dll)]),
1394 AC_ARG_ENABLE(silent-msi,
1395 AS_HELP_STRING([--enable-silent-msi],
1396 [Enable MSI with LIMITUI=1 (silent install).]),
1399 AC_ARG_ENABLE(macosx-code-signing,
1400 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1401 [Sign executables, dylibs, frameworks and the app bundle. If you
1402 don't provide an identity the first suitable certificate
1403 in your keychain is used.]),
1406 AC_ARG_ENABLE(macosx-package-signing,
1407 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1408 [Create a .pkg suitable for uploading to the Mac App Store and sign
1409 it. If you don't provide an identity the first suitable certificate
1410 in your keychain is used.]),
1413 AC_ARG_ENABLE(macosx-sandbox,
1414 AS_HELP_STRING([--enable-macosx-sandbox],
1415 [Make the app bundle run in a sandbox. Requires code signing.
1416 Is required by apps distributed in the Mac App Store, and implies
1417 adherence to App Store rules.]),
1420 AC_ARG_WITH(macosx-bundle-identifier,
1421 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1422 [Define the OS X bundle identifier. Default is the somewhat weird
1423 org.libreoffice.script ("script", huh?).]),
1424 ,with_macosx_bundle_identifier=org.libreoffice.script)
1426 AC_ARG_WITH(product-name,
1427 AS_HELP_STRING([--with-product-name='My Own Office Suite'],
1428 [Define the product name. Default is AC_PACKAGE_NAME.]),
1429 ,with_product_name=$PRODUCTNAME)
1431 AC_ARG_WITH(package-version,
1432 AS_HELP_STRING([--with-package-version='3.1.4.5'],
1433 [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
1436 AC_ARG_ENABLE(ios-simulator,
1437 AS_HELP_STRING([--enable-ios-simulator],
1438 [Build for the iOS Simulator, not iOS device.]),
1441 AC_ARG_ENABLE(readonly-installset,
1442 AS_HELP_STRING([--enable-readonly-installset],
1443 [Prevents any attempts by LibreOffice to write into its installation. That means
1444 at least that no "system-wide" extensions can be added. Experimental work in
1448 AC_ARG_ENABLE(postgresql-sdbc,
1449 AS_HELP_STRING([--disable-postgresql-sdbc],
1450 [Disable the build of the PostgreSQL-SDBC driver.])
1453 AC_ARG_ENABLE(lotuswordpro,
1454 AS_HELP_STRING([--disable-lotuswordpro],
1455 [Disable the build of the Lotus Word Pro filter.]),
1456 ,enable_lotuswordpro=yes)
1458 AC_ARG_ENABLE(firebird-sdbc,
1459 AS_HELP_STRING([--disable-firebird-sdbc],
1460 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1461 ,enable_firebird_sdbc=yes)
1463 AC_ARG_ENABLE(winegcc,
1464 AS_HELP_STRING([--enable-winegcc],
1465 [Enable use of winegcc during the build, in order to create msi* tools
1466 needed for MinGW cross-compilation.]),
1469 AC_ARG_ENABLE(liblangtag,
1470 AS_HELP_STRING([--disable-liblangtag],
1471 [Disable use of liblangtag, and instead use an own simple
1475 AC_ARG_ENABLE(bogus-pkg-config,
1476 AS_HELP_STRING([--enable-bogus-pkg-config],
1477 [MACOSX only: on MacOSX pkg-config can cause trouble. by default if one is found in the PATH, an error is issued. This flag turn that error into a warning.]),
1480 AC_ARG_ENABLE(openssl,
1481 AS_HELP_STRING([--disable-openssl],
1482 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1483 components will either use GNUTLS or NSS. Work in progress,
1484 use only if you are hacking on it.]),
1485 ,enable_openssl=yes)
1487 AC_ARG_ENABLE(library-bin-tar,
1488 AS_HELP_STRING([--enable-library-bin-tar],
1489 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1490 Some libraries can save their build result in a tarball
1491 stored in TARFILE_LOCATION. That binary tarball is
1492 uniquely identified by the source tarball,
1493 the content of the config_host.mk file and the content
1494 of the top-level directory in core for that library
1495 If this option is enabled, then if such a tarfile exist, it will be untarred
1496 instead of the source tarfile, and the build step will be skipped for that
1498 If a proper tarfile does not exist, then the normal source-based
1499 build is done for that library and a proper binary tarfile is created
1500 for the next time.]),
1504 AS_HELP_STRING([--disable-gltf],
1505 [Determines whether to build libraries related to glTF 3D model rendering.]))
1507 AC_ARG_ENABLE(collada,
1508 AS_HELP_STRING([--disable-collada],
1509 [Disable collada support (Rendering 3D models stored in *.dae and *.kmz format).]))
1511 AC_ARG_ENABLE(dconf,
1512 AS_HELP_STRING([--disable-dconf],
1513 [Disable the dconf configuration backend (enabled by default where
1516 AC_ARG_ENABLE(formula-logger,
1518 [--enable-formula-logger],
1519 [Enable formula logger for logging formula calculation flow in Calc.]
1523 dnl ===================================================================
1524 dnl Optional Packages (--with/without-)
1525 dnl ===================================================================
1527 AC_ARG_WITH(gcc-home,
1528 AS_HELP_STRING([--with-gcc-home],
1529 [Specify the location of gcc/g++ manually. This can be used in conjunction
1530 with --enable-icecream when icecream gcc/g++ wrappers are installed in a
1531 non-default path.]),
1534 AC_ARG_WITH(gnu-patch,
1535 AS_HELP_STRING([--with-gnu-patch],
1536 [Specify location of GNU patch on Solaris or FreeBSD.]),
1539 AC_ARG_WITH(build-platform-configure-options,
1540 AS_HELP_STRING([--with-build-platform-configure-options],
1541 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1545 AS_HELP_STRING([--with-gnu-cp],
1546 [Specify location of GNU cp on Solaris or FreeBSD.]),
1549 AC_ARG_WITH(external-tar,
1550 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1551 [Specify an absolute path of where to find (and store) tarfiles.]),
1552 TARFILE_LOCATION=$withval ,
1555 AC_ARG_WITH(referenced-git,
1556 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1557 [Specify another checkout directory to reference. This makes use of
1558 git submodule update --reference, and saves a lot of diskspace
1559 when having multiple trees side-by-side.]),
1560 GIT_REFERENCE_SRC=$withval ,
1563 AC_ARG_WITH(linked-git,
1564 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1565 [Specify a directory where the repositories of submodules are located.
1566 This uses a method similar to git-new-workdir to get submodules.]),
1567 GIT_LINK_SRC=$withval ,
1570 AC_ARG_WITH(galleries,
1571 AS_HELP_STRING([--with-galleries],
1572 [Specify how galleries should be built. It is possible either to
1573 build these internally from source ("build"),
1574 or to disable them ("no")]),
1578 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1579 [Choose which themes to include. By default those themes with an '*' are included.
1580 Possible choices: *breeze, *breeze_dark, crystal, *galaxy, *hicontrast, *oxygen, *sifr, *tango, *tango_testing.]),
1583 AC_ARG_WITH(helppack-integration,
1584 AS_HELP_STRING([--without-helppack-integration],
1585 [It will not integrate the helppacks to the installer
1586 of the product. Please use this switch to use the online help
1587 or separate help packages.]),
1591 AS_HELP_STRING([--without-fonts],
1592 [LibreOffice includes some third-party fonts to provide a reliable basis for
1593 help content, templates, samples, etc. When these fonts are already
1594 known to be available on the system then you should use this option.]),
1597 AC_ARG_ENABLE(noto-font,
1598 AS_HELP_STRING([--enable-noto-font],
1599 [Add Google Noto font.]),
1603 AS_HELP_STRING([--with-epm],
1604 [Decides which epm to use. Default is to use the one from the system if
1605 one is built. When either this is not there or you say =internal epm
1609 AC_ARG_WITH(package-format,
1610 AS_HELP_STRING([--with-package-format],
1611 [Specify package format(s) for LibreOffice installation sets. The
1612 implicit --without-package-format leads to no installation sets being
1613 generated. Possible values: aix, archive, bsd, deb, dmg,
1614 installed, msi, pkg, and rpm.
1615 Example: --with-package-format='deb rpm']),
1619 AS_HELP_STRING([--with-tls],
1620 [Decides which TLS/SSL and cryptographic implementations to use for
1621 LibreOffice's code. Notice that this doesn't apply for depending
1622 libraries like "neon", for example. Default is to use OpenSSL
1623 although NSS is also possible. Notice that selecting NSS restricts
1624 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1625 restrict by now the usage of NSS in LO's code. Possible values:
1626 openssl, nss. Example: --with-tls="nss"]),
1629 AC_ARG_WITH(system-libs,
1630 AS_HELP_STRING([--with-system-libs],
1631 [Use libraries already on system -- enables all --with-system-* flags.]),
1634 AC_ARG_WITH(system-bzip2,
1635 AS_HELP_STRING([--with-system-bzip2],
1636 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1637 [with_system_bzip2="$with_system_libs"])
1639 AC_ARG_WITH(system-headers,
1640 AS_HELP_STRING([--with-system-headers],
1641 [Use headers already on system -- enables all --with-system-* flags for
1642 external packages whose headers are the only entities used i.e.
1643 boost/odbc/sane-header(s).]),,
1644 [with_system_headers="$with_system_libs"])
1646 AC_ARG_WITH(system-jars,
1647 AS_HELP_STRING([--without-system-jars],
1648 [When building with --with-system-libs, also the needed jars are expected
1649 on the system. Use this to disable that]),,
1650 [with_system_jars="$with_system_libs"])
1652 AC_ARG_WITH(system-cairo,
1653 AS_HELP_STRING([--with-system-cairo],
1654 [Use cairo libraries already on system. Happens automatically for
1655 (implicit) --enable-gtk and for --enable-gtk3.]))
1657 AC_ARG_WITH(myspell-dicts,
1658 AS_HELP_STRING([--with-myspell-dicts],
1659 [Adds myspell dictionaries to the LibreOffice installation set]),
1662 AC_ARG_WITH(system-dicts,
1663 AS_HELP_STRING([--without-system-dicts],
1664 [Do not use dictionaries from system paths.]),
1667 AC_ARG_WITH(external-dict-dir,
1668 AS_HELP_STRING([--with-external-dict-dir],
1669 [Specify external dictionary dir.]),
1672 AC_ARG_WITH(external-hyph-dir,
1673 AS_HELP_STRING([--with-external-hyph-dir],
1674 [Specify external hyphenation pattern dir.]),
1677 AC_ARG_WITH(external-thes-dir,
1678 AS_HELP_STRING([--with-external-thes-dir],
1679 [Specify external thesaurus dir.]),
1682 AC_ARG_WITH(system-zlib,
1683 AS_HELP_STRING([--with-system-zlib],
1684 [Use zlib already on system.]),,
1685 [with_system_zlib=auto])
1687 AC_ARG_WITH(system-jpeg,
1688 AS_HELP_STRING([--with-system-jpeg],
1689 [Use jpeg already on system.]),,
1690 [with_system_jpeg="$with_system_libs"])
1692 AC_ARG_WITH(system-libgltf,
1693 AS_HELP_STRING([--with-system-libgltf],
1694 [Use libgltf already on system.]),,
1695 [with_system_libgltf="$with_system_libs"])
1697 AC_ARG_WITH(system-clucene,
1698 AS_HELP_STRING([--with-system-clucene],
1699 [Use clucene already on system.]),,
1700 [with_system_clucene="$with_system_libs"])
1702 AC_ARG_WITH(system-expat,
1703 AS_HELP_STRING([--with-system-expat],
1704 [Use expat already on system.]),,
1705 [with_system_expat="$with_system_libs"])
1707 AC_ARG_WITH(system-libxml,
1708 AS_HELP_STRING([--with-system-libxml],
1709 [Use libxml/libxslt already on system.]),,
1710 [with_system_libxml=auto])
1712 AC_ARG_WITH(system-icu,
1713 AS_HELP_STRING([--with-system-icu],
1714 [Use icu already on system.]),,
1715 [with_system_icu="$with_system_libs"])
1717 AC_ARG_WITH(system-ucpp,
1718 AS_HELP_STRING([--with-system-ucpp],
1719 [Use ucpp already on system.]),,
1722 AC_ARG_WITH(system-opencollada,
1723 AS_HELP_STRING([--with-system-opencollada],
1724 [Use openCOLLADA already on system.]),,
1725 [with_system_opencollada=no])
1727 AC_ARG_WITH(system-collada2gltf,
1728 AS_HELP_STRING([--with-system-collada2gltf],
1729 [Use collada2gltf already on system.]),,
1730 [with_system_collada2gltf=no])
1732 AC_ARG_WITH(system-openldap,
1733 AS_HELP_STRING([--with-system-openldap],
1734 [Use the OpenLDAP LDAP SDK already on system.]),,
1735 [with_system_openldap="$with_system_libs"])
1737 AC_ARG_WITH(system-poppler,
1738 AS_HELP_STRING([--with-system-poppler],
1739 [Use system poppler (only needed for PDF import).]),,
1740 [with_system_poppler="$with_system_libs"])
1742 AC_ARG_WITH(system-apache-commons,
1743 AS_HELP_STRING([--with-system-apache-commons],
1744 [Use Apache commons libraries already on system.]),,
1745 [with_system_apache_commons="$with_system_jars"])
1747 AC_ARG_WITH(system-mariadb,
1748 AS_HELP_STRING([--with-system-mariadb],
1749 [Use MariaDB/MySQL libraries already on system, for building the MariaDB Connector/LibreOffice
1751 [with_system_mariadb="$with_system_libs"])
1753 AC_ARG_ENABLE(bundle-mariadb,
1754 AS_HELP_STRING([--enable-bundle-mariadb],
1755 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice extension.])
1758 AC_ARG_WITH(system-mysql-cppconn,
1759 AS_HELP_STRING([--with-system-mysql-cppconn],
1760 [Use MySQL C++ Connector libraries already on system.]),,
1761 [with_system_mysql_cppconn="$with_system_libs"])
1763 AC_ARG_WITH(system-postgresql,
1764 AS_HELP_STRING([--with-system-postgresql],
1765 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1766 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1767 [with_system_postgresql="$with_system_libs"])
1769 AC_ARG_WITH(libpq-path,
1770 AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
1771 [Use this PostgreSQL C interface (libpq) installation for building
1772 the PostgreSQL-SDBC extension.]),
1775 AC_ARG_WITH(system-firebird,
1776 AS_HELP_STRING([--with-system-firebird],
1777 [Use Firebird libraries already on system, for building the Firebird-SDBC
1778 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1779 [with_system_firebird="$with_system_libs"])
1781 AC_ARG_WITH(system-libtommath,
1782 AS_HELP_STRING([--with-system-libtommath],
1783 [Use libtommath already on system]),,
1784 [with_system_libtommath="$with_system_libs"])
1786 AC_ARG_WITH(system-hsqldb,
1787 AS_HELP_STRING([--with-system-hsqldb],
1788 [Use hsqldb already on system.]))
1790 AC_ARG_WITH(hsqldb-jar,
1791 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1792 [Specify path to jarfile manually.]),
1793 HSQLDB_JAR=$withval)
1795 AC_ARG_ENABLE(scripting-beanshell,
1796 AS_HELP_STRING([--disable-scripting-beanshell],
1797 [Disable support for scripts in BeanShell.]),
1801 AC_ARG_WITH(system-beanshell,
1802 AS_HELP_STRING([--with-system-beanshell],
1803 [Use beanshell already on system.]),,
1804 [with_system_beanshell="$with_system_jars"])
1806 AC_ARG_WITH(beanshell-jar,
1807 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1808 [Specify path to jarfile manually.]),
1811 AC_ARG_ENABLE(scripting-javascript,
1812 AS_HELP_STRING([--disable-scripting-javascript],
1813 [Disable support for scripts in JavaScript.]),
1817 AC_ARG_WITH(system-rhino,
1818 AS_HELP_STRING([--with-system-rhino],
1819 [Use rhino already on system.]),,)
1820 # [with_system_rhino="$with_system_jars"])
1821 # Above is not used as we have different debug interface
1822 # patched into internal rhino. This code needs to be fixed
1823 # before we can enable it by default.
1825 AC_ARG_WITH(rhino-jar,
1826 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1827 [Specify path to jarfile manually.]),
1830 AC_ARG_WITH(commons-codec-jar,
1831 AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1832 [Specify path to jarfile manually.]),
1833 COMMONS_CODEC_JAR=$withval)
1835 AC_ARG_WITH(commons-lang-jar,
1836 AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1837 [Specify path to jarfile manually.]),
1838 COMMONS_LANG_JAR=$withval)
1840 AC_ARG_WITH(commons-httpclient-jar,
1841 AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1842 [Specify path to jarfile manually.]),
1843 COMMONS_HTTPCLIENT_JAR=$withval)
1845 AC_ARG_WITH(commons-logging-jar,
1846 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1847 [Specify path to jarfile manually.]),
1848 COMMONS_LOGGING_JAR=$withval)
1850 AC_ARG_WITH(system-jfreereport,
1851 AS_HELP_STRING([--with-system-jfreereport],
1852 [Use JFreeReport already on system.]),,
1853 [with_system_jfreereport="$with_system_jars"])
1855 AC_ARG_WITH(sac-jar,
1856 AS_HELP_STRING([--with-sac-jar=JARFILE],
1857 [Specify path to jarfile manually.]),
1860 AC_ARG_WITH(libxml-jar,
1861 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1862 [Specify path to jarfile manually.]),
1863 LIBXML_JAR=$withval)
1865 AC_ARG_WITH(flute-jar,
1866 AS_HELP_STRING([--with-flute-jar=JARFILE],
1867 [Specify path to jarfile manually.]),
1870 AC_ARG_WITH(jfreereport-jar,
1871 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1872 [Specify path to jarfile manually.]),
1873 JFREEREPORT_JAR=$withval)
1875 AC_ARG_WITH(liblayout-jar,
1876 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1877 [Specify path to jarfile manually.]),
1878 LIBLAYOUT_JAR=$withval)
1880 AC_ARG_WITH(libloader-jar,
1881 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1882 [Specify path to jarfile manually.]),
1883 LIBLOADER_JAR=$withval)
1885 AC_ARG_WITH(libformula-jar,
1886 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1887 [Specify path to jarfile manually.]),
1888 LIBFORMULA_JAR=$withval)
1890 AC_ARG_WITH(librepository-jar,
1891 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1892 [Specify path to jarfile manually.]),
1893 LIBREPOSITORY_JAR=$withval)
1895 AC_ARG_WITH(libfonts-jar,
1896 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1897 [Specify path to jarfile manually.]),
1898 LIBFONTS_JAR=$withval)
1900 AC_ARG_WITH(libserializer-jar,
1901 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1902 [Specify path to jarfile manually.]),
1903 LIBSERIALIZER_JAR=$withval)
1905 AC_ARG_WITH(libbase-jar,
1906 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1907 [Specify path to jarfile manually.]),
1908 LIBBASE_JAR=$withval)
1910 AC_ARG_WITH(system-odbc,
1911 AS_HELP_STRING([--with-system-odbc],
1912 [Use the odbc headers already on system.]),,
1913 [with_system_odbc="auto"])
1915 AC_ARG_WITH(system-sane,
1916 AS_HELP_STRING([--with-system-sane],
1917 [Use sane.h already on system.]),,
1918 [with_system_sane="$with_system_headers"])
1920 AC_ARG_WITH(system-bluez,
1921 AS_HELP_STRING([--with-system-bluez],
1922 [Use bluetooth.h already on system.]),,
1923 [with_system_bluez="$with_system_headers"])
1925 AC_ARG_WITH(system-curl,
1926 AS_HELP_STRING([--with-system-curl],
1927 [Use curl already on system.]),,
1928 [with_system_curl=auto])
1930 AC_ARG_WITH(system-boost,
1931 AS_HELP_STRING([--with-system-boost],
1932 [Use boost already on system.]),,
1933 [with_system_boost="$with_system_headers"])
1935 AC_ARG_WITH(system-glm,
1936 AS_HELP_STRING([--with-system-glm],
1937 [Use glm already on system.]),,
1938 [with_system_glm="$with_system_headers"])
1940 AC_ARG_WITH(system-hunspell,
1941 AS_HELP_STRING([--with-system-hunspell],
1942 [Use libhunspell already on system.]),,
1943 [with_system_hunspell="$with_system_libs"])
1945 AC_ARG_WITH(system-mythes,
1946 AS_HELP_STRING([--with-system-mythes],
1947 [Use mythes already on system.]),,
1948 [with_system_mythes="$with_system_libs"])
1950 AC_ARG_WITH(system-altlinuxhyph,
1951 AS_HELP_STRING([--with-system-altlinuxhyph],
1952 [Use ALTLinuxhyph already on system.]),,
1953 [with_system_altlinuxhyph="$with_system_libs"])
1955 AC_ARG_WITH(system-lpsolve,
1956 AS_HELP_STRING([--with-system-lpsolve],
1957 [Use lpsolve already on system.]),,
1958 [with_system_lpsolve="$with_system_libs"])
1960 AC_ARG_WITH(system-coinmp,
1961 AS_HELP_STRING([--with-system-coinmp],
1962 [Use CoinMP already on system.]),,
1963 [with_system_coinmp="$with_system_libs"])
1965 AC_ARG_WITH(system-liblangtag,
1966 AS_HELP_STRING([--with-system-liblangtag],
1967 [Use liblangtag library already on system.]),,
1968 [with_system_liblangtag="$with_system_libs"])
1970 AC_ARG_WITH(jpeg-turbo,
1971 AS_HELP_STRING([--with-jpeg-turbo],
1972 [Use internal libjpeg-turbo library.]),,
1973 [with_jpeg_turbo=auto])
1976 AS_HELP_STRING([--with-webdav],
1977 [Specify which library to use for webdav implementation.
1978 Possible values: "neon", "serf", "no". The default value is "neon".
1979 Example: --with-webdav="serf"]),
1980 WITH_WEBDAV=$withval,
1983 AC_ARG_WITH(linker-hash-style,
1984 AS_HELP_STRING([--with-linker-hash-style],
1985 [Use linker with --hash-style=<style> when linking shared objects.
1986 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1987 if supported on the build system, and "sysv" otherwise.]))
1989 AC_ARG_WITH(jdk-home,
1990 AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
1991 [If you have installed JDK 1.3 or later on your system please supply the
1992 path here. Note that this is not the location of the java command but the
1993 location of the entire distribution.]),
1997 AS_HELP_STRING([--with-help],
1998 [Enable the build of help. There is a special parameter "common" that
1999 can be used to bundle only the common part, .e.g help-specific icons.
2000 This is useful when you build the helpcontent separately.])
2002 Usage: --with-help build the entire local help
2003 --without-help no local help (default)
2004 --with-help=common bundle common files for the local
2005 help but do not build the whole help
2010 AS_HELP_STRING([--with-java=<java command>],
2011 [Specify the name of the Java interpreter command. Typically "java"
2012 which is the default.
2014 To build without support for Java components, applets, accessibility
2015 or the XML filters written in Java, use --without-java or --with-java=no.]),
2016 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2020 AC_ARG_WITH(jvm-path,
2021 AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
2022 [Use a specific JVM search path at runtime.
2023 e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
2026 AC_ARG_WITH(ant-home,
2027 AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
2028 [If you have installed Jakarta Ant on your system, please supply the path here.
2029 Note that this is not the location of the Ant binary but the location
2030 of the entire distribution.]),
2033 AC_ARG_WITH(symbol-config,
2034 AS_HELP_STRING([--with-symbol-config],
2035 [Configuration for the crashreport symbol upload]),
2037 [with_symbol_config=no])
2039 AC_ARG_WITH(export-validation,
2040 AS_HELP_STRING([--without-export-validation],
2041 [Disable validating OOXML and ODF files as exported from in-tree tests.
2042 Use this option e.g. if your system only provides Java 5.]),
2043 ,with_export_validation=yes)
2045 AC_ARG_WITH(bffvalidator,
2046 AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
2047 [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
2048 Requires installed Microsoft Office Binary File Format Validator.
2049 Note: export-validation (--with-export-validation) is required to be turned on.
2050 See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
2051 ,with_bffvalidator=no)
2054 AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
2055 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2056 --without-junit disables those tests. Not relevant in the --without-java case.]),
2059 AC_ARG_WITH(hamcrest,
2060 AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
2061 [Specifies the hamcrest jar file to use for JUnit-based tests.
2062 --without-junit disables those tests. Not relevant in the --without-java case.]),
2065 AC_ARG_WITH(perl-home,
2066 AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
2067 [If you have installed Perl 5 Distribution, on your system, please
2068 supply the path here. Note that this is not the location of the Perl
2069 binary but the location of the entire distribution.]),
2072 AC_ARG_WITH(doxygen,
2074 [--with-doxygen=<absolute path to doxygen executable>],
2075 [Specifies the doxygen executable to use when generating ODK C/C++
2076 documentation. --without-doxygen disables generation of ODK C/C++
2077 documentation. Not relevant in the --disable-odk case.]),
2080 AC_ARG_WITH(visual-studio,
2081 AS_HELP_STRING([--with-visual-studio=<2013/2015>],
2082 [Specify which Visual Studio version to use in case several are
2083 installed. If not specified, only 2013 is detected automatically
2084 because 2015 support is currently experimental.]),
2087 AC_ARG_WITH(windows-sdk,
2088 AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
2089 [Specify which Windows SDK, or "Windows Kit", version to use
2090 in case the one that came with the selected Visual Studio
2091 is not what you want for some reason. Note that not all compiler/SDK
2092 combinations are supported. The intent is that this option should not
2097 AS_HELP_STRING([--with-lang="es sw tu cs sk"],
2098 [Use this option to build LibreOffice with additional UI language support.
2099 English (US) is always included by default.
2100 Separate multiple languages with space.
2101 For all languages, use --with-lang=ALL.]),
2104 AC_ARG_WITH(locales,
2105 AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
2106 [Use this option to limit the locale information built in.
2107 Separate multiple locales with space.
2108 Very experimental and might well break stuff.
2109 Just a desperate measure to shrink code and data size.
2110 By default all the locales available is included.
2111 This option is completely unrelated to --with-lang.])
2113 Affects also our character encoding conversion
2114 tables for encodings mainly targeted for a
2115 particular locale, like EUC-CN and EUC-TW for
2116 zh, ISO-2022-JP for ja.
2118 Affects also our add-on break iterator data for
2121 For the default, all locales, don't use this switch at all.
2122 Specifying just the language part of a locale means all matching
2123 locales will be included.
2127 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2129 AS_HELP_STRING([--with-krb5],
2130 [Enable MIT Kerberos 5 support in modules that support it.
2131 By default automatically enabled on platforms
2132 where a good system Kerberos 5 is available.]),
2136 AS_HELP_STRING([--with-gssapi],
2137 [Enable GSSAPI support in modules that support it.
2138 By default automatically enabled on platforms
2139 where a good system GSSAPI is available.]),
2143 AS_HELP_STRING([--with-iwyu],
2144 [Use given IWYU binary path to check unneeded includes instead of building.
2145 Use only if you are hacking on it.]),
2148 dnl ===================================================================
2150 dnl ===================================================================
2152 AC_ARG_WITH(branding,
2153 AS_HELP_STRING([--with-branding=/path/to/images],
2154 [Use given path to retrieve branding images set.])
2156 Search for intro.png about.svg and flat_logo.svg.
2157 If any is missing, default ones will be used instead.
2159 Search also progress.conf for progress
2160 settings on intro screen :
2162 PROGRESSBARCOLOR="255,255,255" Set color of
2163 progress bar. Comma separated RGB decimal values.
2164 PROGRESSSIZE="407,6" Set size of progress bar.
2165 Comma separated decimal values (width, height).
2166 PROGRESSPOSITION="61,317" Set position of progress
2167 bar from left,top. Comma separated decimal values.
2168 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2169 bar frame. Comma separated RGB decimal values.
2170 PROGRESSTEXTCOLOR="255,255,255" Set color of progress
2171 bar text. Comma separated RGB decimal values.
2172 PROGRESSTEXTBASELINE="287" Set vertical position of
2173 progress bar text from top. Decimal value.
2175 Default values will be used if not found.
2180 AC_ARG_WITH(extra-buildid,
2181 AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
2182 [Show addition build identification in about dialog.]),
2187 AS_HELP_STRING([--with-vendor="John the Builder"],
2188 [Set vendor of the build.]),
2191 AC_ARG_WITH(android-package-name,
2192 AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
2193 [Set Android package name of the build.]),
2196 AC_ARG_WITH(compat-oowrappers,
2197 AS_HELP_STRING([--with-compat-oowrappers],
2198 [Install oo* wrappers in parallel with
2199 lo* ones to keep backward compatibility.
2200 Has effect only with make distro-pack-install]),
2203 AC_ARG_WITH(os-version,
2204 AS_HELP_STRING([--with-os-version=<OSVERSION>],
2205 [For FreeBSD users, use this option option to override the detected OSVERSION.]),
2208 AC_ARG_WITH(mingw-cross-compiler,
2209 AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
2210 [Specify the MinGW cross-compiler to use.
2211 When building on the ODK on Unix and building unowinreg.dll,
2212 specify the MinGW C++ cross-compiler.]),
2215 AC_ARG_WITH(idlc-cpp,
2216 AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
2217 [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
2220 AC_ARG_WITH(build-version,
2221 AS_HELP_STRING([--with-build-version="Built by Jim"],
2222 [Allows the builder to add a custom version tag that will appear in the
2223 Help/About box for QA purposes.]),
2224 with_build_version=$withval,
2228 AS_HELP_STRING([--with-alloc],
2229 [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
2230 Note that on FreeBSD/NetBSD system==jemalloc]),
2233 AC_ARG_WITH(parallelism,
2234 AS_HELP_STRING([--with-parallelism],
2235 [Number of jobs to run simultaneously during build. Parallel builds can
2236 save a lot of time on multi-cpu machines. Defaults to the number of
2237 CPUs on the machine, unless you configure --enable-icecream - then to
2241 AC_ARG_WITH(all-tarballs,
2242 AS_HELP_STRING([--with-all-tarballs],
2243 [Download all external tarballs unconditionally]))
2245 AC_ARG_WITH(gdrive-client-id,
2246 AS_HELP_STRING([--with-gdrive-client-id],
2247 [Provides the client id of the application for OAuth2 authentication
2248 on Google Drive. If either this or --with-gdrive-client-secret is
2249 empty, the feature will be disabled]),
2252 AC_ARG_WITH(gdrive-client-secret,
2253 AS_HELP_STRING([--with-gdrive-client-secret],
2254 [Provides the client secret of the application for OAuth2
2255 authentication on Google Drive. If either this or
2256 --with-gdrive-client-id is empty, the feature will be disabled]),
2259 AC_ARG_WITH(alfresco-cloud-client-id,
2260 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2261 [Provides the client id of the application for OAuth2 authentication
2262 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2263 empty, the feature will be disabled]),
2266 AC_ARG_WITH(alfresco-cloud-client-secret,
2267 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2268 [Provides the client secret of the application for OAuth2
2269 authentication on Alfresco Cloud. If either this or
2270 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2273 AC_ARG_WITH(onedrive-client-id,
2274 AS_HELP_STRING([--with-onedrive-client-id],
2275 [Provides the client id of the application for OAuth2 authentication
2276 on OneDrive. If either this or --with-onedrive-client-secret is
2277 empty, the feature will be disabled]),
2280 AC_ARG_WITH(onedrive-client-secret,
2281 AS_HELP_STRING([--with-onedrive-client-secret],
2282 [Provides the client secret of the application for OAuth2
2283 authentication on OneDrive. If either this or
2284 --with-onedrive-client-id is empty, the feature will be disabled]),
2286 dnl ===================================================================
2287 dnl Do we want to use pre-build binary tarball for recompile
2288 dnl ===================================================================
2290 if test "$enable_library_bin_tar" = "yes" ; then
2291 USE_LIBRARY_BIN_TAR=TRUE
2293 USE_LIBRARY_BIN_TAR=
2295 AC_SUBST(USE_LIBRARY_BIN_TAR)
2297 dnl ===================================================================
2298 dnl Test whether build target is Release Build
2299 dnl ===================================================================
2300 AC_MSG_CHECKING([whether build target is Release Build])
2301 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2303 ENABLE_RELEASE_BUILD=
2305 AC_MSG_RESULT([yes])
2306 ENABLE_RELEASE_BUILD=TRUE
2308 AC_SUBST(ENABLE_RELEASE_BUILD)
2310 dnl ===================================================================
2311 dnl Test whether to sign Windows Build
2312 dnl ===================================================================
2313 AC_MSG_CHECKING([whether to sign windows build])
2314 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
2315 AC_MSG_RESULT([yes])
2316 WINDOWS_BUILD_SIGNING="TRUE"
2319 WINDOWS_BUILD_SIGNING="FALSE"
2321 AC_SUBST(WINDOWS_BUILD_SIGNING)
2323 dnl ===================================================================
2324 dnl MacOSX build and runtime environment options
2325 dnl ===================================================================
2327 AC_ARG_WITH(macosx-sdk,
2328 AS_HELP_STRING([--with-macosx-sdk=<version>],
2329 [Prefer a specific SDK for building.])
2331 If the requested SDK is not available, a search for the oldest one will be done.
2332 With current Xcode versions, only the latest SDK is included, so this option is
2333 not terribly useful. It works fine to build with a new SDK and run the result
2336 e. g.: --with-macosx-sdk=10.8
2338 there are 3 options to control the MacOSX build:
2339 --with-macosx-sdk (referred as 'sdk' below)
2340 --with-macosx-version-min-required (referred as 'min' below)
2341 --with-macosx-version-max-allowed (referred as 'max' below)
2343 the connection between these value and the default they take is as follow:
2344 ( ? means not specified on the command line, s means the SDK version found,
2345 constraint: 8 <= x <= y <= z)
2347 ==========================================
2348 command line || config result
2349 ==========================================
2350 min | max | sdk || min | max | sdk |
2351 ? | ? | ? || 10.8 | 10.s | 10.s |
2352 ? | ? | 10.x || 10.8 | 10.x | 10.x |
2353 ? | 10.x | ? || 10.8 | 10.s | 10.s |
2354 ? | 10.x | 10.y || 10.8 | 10.x | 10.y |
2355 10.x | ? | ? || 10.x | 10.s | 10.s |
2356 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2357 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2358 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2361 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2362 for a detailed technical explanation of these variables
2364 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2368 AC_ARG_WITH(macosx-version-min-required,
2369 AS_HELP_STRING([--with-macosx-version-min-required=<version>],
2370 [set the minimum OS version needed to run the built LibreOffice])
2372 e. g.: --with-macos-version-min-required=10.8
2373 see --with-macosx-sdk for more info
2377 AC_ARG_WITH(macosx-version-max-allowed,
2378 AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
2379 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2381 e. g.: --with-macos-version-max-allowed=10.8
2382 see --with-macosx-sdk for more info
2387 dnl ===================================================================
2388 dnl options for stuff used during cross-compilation build
2389 dnl Not quite superseded by --with-build-platform-configure-options.
2390 dnl TODO: check, if the "force" option is still needed anywhere.
2391 dnl ===================================================================
2393 AC_ARG_WITH(system-icu-for-build,
2394 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2395 [Use icu already on system for build tools (cross-compilation only).]))
2398 dnl ===================================================================
2399 dnl check for required programs (grep, awk, sed, bash)
2400 dnl ===================================================================
2404 if test -n "$1"; then
2405 if test "$build_os" = "cygwin"; then
2406 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2408 new_path=`cygpath -sm "$formatted_path"`
2411 new_path=`cygpath -u "$formatted_path"`
2416 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2417 if test "$2" = "after"; then
2418 LO_PATH="$LO_PATH${P_SEP}$new_path"
2420 LO_PATH="$new_path${P_SEP}$LO_PATH"
2428 AC_PATH_PROG( AWK, $AWK)
2429 if test -z "$AWK"; then
2430 AC_MSG_ERROR([install awk to run this script])
2433 AC_PATH_PROG(BASH, bash)
2434 if test -z "$BASH"; then
2435 AC_MSG_ERROR([bash not found in \$PATH])
2439 AC_MSG_CHECKING([for GNU or BSD tar])
2440 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2441 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2442 if test $? -eq 0; then
2447 AC_MSG_RESULT($GNUTAR)
2448 if test -z "$GNUTAR"; then
2449 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2453 AC_MSG_CHECKING([for tar's option to strip components])
2454 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2455 if test $? -eq 0; then
2456 STRIP_COMPONENTS="--strip-components"
2458 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2459 if test $? -eq 0; then
2460 STRIP_COMPONENTS="--strip-path"
2462 STRIP_COMPONENTS="unsupported"
2465 AC_MSG_RESULT($STRIP_COMPONENTS)
2466 if test x$STRIP_COMPONENTS = xunsupported; then
2467 AC_MSG_ERROR([you need a tar that is able to strip components.])
2469 AC_SUBST(STRIP_COMPONENTS)
2471 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2472 dnl desktop OSes from "mobile" ones.
2474 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2475 dnl In other words, that when building for an OS that is not a
2476 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2478 dnl Note the direction of the implication; there is no assumption that
2479 dnl cross-compiling would imply a non-desktop OS.
2481 if test $_os != iOS -a $_os != Android; then
2482 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2483 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2484 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2488 if test "$enable_export" != no; then
2489 BUILD_TYPE="$BUILD_TYPE EXPORT"
2491 DISABLE_EXPORT='TRUE'
2492 SCPDEFS="$SCPDES -DDISABLE_EXPORT"
2494 AC_SUBST(DISABLE_EXPORT)
2496 # Whether to build "avmedia" functionality or not.
2498 if test -z "$enable_avmedia"; then
2502 if test "$enable_avmedia" = yes; then
2503 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2504 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2506 SCPDEFS="$SCPDEFS -DDISABLE_AVMEDIA"
2509 # Decide whether to build database connectivity stuff (including
2510 # Base) or not. We probably don't want to on non-desktop OSes.
2512 if test -z "$enable_database_connectivity"; then
2513 # --disable-database-connectivity is unfinished work in progress
2514 # and the iOS test app doesn't link if we actually try to use it.
2515 # if test $_os != iOS -a $_os != Android; then
2516 enable_database_connectivity=yes
2520 if test "$enable_database_connectivity" = yes; then
2521 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2522 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2525 if test -z "$enable_extensions"; then
2526 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2527 if test $_os != iOS -a $_os != Android; then
2528 enable_extensions=yes
2532 if test "$enable_extensions" = yes; then
2533 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2534 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2537 if test -z "$enable_scripting"; then
2538 # Disable scripting for iOS unless specifically overridden
2539 # with --enable-scripting.
2540 if test $_os != iOS; then
2541 enable_scripting=yes
2545 DISABLE_SCRIPTING=''
2546 if test "$enable_scripting" = yes; then
2547 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2548 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2550 DISABLE_SCRIPTING='TRUE'
2551 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2554 if test $_os = iOS -o $_os = Android; then
2555 # Disable dynamic_loading always for iOS and Android
2556 enable_dynamic_loading=no
2557 elif test -z "$enable_dynamic_loading"; then
2558 # Otherwise enable it unless speficically disabled
2559 enable_dynamic_loading=yes
2562 DISABLE_DYNLOADING=''
2563 if test "$enable_dynamic_loading" = yes; then
2564 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2566 DISABLE_DYNLOADING='TRUE'
2567 SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
2569 AC_SUBST(DISABLE_DYNLOADING)
2571 # remenber SYSBASE value
2574 dnl ===================================================================
2575 dnl Sort out various gallery compilation options
2576 dnl ===================================================================
2577 AC_MSG_CHECKING([how to build and package galleries])
2578 if test -n "${with_galleries}"; then
2579 if test "$with_galleries" = "build"; then
2580 WITH_GALLERY_BUILD=TRUE
2581 AC_MSG_RESULT([build from source images internally])
2582 elif test "$with_galleries" = "no"; then
2584 AC_MSG_RESULT([disable non-internal gallery build])
2586 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2589 if test $_os != iOS -a $_os != Android; then
2590 WITH_GALLERY_BUILD=TRUE
2591 AC_MSG_RESULT([internal src images for desktop])
2594 AC_MSG_RESULT([disable src image build])
2597 AC_SUBST(WITH_GALLERY_BUILD)
2599 dnl ===================================================================
2600 dnl Checks if ccache is available
2601 dnl ===================================================================
2602 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
2603 # on windows/VC build do not use ccache
2605 elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2606 case "%$CC%$CXX%" in
2607 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2608 # assume that's good then
2609 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2610 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2613 AC_PATH_PROG([CCACHE],[ccache],[not found])
2614 if test "$CCACHE" = "not found"; then
2617 # Need to check for ccache version: otherwise prevents
2618 # caching of the results (like "-x objective-c++" for Mac)
2619 if test $_os = Darwin -o $_os = iOS; then
2620 # Check ccache version
2621 AC_MSG_CHECKING([whether version of ccache is suitable])
2622 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2623 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2624 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2625 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2627 AC_MSG_RESULT([no, $CCACHE_VERSION])
2638 if test "$CCACHE" != ""; then
2639 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2640 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2641 if test "$ccache_size" = ""; then
2642 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2643 if test "$ccache_size" = ""; then
2646 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2647 if test $ccache_size -lt 1024; then
2649 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2650 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2652 # warn that ccache may be too small for debug build
2653 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2654 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2657 if test $ccache_size -lt 5; then
2658 #warn that ccache may be too small for debug build
2659 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2660 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2665 dnl ===================================================================
2666 dnl Checks for C compiler,
2667 dnl The check for the C++ compiler is later on.
2668 dnl ===================================================================
2669 if test "$_os" != "WINNT" -a "$WITH_MINGW" != "yes"; then
2671 AC_MSG_CHECKING([gcc home])
2672 if test -z "$with_gcc_home"; then
2673 if test "$enable_icecream" = "yes"; then
2674 if test -d "/usr/lib/icecc/bin"; then
2675 GCC_HOME="/usr/lib/icecc/"
2677 GCC_HOME="/opt/icecream/"
2680 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2681 GCC_HOME_SET="false"
2684 GCC_HOME="$with_gcc_home"
2686 AC_MSG_RESULT($GCC_HOME)
2689 if test "$GCC_HOME_SET" = "true"; then
2690 if test -z "$CC"; then
2691 CC="$GCC_HOME/bin/gcc"
2693 if test -z "$CXX"; then
2694 CXX="$GCC_HOME/bin/g++"
2699 COMPATH=`dirname "$CC"`
2700 if test "$COMPATH" = "."; then
2701 AC_PATH_PROGS(COMPATH, $CC)
2702 dnl double square bracket to get single because of M4 quote...
2703 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2705 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2707 dnl ===================================================================
2709 dnl ===================================================================
2710 AC_MSG_CHECKING([whether to build with Java support])
2711 if test "$with_java" != "no"; then
2712 if test "$DISABLE_SCRIPTING" = TRUE; then
2713 AC_MSG_RESULT([no, overridden by --disable-scripting])
2717 AC_MSG_RESULT([yes])
2719 AC_DEFINE(HAVE_FEATURE_JAVA)
2726 AC_SUBST(ENABLE_JAVA)
2728 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2730 dnl ENABLE_JAVA="" indicate no Java support at all
2732 dnl ===================================================================
2733 dnl Check OS X SDK and compiler
2734 dnl ===================================================================
2736 if test $_os = Darwin; then
2738 # If no --with-macosx-sdk option is given, look for one
2740 # The intent is that for "most" Mac-based developers, a suitable
2741 # SDK will be found automatically without any configure options.
2743 # For developers with a current Xcode, the lowest-numbered SDK
2744 # higher than or equal to the minimum required should be found.
2746 AC_MSG_CHECKING([what Mac OS X SDK to use])
2747 for _macosx_sdk in $with_macosx_sdk 10.8 10.9 10.10 10.11 10.12 10.13 10.14; do
2748 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2749 if test -d "$MACOSX_SDK_PATH"; then
2750 with_macosx_sdk="${_macosx_sdk}"
2753 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2754 if test -d "$MACOSX_SDK_PATH"; then
2755 with_macosx_sdk="${_macosx_sdk}"
2760 if test ! -d "$MACOSX_SDK_PATH"; then
2761 AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2763 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2765 case $with_macosx_sdk in
2767 MACOSX_SDK_VERSION=1080
2770 MACOSX_SDK_VERSION=1090
2773 MACOSX_SDK_VERSION=101000
2776 MACOSX_SDK_VERSION=101100
2779 MACOSX_SDK_VERSION=101200
2782 MACOSX_SDK_VERSION=101300
2785 MACOSX_SDK_VERSION=101400
2788 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.8--13])
2792 if test "$with_macosx_version_min_required" = "" ; then
2793 with_macosx_version_min_required="10.8";
2796 if test "$with_macosx_version_max_allowed" = "" ; then
2797 with_macosx_version_max_allowed="$with_macosx_sdk"
2800 # export this so that "xcrun" invocations later return matching values
2801 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2802 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2803 export DEVELOPER_DIR
2804 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2805 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2807 case "$with_macosx_version_min_required" in
2809 MAC_OS_X_VERSION_MIN_REQUIRED="1080"
2812 MAC_OS_X_VERSION_MIN_REQUIRED="1090"
2815 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2818 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2821 MAC_OS_X_VERSION_MIN_REQUIRED="101200"
2824 MAC_OS_X_VERSION_MIN_REQUIRED="101300"
2827 MAC_OS_X_VERSION_MIN_REQUIRED="101400"
2830 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.8--13])
2834 LIBTOOL=/usr/bin/libtool
2835 INSTALL_NAME_TOOL=install_name_tool
2836 if test -z "$save_CC"; then
2837 AC_MSG_CHECKING([what compiler to use])
2838 stdlib=-stdlib=libc++
2839 if test "$ENABLE_LTO" = TRUE; then
2842 CC="`xcrun -find clang` -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2843 CXX="`xcrun -find clang++` -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2844 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2847 STRIP=`xcrun -find strip`
2848 LIBTOOL=`xcrun -find libtool`
2849 RANLIB=`xcrun -find ranlib`
2850 AC_MSG_RESULT([$CC and $CXX])
2853 case "$with_macosx_version_max_allowed" in
2855 MAC_OS_X_VERSION_MAX_ALLOWED="1080"
2858 MAC_OS_X_VERSION_MAX_ALLOWED="1090"
2861 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2864 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2867 MAC_OS_X_VERSION_MAX_ALLOWED="101200"
2870 MAC_OS_X_VERSION_MAX_ALLOWED="101300"
2873 MAC_OS_X_VERSION_MAX_ALLOWED="101400"
2876 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.8--13])
2880 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2881 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2882 AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2887 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2888 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2889 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2893 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2894 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2896 AC_MSG_CHECKING([whether to do code signing])
2898 if test "$enable_macosx_code_signing" = yes; then
2899 # By default use the first suitable certificate (?).
2901 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2902 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2903 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2904 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2905 # "Developer ID Application" one.
2907 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2908 if test -n "$identity"; then
2909 MACOSX_CODESIGNING_IDENTITY=$identity
2910 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2911 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2913 AC_MSG_ERROR([cannot determine identity to use])
2915 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2916 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2917 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2918 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2923 AC_MSG_CHECKING([whether to create a Mac App Store package])
2925 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2926 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2927 elif test "$enable_macosx_package_signing" = yes; then
2928 # By default use the first suitable certificate.
2929 # It should be a "3rd Party Mac Developer Installer" one
2931 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2932 if test -n "$identity"; then
2933 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2934 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2935 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2937 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2939 elif test -n "$enable_macosx_package_signing"; then
2940 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2941 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2942 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2947 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2948 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2951 AC_MSG_CHECKING([whether to sandbox the application])
2953 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2954 AC_MSG_ERROR([OS X sandboxing requires code signing])
2955 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
2956 AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
2957 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2958 ENABLE_MACOSX_SANDBOX=TRUE
2959 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
2960 AC_MSG_RESULT([yes])
2965 AC_MSG_CHECKING([what OS X app bundle identifier to use])
2966 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
2967 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
2969 AC_SUBST(MACOSX_SDK_PATH)
2970 AC_SUBST(MACOSX_SDK_VERSION)
2971 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2972 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2973 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2974 AC_SUBST(INSTALL_NAME_TOOL)
2975 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
2976 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2977 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
2978 AC_SUBST(ENABLE_MACOSX_SANDBOX)
2979 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
2981 dnl ===================================================================
2982 dnl Check iOS SDK and compiler
2983 dnl ===================================================================
2985 if test $_os = iOS; then
2987 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2993 AC_MSG_CHECKING([what iOS SDK to use])
2995 if test "$enable_ios_simulator" = yes; then
2996 platform=iPhoneSimulator
3001 xcode_developer=`xcode-select -print-path`
3004 for sdkver in 10.0 9.3 9.2; do
3005 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3013 if test -z "$sysroot"; then
3014 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
3017 AC_MSG_RESULT($sysroot)
3019 XCODEBUILD_SDK=`echo $platform | tr A-Z a-z`$ios_sdk
3021 if test "$enable_ios_simulator" = yes; then
3022 if test "$BITNESS_OVERRIDE" = 64; then
3024 versionmin=-mios-simulator-version-min=9.0
3027 versionmin=-mios-simulator-version-min=9.0
3031 if test "$BITNESS_OVERRIDE" = 64; then
3036 versionmin=-miphoneos-version-min=9.0
3039 # LTO is not really recommended for iOS builds,
3040 # the link time will be astronomical
3041 if test "$ENABLE_LTO" = TRUE; then
3044 # Just add -fvisibility=hidden to CC and CXX directly so that the 3rd-party libs also
3045 # get compiled with it, to avoid ld warnings when linking all that together into one
3048 XCODE_CLANG_CXX_LIBRARY=libc++
3049 stdlib="-stdlib=$XCODE_CLANG_CXX_LIBRARY"
3051 CC="`xcrun -find clang` -arch $XCODE_ARCHS -fvisibility=hidden -isysroot $sysroot $lto $versionmin"
3052 CXX="`xcrun -find clang++` -arch $XCODE_ARCHS -fvisibility=hidden $stdlib -isysroot $sysroot $lto $versionmin"
3054 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3057 STRIP=`xcrun -find strip`
3058 LIBTOOL=`xcrun -find libtool`
3059 RANLIB=`xcrun -find ranlib`
3062 AC_SUBST(XCODE_CLANG_CXX_LIBRARY)
3063 AC_SUBST(XCODE_ARCHS)
3064 AC_SUBST(XCODEBUILD_SDK)
3066 AC_MSG_CHECKING([whether to treat the installation as read-only])
3068 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3069 "$enable_extensions" != yes; then
3070 enable_readonly_installset=yes
3072 if test "$enable_readonly_installset" = yes; then
3073 AC_MSG_RESULT([yes])
3074 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3079 dnl ===================================================================
3080 dnl Structure of install set
3081 dnl ===================================================================
3083 if test $_os = Darwin; then
3084 LIBO_BIN_FOLDER=MacOS
3085 LIBO_ETC_FOLDER=Resources
3086 LIBO_LIBEXEC_FOLDER=MacOS
3087 LIBO_LIB_FOLDER=Frameworks
3088 LIBO_LIB_PYUNO_FOLDER=Resources
3089 LIBO_SHARE_FOLDER=Resources
3090 LIBO_SHARE_HELP_FOLDER=Resources/help
3091 LIBO_SHARE_JAVA_FOLDER=Resources/java
3092 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3093 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3094 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3095 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3096 LIBO_URE_BIN_FOLDER=MacOS
3097 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3098 LIBO_URE_LIB_FOLDER=Frameworks
3099 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3100 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3101 elif test $_os = WINNT; then
3102 LIBO_BIN_FOLDER=program
3103 LIBO_ETC_FOLDER=program
3104 LIBO_LIBEXEC_FOLDER=program
3105 LIBO_LIB_FOLDER=program
3106 LIBO_LIB_PYUNO_FOLDER=program
3107 LIBO_SHARE_FOLDER=share
3108 LIBO_SHARE_HELP_FOLDER=help
3109 LIBO_SHARE_JAVA_FOLDER=program/classes
3110 LIBO_SHARE_PRESETS_FOLDER=presets
3111 LIBO_SHARE_READMES_FOLDER=readmes
3112 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3113 LIBO_SHARE_SHELL_FOLDER=program/shell
3114 LIBO_URE_BIN_FOLDER=program
3115 LIBO_URE_ETC_FOLDER=program
3116 LIBO_URE_LIB_FOLDER=program
3117 LIBO_URE_MISC_FOLDER=program
3118 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3120 LIBO_BIN_FOLDER=program
3121 LIBO_ETC_FOLDER=program
3122 LIBO_LIBEXEC_FOLDER=program
3123 LIBO_LIB_FOLDER=program
3124 LIBO_LIB_PYUNO_FOLDER=program
3125 LIBO_SHARE_FOLDER=share
3126 LIBO_SHARE_HELP_FOLDER=help
3127 LIBO_SHARE_JAVA_FOLDER=program/classes
3128 LIBO_SHARE_PRESETS_FOLDER=presets
3129 LIBO_SHARE_READMES_FOLDER=readmes
3130 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3131 LIBO_SHARE_SHELL_FOLDER=program/shell
3132 LIBO_URE_BIN_FOLDER=program
3133 LIBO_URE_ETC_FOLDER=program
3134 LIBO_URE_LIB_FOLDER=program
3135 LIBO_URE_MISC_FOLDER=program
3136 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3138 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3139 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3140 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3141 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3142 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3143 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3144 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3145 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3146 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3147 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3148 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3149 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3150 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3151 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3152 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3153 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3155 # Not all of them needed in config_host.mk, add more if need arises
3156 AC_SUBST(LIBO_BIN_FOLDER)
3157 AC_SUBST(LIBO_ETC_FOLDER)
3158 AC_SUBST(LIBO_LIB_FOLDER)
3159 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3160 AC_SUBST(LIBO_SHARE_FOLDER)
3161 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3162 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3163 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3164 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3165 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3166 AC_SUBST(LIBO_URE_BIN_FOLDER)
3167 AC_SUBST(LIBO_URE_ETC_FOLDER)
3168 AC_SUBST(LIBO_URE_LIB_FOLDER)
3169 AC_SUBST(LIBO_URE_MISC_FOLDER)
3170 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3172 dnl ===================================================================
3173 dnl Windows specific tests and stuff
3174 dnl ===================================================================
3178 # Return value: $regvalue
3181 local _regentry="/proc/registry${1}/${2}"
3182 if test -f "$_regentry"; then
3183 # Stop bash complaining about \0 bytes in input, as it can't handle them.
3184 # Registry keys read via /proc/registry* are always \0 terminated!
3185 local _regvalue=$(tr -d '\0' < "$_regentry")
3186 if test $? -eq 0; then
3192 # Get a value from the 32-bit side of the Registry
3195 reg_get_value "32" "$1"
3198 # Get a value from the 64-bit side of the Registry
3201 reg_get_value "64" "$1"
3204 if test "$_os" = "WINNT"; then
3205 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3206 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3208 WINDOWS_SDK_ARCH="x86"
3210 AC_MSG_RESULT([yes])
3211 WINDOWS_SDK_ARCH="x64"
3216 if test "$cross_compiling" = "yes"; then
3217 export CROSS_COMPILING=TRUE
3218 SCPDEFS="$SCPDEFS -DCROSS_COMPILING"
3221 BUILD_TYPE="$BUILD_TYPE NATIVE"
3223 AC_SUBST(CROSS_COMPILING)
3225 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3226 if test "$GCC" = "yes"; then
3227 AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
3228 bsymbolic_functions_ldflags_save=$LDFLAGS
3229 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
3230 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3233 printf ("hello world\n");
3234 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3235 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3236 AC_MSG_RESULT( found )
3238 AC_MSG_RESULT( not found )
3240 LDFLAGS=$bsymbolic_functions_ldflags_save
3242 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3244 # Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers.
3245 # NOTE: must _not_ be used for bundled external libraries!
3247 if test "$GCC" = "yes"; then
3248 AC_MSG_CHECKING( for -isystem )
3250 CFLAGS="$CFLAGS -Werror"
3251 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3253 if test -n "$ISYSTEM"; then
3259 if test -z "$ISYSTEM"; then
3260 # fall back to using -I
3265 dnl ===================================================================
3266 dnl Check which Visual Studio or MinGW compiler is used
3267 dnl ===================================================================
3269 map_vs_year_to_version()
3271 # Return value: $vsversion
3281 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3285 vs_versions_to_check()
3287 # Args: $1 (optional) : versions to check, in the order of preference
3288 # Return value: $vsversions
3292 if test -n "$1"; then
3293 map_vs_year_to_version "$1"
3294 vsversions=$vsversion
3296 # By default we prefer 2013/2015, in this order
3297 vsversions="12.0 14.0"
3303 # Find Visual Studio 2013/2015
3304 # Args: $1 (optional) : versions to check, in the order of preference
3305 # Return value: $vstest
3309 vs_versions_to_check "$1"
3311 for ver in $vsversions; do
3312 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/ProductDir
3313 if test -n "$regvalue"; then
3317 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VS/ProductDir
3318 if test -n "$regvalue"; then
3325 win_get_env_from_vsvars32bat()
3327 WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
3328 echo -e "@setlocal\r\n" >> $WRAPPERBATCHFILEPATH
3329 echo -e "@call \"`cygpath -w $VC_PRODUCT_DIR`/../Common7/Tools/vsvars32.bat\"\r\n" >> $WRAPPERBATCHFILEPATH
3330 echo -e "@echo %$1%\r\n" >> $WRAPPERBATCHFILEPATH
3331 echo -e "@endlocal\r\n" >> $WRAPPERBATCHFILEPATH
3332 chmod +x $WRAPPERBATCHFILEPATH
3333 _win_get_env_from_vsvars32bat=$($WRAPPERBATCHFILEPATH | tr -d "\r")
3334 rm -f $WRAPPERBATCHFILEPATH
3335 echo $_win_get_env_from_vsvars32bat
3340 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
3341 if test -n "$regvalue"; then
3342 PathFormat "$regvalue"
3343 UCRTSDKDIR=$formatted_path
3344 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
3345 UCRTVERSION=$regvalue
3347 if test -z "$UCRTSDKDIR"; then
3348 if test -f "$VC_PRODUCT_DIR/../Common7/Tools/vsvars32.bat"; then
3349 PathFormat "`win_get_env_from_vsvars32bat "UniversalCRTSdkDir"`"
3350 UCRTSDKDIR=$formatted_path
3351 UCRTVERSION=`win_get_env_from_vsvars32bat "UCRTVersion"`
3358 # Find Visual C++ 2013/2015
3359 # Args: $1 (optional) : The VS version year
3360 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot
3362 unset vctest vcnum vcnumwithdot vcexpress
3364 vs_versions_to_check "$1"
3366 for ver in $vsversions; do
3367 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3368 if test -n "$regvalue"; then
3372 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VC/ProductDir
3373 if test -n "$regvalue"; then
3378 if test -n "$vctest"; then
3380 case "$vcnumwithdot" in
3390 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$vcnumwithdot/Setup/VC/ProductDir
3391 if test -n "$regvalue" -a "$regvalue" = "$vctest" ; then
3398 SHOWINCLUDES_PREFIX=
3401 if test "$_os" = "WINNT"; then
3402 if test "$WITH_MINGW" != "yes"; then
3403 AC_MSG_CHECKING([Visual C++])
3405 find_msvc "$with_visual_studio"
3406 if test -z "$vctest"; then
3407 if test -n "$with_visual_studio"; then
3408 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3410 AC_MSG_ERROR([No Visual Studio 2013/2015 installation found])
3414 if test "$BITNESS_OVERRIDE" = ""; then
3415 if test -f "$vctest/bin/cl.exe"; then
3416 VC_PRODUCT_DIR=$vctest
3418 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3421 if test -f "$vctest/bin/amd64/cl.exe"; then
3422 VC_PRODUCT_DIR=$vctest
3424 if test -f "$vctest/bin/x86_amd64/cl.exe" -a "$vcexpress" = "Express"; then
3425 VC_PRODUCT_DIR=$vctest
3427 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/amd64/cl.exe or $vctest/bin/x86_amd64/cl.exe])
3432 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3433 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3435 AC_MSG_CHECKING([Is Visual C++ Express])
3436 if test "$vcexpress" = "Express" ; then
3437 AC_MSG_RESULT([Yes])
3445 AC_MSG_CHECKING([whether UCRT is needed for this compiler version])
3446 if test "$vcnum" = "120"; then
3449 AC_MSG_RESULT([Yes])
3450 AC_MSG_CHECKING([for UCRT location])
3452 if test -n "$UCRTSDKDIR"; then
3453 AC_MSG_RESULT([found])
3454 PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
3455 ucrtincpath_formatted=$formatted_path
3456 # SOLARINC is used for external modules and must be set too.
3457 # And no, it's not sufficient to set SOLARINC only, as configure
3458 # itself doesn't honour it.
3459 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3460 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3461 CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
3462 CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3464 AC_MSG_ERROR([not found])
3467 AC_SUBST(UCRTSDKDIR)
3468 AC_SUBST(UCRTVERSION)
3470 # Find the proper version of MSBuild.exe to use based on the VS version
3471 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3472 if test -n "$regvalue" ; then
3473 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3476 # Find the version of devenv.exe
3477 DEVENV="$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe"
3478 if test ! -e "$DEVENV" -a "$vcnum" = "120"; then
3479 # for Visual Studio 2013 Express, fall back
3480 DEVENV="$VC_PRODUCT_DIR/../Common7/IDE/WDExpress.exe"
3482 if test ! -e "$DEVENV"; then
3483 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3486 dnl ===========================================================
3487 dnl Check for the corresponding mspdb*.dll
3488 dnl ===========================================================
3492 if test "$BITNESS_OVERRIDE" = ""; then
3493 if test "$vcnum" = "120"; then
3494 MSPDB_PATH="$VC_PRODUCT_DIR/../VC/bin"
3496 MSPDB_PATH="$VC_PRODUCT_DIR/../Common7/IDE"
3499 if test "$vcexpress" = "Express"; then
3500 MSPDB_PATH="$VC_PRODUCT_DIR/bin"
3502 MSPDB_PATH="$VC_PRODUCT_DIR/bin/amd64"
3508 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3509 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3512 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3513 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3515 dnl The path needs to be added before cl is called
3516 PATH="$MSPDB_PATH:$PATH"
3518 AC_MSG_CHECKING([cl.exe])
3520 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3521 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3522 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3525 if test -z "$CC"; then
3526 if test "$BITNESS_OVERRIDE" = ""; then
3527 if test -f "$VC_PRODUCT_DIR/bin/cl.exe"; then
3528 CC="$VC_PRODUCT_DIR/bin/cl.exe"
3531 if test "$vcexpress" = "Express"; then
3532 if test -f "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"; then
3533 CC="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3536 if test -f "$VC_PRODUCT_DIR/bin/amd64/cl.exe"; then
3537 CC="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3542 # This gives us a posix path with 8.3 filename restrictions
3543 CC=`win_short_path_for_make "$CC"`
3546 if test -n "$CC"; then
3547 # Remove /cl.exe from CC case insensitive
3548 AC_MSG_RESULT([found Visual C++ $vcyear $vcexpress ($CC)])
3549 if test "$BITNESS_OVERRIDE" = ""; then
3550 COMPATH=`echo "$CC" | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
3552 if test -n "$VC_PRODUCT_DIR"; then
3553 COMPATH=$VC_PRODUCT_DIR
3556 if test "$BITNESS_OVERRIDE" = ""; then
3557 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3560 export INCLUDE=`cygpath -d "$COMPATH/Include"`
3562 PathFormat "$COMPATH"
3563 COMPATH="$formatted_path"
3568 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3569 # are always "better", we list them in reverse chronological order.
3574 WINDOWS_SDK_ACCEPTABLE_VERSIONS="8.1A 8.1 8.0 7.1A"
3578 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0A 10.0 8.1A 8.1 8.0 7.1A"
3582 # The expectation is that --with-windows-sdk should not need to be used
3583 if test -n "$with_windows_sdk"; then
3584 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3585 *" "$with_windows_sdk" "*)
3586 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3589 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3594 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3599 AC_MSG_ERROR([Visual C++ not found after all, huh])
3602 dnl We need to guess the prefix of the -showIncludes output, it can be
3604 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3605 echo "#include <stdlib.h>" > conftest.c
3606 dnl Filter out -FIIntrin.h when CC points at clang-cl.exe and needs to
3607 dnl explicitly state that argument:
3618 SHOWINCLUDES_PREFIX=`$my_CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3619 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3620 rm -f conftest.c conftest.obj
3621 if test -z "$SHOWINCLUDES_PREFIX"; then
3622 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3624 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3627 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3628 # version of the Explorer extension (and maybe other small
3629 # bits, too) needed when installing a 32-bit LibreOffice on a
3630 # 64-bit OS. The 64-bit Explorer extension is a feature that
3631 # has been present since long in OOo. Don't confuse it with
3632 # building LibreOffice itself as 64-bit code.
3638 if test "$BITNESS_OVERRIDE" = ""; then
3639 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3640 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3641 # Prefer native x64 compiler to cross-compiler, in case we are running
3642 # the build on a 64-bit OS.
3643 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3645 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3646 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3647 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3649 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3650 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3653 if test "$BUILD_X64" = TRUE; then
3654 AC_MSG_RESULT([found])
3656 AC_MSG_RESULT([not found])
3657 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3662 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3663 AC_SUBST(CXX_X64_BINARY)
3664 AC_SUBST(LINK_X64_BINARY)
3666 AC_MSG_CHECKING([the compiler is MinGW])
3667 MACHINE_PREFIX=`$CC -dumpmachine`
3668 if echo $MACHINE_PREFIX | $GREP -q mingw32; then
3669 COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
3670 AC_MSG_RESULT([yes])
3672 AC_MSG_ERROR([Compiler is not MinGW.])
3678 PathFormat "$MSPDB_PATH"
3679 MSPDB_PATH="$formatted_path"
3680 AC_SUBST(SHOWINCLUDES_PREFIX)
3682 if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
3683 AC_MSG_CHECKING([whether to use DirectX])
3684 if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
3685 ENABLE_DIRECTX="TRUE"
3686 AC_MSG_RESULT([yes])
3692 AC_MSG_CHECKING([whether to use ActiveX])
3693 if test "$enable_activex" = "yes" -o "$enable_activex" = "" -a "$vcexpress" != Express; then
3695 AC_MSG_RESULT([yes])
3697 DISABLE_ACTIVEX="TRUE"
3701 AC_MSG_CHECKING([whether to use ATL])
3702 if test "$enable_atl" = "yes" -o "$enable_atl" = "" -a "$vcexpress" != Express; then
3704 AC_DEFINE(HAVE_FEATURE_ATL, 1)
3705 AC_MSG_RESULT([yes])
3712 DISABLE_ACTIVEX="TRUE"
3716 AC_SUBST(ENABLE_DIRECTX)
3717 AC_SUBST(DISABLE_ACTIVEX)
3718 AC_SUBST(DISABLE_ATL)
3723 if test "$_os" = "WINNT"; then
3724 BUILD_TYPE="$BUILD_TYPE DBGHELP"
3730 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3731 AC_SUBST(UNOWINREG_DLL)
3734 AC_MSG_CHECKING([whether the compiler is actually Clang])
3735 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3741 [AC_MSG_RESULT([yes])
3743 [AC_MSG_RESULT([no])])
3745 if test "$COM_IS_CLANG" = TRUE; then
3746 AC_MSG_CHECKING([the Clang version])
3747 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | ${CC%-cl.exe*} -E -P -`
3748 CLANG_FULL_VERSION=`echo __clang_version__ | ${CC%-cl.exe*} -E -P -`
3749 CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3750 AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3751 AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
3752 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3754 AC_SUBST(COM_IS_CLANG)
3757 # prefix C with ccache if needed
3759 if test "$CCACHE" != ""; then
3760 AC_MSG_CHECKING([whether $CC is already ccached])
3764 CFLAGS="$CFLAGS --ccache-skip -O2"
3765 dnl an empty program will do, we're checking the compiler flags
3766 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3767 [use_ccache=yes], [use_ccache=no])
3768 if test $use_ccache = yes; then
3769 AC_MSG_RESULT([yes])
3778 # ===================================================================
3779 # check various GCC options that Clang does not support now but maybe
3780 # will somewhen in the future, check them even for GCC, so that the
3782 # ===================================================================
3785 HAVE_GCC_FINLINE_LIMIT=
3786 HAVE_GCC_FNO_INLINE=
3787 if test "$GCC" = "yes"; then
3788 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3789 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3790 # Option just ignored and silly warning that isn't a real
3795 CFLAGS="$CFLAGS -Werror -ggdb2"
3796 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3799 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3800 AC_MSG_RESULT([yes])
3805 AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3806 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3811 CFLAGS="$CFLAGS -Werror -finline-limit=0"
3812 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3815 if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3816 AC_MSG_RESULT([yes])
3821 AC_MSG_CHECKING([whether $CC supports -fno-inline])
3822 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3827 CFLAGS="$CFLAGS -Werror -fno-inline"
3828 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3831 if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3832 AC_MSG_RESULT([yes])
3837 AC_SUBST(HAVE_GCC_GGDB2)
3838 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3839 AC_SUBST(HAVE_GCC_FNO_INLINE)
3841 dnl ===================================================================
3842 dnl Test the gcc version
3843 dnl ===================================================================
3844 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3845 AC_MSG_CHECKING([the GCC version])
3846 _gcc_version=`$CC -dumpversion`
3847 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3849 AC_MSG_RESULT([gcc $_gcc_version])
3851 if test "$GCC_VERSION" -lt 0407; then
3852 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.7.0])
3855 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3856 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3857 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3858 # (which reports itself as GCC 4.2.1).
3861 AC_SUBST(GCC_VERSION)
3863 dnl Set the ENABLE_DBGUTIL variable
3864 dnl ===================================================================
3865 AC_MSG_CHECKING([whether to build with additional debug utilities])
3866 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3867 ENABLE_DBGUTIL="TRUE"
3868 # this is an extra var so it can have different default on different MSVC
3869 # versions (in case there are version specific problems with it)
3870 MSVC_USE_DEBUG_RUNTIME="TRUE"
3872 AC_MSG_RESULT([yes])
3873 # cppunit and graphite expose STL in public headers
3874 if test "$with_system_cppunit" = "yes"; then
3875 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3877 with_system_cppunit=no
3879 if test "$with_system_graphite" = "yes"; then
3880 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3882 with_system_graphite=no
3884 if test "$with_system_mysql_cppconn" = "yes"; then
3885 AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
3887 with_system_mysql_cppconn=no
3889 if test "$with_system_orcus" = "yes"; then
3890 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3892 with_system_orcus=no
3894 if test "$with_system_libcmis" = "yes"; then
3895 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3897 with_system_libcmis=no
3899 if test "$with_system_libgltf" = "yes"; then
3900 AC_MSG_ERROR([--with-system-libgltf conflicts with --enable-dbgutil])
3902 with_system_libgltf=no
3904 if test "$with_system_hunspell" = "yes"; then
3905 AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
3907 with_system_hunspell=no
3911 MSVC_USE_DEBUG_RUNTIME=""
3914 AC_SUBST(ENABLE_DBGUTIL)
3915 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3917 dnl Set the ENABLE_DEBUG variable.
3918 dnl ===================================================================
3919 AC_MSG_CHECKING([whether to do a debug build])
3920 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3921 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3923 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3924 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3927 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3929 if test -n "$ENABLE_DBGUTIL" ; then
3930 AC_MSG_RESULT([yes (dbgutil)])
3932 AC_MSG_RESULT([yes])
3938 AC_SUBST(ENABLE_DEBUG)
3940 if test "$enable_sal_log" = yes; then
3943 AC_SUBST(ENABLE_SAL_LOG)
3945 dnl Selective debuginfo
3946 ENABLE_DEBUGINFO_FOR=
3947 if test -n "$ENABLE_DEBUG"; then
3948 AC_MSG_CHECKING([whether to use selective debuginfo])
3949 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3950 if test "$enable_selective_debuginfo" = "yes"; then
3951 AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
3953 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3954 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3956 ENABLE_DEBUGINFO_FOR=all
3957 AC_MSG_RESULT([no, for all])
3960 if test -n "$enable_selective_debuginfo"; then
3961 AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
3964 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3966 dnl Check for enable symbols option
3967 dnl ===================================================================
3968 AC_MSG_CHECKING([whether to generate debug information])
3969 if test -z "$enable_symbols"; then
3970 if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
3976 if test "$enable_symbols" != no; then
3978 AC_MSG_RESULT([yes])
3983 AC_SUBST(ENABLE_SYMBOLS)
3985 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
3986 # Building on Android with full symbols: without enough memory the linker never finishes currently.
3987 AC_MSG_CHECKING([whether enough memory is available for linking])
3988 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
3989 # Check for 15GB, as Linux reports a bit less than the physical memory size.
3990 if test -n "$mem_size" -a $mem_size -lt 15728640; then
3991 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
3993 AC_MSG_RESULT([yes])
3997 # Debug information format for iOS. Running dsymutil takes a long time... you really need a separate
3998 # .dSYM only if running Instruments, I think. (Not for normal debugging in Xcode.) To enable a
3999 # separate .dSYM, either use --enable-release-build or change manually to "DWARF with DSYM" in Xcode.
4000 XCODE_DEBUG_INFORMATION_FORMAT=dwarf-with-dsym
4001 if test "$enable_release_build" != yes -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \); then
4002 XCODE_DEBUG_INFORMATION_FORMAT=dwarf
4004 AC_SUBST(XCODE_DEBUG_INFORMATION_FORMAT)
4006 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
4007 # By default use the ones specified by our build system,
4008 # but explicit override is possible.
4009 AC_MSG_CHECKING(for explicit AFLAGS)
4010 if test -n "$AFLAGS"; then
4011 AC_MSG_RESULT([$AFLAGS])
4017 AC_MSG_CHECKING(for explicit CFLAGS)
4018 if test -n "$CFLAGS"; then
4019 AC_MSG_RESULT([$CFLAGS])
4025 AC_MSG_CHECKING(for explicit CXXFLAGS)
4026 if test -n "$CXXFLAGS"; then
4027 AC_MSG_RESULT([$CXXFLAGS])
4033 AC_MSG_CHECKING(for explicit OBJCFLAGS)
4034 if test -n "$OBJCFLAGS"; then
4035 AC_MSG_RESULT([$OBJCFLAGS])
4041 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
4042 if test -n "$OBJCXXFLAGS"; then
4043 AC_MSG_RESULT([$OBJCXXFLAGS])
4049 AC_MSG_CHECKING(for explicit LDFLAGS)
4050 if test -n "$LDFLAGS"; then
4051 AC_MSG_RESULT([$LDFLAGS])
4061 AC_SUBST(OBJCXXFLAGS)
4065 AC_SUBST(x_CXXFLAGS)
4066 AC_SUBST(x_OBJCFLAGS)
4067 AC_SUBST(x_OBJCXXFLAGS)
4071 # determine CPUNAME, OS, ...
4072 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
4083 PLATFORMID=aix_powerpc
4092 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4099 if test "$BITNESS_OVERRIDE" = 64; then
4102 PLATFORMID=windows_x86_64
4104 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4108 PLATFORMID=windows_x86
4112 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4115 SCPDEFS="$SCPDEFS -D_MSC_VER"
4133 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4138 PLATFORMID=macosx_x86_64
4141 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4157 PLATFORMID=dragonfly_x86
4162 PLATFORMID=dragonfly_x86_64
4165 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4181 PLATFORMID=freebsd_x86
4186 PLATFORMID=freebsd_x86_64
4189 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4206 PLATFORMID=kfreebsd_x86
4211 PLATFORMID=kfreebsd_x86_64
4214 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4230 PLATFORMID=linux_aarch64
4236 PLATFORMID=linux_alpha
4242 PLATFORMID=linux_arm_eabi
4246 PLATFORMID=linux_arm_oabi
4254 PLATFORMID=linux_hppa
4259 PLATFORMID=linux_x86
4264 PLATFORMID=linux_ia64
4270 PLATFORMID=linux_mips_eb
4275 EPM_FLAGS="-a mips64"
4276 PLATFORMID=linux_mips64_eb
4281 EPM_FLAGS="-a mips64el"
4282 PLATFORMID=linux_mips64_el
4287 EPM_FLAGS="-a mipsel"
4288 PLATFORMID=linux_mips_el
4293 PLATFORMID=linux_m68k
4298 PLATFORMID=linux_powerpc
4303 PLATFORMID=linux_powerpc64
4307 RTL_ARCH=PowerPC_64_LE
4308 PLATFORMID=linux_powerpc64_le
4313 PLATFORMID=linux_sparc
4318 PLATFORMID=linux_sparc64
4323 PLATFORMID=linux_s390
4328 PLATFORMID=linux_s390x
4333 PLATFORMID=linux_x86_64
4336 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4353 PLATFORMID=android_arm_eabi
4358 PLATFORMID=android_aarch64
4361 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4363 PLATFORMID=android_mips_el
4368 PLATFORMID=android_x86
4371 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4384 PLATFORMID=linux_x86
4396 if test "$BITNESS_OVERRIDE" = 64; then
4399 PLATFORMID=windows_x86_64
4400 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgccx"
4404 PLATFORMID=windows_x86
4405 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgcci"
4409 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4425 PLATFORMID=netbsd_x86
4430 PLATFORMID=netbsd_powerpc
4435 PLATFORMID=netbsd_sparc
4440 PLATFORMID=netbsd_x86_64
4443 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4459 PLATFORMID=openbsd_x86
4464 PLATFORMID=openbsd_x86_64
4467 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4470 SOLARINC="$SOLARINC -I/usr/local/include"
4484 PLATFORMID=solaris_x86
4489 PLATFORMID=solaris_sparc
4494 PLATFORMID=solaris_sparc64
4497 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4500 SOLARINC="$SOLARINC -I/usr/local/include"
4504 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4508 if test "$with_x" = "no"; then
4509 AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
4513 if test "$enable_gui" = "no"; then
4514 if test "$USING_X11" != TRUE; then
4515 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
4518 ENABLE_HEADLESS=TRUE
4519 AC_DEFINE(HAVE_FEATURE_UI,0)
4522 AC_SUBST(ENABLE_HEADLESS)
4524 WORKDIR="${BUILDDIR}/workdir"
4525 INSTDIR="${BUILDDIR}/instdir"
4526 INSTROOT="${INSTDIR}${INSTROOTSUFFIX}"
4527 SOLARINC="-I. -I$SRC_ROOT/include $SOLARINC"
4535 AC_SUBST([INSTROOT])
4539 AC_SUBST(PLATFORMID)
4540 AC_SUBST(WINDOWS_X64)
4541 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4543 dnl ===================================================================
4544 dnl Test which package format to use
4545 dnl ===================================================================
4546 AC_MSG_CHECKING([which package format to use])
4547 if test -n "$with_package_format" -a "$with_package_format" != no; then
4548 for i in $with_package_format; do
4550 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4553 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4554 aix - AIX software distribution
4555 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4556 deb - Debian software distribution
4557 pkg - Solaris software distribution
4558 rpm - RedHat software distribution
4560 LibreOffice additionally supports:
4561 archive - .tar.gz or .zip
4563 installed - installation tree
4569 PKGFORMAT="$with_package_format"
4570 AC_MSG_RESULT([$PKGFORMAT])
4573 AC_MSG_RESULT([none])
4577 dnl ===================================================================
4578 dnl Set up a different compiler to produce tools to run on the build
4579 dnl machine when doing cross-compilation
4580 dnl ===================================================================
4582 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4583 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4584 if test "$cross_compiling" = "yes"; then
4585 AC_MSG_CHECKING([for BUILD platform configuration])
4587 rm -rf CONF-FOR-BUILD config_build.mk
4588 mkdir CONF-FOR-BUILD
4589 # Here must be listed all files needed when running the configure script. In particular, also
4590 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4591 # keep them in the same order as there.
4592 (cd $SRC_ROOT && tar cf - \
4594 bin/get_config_variables \
4595 solenv/bin/getcompver.awk \
4596 solenv/inc/langlist.mk \
4598 config_host_lang.mk.in \
4601 bin/bffvalidator.sh.in \
4602 bin/odfvalidator.sh.in \
4603 bin/officeotron.sh.in \
4604 instsetoo_native/util/openoffice.lst.in \
4606 sysui/desktop/macosx/Info.plist.in \
4607 ios/lo.xcconfig.in) \
4608 | (cd CONF-FOR-BUILD && tar xf -)
4609 cp configure CONF-FOR-BUILD
4610 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4612 unset COM USING_X11 OS CPUNAME
4613 unset CC CXX SYSBASE CFLAGS
4614 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4615 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4616 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4617 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4618 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4619 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4622 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4623 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4624 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4625 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4626 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4627 # we need the msi build tools on mingw if we are creating the
4629 if test "$WITH_MINGW" = "yes"; then
4630 enable_winegcc_for_build=
4631 for pkgformat in $PKGFORMAT; do
4632 case "$pkgformat" in
4633 msi|native) enable_winegcc_for_build=yes ;;
4636 test -n "$enable_winegcc_for_build" && sub_conf_opts="$sub_conf_opts --enable-winegcc"
4638 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4639 # Don't bother having configure look for stuff not needed for the build platform anyway
4642 --disable-graphite \
4644 --disable-pdfimport \
4645 --disable-postgresql-sdbc \
4646 --with-parallelism="$with_parallelism" \
4651 2>&1 | sed -e 's/^/ /'
4652 test -f ./config_host.mk 2>/dev/null || exit
4653 cp config_host.mk ../config_build.mk
4654 cp config_host_lang.mk ../config_build_lang.mk
4655 mv config.log ../config.Build.log
4656 mkdir -p ../config_build
4657 mv config_host/*.h ../config_build
4658 . ./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
4660 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
4662 VV=`eval "echo $VV"`
4663 if test -n "$VV"; then
4664 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4665 echo "$line" >>build-config
4669 for V in INSTDIR INSTROOT WORKDIR; do
4671 VV=`eval "echo $VV"`
4672 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4673 if test -n "$VV"; then
4674 line="${V}_FOR_BUILD='$VV'"
4675 echo "$line" >>build-config
4679 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4680 echo "$line" >>build-config
4683 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4684 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])
4685 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4686 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4688 eval `cat CONF-FOR-BUILD/build-config`
4690 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4692 rm -rf CONF-FOR-BUILD
4696 CXX_FOR_BUILD="$CXX"
4697 INSTDIR_FOR_BUILD="$INSTDIR"
4698 INSTROOT_FOR_BUILD="$INSTROOT"
4699 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4700 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4701 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4702 LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
4703 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4704 WORKDIR_FOR_BUILD="$WORKDIR"
4706 AC_SUBST(OS_FOR_BUILD)
4707 AC_SUBST(INSTDIR_FOR_BUILD)
4708 AC_SUBST(INSTROOT_FOR_BUILD)
4709 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4710 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4711 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4712 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
4713 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4714 AC_SUBST(WORKDIR_FOR_BUILD)
4716 dnl ===================================================================
4717 dnl Check for syslog header
4718 dnl ===================================================================
4719 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4721 # placeholder for future crash reporter feature
4723 AC_SUBST(ENABLE_CRASHDUMP)
4725 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4726 dnl ===================================================================
4727 AC_MSG_CHECKING([whether to turn warnings to errors])
4728 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4729 ENABLE_WERROR="TRUE"
4730 AC_MSG_RESULT([yes])
4732 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4733 ENABLE_WERROR="TRUE"
4734 AC_MSG_RESULT([yes])
4739 AC_SUBST(ENABLE_WERROR)
4741 dnl Set the ASSERT_ALWAYS_ABORT variable. (Activate --enable-assert-always-abort)
4742 dnl ===================================================================
4743 AC_MSG_CHECKING([whether to have assert to abort in release code])
4744 if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
4745 ASSERT_ALWAYS_ABORT="TRUE"
4746 AC_MSG_RESULT([yes])
4748 ASSERT_ALWAYS_ABORT="FALSE"
4751 AC_SUBST(ASSERT_ALWAYS_ABORT)
4753 # Determine whether to use ooenv for the instdir installation
4754 # ===================================================================
4755 if test $_os != "WINNT" -a $_os != "Darwin"; then
4756 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4757 if test "$enable_ooenv" = "no"; then
4761 AC_MSG_RESULT([yes])
4764 AC_SUBST(ENABLE_OOENV)
4766 if test "$USING_X11" != TRUE; then
4767 # be sure to do not mess with unneeded stuff
4773 build_gstreamer_1_0=no
4774 build_gstreamer_0_10=no
4777 enable_cairo_canvas=no
4780 dnl ===================================================================
4781 dnl check for cups support
4782 dnl ===================================================================
4785 if test "$enable_cups" = "no"; then
4789 AC_MSG_CHECKING([whether to enable CUPS support])
4790 if test "$test_cups" = "yes"; then
4792 AC_MSG_RESULT([yes])
4794 AC_MSG_CHECKING([whether cups support is present])
4795 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4796 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4797 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4798 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4805 AC_SUBST(ENABLE_CUPS)
4808 if test "$test_fontconfig" = "yes"; then
4809 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4810 SYSTEM_FONTCONFIG=TRUE
4811 FilterLibs "${FONTCONFIG_LIBS}"
4812 FONTCONFIG_LIBS="${filteredlibs}"
4814 AC_SUBST(FONTCONFIG_CFLAGS)
4815 AC_SUBST(FONTCONFIG_LIBS)
4816 AC_SUBST([SYSTEM_FONTCONFIG])
4818 dnl whether to find & fetch external tarballs?
4819 dnl ===================================================================
4820 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4821 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4822 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4824 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4827 if test -z "$TARFILE_LOCATION"; then
4828 if test -d "$SRC_ROOT/src" ; then
4829 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4830 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4832 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4834 AbsolutePath "$TARFILE_LOCATION"
4835 PathFormat "${absolute_path}"
4836 TARFILE_LOCATION="${formatted_path}"
4838 AC_SUBST(TARFILE_LOCATION)
4840 AC_MSG_CHECKING([whether we want to fetch tarballs])
4841 if test "$enable_fetch_external" != "no"; then
4842 if test "$with_all_tarballs" = "yes"; then
4843 AC_MSG_RESULT(["yes, all of them"])
4844 DO_FETCH_TARBALLS="ALL"
4846 AC_MSG_RESULT(["yes, if we use them"])
4847 DO_FETCH_TARBALLS="TRUE"
4853 AC_SUBST(DO_FETCH_TARBALLS)
4855 AC_MSG_CHECKING([whether to build help])
4856 HELP_COMMON_ONLY=FALSE
4857 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4858 BUILD_TYPE="$BUILD_TYPE HELP"
4859 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4860 if test "$with_help" = "common" ; then
4861 HELP_COMMON_ONLY=TRUE
4862 AC_MSG_RESULT([common only])
4864 SCPDEFS="$SCPDEFS -DWITH_HELP"
4865 AC_MSG_RESULT([yes])
4870 AC_SUBST(HELP_COMMON_ONLY)
4872 dnl Test whether to include MySpell dictionaries
4873 dnl ===================================================================
4874 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4875 if test "$with_myspell_dicts" = "yes"; then
4876 AC_MSG_RESULT([yes])
4877 WITH_MYSPELL_DICTS=TRUE
4878 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4879 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4884 AC_SUBST(WITH_MYSPELL_DICTS)
4886 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
4887 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4888 if test "$with_system_dicts" = yes; then
4889 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4891 with_system_dicts=no
4894 AC_MSG_CHECKING([whether to use dicts from external paths])
4895 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4896 AC_MSG_RESULT([yes])
4898 AC_MSG_CHECKING([for spelling dictionary directory])
4899 if test -n "$with_external_dict_dir"; then
4900 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4902 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4903 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4904 DICT_SYSTEM_DIR=file:///usr/share/myspell
4907 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4908 AC_MSG_CHECKING([for hyphenation patterns directory])
4909 if test -n "$with_external_hyph_dir"; then
4910 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4912 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4914 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4915 AC_MSG_CHECKING([for thesaurus directory])
4916 if test -n "$with_external_thes_dir"; then
4917 THES_SYSTEM_DIR=file://$with_external_thes_dir
4919 THES_SYSTEM_DIR=file:///usr/share/mythes
4921 AC_MSG_RESULT([$THES_SYSTEM_DIR])
4926 AC_SUBST(SYSTEM_DICTS)
4927 AC_SUBST(DICT_SYSTEM_DIR)
4928 AC_SUBST(HYPH_SYSTEM_DIR)
4929 AC_SUBST(THES_SYSTEM_DIR)
4931 dnl ===================================================================
4932 dnl enable pch by default on windows
4933 dnl enable it explicitly otherwise
4934 AC_MSG_CHECKING([whether to enable pch feature])
4936 if test "$enable_pch" != "no"; then
4937 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
4939 AC_MSG_RESULT([yes])
4940 elif test -n "$enable_pch" && test "$GCC" = "yes"; then
4942 AC_MSG_RESULT([yes])
4943 elif test -n "$enable_pch"; then
4944 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
4951 AC_SUBST(ENABLE_PCH)
4955 AC_MSG_CHECKING([the GNU Make version])
4956 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4957 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4958 if test "$_make_longver" -ge "038200"; then
4959 AC_MSG_RESULT([$GNUMAKE $_make_version])
4961 elif test "$_make_longver" -ge "038100"; then
4962 if test "$build_os" = "cygwin"; then
4963 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4965 AC_MSG_RESULT([$GNUMAKE $_make_version])
4967 dnl ===================================================================
4968 dnl Search all the common names for sha1sum
4969 dnl ===================================================================
4970 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
4971 if test -z "$SHA1SUM"; then
4972 AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
4973 elif test "$SHA1SUM" = "openssl"; then
4974 SHA1SUM="openssl sha1"
4976 AC_MSG_CHECKING([for GNU Make bug 20033])
4977 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4978 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
4979 A := \$(wildcard *.a)
4983 <TAB>@echo survived bug20033.
4987 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5000 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5001 <TAB>\$(call d1,\$(CHECKSUM)),\
5002 <TAB>\$(call d2,\$(CHECKSUM)))
5004 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5005 no_parallelism_make="YES"
5006 AC_MSG_RESULT([yes, disable parallelism])
5008 AC_MSG_RESULT([no, keep parallelism enabled])
5010 rm -rf $TESTGMAKEBUG20033
5012 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5015 # find if gnumake support file function
5016 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5017 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5018 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5019 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5021 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5022 \$(file >test.txt,Success )
5029 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5030 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5031 HAVE_GNUMAKE_FILE_FUNC=TRUE
5032 AC_MSG_RESULT([yes])
5036 rm -rf $TESTGMAKEFILEFUNC
5037 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5038 AC_SUBST(GNUMAKE_WIN_NATIVE)
5040 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5042 if test "$_make_ver_check" = ""; then
5046 HAVE_LD_HASH_STYLE=FALSE
5047 WITH_LINKER_HASH_STYLE=
5048 AC_MSG_CHECKING( for --hash-style gcc linker support )
5049 if test "$GCC" = "yes"; then
5050 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5051 hash_styles="gnu sysv"
5052 elif test "$with_linker_hash_style" = "no"; then
5055 hash_styles="$with_linker_hash_style"
5058 for hash_style in $hash_styles; do
5059 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5060 hash_style_ldflags_save=$LDFLAGS
5061 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5063 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5070 HAVE_LD_HASH_STYLE=TRUE
5071 WITH_LINKER_HASH_STYLE=$hash_style
5073 [HAVE_LD_HASH_STYLE=FALSE],
5074 [HAVE_LD_HASH_STYLE=FALSE])
5075 LDFLAGS=$hash_style_ldflags_save
5078 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5079 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5083 LDFLAGS=$hash_style_ldflags_save
5087 AC_SUBST(HAVE_LD_HASH_STYLE)
5088 AC_SUBST(WITH_LINKER_HASH_STYLE)
5090 dnl ===================================================================
5091 dnl Check whether there's a Perl version available.
5092 dnl ===================================================================
5093 if test -z "$with_perl_home"; then
5094 AC_PATH_PROG(PERL, perl)
5096 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5097 _perl_path="$with_perl_home/bin/perl"
5098 if test -x "$_perl_path"; then
5101 AC_MSG_ERROR([$_perl_path not found])
5105 dnl ===================================================================
5106 dnl Testing for Perl version 5 or greater.
5107 dnl $] is the Perl version variable, it is returned as an integer
5108 dnl ===================================================================
5109 if test "$PERL"; then
5110 AC_MSG_CHECKING([the Perl version])
5111 ${PERL} -e "exit($]);"
5113 if test "$_perl_version" -lt 5; then
5114 AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
5116 AC_MSG_RESULT([checked (perl $_perl_version)])
5118 AC_MSG_ERROR([Perl not found, install version 5 of Perl])
5121 dnl ===================================================================
5122 dnl Testing for required Perl modules
5123 dnl ===================================================================
5125 AC_MSG_CHECKING([for required Perl modules])
5126 if `$PERL -e 'use Cwd; use Digest::MD5'>/dev/null 2>&1`; then
5127 AC_MSG_RESULT([all modules found])
5129 AC_MSG_RESULT([failed to find some modules])
5130 # Find out which modules are missing.
5131 if ! `$PERL -e 'use Cwd;'>/dev/null 2>&1`; then
5132 missing_perl_modules="$missing_perl_modules Cwd"
5134 if ! `$PERL -e 'use Digest::MD5;'>/dev/null 2>&1`; then
5135 missing_perl_modules="$missing_perl_modules Digest::MD5"
5138 The missing Perl modules are: $missing_perl_modules
5139 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5142 dnl ===================================================================
5143 dnl Check for pkg-config
5144 dnl ===================================================================
5145 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5149 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5151 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5152 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5153 # explicitly. Or put /path/to/compiler in PATH yourself.
5155 # Use wrappers for LTO
5156 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5157 AC_CHECK_TOOL(AR,gcc-ar)
5158 AC_CHECK_TOOL(NM,gcc-nm)
5159 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5161 AC_CHECK_TOOL(AR,ar)
5162 AC_CHECK_TOOL(NM,nm)
5163 AC_CHECK_TOOL(RANLIB,ranlib)
5165 AC_CHECK_TOOL(OBJDUMP,objdump)
5166 AC_CHECK_TOOL(READELF,readelf)
5167 AC_CHECK_TOOL(STRIP,strip)
5168 if test "$_os" = "WINNT"; then
5169 AC_CHECK_TOOL(DLLTOOL,dlltool)
5170 AC_CHECK_TOOL(WINDRES,windres)
5177 AC_SUBST(PKG_CONFIG)
5183 dnl ===================================================================
5184 dnl pkg-config checks on Mac OS X
5185 dnl ===================================================================
5187 if test $_os = Darwin; then
5188 AC_MSG_CHECKING([for bogus pkg-config])
5189 if test -n "$PKG_CONFIG"; then
5190 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5191 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5193 if test "$enable_bogus_pkg_config" = "yes"; then
5194 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5196 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.])
5200 AC_MSG_RESULT([no, good])
5206 # Return value: $csctest
5210 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5211 if test -n "$regvalue"; then
5219 # Return value: $altest
5223 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5224 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5225 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5234 # Return value: $frametest (that's a silly name...)
5238 for ver in 1.1 2.0; do
5239 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv$ver
5240 if test -n "$regvalue"; then
5251 for ver in 4.6.1 4.6; do
5252 reg_get_value_64 "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5253 if test -n "$regvalue"; then
5257 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5258 if test -n "$regvalue"; then
5265 find_winsdk_version()
5267 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5268 # Return values: $winsdktest, $winsdklibsubdir
5270 unset winsdktest winsdklibsubdir
5272 # Why we look for them in this particular order I don't know. But OTOH I
5275 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5276 if test -n "$regvalue"; then
5277 winsdktest=$regvalue
5283 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5284 if test -n "$regvalue"; then
5285 winsdktest=$regvalue
5286 winsdklibsubdir=winv6.3
5291 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5292 if test -n "$regvalue"; then
5293 winsdktest=$regvalue
5294 winsdklibsubdir=win8
5299 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5300 if test -n "$regvalue"; then
5301 winsdktest=$regvalue
5302 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
5303 winsdklibsubdir=$regvalue
5312 # Args: $1 (optional) : list of acceptable SDK versions
5313 # Return value: $winsdktest
5317 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5318 find_winsdk_version $ver
5319 if test -n "$winsdktest"; then
5327 my_msm_file=Microsoft_VC${VCVER}_CRT_x86.msm
5328 AC_MSG_CHECKING([for $my_msm_file])
5330 for ver in 12.0 14.0; do
5331 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5332 if test -n "$regvalue"; then
5333 if test -e "$regvalue/$my_msm_file"; then
5339 dnl Is the following fallback really necessary, or was it added in response
5340 dnl to never having started Visual Studio on a given machine, so the
5341 dnl registry keys checked above had presumably not yet been created?
5342 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5343 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5344 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5345 dnl expanding to "C:\Program Files\Common Files"), which would need
5346 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5347 dnl obtain its value from cygwin:
5348 if test -z "$msmdir"; then
5349 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5350 if test -e "$my_msm_dir/$my_msm_file"; then
5354 if test -n "$msmdir"; then
5355 msmdir=`cygpath -m "$msmdir"`
5356 AC_MSG_RESULT([$msmdir])
5358 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5359 AC_MSG_ERROR([not found])
5361 AC_MSG_WARN([not found])
5366 find_msvc_x64_dlls()
5368 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5369 # http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-studio-14-ctp.aspx
5370 # Refactored C Runtime (CRT): This CTP contains the first preview of the substantially refactored CRT.
5371 # msvcr140.dll no longer exists. It is replaced by a trio of DLLs: vcruntime140.dll, appcrt140.dll,
5372 # and desktopcrt140.dll.
5373 if test "$VCVER" = 140; then
5374 msvcdlls="msvcp${VCVER}.dll vcruntime${VCVER}.dll"
5376 msvcdlls="msvcp${VCVER}.dll msvcr${VCVER}.dll"
5378 for dll in $msvcdlls; do
5379 if ! test -f "$msvcdllpath/$dll"; then
5380 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5385 if test "$build_os" = "cygwin"; then
5387 AC_MSG_CHECKING([for midl.exe])
5390 if test -f "$winsdktest/Bin/midl.exe"; then
5391 MIDL_PATH="$winsdktest/Bin"
5392 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5393 MIDL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5395 if test ! -f "$MIDL_PATH/midl.exe"; then
5396 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5398 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5401 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5402 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5405 AC_MSG_CHECKING([for csc.exe])
5407 if test -f "$csctest/csc.exe"; then
5410 if test ! -f "$CSC_PATH/csc.exe"; then
5411 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5413 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5416 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5419 AC_MSG_CHECKING([for al.exe])
5421 if test -f "$winsdktest/Bin/al.exe"; then
5422 AL_PATH="$winsdktest/Bin"
5423 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5424 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5427 if test -z "$AL_PATH"; then
5429 if test -f "$altest/bin/al.exe"; then
5430 AL_PATH="$altest/bin"
5431 elif test -f "$altest/al.exe"; then
5435 if test ! -f "$AL_PATH/al.exe"; then
5436 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5438 AC_MSG_RESULT([$AL_PATH/al.exe])
5441 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5443 dnl Check mscoree.lib / .NET Framework dir
5444 AC_MSG_CHECKING(.NET Framework find_dotnetsdk)
5446 if test -f "$frametest/lib/mscoree.lib"; then
5447 DOTNET_FRAMEWORK_HOME="$frametest"
5449 AC_MSG_CHECKING(.NET Framework find_winsdk)
5451 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5452 DOTNET_FRAMEWORK_HOME="$winsdktest"
5454 AC_MSG_CHECKING(.NET Framework find_dotnetsdk46)
5456 PathFormat "$frametest"
5457 frametest="$formatted_path"
5458 AC_MSG_CHECKING(found: $frametest/um/$WINDOWS_SDK_ARCH/mscoree.lib)
5459 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5460 DOTNET_FRAMEWORK_HOME="$frametest"
5465 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
5466 AC_MSG_ERROR([mscoree.lib not found])
5468 AC_MSG_RESULT(found)
5470 PathFormat "$MIDL_PATH"
5471 MIDL_PATH="$formatted_path"
5473 PathFormat "$AL_PATH"
5474 AL_PATH="$formatted_path"
5476 PathFormat "$DOTNET_FRAMEWORK_HOME"
5477 DOTNET_FRAMEWORK_HOME="$formatted_path"
5479 PathFormat "$CSC_PATH"
5480 CSC_PATH="$formatted_path"
5483 dnl ===================================================================
5484 dnl Check if stdc headers are available excluding MSVC.
5485 dnl ===================================================================
5486 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5490 dnl ===================================================================
5491 dnl Testing for C++ compiler and version...
5492 dnl ===================================================================
5494 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5495 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5496 save_CXXFLAGS=$CXXFLAGS
5498 CXXFLAGS=$save_CXXFLAGS
5500 if test -n "$CC" -a -z "$CXX"; then
5505 dnl check for GNU C++ compiler version
5506 if test "$GXX" = "yes" -a "$CXX" != "emcc"; then
5507 AC_MSG_CHECKING([the GNU C++ compiler version])
5509 _gpp_version=`$CXX -dumpversion`
5510 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5512 if test "$_gpp_majmin" -lt "401"; then
5513 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
5515 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5518 dnl see https://code.google.com/p/android/issues/detail?id=41770
5519 if test "$_gpp_majmin" -ge "401"; then
5523 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5524 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5525 #include <bits/c++config.h>]],[[
5526 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5527 && !defined(_GLIBCXX__PTHREADS) \
5528 && !defined(_GLIBCXX_HAS_GTHREADS)
5531 ]])],[AC_MSG_RESULT([yes])
5532 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5534 if test $glibcxx_threads = yes; then
5535 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5539 AC_SUBST(BOOST_CXXFLAGS)
5542 # prefx CXX with ccache if needed
5544 if test "$CCACHE" != ""; then
5545 AC_MSG_CHECKING([whether $CXX is already ccached])
5547 save_CXXFLAGS=$CXXFLAGS
5548 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5549 dnl an empty program will do, we're checking the compiler flags
5550 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5551 [use_ccache=yes], [use_ccache=no])
5552 if test $use_ccache = yes; then
5553 AC_MSG_RESULT([yes])
5558 CXXFLAGS=$save_CXXFLAGS
5562 dnl ===================================================================
5563 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5564 dnl ===================================================================
5566 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5569 dnl Check whether there's a C pre-processor.
5574 dnl ===================================================================
5575 dnl Find integral type sizes and alignments
5576 dnl ===================================================================
5578 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5580 AC_CHECK_SIZEOF(long)
5581 AC_CHECK_SIZEOF(short)
5582 AC_CHECK_SIZEOF(int)
5583 AC_CHECK_SIZEOF(long long)
5584 AC_CHECK_SIZEOF(double)
5585 AC_CHECK_SIZEOF(void*)
5587 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5588 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5589 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5590 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5591 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5593 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5594 m4_pattern_allow([AC_CHECK_ALIGNOF])
5595 m4_ifdef([AC_CHECK_ALIGNOF],
5597 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5598 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5599 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5600 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5603 case "$_os-$host_cpu" in
5605 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5606 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5607 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5608 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5611 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5612 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5613 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5614 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5617 if test -z "$ac_cv_alignof_short" -o \
5618 -z "$ac_cv_alignof_int" -o \
5619 -z "$ac_cv_alignof_long" -o \
5620 -z "$ac_cv_alignof_double"; then
5621 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.])
5627 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5628 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5629 if test $ac_cv_sizeof_long -eq 8; then
5630 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5631 elif test $ac_cv_sizeof_double -eq 8; then
5632 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5634 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5637 dnl Check for large file support
5639 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5640 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5642 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5643 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5647 SAL_TYPES_SIZEOFSHORT=2
5648 SAL_TYPES_SIZEOFINT=4
5649 SAL_TYPES_SIZEOFLONG=4
5650 SAL_TYPES_SIZEOFLONGLONG=8
5651 if test "$BITNESS_OVERRIDE" = ""; then
5652 SAL_TYPES_SIZEOFPOINTER=4
5654 SAL_TYPES_SIZEOFPOINTER=8
5656 SAL_TYPES_ALIGNMENT2=2
5657 SAL_TYPES_ALIGNMENT4=4
5658 SAL_TYPES_ALIGNMENT8=8
5661 AC_SUBST(LFS_CFLAGS)
5663 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5664 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5665 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5666 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5667 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5668 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5669 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5670 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5672 dnl ===================================================================
5673 dnl Check whether to enable runtime optimizations
5674 dnl ===================================================================
5675 ENABLE_RUNTIME_OPTIMIZATIONS=
5676 AC_MSG_CHECKING([whether to enable runtime optimizations])
5677 if test -z "$enable_runtime_optimizations"; then
5681 enable_runtime_optimizations=no
5687 if test "$enable_runtime_optimizations" != no; then
5688 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
5689 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
5690 AC_MSG_RESULT([yes])
5694 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
5696 dnl ===================================================================
5697 dnl Check if valgrind headers are available
5698 dnl ===================================================================
5700 if test "$cross_compiling" != yes; then
5701 prev_cppflags=$CPPFLAGS
5702 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5703 # or where does it come from?
5704 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5705 AC_CHECK_HEADER([valgrind/valgrind.h],
5706 [ENABLE_VALGRIND=TRUE])
5707 CPPFLAGS=$prev_cppflags
5709 AC_SUBST([ENABLE_VALGRIND])
5710 if test -z "$ENABLE_VALGRIND"; then
5713 AC_SUBST([VALGRIND_CFLAGS])
5716 dnl ===================================================================
5717 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
5718 dnl ===================================================================
5720 # We need at least the sys/sdt.h include header.
5721 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
5722 if test "$SDT_H_FOUND" = "TRUE"; then
5723 # Found sys/sdt.h header, now make sure the c++ compiler works.
5724 # Old g++ versions had problems with probes in constructors/destructors.
5725 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
5727 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5728 #include <sys/sdt.h>
5736 ProbeClass(int& v, const char *n) : ref(v), name(n)
5738 DTRACE_PROBE2(_test_, cons, name, ref);
5741 void method(int min)
5743 DTRACE_PROBE3(_test_, meth, name, ref, min);
5749 DTRACE_PROBE2(_test_, dest, name, ref);
5754 DTRACE_PROBE1(_test_, call, i);
5755 ProbeClass inst = ProbeClass(i, "call");
5757 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
5758 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
5761 AC_CONFIG_HEADERS([config_host/config_probes.h])
5763 dnl ===================================================================
5764 dnl Set the MinGW sys-root
5765 dnl ===================================================================
5766 if test "$WITH_MINGW" = "yes"; then
5767 AC_MSG_CHECKING([for MinGW sysroot])
5768 sysroot=`$CC -print-sysroot`
5769 AS_IF([test -d "$sysroot"/mingw],
5770 [MINGW_SYSROOT="$sysroot"/mingw
5771 AC_MSG_RESULT([$MINGW_SYSROOT])],
5772 [AC_MSG_RESULT([not found])
5773 AC_MSG_ERROR([cannot determine MinGW sysroot])])
5775 AC_SUBST([MINGW_DLLS])
5776 AC_SUBST([MINGW_SYSROOT])
5778 dnl ===================================================================
5779 dnl Set the MinGW include directories
5780 dnl ===================================================================
5781 if test "$WITH_MINGW" = "yes"; then
5782 AC_MSG_CHECKING([for MinGW include path])
5783 cat >conftest.$ac_ext <<_ACEOF
5785 #include <bits/c++config.h>
5787 _mingw_lib_include_path=`$CXX -E -xc++ conftest.$ac_ext | $SED -n -e '/.*1*"\(.*\)\/stddef.h".*/s//\1/p' -e '/.*1*"\(.*\)\/bits\/c++config.h".*/s//\1/p' | sort -u | xargs echo`
5789 if test -z "$_mingw_lib_include_path"; then
5790 _mingw_lib_include_path="NO_LIB_INCLUDE"
5791 AC_MSG_RESULT([no MinGW include path])
5793 AC_MSG_RESULT([$_mingw_lib_include_path])
5795 MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
5796 AC_SUBST(MINGW_LIB_INCLUDE_PATH)
5800 AC_MSG_CHECKING([for dynamic libgcc])
5801 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5803 using namespace std;
5804 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
5805 MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
5806 if test -n "$MINGW_GCCDLL"; then
5807 MINGW_SHARED_GCCLIB=TRUE
5808 AC_MSG_RESULT([ $MINGW_GCCDLL])
5810 MINGW_SHARED_GCCLIB=
5813 ],[ AC_MSG_RESULT([no])
5817 AC_MSG_CHECKING([for dynamic libstdc++])
5818 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5820 using namespace std;
5821 ]], [[ cout << "Hello there." << endl; ]])],[
5822 MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
5823 if test -n "$MINGW_GXXDLL"; then
5824 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
5825 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
5826 if test "$CROSS_COMPILING" = "TRUE"; then
5828 mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
5830 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
5831 MINGW_SHARED_GXXLIB=TRUE
5832 AC_MSG_RESULT([$MINGW_GXXDLL])
5834 MINGW_SHARED_GXXLIB=
5837 ],[ AC_MSG_RESULT([no])
5843 AC_SUBST(MINGW_SHARED_GCCLIB)
5844 AC_SUBST(MINGW_SHARED_GXXLIB)
5845 AC_SUBST(MINGW_SHARED_LIBSTDCPP)
5846 AC_SUBST(MINGW_GCCDLL)
5847 AC_SUBST(MINGW_GXXDLL)
5850 dnl *************************************************************
5851 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
5852 dnl *************************************************************
5853 if test "$WITH_MINGW" = "yes"; then
5854 AC_MSG_CHECKING([exception type])
5856 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
5858 extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
5860 ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
5862 AC_MSG_RESULT($exceptions_type)
5866 EXCEPTIONS="$exceptions_type"
5867 AC_SUBST(EXCEPTIONS)
5869 dnl ===================================================================
5870 dnl thread-safe statics
5871 dnl ===================================================================
5872 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
5873 unset HAVE_THREADSAFE_STATICS
5874 if test "$GCC" = "yes"; then
5875 dnl -fthreadsafe-statics is available since GCC 4, so always available for
5876 dnl us. However, some C++ runtimes use a single lock for all static
5877 dnl variables, which can cause deadlock in multi-threaded applications.
5878 dnl This is not easily tested here; for POSIX-based systems, if executing
5879 dnl the following C++ program does not terminate then the tool chain
5880 dnl apparently has this problem:
5882 dnl #include <pthread.h>
5883 dnl int h() { return 0; }
5884 dnl void * g(void * unused) {
5885 dnl static int n = h();
5890 dnl pthread_create(&t, 0, g, 0);
5891 dnl pthread_join(t, 0);
5895 dnl static int n = f();
5899 dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
5900 dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
5901 dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
5902 dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
5903 dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
5904 dnl difference there. Conservative advice from Jakub Jelinek is to assume
5905 dnl it working in GCC >= 4.3, so conservative way to check here is to use
5906 dnl GCC_VERSION for GCC but resort to __GLIBCXX__ corresponding to libstdc++
5907 dnl shipped with GCC 4.3.0 (cf. <http://gcc.gnu.org/onlinedocs/libstdc++/
5908 dnl manual/abi.html#abi.versioning.history>; 4.3.0 is 20080306, 4.2.4 is
5909 dnl 20080519, 4.3.1 is 20080606) for Clang (for which GCC_VERSION is notoriously
5911 if test "$_os" = Darwin; then
5912 dnl On Mac OS X, both /usr/lib/libstdc++.6.dylib and
5913 dnl /usr/lib/libc++1.dylib delegate to /usr/lib/libc++abi.dylib for the
5914 dnl __cxa_guard_* functionality; up to 10.8, libc++abi.dylib is
5915 dnl apparently provided by a libcppabi project that has broken semantics
5916 dnl (cf. <http://www.opensource.apple.com/source/libcppabi/libcppabi-26/
5917 dnl src/cxa_guard.cxx>), while in 10.9 (verified at least on 10.9.4) it
5918 dnl is apparently provided by LLVM's libcxxabi project, which has good
5919 dnl semantics (cf. <http://llvm.org/svn/llvm-project/libcxxabi/trunk/
5920 dnl src/cxa_guard.cpp>):
5921 if test "$MAC_OS_X_VERSION_MIN_REQUIRED" -ge 1090; then
5922 HAVE_THREADSAFE_STATICS=TRUE
5924 elif test "$_os" != Android; then
5925 if test "$COM_IS_CLANG" = TRUE; then
5927 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5929 #if defined __GLIBCXX__
5930 #if __GLIBCXX__ < 20080606 && __GLIBCXX__ != 20080306
5934 ]])],[HAVE_THREADSAFE_STATICS=TRUE],[])
5936 else # known to work in GCC since version 4.3
5937 HAVE_THREADSAFE_STATICS=TRUE
5940 if test "$HAVE_THREADSAFE_STATICS" = TRUE; then
5941 AC_DEFINE(HAVE_THREADSAFE_STATICS)
5942 AC_MSG_RESULT([yes])
5944 AC_MSG_RESULT([broken (i.e., no)])
5947 # MSVC has sprouted C++11 thread-safe statics in 2015
5948 # http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
5949 if test "$COM" = "MSC" -a "$VCVER" -ge "140"; then
5950 AC_DEFINE(HAVE_THREADSAFE_STATICS)
5951 AC_MSG_RESULT([yes])
5956 AC_SUBST(HAVE_THREADSAFE_STATICS)
5958 dnl ===================================================================
5959 dnl visibility and other gcc features
5960 dnl ===================================================================
5961 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
5962 if test "$COM" != MSC; then
5963 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
5965 CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
5966 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
5968 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5969 AC_MSG_RESULT([yes])
5971 AC_MSG_ERROR([no This is no longer supported.])
5975 AC_MSG_CHECKING([whether $CC supports -mno-avx])
5977 CFLAGS="$CFLAGS -Werror -mno-avx"
5978 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5980 if test "$HAVE_GCC_AVX" = "TRUE"; then
5981 AC_MSG_RESULT([yes])
5986 AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong])
5988 CFLAGS="$CFLAGS -Werror -fstack-protector-strong"
5989 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
5991 if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
5992 AC_MSG_RESULT([yes])
5997 AC_MSG_CHECKING([whether $CC supports atomic functions])
5998 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6000 if (__sync_add_and_fetch(&v, 1) != 1 ||
6001 __sync_sub_and_fetch(&v, 1) != 0)
6003 __sync_synchronize();
6004 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6008 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6009 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6010 AC_MSG_RESULT([yes])
6011 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6016 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
6018 CFLAGS="$CFLAGS -Werror"
6019 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6020 __attribute__((deprecated("test"))) void f();
6022 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6023 AC_MSG_RESULT([yes])
6024 ], [AC_MSG_RESULT([no])])
6027 AC_MSG_CHECKING([whether $CXX defines __base_class_type_info in cxxabi.h])
6029 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6032 std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
6034 AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
6035 AC_MSG_RESULT([yes])
6036 ], [AC_MSG_RESULT([no])])
6039 AC_MSG_CHECKING([whether $CXX defines __class_type_info in cxxabi.h])
6041 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6044 std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
6046 AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
6047 AC_MSG_RESULT([yes])
6048 ], [AC_MSG_RESULT([no])])
6051 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
6053 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6055 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6057 AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6058 AC_MSG_RESULT([yes])
6059 ], [AC_MSG_RESULT([no])])
6062 AC_MSG_CHECKING([whether $CXX defines __cxa_eh_globals in cxxabi.h])
6064 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6067 std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
6069 AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
6070 AC_MSG_RESULT([yes])
6071 ], [AC_MSG_RESULT([no])])
6074 AC_MSG_CHECKING([whether $CXX defines __cxa_exceptions in cxxabi.h])
6076 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6079 std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
6081 AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
6082 AC_MSG_RESULT([yes])
6083 ], [AC_MSG_RESULT([no])])
6086 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
6088 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6090 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6092 AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
6093 AC_MSG_RESULT([yes])
6094 ], [AC_MSG_RESULT([no])])
6097 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6099 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6101 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6103 AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
6104 AC_MSG_RESULT([yes])
6105 ], [AC_MSG_RESULT([no])])
6108 AC_MSG_CHECKING([whether $CXX defines __si_class_type_info in cxxabi.h])
6110 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6113 std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
6115 AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
6116 AC_MSG_RESULT([yes])
6117 ], [AC_MSG_RESULT([no])])
6120 AC_MSG_CHECKING([whether $CXX defines __vmi_class_type_info in cxxabi.h])
6122 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6125 std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
6127 AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
6128 AC_MSG_RESULT([yes])
6129 ], [AC_MSG_RESULT([no])])
6132 AC_MSG_CHECKING([whether STL uses __attribute__((warn_unused))])
6134 save_CXXFLAGS=$CXXFLAGS
6135 CXXFLAGS="$CXXFLAGS -Werror -Wunused"
6136 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6138 void f() { std::string s; }
6142 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED_STL],[1])
6143 AC_MSG_RESULT([yes])])
6144 CXXFLAGS=$save_CXXFLAGS
6148 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6150 save_CXXFLAGS=$CXXFLAGS
6151 CXXFLAGS="$CXXFLAGS -Werror -Wunknown-pragmas"
6152 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6153 struct __attribute__((warn_unused)) dummy {};
6155 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6156 AC_MSG_RESULT([yes])
6157 ], [AC_MSG_RESULT([no])])
6158 CXXFLAGS=$save_CXXFLAGS
6161 AC_SUBST(HAVE_GCC_AVX)
6162 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
6163 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6165 dnl ===================================================================
6166 dnl Identify the C++ library
6167 dnl ===================================================================
6169 AC_MSG_CHECKING([What the C++ library is])
6171 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6177 [CPP_LIBRARY=GLIBCXX
6178 cpp_library_name="GNU libstdc++"
6180 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6182 #ifndef _LIBCPP_VERSION
6187 cpp_library_name="LLVM libc++"
6189 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6196 cpp_library_name="Microsoft"
6198 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6199 AC_MSG_RESULT([$cpp_library_name])
6202 dnl ===================================================================
6204 dnl ===================================================================
6207 if test "$COM" = MSC; then
6208 AC_MSG_CHECKING([whether $CXX supports C++11])
6210 # MSVC supports (a subset of) CXX11 without any switch
6211 elif test "$GCC" = "yes"; then
6213 AC_MSG_CHECKING([whether $CXX supports C++14 or C++11])
6214 for flag in -std=gnu++14 -std=gnu++1y -std=c++14 -std=c++1y -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
6215 save_CXXFLAGS=$CXXFLAGS
6216 CXXFLAGS="$CXXFLAGS $flag -Werror"
6218 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6219 #include <algorithm>
6220 #include <functional>
6222 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6223 std::sort(v.begin(), v.end(), fn);
6225 ]])],[CXXFLAGS_CXX11=$flag])
6227 CXXFLAGS=$save_CXXFLAGS
6228 if test -n "$CXXFLAGS_CXX11"; then
6233 if test "$HAVE_CXX11" = TRUE; then
6234 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6240 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6241 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6242 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6243 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6244 dnl again towards 4.7.2:
6245 if test $CPP_LIBRARY = GLIBCXX; then
6246 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6248 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6250 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6251 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6252 // GCC 4.7.0: 20120322
6253 // GCC 4.7.1: 20120614
6254 // and using a range check is not possible as the mapping between
6255 // __GLIBCXX__ values and GCC versions is not monotonic
6260 ]])], [AC_MSG_RESULT(no, ok)],
6261 [AC_MSG_ERROR(yes)])
6265 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6266 save_CXXFLAGS=$CXXFLAGS
6267 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6270 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6273 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6289 a thinga[]={{0,0}, {1,1}};
6290 b thingb[]={{0,0}, {1,1}};
6291 size_t i = sizeof(sal_n_array_size(thinga));
6292 size_t j = sizeof(sal_n_array_size(thingb));
6293 return !(i != 0 && j != 0);
6295 ], [ AC_MSG_RESULT(yes) ],
6296 [ AC_MSG_ERROR(no)])
6298 CXXFLAGS=$save_CXXFLAGS
6300 AC_MSG_CHECKING([whether $CXX supports C++11 without __float128 compile error])
6301 save_CXXFLAGS=$CXXFLAGS
6302 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6305 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6307 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6310 ],[ AC_MSG_RESULT(yes) ],
6313 # The only reason why libstdc++ headers fail with Clang in C++11 mode is because
6314 # they use the __float128 type that Clang doesn't know (libstdc++ checks whether
6315 # __float128 is available during its build, but it's usually built using GCC,
6316 # and so c++config.h hardcodes __float128 being supported). As the only place
6317 # where __float128 is actually used is in a template specialization,
6318 # -D__float128=void will avoid the problem there while still causing a problem
6319 # if somebody actually uses the type.
6320 AC_MSG_CHECKING([whether -D__float128=void workaround helps])
6321 CXXFLAGS="$CXXFLAGS -D__float128=void"
6322 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6324 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6330 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -D__float128=void"
6338 CXXFLAGS=$save_CXXFLAGS
6340 AC_SUBST(CXXFLAGS_CXX11)
6342 AC_MSG_CHECKING([whether $CXX supports C++11 constexpr])
6343 save_CXXFLAGS=$CXXFLAGS
6344 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6346 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6349 constexpr S(int n): n_(n) {}
6351 ]])], [cxx11_constexpr=yes], [cxx11_constexpr=no])
6353 CXXFLAGS=$save_CXXFLAGS
6354 AC_MSG_RESULT([$cxx11_constexpr])
6355 if test "$cxx11_constexpr" = yes; then
6356 AC_DEFINE([HAVE_CXX11_CONSTEXPR])
6359 AC_MSG_CHECKING([whether $CXX supports C++14 constexpr])
6360 save_CXXFLAGS=$CXXFLAGS
6361 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6363 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6364 // A somewhat over-complicated way of checking for
6365 // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "ICE using __func__
6366 // in constexpr function":
6368 template<typename T> inline constexpr T f(T x) { return x; }
6369 template<typename T> inline constexpr T g(T x) {
6370 assert(f(static_cast<int>(x)));
6378 constexpr bool f() {
6381 while (n > 0) { --n; ++i; }
6385 ]])], [cxx14_constexpr=yes], [cxx14_constexpr=no])
6387 CXXFLAGS=$save_CXXFLAGS
6388 AC_MSG_RESULT([$cxx14_constexpr])
6389 if test "$cxx14_constexpr" = yes; then
6390 AC_DEFINE([HAVE_CXX14_CONSTEXPR])
6393 AC_MSG_CHECKING([whether $CXX supports C++11 ref-qualifier])
6394 save_CXXFLAGS=$CXXFLAGS
6395 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6397 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6402 ]])], [cxx11_ref_qualifier=yes], [cxx11_ref_qualifier=no])
6404 CXXFLAGS=$save_CXXFLAGS
6405 AC_MSG_RESULT([$cxx11_ref_qualifier])
6406 if test "$cxx11_ref_qualifier" = yes; then
6407 AC_DEFINE([HAVE_CXX11_REF_QUALIFIER])
6410 AC_MSG_CHECKING([whether $CXX supports C++11 char16_t string literals])
6411 save_CXXFLAGS=$CXXFLAGS
6412 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6414 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6416 ]])], [cxx11_utf16_string_literal=yes], [cxx11_utf16_string_literal=no])
6418 CXXFLAGS=$save_CXXFLAGS
6419 AC_MSG_RESULT([$cxx11_utf16_string_literal])
6420 if test "$cxx11_utf16_string_literal" = yes; then
6421 AC_DEFINE([HAVE_CXX11_UTF16_STRING_LITERAL])
6424 AC_MSG_CHECKING([whether $CXX supports C++14 sized deallocation])
6425 dnl At least Clang -fsanitize=address causes "multiple definition of
6426 dnl `operator delete(void*, unsigned long)'" also defined in
6427 dnl projects/compiler-rt/lib/asan/asan_new_delete.cc:
6429 if test "$COM_IS_CLANG" = TRUE; then
6442 save_CXXFLAGS=$CXXFLAGS
6443 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6445 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
6448 void operator delete(void *) throw () { std::exit(1); }
6449 void operator delete(void *, std::size_t) throw () { std::exit(0); }
6450 struct S { S() { throw 0; } };
6452 try { new S; } catch (...) {}
6454 ]])], [cxx14_sized_deallocation=yes], [cxx14_sized_deallocation=no], [cxx14_sized_deallocation=no])
6457 CXXFLAGS=$save_CXXFLAGS
6458 AC_MSG_RESULT([$cxx14_sized_deallocation])
6459 if test "$cxx14_sized_deallocation" = yes; then
6460 AC_DEFINE([HAVE_CXX14_SIZED_DEALLOCATION])
6463 HAVE_GCC_PRAGMA_OPERATOR=
6464 dnl _Pragma support (may require C++11)
6465 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6466 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6468 save_CXXFLAGS=$CXXFLAGS
6469 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6470 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6471 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6473 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6474 HAVE_GCC_PRAGMA_OPERATOR=1
6475 AC_MSG_RESULT([yes])
6476 ], [AC_MSG_RESULT([no])])
6478 CXXFLAGS=$save_CXXFLAGS
6480 AC_SUBST(HAVE_GCC_PRAGMA_OPERATOR)
6482 HAVE_GCC_FNO_FNO_SIZED_DEALLOCATION=
6483 if test "$GCC" = yes; then
6484 AC_MSG_CHECKING([whether $CXX supports -fno-sized-deallocation])
6486 save_CXXFLAGS=$CXXFLAGS
6487 CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
6488 AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
6489 CXXFLAGS=$save_CXXFLAGS
6491 if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
6492 AC_MSG_RESULT([yes])
6497 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
6499 dnl ===================================================================
6500 dnl system stl sanity tests
6501 dnl ===================================================================
6502 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
6506 save_CPPFLAGS="$CPPFLAGS"
6507 if test -n "$MACOSX_SDK_PATH"; then
6508 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6511 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6513 if test "$CPP_LIBRARY" = GLIBCXX; then
6514 dnl gcc#19664, gcc#22482, rhbz#162935
6515 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6516 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6517 AC_MSG_RESULT([$stlvisok])
6518 if test "$stlvisok" = "no"; then
6519 AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
6523 sharedlink_ldflags_save=$LDFLAGS
6524 LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
6526 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
6527 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6529 using namespace std;
6531 istringstream strm( "test" ); return 0;
6533 # Ugh, surely bad to assume an error message will contain
6534 # the word "unresolvable", a problem with
6535 # -fvisibility-inlines-hidden and STL headers might cause
6536 # some more obscure message on some platform, and anway,
6537 # the error message could be localised.
6538 [$EGREP -q unresolvable conftest.err;
6539 if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
6541 AC_MSG_RESULT([$gccvisok])
6542 if test "$gccvisok" = "no"; then
6543 AC_MSG_ERROR([Your gcc is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6546 LDFLAGS=$sharedlink_ldflags_save
6548 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6549 # when we don't make any dynamic libraries?
6550 if test "$DISABLE_DYNLOADING" = ""; then
6551 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6552 cat > conftestlib1.cc <<_ACEOF
6553 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6554 struct S2: S1<int> { virtual ~S2(); };
6557 cat > conftestlib2.cc <<_ACEOF
6558 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6559 struct S2: S1<int> { virtual ~S2(); };
6560 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6562 gccvisinlineshiddenok=yes
6563 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6564 gccvisinlineshiddenok=no
6566 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6567 dnl known to not work with -z defs (unsetting which makes the test
6569 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6570 if test "$COM_IS_CLANG" = TRUE; then
6574 my_linkflagsnoundefs=
6580 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6581 gccvisinlineshiddenok=no
6586 AC_MSG_RESULT([$gccvisinlineshiddenok])
6587 if test "$gccvisinlineshiddenok" = "no"; then
6588 AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
6592 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6593 cat >visibility.cxx <<_ACEOF
6594 #pragma GCC visibility push(hidden)
6595 struct __attribute__ ((visibility ("default"))) TestStruct {
6598 __attribute__ ((visibility ("default"))) void TestFunc() {
6602 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
6607 if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
6610 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
6622 rm -f visibility.s visibility.cxx
6624 AC_MSG_RESULT([$gccvisbroken])
6625 if test "$gccvisbroken" = "yes"; then
6626 AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
6629 CPPFLAGS="$save_CPPFLAGS"
6634 dnl ===================================================================
6636 dnl ===================================================================
6638 HAVE_GCC_FNO_DEFAULT_INLINE=
6639 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6640 if test "$GCC" = "yes"; then
6641 AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
6642 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6643 # Option just ignored and silly warning that isn't a real
6648 save_CXXFLAGS=$CXXFLAGS
6649 CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
6650 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
6651 CXXFLAGS=$save_CXXFLAGS
6654 if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
6655 AC_MSG_RESULT([yes])
6660 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6661 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6666 save_CXXFLAGS=$CXXFLAGS
6667 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6668 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6669 CXXFLAGS=$save_CXXFLAGS
6672 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6673 AC_MSG_RESULT([yes])
6678 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
6679 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6681 dnl ===================================================================
6682 dnl Compiler plugins
6683 dnl ===================================================================
6686 # currently only Clang
6687 if test "$COM_IS_CLANG" = "TRUE"; then
6688 if test -n "$enable_compiler_plugins"; then
6689 compiler_plugins="$enable_compiler_plugins"
6690 elif test -n "$ENABLE_DBGUTIL"; then
6691 compiler_plugins=test
6695 if test "$compiler_plugins" != "no"; then
6696 dnl The prefix where Clang resides, override to where Clang resides if
6697 dnl using a source build:
6698 if test -z "$CLANGDIR"; then
6702 save_CPPFLAGS=$CPPFLAGS
6704 # compiler plugins must be built with "native" bitness of clang
6705 # because they link against clang libraries
6706 CXX=${COMPILER_PLUGINS_CXX-$(echo $CXX | sed -e s/-m64// -e s/-m32//)}
6707 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
6708 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
6709 [COMPILER_PLUGINS=TRUE],
6711 if test "$compiler_plugins" = "yes"; then
6712 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
6714 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
6715 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
6719 CPPFLAGS=$save_CPPFLAGS
6723 if test "$enable_compiler_plugins" = "yes"; then
6724 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
6727 AC_SUBST(COMPILER_PLUGINS)
6728 AC_SUBST(COMPILER_PLUGINS_CXX)
6731 # Plugin to help linker.
6732 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
6733 # This makes --enable-lto build with clang work.
6736 dnl ===================================================================
6738 dnl ===================================================================
6739 AC_MSG_CHECKING([which memory allocator to use])
6740 if test "$with_alloc" = "system"; then
6741 AC_MSG_RESULT([system])
6744 if test "$with_alloc" = "tcmalloc"; then
6745 AC_MSG_RESULT(tcmalloc)
6746 if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
6747 AC_MSG_ERROR([tcmalloc only available/usable on ix86])
6749 AC_CHECK_LIB([tcmalloc], [malloc], [:],
6750 [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
6753 if test "$with_alloc" = "jemalloc"; then
6754 if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
6755 AC_MSG_RESULT(jemalloc)
6757 CFLAGS="$CFLAGS -pthread"
6758 AC_CHECK_LIB([jemalloc], [malloc], [:],
6759 [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
6763 AC_MSG_RESULT([system])
6767 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
6768 AC_MSG_RESULT([internal])
6770 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6771 AC_SUBST(HAVE_POSIX_FALLOCATE)
6774 dnl ===================================================================
6775 dnl Custom build version
6776 dnl ===================================================================
6778 AC_MSG_CHECKING([whether to add custom build version])
6779 if test "$with_build_version" != ""; then
6780 BUILD_VER_STRING=$with_build_version
6781 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6786 AC_SUBST(BUILD_VER_STRING)
6788 JITC_PROCESSOR_TYPE=""
6789 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6790 # IBMs JDK needs this...
6791 JITC_PROCESSOR_TYPE=6
6792 export JITC_PROCESSOR_TYPE
6794 AC_SUBST([JITC_PROCESSOR_TYPE])
6796 # Misc Windows Stuff
6797 if test $_os = "WINNT" -a "$WITH_MINGW" != yes; then
6800 MSVC_DLL_PATH="$msvcdllpath"
6801 MSVC_DLLS="$msvcdlls"
6803 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6806 AC_SUBST(MSVC_DLL_PATH)
6810 dnl ===================================================================
6812 dnl ===================================================================
6813 if test "$ENABLE_JAVA" != ""; then
6815 # Windows-specific tests
6816 if test "$build_os" = "cygwin"; then
6817 if test "$BITNESS_OVERRIDE" = 64; then
6823 if test -z "$with_jdk_home"; then
6824 for ver in 1.8 1.7 1.6; do
6825 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
6826 if test -n "$regvalue"; then
6831 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
6832 with_jdk_home="$_jdk_home"
6833 howfound="found automatically"
6835 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
6838 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
6839 howfound="you passed"
6843 # 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.
6844 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
6845 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
6846 with_jdk_home=`/usr/libexec/java_home`
6849 JAVA_HOME=; export JAVA_HOME
6850 if test -z "$with_jdk_home"; then
6851 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
6853 _java_path="$with_jdk_home/bin/$with_java"
6854 dnl Check if there is a Java interpreter at all.
6855 if test -x "$_java_path"; then
6856 JAVAINTERPRETER=$_java_path
6858 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
6862 dnl Check that the JDK found is correct architecture (at least 2 reasons to
6863 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
6864 dnl loaded by java to run JunitTests:
6865 if test "$build_os" = "cygwin"; then
6866 shortjdkhome=`cygpath -d "$with_jdk_home"`
6867 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
6868 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
6869 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6870 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
6871 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6872 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6875 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6876 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6878 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
6879 elif test "$cross_compiling" != "yes"; then
6881 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
6882 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
6883 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
6884 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6887 *) # assumption: everything else 32-bit
6888 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
6889 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6890 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6898 dnl ===================================================================
6900 dnl ===================================================================
6902 # Note that JAVA_HOME as for now always means the *build* platform's
6903 # JAVA_HOME. Whether all the complexity here actually is needed any
6904 # more or not, no idea.
6906 if test "$ENABLE_JAVA" != ""; then
6908 AC_MSG_CHECKING([the installed JDK])
6909 if test -n "$JAVAINTERPRETER"; then
6910 dnl java -version sends output to stderr!
6911 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6912 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6913 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6914 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6915 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6916 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6917 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6920 dnl IBM JDK specific tests
6921 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6922 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6924 if test "$_jdk_ver" -lt 10600; then
6925 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.6])
6928 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6930 if test "$with_jdk_home" = ""; then
6931 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6932 you must use the "--with-jdk-home" configure option explicitly])
6935 JAVA_HOME=$with_jdk_home
6939 dnl Sun JDK specific tests
6940 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6941 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6943 if test "$_jdk_ver" -lt 10600; then
6944 AC_MSG_ERROR([JDK is too old, you need at least 1.6])
6946 if test "$_jdk_ver" -gt 10600; then
6947 JAVA_CLASSPATH_NOT_SET="1"
6949 if test "$_jdk_ver" -ge 10900; then
6953 AC_MSG_RESULT([checked (JDK $_jdk)])
6954 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6955 if test "$_os" = "WINNT"; then
6956 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6959 # set to limit VM usage for JunitTests
6961 # set to limit VM usage for javac
6962 JAVAFLAGS=-J-Xmx128M
6965 AC_MSG_ERROR([Java not found. You need at least jdk-1.6])
6973 dnl ===================================================================
6974 dnl Set target Java bytecode version
6975 dnl ===================================================================
6976 if test "$ENABLE_JAVA" != ""; then
6977 if test "$HAVE_JAVA9" = "TRUE"; then
6978 _java_target_ver="1.6"
6980 _java_target_ver="1.5"
6982 JAVA_SOURCE_VER="$_java_target_ver"
6983 JAVA_TARGET_VER="$_java_target_ver"
6986 dnl ===================================================================
6987 dnl Checks for javac
6988 dnl ===================================================================
6989 if test "$ENABLE_JAVA" != ""; then
6990 javacompiler="javac"
6991 if test -z "$with_jdk_home"; then
6992 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
6994 _javac_path="$with_jdk_home/bin/$javacompiler"
6995 dnl Check if there is a Java compiler at all.
6996 if test -x "$_javac_path"; then
6997 JAVACOMPILER=$_javac_path
7000 if test -z "$JAVACOMPILER"; then
7001 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7003 if test "$build_os" = "cygwin"; then
7004 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7005 JAVACOMPILER="${JAVACOMPILER}.exe"
7007 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7011 dnl ===================================================================
7012 dnl Checks for javadoc
7013 dnl ===================================================================
7014 if test "$ENABLE_JAVA" != ""; then
7015 if test -z "$with_jdk_home"; then
7016 AC_PATH_PROG(JAVADOC, javadoc)
7018 _javadoc_path="$with_jdk_home/bin/javadoc"
7019 dnl Check if there is a javadoc at all.
7020 if test -x "$_javadoc_path"; then
7021 JAVADOC=$_javadoc_path
7023 AC_PATH_PROG(JAVADOC, javadoc)
7026 if test -z "$JAVADOC"; then
7027 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7029 if test "$build_os" = "cygwin"; then
7030 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7031 JAVADOC="${JAVADOC}.exe"
7033 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7036 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7037 JAVADOCISGJDOC="yes"
7040 AC_SUBST(JAVADOCISGJDOC)
7042 if test "$ENABLE_JAVA" != ""; then
7043 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7044 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7045 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7046 # try to recover first by looking whether we have a alternatives
7047 # system as in Debian or newer SuSEs where following /usr/bin/javac
7048 # over /etc/alternatives/javac leads to the right bindir where we
7049 # just need to strip a bit away to get a valid JAVA_HOME
7050 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7051 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7052 # maybe only one level of symlink (e.g. on Mac)
7053 JAVA_HOME=$(readlink $JAVACOMPILER)
7054 if test "$(dirname $JAVA_HOME)" = "."; then
7055 # we've got no path to trim back
7060 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7061 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7062 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7063 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7065 dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
7066 if test "$JAVA_HOME" != "/usr"; then
7067 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7068 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7069 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7070 dnl Tiger already returns a JDK path..
7071 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7073 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7074 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
7075 dnl that checks which version to run
7076 if test -f "$JAVA_HOME"; then
7077 JAVA_HOME=""; # set JAVA_HOME to null if it's a file
7082 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7084 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7085 if test -z "$JAVA_HOME"; then
7086 if test "x$with_jdk_home" = "x"; then
7087 cat > findhome.java <<_ACEOF
7088 [import java.io.File;
7092 public static void main(String args[])
7094 String jrelocation = System.getProperty("java.home");
7095 File jre = new File(jrelocation);
7096 System.out.println(jre.getParent());
7100 AC_MSG_CHECKING([if javac works])
7101 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7102 AC_TRY_EVAL(javac_cmd)
7103 if test $? = 0 -a -f ./findhome.class; then
7104 AC_MSG_RESULT([javac works])
7106 echo "configure: javac test failed" >&5
7107 cat findhome.java >&5
7108 AC_MSG_ERROR([javac does not work - java projects will not build!])
7110 AC_MSG_CHECKING([if gij knows its java.home])
7111 JAVA_HOME=`$JAVAINTERPRETER findhome`
7112 if test $? = 0 -a "$JAVA_HOME" != ""; then
7113 AC_MSG_RESULT([$JAVA_HOME])
7115 echo "configure: java test failed" >&5
7116 cat findhome.java >&5
7117 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7119 # clean-up after ourselves
7120 rm -f ./findhome.java ./findhome.class
7122 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7126 # now check if $JAVA_HOME is really valid
7127 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7128 case "${JAVA_HOME}" in
7129 /Library/Java/JavaVirtualMachines/*)
7132 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
7135 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7138 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7141 if test "$JAVA_HOME_OK" = "NO"; then
7142 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7143 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7144 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
7145 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7146 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7147 add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
7149 PathFormat "$JAVA_HOME"
7150 JAVA_HOME="$formatted_path"
7153 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7156 AC_MSG_CHECKING([for JAWT lib])
7157 if test "$_os" = WINNT; then
7158 if test "$WITH_MINGW" = yes; then
7159 # The path is taken care of in gb_LinkTarget__use_jawt
7160 # in RepositoryExternal.mk:
7163 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7169 AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
7170 JAVA_ARCH=$my_java_arch
7185 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7186 JAVA_ARCH=$my_java_arch
7189 my_java_arch=sparcv9
7195 my_java_arch=$host_cpu
7198 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7199 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7201 AC_MSG_RESULT([$JAWTLIB])
7205 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7209 JAVAINC="-I$JAVA_HOME/include"
7210 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7211 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7215 JAVAINC="-I$JAVA_HOME/include/win32"
7216 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7220 if test -d "$JAVA_HOME/include/darwin"; then
7221 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7223 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7228 JAVAINC="-I$JAVA_HOME/include"
7229 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7233 JAVAINC="-I$JAVA_HOME/include"
7234 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7235 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7236 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7237 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7241 JAVAINC="-I$JAVA_HOME/include"
7242 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7243 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7247 JAVAINC="-I$JAVA_HOME/include"
7248 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7249 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7253 JAVAINC="-I$JAVA_HOME/include"
7257 JAVAINC="-I$JAVA_HOME/include"
7258 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7259 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7263 JAVAINC="-I$JAVA_HOME/include"
7264 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7265 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7269 JAVAINC="-I$JAVA_HOME/include"
7270 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7271 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7275 SOLARINC="$SOLARINC $JAVAINC"
7277 AC_SUBST(JAVACOMPILER)
7279 AC_SUBST(JAVAINTERPRETER)
7280 AC_SUBST(JAVAIFLAGS)
7282 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7284 AC_SUBST(JAVA_SOURCE_VER)
7285 AC_SUBST(JAVA_TARGET_VER)
7289 dnl ===================================================================
7290 dnl Export file validation
7291 dnl ===================================================================
7292 AC_MSG_CHECKING([whether to enable export file validation])
7293 if test "$with_export_validation" = yes; then
7294 if test -z "$ENABLE_JAVA"; then
7295 AC_MSG_RESULT([no, as Java is disabled])
7297 AC_MSG_RESULT([yes])
7298 AC_DEFINE(HAVE_EXPORT_VALIDATION)
7300 AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
7301 if test -z "$ODFVALIDATOR"; then
7302 # remember to download the ODF toolkit with validator later
7303 AC_MSG_NOTICE([no odfvalidator found, will download it])
7304 BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
7305 ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
7307 # and fetch name of odfvalidator jar name from download.lst
7308 ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7309 AC_SUBST(ODFVALIDATOR_JAR)
7311 if test -z "$ODFVALIDATOR_JAR"; then
7312 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
7315 if test "$build_os" = "cygwin"; then
7316 # In case of CygWin it will be executed from Windows,
7317 # so we need to run bash and absolute path to validator
7318 # so instead of "odfvalidator" it will be
7319 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7320 ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
7322 ODFVALIDATOR="sh $ODFVALIDATOR"
7324 AC_SUBST(ODFVALIDATOR)
7327 AC_PATH_PROGS(OFFICEOTRON, officeotron)
7328 if test -z "$OFFICEOTRON"; then
7329 # remember to download the officeotron with validator later
7330 AC_MSG_NOTICE([no officeotron found, will download it])
7331 BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
7332 OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
7334 # and fetch name of officeotron jar name from download.lst
7335 OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
7336 AC_SUBST(OFFICEOTRON_JAR)
7338 if test -z "$OFFICEOTRON_JAR"; then
7339 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
7342 # check version of existing officeotron
7343 OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
7344 if test 0"$OFFICEOTRON_VER" -lt 704; then
7345 AC_MSG_ERROR([officeotron too old])
7348 if test "$build_os" = "cygwin"; then
7349 # In case of CygWin it will be executed from Windows,
7350 # so we need to run bash and absolute path to validator
7351 # so instead of "odfvalidator" it will be
7352 # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
7353 OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
7355 OFFICEOTRON="sh $OFFICEOTRON"
7358 AC_SUBST(OFFICEOTRON)
7363 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
7364 if test "$with_bffvalidator" != "no"; then
7365 AC_DEFINE(HAVE_BFFVALIDATOR)
7367 if test "$with_export_validation" != "yes"; then
7368 AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
7371 if test "$with_bffvalidator" = "yes"; then
7372 BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
7374 BFFVALIDATOR="$with_bffvalidator"
7377 if test "$build_os" = "cygwin"; then
7378 if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
7379 AC_MSG_RESULT($BFFVALIDATOR)
7381 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7383 elif test -n "$BFFVALIDATOR"; then
7384 # We are not in CygWin but need to run Windows binary with wine
7385 AC_PATH_PROGS(WINE, wine)
7387 # so swap in a shell wrapper that converts paths transparently
7388 BFFVALIDATOR_EXE="$BFFVALIDATOR"
7389 BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
7390 AC_SUBST(BFFVALIDATOR_EXE)
7391 AC_MSG_RESULT($BFFVALIDATOR)
7393 AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
7395 AC_SUBST(BFFVALIDATOR)
7400 dnl ===================================================================
7401 dnl Check for C preprocessor to use
7402 dnl ===================================================================
7403 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7404 if test -n "$with_idlc_cpp"; then
7405 AC_MSG_RESULT([$with_idlc_cpp])
7406 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7408 AC_MSG_RESULT([ucpp])
7409 AC_MSG_CHECKING([which ucpp tp use])
7410 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7411 AC_MSG_RESULT([external])
7412 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7414 AC_MSG_RESULT([internal])
7415 BUILD_TYPE="$BUILD_TYPE UCPP"
7418 AC_SUBST(SYSTEM_UCPP)
7420 dnl ===================================================================
7421 dnl Check for epm (not needed for Windows)
7422 dnl ===================================================================
7423 AC_MSG_CHECKING([whether to enable EPM for packing])
7424 if test "$enable_epm" = "yes"; then
7425 AC_MSG_RESULT([yes])
7426 if test "$_os" != "WINNT"; then
7427 if test $_os = Darwin; then
7429 elif test -n "$with_epm"; then
7432 AC_PATH_PROG(EPM, epm, no)
7434 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7435 AC_MSG_NOTICE([EPM will be built.])
7436 BUILD_TYPE="$BUILD_TYPE EPM"
7437 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7439 # Gentoo has some epm which is something different...
7440 AC_MSG_CHECKING([whether the found epm is the right epm])
7441 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7442 AC_MSG_RESULT([yes])
7444 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7446 AC_MSG_CHECKING([epm version])
7447 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7448 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7449 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7450 AC_MSG_RESULT([OK, >= 3.7])
7452 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7453 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7458 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7459 AC_MSG_CHECKING([for rpm])
7460 for a in "$RPM" rpmbuild rpm; do
7461 $a --usage >/dev/null 2> /dev/null
7462 if test $? -eq 0; then
7466 $a --version >/dev/null 2> /dev/null
7467 if test $? -eq 0; then
7473 if test -z "$RPM"; then
7474 AC_MSG_ERROR([not found])
7475 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7476 RPM_PATH=`which $RPM`
7477 AC_MSG_RESULT([$RPM_PATH])
7478 SCPDEFS="$SCPDEFS -DWITH_RPM"
7480 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7483 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7484 AC_PATH_PROG(DPKG, dpkg, no)
7485 if test "$DPKG" = "no"; then
7486 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7489 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7490 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7491 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7492 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7493 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7494 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
7495 AC_MSG_RESULT([yes])
7498 if echo "$PKGFORMAT" | $GREP -q rpm; then
7500 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7501 add_warning "the rpms will need to be installed with --nodeps"
7505 AC_MSG_WARN([the ${_pt}s will not be relocateable])
7506 add_warning "the ${_pt}s will not be relocateable"
7507 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7508 relocation will work, you need to patch your epm with the
7509 patch in epm/epm-3.7.patch or build with
7510 --with-epm=internal which will build a suitable epm])
7515 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7516 AC_PATH_PROG(PKGMK, pkgmk, no)
7517 if test "$PKGMK" = "no"; then
7518 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7525 for i in $PKGFORMAT; do
7527 aix | bsd | deb | pkg | rpm | native | portable)
7529 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7538 dnl ===================================================================
7539 dnl We need winegcc when building MinGW build to be able to cross-build msi tools
7540 dnl ===================================================================
7542 if test "$enable_winegcc" = "yes"; then
7543 AC_PATH_PROG(WINEGCC, winegcc)
7544 if test "$WINEGCC" = ""; then
7545 AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
7548 ac_exeext_save="$ac_exeext"
7551 AC_LINK_IFELSE([AC_LANG_PROGRAM([
7554 printf ("hello world\n");
7556 [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
7559 ac_exeext="$ac_exeext_save"
7563 if test $_os = iOS; then
7564 enable_mpl_subset=yes
7565 enable_lotuswordpro=no
7568 enable_postgresql_sdbc=no
7569 enable_extension_integration=no
7570 enable_report_builder=no
7576 if test "$enable_lotuswordpro" = "yes"; then
7578 SCPDEFS="$SCPDEFS -DDISABLE_LWP"
7580 AC_SUBST(ENABLE_LWP)
7582 dnl ===================================================================
7584 dnl ===================================================================
7585 AC_PATH_PROG(GPERF, gperf)
7586 if test -z "$GPERF"; then
7587 AC_MSG_ERROR([gperf not found but needed. Install it.])
7589 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
7590 GPERF=`cygpath -m $GPERF`
7592 AC_MSG_CHECKING([gperf version])
7593 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
7596 AC_MSG_ERROR([too old, you need at least 3.0.0])
7600 dnl ===================================================================
7601 dnl Check for building ODK
7602 dnl ===================================================================
7603 if test "$enable_odk" = no; then
7606 if test "$with_doxygen" = no; then
7607 AC_MSG_CHECKING([for doxygen])
7611 if test "$with_doxygen" = yes; then
7612 AC_PATH_PROG([DOXYGEN], [doxygen])
7613 if test -z "$DOXYGEN"; then
7614 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7617 AC_MSG_CHECKING([for doxygen])
7618 DOXYGEN=$with_doxygen
7619 AC_MSG_RESULT([$DOXYGEN])
7621 if test -n "$DOXYGEN"; then
7622 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7623 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7624 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7625 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7632 AC_MSG_CHECKING([whether to build the ODK])
7633 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7634 AC_MSG_RESULT([yes])
7636 if test "$with_java" != "no"; then
7637 AC_MSG_CHECKING([whether to build unowinreg.dll])
7638 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7639 # build on Win by default
7640 enable_build_unowinreg=yes
7642 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7646 AC_MSG_RESULT([yes])
7647 BUILD_UNOWINREG=TRUE
7649 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7650 if test -z "$with_mingw_cross_compiler"; then
7652 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7653 elif test -x "$with_mingw_cross_compiler"; then
7654 MINGWCXX="$with_mingw_cross_compiler"
7656 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7659 if test "$MINGWCXX" = "false"; then
7660 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7663 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7664 if test -x "$mingwstrip_test"; then
7665 MINGWSTRIP="$mingwstrip_test"
7667 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7670 if test "$MINGWSTRIP" = "false"; then
7671 AC_MSG_ERROR(MinGW32 binutils not found.)
7675 BUILD_TYPE="$BUILD_TYPE ODK"
7680 AC_SUBST(BUILD_UNOWINREG)
7682 AC_SUBST(MINGWSTRIP)
7684 dnl ===================================================================
7685 dnl Check for system zlib
7686 dnl ===================================================================
7687 if test "$with_system_zlib" = "auto"; then
7690 with_system_zlib="$with_system_libs"
7693 with_system_zlib=yes
7698 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
7699 dnl and has no pkg-config for it at least on some tinderboxes,
7700 dnl so leaving that out for now
7701 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7702 AC_MSG_CHECKING([which zlib to use])
7703 if test "$with_system_zlib" = "yes"; then
7704 AC_MSG_RESULT([external])
7706 if test "$_os" != "Emscripten"; then
7707 # Emscripten provides its own zlib, don't check for that
7708 AC_CHECK_HEADER(zlib.h, [],
7709 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7710 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
7711 [AC_MSG_ERROR(zlib not found or functional)], [])
7714 AC_MSG_RESULT([internal])
7716 BUILD_TYPE="$BUILD_TYPE ZLIB"
7717 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7718 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
7720 AC_SUBST(ZLIB_CFLAGS)
7722 AC_SUBST(SYSTEM_ZLIB)
7724 dnl ===================================================================
7725 dnl Check for system jpeg
7726 dnl ===================================================================
7727 AC_MSG_CHECKING([which libjpeg to use])
7728 if test "$with_jpeg_turbo" = "auto"; then
7729 # TODO use jpeg-turbo on Darwin too
7740 if test "$with_system_jpeg" = "yes"; then
7741 AC_MSG_RESULT([external])
7743 AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
7744 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7745 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
7746 [AC_MSG_ERROR(jpeg library not found or fuctional)], [])
7747 libo_MINGW_CHECK_DLL([libjpeg])
7750 if test "$with_jpeg_turbo" = "yes"; then
7751 AC_MSG_RESULT([internal, jpeg-turbo])
7752 BUILD_TYPE="$BUILD_TYPE JPEG_TURBO"
7753 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
7755 if test -z "$NASM" -a "$build_os" = "cygwin"; then
7756 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
7757 NASM="$LODE_HOME/opt/bin/nasm"
7758 elif test -x "/opt/lo/bin/nasm"; then
7759 NASM="/opt/lo/bin/nasm"
7762 if test -z "$NASM"; then
7764 ****************************************************************************
7765 You need nasm (Netwide Assembler) to build internal jpeg library.
7766 To get one please do:
7769 if test "$build_os" = "cygwin"; then
7771 install a pre-compiled binary for Win32
7773 mkdir -p /opt/lo/bin
7775 wget http://dev-www.libreoffice.org/bin/cygwin/nasm.exe
7780 consult http://svn.code.sf.net/p/libjpeg-turbo/code/trunk/BUILDING.txt
7785 or get and install one from http://www.nasm.us/
7787 Then re-run autogen.sh
7789 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
7790 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
7793 AC_MSG_ERROR([no nasm (Netwide Assembler) found])
7795 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/jpeg-turbo"
7796 if test "$COM" = "MSC"; then
7797 LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/jpeg-turbo/.libs/libjpeg.lib"
7799 LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/jpeg-turbo/.libs -ljpeg"
7802 AC_MSG_RESULT([internal, jpeg])
7803 BUILD_TYPE="$BUILD_TYPE JPEG"
7804 LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/jpeg"
7805 if test "$COM" = "MSC"; then
7806 LIBJPEG_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/libjpeg.lib"
7808 LIBJPEG_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -ljpeg"
7813 AC_SUBST(LIBJPEG_CFLAGS)
7814 AC_SUBST(LIBJPEG_LIBS)
7815 AC_SUBST(SYSTEM_JPEG)
7817 dnl ===================================================================
7818 dnl Check for system clucene
7819 dnl ===================================================================
7820 dnl we should rather be using
7821 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
7822 dnl but the contribs-lib check seems tricky
7823 AC_MSG_CHECKING([which clucene to use])
7824 if test "$with_system_clucene" = "yes"; then
7825 AC_MSG_RESULT([external])
7827 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
7828 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
7829 FilterLibs "${CLUCENE_LIBS}"
7830 CLUCENE_LIBS="${filteredlibs}"
7832 save_CXXFLAGS=$CXXFLAGS
7833 save_CPPFLAGS=$CPPFLAGS
7834 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
7835 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
7836 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
7837 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
7838 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
7839 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
7840 CXXFLAGS=$save_CXXFLAGS
7841 CPPFLAGS=$save_CPPFLAGS
7844 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
7846 AC_MSG_RESULT([internal])
7848 BUILD_TYPE="$BUILD_TYPE CLUCENE"
7850 AC_SUBST(SYSTEM_CLUCENE)
7851 AC_SUBST(CLUCENE_CFLAGS)
7852 AC_SUBST(CLUCENE_LIBS)
7854 dnl ===================================================================
7855 dnl Check for system expat
7856 dnl ===================================================================
7857 dnl we should use libo_CHECK_SYSTEM_MODULE, but e.g. the mingw tinderbox has no
7858 dnl proper pkg-config for it. It should really be fixed on the tinderbox though.
7859 AC_MSG_CHECKING([which expat to use])
7860 if test "$with_system_expat" = "yes"; then
7861 AC_MSG_RESULT([external])
7863 AC_CHECK_HEADER(expat.h, [],
7864 [AC_MSG_ERROR(expat.h not found. install expat)], [])
7865 AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
7866 [AC_MSG_RESULT(expat library not found or functional.)], [])
7867 libo_MINGW_CHECK_DLL([libexpat])
7869 AC_MSG_RESULT([internal])
7871 BUILD_TYPE="$BUILD_TYPE EXPAT"
7873 AC_SUBST(SYSTEM_EXPAT)
7875 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
7876 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
7878 AC_DEFINE([ENABLE_EOT])
7879 AC_MSG_RESULT([yes])
7881 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
7886 AC_SUBST([ENABLE_EOT])
7888 dnl ===================================================================
7889 dnl Check for DLP libs
7890 dnl ===================================================================
7891 AS_IF([test "$COM" = "MSC"],
7892 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
7893 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
7895 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
7897 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
7899 AS_IF([test "$COM" = "MSC"],
7900 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
7901 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
7903 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
7905 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
7907 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
7908 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.4])
7910 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
7912 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
7914 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
7916 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
7917 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.9])
7919 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
7920 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.5])
7922 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
7924 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
7925 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
7927 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
7929 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
7931 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
7933 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
7934 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.2])
7936 dnl ===================================================================
7937 dnl Check for system libcmis
7938 dnl ===================================================================
7939 # libcmis requires curl and we can't build curl for iOS
7940 if test $_os != iOS; then
7941 libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.5 >= 0.5.0])
7946 AC_SUBST(ENABLE_CMIS)
7948 dnl ===================================================================
7949 dnl Check for system lcms2
7950 dnl ===================================================================
7951 if test "$with_system_lcms2" = "yes"; then
7952 libo_MINGW_CHECK_DLL([liblcms2])
7956 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
7957 if test "$GCC" = "yes"; then
7958 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7960 if test "$COM" = "MSC"; then # override the above
7961 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
7964 dnl ===================================================================
7965 dnl Check for system cppunit
7966 dnl ===================================================================
7967 if test "$cross_compiling" != "yes"; then
7968 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.12.0])
7971 dnl ===================================================================
7972 dnl Check whether freetype is available
7973 dnl ===================================================================
7974 if test "$test_freetype" = "yes"; then
7975 AC_MSG_CHECKING([whether freetype is available])
7976 # FreeType has 3 different kinds of versions
7977 # * release, like 2.4.10
7978 # * libtool, like 13.0.7 (this what pkg-config returns)
7980 # FreeType's docs/VERSION.DLL provides a table mapping between the three
7983 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
7984 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7985 FilterLibs "${FREETYPE_LIBS}"
7986 FREETYPE_LIBS="${filteredlibs}"
7987 SYSTEM_FREETYPE=TRUE
7989 _save_cflags="$CFLAGS"
7990 LIBS="$LIBS $FREETYPE_LIBS"
7991 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
7992 AC_CHECK_FUNC(FT_Face_GetCharVariantIndex, AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX), [])
7994 CFLAGS="$_save_cflags"
7996 AC_SUBST(FREETYPE_CFLAGS)
7997 AC_SUBST(FREETYPE_LIBS)
7998 AC_SUBST([SYSTEM_FREETYPE])
8000 # ===================================================================
8001 # Check for system libxslt
8002 # to prevent incompatibilities between internal libxml2 and external libxslt,
8003 # or vice versa, use with_system_libxml here
8004 # ===================================================================
8005 if test "$with_system_libxml" = "auto"; then
8008 with_system_libxml="$with_system_libs"
8011 with_system_libxml=yes
8016 AC_MSG_CHECKING([which libxslt to use])
8017 if test "$with_system_libxml" = "yes"; then
8018 AC_MSG_RESULT([external])
8020 if test "$_os" = "Darwin"; then
8021 dnl make sure to use SDK path
8022 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8023 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
8025 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
8026 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
8028 PKG_CHECK_MODULES(LIBXSLT, libxslt)
8029 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8030 FilterLibs "${LIBXSLT_LIBS}"
8031 LIBXSLT_LIBS="${filteredlibs}"
8032 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
8033 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8034 FilterLibs "${LIBEXSLT_LIBS}"
8035 LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//" -e "s/-lgcrypt//")
8038 dnl Check for xsltproc
8039 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8040 if test "$XSLTPROC" = "no"; then
8041 AC_MSG_ERROR([xsltproc is required])
8044 libo_MINGW_CHECK_DLL([libxslt])
8045 libo_MINGW_CHECK_DLL([libexslt])
8046 libo_MINGW_TRY_DLL([iconv])
8048 AC_MSG_RESULT([internal])
8050 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
8052 if test "$cross_compiling" = "yes"; then
8053 AC_PATH_PROG(XSLTPROC, xsltproc, no)
8054 if test "$XSLTPROC" = "no"; then
8055 AC_MSG_ERROR([xsltproc is required])
8059 AC_SUBST(SYSTEM_LIBXSLT)
8060 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
8061 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
8063 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
8065 AC_SUBST(LIBEXSLT_CFLAGS)
8066 AC_SUBST(LIBEXSLT_LIBS)
8067 AC_SUBST(LIBXSLT_CFLAGS)
8068 AC_SUBST(LIBXSLT_LIBS)
8071 # ===================================================================
8072 # Check for system libxml
8073 # ===================================================================
8074 AC_MSG_CHECKING([which libxml to use])
8075 if test "$with_system_libxml" = "yes"; then
8076 AC_MSG_RESULT([external])
8078 if test "$_os" = "Darwin"; then
8079 dnl make sure to use SDK path
8080 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
8082 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
8083 elif test $_os = iOS; then
8084 dnl make sure to use SDK path
8085 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
8086 LIBXML_CFLAGS="-I$usr/include/libxml2"
8087 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
8089 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
8090 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8091 FilterLibs "${LIBXML_LIBS}"
8092 LIBXML_LIBS="${filteredlibs}"
8095 dnl Check for xmllint
8096 AC_PATH_PROG(XMLLINT, xmllint, no)
8097 if test "$XMLLINT" = "no"; then
8098 AC_MSG_ERROR([xmllint is required])
8101 libo_MINGW_CHECK_DLL([libxml2])
8102 libo_MINGW_TRY_DLL([zlib1])
8104 AC_MSG_RESULT([internal])
8106 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/xml2/include"
8107 if test "$COM" = "MSC"; then
8108 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
8110 if test "$COM" = "MSC"; then
8111 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/xml2/win32/bin.msvc/libxml2.lib"
8113 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/xml2/.libs -lxml2"
8115 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8117 AC_SUBST(SYSTEM_LIBXML)
8118 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
8119 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
8121 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
8122 AC_SUBST(LIBXML_CFLAGS)
8123 AC_SUBST(LIBXML_LIBS)
8126 # =====================================================================
8127 # Checking for a Python interpreter with version >= 2.6.
8128 # Build and runtime requires Python 3 compatible version (>= 2.6).
8129 # Optionally user can pass an option to configure, i. e.
8130 # ./configure PYTHON=/usr/bin/python
8131 # =====================================================================
8132 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8133 # This allows a lack of system python with no error, we use internal one in that case.
8134 AM_PATH_PYTHON([2.6],, [:])
8135 # Clean PYTHON_VERSION checked below if cross-compiling
8137 if test "$PYTHON" != ":"; then
8138 PYTHON_FOR_BUILD=$PYTHON
8141 AC_SUBST(PYTHON_FOR_BUILD)
8143 # Checks for Python to use for Pyuno
8144 AC_MSG_CHECKING([which Python to use for Pyuno])
8145 case "$enable_python" in
8147 if test -z $PYTHON_FOR_BUILD; then
8148 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8149 # requirement from the choice whether to include Python stuff in the installer, but why
8151 AC_MSG_ERROR([Python is required at build time.])
8154 AC_MSG_RESULT([none])
8157 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8158 AC_MSG_RESULT([no, overridden by --disable-scripting])
8160 elif test $build_os = cygwin; then
8161 dnl When building on Windows we don't attempt to use any installed
8162 dnl "system" Python.
8164 dnl (When cross-compiling to Windows from Linux using the mingw32-cross
8165 dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
8166 dnl MinGW cross-compilation setups.)
8167 AC_MSG_RESULT([fully internal])
8168 enable_python=internal
8169 elif test "$cross_compiling" = yes; then
8170 AC_MSG_RESULT([system])
8171 enable_python=system
8173 # Unset variables set by the above AM_PATH_PYTHON so that
8174 # we actually do check anew.
8175 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
8176 AM_PATH_PYTHON([3.3],, [:])
8177 if test "$PYTHON" = ":"; then
8178 if test -z "$PYTHON_FOR_BUILD"; then
8179 AC_MSG_RESULT([fully internal])
8181 AC_MSG_RESULT([internal])
8183 enable_python=internal
8185 AC_MSG_RESULT([system])
8186 enable_python=system
8191 AC_MSG_RESULT([internal])
8194 AC_MSG_RESULT([fully internal])
8195 enable_python=internal
8198 AC_MSG_RESULT([system])
8201 AC_MSG_ERROR([Incorrect --enable-python option])
8205 if test $enable_python != no; then
8206 BUILD_TYPE="$BUILD_TYPE PYUNO"
8209 if test $enable_python = system; then
8210 if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
8212 PYTHON=python$python_version
8213 if test -d "$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"; then
8214 PYTHON_CFLAGS="-I$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"
8215 PYTHON_LIBS="-framework Python"
8217 PYTHON_CFLAGS="`$PYTHON-config --includes`"
8218 PYTHON_LIBS="`$PYTHON-config --libs`"
8221 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8222 # Fallback: Accept these in the environment, or as set above
8225 elif test "$cross_compiling" != yes; then
8226 # Unset variables set by the above AM_PATH_PYTHON so that
8227 # we actually do check anew.
8228 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
8229 # This causes an error if no python command is found
8230 AM_PATH_PYTHON([3.3])
8231 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8232 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8233 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8234 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8235 if test -z "$PKG_CONFIG"; then
8236 PYTHON_CFLAGS="-I$python_include"
8237 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8238 elif $PKG_CONFIG --exists python-$python_version; then
8239 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8240 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8242 PYTHON_CFLAGS="-I$python_include"
8243 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8245 FilterLibs "${PYTHON_LIBS}"
8246 PYTHON_LIBS="${filteredlibs}"
8248 dnl How to find out the cross-compilation Python installation path?
8249 dnl Let's hardocode what we know for different distributions for now...
8250 for python_version in 2.6; do
8251 if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
8252 PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
8253 PYTHON_LIBS="-L${MINGW_SYSROOT}/lib -lpython$python_version $python_libs"
8254 AC_MSG_CHECKING([for python.exe])
8255 libo_MINGW_CHECK_DLL([libpython$python_version])
8256 libo_MINGW_CHECK_DLL([libreadline6])
8257 libo_MINGW_CHECK_DLL([libtermcap])
8258 # could we somehow extract the really mingw python version from
8259 # actual distro package?
8260 # 2.6.2 currently on OpenSUSE 12.1?
8261 # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
8262 PYTHON_VERSION=$python_version.2
8263 PYTHON_VERSION_MAJOR=`echo $python_version | cut -d . -f 1`
8264 PYTHON_VERSION_MINOR=`echo $python_version | cut -d . -f 2`
8268 AC_MSG_CHECKING([for python version])
8269 AS_IF([test -n "$PYTHON_VERSION"],
8270 [AC_MSG_RESULT([$PYTHON_VERSION])],
8271 [AC_MSG_RESULT([not found])
8272 AC_MSG_ERROR([no usable python found])])
8273 test -n "$PYTHON_CFLAGS" && break
8275 # let the PYTHON_FOR_BUILD match the same python installation that
8276 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8277 # better for PythonTests.
8278 PYTHON_FOR_BUILD=$PYTHON
8281 dnl By now enable_python should be "system", "internal" or "no"
8282 case $enable_python in
8286 dnl Check if the headers really work
8287 save_CPPFLAGS="$CPPFLAGS"
8288 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8289 AC_CHECK_HEADER(Python.h, [],
8290 [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
8292 CPPFLAGS="$save_CPPFLAGS"
8295 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8296 AC_MSG_CHECKING([for correct python library version])
8297 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8300 int main(int argc, char **argv) {
8301 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
8302 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8305 ]])],[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])])
8309 dnl FIXME Check if the Python library can be linked with, too?
8314 PYTHON_VERSION_MAJOR=3
8315 # On windows we are supporting two different python versions: 3.3 and 3.5.
8316 # We msut do it as long as we support MSVC 2013. Python 3.3 can be removed
8317 # when MSVC 2013 support was dropped.
8318 if test "$COM" = "MSC" -a "$VCVER" = "120"; then
8319 PYTHON_VERSION_MINOR=3
8321 PYTHON_VERSION_MINOR=5
8323 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.0
8324 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8325 BUILD_TYPE="$BUILD_TYPE PYTHON"
8326 # Embedded Python dies without Home set
8327 if test "$HOME" = ""; then
8330 # bz2 tarball and bzip2 is not standard
8331 if test -z "$BZIP2"; then
8332 AC_PATH_PROG( BZIP2, bzip2)
8333 if test -z "$BZIP2"; then
8334 AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
8343 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8347 AC_SUBST(DISABLE_PYTHON)
8348 AC_SUBST(SYSTEM_PYTHON)
8349 AC_SUBST(PYTHON_CFLAGS)
8350 AC_SUBST(PYTHON_LIBS)
8351 AC_SUBST(PYTHON_VERSION)
8352 AC_SUBST(PYTHON_VERSION_MAJOR)
8353 AC_SUBST(PYTHON_VERSION_MINOR)
8355 AC_MSG_CHECKING([whether to build the MariaDB/MySQL Connector extension])
8356 if test "x$enable_ext_mariadb_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8357 AC_MSG_RESULT([yes])
8358 ENABLE_MARIADBC=TRUE
8362 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8367 AC_SUBST(ENABLE_MARIADBC)
8368 AC_SUBST(MARIADBC_MAJOR)
8369 AC_SUBST(MARIADBC_MINOR)
8370 AC_SUBST(MARIADBC_MICRO)
8372 if test "$ENABLE_MARIADBC" = "TRUE"; then
8374 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MARIADBC"
8376 dnl ===================================================================
8377 dnl Check for system MariaDB
8378 dnl ===================================================================
8379 AC_MSG_CHECKING([which MariaDB to use])
8380 if test "$with_system_mariadb" = "yes"; then
8381 AC_MSG_RESULT([external])
8383 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8384 if test -z "$MARIADBCONFIG"; then
8385 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8386 if test -z "$MARIADBCONFIG"; then
8387 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8388 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8391 AC_MSG_CHECKING([MariaDB version])
8392 MARIADB_VERSION=`$MARIADBCONFIG --version`
8393 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8394 if test "$MARIADB_MAJOR" -ge "5"; then
8397 AC_MSG_ERROR([too old, use 5.0.x or later])
8399 AC_MSG_CHECKING([for MariaDB Client library])
8400 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8401 if test "$COM_IS_CLANG" = TRUE; then
8402 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8404 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8405 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8406 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8408 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8409 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8410 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8411 | sed -e 's|/lib64/|/lib/|')
8413 FilterLibs "${MARIADB_LIBS}"
8414 MARIADB_LIBS="${filteredlibs}"
8415 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8416 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8417 if test "$enable_bundle_mariadb" = "yes"; then
8418 AC_MSG_RESULT([yes])
8420 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8422 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8424 /g' | grep -E '(mysqlclient|mariadb)')
8425 if test "$_os" = "Darwin"; then
8426 LIBMARIADB=${LIBMARIADB}.dylib
8427 elif test "$_os" = "WINNT"; then
8428 LIBMARIADB=${LIBMARIADB}.dll
8430 LIBMARIADB=${LIBMARIADB}.so
8432 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8433 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8434 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8435 AC_MSG_RESULT([found.])
8436 PathFormat "$LIBMARIADB_PATH"
8437 LIBMARIADB_PATH="$formatted_path"
8439 AC_MSG_ERROR([not found.])
8446 AC_MSG_RESULT([internal])
8448 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb/include"
8449 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadblib"
8450 BUILD_TYPE="$BUILD_TYPE MARIADB"
8453 AC_SUBST(SYSTEM_MARIADB)
8454 AC_SUBST(MARIADB_CFLAGS)
8455 AC_SUBST(MARIADB_LIBS)
8456 AC_SUBST(LIBMARIADB)
8457 AC_SUBST(LIBMARIADB_PATH)
8458 AC_SUBST(BUNDLE_MARIADB)
8461 dnl ===================================================================
8462 dnl Check for system MySQL C++ Connector
8463 dnl ===================================================================
8465 # who thought this too-generic cppconn dir was a good idea?
8466 AC_MSG_CHECKING([MySQL Connector/C++])
8467 if test "$with_system_mysql_cppconn" = "yes"; then
8468 AC_MSG_RESULT([external])
8469 SYSTEM_MYSQL_CPPCONN=TRUE
8471 AC_CHECK_HEADER(mysql_driver.h, [],
8472 [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
8473 AC_CHECK_LIB([mysqlcppconn], [main], [:],
8474 [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
8476 LIBS="$LIBS -lmysqlcppconn"
8477 AC_MSG_CHECKING([version])
8478 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8479 #include <mysql_driver.h>
8481 int main(int argc, char **argv) {
8482 sql::Driver *driver;
8483 driver = get_driver_instance();
8484 if (driver->getMajorVersion() > 1 || \
8485 (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
8486 (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
8491 ]])],[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])])
8496 AC_MSG_RESULT([internal])
8497 BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
8498 SYSTEM_MYSQL_CPPCONN=
8502 AC_SUBST(SYSTEM_MYSQL_CPPCONN)
8504 dnl ===================================================================
8505 dnl Check for system hsqldb
8506 dnl ===================================================================
8507 if test "$with_java" != "no"; then
8508 HSQLDB_USE_JDBC_4_1=
8509 AC_MSG_CHECKING([which hsqldb to use])
8510 if test "$with_system_hsqldb" = "yes"; then
8511 AC_MSG_RESULT([external])
8513 if test -z $HSQLDB_JAR; then
8514 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8516 if ! test -f $HSQLDB_JAR; then
8517 AC_MSG_ERROR(hsqldb.jar not found.)
8519 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8523 my $file = "$ENV{'HSQLDB_JAR'}";
8524 my $zip = Archive::Zip->new( $file );
8525 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8526 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8528 push @l, split(/\n/, $mf);
8529 foreach my $line (@l)
8531 if ($line =~ m/Specification-Version:/)
8533 ($t, $version) = split (/:/,$line);
8534 $version =~ s/^\s//;
8535 ($a, $b, $c, $d) = split (/\./,$version);
8536 if ($c == "0" && $d > "8")
8551 AC_MSG_RESULT([yes])
8553 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8556 AC_MSG_RESULT([internal])
8558 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8559 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8560 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8561 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8562 AC_MSG_RESULT([yes])
8563 HSQLDB_USE_JDBC_4_1=TRUE
8568 AC_SUBST(SYSTEM_HSQLDB)
8569 AC_SUBST(HSQLDB_JAR)
8570 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8573 dnl ===================================================================
8574 dnl Check for PostgreSQL stuff
8575 dnl ===================================================================
8576 if test "x$enable_postgresql_sdbc" != "xno"; then
8577 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8579 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8580 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8582 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8583 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8586 postgres_interface=""
8587 if test "$with_system_postgresql" = "yes"; then
8588 postgres_interface="external PostgreSQL"
8589 SYSTEM_POSTGRESQL=TRUE
8590 if test "$_os" = Darwin; then
8592 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8593 pg_supp_path="$P_SEP$d$pg_supp_path"
8596 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8597 if test -z "$PGCONFIG"; then
8598 AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
8600 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8601 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8602 FilterLibs "${POSTGRESQL_LIB}"
8603 POSTGRESQL_LIB="${filteredlibs}"
8605 # if/when anything else than PostgreSQL uses Kerberos,
8606 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8611 # MacOS X has system MIT Kerberos 5 since 10.4
8612 if test "$with_krb5" != "no"; then
8615 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8616 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
8619 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8620 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
8621 KRB5_LIBS="$KRB5_LIBS $LIBS"
8624 if test "$with_gssapi" != "no"; then
8627 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8628 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8634 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8635 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8638 Linux|GNU|*BSD|DragonFly)
8639 if test "$with_krb5" != "no"; then
8642 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8643 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8646 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8647 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8648 KRB5_LIBS="$KRB5_LIBS $LIBS"
8651 if test "$with_gssapi" != "no"; then
8654 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8655 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8661 if test "$with_krb5" = "yes"; then
8664 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8665 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8668 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8669 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8670 KRB5_LIBS="$KRB5_LIBS $LIBS"
8673 if test "$with_gssapi" = "yes"; then
8676 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8677 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8683 if test -n "$with_libpq_path"; then
8684 SYSTEM_POSTGRESQL=TRUE
8685 postgres_interface="external libpq"
8686 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8687 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8690 postgres_interface="internal"
8692 POSTGRESQL_INC="%OVERRIDE_ME%"
8693 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8697 AC_MSG_CHECKING([PostgreSQL C interface])
8698 AC_MSG_RESULT([$postgres_interface])
8700 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
8701 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8703 save_CPPFLAGS=$CPPFLAGS
8705 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8706 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8707 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8708 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8709 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8711 CPPFLAGS=$save_CPPFLAGS
8714 BUILD_POSTGRESQL_SDBC=TRUE
8717 AC_SUBST(WITH_GSSAPI)
8718 AC_SUBST(GSSAPI_LIBS)
8720 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8721 AC_SUBST(SYSTEM_POSTGRESQL)
8722 AC_SUBST(POSTGRESQL_INC)
8723 AC_SUBST(POSTGRESQL_LIB)
8725 dnl ===================================================================
8726 dnl Check for Firebird stuff
8727 dnl ===================================================================
8728 ENABLE_FIREBIRD_SDBC=""
8729 if test "$enable_firebird_sdbc" = "yes" ; then
8730 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8732 dnl ===================================================================
8733 dnl Check for system Firebird
8734 dnl ===================================================================
8735 AC_MSG_CHECKING([which Firebird to use])
8736 if test "$with_system_firebird" = "yes"; then
8737 AC_MSG_RESULT([external])
8738 SYSTEM_FIREBIRD=TRUE
8739 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8740 if test -z "$FIREBIRDCONFIG"; then
8741 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8742 PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
8743 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
8745 FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
8747 AC_MSG_NOTICE([fb_config found])
8748 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8749 AC_MSG_CHECKING([for Firebird Client library])
8750 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8751 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8752 FilterLibs "${FIREBIRD_LIBS}"
8753 FIREBIRD_LIBS="${filteredlibs}"
8755 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8756 AC_MSG_CHECKING([Firebird version])
8757 if test -n "${FIREBIRD_VERSION}"; then
8758 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8759 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8760 if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
8763 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
8766 __save_CFLAGS="${CFLAGS}"
8767 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
8768 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
8769 #if defined(FB_API_VER) && FB_API_VER == 30
8770 int fb_api_is_30(void) { return 0; }
8772 #error "Wrong Firebird API version"
8773 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
8774 CFLAGS="${__save_CFLAGS}"
8776 ENABLE_FIREBIRD_SDBC="TRUE"
8777 elif test "$enable_database_connectivity" != yes; then
8778 AC_MSG_RESULT([none])
8779 elif test "$cross_compiling" = "yes"; then
8780 AC_MSG_RESULT([none])
8782 dnl Embedded Firebird has version 3.0
8783 AC_DEFINE(HAVE_FIREBIRD_30, 1)
8784 dnl We need libatomic-ops for any non X86/X64 system
8785 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
8786 dnl ===================================================================
8787 dnl Check for system libatomic-ops
8788 dnl ===================================================================
8789 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
8790 if test "$with_system_libatomic_ops" = "yes"; then
8791 SYSTEM_LIBATOMIC_OPS=TRUE
8792 AC_CHECK_HEADERS(atomic_ops.h, [],
8793 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
8795 SYSTEM_LIBATOMIC_OPS=
8796 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
8797 LIBATOMIC_OPS_LIBS="-latomic_ops"
8798 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
8802 AC_MSG_RESULT([internal])
8804 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
8805 FIREBIRD_LIBS="-lfbclient"
8807 if test "$with_system_libtommath" = "yes"; then
8808 SYSTEM_LIBTOMMATH=TRUE
8809 dnl check for tommath presence
8811 AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
8812 AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
8816 LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
8817 LIBTOMMATH_LIBS="-ltommath"
8818 BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
8821 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
8822 ENABLE_FIREBIRD_SDBC="TRUE"
8825 AC_SUBST(ENABLE_FIREBIRD_SDBC)
8826 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
8827 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
8828 AC_SUBST(LIBATOMIC_OPS_LIBS)
8829 AC_SUBST(SYSTEM_FIREBIRD)
8830 AC_SUBST(FIREBIRD_CFLAGS)
8831 AC_SUBST(FIREBIRD_LIBS)
8832 AC_SUBST([TOMMATH_CFLAGS])
8833 AC_SUBST([TOMMATH_LIBS])
8835 dnl ===================================================================
8836 dnl Check for system curl
8837 dnl ===================================================================
8838 AC_MSG_CHECKING([which libcurl to use])
8839 if test "$with_system_curl" = "auto"; then
8840 with_system_curl="$with_system_libs"
8843 if test "$with_system_curl" = "yes"; then
8844 AC_MSG_RESULT([external])
8847 # First try PKGCONFIG and then fall back
8848 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
8850 if test -n "$CURL_PKG_ERRORS"; then
8851 AC_PATH_PROG(CURLCONFIG, curl-config)
8852 if test -z "$CURLCONFIG"; then
8853 AC_MSG_ERROR([curl development files not found])
8855 CURL_LIBS=`$CURLCONFIG --libs`
8856 FilterLibs "${CURL_LIBS}"
8857 CURL_LIBS="${filteredlibs}"
8858 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
8859 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
8861 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
8862 case $curl_version in
8863 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
8864 dnl so they need to be doubled to end up in the configure script
8865 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
8866 AC_MSG_RESULT([yes])
8869 AC_MSG_ERROR([no, you have $curl_version])
8874 libo_MINGW_CHECK_DLL([libcurl])
8875 libo_MINGW_TRY_DLL([libintl])
8876 libo_MINGW_TRY_DLL([libidn])
8877 libo_MINGW_TRY_DLL([libnspr4])
8878 libo_MINGW_TRY_DLL([nssutil3])
8879 libo_MINGW_TRY_DLL([libplc4])
8880 libo_MINGW_TRY_DLL([libplds4])
8881 libo_MINGW_TRY_DLL([nss3])
8882 libo_MINGW_TRY_DLL([ssl3])
8883 libo_MINGW_TRY_DLL([libgpg-error])
8884 libo_MINGW_TRY_DLL([libgcrypt])
8885 libo_MINGW_TRY_DLL([libssh2])
8887 elif test $_os = iOS; then
8888 # Let's see if we need curl, I think not?
8889 AC_MSG_RESULT([none])
8892 AC_MSG_RESULT([internal])
8894 BUILD_TYPE="$BUILD_TYPE CURL"
8897 AC_SUBST(SYSTEM_CURL)
8898 AC_SUBST(CURL_CFLAGS)
8900 AC_SUBST(ENABLE_CURL)
8902 dnl ===================================================================
8903 dnl Check for system boost
8904 dnl ===================================================================
8905 AC_MSG_CHECKING([which boost to use])
8906 if test "$with_system_boost" = "yes"; then
8907 AC_MSG_RESULT([external])
8913 mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
8914 libo_MINGW_TRY_DLL([$mingw_boost_date_time_dll])
8915 if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
8916 # if not found, try again with 'lib' prefix
8917 libo_MINGW_CHECK_DLL([lib$mingw_boost_date_time_dll])
8920 save_CXXFLAGS=$CXXFLAGS
8921 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
8922 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
8923 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
8924 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
8925 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
8926 AC_CHECK_HEADER(boost/function.hpp, [],
8927 [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
8928 CXXFLAGS="$CXXFLAGS -fno-exceptions"
8929 AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
8930 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
8931 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
8932 if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
8933 AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
8935 AC_MSG_RESULT([yes])
8937 CXXFLAGS=$save_CXXFLAGS
8939 # this is in m4/ax_boost_base.m4
8940 FilterLibs "${BOOST_LDFLAGS}"
8941 BOOST_LDFLAGS="${filteredlibs}"
8943 AC_MSG_RESULT([internal])
8944 BUILD_TYPE="$BUILD_TYPE BOOST"
8946 if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
8947 # use warning-suppressing wrapper headers
8948 BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
8950 BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
8953 AC_SUBST(SYSTEM_BOOST)
8955 dnl ===================================================================
8956 dnl Check for system mdds
8957 dnl ===================================================================
8958 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.2 >= 1.2.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
8960 dnl ===================================================================
8961 dnl Check for system glm
8962 dnl ===================================================================
8963 AC_MSG_CHECKING([which glm to use])
8964 if test "$with_system_glm" = "yes"; then
8965 AC_MSG_RESULT([external])
8968 AC_CHECK_HEADER([glm/glm.hpp], [],
8969 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
8972 AC_MSG_RESULT([internal])
8973 BUILD_TYPE="$BUILD_TYPE GLM"
8975 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
8977 AC_SUBST([GLM_CFLAGS])
8978 AC_SUBST([SYSTEM_GLM])
8980 dnl ===================================================================
8981 dnl Check for system glew
8982 dnl ===================================================================
8983 libo_CHECK_SYSTEM_MODULE([glew], [GLEW], [glew >= 1.10.0])
8984 AS_IF([test "$with_system_glew" = "yes"],
8985 [PKG_CHECK_EXISTS([glew >= 1.12.0], [AC_DEFINE([HAVE_GLEW_1_12])])],
8986 [AC_DEFINE([HAVE_GLEW_1_12])])
8988 dnl ===================================================================
8989 dnl Check for system odbc
8990 dnl ===================================================================
8991 AC_MSG_CHECKING([which odbc headers to use])
8992 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
8993 AC_MSG_RESULT([external])
8994 SYSTEM_ODBC_HEADERS=TRUE
8996 if test "$build_os" = "cygwin"; then
8997 save_CPPFLAGS=$CPPFLAGS
8999 PathFormat "$winsdktest"
9000 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"
9001 AC_CHECK_HEADER(sqlext.h, [],
9002 [AC_MSG_ERROR(odbc not found. install odbc)],
9003 [#include <windows.h>])
9004 CPPFLAGS=$save_CPPFLAGS
9006 AC_CHECK_HEADER(sqlext.h, [],
9007 [AC_MSG_ERROR(odbc not found. install odbc)],[])
9009 elif test "$enable_database_connectivity" != yes; then
9010 AC_MSG_RESULT([none])
9012 AC_MSG_RESULT([internal])
9013 SYSTEM_ODBC_HEADERS=
9015 AC_SUBST(SYSTEM_ODBC_HEADERS)
9018 dnl ===================================================================
9019 dnl Check for system openldap
9020 dnl ===================================================================
9022 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
9023 AC_MSG_CHECKING([which openldap library to use])
9024 if test "$with_system_openldap" = "yes"; then
9025 AC_MSG_RESULT([external])
9026 SYSTEM_OPENLDAP=TRUE
9027 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
9028 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9029 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
9031 AC_MSG_RESULT([internal])
9033 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
9036 AC_SUBST(SYSTEM_OPENLDAP)
9038 dnl ===================================================================
9039 dnl Check for TLS/SSL and cryptographic implementation to use
9040 dnl ===================================================================
9041 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
9042 if test -n "$with_tls"; then
9045 AC_DEFINE(USE_TLS_OPENSSL)
9048 if test "$enable_openssl" != "yes"; then
9049 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
9052 # warn that OpenSSL has been selected but not all TLS code has this option
9053 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS])
9054 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS"
9057 AC_DEFINE(USE_TLS_NSS)
9061 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
9063 nss - Mozilla's Network Security Services (NSS)
9067 elif test $_os = iOS -o $_os = Android; then
9068 # We don't build NSS for iOS and Android
9069 AC_DEFINE(USE_TLS_OPENSSL)
9072 # default to using NSS, it results in smaller oox lib
9073 AC_DEFINE(USE_TLS_NSS)
9076 AC_MSG_RESULT([$TLS])
9079 dnl ===================================================================
9080 dnl Check for system NSS
9081 dnl ===================================================================
9082 if test $_os != iOS; then
9083 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
9085 if test "$with_system_nss" = "yes"; then
9086 libo_MINGW_CHECK_DLL([libnspr4])
9087 libo_MINGW_CHECK_DLL([libplc4])
9088 libo_MINGW_CHECK_DLL([libplds4])
9089 libo_MINGW_CHECK_DLL([nss3])
9090 libo_MINGW_CHECK_DLL([nssutil3])
9091 libo_MINGW_CHECK_DLL([smime3])
9092 libo_MINGW_CHECK_DLL([ssl3])
9095 dnl ===================================================================
9096 dnl Check for system sane
9097 dnl ===================================================================
9098 AC_MSG_CHECKING([which sane header to use])
9099 if test "$with_system_sane" = "yes"; then
9100 AC_MSG_RESULT([external])
9101 AC_CHECK_HEADER(sane/sane.h, [],
9102 [AC_MSG_ERROR(sane not found. install sane)], [])
9104 AC_MSG_RESULT([internal])
9105 BUILD_TYPE="$BUILD_TYPE SANE"
9108 dnl ===================================================================
9109 dnl Check for system icu
9110 dnl ===================================================================
9117 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9118 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9119 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9120 AC_MSG_CHECKING([which icu to use])
9121 if test "$with_system_icu" = "yes"; then
9122 AC_MSG_RESULT([external])
9125 AC_MSG_CHECKING([for unicode/rbbi.h])
9126 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
9129 if test "$cross_compiling" != "yes" -o "$WITH_MINGW" = "yes"; then
9131 if test "$WITH_MINGW" = "yes"; then
9132 ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
9134 AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
9136 AC_MSG_CHECKING([ICU version])
9137 ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
9138 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9139 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9141 if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "6" \); then
9142 AC_MSG_RESULT([OK, $ICU_VERSION])
9144 AC_MSG_ERROR([not suitable, only >= 4.6 supported currently])
9148 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9149 AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
9150 ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
9151 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9152 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9153 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9154 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9155 AC_MSG_RESULT([yes])
9158 if test "$with_system_icu_for_build" != "force"; then
9159 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9160 You can use --with-system-icu-for-build=force to use it anyway.])
9165 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9166 # using the system icu tools can lead to version confusion, use the
9167 # ones from the build environment when cross-compiling
9168 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9169 if test -z "$SYSTEM_GENBRK"; then
9170 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9172 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9173 if test -z "$SYSTEM_GENCCODE"; then
9174 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9176 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9177 if test -z "$SYSTEM_GENCMN"; then
9178 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9180 if test "$ICU_MAJOR" -ge "49"; then
9181 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9182 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9183 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9185 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9186 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9187 ICU_RECLASSIFIED_HEBREW_LETTER=
9191 if test "$cross_compiling" = "yes"; then
9192 if test "$ICU_MAJOR" -ge "50"; then
9193 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9198 libo_MINGW_CHECK_DLL([icudata][$ICU_MAJOR][$ICU_MINOR])
9199 libo_MINGW_CHECK_DLL([icui18n][$ICU_MAJOR][$ICU_MINOR])
9200 libo_MINGW_CHECK_DLL([icuuc][$ICU_MAJOR][$ICU_MINOR])
9202 AC_MSG_RESULT([internal])
9204 BUILD_TYPE="$BUILD_TYPE ICU"
9205 # surprisingly set these only for "internal" (to be used by various other
9206 # external libs): the system icu-config is quite unhelpful and spits out
9207 # dozens of weird flags and also default path -I/usr/include
9208 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9209 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9211 AC_SUBST(SYSTEM_ICU)
9212 AC_SUBST(SYSTEM_GENBRK)
9213 AC_SUBST(SYSTEM_GENCCODE)
9214 AC_SUBST(SYSTEM_GENCMN)
9217 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9218 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9219 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9220 AC_SUBST(ICU_CFLAGS)
9223 dnl ===================================================================
9225 dnl ===================================================================
9226 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
9227 if test "$with_system_graphite" = "yes"; then
9228 libo_MINGW_CHECK_DLL([libgraphite2])
9230 if test "$COM" = "MSC"; then # override the above
9231 GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
9234 # This is the old Graphite support that will eventually be removed
9235 AC_MSG_CHECKING([whether to enable graphite support])
9236 if test $_os != Darwin -a $_os != Android -a $_os != iOS -a \( -z "$enable_graphite" -o "$enable_graphite" != no \); then
9237 AC_MSG_RESULT([yes])
9238 ENABLE_GRAPHITE="TRUE"
9239 AC_DEFINE(ENABLE_GRAPHITE)
9244 AC_SUBST(ENABLE_GRAPHITE)
9246 dnl ==================================================================
9248 dnl ==================================================================
9249 AC_MSG_CHECKING([whether to enable breakpad])
9250 if test "$enable_breakpad" != yes; then
9253 AC_MSG_RESULT([yes])
9254 ENABLE_BREAKPAD="TRUE"
9255 AC_DEFINE(ENABLE_BREAKPAD)
9256 AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
9257 BUILD_TYPE="$BUILD_TYPE BREAKPAD"
9259 AC_MSG_CHECKING([for crashreport config])
9260 if test "$with_symbol_config" = "no"; then
9261 BREAKPAD_SYMBOL_CONFIG="invalid"
9264 BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
9265 AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
9266 AC_MSG_RESULT([yes])
9268 AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
9270 AC_SUBST(ENABLE_BREAKPAD)
9272 dnl ===================================================================
9274 dnl ===================================================================
9276 AC_MSG_CHECKING([whether to enable orcus])
9277 if test -z "$enable_orcus" -o "$enable_orcus" != no; then
9278 AC_MSG_RESULT([yes])
9280 AC_DEFINE(ENABLE_ORCUS)
9282 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.12 >= 0.12.0])
9283 if test "$with_system_orcus" != "yes"; then
9284 if test "$SYSTEM_BOOST" = "TRUE"; then
9285 # ===========================================================
9286 # Determine if we are going to need to link with Boost.System
9287 # ===========================================================
9288 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9289 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9290 dnl in documentation has no effect.
9291 AC_MSG_CHECKING([if we need to link with Boost.System])
9293 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9294 @%:@include <boost/version.hpp>
9296 #if BOOST_VERSION >= 105000
9297 # error yes, we need to link with Boost.System
9302 AC_MSG_RESULT([yes])
9308 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9309 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9310 AC_SUBST([BOOST_SYSTEM_LIB])
9311 AC_SUBST(SYSTEM_LIBORCUS)
9316 AC_SUBST(ENABLE_ORCUS)
9318 dnl ===================================================================
9320 dnl ===================================================================
9321 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
9322 if test "$COM" = "MSC"; then # override the above
9323 HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
9325 if test "$with_system_harfbuzz" = "yes"; then
9326 if test "$with_system_graphite" = "no"; then
9327 AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
9329 AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
9331 _save_cflags="$CFLAGS"
9332 LIBS="$LIBS $HARFBUZZ_LIBS"
9333 CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
9334 AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
9336 CFLAGS="$_save_cflags"
9338 if test "$with_system_graphite" = "yes"; then
9339 AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
9343 AC_MSG_CHECKING([whether to use X11])
9344 dnl ***************************************
9345 dnl testing for X libraries and includes...
9346 dnl ***************************************
9347 if test "$USING_X11" = TRUE; then
9348 AC_DEFINE(HAVE_FEATURE_X11)
9350 AC_MSG_RESULT([$USING_X11])
9352 if test "$USING_X11" = TRUE; then
9355 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9357 if test -z "$x_includes"; then
9358 x_includes="default_x_includes"
9360 if test -z "$x_libraries"; then
9361 x_libraries="default_x_libraries"
9363 CFLAGS="$CFLAGS $X_CFLAGS"
9364 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9365 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9367 x_includes="no_x_includes"
9368 x_libraries="no_x_libraries"
9371 if test "$USING_X11" = TRUE; then
9372 dnl ===================================================================
9373 dnl Check for Composite.h for Mozilla plugin
9374 dnl ===================================================================
9375 AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
9376 [#include <X11/Intrinsic.h>])
9378 dnl ===================================================================
9379 dnl Check for extension headers
9380 dnl ===================================================================
9381 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9382 [#include <X11/extensions/shape.h>])
9384 # vcl needs ICE and SM
9385 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9386 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9387 [AC_MSG_ERROR(ICE library not found)])
9388 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9389 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9390 [AC_MSG_ERROR(SM library not found)])
9393 dnl ===================================================================
9394 dnl Check for system Xrender
9395 dnl ===================================================================
9396 AC_MSG_CHECKING([whether to use Xrender])
9397 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9398 AC_MSG_RESULT([yes])
9399 PKG_CHECK_MODULES(XRENDER, xrender)
9400 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9401 FilterLibs "${XRENDER_LIBS}"
9402 XRENDER_LIBS="${filteredlibs}"
9403 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9404 [AC_MSG_ERROR(libXrender not found or functional)], [])
9405 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9406 [AC_MSG_ERROR(Xrender not found. install X)], [])
9410 AC_SUBST(XRENDER_CFLAGS)
9411 AC_SUBST(XRENDER_LIBS)
9413 dnl ===================================================================
9414 dnl Check for XRandr
9415 dnl ===================================================================
9416 AC_MSG_CHECKING([whether to enable RandR support])
9417 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9418 AC_MSG_RESULT([yes])
9419 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9420 if test "$ENABLE_RANDR" != "TRUE"; then
9421 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9422 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9424 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9425 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9426 XRANDR_LIBS="-lXrandr "
9429 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9430 FilterLibs "${XRANDR_LIBS}"
9431 XRANDR_LIBS="${filteredlibs}"
9436 AC_SUBST(XRANDR_CFLAGS)
9437 AC_SUBST(XRANDR_LIBS)
9438 AC_SUBST(ENABLE_RANDR)
9440 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9443 if test $_os = iOS -o $_os = Android; then
9446 AC_MSG_CHECKING([for webdav library])
9447 case "$WITH_WEBDAV" in
9449 AC_MSG_RESULT([serf])
9450 # Check for system apr-util
9451 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9452 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9453 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9454 if test "$COM" = "MSC"; then
9456 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9457 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9460 # Check for system serf
9461 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9462 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9463 if test "$COM" = "MSC"; then
9464 SERF_LIB_DIR="Release"
9465 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9466 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9470 AC_MSG_RESULT([neon])
9471 # Check for system neon
9472 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9473 if test "$with_system_neon" = "yes"; then
9474 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9475 libo_MINGW_CHECK_DLL([libneon])
9476 libo_MINGW_TRY_DLL([libtasn1])
9477 libo_MINGW_TRY_DLL([libgnutls])
9481 AC_SUBST(NEON_VERSION)
9484 AC_MSG_RESULT([none, disabled])
9488 AC_SUBST(WITH_WEBDAV)
9490 dnl ===================================================================
9491 dnl Check for disabling cve_tests
9492 dnl ===================================================================
9493 AC_MSG_CHECKING([whether to execute CVE tests])
9494 # If not explicitly enabled or disabled, default
9495 if test -z "$enable_cve_tests"; then
9498 # Default cves off for windows with its wild and wonderful
9499 # varienty of AV software kicking in and panicing
9504 enable_cve_tests=yes
9508 if test "$enable_cve_tests" = "no"; then
9510 DISABLE_CVE_TESTS=TRUE
9511 AC_SUBST(DISABLE_CVE_TESTS)
9513 AC_MSG_RESULT([yes])
9516 dnl ===================================================================
9517 dnl Check for enabling chart XShape tests
9518 dnl ===================================================================
9519 AC_MSG_CHECKING([whether to execute chart XShape tests])
9520 if test "$enable_chart_tests" = "yes"; then
9521 AC_MSG_RESULT([yes])
9522 ENABLE_CHART_TESTS=TRUE
9523 AC_SUBST(ENABLE_CHART_TESTS)
9528 dnl ===================================================================
9529 dnl Check for system openssl
9530 dnl ===================================================================
9532 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9533 if test "$enable_openssl" = "yes"; then
9535 if test "$_os" = Darwin ; then
9536 # OpenSSL is deprecated when building for 10.7 or later.
9538 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9539 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9541 with_system_openssl=no
9542 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9543 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9544 && test "$with_system_openssl" != "no"; then
9545 with_system_openssl=yes
9548 OPENSSL_LIBS="-lssl -lcrypto"
9550 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9552 if test "$with_system_openssl" = "yes"; then
9553 libo_MINGW_CHECK_DLL([libssl])
9554 libo_MINGW_CHECK_DLL([libcrypto])
9555 AC_MSG_CHECKING([whether openssl supports SHA512])
9557 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9559 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9563 AC_MSG_RESULT([yes])
9564 DISABLE_OPENSSL=TRUE
9566 # warn that although OpenSSL is disabled, system libraries may be depending on it
9567 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9568 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9571 AC_SUBST([DISABLE_OPENSSL])
9573 dnl ===================================================================
9574 dnl Check for building gnutls
9575 dnl ===================================================================
9576 AC_MSG_CHECKING([whether to use gnutls])
9577 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
9578 AC_MSG_RESULT([yes])
9580 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9581 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9582 available in the system to use as replacement.]]))
9583 FilterLibs "${LIBGCRYPT_LIBS}"
9584 LIBGCRYPT_LIBS="${filteredlibs}"
9589 AC_SUBST([LIBGCRYPT_CFLAGS])
9590 AC_SUBST([LIBGCRYPT_LIBS])
9592 dnl ===================================================================
9593 dnl Check for system redland
9594 dnl ===================================================================
9595 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9596 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9597 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9598 if test "$with_system_redland" = "yes"; then
9599 libo_MINGW_CHECK_DLL([librdf])
9600 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9601 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9602 libo_MINGW_TRY_DLL([libraptor])
9603 libo_MINGW_TRY_DLL([librasqal])
9604 libo_MINGW_TRY_DLL([libsqlite3])
9610 AC_SUBST(RAPTOR_MAJOR)
9611 AC_SUBST(RASQAL_MAJOR)
9612 AC_SUBST(REDLAND_MAJOR)
9614 dnl ===================================================================
9615 dnl Check for system hunspell
9616 dnl ===================================================================
9617 AC_MSG_CHECKING([which libhunspell to use])
9618 if test "$with_system_hunspell" = "yes"; then
9619 AC_MSG_RESULT([external])
9620 SYSTEM_HUNSPELL=TRUE
9622 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9623 if test "$HUNSPELL_PC" != "TRUE"; then
9624 AC_CHECK_HEADER(hunspell.hxx, [],
9626 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9627 [AC_MSG_ERROR(hunspell headers not found.)], [])
9629 AC_CHECK_LIB([hunspell], [main], [:],
9630 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9631 HUNSPELL_LIBS=-lhunspell
9634 libo_MINGW_CHECK_DLL([libhunspell-1.6])
9635 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9636 FilterLibs "${HUNSPELL_LIBS}"
9637 HUNSPELL_LIBS="${filteredlibs}"
9639 AC_MSG_RESULT([internal])
9641 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9642 if test "$COM" = "MSC"; then
9643 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9645 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.6"
9647 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9649 AC_SUBST(SYSTEM_HUNSPELL)
9650 AC_SUBST(HUNSPELL_CFLAGS)
9651 AC_SUBST(HUNSPELL_LIBS)
9653 dnl ===================================================================
9654 dnl Checking for altlinuxhyph
9655 dnl ===================================================================
9656 AC_MSG_CHECKING([which altlinuxhyph to use])
9657 if test "$with_system_altlinuxhyph" = "yes"; then
9658 AC_MSG_RESULT([external])
9660 AC_CHECK_HEADER(hyphen.h, [],
9661 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9662 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9663 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9664 [#include <hyphen.h>])
9665 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9666 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9667 if test -z "$HYPHEN_LIB"; then
9668 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9669 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9671 if test -z "$HYPHEN_LIB"; then
9672 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9673 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9675 libo_MINGW_CHECK_DLL([libhyphen])
9677 AC_MSG_RESULT([internal])
9679 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9680 if test "$COM" = "MSC"; then
9681 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9683 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9686 AC_SUBST(SYSTEM_HYPH)
9687 AC_SUBST(HYPHEN_LIB)
9689 dnl ===================================================================
9690 dnl Checking for mythes
9691 dnl ===================================================================
9692 AC_MSG_CHECKING([which mythes to use])
9693 if test "$with_system_mythes" = "yes"; then
9694 AC_MSG_RESULT([external])
9697 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9698 if test "$MYTHES_PKGCONFIG" = "no"; then
9699 AC_CHECK_HEADER(mythes.hxx, [],
9700 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9701 AC_CHECK_LIB([mythes-1.2], [main], [:],
9702 [ MYTHES_FOUND=no], [])
9703 if test "$MYTHES_FOUND" = "no"; then
9704 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9705 [ MYTHES_FOUND=no], [])
9707 if test "$MYTHES_FOUND" = "no"; then
9708 AC_MSG_ERROR([mythes library not found!.])
9712 libo_MINGW_CHECK_DLL([libmythes-1.2])
9713 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9714 FilterLibs "${MYTHES_LIBS}"
9715 MYTHES_LIBS="${filteredlibs}"
9717 AC_MSG_RESULT([internal])
9719 BUILD_TYPE="$BUILD_TYPE MYTHES"
9720 if test "$COM" = "MSC"; then
9721 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9723 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9726 AC_SUBST(SYSTEM_MYTHES)
9727 AC_SUBST(MYTHES_CFLAGS)
9728 AC_SUBST(MYTHES_LIBS)
9730 dnl ===================================================================
9731 dnl How should we build the linear programming solver ?
9732 dnl ===================================================================
9735 AC_MSG_CHECKING([whether to build with CoinMP])
9736 if test "$enable_coinmp" != "no"; then
9738 AC_MSG_RESULT([yes])
9739 if test "$with_system_coinmp" = "yes"; then
9741 PKG_CHECK_MODULES(COINMP, coinmp coinutils)
9742 FilterLibs "${COINMP_LIBS}"
9743 COINMP_LIBS="${filteredlibs}"
9745 BUILD_TYPE="$BUILD_TYPE COINMP"
9750 AC_SUBST(ENABLE_COINMP)
9751 AC_SUBST(SYSTEM_COINMP)
9752 AC_SUBST(COINMP_CFLAGS)
9753 AC_SUBST(COINMP_LIBS)
9756 AC_MSG_CHECKING([whether to build with lpsolve])
9757 if test "$enable_lpsolve" != "no"; then
9759 AC_MSG_RESULT([yes])
9763 AC_SUBST(ENABLE_LPSOLVE)
9765 if test "$ENABLE_LPSOLVE" = TRUE; then
9766 AC_MSG_CHECKING([which lpsolve to use])
9767 if test "$with_system_lpsolve" = "yes"; then
9768 AC_MSG_RESULT([external])
9770 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9771 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9773 # some systems need this. Like Ubuntu....
9774 AC_CHECK_LIB(m, floor)
9775 AC_CHECK_LIB(dl, dlopen)
9776 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9777 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9779 libo_MINGW_CHECK_DLL([lpsolve55])
9781 AC_MSG_RESULT([internal])
9783 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9786 AC_SUBST(SYSTEM_LPSOLVE)
9788 dnl ===================================================================
9789 dnl Checking for libexttextcat
9790 dnl ===================================================================
9791 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
9792 if test "$with_system_libexttextcat" = "yes"; then
9793 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9795 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9797 dnl ***************************************
9798 dnl testing libc version for Linux...
9799 dnl ***************************************
9800 if test "$_os" = "Linux"; then
9801 AC_MSG_CHECKING([whether libc is >= 2.1.1])
9802 exec 6>/dev/null # no output
9803 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
9804 exec 6>&1 # output on again
9805 if test "$HAVE_LIBC"; then
9806 AC_MSG_RESULT([yes])
9808 AC_MSG_ERROR([no, upgrade libc])
9812 dnl =========================================
9813 dnl Check for the Windows SDK.
9814 dnl =========================================
9815 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
9816 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
9817 if test "$_os" = "WINNT"; then
9818 AC_MSG_CHECKING([for Windows SDK])
9819 if test "$build_os" = "cygwin"; then
9821 WINDOWS_SDK_HOME=$winsdktest
9823 # normalize if found
9824 if test -n "$WINDOWS_SDK_HOME"; then
9825 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
9826 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
9829 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
9832 if test -n "$WINDOWS_SDK_HOME"; then
9833 # Remove a possible trailing backslash
9834 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
9836 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
9837 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
9838 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
9839 have_windows_sdk_headers=yes
9840 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
9841 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
9842 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
9843 have_windows_sdk_headers=yes
9844 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
9845 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
9846 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
9847 have_windows_sdk_headers=yes
9849 have_windows_sdk_headers=no
9852 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
9853 have_windows_sdk_libs=yes
9854 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
9855 have_windows_sdk_libs=yes
9857 have_windows_sdk_libs=no
9860 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
9861 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
9862 the Windows SDK are installed.])
9865 if test ! -f "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
9866 -o ! -f "$WINDOWS_SDK_HOME/bin/msidb.exe" \
9867 -o ! -f "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
9868 -o ! -f "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
9869 elif test ! -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
9870 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
9871 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
9872 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
9874 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
9878 if test -z "$WINDOWS_SDK_HOME"; then
9879 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
9880 elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
9881 WINDOWS_SDK_VERSION=70
9882 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
9883 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
9884 WINDOWS_SDK_VERSION=80
9885 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
9886 dnl compatibility warning if not explicitly choosing the 80 SDK:
9887 if test -z "$with_windows_sdk"; then
9888 AC_MSG_WARN([If a build should run on Windows XP,])
9889 AC_MSG_WARN([use --with-windows-sdk=7.1A])
9890 add_warning "If a build should run on Windows XP,"
9891 add_warning "use --with-windows-sdk=7.1A"
9893 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
9894 WINDOWS_SDK_VERSION=81
9895 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
9896 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
9897 WINDOWS_SDK_VERSION=10
9898 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
9900 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
9902 PathFormat "$WINDOWS_SDK_HOME"
9903 WINDOWS_SDK_HOME="$formatted_path"
9904 if test "$build_os" = "cygwin"; then
9905 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
9906 if test -d "$WINDOWS_SDK_HOME/include/um"; then
9907 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
9908 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
9909 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
9913 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
9914 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
9915 dnl but not in v8.0), so allow this to be overridden with a
9916 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
9917 dnl and configuration error if no WiLangId.vbs is found would arguably be
9918 dnl better, but I do not know under which conditions exactly it is needed by
9920 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
9921 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
9922 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9923 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
9925 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9926 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
9928 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9929 AC_MSG_WARN([WiLangId.vbs not found - building translated packages will fail])
9930 add_warning "WiLangId.vbs not found - building translated packages will fail"
9934 AC_SUBST(WINDOWS_SDK_HOME)
9935 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
9936 AC_SUBST(WINDOWS_SDK_VERSION)
9937 AC_SUBST(WINDOWS_SDK_WILANGID)
9939 dnl =========================================
9940 dnl Check for uuidgen
9941 dnl =========================================
9942 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9943 if test "$WITH_MINGW" = "yes"; then
9944 AC_PATH_PROG([UUIDGEN], [uuid])
9945 if test -z "$UUIDGEN"; then
9946 AC_MSG_WARN([uuid is needed for building installation sets])
9949 # presence is already tested above in the WINDOWS_SDK_HOME check
9954 AC_PATH_PROG([UUIDGEN], [uuidgen])
9955 if test -z "$UUIDGEN"; then
9956 AC_MSG_WARN([uuid is needed for building installation sets])
9960 dnl ***************************************
9961 dnl Checking for bison and flex
9962 dnl ***************************************
9963 AC_PATH_PROG(BISON, bison)
9964 if test -z "$BISON"; then
9965 AC_MSG_ERROR([no bison found in \$PATH, install it])
9967 AC_MSG_CHECKING([the bison version])
9968 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9969 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9970 # Accept newer than 2.0
9971 if test "$_bison_longver" -lt 2000; then
9972 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
9976 AC_PATH_PROG(FLEX, flex)
9977 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9978 FLEX=`cygpath -m $FLEX`
9980 if test -z "$FLEX"; then
9981 AC_MSG_ERROR([no flex found in \$PATH, install it])
9983 AC_MSG_CHECKING([the flex version])
9984 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
9985 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
9986 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
9990 dnl ***************************************
9991 dnl Checking for patch
9992 dnl ***************************************
9993 AC_PATH_PROG(PATCH, patch)
9994 if test -z "$PATCH"; then
9995 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
9998 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9999 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
10000 if test -z "$with_gnu_patch"; then
10003 if test -x "$with_gnu_patch"; then
10004 GNUPATCH=$with_gnu_patch
10006 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
10010 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
10011 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
10012 AC_MSG_RESULT([yes])
10014 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
10020 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10021 GNUPATCH=`cygpath -m $GNUPATCH`
10024 dnl We also need to check for --with-gnu-cp
10026 if test -z "$with_gnu_cp"; then
10027 # check the place where the good stuff is hidden on Solaris...
10028 if test -x /usr/gnu/bin/cp; then
10029 GNUCP=/usr/gnu/bin/cp
10031 AC_PATH_PROGS(GNUCP, gnucp cp)
10033 if test -z $GNUCP; then
10034 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
10037 if test -x "$with_gnu_cp"; then
10040 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
10044 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
10045 GNUCP=`cygpath -m $GNUCP`
10048 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
10049 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
10050 AC_MSG_RESULT([yes])
10051 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
10052 AC_MSG_RESULT([yes])
10054 case "$build_os" in
10055 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
10058 AC_MSG_RESULT([no gnucp found - using the system's cp command])
10061 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
10070 dnl ***************************************
10071 dnl testing assembler path
10072 dnl ***************************************
10074 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
10075 if test "$BITNESS_OVERRIDE" = ""; then
10079 if test "$vcexpress" = "Express"; then
10081 assembler_bin=bin/x86_amd64
10084 assembler_bin=bin/amd64
10088 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
10089 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
10090 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
10091 AC_MSG_RESULT([found])
10092 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
10094 AC_MSG_ERROR([Configure did not find $assembler assembler.])
10097 PathFormat "$ASM_HOME"
10098 ASM_HOME="$formatted_path"
10105 dnl ===================================================================
10106 dnl We need zip and unzip
10107 dnl ===================================================================
10108 AC_PATH_PROG(ZIP, zip)
10109 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10110 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10111 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],,)
10114 AC_PATH_PROG(UNZIP, unzip)
10115 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10117 dnl ===================================================================
10118 dnl Zip must be a specific type for different build types.
10119 dnl ===================================================================
10120 if test $build_os = cygwin; then
10121 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10122 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10126 dnl ===================================================================
10127 dnl We need touch with -h option support.
10128 dnl ===================================================================
10129 AC_PATH_PROG(TOUCH, touch)
10130 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10132 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10133 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],,)
10136 dnl ===================================================================
10137 dnl Set vcl option: coordinate device in double or sal_Int32
10138 dnl ===================================================================
10140 dnl disabled for now, we don't want subtle differences between OSs
10141 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10142 dnl if test "$_os" = "Darwin" -o $_os = iOS ; then
10143 dnl AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10144 dnl AC_MSG_RESULT([double])
10146 dnl AC_MSG_RESULT([sal_Int32])
10149 dnl ===================================================================
10150 dnl Test which vclplugs have to be built.
10151 dnl ===================================================================
10153 if test "$USING_X11" != TRUE; then
10160 if test "x$enable_gtk3" = "xyes"; then
10161 if test "$with_system_cairo" = no; then
10162 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10164 : ${with_system_cairo:=yes}
10165 PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.8 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
10166 if test "x$ENABLE_GTK3" = "xTRUE"; then
10168 dnl Avoid installed by unpackaged files for now.
10169 if test -z "$PKGFORMAT"; then
10170 GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
10173 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10175 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10176 FilterLibs "${GTK3_LIBS}"
10177 GTK3_LIBS="${filteredlibs}"
10179 AC_SUBST(GTK3_LIBS)
10180 AC_SUBST(GTK3_CFLAGS)
10181 AC_SUBST(ENABLE_GTK3)
10184 if test "x$enable_gtk" = "xyes"; then
10185 if test "$with_system_cairo" = no; then
10186 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10188 : ${with_system_cairo:=yes}
10190 AC_DEFINE(ENABLE_GTK)
10193 AC_SUBST(ENABLE_GTK)
10196 if test "x$enable_tde" = "xyes"; then
10198 AC_DEFINE(ENABLE_TDE)
10201 AC_SUBST(ENABLE_TDE)
10204 if test "x$enable_kde4" = "xyes"; then
10206 AC_DEFINE(ENABLE_KDE4)
10209 AC_SUBST(ENABLE_KDE4)
10212 build_vcl_plugins="$R"
10213 if test -z "$build_vcl_plugins"; then
10214 build_vcl_plugins="none"
10216 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10218 dnl ===================================================================
10219 dnl check for dbus support
10220 dnl ===================================================================
10225 if test "$enable_dbus" = "no"; then
10229 AC_MSG_CHECKING([whether to enable DBUS support])
10230 if test "$test_dbus" = "yes"; then
10232 AC_MSG_RESULT([yes])
10233 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
10234 AC_DEFINE(ENABLE_DBUS)
10235 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10236 FilterLibs "${DBUS_LIBS}"
10237 DBUS_LIBS="${filteredlibs}"
10239 AC_MSG_RESULT([no])
10242 AC_SUBST(ENABLE_DBUS)
10243 AC_SUBST(DBUS_CFLAGS)
10244 AC_SUBST(DBUS_LIBS)
10246 AC_MSG_CHECKING([whether to enable Impress remote control])
10247 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10248 AC_MSG_RESULT([yes])
10249 ENABLE_SDREMOTE=TRUE
10250 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10252 # If not explicitly enabled or disabled, default
10253 if test -z "$enable_sdremote_bluetooth"; then
10256 # Default to yes for these
10257 enable_sdremote_bluetooth=yes
10261 enable_sdremote_bluetooth=no
10265 # $enable_sdremote_bluetooth is guaranteed non-empty now
10267 if test "$enable_sdremote_bluetooth" != "no"; then
10268 if test "$OS" = "LINUX"; then
10269 if test "$ENABLE_DBUS" = "TRUE"; then
10270 AC_MSG_RESULT([yes])
10271 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10272 dnl ===================================================================
10273 dnl Check for system bluez
10274 dnl ===================================================================
10275 AC_MSG_CHECKING([which Bluetooth header to use])
10276 if test "$with_system_bluez" = "yes"; then
10277 AC_MSG_RESULT([external])
10278 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10279 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10282 AC_MSG_RESULT([internal])
10286 AC_MSG_RESULT([no, dbus disabled])
10287 ENABLE_SDREMOTE_BLUETOOTH=
10291 AC_MSG_RESULT([yes])
10292 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10296 AC_MSG_RESULT([no])
10297 ENABLE_SDREMOTE_BLUETOOTH=
10303 AC_MSG_RESULT([no])
10305 AC_SUBST(ENABLE_SDREMOTE)
10306 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10307 AC_SUBST(SYSTEM_BLUEZ)
10309 dnl ===================================================================
10310 dnl Check whether the gtk 2.0 libraries are available.
10311 dnl ===================================================================
10315 ENABLE_SYSTRAY_GTK=""
10316 if test "$test_gtk" = "yes"; then
10318 if test "$ENABLE_GTK" = "TRUE"; then
10319 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]))
10320 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10321 FilterLibs "${GTK_LIBS}"
10322 GTK_LIBS="${filteredlibs}"
10323 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]))
10324 BUILD_TYPE="$BUILD_TYPE GTK"
10325 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10326 FilterLibs "${GTHREAD_LIBS}"
10327 GTHREAD_LIBS="${filteredlibs}"
10329 if test "x$enable_systray" = "xyes"; then
10330 ENABLE_SYSTRAY_GTK="TRUE"
10333 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10334 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10335 [ENABLE_GTK_PRINT="TRUE"],
10336 [ENABLE_GTK_PRINT=""])
10337 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10338 FilterLibs "${GTK_PRINT_LIBS}"
10339 GTK_PRINT_LIBS="${filteredlibs}"
10341 AC_MSG_CHECKING([whether to enable GIO support])
10342 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10343 dnl Need at least 2.26 for the dbus support.
10344 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10345 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10346 if test "$ENABLE_GIO" = "TRUE"; then
10347 AC_DEFINE(ENABLE_GIO)
10348 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10349 FilterLibs "${GIO_LIBS}"
10350 GIO_LIBS="${filteredlibs}"
10353 AC_MSG_RESULT([no])
10357 AC_SUBST(ENABLE_GIO)
10358 AC_SUBST(GIO_CFLAGS)
10360 AC_SUBST(ENABLE_SYSTRAY_GTK)
10361 AC_SUBST(GTK_CFLAGS)
10363 AC_SUBST(GTHREAD_CFLAGS)
10364 AC_SUBST(GTHREAD_LIBS)
10365 AC_SUBST([ENABLE_GTK_PRINT])
10366 AC_SUBST([GTK_PRINT_CFLAGS])
10367 AC_SUBST([GTK_PRINT_LIBS])
10370 dnl ===================================================================
10371 dnl Check whether the Telepathy libraries are available.
10372 dnl ===================================================================
10374 ENABLE_TELEPATHY=""
10375 TELEPATHY_CFLAGS=""
10378 AC_MSG_CHECKING([whether to enable Telepathy support])
10379 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
10380 ENABLE_TELEPATHY="TRUE"
10381 AC_DEFINE(ENABLE_TELEPATHY)
10382 AC_MSG_RESULT([yes])
10383 PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 gtk+-2.0 >= 2.18.0 )
10384 TELEPATHY_CFLAGS=$(printf '%s' "$TELEPATHY_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10385 FilterLibs "${TELEPATHY_LIBS}"
10386 TELEPATHY_LIBS="${filteredlibs}"
10388 AC_MSG_RESULT([no])
10391 AC_SUBST(ENABLE_TELEPATHY)
10392 AC_SUBST(TELEPATHY_CFLAGS)
10393 AC_SUBST(TELEPATHY_LIBS)
10396 dnl ===================================================================
10398 SPLIT_APP_MODULES=""
10399 if test "$enable_split_app_modules" = "yes"; then
10400 SPLIT_APP_MODULES="TRUE"
10402 AC_SUBST(SPLIT_APP_MODULES)
10404 SPLIT_OPT_FEATURES=""
10405 if test "$enable_split_opt_features" = "yes"; then
10406 SPLIT_OPT_FEATURES="TRUE"
10408 AC_SUBST(SPLIT_OPT_FEATURES)
10410 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10411 if test "$enable_cairo_canvas" = yes; then
10412 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10414 enable_cairo_canvas=no
10415 elif test -z "$enable_cairo_canvas"; then
10416 enable_cairo_canvas=yes
10419 ENABLE_CAIRO_CANVAS=""
10420 if test "$enable_cairo_canvas" = "yes"; then
10422 ENABLE_CAIRO_CANVAS="TRUE"
10423 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10425 AC_SUBST(ENABLE_CAIRO_CANVAS)
10427 dnl ===================================================================
10428 dnl Check whether the GStreamer libraries are available.
10429 dnl It's possible to build avmedia with both GStreamer backends!
10430 dnl ===================================================================
10432 ENABLE_GSTREAMER_1_0=""
10434 if test "$build_gstreamer_1_0" = "yes"; then
10436 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10437 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10438 ENABLE_GSTREAMER_1_0="TRUE"
10439 AC_MSG_RESULT([yes])
10440 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10441 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10442 FilterLibs "${GSTREAMER_1_0_LIBS}"
10443 GSTREAMER_1_0_LIBS="${filteredlibs}"
10445 AC_MSG_RESULT([no])
10448 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10449 AC_SUBST(GSTREAMER_1_0_LIBS)
10450 AC_SUBST(ENABLE_GSTREAMER_1_0)
10453 ENABLE_GSTREAMER_0_10=""
10454 if test "$build_gstreamer_0_10" = "yes"; then
10456 AC_MSG_CHECKING([whether to enable the GStreamer 0.10 avmedia backend])
10457 if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10458 ENABLE_GSTREAMER_0_10="TRUE"
10459 AC_MSG_RESULT([yes])
10460 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10],, [
10461 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10] )
10463 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10464 FilterLibs "${GSTREAMER_0_10_LIBS}"
10465 GSTREAMER_0_10_LIBS="${filteredlibs}"
10467 AC_MSG_RESULT([no])
10471 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10472 AC_SUBST(GSTREAMER_0_10_LIBS)
10473 AC_SUBST(ENABLE_GSTREAMER_0_10)
10475 dnl ===================================================================
10476 dnl Check whether to build the VLC avmedia backend
10477 dnl ===================================================================
10481 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10482 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10484 AC_MSG_RESULT([yes])
10486 AC_MSG_RESULT([no])
10488 AC_SUBST(ENABLE_VLC)
10490 ENABLE_OPENGL_TRANSITIONS=
10491 ENABLE_OPENGL_CANVAS=
10492 if test $_os = iOS -o $_os = Android; then
10494 elif test "$_os" = "Darwin"; then
10495 # We use frameworks on Mac OS X, no need for detail checks
10496 ENABLE_OPENGL_TRANSITIONS=TRUE
10497 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10498 ENABLE_OPENGL_CANVAS=TRUE
10499 elif test $_os = WINNT; then
10500 ENABLE_OPENGL_TRANSITIONS=TRUE
10501 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10502 ENABLE_OPENGL_CANVAS=TRUE
10504 if test "$USING_X11" = TRUE; then
10505 AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10506 ENABLE_OPENGL_TRANSITIONS=TRUE
10507 AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10508 ENABLE_OPENGL_CANVAS=TRUE
10512 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10513 AC_SUBST(ENABLE_OPENGL_CANVAS)
10515 dnl =================================================
10516 dnl Check whether to build with OpenCL support.
10517 dnl =================================================
10519 if test $_os != iOS -a $_os != Android; then
10520 # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10521 # platform (optional at run-time, used through clew).
10522 BUILD_TYPE="$BUILD_TYPE OPENCL"
10523 AC_DEFINE(HAVE_FEATURE_OPENCL)
10526 dnl ===================================================================
10527 dnl Check whether to enable glTF support
10528 dnl ===================================================================
10529 AC_MSG_CHECKING([whether to enable glTF support])
10531 if test "x$enable_gltf" != "xno" -a $_os != iOS -a $_os != Android -a "$ENABLE_HEADLESS" = ""; then
10533 AC_MSG_RESULT([yes])
10534 AC_DEFINE(HAVE_FEATURE_GLTF,1)
10535 if test "$with_system_libgltf" = "yes"; then
10536 SYSTEM_LIBGLTF=TRUE
10537 PKG_CHECK_MODULES( LIBGLTF, [libgltf-0.0 >= 0.0.1] )
10538 FilterLibs "${LIBGLTF_LIBS}"
10539 LIBGLTF_LIBS="${filteredlibs}"
10541 BUILD_TYPE="$BUILD_TYPE LIBGLTF"
10544 AC_MSG_RESULT([no])
10546 AC_SUBST(ENABLE_GLTF)
10547 AC_SUBST(SYSTEM_LIBGLTF)
10548 AC_SUBST(LIBGLTF_CFLAGS)
10549 AC_SUBST(LIBGLTF_LIBS)
10551 dnl ===================================================================
10552 dnl Check whether to enable COLLADA support
10553 dnl ===================================================================
10554 AC_MSG_CHECKING([whether to enable COLLADA support])
10556 if test "$enable_collada" != "no" -a "$ENABLE_GLTF" = "TRUE"; then
10557 AC_MSG_RESULT([yes])
10558 ENABLE_COLLADA=TRUE
10559 AC_DEFINE(HAVE_FEATURE_COLLADA,1)
10561 AC_MSG_CHECKING([which OPENCOLLADA to use])
10562 if test "$with_system_opencollada" = "yes"; then
10563 AC_MSG_RESULT([external])
10564 SYSTEM_OPENCOLLADA=TRUE
10565 AS_IF([test -n "$OPENCOLLADA_CFLAGS"],[],[AC_MSG_ERROR([export OPENCOLLADA_CFLAGS])])
10566 AS_IF([test -n "$OPENCOLLADA_LIBS"],[],[AC_MSG_ERROR([export OPENCOLLADA_LIBS])])
10567 AC_LANG_PUSH([C++])
10568 save_CXXFLAGS=$CXXFLAGS
10569 save_CPPFLAGS=$CPPFLAGS
10570 CXXFLAGS="$CXXFLAGS $OPENCOLLADA_CFLAGS"
10571 CPPFLAGS="$CPPFLAGS $OPENCOLLADA_CFLAGS"
10575 COLLADASaxFWLLoader.h \
10576 GeneratedSaxParser.h,
10578 [AC_MSG_ERROR([openCOLLADA headers not found. Install openCOLLADA])],
10580 CXXFLAGS=$save_CXXFLAGS
10581 CPPFLAGS=$save_CPPFLAGS
10583 OPENCOLLADA_CFLAGS=$(printf '%s' "$OPENCOLLADA_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10584 FilterLibs "${OPENCOLLADA_LIBS}"
10585 OPENCOLLADA_LIBS="${filteredlibs}"
10587 AC_MSG_RESULT([internal])
10588 BUILD_TYPE="$BUILD_TYPE OPENCOLLADA"
10591 AC_MSG_CHECKING([which collada2gltf to use])
10592 if test "$with_system_collada2gltf" = "yes"; then
10593 if test "$with_system_opencollada" = "no"; then
10594 AC_MSG_ERROR([the combination of system collada2gltf and internal openCOLLADA is not allowed])
10596 AC_MSG_RESULT([external])
10597 SYSTEM_COLLADA2GLTF=TRUE
10598 AS_IF([test -n "$COLLADA2GLTF_CFLAGS"],[],[AC_MSG_ERROR([export COLLADA2GLTF_CFLAGS])])
10599 AS_IF([test -n "$COLLADA2GLTF_LIBS"],[],[AC_MSG_ERROR([export COLLADA2GLTF_LIBS])])
10600 AC_LANG_PUSH([C++])
10601 save_CXXFLAGS=$CXXFLAGS
10602 save_CPPFLAGS=$CPPFLAGS
10603 CXXFLAGS="$CXXFLAGS $COLLADA2GLTF_CFLAGS $OPENCOLLADA_CFLAGS $CXXFLAGS_CXX11"
10604 CPPFLAGS="$CPPFLAGS $COLLADA2GLTF_CFLAGS $OPENCOLLADA_CFLAGS $CXXFLAGS_CXX11"
10609 [AC_MSG_ERROR([collada2gltf headers not found. Install collada2gltf])],
10611 CXXFLAGS=$save_CXXFLAGS
10612 CPPFLAGS=$save_CPPFLAGS
10614 COLLADA2GLTF_CFLAGS=$(printf '%s' "$COLLADA2GLTF_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10615 FilterLibs "${COLLADA2GLTF_LIBS}"
10616 COLLADA2GLTF_LIBS="${filteredlibs}"
10618 AC_MSG_RESULT([internal])
10619 BUILD_TYPE="$BUILD_TYPE COLLADA2GLTF"
10622 AC_MSG_RESULT([no])
10624 AC_SUBST(ENABLE_COLLADA)
10625 AC_SUBST([OPENCOLLADA_CFLAGS])
10626 AC_SUBST([OPENCOLLADA_LIBS])
10627 AC_SUBST([SYSTEM_OPENCOLLADA])
10629 AC_SUBST([COLLADA2GLTF_CFLAGS])
10630 AC_SUBST([COLLADA2GLTF_LIBS])
10631 AC_SUBST([SYSTEM_COLLADA2GLTF])
10633 if test "$enable_dconf" != no; then
10634 PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10635 if test "$enable_dconf" = yes; then
10636 AC_MSG_ERROR([dconf not found])
10641 AC_MSG_CHECKING([whether to enable dconf])
10642 if test "$enable_dconf" = no; then
10646 AC_MSG_RESULT([no])
10649 AC_DEFINE(ENABLE_DCONF)
10650 AC_MSG_RESULT([yes])
10652 AC_SUBST([DCONF_CFLAGS])
10653 AC_SUBST([DCONF_LIBS])
10654 AC_SUBST([ENABLE_DCONF])
10657 AC_MSG_CHECKING([whether to build the PDF import feature])
10659 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10660 AC_MSG_RESULT([yes])
10661 ENABLE_PDFIMPORT=TRUE
10662 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10664 dnl ===================================================================
10665 dnl Check for system poppler
10666 dnl ===================================================================
10667 AC_MSG_CHECKING([which PDF import backend to use])
10668 if test "$with_system_poppler" = "yes"; then
10669 AC_MSG_RESULT([external])
10670 SYSTEM_POPPLER=TRUE
10671 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10672 AC_LANG_PUSH([C++])
10673 save_CXXFLAGS=$CXXFLAGS
10674 save_CPPFLAGS=$CPPFLAGS
10675 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10676 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10677 AC_CHECK_HEADER([cpp/poppler-version.h],
10678 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10680 CXXFLAGS=$save_CXXFLAGS
10681 CPPFLAGS=$save_CPPFLAGS
10683 libo_MINGW_CHECK_DLL([libpoppler])
10684 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10686 FilterLibs "${POPPLER_LIBS}"
10687 POPPLER_LIBS="${filteredlibs}"
10689 AC_MSG_RESULT([internal])
10691 BUILD_TYPE="$BUILD_TYPE POPPLER"
10692 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10694 AC_DEFINE([ENABLE_PDFIMPORT],1)
10696 AC_MSG_RESULT([no])
10698 AC_SUBST(ENABLE_PDFIMPORT)
10699 AC_SUBST(SYSTEM_POPPLER)
10700 AC_SUBST(POPPLER_CFLAGS)
10701 AC_SUBST(POPPLER_LIBS)
10704 AC_MSG_CHECKING([whether to build PDFium])
10706 if test -z "$enable_pdfium" -o "$enable_pdfium" = yes; then
10707 AC_MSG_RESULT([yes])
10709 AC_DEFINE(HAVE_FEATURE_PDFIUM)
10710 BUILD_TYPE="$BUILD_TYPE PDFIUM"
10712 AC_MSG_RESULT([no])
10714 AC_SUBST(ENABLE_PDFIUM)
10716 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10717 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10718 AC_MSG_RESULT([yes])
10719 ENABLE_MEDIAWIKI=TRUE
10720 BUILD_TYPE="$BUILD_TYPE XSLTML"
10721 if test "x$with_java" = "xno"; then
10722 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10725 AC_MSG_RESULT([no])
10727 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10729 AC_SUBST(ENABLE_MEDIAWIKI)
10731 AC_MSG_CHECKING([whether to build the Report Builder])
10732 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10733 AC_MSG_RESULT([yes])
10734 ENABLE_REPORTBUILDER=TRUE
10735 AC_MSG_CHECKING([which jfreereport libs to use])
10736 if test "$with_system_jfreereport" = "yes"; then
10737 SYSTEM_JFREEREPORT=TRUE
10738 AC_MSG_RESULT([external])
10739 if test -z $SAC_JAR; then
10740 SAC_JAR=/usr/share/java/sac.jar
10742 if ! test -f $SAC_JAR; then
10743 AC_MSG_ERROR(sac.jar not found.)
10746 if test -z $LIBXML_JAR; then
10747 if test -f /usr/share/java/libxml-1.0.0.jar; then
10748 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
10749 elif test -f /usr/share/java/libxml.jar; then
10750 LIBXML_JAR=/usr/share/java/libxml.jar
10752 AC_MSG_ERROR(libxml.jar replacement not found.)
10754 elif ! test -f $LIBXML_JAR; then
10755 AC_MSG_ERROR(libxml.jar not found.)
10758 if test -z $FLUTE_JAR; then
10759 if test -f/usr/share/java/flute-1.3.0.jar; then
10760 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
10761 elif test -f /usr/share/java/flute.jar; then
10762 FLUTE_JAR=/usr/share/java/flute.jar
10764 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
10766 elif ! test -f $FLUTE_JAR; then
10767 AC_MSG_ERROR(flute-1.3.0.jar not found.)
10770 if test -z $JFREEREPORT_JAR; then
10771 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
10772 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
10773 elif test -f /usr/share/java/flow-engine.jar; then
10774 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
10776 AC_MSG_ERROR(jfreereport.jar replacement not found.)
10778 elif ! test -f $JFREEREPORT_JAR; then
10779 AC_MSG_ERROR(jfreereport.jar not found.)
10782 if test -z $LIBLAYOUT_JAR; then
10783 if test -f /usr/share/java/liblayout-0.2.9.jar; then
10784 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
10785 elif test -f /usr/share/java/liblayout.jar; then
10786 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
10788 AC_MSG_ERROR(liblayout.jar replacement not found.)
10790 elif ! test -f $LIBLAYOUT_JAR; then
10791 AC_MSG_ERROR(liblayout.jar not found.)
10794 if test -z $LIBLOADER_JAR; then
10795 if test -f /usr/share/java/libloader-1.0.0.jar; then
10796 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
10797 elif test -f /usr/share/java/libloader.jar; then
10798 LIBLOADER_JAR=/usr/share/java/libloader.jar
10800 AC_MSG_ERROR(libloader.jar replacement not found.)
10802 elif ! test -f $LIBLOADER_JAR; then
10803 AC_MSG_ERROR(libloader.jar not found.)
10806 if test -z $LIBFORMULA_JAR; then
10807 if test -f /usr/share/java/libformula-0.2.0.jar; then
10808 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
10809 elif test -f /usr/share/java/libformula.jar; then
10810 LIBFORMULA_JAR=/usr/share/java/libformula.jar
10812 AC_MSG_ERROR(libformula.jar replacement not found.)
10814 elif ! test -f $LIBFORMULA_JAR; then
10815 AC_MSG_ERROR(libformula.jar not found.)
10818 if test -z $LIBREPOSITORY_JAR; then
10819 if test -f /usr/share/java/librepository-1.0.0.jar; then
10820 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
10821 elif test -f /usr/share/java/librepository.jar; then
10822 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
10824 AC_MSG_ERROR(librepository.jar replacement not found.)
10826 elif ! test -f $LIBREPOSITORY_JAR; then
10827 AC_MSG_ERROR(librepository.jar not found.)
10830 if test -z $LIBFONTS_JAR; then
10831 if test -f /usr/share/java/libfonts-1.0.0.jar; then
10832 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
10833 elif test -f /usr/share/java/libfonts.jar; then
10834 LIBFONTS_JAR=/usr/share/java/libfonts.jar
10836 AC_MSG_ERROR(libfonts.jar replacement not found.)
10838 elif ! test -f $LIBFONTS_JAR; then
10839 AC_MSG_ERROR(libfonts.jar not found.)
10842 if test -z $LIBSERIALIZER_JAR; then
10843 if test -f /usr/share/java/libserializer-1.0.0.jar; then
10844 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
10845 elif test -f /usr/share/java/libserializer.jar; then
10846 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
10848 AC_MSG_ERROR(libserializer.jar replacement not found.)
10850 elif ! test -f $LIBSERIALIZER_JAR; then
10851 AC_MSG_ERROR(libserializer.jar not found.)
10854 if test -z $LIBBASE_JAR; then
10855 if test -f /usr/share/java/libbase-1.0.0.jar; then
10856 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
10857 elif test -f /usr/share/java/libbase.jar; then
10858 LIBBASE_JAR=/usr/share/java/libbase.jar
10860 AC_MSG_ERROR(libbase.jar replacement not found.)
10862 elif ! test -f $LIBBASE_JAR; then
10863 AC_MSG_ERROR(libbase.jar not found.)
10867 AC_MSG_RESULT([internal])
10868 SYSTEM_JFREEREPORT=
10869 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10872 AC_MSG_RESULT([no])
10873 ENABLE_REPORTBUILDER=
10874 SYSTEM_JFREEREPORT=
10876 AC_SUBST(ENABLE_REPORTBUILDER)
10877 AC_SUBST(SYSTEM_JFREEREPORT)
10879 AC_SUBST(LIBXML_JAR)
10880 AC_SUBST(FLUTE_JAR)
10881 AC_SUBST(JFREEREPORT_JAR)
10882 AC_SUBST(LIBBASE_JAR)
10883 AC_SUBST(LIBLAYOUT_JAR)
10884 AC_SUBST(LIBLOADER_JAR)
10885 AC_SUBST(LIBFORMULA_JAR)
10886 AC_SUBST(LIBREPOSITORY_JAR)
10887 AC_SUBST(LIBFONTS_JAR)
10888 AC_SUBST(LIBSERIALIZER_JAR)
10890 # this has to be here because both the Wiki Publisher and the SRB use
10892 COMMONS_LOGGING_VERSION=1.2
10893 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
10894 AC_MSG_CHECKING([which Apache commons-* libs to use])
10895 if test "$with_system_apache_commons" = "yes"; then
10896 SYSTEM_APACHE_COMMONS=TRUE
10897 AC_MSG_RESULT([external])
10898 if test -z $COMMONS_LOGGING_JAR; then
10899 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
10900 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
10901 elif test -f /usr/share/java/commons-logging.jar; then
10902 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
10904 AC_MSG_ERROR(commons-logging.jar replacement not found.)
10906 elif ! test -f $COMMONS_LOGGING_JAR; then
10907 AC_MSG_ERROR(commons-logging.jar not found.)
10910 AC_MSG_RESULT([internal])
10911 SYSTEM_APACHE_COMMONS=
10912 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
10915 AC_SUBST(SYSTEM_APACHE_COMMONS)
10916 AC_SUBST(COMMONS_LOGGING_JAR)
10917 AC_SUBST(COMMONS_LOGGING_VERSION)
10919 # scripting provider for BeanShell?
10920 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10921 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10922 AC_MSG_RESULT([yes])
10923 ENABLE_SCRIPTING_BEANSHELL=TRUE
10925 dnl ===================================================================
10926 dnl Check for system beanshell
10927 dnl ===================================================================
10928 AC_MSG_CHECKING([which beanshell to use])
10929 if test "$with_system_beanshell" = "yes"; then
10930 AC_MSG_RESULT([external])
10932 if test -z $BSH_JAR; then
10933 BSH_JAR=/usr/share/java/bsh.jar
10935 if ! test -f $BSH_JAR; then
10936 AC_MSG_ERROR(bsh.jar not found.)
10939 AC_MSG_RESULT([internal])
10941 BUILD_TYPE="$BUILD_TYPE BSH"
10944 AC_MSG_RESULT([no])
10945 ENABLE_SCRIPTING_BEANSHELL=
10946 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10948 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10949 AC_SUBST(SYSTEM_BSH)
10952 # scripting provider for JavaScript?
10953 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10954 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10955 AC_MSG_RESULT([yes])
10956 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10958 dnl ===================================================================
10959 dnl Check for system rhino
10960 dnl ===================================================================
10961 AC_MSG_CHECKING([which rhino to use])
10962 if test "$with_system_rhino" = "yes"; then
10963 AC_MSG_RESULT([external])
10965 if test -z $RHINO_JAR; then
10966 RHINO_JAR=/usr/share/java/js.jar
10968 if ! test -f $RHINO_JAR; then
10969 AC_MSG_ERROR(js.jar not found.)
10972 AC_MSG_RESULT([internal])
10974 BUILD_TYPE="$BUILD_TYPE RHINO"
10977 AC_MSG_RESULT([no])
10978 ENABLE_SCRIPTING_JAVASCRIPT=
10979 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10981 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10982 AC_SUBST(SYSTEM_RHINO)
10983 AC_SUBST(RHINO_JAR)
10985 # This is only used in KDE3/KDE4/TDE checks to determine if /usr/lib64
10986 # paths should be added to library search path. So lets put all 64-bit
10989 case "$host_cpu" in
10990 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
10991 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
10992 supports_multilib="yes"
10999 dnl ===================================================================
11000 dnl Check whether the TQt and TDE libraries are available.
11001 dnl ===================================================================
11005 if test "$_os" != "OpenBSD"; then
11008 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
11009 dnl Search paths for TQt and TDE
11010 if test -z "$supports_multilib"; then
11011 tqt_incdirs="$QTINC /usr/local/tqt3/include /usr/include/tqt3 /usr/include /usr/X11R6/include/X11/tqt3 /usr/X11R6/include/tqt3 /usr/lib/tqt3/include /usr/lib/tqt3/include /usr/share/tqt3/include /usr/local/include/X11/tqt3 $x_includes"
11012 tqt_libdirs="$QTLIB /usr/local/tqt3/lib /usr/lib/tqt3 /usr/lib /usr/X11R6/lib/X11/tqt3 /usr/X11R6/lib/tqt3 /usr/lib/tqt3/lib /usr/lib/tqt3/lib /usr/share/tqt3/lib /usr/local/lib/tqt3 $x_libraries"
11014 tqt_incdirs="$QTINC /usr/local/tqt3/include /usr/include/tqt3 /usr/include /usr/X11R6/include/X11/tqt3 /usr/X11R6/include/tqt3 /usr/lib64/tqt3/include /usr/lib64/tqt3/include /usr/share/tqt3/include /usr/lib/tqt3/include /usr/lib/tqt3/include /usr/local/include/X11/tqt3 $x_includes"
11015 tqt_libdirs="$QTLIB /usr/local/tqt3/lib64 /usr/lib64/tqt3 /usr/lib64 /usr/X11R6/lib64/X11/tqt3 /usr/X11R6/lib64/tqt3 /usr/lib64/tqt3/lib64 /usr/lib64/tqt3/lib64 /usr/share/tqt3/lib64 /usr/local/tqt3/lib /usr/lib/tqt3 /usr/lib /usr/X11R6/lib/X11/tqt3 /usr/X11R6/lib/tqt3 /usr/lib/tqt3/lib /usr/lib/tqt3/lib /usr/share/tqt3/lib /usr/local/lib/tqt3 $x_libraries"
11017 if test -n "$TQTDIR"; then
11018 tqt_incdirs="$TQTDIR/include $tqt_incdirs"
11019 if test -z "$supports_multilib"; then
11020 tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
11022 tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
11025 if test -z "$supports_multilib"; then
11026 tde_incdirs="/usr/lib/trinity/include /usr/local/trinity/include /usr/local/include /usr/trinity/include /usr/include/trinity /opt/trinity/include /opt/trinity/include $x_includes"
11027 tde_libdirs="/usr/lib/trinity/lib /usr/local/trinity/lib /usr/trinity/lib /usr/lib/trinity /usr/lib/trinity /usr/X11R6/lib /usr/local/lib /opt/trinity/lib /opt/trinity/lib /usr/X11R6/trinity/lib /usr/lib $x_libraries"
11029 tde_incdirs="/usr/lib64/trinity/include /usr/lib/trinity/include /usr/local/trinity/include /usr/local/include /usr/trinity/include /usr/include/trinity /opt/trinity/include /opt/trinity/include $x_includes"
11030 tde_libdirs="/usr/lib64/trinity/lib64 /usr/local/trinity/lib64 /usr/trinity/lib64 /usr/lib64/trinity /usr/lib64/trinity /usr/X11R6/lib64 /usr/local/lib64 /opt/trinity/lib64 /opt/trinity/lib64 /usr/X11R6/trinity/lib64 /usr/lib/trinity/lib /usr/local/trinity/lib /usr/trinity/lib /usr/lib/trinity /usr/lib/trinity /usr/lib /usr/X11R6/lib /usr/local/lib /opt/trinity/lib /opt/trinity/lib /usr/X11R6/trinity/lib /usr/lib64 $x_libraries"
11032 if test -n "$TDEDIR"; then
11033 tde_incdirs="$TDEDIR/include $tde_incdirs"
11034 if test -z "$supports_multilib"; then
11035 tde_libdirs="$TDEDIR/lib $tde_libdirs"
11037 tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
11042 tqt_test_include="ntqstyle.h"
11043 tde_test_include="kapp.h"
11045 if test "$_os" != "OpenBSD"; then
11046 tqt_test_library="libtqt-mt.so"
11047 tde_test_library="libDCOP.so"
11049 tqt_test_library="libtqt-mt.so*"
11050 tde_test_library="libDCOP.so*"
11053 dnl Check for TQt headers
11054 AC_MSG_CHECKING([for TQt headers])
11056 for tde_check in $tqt_incdirs; do
11057 if test -r "$tde_check/$tqt_test_include"; then
11058 tqt_incdir="$tde_check"
11062 AC_MSG_RESULT([$tqt_incdir])
11063 if test "x$tqt_incdir" = "xno"; then
11064 AC_MSG_ERROR([TQt headers not found. Please specify the root of
11065 your TQt installation by exporting TQTDIR before running "configure".])
11068 dnl Check for TQt libraries
11069 AC_MSG_CHECKING([for TQt libraries])
11071 for tqt_check in $tqt_libdirs; do
11072 if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
11073 tqt_libdir="$tqt_check"
11077 AC_MSG_RESULT([$tqt_libdir])
11078 if test "x$tqt_libdir" = "xno"; then
11079 AC_MSG_ERROR([TQt libraries not found. Please specify the root of
11080 your TQt installation by exporting TQTDIR before running "configure".])
11083 dnl Check for Meta Object Compiler
11084 AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
11085 if test "$MOC" = "no"; then
11086 AC_MSG_ERROR([TQt Meta Object Compiler not found. Please specify
11087 the root of your TQt installation by exporting TQTDIR before running "configure".])
11090 dnl Check for TDE headers
11091 AC_MSG_CHECKING([for TDE headers])
11093 for tde_check in $tde_incdirs; do
11094 if test -r "$tde_check/$tde_test_include"; then
11095 tde_incdir="$tde_check"
11099 AC_MSG_RESULT([$tde_incdir])
11100 if test "x$tde_incdir" = "xno"; then
11101 AC_MSG_ERROR([TDE headers not found. Please specify the root of
11102 your TDE installation by exporting TDEDIR before running "configure".])
11105 dnl Check for TDE libraries
11106 AC_MSG_CHECKING([for TDE libraries])
11108 for tde_check in $tde_libdirs; do
11109 if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
11110 tde_libdir="$tde_check"
11114 AC_MSG_RESULT([$tde_libdir])
11115 if test "x$tde_libdir" = "xno"; then
11116 AC_MSG_ERROR([TDE libraries not found. Please specify the root of
11117 your TDE installation by exporting TDEDIR before running "configure".])
11120 dnl Set the variables
11121 TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11122 TDE_LIBS="-L$tde_libdir -L$tqt_libdir -ltdeio -ltdeui -ltdecore -ltqt -ltqt-mt"
11124 AC_SUBST(TDE_CFLAGS)
11128 dnl ===================================================================
11129 dnl KDE4 Integration
11130 dnl ===================================================================
11136 KDE4_GLIB_CFLAGS=""
11139 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
11140 qt4_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
11141 qt4_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
11143 kde4_incdirs="/usr/include /usr/include/kde4 $x_includes"
11144 kde4_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
11146 if test -n "$supports_multilib"; then
11147 qt4_libdirs="$qt4_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
11148 kde4_libdirs="$kde4_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
11151 if test -n "$QTDIR"; then
11152 qt4_incdirs="$QTDIR/include $qt4_incdirs"
11153 if test -z "$supports_multilib"; then
11154 qt4_libdirs="$QTDIR/lib $qt4_libdirs"
11156 qt4_libdirs="$QTDIR/lib64 $QTDIR/lib $qt4_libdirs"
11159 if test -n "$QT4DIR"; then
11160 qt4_incdirs="$QT4DIR/include $qt4_incdirs"
11161 if test -z "$supports_multilib"; then
11162 qt4_libdirs="$QT4DIR/lib $qt4_libdirs"
11164 qt4_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt4_libdirs"
11168 if test -n "$KDEDIR"; then
11169 kde4_incdirs="$KDEDIR/include $kde4_incdirs"
11170 if test -z "$supports_multilib"; then
11171 kde4_libdirs="$KDEDIR/lib $kde4_libdirs"
11173 kde4_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde4_libdirs"
11176 if test -n "$KDE4DIR"; then
11177 kde4_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde4_incdirs"
11178 if test -z "$supports_multilib"; then
11179 kde4_libdirs="$KDE4DIR/lib $kde4_libdirs"
11181 kde4_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde4_libdirs"
11185 qt4_test_include="Qt/qobject.h"
11186 qt4_test_library="libQtNetwork.so"
11187 kde4_test_include="kwindowsystem.h"
11188 kde4_test_library="libsolid.so"
11190 AC_MSG_CHECKING([for Qt4 headers])
11191 qt4_header_dir="no"
11192 for inc_dir in $qt4_incdirs; do
11193 if test -r "$inc_dir/$qt4_test_include"; then
11194 qt4_header_dir="$inc_dir"
11199 AC_MSG_RESULT([$qt4_header_dir])
11200 if test "x$qt4_header_dir" = "xno"; then
11201 AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11204 dnl Check for qmake
11205 AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
11207 if test "$QMAKE4" = "no"; then
11208 AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
11209 if test "$QMAKE4" = "no"; then
11210 AC_MSG_ERROR([Qmake not found. Please specify
11211 the root of your Qt installation by exporting QT4DIR before running "configure".])
11215 qt4_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt4_libdirs"
11216 AC_MSG_CHECKING([for Qt4 libraries])
11218 for lib_dir in $qt4_libdirs; do
11219 if test -r "$lib_dir/$qt4_test_library"; then
11220 qt4_lib_dir="$lib_dir"
11221 PKG_CONFIG_PATH="$qt4_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
11226 AC_MSG_RESULT([$qt4_lib_dir])
11228 if test "x$qt4_lib_dir" = "xno"; then
11229 AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11232 dnl Check for Meta Object Compiler
11234 AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11236 if test "$MOC4" = "no"; then
11237 AC_PATH_PROG( MOC4, moc, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11238 if test "$MOC4" = "no"; then
11239 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11240 the root of your Qt installation by exporting QT4DIR before running "configure".])
11244 dnl Check for KDE4 headers
11245 AC_MSG_CHECKING([for KDE4 headers])
11247 for kde4_check in $kde4_incdirs; do
11248 if test -r "$kde4_check/$kde4_test_include"; then
11249 kde4_incdir="$kde4_check"
11253 AC_MSG_RESULT([$kde4_incdir])
11254 if test "x$kde4_incdir" = "xno"; then
11255 AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11257 if test "$kde4_incdir" = "/usr/include"; then kde4_incdir=; fi
11259 dnl Check for KDE4 libraries
11260 AC_MSG_CHECKING([for KDE4 libraries])
11262 for kde4_check in $kde4_libdirs; do
11263 if test -r "$kde4_check/$kde4_test_library"; then
11264 kde4_libdir="$kde4_check"
11269 AC_MSG_RESULT([$kde4_libdir])
11270 if test "x$kde4_libdir" = "xno"; then
11271 AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11274 PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
11275 if ! test -z "$kde4_incdir"; then
11276 KDE4_CFLAGS="-I$kde4_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11278 KDE4_CFLAGS="$QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11281 KDE4_LIBS="-L$kde4_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt4_lib_dir $QT4_LIBS"
11282 KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11283 FilterLibs "$KDE4_LIBS"
11284 KDE4_LIBS="$filteredlibs"
11286 AC_LANG_PUSH([C++])
11287 save_CXXFLAGS=$CXXFLAGS
11288 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11289 AC_MSG_CHECKING([whether KDE is >= 4.2])
11290 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11291 #include <kdeversion.h>
11293 int main(int argc, char **argv) {
11294 if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
11297 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
11298 CXXFLAGS=$save_CXXFLAGS
11301 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11302 # Sets also KDE4_GLIB_CFLAGS/KDE4_GLIB_LIBS if successful.
11303 PKG_CHECK_MODULES(KDE4_GLIB,[glib-2.0 >= 2.4],
11306 AC_DEFINE(KDE4_HAVE_GLIB,1)
11307 KDE4_GLIB_CFLAGS=$(printf '%s' "$KDE4_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11308 FilterLibs "${KDE4_GLIB_LIBS}"
11309 KDE4_GLIB_LIBS="${filteredlibs}"
11313 AC_LANG_PUSH([C++])
11314 # tst_exclude_socket_notifiers.moc:70:28: runtime error: member access within address 0x60d00000bb20 which does not point to an object of type 'QObjectData'
11315 # 0x60d00000bb20: note: object is of type 'QObjectPrivate'
11316 # 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
11317 # ^~~~~~~~~~~~~~~~~~~~~~~
11318 # vptr for 'QObjectPrivate'
11320 CXX=$(printf %s "$CXX" \
11321 | sed -e 's/-fno-sanitize-recover\(=[[0-9A-Za-z,_-]]*\)*//')
11322 save_CXXFLAGS=$CXXFLAGS
11323 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11325 LIBS="$LIBS $KDE4_LIBS"
11326 AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
11328 # Prepare meta object data
11329 TSTBASE="tst_exclude_socket_notifiers"
11330 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11331 ln -fs "${TSTMOC}.hxx"
11332 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11334 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11336 #include "tst_exclude_socket_notifiers.moc"
11338 int main(int argc, char *argv[])
11340 QCoreApplication app(argc, argv);
11341 exit(tst_processEventsExcludeSocket());
11345 AC_MSG_RESULT([yes])
11347 AC_MSG_RESULT([no])
11348 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11349 if test -z "$qt4_fix_warning"; then
11350 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11353 add_warning " https://bugreports.qt-project.org/browse/QTBUG-37380 (needed)"
11354 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11356 # Remove meta object data
11357 rm -f "${TSTBASE}."*
11359 AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
11361 # Prepare meta object data
11362 TSTBASE="tst_exclude_posted_events"
11363 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11364 ln -fs "${TSTMOC}.hxx"
11365 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11367 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11369 #include "tst_exclude_posted_events.moc"
11371 int main(int argc, char *argv[])
11373 QCoreApplication app(argc, argv);
11374 exit(tst_excludePostedEvents());
11378 AC_MSG_RESULT([yes])
11380 AC_MSG_RESULT([no])
11381 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11382 if test -z "$qt4_fix_warning"; then
11383 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11386 add_warning " https://bugreports.qt-project.org/browse/QTBUG-34614 (needed)"
11387 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11389 # Remove meta object data
11390 rm -f "${TSTBASE}."*
11392 if test -n "$qt4_fix_warning"; then
11393 add_warning " https://bugreports.qt-project.org/browse/QTBUG-38585 (recommended)"
11397 CXXFLAGS=$save_CXXFLAGS
11401 AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
11403 AC_SUBST(KDE4_CFLAGS)
11404 AC_SUBST(KDE4_LIBS)
11406 AC_SUBST(KDE4_GLIB_CFLAGS)
11407 AC_SUBST(KDE4_GLIB_LIBS)
11408 AC_SUBST(KDE4_HAVE_GLIB)
11410 dnl ===================================================================
11411 dnl Test whether to include Evolution 2 support
11412 dnl ===================================================================
11413 AC_MSG_CHECKING([whether to enable evolution 2 support])
11414 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11415 AC_MSG_RESULT([yes])
11416 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11417 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11418 FilterLibs "${GOBJECT_LIBS}"
11419 GOBJECT_LIBS="${filteredlibs}"
11420 ENABLE_EVOAB2="TRUE"
11423 AC_MSG_RESULT([no])
11425 AC_SUBST(ENABLE_EVOAB2)
11426 AC_SUBST(GOBJECT_CFLAGS)
11427 AC_SUBST(GOBJECT_LIBS)
11429 dnl ===================================================================
11430 dnl Test whether to include TDE AB support
11431 dnl ===================================================================
11432 AC_MSG_CHECKING([whether to enable TDE address book support])
11433 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
11434 AC_MSG_RESULT([yes])
11435 AC_LANG_PUSH([C++])
11436 save_CXXFLAGS=$CXXFLAGS
11437 CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
11438 AC_MSG_CHECKING([whether TDE is at least R14.0])
11439 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11440 #include <tdeversion.h>
11442 int main(int argc, char **argv) {
11443 if (TDE_VERSION_MAJOR >= 14) return 0;
11446 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([TDE version too old or too recent, please use another version of TDE or disable TDE address book support])],
11447 [AC_MSG_ERROR([TDE support not tested with cross compilation])])
11448 CXXFLAGS=$save_CXXFLAGS
11452 AC_MSG_RESULT([no])
11455 AC_SUBST(ENABLE_TDEAB)
11457 dnl ===================================================================
11458 dnl Test which themes to include
11459 dnl ===================================================================
11460 AC_MSG_CHECKING([which themes to include])
11461 # if none given use default subset of available themes
11462 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11463 with_theme="breeze breeze_dark galaxy hicontrast oxygen sifr tango"
11464 test -z "$ENABLE_RELEASE_BUILD" && with_theme="$with_theme tango_testing"
11468 if test "x$with_theme" != "xno"; then
11469 for theme in $with_theme; do
11471 breeze|breeze_dark|crystal|elementary|galaxy|hicontrast|oxygen|sifr|tango|tango_testing) real_theme="$theme" ;;
11472 default) real_theme=galaxy ;;
11473 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11475 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11478 AC_MSG_RESULT([$WITH_THEMES])
11479 AC_SUBST([WITH_THEMES])
11480 # FIXME: remove this, and the convenience default->galaxy remapping after a crace period
11481 for theme in $with_theme; do
11483 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=galaxy]) ;;
11488 dnl ===================================================================
11489 dnl Test whether to integrate helppacks into the product's installer
11490 dnl ===================================================================
11491 AC_MSG_CHECKING([for helppack integration])
11492 if test "$with_helppack_integration" = "no"; then
11493 WITH_HELPPACK_INTEGRATION=
11494 AC_MSG_RESULT([no integration])
11496 WITH_HELPPACK_INTEGRATION=TRUE
11497 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11498 AC_MSG_RESULT([integration])
11500 AC_SUBST(WITH_HELPPACK_INTEGRATION)
11502 ###############################################################################
11503 # Extensions checking
11504 ###############################################################################
11505 AC_MSG_CHECKING([for extensions integration])
11506 if test "x$enable_extension_integration" != "xno"; then
11507 WITH_EXTENSION_INTEGRATION=TRUE
11508 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11509 AC_MSG_RESULT([yes, use integration])
11511 WITH_EXTENSION_INTEGRATION=
11512 AC_MSG_RESULT([no, do not integrate])
11514 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11516 dnl Should any extra extensions be included?
11517 dnl There are standalone tests for each of these below.
11518 WITH_EXTRA_EXTENSIONS=
11519 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11521 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11522 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11523 libo_CHECK_EXTENSION([Google Docs],[GOOGLE_DOCS],[google_docs],[google-docs],[27211596cf0ad97cab7321239406fde0-gdocs_3.0.1_modified.oxt])
11524 if test "x$with_java" != "xno"; then
11525 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11526 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11529 TEST_FONTS_MISSING=0
11532 # $2+ = accepted font mappings
11536 AC_MSG_CHECKING([font mapping for '$FONT'])
11537 FONTFILE="$(basename `$FCMATCH -f '%{file}' "$FONT"`)"
11538 FONTFILE_LOWER="$(echo $FONTFILE | $AWK '{print tolower($0)}')"
11540 TESTEXPR="'${FONTFILE_LOWER}' = '$(echo $FONT | $AWK '{print tolower($0)}').ttf'"
11541 while test "$#" -ge 1 ; do
11542 MAPPING="$(echo $1 | $AWK '{print tolower($0)}')"; shift
11543 TESTEXPR="${TESTEXPR} -o '${FONTFILE_LOWER}' = '$MAPPING-regular.ttf'"
11547 AC_MSG_RESULT([ok])
11549 AC_MSG_RESULT([unknown ($FONTFILE)])
11550 TEST_FONTS_MISSING=1
11554 dnl ===================================================================
11555 dnl Test whether to include fonts
11556 dnl ===================================================================
11557 AC_MSG_CHECKING([whether to include third-party fonts])
11558 if test "$with_fonts" != "no"; then
11559 AC_MSG_RESULT([yes])
11561 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11563 AC_MSG_RESULT([no])
11565 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11566 if test "$test_fontconfig" = "yes"; then
11567 AC_PATH_PROG([FCMATCH], [fc-match])
11568 if test -z "$FCMATCH"; then
11569 AC_MSG_WARN([Unable to query installed fonts - unit tests disabled.])
11570 TEST_FONTS_MISSING=1
11572 test_font_map 'Calibri' 'Carlito'
11573 if test ${TEST_FONTS_MISSING} -eq 1
11575 AC_MSG_WARN([Unknown font mappings - unit tests disabled.])
11579 TEST_FONTS_MISSING=0
11582 AC_SUBST(WITH_FONTS)
11583 AC_DEFINE_UNQUOTED([TEST_FONTS_MISSING], $TEST_FONTS_MISSING)
11585 dnl Test whether to include Google Noto fonts
11586 dnl ===================================================================
11587 AC_MSG_CHECKING([whether to include Google Noto fonts])
11588 if test "$enable_noto_font" = "" -o "$enable_noto_font" = "no" -o "$with_fonts" = "no"; then
11589 AC_MSG_RESULT([no])
11592 AC_MSG_RESULT([yes])
11593 WITH_NOTO_FONT=TRUE
11594 BUILD_TYPE="$BUILD_TYPE NOTO_FONT"
11595 SCPDEFS="$SCPDEFS -DWITH_NOTO_FONT"
11597 AC_SUBST(WITH_NOTO_FONT)
11599 dnl ===================================================================
11601 dnl ===================================================================
11602 dnl Test whether to enable online update service
11603 dnl ===================================================================
11604 AC_MSG_CHECKING([whether to enable online update])
11605 ENABLE_ONLINE_UPDATE=
11606 ENABLE_ONLINE_UPDATE_MAR=
11607 if test "$enable_online_update" = ""; then
11608 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11609 AC_MSG_RESULT([yes])
11610 ENABLE_ONLINE_UPDATE="TRUE"
11612 AC_MSG_RESULT([no])
11615 if test "$enable_online_update" = "mar"; then
11616 AC_MSG_RESULT([yes - MAR-based online update])
11617 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11618 elif test "$enable_online_update" = "yes"; then
11619 AC_MSG_RESULT([yes])
11620 ENABLE_ONLINE_UPDATE="TRUE"
11622 AC_MSG_RESULT([no])
11625 AC_SUBST(ENABLE_ONLINE_UPDATE)
11626 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11628 dnl ===================================================================
11629 dnl Test whether we need bzip2
11630 dnl ===================================================================
11632 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11633 AC_MSG_CHECKING([whether to use system bzip2])
11634 if test "$with_system_bzip2" = yes; then
11636 AC_MSG_RESULT([yes])
11637 PKG_CHECK_MODULES(BZIP2, bzip2)
11638 FilterLibs "${BZIP2_LIBS}"
11639 BZIP2_LIBS="${filteredlibs}"
11641 AC_MSG_RESULT([no])
11642 BUILD_TYPE="$BUILD_TYPE BZIP2"
11645 AC_SUBST(SYSTEM_BZIP2)
11646 AC_SUBST(BZIP2_CFLAGS)
11647 AC_SUBST(BZIP2_LIBS)
11649 dnl ===================================================================
11650 dnl Test whether to enable extension update
11651 dnl ===================================================================
11652 AC_MSG_CHECKING([whether to enable extension update])
11653 ENABLE_EXTENSION_UPDATE=
11654 if test "x$enable_extension_update" = "xno"; then
11655 AC_MSG_RESULT([no])
11657 AC_MSG_RESULT([yes])
11658 ENABLE_EXTENSION_UPDATE="TRUE"
11659 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11660 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11662 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11665 dnl ===================================================================
11666 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11667 dnl ===================================================================
11668 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11669 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11670 AC_MSG_RESULT([no])
11673 AC_MSG_RESULT([yes])
11674 ENABLE_SILENT_MSI=TRUE
11675 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11677 AC_SUBST(ENABLE_SILENT_MSI)
11679 AC_MSG_CHECKING([whether and how to use Xinerama])
11680 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11681 if test "$x_libraries" = "default_x_libraries"; then
11682 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11683 if test "x$XINERAMALIB" = x; then
11684 XINERAMALIB="/usr/lib"
11687 XINERAMALIB="$x_libraries"
11689 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11690 # we have both versions, let the user decide but use the dynamic one
11693 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11694 XINERAMA_LINK=dynamic
11696 XINERAMA_LINK=static
11698 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11699 # we have only the dynamic version
11701 XINERAMA_LINK=dynamic
11702 elif test -e "$XINERAMALIB/libXinerama.a"; then
11704 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11706 XINERAMA_LINK=static
11716 if test "$USE_XINERAMA" = "TRUE"; then
11717 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11718 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11719 [AC_MSG_ERROR(Xinerama header not found.)], [])
11720 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11721 if test "x$XEXTLIB" = x; then
11722 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11724 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11725 if test "$_os" = "FreeBSD"; then
11726 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11728 if test "$_os" = "Linux"; then
11729 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11731 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11732 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11734 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11739 AC_MSG_RESULT([no])
11741 AC_SUBST(USE_XINERAMA)
11742 AC_SUBST(XINERAMA_LINK)
11744 dnl ===================================================================
11745 dnl Test whether to build cairo or rely on the system version
11746 dnl ===================================================================
11748 if test "$USING_X11" = TRUE; then
11749 # Used in vcl/Library_vclplug_gen.mk
11753 if test "$test_cairo" = "yes"; then
11754 AC_MSG_CHECKING([whether to use the system cairo])
11756 : ${with_system_cairo:=$with_system_libs}
11757 if test "$with_system_cairo" = "yes"; then
11759 AC_MSG_RESULT([yes])
11761 PKG_CHECK_MODULES( CAIRO, cairo >= 1.2.0 )
11762 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11763 FilterLibs "${CAIRO_LIBS}"
11764 CAIRO_LIBS="${filteredlibs}"
11766 if test "$test_xrender" = "yes"; then
11767 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11769 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11770 #ifdef PictStandardA8
11774 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11778 libo_MINGW_CHECK_DLL([libcairo])
11779 libo_MINGW_TRY_DLL([libfontconfig])
11780 libo_MINGW_TRY_DLL([libfreetype])
11781 libo_MINGW_TRY_DLL([libpixman])
11782 libo_MINGW_TRY_DLL([libpng15])
11785 AC_MSG_RESULT([no])
11787 BUILD_TYPE="$BUILD_TYPE CAIRO"
11791 AC_SUBST(SYSTEM_CAIRO)
11792 AC_SUBST(CAIRO_CFLAGS)
11793 AC_SUBST(CAIRO_LIBS)
11795 dnl ===================================================================
11796 dnl Test whether to use avahi
11797 dnl ===================================================================
11798 if test "$_os" = "WINNT"; then
11799 # Windows uses bundled mDNSResponder
11800 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11801 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11802 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11803 [ENABLE_AVAHI="TRUE"])
11804 AC_DEFINE(HAVE_FEATURE_AVAHI)
11805 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11806 FilterLibs "${AVAHI_LIBS}"
11807 AVAHI_LIBS="${filteredlibs}"
11810 AC_SUBST(ENABLE_AVAHI)
11811 AC_SUBST(AVAHI_CFLAGS)
11812 AC_SUBST(AVAHI_LIBS)
11814 dnl ===================================================================
11815 dnl Test whether to use liblangtag
11816 dnl ===================================================================
11819 AC_MSG_CHECKING([whether to use liblangtag])
11820 if test "$enable_liblangtag" = "yes" -o \
11821 \( "$enable_liblangtag" = "" -a $_os != Emscripten \); then
11822 ENABLE_LIBLANGTAG=TRUE
11823 AC_MSG_RESULT([yes])
11824 AC_MSG_CHECKING([whether to use system liblangtag])
11825 if test "$with_system_liblangtag" = yes; then
11826 SYSTEM_LIBLANGTAG=TRUE
11827 AC_MSG_RESULT([yes])
11828 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11829 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11830 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11831 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11832 FilterLibs "${LIBLANGTAG_LIBS}"
11833 LIBLANGTAG_LIBS="${filteredlibs}"
11834 libo_MINGW_CHECK_DLL([liblangtag])
11837 AC_MSG_RESULT([no])
11838 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11839 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/langtag"
11840 if test "$COM" = "MSC"; then
11841 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs/liblangtag.lib"
11843 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs -llangtag"
11846 AC_DEFINE(ENABLE_LIBLANGTAG)
11848 AC_MSG_RESULT([no])
11850 AC_SUBST(ENABLE_LIBLANGTAG)
11851 AC_SUBST(SYSTEM_LIBLANGTAG)
11852 AC_SUBST(LIBLANGTAG_CFLAGS)
11853 AC_SUBST(LIBLANGTAG_LIBS)
11855 dnl ===================================================================
11856 dnl Test whether to build libpng or rely on the system version
11857 dnl ===================================================================
11859 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/png"],["-L${WORKDIR}/LinkTarget/StaticLibrary -lpng"])
11861 dnl ===================================================================
11862 dnl Check for runtime JVM search path
11863 dnl ===================================================================
11864 if test "$ENABLE_JAVA" != ""; then
11865 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11866 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11867 AC_MSG_RESULT([yes])
11868 if ! test -d "$with_jvm_path"; then
11869 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11871 if ! test -d "$with_jvm_path"jvm; then
11872 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11874 JVM_ONE_PATH_CHECK="$with_jvm_path"
11875 AC_SUBST(JVM_ONE_PATH_CHECK)
11877 AC_MSG_RESULT([no])
11881 dnl ===================================================================
11882 dnl Test for the presence of Ant and that it works
11883 dnl ===================================================================
11885 if test "$ENABLE_JAVA" != ""; then
11886 ANT_HOME=; export ANT_HOME
11887 WITH_ANT_HOME=; export WITH_ANT_HOME
11888 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11889 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11890 if test "$_os" = "WINNT"; then
11891 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11893 with_ant_home="$LODE_HOME/opt/ant"
11895 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11896 with_ant_home="$LODE_HOME/opt/ant"
11899 if test -z "$with_ant_home"; then
11900 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11902 if test "$_os" = "WINNT"; then
11903 # AC_PATH_PROGS needs unix path
11904 with_ant_home=`cygpath -u "$with_ant_home"`
11906 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11907 WITH_ANT_HOME=$with_ant_home
11908 ANT_HOME=$with_ant_home
11911 if test -z "$ANT"; then
11912 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11914 # resolve relative or absolute symlink
11915 while test -h "$ANT"; do
11917 a_basename=`basename "$ANT"`
11918 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11919 cd "`dirname "$ANT"`"
11920 cd "`dirname "$a_script"`"
11921 ANT="`pwd`"/"`basename "$a_script"`"
11925 AC_MSG_CHECKING([if $ANT works])
11926 cat > conftest.java << EOF
11927 public class conftest {
11928 int testmethod(int a, int b) {
11934 cat > conftest.xml << EOF
11935 <project name="conftest" default="conftest">
11936 <target name="conftest">
11937 <javac srcdir="." includes="conftest.java">
11943 AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
11944 if test $? = 0 -a -f ./conftest.class; then
11945 AC_MSG_RESULT([Ant works])
11946 if test -z "$WITH_ANT_HOME"; then
11947 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11948 if test -z "$ANT_HOME"; then
11949 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11952 ANT_HOME="$WITH_ANT_HOME"
11955 echo "configure: Ant test failed" >&5
11956 cat conftest.java >&5
11957 cat conftest.xml >&5
11958 AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
11960 rm -f conftest* core core.* *.core
11962 if test -z "$ANT_HOME"; then
11963 ANT_HOME="NO_ANT_HOME"
11965 PathFormat "$ANT_HOME"
11966 ANT_HOME="$formatted_path"
11968 ANT="$formatted_path"
11973 dnl Checking for ant.jar
11974 if test "$ANT_HOME" != "NO_ANT_HOME"; then
11975 AC_MSG_CHECKING([Ant lib directory])
11976 if test -f $ANT_HOME/lib/ant.jar; then
11977 ANT_LIB="$ANT_HOME/lib"
11979 if test -f $ANT_HOME/ant.jar; then
11980 ANT_LIB="$ANT_HOME"
11982 if test -f /usr/share/java/ant.jar; then
11983 ANT_LIB=/usr/share/java
11985 if test -f /usr/share/ant-core/lib/ant.jar; then
11986 ANT_LIB=/usr/share/ant-core/lib
11988 if test -f $ANT_HOME/lib/ant/ant.jar; then
11989 ANT_LIB="$ANT_HOME/lib/ant"
11991 if test -f /usr/share/lib/ant/ant.jar; then
11992 ANT_LIB=/usr/share/lib/ant
11994 AC_MSG_ERROR([Ant libraries not found!])
12001 PathFormat "$ANT_LIB"
12002 ANT_LIB="$formatted_path"
12003 AC_MSG_RESULT([Ant lib directory found.])
12008 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
12010 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
12011 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
12012 ant_version_major=`echo $ant_version | cut -d. -f1`
12013 ant_version_minor=`echo $ant_version | cut -d. -f2`
12014 echo "configure: ant_version $ant_version " >&5
12015 echo "configure: ant_version_major $ant_version_major " >&5
12016 echo "configure: ant_version_minor $ant_version_minor " >&5
12017 if test "$ant_version_major" -ge "2"; then
12018 AC_MSG_RESULT([yes, $ant_version])
12019 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
12020 AC_MSG_RESULT([yes, $ant_version])
12022 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
12025 rm -f conftest* core core.* *.core
12029 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12030 AC_MSG_CHECKING([for JUnit 4])
12031 if test "$with_junit" = "yes"; then
12032 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
12033 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
12034 elif test -e /usr/share/java/junit4.jar; then
12035 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
12037 if test -e /usr/share/lib/java/junit.jar; then
12038 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
12040 OOO_JUNIT_JAR=/usr/share/java/junit.jar
12044 OOO_JUNIT_JAR=$with_junit
12046 if test "$_os" = "WINNT"; then
12047 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
12049 printf 'import org.junit.Before;' > conftest.java
12050 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12051 AC_MSG_RESULT([$OOO_JUNIT_JAR])
12054 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
12055 specify its pathname via --with-junit=..., or disable it via --without-junit])
12057 rm -f conftest.class conftest.java
12058 if test $OOO_JUNIT_JAR != ""; then
12059 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
12062 AC_SUBST(OOO_JUNIT_JAR)
12065 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12066 AC_MSG_CHECKING([for included Hamcrest])
12067 printf 'import org.hamcrest.BaseDescription;' > conftest.java
12068 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12069 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
12071 AC_MSG_RESULT([Not included])
12072 AC_MSG_CHECKING([for standalone hamcrest jar.])
12073 if test "$with_hamcrest" = "yes"; then
12074 if test -e /usr/share/lib/java/hamcrest.jar; then
12075 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
12076 elif test -e /usr/share/java/hamcrest/core.jar; then
12077 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
12079 HAMCREST_JAR=/usr/share/java/hamcrest.jar
12082 HAMCREST_JAR=$with_hamcrest
12084 if test "$_os" = "WINNT"; then
12085 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
12087 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
12088 AC_MSG_RESULT([$HAMCREST_JAR])
12090 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),
12091 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
12094 rm -f conftest.class conftest.java
12096 AC_SUBST(HAMCREST_JAR)
12102 # check for wget and curl
12107 if test "$enable_fetch_external" != "no"; then
12109 CURL=`which curl 2>/dev/null`
12111 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12113 $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
12114 if test $? -eq 0; then
12120 if test -z "$WGET" -a -z "$CURL"; then
12121 AC_MSG_ERROR([neither wget nor curl found!])
12134 for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
12135 if test "$i" = "md5"; then
12136 eval "$i -x" > /dev/null 2>&1
12138 eval "$i --version" > /dev/null 2>&1
12141 if test $ret -eq 0; then
12147 if test "$MD5SUM" = "md5"; then
12148 if md5 -r < /dev/null > /dev/null 2>/dev/null; then
12149 MD5SUM="$MD5SUM -r"
12150 elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
12151 MD5SUM="$MD5SUM -n"
12155 if test -z "$MD5SUM"; then
12156 AC_MSG_ERROR([no md5sum found!])
12161 dnl ===================================================================
12162 dnl Dealing with l10n options
12163 dnl ===================================================================
12164 AC_MSG_CHECKING([which languages to be built])
12165 # get list of all languages
12166 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12167 # the sed command does the following:
12168 # + if a line ends with a backslash, append the next line to it
12169 # + adds " on the beginning of the value (after =)
12170 # + adds " at the end of the value
12171 # + removes en-US; we want to put it on the beginning
12172 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12173 [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)]
12174 ALL_LANGS="en-US $completelangiso"
12175 # check the configured localizations
12176 WITH_LANG="$with_lang"
12177 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12178 AC_MSG_RESULT([en-US])
12180 AC_MSG_RESULT([$WITH_LANG])
12181 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12183 # check that the list is valid
12184 for lang in $WITH_LANG; do
12185 test "$lang" = "ALL" && continue
12186 # need to check for the exact string, so add space before and after the list of all languages
12187 for vl in $ALL_LANGS; do
12188 if test "$vl" = "$lang"; then
12192 if test "$vl" != "$lang"; then
12193 # if you're reading this - you prolly quoted your languages remove the quotes ...
12194 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12197 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12198 echo $WITH_LANG | grep -q en-US
12199 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12201 # list with substituted ALL
12202 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12203 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12204 test "$WITH_LANG" = "en-US" && WITH_LANG=
12205 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12206 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12207 ALL_LANGS=`echo $ALL_LANGS qtz`
12209 AC_SUBST(ALL_LANGS)
12210 AC_SUBST(WITH_LANG)
12211 AC_SUBST(WITH_LANG_LIST)
12212 AC_SUBST(GIT_NEEDED_SUBMODULES)
12214 WITH_POOR_HELP_LOCALIZATIONS=
12215 if test -d "$SRC_ROOT/translations/source"; then
12216 for l in `ls -1 $SRC_ROOT/translations/source`; do
12217 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12218 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12222 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12224 if test -n "$with_locales"; then
12225 WITH_LOCALES="$with_locales"
12227 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12228 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12229 # config_host/config_locales.h.in
12230 for locale in $WITH_LOCALES; do
12233 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12237 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12240 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12245 AC_DEFINE(WITH_LOCALE_ALL)
12247 AC_SUBST(WITH_LOCALES)
12249 dnl git submodule update --reference
12250 dnl ===================================================================
12251 if test -n "${GIT_REFERENCE_SRC}"; then
12252 for repo in ${GIT_NEEDED_SUBMODULES}; do
12253 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12254 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12258 AC_SUBST(GIT_REFERENCE_SRC)
12260 dnl git submodules linked dirs
12261 dnl ===================================================================
12262 if test -n "${GIT_LINK_SRC}"; then
12263 for repo in ${GIT_NEEDED_SUBMODULES}; do
12264 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12265 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12269 AC_SUBST(GIT_LINK_SRC)
12272 dnl ===================================================================
12273 AC_MSG_CHECKING([for alternative branding images directory])
12274 # initialize mapped arrays
12275 BRAND_INTRO_IMAGES="flat_logo.svg intro.png"
12276 brand_files="$BRAND_INTRO_IMAGES about.svg"
12278 if test -z "$with_branding" -o "$with_branding" = "no"; then
12279 AC_MSG_RESULT([none])
12280 DEFAULT_BRAND_IMAGES="$brand_files"
12282 if ! test -d $with_branding ; then
12283 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12285 AC_MSG_RESULT([$with_branding])
12286 CUSTOM_BRAND_DIR="$with_branding"
12287 for lfile in $brand_files
12289 if ! test -f $with_branding/$lfile ; then
12290 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12291 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12293 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12296 check_for_progress="yes"
12299 AC_SUBST([BRAND_INTRO_IMAGES])
12300 AC_SUBST([CUSTOM_BRAND_DIR])
12301 AC_SUBST([CUSTOM_BRAND_IMAGES])
12302 AC_SUBST([DEFAULT_BRAND_IMAGES])
12305 AC_MSG_CHECKING([for 'intro' progress settings])
12309 PROGRESSFRAMECOLOR=
12311 PROGRESSTEXTBASELINE=
12313 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12314 source "$with_branding/progress.conf"
12315 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12317 AC_MSG_RESULT([none])
12320 AC_SUBST(PROGRESSBARCOLOR)
12321 AC_SUBST(PROGRESSSIZE)
12322 AC_SUBST(PROGRESSPOSITION)
12323 AC_SUBST(PROGRESSFRAMECOLOR)
12324 AC_SUBST(PROGRESSTEXTCOLOR)
12325 AC_SUBST(PROGRESSTEXTBASELINE)
12328 AC_MSG_CHECKING([for extra build ID])
12329 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12330 EXTRA_BUILDID="$with_extra_buildid"
12332 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12333 if test -n "$EXTRA_BUILDID" ; then
12334 AC_MSG_RESULT([$EXTRA_BUILDID])
12336 AC_MSG_RESULT([not set])
12338 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12341 AC_MSG_CHECKING([for vendor])
12342 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12343 OOO_VENDOR="$USERNAME"
12345 if test -z "$OOO_VENDOR"; then
12349 if test -z "$OOO_VENDOR"; then
12350 OOO_VENDOR="`id -u -n`"
12353 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12355 OOO_VENDOR="$with_vendor"
12356 AC_MSG_RESULT([$OOO_VENDOR])
12358 AC_SUBST(OOO_VENDOR)
12360 if echo "$host_os" | grep -q linux-android ; then
12361 ANDROID_PACKAGE_NAME=
12362 AC_MSG_CHECKING([for Android package name])
12363 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12364 if test -n "$ENABLE_DEBUG"; then
12365 # Default to the package name that makes ndk-gdb happy.
12366 ANDROID_PACKAGE_NAME="org.libreoffice"
12368 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12371 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12373 ANDROID_PACKAGE_NAME="$with_android_package_name"
12374 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12376 AC_SUBST(ANDROID_PACKAGE_NAME)
12379 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12380 if test "$with_compat_oowrappers" = "yes"; then
12381 WITH_COMPAT_OOWRAPPERS=TRUE
12384 WITH_COMPAT_OOWRAPPERS=
12387 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12389 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{gsub(" ", "", $0);print tolower($0)}'`
12390 AC_MSG_CHECKING([for install dirname])
12391 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12392 INSTALLDIRNAME="$with_install_dirname"
12394 AC_MSG_RESULT([$INSTALLDIRNAME])
12395 AC_SUBST(INSTALLDIRNAME)
12397 AC_MSG_CHECKING([for prefix])
12398 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12399 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12400 PREFIXDIR="$prefix"
12401 AC_MSG_RESULT([$PREFIXDIR])
12402 AC_SUBST(PREFIXDIR)
12404 LIBDIR=[$(eval echo $(eval echo $libdir))]
12407 DATADIR=[$(eval echo $(eval echo $datadir))]
12410 MANDIR=[$(eval echo $(eval echo $mandir))]
12413 DOCDIR=[$(eval echo $(eval echo $docdir))]
12416 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12417 AC_SUBST(INSTALLDIR)
12419 TESTINSTALLDIR="${BUILDDIR}/test-install"
12420 AC_SUBST(TESTINSTALLDIR)
12423 # ===================================================================
12424 # OAuth2 id and secrets
12425 # ===================================================================
12427 AC_MSG_CHECKING([for Google Drive client id and secret])
12428 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12429 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12430 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12431 GDRIVE_CLIENT_ID="\"\""
12434 if test "$with_gdrive_client_secret" = "no" -o -z "$with_gdrive_client_secret"; then
12435 GDRIVE_CLIENT_SECRET="\"\""
12438 if test -z "$GDRIVE_CLIENT_ID" -o -z "$GDRIVE_CLIENT_SECRET"; then
12439 AC_MSG_RESULT([not set])
12441 AC_MSG_RESULT([set])
12444 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12445 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12447 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12448 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12449 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12450 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12451 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12454 if test "$with_alfresco_cloud_client_secret" = "no" -o -z "$with_alfresco_cloud_client_secret"; then
12455 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12458 if test -z "$ALFRESCO_CLOUD_CLIENT_ID" -o -z "$ALFRESCO_CLOUD_CLIENT_SECRET"; then
12459 AC_MSG_RESULT([not set])
12461 AC_MSG_RESULT([set])
12463 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12464 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12466 AC_MSG_CHECKING([for OneDrive client id and secret])
12467 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12468 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12469 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12470 ONEDRIVE_CLIENT_ID="\"\""
12473 if test "$with_onedrive_client_secret" = "no" -o -z "$with_onedrive_client_secret"; then
12474 ONEDRIVE_CLIENT_SECRET="\"\""
12477 if test -z "$ONEDRIVE_CLIENT_ID" -o -z "$ONEDRIVE_CLIENT_SECRET"; then
12478 AC_MSG_RESULT([not set])
12480 AC_MSG_RESULT([set])
12482 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12483 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12486 dnl ===================================================================
12487 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12488 dnl --enable-dependency-tracking configure option
12489 dnl ===================================================================
12490 AC_MSG_CHECKING([whether to enable dependency tracking])
12491 if test "$enable_dependency_tracking" = "no"; then
12493 AC_MSG_RESULT([no])
12495 AC_MSG_RESULT([yes])
12499 dnl ===================================================================
12500 dnl Number of CPUs to use during the build
12501 dnl ===================================================================
12502 AC_MSG_CHECKING([for number of processors to use])
12503 # plain --with-parallelism is just the default
12504 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12505 if test "$with_parallelism" = "no"; then
12508 PARALLELISM=$with_parallelism
12511 if test "$enable_icecream" = "yes"; then
12516 Darwin|FreeBSD|NetBSD|OpenBSD)
12517 PARALLELISM=`sysctl -n hw.ncpu`
12521 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12523 # what else than above does profit here *and* has /proc?
12525 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12529 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12530 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12534 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12535 if test -z "$with_parallelism"; then
12536 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12537 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12540 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."
12544 if test $PARALLELISM -eq 0; then
12545 AC_MSG_RESULT([explicit make -j option needed])
12547 AC_MSG_RESULT([$PARALLELISM])
12549 AC_SUBST(PARALLELISM)
12551 IWYU_PATH="$with_iwyu"
12552 AC_SUBST(IWYU_PATH)
12553 if test ! -z "$IWYU_PATH"; then
12554 if test ! -f "$IWYU_PATH"; then
12555 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12560 # Set up ILIB for MSVC build
12563 if test "$build_os" = "cygwin"; then
12565 if test -n "$JAVA_HOME"; then
12566 ILIB="$ILIB;$JAVA_HOME/lib"
12569 if test "$BITNESS_OVERRIDE" = 64; then
12570 ILIB="$ILIB;$COMPATH/lib/amd64"
12571 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/amd64"
12572 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12573 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12574 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12575 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12576 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12578 if test $VCVER = 140; then
12579 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
12580 ucrtlibpath_formatted=$formatted_path
12581 ILIB="$ILIB;$ucrtlibpath_formatted"
12584 ILIB="$ILIB;$COMPATH/lib"
12585 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib"
12586 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12587 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12588 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12589 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12590 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12592 if test $VCVER = 140; then
12593 PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
12594 ucrtlibpath_formatted=$formatted_path
12595 ILIB="$ILIB;$ucrtlibpath_formatted"
12598 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12599 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12601 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12608 [whether C++11 use of const_iterator in standard containers is broken])
12609 save_CXXFLAGS=$CXXFLAGS
12610 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12611 AC_LANG_PUSH([C++])
12612 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12616 l.erase(l.cbegin());
12618 [broken=no], [broken=yes])
12621 CXXFLAGS=$save_CXXFLAGS
12622 AC_MSG_RESULT([$broken])
12623 if test "$broken" = yes; then
12624 AC_DEFINE([HAVE_BROKEN_CONST_ITERATORS])
12628 AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
12629 save_CXXFLAGS=$CXXFLAGS
12630 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12632 if test -n "$ILIB1"; then
12633 LIBS="$LIBS $ILIB1"
12635 AC_LANG_PUSH([C++])
12636 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
12637 // Exit with failure if the static initializer_list is stored on the
12638 // stack (as done by Clang < 3.4):
12639 #include <initializer_list>
12641 bool g(void const * p1, void const * p2) {
12643 return !((p1 > p2 && p2 > &n) || (p1 < p2 && p2 < &n));
12645 bool f(void const * p1) {
12646 static std::initializer_list<S> s { S() };
12647 return g(p1, s.begin());
12651 return f(&n) ? 0 : 1;
12652 ]])], [broken=no], [broken=yes],[broken='assuming not (cross-compiling)'])
12655 CXXFLAGS=$save_CXXFLAGS
12656 AC_MSG_RESULT([$broken])
12657 if test "$broken" = yes; then
12658 AC_DEFINE([HAVE_BROKEN_STATIC_INITIALIZER_LIST])
12662 # ===================================================================
12663 # Creating bigger shared library to link against
12664 # ===================================================================
12665 AC_MSG_CHECKING([whether to create huge library])
12668 if test $_os = iOS -o $_os = Android; then
12669 # Never any point in mergelibs for these as we build just static
12670 # libraries anyway...
12671 enable_mergelibs=no
12674 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12675 if test $_os != Linux -a $_os != WINNT; then
12676 add_warning "--enable-mergelibs is not tested for this platform"
12679 AC_MSG_RESULT([yes])
12681 AC_MSG_RESULT([no])
12683 AC_SUBST([MERGELIBS])
12685 dnl ===================================================================
12686 dnl icerun is a wrapper that stops us spawning tens of processes
12687 dnl locally - for tools that can't be executed on the compile cluster
12688 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12689 dnl ===================================================================
12690 AC_MSG_CHECKING([whether to use icerun wrapper])
12692 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12693 ICECREAM_RUN=icerun
12694 AC_MSG_RESULT([yes])
12696 AC_MSG_RESULT([no])
12698 AC_SUBST(ICECREAM_RUN)
12700 dnl ===================================================================
12701 dnl Setup the ICECC_VERSION for the build the same way it was set for
12702 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12703 dnl ===================================================================
12704 x_ICECC_VERSION=[\#]
12705 if test -n "$ICECC_VERSION" ; then
12708 AC_SUBST(x_ICECC_VERSION)
12709 AC_SUBST(ICECC_VERSION)
12711 dnl ===================================================================
12713 AC_MSG_CHECKING([MPL subset])
12716 if test "$enable_mpl_subset" = "yes"; then
12718 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12720 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12723 if test "$warn_report" = "true"; then
12724 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12726 if test "x$enable_postgresql_sdbc" != "xno"; then
12727 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the postgress database backend.])
12729 if test "$enable_lotuswordpro" = "yes"; then
12730 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12732 if test "$WITH_WEBDAV" = "neon"; then
12733 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12735 if test "x$enable_ext_mariadb_connector" = "xyes"; then
12736 AC_MSG_ERROR([need to --disable-ext-mariadb-connector - mariadb/mysql support.])
12738 if test -n "$ENABLE_PDFIMPORT"; then
12739 if test "x$SYSTEM_POPPLER" = "x"; then
12740 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12743 # cf. m4/libo_check_extension.m4
12744 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12745 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12747 for theme in $WITH_THEMES; do
12749 crystal|default|hicontrast|oxygen)
12750 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12755 ENABLE_OPENGL_TRANSITIONS=
12757 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12758 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12762 AC_DEFINE(MPL_HAVE_SUBSET)
12763 AC_MSG_RESULT([only])
12765 AC_MSG_RESULT([no restrictions])
12767 AC_SUBST(MPL_SUBSET)
12769 dnl ===================================================================
12771 AC_MSG_CHECKING([formula logger])
12772 ENABLE_FORMULA_LOGGER=
12774 if test "x$enable_formula_logger" = "xyes"; then
12775 AC_MSG_RESULT([yes])
12776 AC_DEFINE(ENABLE_FORMULA_LOGGER)
12777 ENABLE_FORMULA_LOGGER=TRUE
12779 AC_MSG_RESULT([no])
12782 AC_SUBST(ENABLE_FORMULA_LOGGER)
12784 dnl ===================================================================
12785 dnl Setting up the environment.
12786 dnl ===================================================================
12787 AC_MSG_NOTICE([setting up the build environment variables...])
12791 if test "$build_os" = "cygwin"; then
12792 if test -d "$COMPATH/atlmfc/lib"; then
12793 ATL_LIB="$COMPATH/atlmfc/lib"
12794 ATL_INCLUDE="$COMPATH/atlmfc/include"
12796 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12797 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12799 if test "$BITNESS_OVERRIDE" = 64; then
12800 ATL_LIB="$ATL_LIB/amd64"
12802 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12803 PathFormat "/usr/bin/find.exe"
12804 FIND="$formatted_path"
12805 PathFormat "/usr/bin/sort.exe"
12806 SORT="$formatted_path"
12807 PathFormat "/usr/bin/grep.exe"
12808 WIN_GREP="$formatted_path"
12809 PathFormat "/usr/bin/ls.exe"
12810 WIN_LS="$formatted_path"
12811 PathFormat "/usr/bin/touch.exe"
12812 WIN_TOUCH="$formatted_path"
12818 AC_SUBST(ATL_INCLUDE)
12824 AC_SUBST(WIN_TOUCH)
12826 AC_SUBST(BUILD_TYPE)
12831 PERL="$formatted_path"
12834 if test -n "$TMPDIR"; then
12835 TEMP_DIRECTORY="$TMPDIR"
12837 TEMP_DIRECTORY="/tmp"
12839 if test "$build_os" = "cygwin"; then
12840 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12842 AC_SUBST(TEMP_DIRECTORY)
12844 # setup the PATH for the environment
12845 if test -n "$LO_PATH_FOR_BUILD"; then
12846 LO_PATH="$LO_PATH_FOR_BUILD"
12852 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12853 if test "$ENABLE_JAVA" != ""; then
12854 pathmunge "$JAVA_HOME/bin" "after"
12859 # Win32 make needs native paths
12860 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12861 LO_PATH=`cygpath -p -m "$PATH"`
12863 if test "$BITNESS_OVERRIDE" = 64; then
12864 # needed for msi packaging
12865 pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12867 # .NET 4.6 and higher don't have bin directory
12868 if test -f "$DOTNET_FRAMEWORK_HOME/bin"; then
12869 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12871 pathmunge "$ASM_HOME" "before"
12872 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12873 pathmunge "$CSC_PATH" "before"
12874 pathmunge "$MIDL_PATH" "before"
12875 pathmunge "$AL_PATH" "before"
12876 pathmunge "$MSPDB_PATH" "before"
12877 if test -n "$MSBUILD_PATH" ; then
12878 pathmunge "$MSBUILD_PATH" "before"
12880 if test "$BITNESS_OVERRIDE" = 64; then
12881 if test "$vcexpress" = "Express"; then
12882 pathmunge "$COMPATH/bin/x86_amd64" "before"
12883 pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12885 pathmunge "$COMPATH/bin/amd64" "before"
12886 pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12889 pathmunge "$COMPATH/bin" "before"
12890 pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12892 if test "$ENABLE_JAVA" != ""; then
12893 if test -d "$JAVA_HOME/jre/bin/client"; then
12894 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12896 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12897 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12899 pathmunge "$JAVA_HOME/bin" "before"
12904 pathmunge "/usr/css/bin" "before"
12905 if test "$ENABLE_JAVA" != ""; then
12906 pathmunge "$JAVA_HOME/bin" "after"
12914 # Generate a configuration md5 we can use for deps
12915 if test -f config_host.mk; then
12916 config_md5=`$MD5SUM config_host.mk | sed "s/ .*//"`
12918 if test -f config_host_lang.mk; then
12919 config_lang_md5=`$MD5SUM config_host_lang.mk | sed "s/ .*//"`
12922 AC_CONFIG_FILES([config_host.mk
12923 config_host_lang.mk
12926 bin/bffvalidator.sh
12927 bin/odfvalidator.sh
12929 instsetoo_native/util/openoffice.lst
12930 sysui/desktop/macosx/Info.plist
12932 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12933 AC_CONFIG_HEADERS([config_host/config_clang.h])
12934 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12935 AC_CONFIG_HEADERS([config_host/config_eot.h])
12936 AC_CONFIG_HEADERS([config_host/config_extension_update.h])
12937 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12938 AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
12939 AC_CONFIG_HEADERS([config_host/config_dbus.h])
12940 AC_CONFIG_HEADERS([config_host/config_features.h])
12941 AC_CONFIG_HEADERS([config_host/config_firebird.h])
12942 AC_CONFIG_HEADERS([config_host/config_folders.h])
12943 AC_CONFIG_HEADERS([config_host/config_gio.h])
12944 AC_CONFIG_HEADERS([config_host/config_global.h])
12945 AC_CONFIG_HEADERS([config_host/config_graphite.h])
12946 AC_CONFIG_HEADERS([config_host/config_java.h])
12947 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12948 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
12949 AC_CONFIG_HEADERS([config_host/config_locales.h])
12950 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12951 AC_CONFIG_HEADERS([config_host/config_orcus.h])
12952 AC_CONFIG_HEADERS([config_host/config_kde4.h])
12953 AC_CONFIG_HEADERS([config_host/config_oox.h])
12954 AC_CONFIG_HEADERS([config_host/config_opengl.h])
12955 AC_CONFIG_HEADERS([config_host/config_options.h])
12956 AC_CONFIG_HEADERS([config_host/config_options_calc.h])
12957 AC_CONFIG_HEADERS([config_host/config_test.h])
12958 AC_CONFIG_HEADERS([config_host/config_telepathy.h])
12959 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12960 AC_CONFIG_HEADERS([config_host/config_vcl.h])
12961 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12962 AC_CONFIG_HEADERS([config_host/config_version.h])
12963 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12964 AC_CONFIG_HEADERS([config_host/config_poppler.h])
12965 AC_CONFIG_HEADERS([config_host/config_python.h])
12966 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
12969 if test "$CROSS_COMPILING" = TRUE; then
12970 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12973 # touch the config timestamp file
12974 if test ! -f config_host.mk.stamp; then
12975 echo > config_host.mk.stamp
12976 elif test "$config_md5" = `$MD5SUM config_host.mk | sed "s/ .*//"`; then
12977 echo "Host Configuration unchanged - avoiding scp2 stamp update"
12979 echo > config_host.mk.stamp
12982 # touch the config lang timestamp file
12983 if test ! -f config_host_lang.mk.stamp; then
12984 echo > config_host_lang.mk.stamp
12985 elif test "$config_lang_md5" = `$MD5SUM config_host_lang.mk | sed "s/ .*//"`; then
12986 echo "Language Configuration unchanged - avoiding scp2 stamp update"
12988 echo > config_host_lang.mk.stamp
12992 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12995 ****************************************************************************
12997 Your make version is known to be horribly slow, and hard to debug
12998 problems with. To get a reasonably functional make please do:
13000 to install a pre-compiled binary make for Win32
13002 mkdir -p /opt/lo/bin
13004 wget http://dev-www.libreoffice.org/bin/cygwin/make-85047eb-msvc.exe
13005 cp make-85047eb-msvc.exe make
13008 to install from source:
13009 place yourself in a working directory of you choice.
13011 git clone git://git.savannah.gnu.org/make.git
13013 [go to Start menu, click "All Programs", click "Visual Studio 2013", click "Visual Studio Tools", double-click "VS2013 x86 Native Tools Command Prompt" or "VS2013 x64 Native Tools Command Prompt"]
13014 set PATH=%PATH%;C:\Cygwin\bin
13015 [or Cygwin64, if that is what you have]
13016 cd path-to-make-repo-you-cloned-above
13017 build_w32.bat --without-guile
13019 should result in a WinRel/gnumake.exe.
13020 Copy it to the Cygwin /opt/lo/bin directory as make.exe
13022 Then re-run autogen.sh
13024 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
13025 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
13031 ****************************************************************************
13036 To view some help, run:
13041 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
13043 After the build has finished, you can immediately run it using:
13046 if test $_os = Darwin; then
13047 echo open instdir/$PRODUCTNAME.app
13049 echo instdir/program/soffice
13053 If you want to run the smoketest, run:
13059 if test -f warn; then
13064 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: