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([LibreOffice],[4.4.0.0.alpha0+],[],[],[http://documentfoundation.org/])
16 if test -n "$BUILD_TYPE"; then
17 AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
25 GIT_NEEDED_SUBMODULES=""
26 LO_PATH= # used by path_munge to construct a PATH variable
31 if test "$build_os" = "cygwin"; then
34 for pf_part in $formatted_path; do
35 if test -z "$pf_part1"; then
41 if test "$pf_conv_to_dos" = "yes"; then
42 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
43 formatted_path=`cygpath -sm "$formatted_path"`
45 formatted_path=`cygpath -d "$formatted_path"`
47 if test $? -ne 0; then
48 AC_MSG_ERROR([path conversion failed for "$1".])
51 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
52 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
53 if test "$fp_count_slash$fp_count_colon" != "00"; then
54 if test "$fp_count_colon" = "0"; then
55 new_formatted_path=`realpath "$formatted_path"`
56 if test $? -ne 0; then
57 AC_MSG_WARN([realpath failed for "$1", not necessarily a problem.])
59 formatted_path="$new_formatted_path"
62 formatted_path=`cygpath -m "$formatted_path"`
63 if test $? -ne 0; then
64 AC_MSG_ERROR([path conversion failed for "$1".])
72 # There appears to be no simple and portable method to get an absolute and
73 # canonical path, so we try creating the directory if does not exist and
74 # utilizing the shell and pwd.
77 test ! -e "$rel" && mkdir -p "$rel"
78 if test -d "$rel" ; then
79 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
80 absolute_path="$(pwd)"
83 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
91 if test "$have_WARNINGS" = "no"; then
92 echo "*************************************" > warn
94 if which tput >/dev/null 2>/dev/null && test `tput colors` -ge 8; then
95 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
96 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
98 COLORWARN="* WARNING :"
101 echo "$COLORWARN $@" >> warn
104 echo "********************************************************************"
106 echo "* Running ${PACKAGE_NAME} build configuration."
108 echo "********************************************************************"
111 dnl ===================================================================
112 dnl checks build and host OSes
113 dnl do this before argument processing to allow for platform dependent defaults
114 dnl ===================================================================
117 AC_MSG_CHECKING([for product name])
118 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
119 PRODUCTNAME=AC_PACKAGE_NAME"Dev"
121 PRODUCTNAME=AC_PACKAGE_NAME
123 AC_MSG_RESULT([$PRODUCTNAME])
124 AC_SUBST(PRODUCTNAME)
126 dnl ===================================================================
127 dnl Our version is defined by the AC_INIT() at the top of this script.
128 dnl ===================================================================
130 set `echo AC_PACKAGE_VERSION | sed "s/\./ /g"`
132 LIBO_VERSION_MAJOR=$1
133 LIBO_VERSION_MINOR=$2
134 LIBO_VERSION_MICRO=$3
135 LIBO_VERSION_PATCH=$4
137 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
138 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
139 # no way to encode that into an integer in general.
140 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
142 LIBO_VERSION_SUFFIX=$5
143 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
144 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
145 # they get undoubled before actually passed to sed.
146 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
147 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
148 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
149 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
151 AC_SUBST(LIBO_VERSION_MAJOR)
152 AC_SUBST(LIBO_VERSION_MINOR)
153 AC_SUBST(LIBO_VERSION_MICRO)
154 AC_SUBST(LIBO_VERSION_PATCH)
155 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
156 AC_SUBST(LIBO_VERSION_SUFFIX)
157 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
159 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
160 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
161 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
162 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
164 LIBO_THIS_YEAR=`date +%Y`
165 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
167 dnl ===================================================================
169 dnl ===================================================================
170 AC_MSG_CHECKING([for product version])
171 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
172 AC_MSG_RESULT([$PRODUCTVERSION])
173 AC_SUBST(PRODUCTVERSION)
176 # AC_PROG_EGREP doesn't set GREP on all systems as well
177 AC_PATH_PROG(GREP, grep)
185 dnl ===================================================================
186 dnl Search all the common names for GNU make
187 dnl ===================================================================
188 AC_MSG_CHECKING([for GNU make])
190 # try to use our own make if it is available and GNUMAKE was not already defined
191 if test -z "$GNUMAKE"; then
192 if test -x "/opt/lo/bin/make"; then
193 GNUMAKE="/opt/lo/bin/make"
198 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
199 if test -n "$a"; then
200 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
201 if test $? -eq 0; then
202 if test "$build_os" = "cygwin"; then
203 if test -n "$($a -v | grep 'Built for Windows')" ; then
204 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
205 GNUMAKE_WIN_NATIVE="TRUE"
216 AC_MSG_RESULT($GNUMAKE)
217 if test -z "$GNUMAKE"; then
218 AC_MSG_ERROR([not found. install GNU make.])
220 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
221 AC_MSG_NOTICE([Using a native Win32 gnumake version.])
225 win_short_path_for_make()
227 local_short_path="$1"
228 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
229 cygpath -sm "$local_short_path"
231 cygpath -u "$(cygpath -d "$local_short_path")"
236 if test "$build_os" = "cygwin"; then
237 PathFormat "$SRC_ROOT"
238 SRC_ROOT="$formatted_path"
239 PathFormat "$BUILDDIR"
240 BUILDDIR="$formatted_path"
247 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
248 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
250 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
251 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
254 # need sed in os checks...
255 AC_PATH_PROGS(SED, sed)
256 if test -z "$SED"; then
257 AC_MSG_ERROR([install sed to run this script])
260 # Set the ENABLE_LTO variable
261 # ===================================================================
262 AC_MSG_CHECKING([whether to use link-time optimization])
263 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
266 AC_DEFINE(STATIC_LINKING)
273 dnl ===================================================================
274 dnl When building for Android, --with-android-ndk,
275 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
277 dnl ===================================================================
279 AC_ARG_WITH(android-ndk,
280 AS_HELP_STRING([--with-android-ndk],
281 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
284 AC_ARG_WITH(android-ndk-toolchain-version,
285 AS_HELP_STRING([--with-android-ndk-toolchain-version],
286 [Specify which toolchain version to use, of those present in the
287 Android NDK you are using. Mandatory if the NDK used has several
288 toolchain versions for the host architecture you are building for.
289 Possible values are 4.6, 4.8, clang3.3 and clang3.4. Only 4.8 has been
290 tested for real...]), ,)
292 AC_ARG_WITH(android-sdk,
293 AS_HELP_STRING([--with-android-sdk],
294 [Specify location of the Android SDK. Mandatory when building for Android,
295 or when building the Impress Remote Android app.]),
299 if test -n "$with_android_ndk"; then
300 ANDROID_NDK_HOME=$with_android_ndk
302 # Set up a lot of pre-canned defaults
304 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
305 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT file in $ANDROID_NDK_HOME.])
307 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
309 case $ANDROID_NDK_VERSION in
313 AC_MSG_ERROR([Unsupported NDK version $ANDROID_NDK_VERSION, only r8* and r9* versions are supported])
317 if test $host_cpu = arm; then
319 android_platform_prefix=$android_cpu-linux-androideabi
320 elif test $host_cpu = mips; then
322 android_platform_prefix=$android_cpu-linux-androideabi
324 # host_cpu is something like "i386" or "i686" I guess, NDK uses
325 # "x86" in some contexts
327 android_platform_prefix=$android_cpu
330 case "$with_android_ndk_toolchain_version" in
332 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$with_android_ndk_toolchain_version
333 ANDROID_COMPILER_DIR=$ANDROID_BINUTILS_DIR
336 AC_MSG_WARN([Building with the Clang tool-chain is known to break in the bridges module, fix that please])
337 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-4.8
338 ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm-${with_android_ndk_toolchain_version#clang}
339 ANDROID_USING_CLANG=true
342 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option])
345 if test ! -d $ANDROID_BINUTILS_DIR; then
346 AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
347 elif test $ANDROID_COMPILER_DIR != $ANDROID_BINUTILS_DIR -a ! -d $ANDROID_COMPILER_DIR; then
348 AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
351 # Check if there is a 64-bit tool-chain. Google provides a NDK with 64-bit tool-chain binaries in
352 # NDK r8e and later, and for earlier NDKs it was possible to build one yourself. Using a 64-bit
353 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
354 # manage to link the (app-specific) single huge .so that is built for the apps in
355 # android/experimental/* if there is debug information in a significant part of the object files.
356 # (A 64-bit ld.gold grows to much over 10 gigabytes of virtual space when linking such a .so if
357 # all objects have been built with debug information.)
359 if test $build_os = linux-gnu; then
360 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/linux-x86/bin
361 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/linux-x86
362 if test $build_cpu = x86_64; then
363 if test -d $ANDROID_COMPILER_DIR/prebuilt/linux-x86_64; then
364 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/linux-x86_64/bin
366 if test -d $ANDROID_BINUTILS_DIR/prebuilt/linux-x86_64; then
367 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/linux-x86_64
370 ANDROID_BINUTILS_BIN=$ANDROID_BINUTILS_PREBUILT_ROOT/bin
373 # This stays empty if there is just one version of the toolchain in the NDK
374 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=
375 case "`echo $ANDROID_NDK_HOME/toolchains/$android_cpu*-*/prebuilt/*/bin`" in
377 # Trailing slash intentional and necessary, compare to how this is used
378 if test -n "$ANDROID_USING_CLANG"; then
379 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=4.8/
381 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
386 if test $host_cpu = arm; then
387 android_gnu_prefix=arm-linux-androideabi
388 elif test $host_cpu = mips; then
389 android_gnu_prefix=mipsel-linux-android
390 elif test $ANDROID_NDK_VERSION = r8; then
391 # The prefix used for the x86 tool-chain changed between NDK r8 and r8b
392 android_gnu_prefix=i686-android-linux
394 android_gnu_prefix=i686-linux-android
397 test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-15/arch-$android_cpu
398 test -z "$AR" && AR=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ar
399 test -z "$NM" && NM=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-nm
400 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-objdump
401 test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ranlib
402 test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-strip
404 if test $host_cpu = arm; then
405 ANDROID_APP_ABI=armeabi-v7a
406 if test -n "$ANDROID_USING_CLANG"; then
407 ANDROIDCFLAGS="-gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT"
408 ANDROIDCFLAGS="$ANDROIDCFLAGS -target armv7-none-linux-androideabi"
409 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes"
413 ANDROIDCFLAGS="$ANDROIDCFLAGS -mthumb"
414 ANDROIDCFLAGS="$ANDROIDCFLAGS -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
415 elif test $host_cpu = mips; then
420 ANDROIDCFLAGS="-march=atom"
422 ANDROIDCFLAGS="$ANDROIDCFLAGS -ffunction-sections -fdata-sections"
423 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/$ANDROID_APP_ABI"
424 ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot $ANDROID_NDK_HOME/platforms/android-15/arch-$android_cpu"
425 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wl,--fix-cortex-a8"
427 if test -n "$ANDROID_USING_CLANG"; then
428 ANDROIDCFLAGS="$ANDROIDCFLAGS -Qunused-arguments"
430 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wno-psabi"
433 # When using the 4.6 or newer toolchain, use the gold linker
434 case "$with_android_ndk_toolchain_version" in
435 4.[[6789]]*|[[56789]].*|clang*)
436 # The NDK doesn't have ld.gold for MIPS for some reason
437 if test "$host_cpu" != mips -a "$ENABLE_LTO" != TRUE; then
438 ANDROIDCFLAGS="$ANDROIDCFLAGS -fuse-ld=gold"
443 if test "$ENABLE_LTO" = TRUE; then
444 # -flto comes from com_GCC_degs.mk, too, but we need to make sure it gets passed as part of
445 # $CC and $CXX when building external libraries
446 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto"
449 # gdbserver can be in different locations
450 if test -f $ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver; then
451 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver
452 elif test -f $ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver; then
453 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver
455 AC_MSG_ERROR([Can't find gdbserver for your Android target])
458 if test $host_cpu = arm; then
459 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"
460 elif test $host_cpu = mips; then
461 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"
463 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"
466 if test -z "$CC"; then
467 case "$with_android_ndk_toolchain_version" in
469 CC="$ANDROID_COMPILER_BIN/$android_gnu_prefix-gcc $ANDROIDCFLAGS"
472 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
475 if test -z "$CXX"; then
476 case "$with_android_ndk_toolchain_version" in
478 CXX="$ANDROID_COMPILER_BIN/$android_gnu_prefix-g++ $ANDROIDCXXFLAGS"
481 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
486 AC_SUBST(ANDROID_NDK_GDBSERVER)
487 AC_SUBST(ANDROID_APP_ABI)
489 dnl ===================================================================
490 dnl Also --with-android-sdk is mandatory
491 dnl ===================================================================
493 if test -n "$with_android_sdk"; then
494 ANDROID_SDK_HOME=$with_android_sdk
495 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
497 AC_SUBST(ANDROID_SDK_HOME)
499 dnl ===================================================================
500 dnl The following is a list of supported systems.
501 dnl Sequential to keep the logic very simple
502 dnl These values may be checked and reset later.
503 dnl ===================================================================
504 #defaults unless the os test overrides this:
512 # Default values, as such probably valid just for Linux, set
513 # differently below just for Mac OSX,but at least better than
514 # hardcoding these as we used to do. Much of this is duplicated also
515 # in solenv for old build system and for gbuild, ideally we should
516 # perhaps define stuff like this only here in configure.ac?
518 LINKFLAGSSHL="-shared"
522 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
532 build_gstreamer_0_10=yes
539 dnl ===========================================================
540 dnl Check whether we're using Solaris 10 - SPARC or Intel.
541 dnl ===========================================================
542 AC_MSG_CHECKING([the Solaris operating system release])
543 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
544 if test "$_os_release" -lt "10"; then
545 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
547 AC_MSG_RESULT([ok ($_os_release)])
550 dnl Check whether we're using a SPARC or i386 processor
551 AC_MSG_CHECKING([the processor type])
552 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
553 AC_MSG_RESULT([ok ($host_cpu)])
555 AC_MSG_ERROR([only SPARC and i386 processors are supported])
559 linux-gnu*|k*bsd*-gnu*)
562 build_gstreamer_0_10=yes
576 cygwin*|interix*|mingw32*)
578 # When building on Windows normally with MSVC under Cygwin,
579 # configure thinks that the host platform (the platform the
580 # built code will run on) is Cygwin, even if it obviously is
581 # Windows, which in Autoconf terminology is called
582 # "mingw32". (Which is misleading as MinGW is the name of the
583 # tool-chain, not an operating system.)
585 # Somewhat confusing, yes. But this configure script doesn't
586 # look at $host etc that much, it mostly uses its own $_os
587 # variable, set here in this case statement.
589 # When cross-compiling to Windows from Unix, the host platform
590 # is "mingw32" (because in that case it is the MinGW
591 # tool-chain that is used).
604 # If the host OS matches "mingw32*", that means we are using the
605 # MinGW cross-compiler, because we don't see the point in building
606 # LibreOffice using MinGW on Windows. If you want to build on
607 # Windows, use MSVC. If you want to use MinGW, surely you want to
608 # cross-compile (from Linux or some other Unix).
613 if test -z "$CC"; then
614 CC="$host_cpu-$host_vendor-$host_os-gcc"
616 if test -z "$CXX"; then
617 CXX="$host_cpu-$host_vendor-$host_os-g++"
623 darwin*) # Mac OS X or iOS
630 if test "$host_cpu" = "arm"; then
636 INSTROOTSUFFIX=/$PRODUCTNAME.app/Contents
637 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
640 # See comment above the case "$host_os"
641 LINKFLAGSSHL="-dynamiclib -single_module"
648 # -undefined error is the default
655 build_gstreamer_0_10=yes
660 AC_MSG_CHECKING([the FreeBSD operating system release])
661 if test -n "$with_os_version"; then
662 OSVERSION="$with_os_version"
664 OSVERSION=`/sbin/sysctl -n kern.osreldate`
666 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
667 AC_MSG_CHECKING([which thread library to use])
668 if test "$OSVERSION" -lt "500016"; then
669 PTHREAD_CFLAGS="-D_THREAD_SAFE"
670 PTHREAD_LIBS="-pthread"
671 elif test "$OSVERSION" -lt "502102"; then
672 PTHREAD_CFLAGS="-D_THREAD_SAFE"
676 PTHREAD_LIBS="-pthread"
678 AC_MSG_RESULT([$PTHREAD_LIBS])
685 build_gstreamer_0_10=yes
690 PTHREAD_LIBS="-pthread -lpthread"
697 PTHREAD_LIBS=-pthread
706 PTHREAD_CFLAGS="-D_THREAD_SAFE"
707 PTHREAD_LIBS="-pthread"
714 build_gstreamer_0_10=yes
719 PTHREAD_LIBS="-pthread"
725 build_gstreamer_0_10=no
726 enable_lotuswordpro=no
727 enable_mpl_subset=yes
731 enable_report_builder=no
745 if test -z "$with_android_ndk"; then
746 AC_MSG_ERROR([the --with-android-ndk option is mandatory])
749 if test -z "$with_android_ndk_toolchain_version"; then
750 AC_MSG_ERROR([the --with-android-ndk-toolchain-version option is mandatory])
753 # Verify that the NDK and SDK options are proper
754 if test ! -f "$ANDROID_NDK_HOME/platforms/android-15/arch-arm/usr/lib/libc.a"; then
755 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
758 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
759 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
763 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
767 if echo "$host_os" | grep -q linux-android || test "$enable_sdremote_android" = "yes"; then
768 if test -z "$with_android_sdk"; then
769 AC_MSG_ERROR([the --with-android-sdk option is mandatory])
772 if test ! -d "$ANDROID_SDK_HOME/platforms"; then
773 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
777 if test "$_os" = "AIX"; then
778 AC_PATH_PROG(GAWK, gawk)
779 if test -z "$GAWK"; then
780 AC_MSG_ERROR([gawk not found in \$PATH])
787 AC_SUBST(PTHREAD_CFLAGS)
788 AC_SUBST(PTHREAD_LIBS)
790 ###############################################################################
791 # Extensions switches --enable/--disable
792 ###############################################################################
793 # By default these should be enabled unless having extra dependencies.
794 # If there is extra dependency over configure options then the enable should
795 # be automagic based on whether the requiring feature is enabled or not.
796 # All this options change anything only with --enable-extension-integration.
798 # The name of this option and its help string makes it sound as if
799 # extensions are built anyway, just not integrated in the installer,
800 # if you use --disable-extension-integration. Is that really the
803 AC_ARG_ENABLE(extension-integration,
804 AS_HELP_STRING([--disable-extension-integration],
805 [Disable integration of the built extensions in the installer of the
806 product. Use this switch to disable the integration.])
809 AC_ARG_ENABLE(export,
810 AS_HELP_STRING([--disable-export],
811 [Disable (some) code for document export. Useful when building viewer-only apps that lack
812 save/export functionality, to avoid having an excessive amount of code and data used
813 only for exporrt linked in. Work in progress, use only if you are hacking on it.])
816 AC_ARG_ENABLE(avmedia,
817 AS_HELP_STRING([--disable-avmedia],
818 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
821 AC_ARG_ENABLE(database-connectivity,
822 AS_HELP_STRING([--disable-database-connectivity],
823 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
826 # This doesn't mean not building (or "integrating") extensions
827 # (although it probably should; i.e. it should imply
828 # --disable-extension-integration I guess), it means not supporting
829 # any extension mechanism at all
830 AC_ARG_ENABLE(extensions,
831 AS_HELP_STRING([--disable-extensions],
832 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
835 AC_ARG_ENABLE(scripting,
836 AS_HELP_STRING([--disable-scripting],
837 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
840 # This is mainly for Android and iOS, but could potentially be used in some
841 # special case otherwise, too, so factored out as a separate setting
843 AC_ARG_ENABLE(dynamic-loading,
844 AS_HELP_STRING([--disable-dynamic-loading],
845 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
848 AC_ARG_ENABLE(ext-mariadb-connector,
849 AS_HELP_STRING([--enable-ext-mariadb-connector],
850 [Enable the build of the MariaDB/MySQL Connector extension.])
853 AC_ARG_ENABLE(report-builder,
854 AS_HELP_STRING([--disable-report-builder],
855 [Disable the Report Builder.])
858 AC_ARG_ENABLE(ext-wiki-publisher,
859 AS_HELP_STRING([--enable-ext-wiki-publisher],
860 [Enable the Wiki Publisher extension.])
863 AC_ARG_ENABLE(lpsolve,
864 AS_HELP_STRING([--disable-lpsolve],
865 [Disable compilation of the lp solve solver ])
867 AC_ARG_ENABLE(coinmp,
868 AS_HELP_STRING([--disable-coinmp],
869 [Disable compilation of the CoinMP solver ])
872 AC_ARG_ENABLE(pdfimport,
873 AS_HELP_STRING([--disable-pdfimport],
874 [Disable building the PDF import feature.])
877 ###############################################################################
879 dnl ---------- *** ----------
881 AC_ARG_ENABLE([hardlink-deliver],
882 AS_HELP_STRING([--enable-hardlink-deliver],
883 [Put files into deliver folder as hardlinks instead of copying them
884 over. Saves space and speeds up build.])
887 AC_ARG_ENABLE(mergelibs,
888 AS_HELP_STRING([--enable-mergelibs=<all/yes>],
889 [Enables linking of big, merged, library. Experimental feature, tested
890 only for Linux at some stage in history, but possibly does not work even
891 for Linux any more. 'all' will link a lot of libraries into libmerged
892 while 'yes' will do it for just a core set of libraries.])
895 AC_ARG_ENABLE(graphite,
896 AS_HELP_STRING([--enable-graphite],
897 [Enables the compilation of Graphite smart font rendering.])
901 AS_HELP_STRING([--enable-orcus],
902 [Enables orcus for extra file import filters for Calc.])
905 AC_ARG_ENABLE(fetch-external,
906 AS_HELP_STRING([--disable-fetch-external],
907 [Disables fetching external tarballs from web sources.])
910 AC_ARG_ENABLE(lockdown,
911 AS_HELP_STRING([--disable-lockdown],
912 [Disables the gconf integration work in LibreOffice.]),
916 AS_HELP_STRING([--disable-vba],
917 [Disables the vba compatibility feature.])
921 AS_HELP_STRING([--enable-pch],
922 [Enables precompiled header support for C++.])
925 AC_ARG_ENABLE(win-mozab-driver,
926 AS_HELP_STRING([--enable-win-mozab-driver],
927 [LibreOffice includes a driver to connect to Mozilla
928 address books under Windows, to build with this version, use this option.])
932 AS_HELP_STRING([--enable-epm],
933 [LibreOffice includes self-packaging code, that requires epm, however epm is
934 useless for large scale package building.])
938 AS_HELP_STRING([--disable-odk],
939 [LibreOffice includes an ODK, office development kit which some packagers may
940 wish to build without.])
943 AC_ARG_ENABLE(mpl-subset,
944 AS_HELP_STRING([--enable-mpl-subset],
945 [Don't compile any pieces which are not MPL or more liberally licensed])
948 AC_ARG_ENABLE(evolution2,
949 AS_HELP_STRING([--enable-evolution2],
950 [Allows the built-in evolution 2 addressbook connectivity build to be
954 AC_ARG_ENABLE(directx,
955 AS_HELP_STRING([--disable-directx],
956 [Remove DirectX implementation for the new XCanvas interface.
957 The DirectX support requires more stuff installed on Windows to
958 compile. (DirectX SDK, GDI+ libs)])
961 AC_ARG_ENABLE(activex,
962 AS_HELP_STRING([--disable-activex],
963 [Disable the use of ActiveX for a Windows build.
964 This switch is mandatory when using an Express edition of Visual Studio.])
968 AS_HELP_STRING([--disable-atl],
969 [Disable the use of ATL for a Windows build.])
971 This switch is mandatory when using an Express edition of Visual Studio.
976 AS_HELP_STRING([--enable-avahi],
977 [Determines whether to use Avahi to advertise Impress to remote controls.]),
980 AC_ARG_ENABLE(werror,
981 AS_HELP_STRING([--enable-werror],
982 [Turn warnings to errors. (Has no effect in modules where the treating
983 of warnings as errors is disabled explicitly.)]),
986 AC_ARG_ENABLE(assert-always-abort,
987 AS_HELP_STRING([--enable-assert-always-abort],
988 [make assert() abort even in release code.]),
991 AC_ARG_ENABLE(dbgutil,
992 AS_HELP_STRING([--enable-dbgutil],
993 [Provide debugging support from --enable-debug and include additional debugging
994 utilities such as object counting or more expensive checks.
995 This is the recommended option for developers.
996 Note that this makes the build ABI incompatible, it is not possible to mix object
997 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1000 AS_HELP_STRING([--enable-debug],
1001 [Include debugging information, disable compiler optimization and inlining plus
1002 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1004 AC_ARG_ENABLE(selective-debuginfo,
1005 AS_HELP_STRING([--enable-selective-debuginfo],
1006 [If --enable-debug or --enable-dbgutil is used, build debugging information
1007 (-g compiler flag) only for the specified gbuild build targets
1008 (where all means everything, - prepended means not to enable, / appended means
1009 everything in the directory; there is no ordering, more specific overrides
1010 more general, and disabling takes precedence).
1011 Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
1013 AC_ARG_ENABLE(symbols,
1014 AS_HELP_STRING([--enable-symbols],
1015 [Include debugging symbols in output while preserve optimization.
1016 This enables -g compiler flag for GCC or equivalent,
1017 without changing anything else compared to productive code.]))
1019 AC_ARG_ENABLE(runtime-optimizations,
1020 AS_HELP_STRING([--disable-runtime-optimizations],
1021 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1022 JVM JIT) that are known to interact badly with certain dynamic analysis
1023 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1024 CC contains "-fsanitize=address". (For Valgrind, those runtime
1025 optimizations are typcially disabled dynamically via
1026 RUNNING_ON_VALGRIND.)]))
1028 AC_ARG_ENABLE(compiler-plugins,
1029 AS_HELP_STRING([--enable-compiler-plugins],
1030 [Enable compiler plugins that will perform additional checks during
1031 building. Enabled automatically by --enable-dbgutil.]))
1033 AC_ARG_ENABLE(ooenv,
1034 AS_HELP_STRING([--disable-ooenv],
1035 [Disable ooenv for the instdir installation.]))
1038 AS_HELP_STRING([--enable-lto],
1039 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1040 longer but libraries and executables are optimized for speed. (For GCC, best to use GCC 4.6
1041 or later and 'gold' linker. Works fine (and is turned on automatically in an optimising
1042 build) for MSVC, otherwise experimental work in progress that shouldn't be used unless you
1043 are working on it.)]))
1045 AC_ARG_ENABLE(crashdump,
1046 AS_HELP_STRING([--enable-crashdump],
1047 [Enable the crashdump feature.]))
1049 AC_ARG_ENABLE(python,
1050 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1051 [Enables or disables Python support at run-time and build-time.
1052 Also specifies what Python to use. 'auto' is the default.
1053 'fully-internal' even forces the internal version for uses of Python
1054 during the build.]))
1057 AS_HELP_STRING([--disable-gtk],
1058 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
1062 AS_HELP_STRING([--enable-gtk3],
1063 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
1066 AC_ARG_ENABLE(systray,
1067 AS_HELP_STRING([--disable-systray],
1068 [Determines whether to build the systray quickstarter.]),
1069 ,enable_systray=yes)
1071 AC_ARG_ENABLE(split-app-modules,
1072 AS_HELP_STRING([--enable-split-app-modules],
1073 [Split file lists for app modules, e.g. base, calc.
1074 Has effect only with make distro-pack-install]),
1077 AC_ARG_ENABLE(split-opt-features,
1078 AS_HELP_STRING([--enable-split-opt-features],
1079 [Split file lists for some optional features, .e.g. pyuno, testtool.
1080 Has effect only with make distro-pack-install]),
1083 AC_ARG_ENABLE(cairo-canvas,
1084 [ --disable-cairo-canvas Determines whether to build the Cairo canvas on
1085 platforms where Cairo is available.
1088 AC_ARG_ENABLE(opengl,
1089 AS_HELP_STRING([--disable-opengl],
1090 [Determines whether to build the OpenGL 3D slide transitions and canvas component.]))
1092 AC_ARG_ENABLE(opencl,
1093 AS_HELP_STRING([--disable-opencl],
1094 [Determines whether to build with OpenCL support.]))
1097 AS_HELP_STRING([--disable-dbus],
1098 [Determines whether to enable features that depend on dbus.
1099 e.g. Presentation mode screensaver control, bluetooth presentation control]),
1102 AC_ARG_ENABLE(packagekit,
1103 AS_HELP_STRING([--enable-packagekit],
1104 [Determines whether to enable features using packagekit.
1105 Right now that is auto font install]),
1108 AC_ARG_ENABLE(sdremote,
1109 AS_HELP_STRING([--disable-sdremote],
1110 [Determines whether to enable Impress remote control (i.e. the server component).]),
1111 ,enable_sdremote=yes)
1113 AC_ARG_ENABLE(sdremote-bluetooth,
1114 AS_HELP_STRING([--disable-sdremote-bluetooth],
1115 [Determines whether to build sdremote with bluetooth support.
1116 Requires dbus on Linux.]))
1118 AC_ARG_ENABLE(sdremote-android,
1119 AS_HELP_STRING([--enable-sdremote-android],
1120 [Determines whether to build the Impress Remote Android app -- requires
1121 a correctly configured android sdk.]),
1122 ,enable_sdremote_android=no)
1124 AC_ARG_ENABLE(gconf,
1125 AS_HELP_STRING([--disable-gconf],
1126 [Determines whether to use the GConf support.]),
1129 AC_ARG_ENABLE(gnome-vfs,
1130 AS_HELP_STRING([--enable-gnome-vfs],
1131 [Determines whether to use the Gnome Virtual Filing System on platforms
1132 where that VFS is available.]),
1133 ,enable_gnome_vfs=no)
1136 AS_HELP_STRING([--disable-gio],
1137 [Determines whether to use the GIO support.]),
1140 AC_ARG_ENABLE(telepathy,
1141 AS_HELP_STRING([--enable-telepathy],
1142 [Determines whether to enable Telepathy for collaboration.]),
1143 ,enable_telepathy=no)
1146 AS_HELP_STRING([--enable-tde],
1147 [Determines whether to use TQt/TDE vclplug on platforms where TQt and
1148 TDE are available.]),
1151 AC_ARG_ENABLE(tdeab,
1152 AS_HELP_STRING([--disable-tdeab],
1153 [Disable the TDE address book support.]),
1155 if test "$enable_tde" = "yes"; then
1161 AS_HELP_STRING([--enable-kde],
1162 [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
1163 KDE3 are available.]),
1166 AC_ARG_ENABLE(kdeab,
1167 AS_HELP_STRING([--disable-kdeab],
1168 [Disable the KDE3 address book support.]),
1170 if test "$enable_kde" = "yes"; then
1176 AS_HELP_STRING([--enable-kde4],
1177 [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
1178 KDE4 are available. May be used with --enable-kde if you want to support
1179 both KDE3 and KDE4.]),
1182 AC_ARG_ENABLE(headless,
1183 AS_HELP_STRING([--enable-headless],
1184 [Disable building of GUIs to reduce dependencies. Useful for
1185 server usage. Work in progress, use only if you are hacking on
1186 it. Not related to the --headless option.]), ,)
1188 AC_ARG_ENABLE(randr,
1189 AS_HELP_STRING([--disable-randr],
1190 [Disable RandR support in the vcl project.]),
1193 AC_ARG_ENABLE(randr-link,
1194 AS_HELP_STRING([--disable-randr-link],
1195 [Disable linking with libXrandr, instead dynamically open it at runtime.]),
1196 ,enable_randr_link=yes)
1198 AC_ARG_ENABLE(gstreamer,
1199 AS_HELP_STRING([--enable-gstreamer],
1200 [Enable building with the new gstreamer 1.0 avmedia backend.]),
1201 ,enable_gstreamer=no)
1203 AC_ARG_ENABLE(gstreamer-0-10,
1204 AS_HELP_STRING([--disable-gstreamer-0-10],
1205 [Disable building the gstreamer avmedia backend.]),
1206 ,enable_gstreamer_0_10=yes)
1209 AS_HELP_STRING([--enable-vlc],
1210 [Enable building with the VLC avmedia backend.]),
1214 AS_HELP_STRING([--disable-neon],
1215 [Disable neon and the compilation of webdav binding.]),
1218 AC_ARG_ENABLE([eot],
1219 [AS_HELP_STRING([--enable-eot],
1220 [Enable support for Embedded OpenType fonts.])],
1223 AC_ARG_ENABLE(cve-tests,
1224 AS_HELP_STRING([--disable-cve-tests],
1225 [Prevent CVE tests to be executed]),
1228 AC_ARG_ENABLE(chart-tests,
1229 AS_HELP_STRING([--enable-chart-tests],
1230 [Executes chart XShape tests]),
1233 AC_ARG_ENABLE(build-unowinreg,
1234 AS_HELP_STRING([--enable-build-unowinreg],
1235 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1236 compiler is needed on Linux.])
1238 Usage: --enable-build-unowinreg
1242 AC_ARG_ENABLE(verbose,
1243 AS_HELP_STRING([--enable-verbose],
1244 [Increase build verbosity.])[
1245 --disable-verbose Decrease build verbosity.],
1248 AC_ARG_ENABLE(dependency-tracking,
1249 AS_HELP_STRING([--enable-dependency-tracking],
1250 [Do not reject slow dependency extractors.])[
1251 --disable-dependency-tracking
1252 Disables generation of dependency information.
1253 Speed up one-time builds.],
1256 AC_ARG_ENABLE(icecream,
1257 AS_HELP_STRING([--enable-icecream],
1258 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1259 It defaults to /opt/icecream for the location of the icecream gcc/g++
1260 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1264 AS_HELP_STRING([--disable-cups],
1265 [Do not build cups support.])
1268 AC_ARG_ENABLE(ccache,
1269 AS_HELP_STRING([--disable-ccache],
1270 [Do not try to use ccache automatically.
1271 By default, we will try to detect if ccache is available; in that case if
1272 CC/CXX are not yet set, and --enable-icecream is not given, we
1273 attempt to use ccache. --disable-ccache disables ccache completely.
1277 AC_ARG_ENABLE(64-bit,
1278 AS_HELP_STRING([--enable-64-bit],
1279 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit. Works fine for OS
1280 X. In other cases this option is experimental and possibly quite broken, use only if you are
1281 hacking on 64-bit support.]), ,)
1283 AC_ARG_ENABLE(extra-gallery,
1284 AS_HELP_STRING([--enable-extra-gallery],
1285 [Add extra gallery content.]),
1288 AC_ARG_ENABLE(extra-template,
1289 AS_HELP_STRING([--enable-extra-template],
1290 [Add extra template content.]),
1293 AC_ARG_ENABLE(extra-sample,
1294 AS_HELP_STRING([--enable-extra-sample],
1295 [Add extra sample content.]),
1298 AC_ARG_ENABLE(extra-font,
1299 AS_HELP_STRING([--enable-extra-font],
1300 [Add extra font content.]),
1303 AC_ARG_ENABLE(online-update,
1304 AS_HELP_STRING([--enable-online-update],
1305 [Enable the online update service that will check for new versions of
1306 LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
1309 AC_ARG_ENABLE(release-build,
1310 AS_HELP_STRING([--enable-release-build],
1311 [Enable release build.
1312 See http://wiki.documentfoundation.org/DevBuild]),
1315 AC_ARG_ENABLE(windows-build-signing,
1316 AS_HELP_STRING([--enable-windows-build-signing],
1317 [Enable signing of windows binaries (*.exe, *.dll)]),
1320 AC_ARG_ENABLE(silent-msi,
1321 AS_HELP_STRING([--enable-silent-msi],
1322 [Enable MSI with LIMITUI=1 (silent install).]),
1325 AC_ARG_ENABLE(macosx-retina,
1326 AS_HELP_STRING([--enable-macosx-retina],
1327 [Declare the application as High Resolution Capable. (retina display)
1331 AC_ARG_ENABLE(macosx-code-signing,
1332 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1333 [Sign executables, dylibs, frameworks and the app bundle. If you
1334 don't provide an identity the first suitable certificate
1335 in your keychain is used.]),
1338 AC_ARG_ENABLE(macosx-package-signing,
1339 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1340 [Create a .pkg suitable for uploading to the Mac App Store and sign
1341 it. If you don't provide an identity the first suitable certificate
1342 in your keychain is used.]),
1345 AC_ARG_ENABLE(macosx-sandbox,
1346 AS_HELP_STRING([--enable-macosx-sandbox],
1347 [Make the app bundle run in a sandbox. Requires code signing.
1348 Is required by apps distributed in the Mac App Store, and implies
1349 adherence to App Store rules.]),
1352 AC_ARG_ENABLE(canonical-installation-tree-structure,
1353 AS_HELP_STRING([--enable-canonical-installation-tree-structure],
1354 [Make the installation tree structure be more canonical for
1355 the platform. Implemented only for OS X. Experimental and currently broken.]),
1359 AC_ARG_WITH(macosx-bundle-identifier,
1360 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1361 [Define the OS X bundle identifier. Default is the somewhat weird
1362 org.libreoffice.script ("script", huh?).]),
1363 ,with_macosx_bundle_identifier=org.libreoffice.script)
1365 AC_ARG_WITH(macosx-app-name,
1366 AS_HELP_STRING([--with-macosx-app-name='My Own Office Suite'],
1367 [Define the OS X app name. Default is AC_PACKAGE_NAME.]),
1368 ,with_macosx_app_name=$PRODUCTNAME)
1370 AC_ARG_ENABLE(ios-simulator,
1371 AS_HELP_STRING([--enable-ios-simulator],
1372 [Build for the iOS Simulator, not iOS device.]),
1375 AC_ARG_ENABLE(readonly-installset,
1376 AS_HELP_STRING([--enable-readonly-installset],
1377 [Prevents any attempts by LibreOffice to write into its installation. That means
1378 at least that no "system-wide" extensions can be added. Experimental work in
1382 AC_ARG_ENABLE(postgresql-sdbc,
1383 AS_HELP_STRING([--disable-postgresql-sdbc],
1384 [Disable the build of the PostgreSQL-SDBC driver.])
1387 AC_ARG_ENABLE(lotuswordpro,
1388 AS_HELP_STRING([--disable-lotuswordpro],
1389 [Disable the build of the Lotus Word Pro filter.]),
1390 ,enable_lotuswordpro=yes)
1392 AC_ARG_ENABLE(firebird-sdbc,
1393 AS_HELP_STRING([--disable-firebird-sdbc],
1394 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1395 ,enable_firebird_sdbc=yes)
1397 AC_ARG_ENABLE(winegcc,
1398 AS_HELP_STRING([--enable-winegcc],
1399 [Enable use of winegcc during the build, in order to create msi* tools
1400 needed for MinGW cross-compilation.]),
1403 AC_ARG_ENABLE(liblangtag,
1404 AS_HELP_STRING([--disable-liblangtag],
1405 [Disable use of liblangtag, and instead use an own simple
1409 AC_ARG_ENABLE(bogus-pkg-config,
1410 AS_HELP_STRING([--enable-bogus-pkg-config],
1411 [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.]),
1414 AC_ARG_ENABLE(openssl,
1415 AS_HELP_STRING([--disable-openssl],
1416 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1417 components will either use GNUTLS or NSS. Work in progress,
1418 use only if you are hacking on it.]),
1419 ,enable_openssl=yes)
1421 AC_ARG_ENABLE(library-bin-tar,
1422 AS_HELP_STRING([--enable-library-bin-tar],
1423 [Enable the building and reused of tarball of binary build for some 'external' libraries
1424 Some libraries can save their build result in a tarball
1425 stored in TARFILE_LOCATION. that binary tarball is
1426 uniquely identified by the source tarbal,
1427 the content of the config_host.mk file and the content
1428 of the top-level directory in core for that library
1429 If this option is enabled, then if such a tarfile exist, it will be untarred
1430 isntead of the source tarfile, and the build step will be skipped for that
1432 If a proper tarfile does not exist, then the normal source-based
1433 build is done for taht library and a proper binary tarfile is created
1434 for the next time.]),
1438 AS_HELP_STRING([--disable-gltf],
1439 [Determines whether to build libraries related to glTF 3D model rendering.]))
1441 dnl ===================================================================
1442 dnl Optional Packages (--with/without-)
1443 dnl ===================================================================
1445 AC_ARG_WITH(gnu-patch,
1446 AS_HELP_STRING([--with-gnu-patch],
1447 [Specify location of GNU patch on Solaris or FreeBSD.]),
1450 AC_ARG_WITH(build-platform-configure-options,
1451 [Specify options for the configure script run for the *build* platform in a cross-compilation])
1454 AS_HELP_STRING([--with-gnu-cp],
1455 [Specify location of GNU cp on Solaris or FreeBSD.]),
1458 AC_ARG_WITH(external-tar,
1459 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1460 [Specify an absolute path of where to find (and store) tarfiles.]),
1461 TARFILE_LOCATION=$withval ,
1464 AC_ARG_WITH(referenced-git,
1465 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1466 [Specify another checkout directory to reference. This makes use of
1467 git submodule update --reference, and saves a lot of diskspace
1468 when having multiple trees side-by-side.]),
1469 GIT_REFERENCE_SRC=$withval ,
1472 AC_ARG_WITH(linked-git,
1473 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1474 [Specify a directory where the repositories of submodules are located.
1475 This uses a method similar to git-new-workdir to get submodules.]),
1476 GIT_LINK_SRC=$withval ,
1479 AC_ARG_WITH(galleries,
1480 AS_HELP_STRING([--with-galleries],
1481 [Specify how galleries should be built. It is possible either to
1482 build these internally from source ("build"),
1483 or to disable them ("no")]),
1487 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1488 [Choose which themes to include. By default those themes with an '*' are included.
1489 Possible choices: *crystal, *default (galaxy), *hicontrast, human, industrial, *oxygen, *sifr, *tango, *tango_testing.]),
1492 AC_ARG_WITH(helppack-integration,
1494 --without-helppack-integration It will not integrate the helppacks to the installer
1496 Please use this switch to use the online help or separate help packages.],
1500 AS_HELP_STRING([--without-fonts],
1501 [LibreOffice includes some third-party fonts to provide a reliable basis for
1502 help content, templates, samples, etc. When these fonts are already
1503 known to be available on the system then you should use this option.]),
1507 AS_HELP_STRING([--without-ppds],
1508 [Removes Postscript Printer definition files from LibreOffice
1509 installation set, for people building for specific distributions where
1510 PPDs are known to be already available (every recent distro with CUPS backend).]),
1514 AS_HELP_STRING([--with-epm],
1515 [Decides which epm to use. Default is to use the one from the system if
1516 one is built. When either this is not there or you say =internal epm
1520 AC_ARG_WITH(package-format,
1521 AS_HELP_STRING([--with-package-format],
1522 [Specify package format(s) for LibreOffice installation sets. The
1523 implicit --without-package-format leads to no installation sets being
1524 generated. Possible values: aix, archive, bsd, deb, dmg,
1525 installed, msi, native, pkg, portable, and rpm.
1526 Example: --with-package-format='deb rpm']),
1530 AS_HELP_STRING([--with-tls],
1531 [Decides which TLS/SSL and cryptographic implementations to use for
1532 LibreOffice's code. Notice that this doesn't apply for depending
1533 libraries like "neon", for example. Default is to use OpenSSL
1534 although NSS is also possible. Notice that selecting NSS restricts
1535 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1536 restrict by now the usage of NSS in LO's code. Possible values:
1537 openssl, nss. Example: --with-tls="nss"]),
1540 AC_ARG_WITH(system-libs,
1541 AS_HELP_STRING([--with-system-libs],
1542 [Use libraries already on system -- enables all --with-system-* flags.]),
1545 AC_ARG_WITH(system-headers,
1546 AS_HELP_STRING([--with-system-headers],
1547 [Use headers already on system -- enables all --with-system-* flags for
1548 external packages whose headers are the only entities used i.e.
1549 boost/vigra/odbc/sane-header(s).]),,
1550 [with_system_headers="$with_system_libs"])
1552 AC_ARG_WITH(system-jars,
1553 AS_HELP_STRING([--without-system-jars],
1554 [When building with --with-system-libs, also the needed jars are expected
1555 on the system. Use this to disable that]),,
1556 [with_system_jars="$with_system_libs"])
1558 AC_ARG_WITH(system-cairo,
1559 AS_HELP_STRING([--with-system-cairo],
1560 [Use cairo libraries already on system. Happens automatically for
1561 (implicit) --enable-gtk and for --enable-gtk3.]))
1563 AC_ARG_WITH(myspell-dicts,
1564 AS_HELP_STRING([--with-myspell-dicts],
1565 [Adds myspell dictionaries to the LibreOffice installation set]),
1568 AC_ARG_WITH(system-dicts,
1569 AS_HELP_STRING([--without-system-dicts],
1570 [Do not use dictionaries from system paths.]),
1573 AC_ARG_WITH(external-dict-dir,
1574 AS_HELP_STRING([--with-external-dict-dir],
1575 [Specify external dictionary dir.]),
1578 AC_ARG_WITH(external-hyph-dir,
1579 AS_HELP_STRING([--with-external-hyph-dir],
1580 [Specify external hyphenation pattern dir.]),
1583 AC_ARG_WITH(external-thes-dir,
1584 AS_HELP_STRING([--with-external-thes-dir],
1585 [Specify external thesaurus dir.]),
1588 AC_ARG_WITH(system-zlib,
1589 AS_HELP_STRING([--with-system-zlib],
1590 [Use zlib already on system.]),,
1591 [with_system_zlib=auto])
1593 AC_ARG_WITH(system-jpeg,
1594 AS_HELP_STRING([--with-system-jpeg],
1595 [Use jpeg already on system.]),,
1596 [with_system_jpeg=auto])
1598 AC_ARG_WITH(system-clucene,
1599 AS_HELP_STRING([--with-system-clucene],
1600 [Use clucene already on system.]),,
1601 [with_system_clucene="$with_system_libs"])
1603 AC_ARG_WITH(system-expat,
1604 AS_HELP_STRING([--with-system-expat],
1605 [Use expat already on system.]),,
1606 [with_system_expat="$with_system_libs"])
1608 AC_ARG_WITH(system-libxml,
1609 AS_HELP_STRING([--with-system-libxml],
1610 [Use libxml/libxslt already on system.]),,
1611 [with_system_libxml=auto])
1613 AC_ARG_WITH(system-icu,
1614 AS_HELP_STRING([--with-system-icu],
1615 [Use icu already on system.]),,
1616 [with_system_icu="$with_system_libs"])
1618 AC_ARG_WITH(system-ucpp,
1619 AS_HELP_STRING([--with-system-ucpp],
1620 [Use ucpp already on system.]),,
1623 AC_ARG_WITH(system-openldap,
1624 AS_HELP_STRING([--with-system-openldap],
1625 [Use the OpenLDAP LDAP SDK already on system.]),,
1626 [with_system_openldap="$with_system_libs"])
1628 AC_ARG_WITH(system-poppler,
1629 AS_HELP_STRING([--with-system-poppler],
1630 [Use system poppler (only needed for PDF import).]),,
1631 [with_system_poppler="$with_system_libs"])
1633 AC_ARG_WITH(system-apache-commons,
1634 AS_HELP_STRING([--with-system-apache-commons],
1635 [Use Apache commons libraries already on system.]),,
1636 [with_system_apache_commons="$with_system_jars"])
1638 AC_ARG_WITH(system-mariadb,
1639 AS_HELP_STRING([--with-system-mariadb],
1640 [Use MariaDB/MySQL libraries already on system, for building the MariaDB Connector/LibreOffice
1642 [with_system_mariadb="$with_system_libs"])
1644 AC_ARG_ENABLE(bundle-mariadb,
1645 AS_HELP_STRING([--enable-bundle-mariadb],
1646 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice extension.])
1649 AC_ARG_WITH(system-mysql-cppconn,
1650 AS_HELP_STRING([--with-system-mysql-cppconn],
1651 [Use MySQL C++ Connector libraries already on system.]),,
1652 [with_system_mysql_cppconn="$with_system_libs"])
1654 AC_ARG_WITH(system-postgresql,
1655 AS_HELP_STRING([--with-system-postgresql],
1656 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1657 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1658 [with_system_postgresql="$with_system_libs"])
1660 AC_ARG_WITH(libpq-path,
1661 AS_HELP_STRING([--with-libpq-path],
1662 [Use this PostgreSQL C interface (libpq) installation for building
1663 the PostgreSQL-SDBC extension.])
1665 Usage: --with-libpq-path=<absolute path to
1666 your libpq installation>
1670 AC_ARG_WITH(system-firebird,
1671 AS_HELP_STRING([--with-system-firebird],
1672 [Use Firebird libraries already on system, for building the Firebird-SDBC
1673 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1674 [with_system_firebird="$with_system_libs"])
1676 AC_ARG_WITH(system-hsqldb,
1677 AS_HELP_STRING([--with-system-hsqldb],
1678 [Use hsqldb already on system.]))
1680 AC_ARG_WITH(hsqldb-jar,
1681 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1682 [Specify path to jarfile manually.]),
1683 HSQLDB_JAR=$withval)
1685 AC_ARG_ENABLE(scripting-beanshell,
1686 AS_HELP_STRING([--disable-scripting-beanshell],
1687 [Disable support for scripts in BeanShell.]),
1691 AC_ARG_WITH(system-beanshell,
1692 AS_HELP_STRING([--with-system-beanshell],
1693 [Use beanshell already on system.]),,
1694 [with_system_beanshell="$with_system_jars"])
1696 AC_ARG_WITH(beanshell-jar,
1697 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1698 [Specify path to jarfile manually.]),
1701 AC_ARG_ENABLE(scripting-javascript,
1702 AS_HELP_STRING([--disable-scripting-javascript],
1703 [Disable support for scripts in JavaScript.]),
1707 AC_ARG_WITH(system-rhino,
1708 AS_HELP_STRING([--with-system-rhino],
1709 [Use rhino already on system.]),,)
1710 # [with_system_rhino="$with_system_jars"])
1711 # Above is not used as we have different debug interface
1712 # patched into internal rhino. This code needs to be fixed
1713 # before we can enable it by default.
1715 AC_ARG_WITH(rhino-jar,
1716 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1717 [Specify path to jarfile manually.]),
1720 AC_ARG_WITH(commons-codec-jar,
1721 AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1722 [Specify path to jarfile manually.]),
1723 COMMONS_CODEC_JAR=$withval)
1725 AC_ARG_WITH(commons-lang-jar,
1726 AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1727 [Specify path to jarfile manually.]),
1728 COMMONS_LANG_JAR=$withval)
1730 AC_ARG_WITH(commons-httpclient-jar,
1731 AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1732 [Specify path to jarfile manually.]),
1733 COMMONS_HTTPCLIENT_JAR=$withval)
1735 AC_ARG_WITH(commons-logging-jar,
1736 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1737 [Specify path to jarfile manually.]),
1738 COMMONS_LOGGING_JAR=$withval)
1740 AC_ARG_WITH(system-jfreereport,
1741 AS_HELP_STRING([--with-system-jfreereport],
1742 [Use JFreeReport already on system.]),,
1743 [with_system_jfreereport="$with_system_jars"])
1745 AC_ARG_WITH(sac-jar,
1746 AS_HELP_STRING([--with-sac-jar=JARFILE],
1747 [Specify path to jarfile manually.]),
1750 AC_ARG_WITH(libxml-jar,
1751 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1752 [Specify path to jarfile manually.]),
1753 LIBXML_JAR=$withval)
1755 AC_ARG_WITH(flute-jar,
1756 AS_HELP_STRING([--with-flute-jar=JARFILE],
1757 [Specify path to jarfile manually.]),
1760 AC_ARG_WITH(jfreereport-jar,
1761 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1762 [Specify path to jarfile manually.]),
1763 JFREEREPORT_JAR=$withval)
1765 AC_ARG_WITH(liblayout-jar,
1766 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1767 [Specify path to jarfile manually.]),
1768 LIBLAYOUT_JAR=$withval)
1770 AC_ARG_WITH(libloader-jar,
1771 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1772 [Specify path to jarfile manually.]),
1773 LIBLOADER_JAR=$withval)
1775 AC_ARG_WITH(libloader-jar,
1776 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1777 [Specify path to jarfile manually.]),
1778 LIBLOADER_JAR=$withval)
1780 AC_ARG_WITH(libformula-jar,
1781 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1782 [Specify path to jarfile manually.]),
1783 LIBFORMULA_JAR=$withval)
1785 AC_ARG_WITH(librepository-jar,
1786 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1787 [Specify path to jarfile manually.]),
1788 LIBREPOSITORY_JAR=$withval)
1790 AC_ARG_WITH(libfonts-jar,
1791 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1792 [Specify path to jarfile manually.]),
1793 LIBFONTS_JAR=$withval)
1795 AC_ARG_WITH(libserializer-jar,
1796 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1797 [Specify path to jarfile manually.]),
1798 LIBSERIALIZER_JAR=$withval)
1800 AC_ARG_WITH(libbase-jar,
1801 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1802 [Specify path to jarfile manually.]),
1803 LIBBASE_JAR=$withval)
1805 AC_ARG_WITH(system-odbc,
1806 AS_HELP_STRING([--with-system-odbc],
1807 [Use the odbc headers already on system.]),,
1808 [with_system_odbc="$with_system_headers"])
1810 AC_ARG_WITH(system-sane,
1811 AS_HELP_STRING([--with-system-sane],
1812 [Use sane.h already on system.]),,
1813 [with_system_sane="$with_system_headers"])
1815 AC_ARG_WITH(system-bluez,
1816 AS_HELP_STRING([--with-system-bluez],
1817 [Use bluetooth.h already on system.]),,
1818 [with_system_bluez="$with_system_headers"])
1820 AC_ARG_WITH(system-mesa-headers,
1821 AS_HELP_STRING([--with-system-mesa-headers],
1822 [Use Mesa headers already on system.]),,
1823 [with_system_mesa_headers="$with_system_headers"])
1825 AC_ARG_WITH(system-curl,
1826 AS_HELP_STRING([--with-system-curl],
1827 [Use curl already on system.]),,
1828 [with_system_curl=auto])
1830 AC_ARG_WITH(system-boost,
1831 AS_HELP_STRING([--with-system-boost],
1832 [Use boost already on system.]),,
1833 [with_system_boost="$with_system_headers"])
1835 AC_ARG_WITH(system-glm,
1836 AS_HELP_STRING([--with-system-glm],
1837 [Use glm already on system.]),,
1838 [with_system_glm="$with_system_headers"])
1840 AC_ARG_WITH(system-vigra,
1841 AS_HELP_STRING([--with-system-vigra],
1842 [Use vigra already on system.]),,
1843 [with_system_vigra="$with_system_headers"])
1845 AC_ARG_WITH(system-hunspell,
1846 AS_HELP_STRING([--with-system-hunspell],
1847 [Use libhunspell already on system.]),,
1848 [with_system_hunspell="$with_system_libs"])
1850 AC_ARG_WITH(system-mythes,
1851 AS_HELP_STRING([--with-system-mythes],
1852 [Use mythes already on system.]),,
1853 [with_system_mythes="$with_system_libs"])
1855 AC_ARG_WITH(system-altlinuxhyph,
1856 AS_HELP_STRING([--with-system-altlinuxhyph],
1857 [Use ALTLinuxhyph already on system.]),,
1858 [with_system_altlinuxhyph="$with_system_libs"])
1860 AC_ARG_WITH(system-lpsolve,
1861 AS_HELP_STRING([--with-system-lpsolve],
1862 [Use lpsolve already on system.]),,
1863 [with_system_lpsolve="$with_system_libs"])
1865 AC_ARG_WITH(system-liblangtag,
1866 AS_HELP_STRING([--with-system-liblangtag],
1867 [Use liblangtag library already on system.]),,
1868 [with_system_liblangtag="$with_system_libs"])
1870 AC_ARG_WITH(system-npapi-headers,
1871 AS_HELP_STRING([--with-system-npapi-headers],
1872 [Use NPAPI headers provided by system instead of bundled ones. Used in
1873 extensions/source/nsplugin (ENABLE_NPAPI_INTO_BROWSER=TRUE) and
1874 extensions/source/plugin (ENABLE_NPAPI_FROM_BROWSER=TRUE)]),,
1875 [with_system_npapi_headers="$with_system_headers"]
1879 AS_HELP_STRING([--with-webdav],
1880 [Specify which library to use for webdav implementation.
1881 Possible values: "neon", "serf", "no". The default value is "neon".
1882 Example: --with-webdav="serf"]),
1883 WITH_WEBDAV=$withval,
1886 AC_ARG_WITH(linker-hash-style,
1887 AS_HELP_STRING([--with-linker-hash-style],
1888 [Use linker with --hash-style=<style> when linking shared objects.
1889 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1890 if supported on the build system, and "sysv" otherwise.]))
1892 AC_ARG_WITH(jdk-home,
1893 AS_HELP_STRING([--with-jdk-home],
1894 [If you have installed JDK 1.3 or later on your system please supply the
1895 path here. Note that this is not the location of the java command but the
1896 location of the entire distribution.])
1898 Usage: --with-jdk-home=<absolute path to JDK home>
1903 AS_HELP_STRING([--with-help],
1904 [Enable the build of help. There is a special parameter "common" that
1905 can be used to bundle only the common part, .e.g help-specific icons.
1906 This is useful when you build the helpcontent separately.])
1908 Usage: --with-help build the entire local help
1909 --without-help no local help (default)
1910 --with-help=common bundle common files for the local
1911 help but do not build the whole help
1916 AS_HELP_STRING([--with-java],
1917 [Specify the name of the Java interpreter command. Typically "java"
1918 which is the default.
1920 To build without support for Java components, applets, accessibility
1921 or the XML filters written in Java, use --without-java or --with-java=no.])
1923 Usage: --with-java==<java command>
1926 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1930 AC_ARG_WITH(jvm-path,
1931 AS_HELP_STRING([--with-jvm-path],
1932 [Use a specific JVM search path at runtime.])
1934 Usage: --with-jvm-path=<absolute path to parent of jvm home>
1936 e. g.: --with-jvm-path=/usr/lib/
1937 to find JRE/JDK in /usr/lib/jvm/
1941 AC_ARG_WITH(ant-home,
1942 AS_HELP_STRING([--with-ant-home],
1943 [If you have installed Jakarta Ant on your system, please supply the path here.
1944 Note that this is not the location of the Ant binary but the location
1945 of the entire distribution.])
1947 Usage: --with-ant-home=<absolute path to Ant home>
1951 AC_ARG_WITH(export-validation,
1952 AS_HELP_STRING([--with-export-validation],
1953 [If you want the exported files to be validated. Right now limited to OOXML files in calc export tests.
1954 Note: You need an executable script officeotron that takes the path to the file.])
1956 Usage: --with-export-validation
1961 AS_HELP_STRING([--with-junit],
1962 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1963 --without-junit disables those tests. Not relevant in the --without-java case.])
1965 Usage: --with-junit=<absolute path to JUnit 4 jar>
1969 AC_ARG_WITH(perl-home,
1970 AS_HELP_STRING([--with-perl-home],
1971 [If you have installed Perl 5 Distribution, on your system, please
1972 supply the path here. Note that this is not the location of the Perl
1973 binary but the location of the entire distribution.])
1975 Usage: --with-perl-home=<abs. path to Perl 5 home>
1983 [Specifies the doxygen executable to use when generating ODK C/C++
1984 documentation. --without-doxygen disables generation of ODK C/C++
1985 documentation. Not relevant in the --disable-odk case.])
1987 Usage: --with-doxygen=<absolute path to doxygen executable>
1991 AC_ARG_WITH(visual-studio,
1992 AS_HELP_STRING([--with-visual-studio=<2012/2010/2013>],
1993 [Specify which Visual Studio version to use in case several are
1994 are installed. If not specified, the order of preference is
1995 2012, 2010, 2013 (including Express editions).])
1997 Usage: --with-visual-studio=<2012/2010/2013>
2001 AC_ARG_WITH(windows-sdk,
2002 AS_HELP_STRING([--with-windows-sdk=<6.0(A)/7.0(A)/7.1(A)/8.0(A)>],
2003 [Specify which Windows SDK, or "Windows Kit", version to use
2004 in case the one that came with the selected Visual Studio
2005 is not what you want for some reason. Note that not all compiler/SDK
2006 combinations are supported. The intent is that this option should not
2009 Usage: --with-windows-sdk=6.0(A)/7.0(A)/7.1(A)/8.0(A)>
2014 AS_HELP_STRING([--with-lang],
2015 [Use this option to build LibreOffice with additional UI language support.
2016 English (US) is always included by default.
2017 Separate multiple languages with space.
2018 For all languages, use --with-lang=ALL.])
2020 Usage: --with-lang="es sw tu cs sk"
2024 AC_ARG_WITH(locales,
2025 AS_HELP_STRING([--with-locales],
2026 [Use this option to limit the locale information built in.
2027 Separate multiple locales with space.
2028 Very experimental and might well break stuff.
2029 Just a desperate measure to shrink code and data size.
2030 By default all the locales available is included.
2031 This option is completely unrelated to --with-lang.])
2033 Affects also our character encoding conversion
2034 tables for encodings mainly targeted for a
2035 particular locale, like EUC-CN and EUC-TW for
2036 zh, ISO-2022-JP for ja.
2038 Affects also our add-on break iterator data for
2041 For the default, all locales, don't use this switch at all.
2042 Specifying just the language part of a locale means all matching
2043 locales will be included.
2045 Usage: --with-locales="en es pt fr zh kr ja"
2049 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2051 AS_HELP_STRING([--with-krb5],
2052 [Enable MIT Kerberos 5 support in modules that support it.
2053 By default automatically enabled on platforms
2054 where a good system Kerberos 5 is available.]),
2058 AS_HELP_STRING([--with-gssapi],
2059 [Enable GSSAPI support in modules that support it.
2060 By default automatically enabled on platforms
2061 where a good system GSSAPI is available.]),
2064 dnl ===================================================================
2066 dnl ===================================================================
2068 AC_ARG_WITH(branding,
2069 AS_HELP_STRING([--with-branding],
2070 [Use given path to retrieve branding images set.])
2072 Search for intro.png about.svg and flat_logo.svg.
2073 If any is missing, default ones will be used instead.
2075 Search also progress.conf for progress
2076 settings on intro screen :
2078 PROGRESSBARCOLOR="255,255,255" Set color of
2079 progress bar. Comma separated RGB decimal values.
2080 PROGRESSSIZE="407,6" Set size of progress bar.
2081 Comma separated decimal values (width, height).
2082 PROGRESSPOSITION="61,317" Set position of progress
2083 bar from left,top. Comma separated decimal values.
2084 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2085 bar frame. Comma separated RGB decimal values.
2086 PROGRESSTEXTCOLOR="255,255,255" Set color of progress
2087 bar text. Comma separated RGB decimal values.
2088 PROGRESSTEXTBASELINE="287" Set vertical position of
2089 progress bar text from top. Decimal value.
2091 Default values will be used if not found.
2093 Usage: --with-branding=/path/to/images
2098 AC_ARG_WITH(extra-buildid,
2099 AS_HELP_STRING([--with-extra-buildid],
2100 [Show addition build identification in about dialog.])
2102 Usage: --with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"
2108 AS_HELP_STRING([--with-vendor],
2109 [Set vendor of the build.])
2111 Usage: --with-vendor="John the Builder"
2115 AC_ARG_WITH(compat-oowrappers,
2116 AS_HELP_STRING([--with-compat-oowrappers],
2117 [Install oo* wrappers in parallel with
2118 lo* ones to keep backward compatibility.
2119 Has effect only with make distro-pack-install]),
2122 AC_ARG_WITH(os-version,
2123 AS_HELP_STRING([--with-os-version],
2124 [For FreeBSD users, use this option option to override the detected OSVERSION.])
2126 Usage: --with-os-version=<OSVERSION>
2130 AC_ARG_WITH(mingw-cross-compiler,
2131 AS_HELP_STRING([--with-mingw-cross-compiler],
2132 [Specify the MinGW cross-compiler to use.])
2134 Usage: --with-mingw-cross-compiler=<mingw32-g++ command>
2136 When building on the ODK on Unix and building unowinreg.dll,
2137 specify the MinGW C++ cross-compiler.
2141 AC_ARG_WITH(idlc-cpp,
2142 AS_HELP_STRING([--with-idlc-cpp],
2143 [Specify the C Preprocessor to use for idlc.])
2145 Usage: --with-idlc-cpp=cpp
2151 AC_ARG_WITH(build-version,
2152 AS_HELP_STRING([--with-build-version],
2153 [Allows the builder to add a custom version tag that will appear in the
2154 Help/About box for QA purposes.])
2156 Usage: --with-build-version="Built by Jim"
2158 with_build_version=$withval ,
2162 AS_HELP_STRING([--with-alloc],
2163 [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
2164 Note that on FreeBSD/NetBSD system==jemalloc]),
2167 AC_ARG_WITH(sun-templates,
2168 AS_HELP_STRING([--with-sun-templates],
2169 [Integrate Sun template packages.]),
2172 AC_ARG_WITH(parallelism,
2173 AS_HELP_STRING([--with-parallelism],
2174 [Number of jobs to run simultaneously during build. Parallel builds can
2175 save a lot of time on multi-cpu machines. Defaults to the number of
2176 CPUs on the machine, unless you configure --enable-icecream - then to
2180 AC_ARG_WITH(all-tarballs,
2181 AS_HELP_STRING([--with-all-tarballs],
2182 [Download all external tarballs unconditionally]))
2184 AC_ARG_WITH(gdrive-client-id,
2185 AS_HELP_STRING([--with-gdrive-client-id],
2186 [Provides the client id of the application for OAuth2 authentication
2187 on Google Drive. If either this or --with-gdrive-client-secret is
2188 empty, the feature will be disabled]),
2191 AC_ARG_WITH(gdrive-client-secret,
2192 AS_HELP_STRING([--with-gdrive-client-secret],
2193 [Provides the client secret of the application for OAuth2
2194 authentication on Google Drive. If either this or
2195 --with-gdrive-client-id is empty, the feature will be disabled]),
2198 AC_ARG_WITH(alfresco-cloud-client-id,
2199 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2200 [Provides the client id of the application for OAuth2 authentication
2201 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2202 empty, the feature will be disabled]),
2205 AC_ARG_WITH(alfresco-cloud-client-secret,
2206 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2207 [Provides the client secret of the application for OAuth2
2208 authentication on Alfresco Cloud. If either this or
2209 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2212 dnl ===================================================================
2213 dnl Do we want to use pre-build binary tarball for recompile
2214 dnl ===================================================================
2216 if test "$enable_library_bin_tar" = "yes" ; then
2217 USE_LIBRARY_BIN_TAR=TRUE
2219 USE_LIBRARY_BIN_TAR=
2221 AC_SUBST(USE_LIBRARY_BIN_TAR)
2223 dnl ===================================================================
2224 dnl Test whether build target is Release Build
2225 dnl ===================================================================
2226 AC_MSG_CHECKING([whether build target is Release Build])
2227 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2229 ENABLE_RELEASE_BUILD=
2231 AC_MSG_RESULT([yes])
2232 ENABLE_RELEASE_BUILD=TRUE
2234 AC_SUBST(ENABLE_RELEASE_BUILD)
2236 dnl ===================================================================
2237 dnl Test whether to sign Windows Build
2238 dnl ===================================================================
2239 AC_MSG_CHECKING([whether to sign windows build])
2240 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
2241 AC_MSG_RESULT([yes])
2242 WINDOWS_BUILD_SIGNING="TRUE"
2245 WINDOWS_BUILD_SIGNING="FALSE"
2247 AC_SUBST(WINDOWS_BUILD_SIGNING)
2249 dnl ===================================================================
2250 dnl MacOSX build and runtime environment options
2251 dnl ===================================================================
2253 AC_ARG_WITH(macosx-sdk,
2254 AS_HELP_STRING([--with-macosx-sdk],
2255 [Use a specific SDK for building.])
2257 Usage: --with-macosx-sdk=<version>
2259 e. g.: --with-macosx-sdk=10.6
2261 there are 3 options to control the MacOSX build:
2262 --with-macosx-sdk (refered as 'sdk' below)
2263 --with-macosx-version-min-required (refered as 'min' below)
2264 --with-macosx-version-max-allowed (refered as 'max' below)
2266 the connection between these value and the default they take is as follow:
2267 ( ? means not specified on the command line, s means the SDK version found,
2268 constraint: x <= y <= z)
2270 ==========================================
2271 command line || config result
2272 ==========================================
2273 min | max | sdk || min | max | sdk |
2274 ? | ? | ? || 10.6 | 10.s | 10.s |
2275 ? | ? | 10.x || 10.6 | 10.x | 10.x |
2276 ? | 10.x | ? || 10.6 | 10.s | 10.s |
2277 ? | 10.x | 10.y || 10.6 | 10.x | 10.y |
2278 10.x | ? | ? || 10.x | 10.s | 10.s |
2279 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2280 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2281 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2284 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2285 for a detailled technical explanation of these variables
2287 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2289 Note that even if in theory using a --with-macosx-version-max-allowed
2290 (i.e. the MAC_OS_X_VERSION_MAX_ALLOWED macro) less than the SDK version
2291 should work, in practice Apple doesn't seem to test that, and at least
2292 compiling with -DMAC_OS_X_VERSION_MAX_ALLOWED=1060 against the 10.7 SDK
2293 fails in a couple of places. Just because of oversights in ifdefs in the SDK
2298 AC_ARG_WITH(macosx-version-min-required,
2299 AS_HELP_STRING([--with-macosx-version-min-required],
2300 [set the minimum OS version needed to run the built LibreOffice])
2302 Usage: --with-macosx-version-min-required=<version>
2304 e. g.: --with-macos-version-min-required=10.6
2305 see --with-macosx-sdk for more info
2309 AC_ARG_WITH(macosx-version-max-allowed,
2310 AS_HELP_STRING([--with-macosx-version-max-allowed],
2311 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2313 Usage: --with-macosx-version-max-allowed=<version>
2315 e. g.: --with-macos-version-max-allowed=10.6
2316 see --with-macosx-sdk for more info
2321 dnl ===================================================================
2322 dnl options for stuff used during cross-compilation build
2323 dnl These are superseded by --with-build-platform-configure-options.
2324 dnl Or are they? Look for the complicated tests for "$cross_compiling" = "yes" -a \(
2325 dnl "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \)
2326 dnl far below. Could whoever understands MinGW cross-compilation clean up this please.
2327 dnl ===================================================================
2329 AC_ARG_WITH(system-boost-for-build,
2330 AS_HELP_STRING([--with-system-boost-for-build],
2331 [Use boost already on system for build tools (cross-compilation only).]))
2333 AC_ARG_WITH(system-cppunit-for-build,
2334 AS_HELP_STRING([--with-system-cppunit-for-build],
2335 [Use cppunit already on system for build tools (cross-compilation only).]))
2337 AC_ARG_WITH(system-expat-for-build,
2338 AS_HELP_STRING([--with-system-expat-for-build],
2339 [Use expat already on system for build tools (cross-compilation only).]))
2341 AC_ARG_WITH(system-icu-for-build,
2342 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2343 [Use icu already on system for build tools (cross-compilation only).]))
2345 AC_ARG_WITH(system-libxml-for-build,
2346 AS_HELP_STRING([--with-system-libxml-for-build],
2347 [Use libxml/libxslt already on system for build tools (cross-compilation only).]))
2350 dnl ===================================================================
2351 dnl check for required programs (grep, awk, sed, bash)
2352 dnl ===================================================================
2356 if test -n "$1"; then
2357 if test "$build_os" = "cygwin"; then
2358 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2360 new_path=`cygpath -sm "$formatted_path"`
2363 new_path=`cygpath -u "$formatted_path"`
2368 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2369 if test "$2" = "after"; then
2370 LO_PATH="$LO_PATH${P_SEP}$new_path"
2372 LO_PATH="$new_path${P_SEP}$LO_PATH"
2380 AC_PATH_PROG( AWK, $AWK)
2381 if test -z "$AWK"; then
2382 AC_MSG_ERROR([install awk to run this script])
2385 AC_PATH_PROG(BASH, bash)
2386 if test -z "$BASH"; then
2387 AC_MSG_ERROR([bash not found in \$PATH])
2391 AC_MSG_CHECKING([for GNU or BSD tar])
2392 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
2393 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2394 if test $? -eq 0; then
2399 AC_MSG_RESULT($GNUTAR)
2400 if test -z "$GNUTAR"; then
2401 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2405 AC_MSG_CHECKING([for tar's option to strip components])
2406 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2407 if test $? -eq 0; then
2408 STRIP_COMPONENTS="--strip-components"
2410 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2411 if test $? -eq 0; then
2412 STRIP_COMPONENTS="--strip-path"
2414 STRIP_COMPONENTS="unsupported"
2417 AC_MSG_RESULT($STRIP_COMPONENTS)
2418 if test x$STRIP_COMPONENTS = xunsupported; then
2419 AC_MSG_ERROR([you need a tar that is able to strip components.])
2421 AC_SUBST(STRIP_COMPONENTS)
2423 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2424 dnl desktop OSes from "mobile" ones.
2426 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2427 dnl In other words, that when building for an OS that is not a
2428 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2430 dnl Note the direction of the implication; there is no assumption that
2431 dnl cross-compiling would imply a non-desktop OS.
2433 if test $_os != iOS -a $_os != Android; then
2434 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2435 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2436 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2440 if test "$enable_export" != no; then
2441 BUILD_TYPE="$BUILD_TYPE EXPORT"
2443 DISABLE_EXPORT='TRUE'
2444 SCPDEFS="$SCPDES -DDISABLE_EXPORT"
2446 AC_SUBST(DISABLE_EXPORT)
2448 # Whether to build "avmedia" functionality or not.
2449 # We probably don't want it for non-desktop.
2451 if test -z "$enable_avmedia"; then
2452 if test $_os != iOS -a $_os != Android; then
2457 if test "$enable_avmedia" = yes; then
2458 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2459 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2461 SCPDEFS="$SCPDEFS -DDISABLE_AVMEDIA"
2464 # Decide whether to build database connectivity stuff (including
2465 # Base) or not. We probably don't want to on non-desktop OSes.
2467 if test -z "$enable_database_connectivity"; then
2468 # --disable-database-connectivity is unfinished work in progress
2469 # and the iOS test app doesn't link if we actually try to use it.
2470 # if test $_os != iOS -a $_os != Android; then
2471 enable_database_connectivity=yes
2475 if test "$enable_database_connectivity" = yes; then
2476 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2477 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2480 if test -z "$enable_extensions"; then
2481 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2482 if test $_os != iOS -a $_os != Android; then
2483 enable_extensions=yes
2487 if test "$enable_extensions" = yes; then
2488 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2489 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2492 if test -z "$enable_scripting"; then
2493 # Disable scripting for iOS unless specifically overridden
2494 # with --enable-scripting.
2495 if test $_os != iOS; then
2496 enable_scripting=yes
2500 DISABLE_SCRIPTING=''
2501 if test "$enable_scripting" = yes; then
2502 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2504 DISABLE_SCRIPTING='TRUE'
2505 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2507 AC_SUBST(DISABLE_SCRIPTING)
2509 if test $_os = iOS -o $_os = Android; then
2510 # Disable dynamic_loading always for iOS and Android
2511 enable_dynamic_loading=no
2512 elif test -z "$enable_dynamic_loading"; then
2513 # Otherwise enable it unless speficically disabled
2514 enable_dynamic_loading=yes
2517 DISABLE_DYNLOADING=''
2518 if test "$enable_dynamic_loading" = yes; then
2519 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2521 DISABLE_DYNLOADING='TRUE'
2522 SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
2524 AC_SUBST(DISABLE_DYNLOADING)
2526 # remenber SYSBASE value
2529 dnl ===================================================================
2530 dnl Sort out various gallery compilation options
2531 dnl ===================================================================
2532 AC_MSG_CHECKING([how to build and package galleries])
2533 if test -n "${with_galleries}"; then
2534 if test "$with_galleries" = "build"; then
2535 WITH_GALLERY_BUILD=TRUE
2536 AC_MSG_RESULT([build from source images internally])
2537 elif test "$with_galleries" = "no"; then
2539 AC_MSG_RESULT([disable non-internal gallery build])
2541 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2544 if test $_os != iOS -a $_os != Android; then
2545 WITH_GALLERY_BUILD=TRUE
2546 AC_MSG_RESULT([internal src images for desktop])
2549 AC_MSG_RESULT([disable src imgage build])
2552 AC_SUBST(WITH_GALLERY_BUILD)
2554 dnl ===================================================================
2555 dnl Checks if ccache is available
2556 dnl ===================================================================
2557 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2558 case "%$CC%$CXX%" in
2559 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some verison number etc),
2560 # assume that's good then
2561 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2562 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2565 AC_PATH_PROG([CCACHE],[ccache],[not found])
2566 if test "$CCACHE" = "not found"; then
2569 # Need to check for ccache version: otherwise prevents
2570 # caching of the results (like "-x objective-c++" for Mac)
2571 if test $_os = Darwin -o $_os = iOS; then
2572 # Check ccache version
2573 AC_MSG_CHECKING([whether version of ccache is suitable])
2574 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2575 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2576 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2577 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2579 AC_MSG_RESULT([no, $CCACHE_VERSION])
2590 if test "$CCACHE" != ""; then
2591 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2592 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2593 if test "$ccache_size" = ""; then
2594 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2595 if test "$ccache_size" = ""; then
2598 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2599 if test $ccache_size -lt 1024; then
2601 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2602 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2604 # warn that ccache may be too small for debug build
2605 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2606 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2609 if test $ccache_size -lt 5; then
2610 #warn that ccache may be too small for debug build
2611 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2612 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2617 dnl ===================================================================
2618 dnl Checks for C compiler,
2619 dnl The check for the C++ compiler is later on.
2620 dnl ===================================================================
2621 if test "$_os" != "WINNT" -a "$WITH_MINGW" != "yes"; then
2623 AC_MSG_CHECKING([gcc home])
2624 if test -z "$with_gcc_home"; then
2625 if test "$enable_icecream" = "yes"; then
2626 if test -d "/usr/lib/icecc/bin"; then
2627 GCC_HOME="/usr/lib/icecc/"
2629 GCC_HOME="/opt/icecream/"
2632 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2633 GCC_HOME_SET="false"
2636 GCC_HOME="$with_gcc_home"
2638 AC_MSG_RESULT($GCC_HOME)
2641 if test "$GCC_HOME_SET" = "true"; then
2642 if test -z "$CC"; then
2643 CC="$GCC_HOME/bin/gcc"
2645 if test -z "$CXX"; then
2646 CXX="$GCC_HOME/bin/g++"
2651 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
2652 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2653 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
2659 COMPATH=`dirname "$CC"`
2660 if test "$COMPATH" = "."; then
2661 AC_PATH_PROGS(COMPATH, $CC)
2662 dnl double square bracket to get single because of M4 quote...
2663 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2665 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2667 dnl ===================================================================
2669 dnl ===================================================================
2670 AC_MSG_CHECKING([whether to build with Java support])
2671 if test "$with_java" != "no"; then
2672 if test "$DISABLE_SCRIPTING" = TRUE; then
2673 AC_MSG_RESULT([no, overridden by --disable-scripting])
2677 AC_MSG_RESULT([yes])
2679 AC_DEFINE(HAVE_FEATURE_JAVA)
2686 AC_SUBST(ENABLE_JAVA)
2688 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2690 dnl ENABLE_JAVA="" indicate no Java support at all
2692 dnl ===================================================================
2693 dnl Export file validation
2694 dnl ===================================================================
2695 AC_MSG_CHECKING([whether to enable export file validation])
2696 if test "$with_export_validation" = yes; then
2697 AC_MSG_RESULT([yes])
2698 AC_DEFINE(HAVE_EXPORT_VALIDATION)
2703 dnl ===================================================================
2704 dnl Test the Solaris compiler version
2705 dnl ===================================================================
2706 if test "$_os" = "SunOS"; then
2707 if test "$CC" = "cc"; then
2708 AC_PATH_PROGS(_cc, cc)
2709 COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2710 AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2711 dnl cc -V outputs to standard error!!!!
2712 _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2713 _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2714 _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2715 if test "$_sunstudio_major" != "5"; then
2716 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2718 _sunstudio_minor=`echo $_sunstudio_version | $AWK -F. '{ if ($2 == 5) print "true"; else if ($2 == 7) print "true"; else if ($2 == 8) print "true"; else if ($2 == 9) print "true"; else print "false" }'`
2719 if test "$_sunstudio_minor" = "false"; then
2720 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2722 dnl compiler will do
2723 AC_MSG_RESULT([checked])
2730 dnl ===================================================================
2731 dnl Check OS X SDK and compiler
2732 dnl ===================================================================
2734 if test $_os = Darwin; then
2736 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2743 # If no --with-macosx-sdk option is given, look for 10.6,
2744 # 10.7, 10.8 and 10.9 SDKs, in that order. If not found
2745 # in some default locations, try the xcode-select tool.
2746 # 10.5 must be specified explicitely to be considered
2748 # The intent is that for "most" Mac-based developers, a suitable
2749 # SDK will be found automatically without any configure options.
2751 # For developers still using old Xcode in /Developer, either
2752 # because it is the only Xcode they have, or they have that in
2753 # addition to Xcode 4 in /Applications/Xcode.app, the 10.5 SDK
2754 # or 10.6 SDK should be found.
2756 # For developers with a current Xcode, the lowest-numbered SDK
2759 AC_MSG_CHECKING([what Mac OS X SDK to use])
2761 if test -z "$with_macosx_sdk"; then
2762 for MACOSX_SDK_PATH in /Developer/SDKs/MacOSX10.6.sdk /Developer-old/SDKs/MacOSX10.6.sdk /Xcode3/SDKs/MacOSX10.6.sdk; do
2763 if test -d "$MACOSX_SDK_PATH"; then
2764 with_macosx_sdk=10.6
2768 if test -z "$with_macosx_sdk"; then
2769 MACOSX_SDK_PATH="/Developer/SDKs/MacOSX10.7.sdk"
2770 if test -d "$MACOSX_SDK_PATH"; then
2771 with_macosx_sdk=10.7
2773 for with_macosx_sdk in 10.6 10.7 10.8 10.9 10.10; do
2774 MACOSX_SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk"
2775 if test -d "$MACOSX_SDK_PATH"; then
2779 if test ! -d "$MACOSX_SDK_PATH"; then
2780 for with_macosx_sdk in 10.6 10.7 10.8 10.9 10.10; do
2781 MACOSX_SDK_PATH=`xcrun --sdk macosx${with_macosx_sdk} --show-sdk-path 2> /dev/null`
2782 if test -d "$MACOSX_SDK_PATH"; then
2785 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk"
2786 if test -d "$MACOSX_SDK_PATH"; then
2791 if test ! -d "$MACOSX_SDK_PATH"; then
2792 AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2798 # with --with-macosx-sdk=something
2799 case $with_macosx_sdk in
2801 if test -d /Developer-old/SDKs/MacOSX${with_macosx_sdk}.sdk; then
2802 MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX${with_macosx_sdk}.sdk
2803 elif test -d /Xcode3/SDKs/MacOSX${with_macosx_sdk}.sdk; then
2804 MACOSX_SDK_PATH=/Xcode3/SDKs/MacOSX${with_macosx_sdk}.sdk
2808 if test -z "$MACOSX_SDK_PATH"; then
2809 case $with_macosx_sdk in
2811 if test -d /Developer/SDKs/MacOSX${with_macosx_sdk}.sdk; then
2812 MACOSX_SDK_PATH=/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk
2816 if test -z "$MACOSX_SDK_PATH"; then
2817 case $with_macosx_sdk in
2818 10.6|10.7|10.8|10.9|10.10)
2819 MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk
2820 if test ! -d "$MACOSX_SDK_PATH"; then
2821 MACOSX_SDK_PATH=`xcrun --sdk macosx${with_macosx_sdk} --show-sdk-path 2> /dev/null`
2822 if test ! -d "$MACOSX_SDK_PATH"; then
2823 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk"
2824 if test ! -d "$MACOSX_SDK_PATH"; then
2825 AC_MSG_ERROR([Could not figure out the location of Mac OS X $with_macosx_sdk SDK])
2831 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.5--10])
2838 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2840 case $with_macosx_sdk in
2842 MACOSX_SDK_VERSION=1050
2845 MACOSX_SDK_VERSION=1060
2848 MACOSX_SDK_VERSION=1070
2851 MACOSX_SDK_VERSION=1080
2854 MACOSX_SDK_VERSION=1090
2857 MACOSX_SDK_VERSION=101000
2860 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.5--10])
2864 if test "$with_macosx_version_min_required" = ""; then
2865 case $with_macosx_sdk in
2867 with_macosx_version_min_required="10.5";;
2869 with_macosx_version_min_required="10.6";;
2873 if test "$with_macosx_version_max_allowed" = ""; then
2874 with_macosx_version_max_allowed="$with_macosx_sdk"
2877 # export this so that "xcrun" invocations later return matching values
2878 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2879 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2880 export DEVELOPER_DIR
2881 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2882 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2884 case "$with_macosx_version_min_required" in
2886 MAC_OS_X_VERSION_MIN_REQUIRED="1050"
2889 MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2892 MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2895 MAC_OS_X_VERSION_MIN_REQUIRED="1080"
2898 MAC_OS_X_VERSION_MIN_REQUIRED="1090"
2901 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2904 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.5--10])
2908 if test "$BITNESS_OVERRIDE" = ""; then
2909 case "$with_macosx_version_min_required" in
2911 case "$with_macosx_sdk" in
2915 AC_MSG_WARN([Building with a SDK > 10.5 possibly breaks 10.5 compatibility.])
2916 add_warning "Building with a SDK > 10.5 possibly breaks 10.5 compatibility."
2923 # If no CC and CXX environment vars, try to guess where the compiler is
2925 INSTALL_NAME_TOOL=install_name_tool
2926 if test -z "$save_CC"; then
2927 AC_MSG_CHECKING([what compiler to use])
2928 case $with_macosx_sdk in
2930 _gcc_version=`gcc -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
2931 _gcc42_version=`gcc-4.2 -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
2932 if test "$_gcc_version" -gt "$_gcc42_version"; then
2933 CC="gcc -mmacosx-version-min=$with_macosx_version_min_required"
2934 CXX="g++ -mmacosx-version-min=$with_macosx_version_min_required"
2936 CC="gcc-4.2 -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2937 CXX="g++-4.2 -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2939 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2942 # did someone copy her 10.6 sdk into xcode 4 (needed on Mountain Lion)?
2943 if test "$(echo $MACOSX_SDK_PATH | cut -c1-23)" = "/Applications/Xcode.app"; then
2944 CC="`xcrun -find gcc` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2945 CXX="`xcrun -find g++` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2947 CC="gcc-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2948 CXX="g++-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2950 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2953 10.7|10.8|10.9|10.10)
2954 if test "$with_macosx_version_min_required" != 10.6; then
2955 # Use libc++ instead of libstdc++ when possible
2956 stdlib=-stdlib=libc++
2958 if test "$ENABLE_LTO" = TRUE; then
2961 CC="`xcrun -find clang` $bitness $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2962 CXX="`xcrun -find clang++` $bitness $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2963 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2966 STRIP=`xcrun -find strip`
2967 LIBTOOL=`xcrun -find libtool`
2968 RANLIB=`xcrun -find ranlib`
2971 AC_MSG_RESULT([$CC and $CXX])
2974 case "$with_macosx_version_max_allowed" in
2976 MAC_OS_X_VERSION_MAX_ALLOWED="1050"
2979 MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2982 MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2985 MAC_OS_X_VERSION_MAX_ALLOWED="1080"
2988 MAC_OS_X_VERSION_MAX_ALLOWED="1090"
2991 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2994 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.5--10])
2998 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2999 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
3000 AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
3005 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
3006 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
3007 AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
3011 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
3012 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
3014 AC_MSG_CHECKING([whether to do code signing])
3016 if test "$enable_macosx_code_signing" = yes; then
3017 # By default use the first suitable certificate (?).
3019 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
3020 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
3021 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
3022 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the the
3023 # "Developer ID Application" one.
3025 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
3026 if test -n "$identity"; then
3027 MACOSX_CODESIGNING_IDENTITY=$identity
3028 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3029 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
3031 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
3032 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
3033 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3034 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
3039 AC_MSG_CHECKING([whether to create a Mac App Store package])
3041 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
3042 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
3043 elif test "$enable_macosx_package_signing" = yes; then
3044 # By default use the first suitable certificate.
3045 # It should be a "3rd Party Mac Developer Installer" one
3047 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
3048 if test -n "$identity"; then
3049 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
3050 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3051 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3053 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
3055 elif test -n "$enable_macosx_package_signing"; then
3056 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
3057 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
3058 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
3063 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
3064 AC_MSG_ERROR([You should not use the same identity for code and package signing])
3067 AC_MSG_CHECKING([whether to sandbox the application])
3069 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3070 AC_MSG_ERROR([OS X sandboxing requires code signing])
3071 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3072 AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
3073 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3074 ENABLE_MACOSX_SANDBOX=TRUE
3075 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3076 AC_MSG_RESULT([yes])
3081 AC_MSG_CHECKING([what OS X app bundle identifier to use])
3082 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3083 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3085 AC_MSG_CHECKING([what OS X app name to use])
3086 MACOSX_APP_NAME="$with_macosx_app_name"
3087 AC_MSG_RESULT([$MACOSX_APP_NAME])
3089 AC_MSG_CHECKING([build with mac retina support])
3090 if test "$enable_macosx_retina" = yes ; then
3091 MACOSX_HIGH_RESOLUTION_VALUE=true
3093 MACOSX_HIGH_RESOLUTION_VALUE=false
3095 AC_MSG_RESULT([$MACOSX_HIGH_RESOLUTION_VALUE])
3097 AC_SUBST(MACOSX_SDK_PATH)
3098 AC_SUBST(MACOSX_SDK_VERSION)
3099 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3100 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3101 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
3102 AC_SUBST(INSTALL_NAME_TOOL)
3103 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
3104 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3105 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3106 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3107 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3108 AC_SUBST(MACOSX_APP_NAME)
3109 AC_SUBST(MACOSX_HIGH_RESOLUTION_VALUE)
3111 dnl ===================================================================
3112 dnl Check iOS SDK and compiler
3113 dnl ===================================================================
3115 if test $_os = iOS; then
3117 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3123 AC_MSG_CHECKING([what iOS SDK to use])
3125 if test "$enable_ios_simulator" = yes; then
3126 platform=iPhoneSimulator
3131 xcode_developer=`xcode-select -print-path`
3134 for sdkver in 7.1 7.0 6.1 6.0; do
3135 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3143 if test -z "$sysroot"; then
3144 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${pref_sdk_ver}])
3147 AC_MSG_RESULT($sysroot)
3149 XCODEBUILD_SDK=`echo $platform | tr A-Z a-z`$ios_sdk
3151 if test "$enable_ios_simulator" = yes; then
3152 if test "$BITNESS_OVERRIDE" = 64; then
3154 versionmin=-mios-simulator-version-min=7.0
3159 versionmin=-mios-simulator-version-min=6.1
3162 versionmin=-mmacosx-version-min=10.7
3168 if test "$BITNESS_OVERRIDE" = 64; then
3170 versionmin=-miphoneos-version-min=7.0
3173 versionmin=-miphoneos-version-min=6.1
3177 # LTO is not really recommended for iOS builds,
3178 # the link time will be astronomical
3179 if test "$ENABLE_LTO" = TRUE; then
3182 # Just add -fvisibility=hidden to CC and CXX directly so that the 3rd-party libs also
3183 # get compiled with it, to avoid ld warnings when linking all that together into one
3186 # Use libc++ for iOS 7 SDK and libstdc++ for earlier (but we don't really expect anybody to
3187 # be be using an earlier SDK)
3189 XCODE_CLANG_CXX_LIBRARY=libstdc++
3194 XCODE_CLANG_CXX_LIBRARY=libc++
3198 stdlib="-stdlib=$XCODE_CLANG_CXX_LIBRARY"
3200 CC="`xcrun -find clang` -arch $XCODE_ARCHS -fvisibility=hidden -isysroot $sysroot $lto $versionmin"
3201 CXX="`xcrun -find clang++` -arch $XCODE_ARCHS -fvisibility=hidden $stdlib -isysroot $sysroot $lto $versionmin"
3203 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3206 STRIP=`xcrun -find strip`
3207 LIBTOOL=`xcrun -find libtool`
3208 RANLIB=`xcrun -find ranlib`
3211 AC_SUBST(XCODE_CLANG_CXX_LIBRARY)
3212 AC_SUBST(XCODE_ARCHS)
3213 AC_SUBST(XCODEBUILD_SDK)
3215 AC_MSG_CHECKING([whether to treat the installation as read-only])
3217 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3218 "$enable_extensions" != yes; then
3219 enable_readonly_installset=yes
3221 if test "$enable_readonly_installset" = yes; then
3222 AC_MSG_RESULT([yes])
3223 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3228 dnl ===================================================================
3229 dnl Structure of install set
3230 dnl ===================================================================
3232 if test $_os = Darwin -a "$enable_canonical_installation_tree_structure" = yes; then
3233 LIBO_BIN_FOLDER=MacOS
3234 LIBO_ETC_FOLDER=Resources
3235 LIBO_LIBEXEC_FOLDER=MacOS
3236 LIBO_LIB_FOLDER=Frameworks
3237 LIBO_SHARE_FOLDER=Resources
3238 LIBO_SHARE_HELP_FOLDER=Resources/help
3239 LIBO_SHARE_JAVA_FOLDER=Resources/java
3240 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3241 LIBO_LIB_PYUNO_FOLDER=Resources
3242 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3243 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3244 LIBO_URE_BIN_FOLDER=MacOS
3245 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3246 LIBO_URE_LIB_FOLDER=Frameworks
3247 LIBO_URE_SHARE_FOLDER=Resources/ure/share
3248 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3249 ENABLE_MACOSX_MACLIKE_APP_STRUCTURE=TRUE
3250 AC_DEFINE(HAVE_FEATURE_MACOSX_MACLIKE_APP_STRUCTURE)
3251 elif test $_os = Darwin; then
3252 LIBO_BIN_FOLDER=MacOS
3253 LIBO_ETC_FOLDER=MacOS
3254 LIBO_LIBEXEC_FOLDER=MacOS
3255 LIBO_LIB_FOLDER=MacOS
3256 LIBO_LIB_PYUNO_FOLDER=MacOS
3257 LIBO_SHARE_FOLDER=share
3258 LIBO_SHARE_HELP_FOLDER=help
3259 LIBO_SHARE_JAVA_FOLDER=MacOS/classes
3260 LIBO_SHARE_PRESETS_FOLDER=presets
3261 LIBO_SHARE_RESOURCE_FOLDER=MacOS/resource
3262 LIBO_SHARE_SHELL_FOLDER=MacOS/shell
3263 LIBO_URE_BIN_FOLDER=ure-link/bin
3264 LIBO_URE_ETC_FOLDER=ure-link/lib
3265 LIBO_URE_LIB_FOLDER=ure-link/lib
3266 LIBO_URE_SHARE_FOLDER=ure-link/share
3267 LIBO_URE_SHARE_JAVA_FOLDER=ure-link/share/java
3268 elif test $_os = WINNT; then
3269 LIBO_BIN_FOLDER=program
3270 LIBO_ETC_FOLDER=program
3271 LIBO_LIBEXEC_FOLDER=program
3272 LIBO_LIB_FOLDER=program
3273 LIBO_LIB_PYUNO_FOLDER=program
3274 LIBO_SHARE_FOLDER=share
3275 LIBO_SHARE_HELP_FOLDER=help
3276 LIBO_SHARE_JAVA_FOLDER=program/classes
3277 LIBO_SHARE_PRESETS_FOLDER=presets
3278 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3279 LIBO_SHARE_SHELL_FOLDER=program/shell
3280 LIBO_URE_BIN_FOLDER=URE/bin
3281 LIBO_URE_ETC_FOLDER=URE/bin
3282 LIBO_URE_LIB_FOLDER=URE/bin
3283 LIBO_URE_SHARE_FOLDER=URE
3284 LIBO_URE_SHARE_JAVA_FOLDER=URE/java
3286 LIBO_BIN_FOLDER=program
3287 LIBO_ETC_FOLDER=program
3288 LIBO_LIBEXEC_FOLDER=program
3289 LIBO_LIB_FOLDER=program
3290 LIBO_LIB_PYUNO_FOLDER=program
3291 LIBO_SHARE_FOLDER=share
3292 LIBO_SHARE_HELP_FOLDER=help
3293 LIBO_SHARE_JAVA_FOLDER=program/classes
3294 LIBO_SHARE_PRESETS_FOLDER=presets
3295 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3296 LIBO_SHARE_SHELL_FOLDER=program/shell
3297 LIBO_URE_BIN_FOLDER=ure/bin
3298 LIBO_URE_ETC_FOLDER=ure/lib
3299 LIBO_URE_LIB_FOLDER=ure/lib
3300 LIBO_URE_SHARE_FOLDER=ure/share
3301 LIBO_URE_SHARE_JAVA_FOLDER=ure/share/java
3303 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3304 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3305 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3306 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3307 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3308 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3309 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3310 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3311 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3312 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3313 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3314 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3315 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3316 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3317 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_FOLDER,"$LIBO_URE_SHARE_FOLDER")
3318 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3320 # Not all of them needed in config_host.mk, add more if need arises
3321 AC_SUBST(LIBO_BIN_FOLDER)
3322 AC_SUBST(LIBO_ETC_FOLDER)
3323 AC_SUBST(LIBO_LIB_FOLDER)
3324 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3325 AC_SUBST(LIBO_SHARE_FOLDER)
3326 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3327 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3328 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3329 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3330 AC_SUBST(LIBO_URE_BIN_FOLDER)
3331 AC_SUBST(LIBO_URE_ETC_FOLDER)
3332 AC_SUBST(LIBO_URE_LIB_FOLDER)
3333 AC_SUBST(LIBO_URE_SHARE_FOLDER)
3334 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3335 AC_SUBST(ENABLE_MACOSX_MACLIKE_APP_STRUCTURE)
3337 dnl ===================================================================
3338 dnl Windows specific tests and stuff
3339 dnl ===================================================================
3341 # Get a value from the 32-bit side of the Registry
3344 # Return value: $regvalue
3346 _regvalue=`cat "/proc/registry32/$1" 2> /dev/null`
3348 if test $? -eq 0; then
3353 # Get a value from the 64-bit side of the Registry
3356 # Return value: $regvalue
3358 _regvalue=`cat "/proc/registry64/$1" 2> /dev/null`
3360 if test $? -eq 0; then
3365 if test "$_os" = "WINNT"; then
3366 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3367 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3369 WINDOWS_SDK_ARCH="x86"
3371 AC_MSG_RESULT([yes])
3372 WINDOWS_SDK_ARCH="x64"
3377 if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
3378 AC_MSG_CHECKING([whether to use DirectX])
3379 if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
3380 ENABLE_DIRECTX="TRUE"
3381 AC_MSG_RESULT([yes])
3387 AC_MSG_CHECKING([whether to use ActiveX])
3388 if test "$enable_activex" = "yes" -o "$enable_activex" = ""; then
3390 AC_MSG_RESULT([yes])
3392 DISABLE_ACTIVEX="TRUE"
3396 AC_MSG_CHECKING([whether to use ATL])
3397 if test "$enable_atl" = "yes" -o "$enable_atl" = ""; then
3399 AC_MSG_RESULT([yes])
3406 DISABLE_ACTIVEX="TRUE"
3410 AC_SUBST(ENABLE_DIRECTX)
3411 AC_SUBST(DISABLE_ACTIVEX)
3412 AC_SUBST(DISABLE_ATL)
3414 if test "$cross_compiling" = "yes"; then
3415 export CROSS_COMPILING=TRUE
3416 SCPDEFS="$SCPDEFS -DCROSS_COMPILING"
3419 BUILD_TYPE="$BUILD_TYPE NATIVE"
3421 AC_SUBST(CROSS_COMPILING)
3423 dnl ===================================================================
3424 dnl Is GCC actually Clang?
3425 dnl ===================================================================
3428 if test "$GCC" = "yes"; then
3429 AC_MSG_CHECKING([whether GCC is actually Clang])
3430 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3436 [AC_MSG_RESULT([yes])
3437 COM_GCC_IS_CLANG=TRUE],
3438 [AC_MSG_RESULT([no])])
3440 if test "$COM_GCC_IS_CLANG" = TRUE; then
3441 AC_MSG_CHECKING([the Clang version])
3442 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
3443 CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
3444 CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3445 AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3446 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3449 AC_SUBST(COM_GCC_IS_CLANG)
3451 if test "$CCACHE" != "" -a "$COM_GCC_IS_CLANG" = TRUE; then
3452 if test -z "$CCACHE_CPP2"; then
3453 AC_MSG_WARN([Using ccache with Clang without CCACHE_CPP2 set causes spurious warnings.])
3454 add_warning "Using ccache with Clang without CCACHE_CPP2 set causes spurious warnings."
3458 dnl ===================================================================
3459 dnl Test the gcc version
3460 dnl ===================================================================
3461 if test "$GCC" = "yes" -a -z "$COM_GCC_IS_CLANG"; then
3462 AC_MSG_CHECKING([the GCC version])
3463 _gcc_version=`$CC -dumpversion`
3464 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3466 if test "$_os" = "Darwin"; then
3467 if test "$with_macosx_sdk" = "10.5"; then
3468 # use gcc-4.2 for OS X SDK 10.5 when "plain" gcc is not more recent
3469 if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.2"; then
3470 _gcc42_version=`$GCC_HOME/bin/gcc-4.2 -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
3471 if test "$GCC_VERSION" -le "$_gcc42_version"; then
3472 export CC=$GCC_HOME/bin/gcc-4.2
3475 AC_MSG_RESULT([using CC=$CC])
3478 AC_MSG_RESULT([gcc $_gcc_version])
3481 if test "$GCC_VERSION" -lt 0401; then
3482 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.1.0])
3485 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3486 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3487 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3488 # (which reports itself as GCC 4.2.1).
3491 AC_SUBST(GCC_VERSION)
3493 # ===================================================================
3494 # check various GCC options that Clang does not support now but maybe
3495 # will somewhen in the future, check them even for GCC, so that the
3497 # ===================================================================
3500 HAVE_GCC_FINLINE_LIMIT=
3501 HAVE_GCC_FNO_INLINE=
3502 if test "$GCC" = "yes"; then
3503 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3504 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3505 # Option just ignored and silly warning that isn't a real
3510 CFLAGS="$CFLAGS -Werror -ggdb2"
3511 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3514 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3515 AC_MSG_RESULT([yes])
3520 AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3521 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3526 CFLAGS="$CFLAGS -Werror -finline-limit=0"
3527 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3530 if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3531 AC_MSG_RESULT([yes])
3536 AC_MSG_CHECKING([whether $CC supports -fno-inline])
3537 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3542 CFLAGS="$CFLAGS -Werror -fno-inline"
3543 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3546 if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3547 AC_MSG_RESULT([yes])
3552 AC_SUBST(HAVE_GCC_GGDB2)
3553 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3554 AC_SUBST(HAVE_GCC_FNO_INLINE)
3556 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3557 if test "$GCC" = "yes"; then
3558 AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
3559 bsymbolic_functions_ldflags_save=$LDFLAGS
3560 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
3561 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3564 printf ("hello world\n");
3565 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3566 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3567 AC_MSG_RESULT( found )
3569 AC_MSG_RESULT( not found )
3571 LDFLAGS=$bsymbolic_functions_ldflags_save
3573 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3575 # Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers.
3576 # NOTE: must _not_ be used for bundled external libraries!
3578 if test "$GCC" = "yes"; then
3579 AC_MSG_CHECKING( for -isystem )
3581 CFLAGS="$CFLAGS -Werror"
3582 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3584 if test -n "$ISYSTEM"; then
3590 if test -z "$ISYSTEM"; then
3591 # fall back to using -I
3596 dnl ===================================================================
3597 dnl Check which Visual Studio or MinGW compiler is used
3598 dnl ===================================================================
3600 map_vs_year_to_version()
3602 # Return value: $vsversion
3614 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3618 vs_versions_to_check()
3620 # Args: $1 (optional) : versions to check, in the order of preference
3621 # Return value: $vsversions
3625 if test -n "$1"; then
3626 map_vs_year_to_version "$1"
3627 vsversions=$vsversion
3629 # By default we prefer 2012, then 2010, then 2013
3630 vsversions="11.0 10.0 12.0"
3636 # Find Visual Studio 2012/2010/2013
3637 # Args: $1 (optional) : versions to check, in the order of preference
3638 # Return value: $vstest
3642 vs_versions_to_check "$1"
3644 for ver in $vsversions; do
3645 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/ProductDir
3646 if test -n "$regvalue"; then
3650 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VS/ProductDir
3651 if test -n "$regvalue"; then
3660 # Find Visual C++ 2012/2010/2013
3661 # Args: $1 (optional) : The VS version year
3662 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot
3664 unset vctest vcnum vcnumwithdot
3666 vs_versions_to_check "$1"
3668 for ver in $vsversions; do
3669 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3670 if test -n "$regvalue"; then
3674 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VC/ProductDir
3675 if test -n "$regvalue"; then
3680 if test -n "$vctest"; then
3682 case "$vcnumwithdot" in
3699 SHOWINCLUDES_PREFIX=
3700 if test "$_os" = "WINNT"; then
3701 if test "$WITH_MINGW" != "yes"; then
3702 AC_MSG_CHECKING([Visual C++])
3704 find_msvc "$with_visual_studio"
3706 if test -z "$vctest"; then
3707 if test -n "$with_visual_studio"; then
3708 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3710 AC_MSG_ERROR([No Visual Studio 2012, 2010 or 2013 installation found])
3714 if test "$BITNESS_OVERRIDE" = ""; then
3715 if test -f "$vctest/bin/cl.exe"; then
3716 VC_PRODUCT_DIR=$vctest
3718 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3721 if test -f "$vctest/bin/amd64/cl.exe"; then
3722 VC_PRODUCT_DIR=$vctest
3724 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/amd64/cl.exe])
3728 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3729 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3731 dnl ===========================================================
3732 dnl Check for the corresponding mspdb*.dll
3733 dnl ===========================================================
3737 if test "$BITNESS_OVERRIDE" = ""; then
3738 if test "$vcnum" = "120"; then
3739 MSPDB_PATH="$VC_PRODUCT_DIR/../VC/bin"
3741 MSPDB_PATH="$VC_PRODUCT_DIR/../Common7/IDE"
3744 MSPDB_PATH="$VC_PRODUCT_DIR/bin/amd64"
3749 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3750 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3753 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3754 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3756 dnl The path needs to be added before cl is called
3757 PATH="$MSPDB_PATH:$PATH"
3759 AC_MSG_CHECKING([cl.exe])
3761 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3762 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3763 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3766 if test -z "$CC"; then
3767 if test "$BITNESS_OVERRIDE" = ""; then
3768 if test -f "$VC_PRODUCT_DIR/bin/cl.exe"; then
3769 CC="$VC_PRODUCT_DIR/bin/cl.exe"
3772 if test -f "$VC_PRODUCT_DIR/bin/amd64/cl.exe"; then
3773 CC="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3777 # This gives us a posix path with 8.3 filename restrictions
3778 CC=`win_short_path_for_make "$CC"`
3781 if test -n "$CC"; then
3782 # Remove /cl.exe from CC case insensitive
3783 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3784 if test "$BITNESS_OVERRIDE" = ""; then
3785 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
3787 if test -n "$VC_PRODUCT_DIR"; then
3788 # Huh, why not just an assignment?
3789 COMPATH=`echo $VC_PRODUCT_DIR`
3792 export INCLUDE=`cygpath -d "$COMPATH/Include"`
3794 PathFormat "$COMPATH"
3795 COMPATH="$formatted_path"
3800 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3801 # are always "better", we list them in reverse chronological order.
3806 WINDOWS_SDK_ACCEPTABLE_VERSIONS="7.1A 7.1 7.0A 6.0A"
3807 if test "$ENABLE_LTO" = TRUE; then
3808 AC_MSG_WARN([LTO is known to cause problems with MSVC 2010])
3809 add_warning "LTO is known to cause problems with MSVC 2010"
3814 WINDOWS_SDK_ACCEPTABLE_VERSIONS="8.0 7.1A"
3818 WINDOWS_SDK_ACCEPTABLE_VERSIONS="8.1A 8.1 8.0"
3822 # The expectation is that --with-windows-sdk should not need to be used
3823 if test -n "$with_windows_sdk"; then
3824 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3825 *" "$with_windows_sdk" "*)
3826 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3829 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work witn VS $MSVSVER])
3834 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3839 AC_MSG_ERROR([Visual C++ not found after all, huh])
3842 dnl We need to guess the prefix of the -showIncludes output, it can be
3844 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3845 echo "#include <stdlib.h>" > conftest.c
3846 SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
3847 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3848 rm -f conftest.c conftest.obj
3849 if test -z "$SHOWINCLUDES_PREFIX"; then
3850 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3852 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3855 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3856 # version of the Explorer extension (and maybe other small
3857 # bits, too) needed when installing a 32-bit LibreOffice on a
3858 # 64-bit OS. The 64-bit Explorer extension is a feature that
3859 # has been present since long in OOo. Don't confuse it with
3860 # building LibreOffice itself as 64-bit code, which is
3861 # unfinished work and highly experimental.
3867 if test "$BITNESS_OVERRIDE" = ""; then
3868 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3869 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3870 # Prefer native x64 compiler to cross-compiler, in case we are running
3871 # the build on a 64-bit OS.
3872 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3874 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3875 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3876 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3878 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3879 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3882 if test "$BUILD_X64" = TRUE; then
3883 AC_MSG_RESULT([found])
3885 AC_MSG_RESULT([not found])
3886 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3891 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3892 AC_SUBST(CXX_X64_BINARY)
3893 AC_SUBST(LINK_X64_BINARY)
3895 AC_MSG_CHECKING([the compiler is MinGW])
3896 MACHINE_PREFIX=`$CC -dumpmachine`
3897 if echo $MACHINE_PREFIX | $GREP -q mingw32; then
3898 COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
3899 AC_MSG_RESULT([yes])
3901 AC_MSG_ERROR([Compiler is not MinGW.])
3906 PathFormat "$MSPDB_PATH"
3907 MSPDB_PATH="$formatted_path"
3908 AC_SUBST(SHOWINCLUDES_PREFIX)
3913 if test "$_os" = "WINNT"; then
3914 BUILD_TYPE="$BUILD_TYPE DBGHELP"
3920 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3921 AC_SUBST(UNOWINREG_DLL)
3924 # prefix C with ccache if needed
3926 if test "$CCACHE" != ""; then
3927 AC_MSG_CHECKING([whether $CC is already ccached])
3931 CFLAGS="$CFLAGS --ccache-skip -O2"
3932 dnl an empty program will do, we're checking the compiler flags
3933 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3934 [use_ccache=yes], [use_ccache=no])
3935 if test $use_ccache = yes; then
3936 AC_MSG_RESULT([yes])
3945 dnl Set the ENABLE_DBGUTIL variable
3946 dnl ===================================================================
3947 AC_MSG_CHECKING([whether to build with additional debug utilities])
3948 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3949 ENABLE_DBGUTIL="TRUE"
3950 # this is an extra var so it can have different default on different MSVC
3951 # versions (in case there are version specific problems with it)
3952 MSVC_USE_DEBUG_RUNTIME="TRUE"
3954 AC_MSG_RESULT([yes])
3955 # cppunit and graphite expose STL in public headers
3956 if test "$with_system_cppunit" = "yes"; then
3957 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3959 with_system_cppunit=no
3961 if test "$with_system_graphite" = "yes"; then
3962 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3964 with_system_graphite=no
3966 if test "$with_system_mysql_cppconn" = "yes"; then
3967 AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
3969 with_system_mysql_cppconn=no
3971 if test "$with_system_orcus" = "yes"; then
3972 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3974 with_system_orcus=no
3976 if test "$with_system_libcmis" = "yes"; then
3977 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3979 with_system_libcmis=no
3981 if test "$enable_win_mozab_driver" = "yes"; then
3982 AC_MSG_ERROR([--enable-win-mozab-driver conflicts with --enable-dbgutil])
3986 MSVC_USE_DEBUG_RUNTIME=""
3989 AC_SUBST(ENABLE_DBGUTIL)
3990 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3992 dnl Set the ENABLE_DEBUG variable.
3993 dnl ===================================================================
3994 AC_MSG_CHECKING([whether to do a debug build])
3995 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3996 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3998 if test -n "$ENABLE_DBGUTIL"; then
3999 if test "$enable_debug" = "no"; then
4000 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
4003 AC_MSG_RESULT([yes (dbgutil)])
4004 elif test -n "$enable_debug" && test "$enable_debug" != "no"; then
4006 AC_MSG_RESULT([yes])
4011 AC_SUBST(ENABLE_DEBUG)
4013 dnl Selective debuginfo
4014 ENABLE_DEBUGINFO_FOR=
4015 if test -n "$ENABLE_DEBUG"; then
4016 AC_MSG_CHECKING([whether to use selective debuginfo])
4017 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
4018 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
4019 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
4021 ENABLE_DEBUGINFO_FOR=all
4022 AC_MSG_RESULT([no, for all])
4025 AC_SUBST(ENABLE_DEBUGINFO_FOR)
4027 dnl Check for enable symbols option
4028 dnl ===================================================================
4029 AC_MSG_CHECKING([whether to include symbols while preserve optimization])
4030 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
4031 ENABLE_SYMBOLS="TRUE"
4032 if test -n "$ENABLE_DBGUTIL"; then
4033 AC_MSG_ERROR([--enable-dbgutil cannot be used with --enable-symbols])
4034 elif test -n "$ENABLE_DEBUG"; then
4035 AC_MSG_ERROR([--enable-debug cannot be used with --enable-symbols])
4037 AC_MSG_RESULT([yes])
4039 if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
4040 ENABLE_SYMBOLS="FALSE"
4046 AC_SUBST(ENABLE_SYMBOLS)
4048 # Debug information format for iOS. Running dsymutil takes a long time... you really need a separate
4049 # .dSYM only if running Instruments, I think. (Not for normal debugging in Xcode.) To enable a
4050 # separate .dSYM, either use --enable-release-build or change manually to "DWARF with DSYM" in Xcode.
4051 XCODE_DEBUG_INFORMATION_FORMAT=dwarf-with-dsym
4052 if test "$enable_release_build" != yes -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \); then
4053 XCODE_DEBUG_INFORMATION_FORMAT=dwarf
4055 AC_SUBST(XCODE_DEBUG_INFORMATION_FORMAT)
4057 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
4058 # By default use the ones specified by our build system,
4059 # but explicit override is possible.
4060 AC_MSG_CHECKING(for explicit AFLAGS)
4061 if test -n "$AFLAGS"; then
4062 AC_MSG_RESULT([$AFLAGS])
4068 AC_MSG_CHECKING(for explicit CFLAGS)
4069 if test -n "$CFLAGS"; then
4070 AC_MSG_RESULT([$CFLAGS])
4076 AC_MSG_CHECKING(for explicit CXXFLAGS)
4077 if test -n "$CXXFLAGS"; then
4078 AC_MSG_RESULT([$CXXFLAGS])
4084 AC_MSG_CHECKING(for explicit OBJCFLAGS)
4085 if test -n "$OBJCFLAGS"; then
4086 AC_MSG_RESULT([$OBJCFLAGS])
4092 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
4093 if test -n "$OBJCXXFLAGS"; then
4094 AC_MSG_RESULT([$OBJCXXFLAGS])
4100 AC_MSG_CHECKING(for explicit LDFLAGS)
4101 if test -n "$LDFLAGS"; then
4102 AC_MSG_RESULT([$LDFLAGS])
4112 AC_SUBST(OBJCXXFLAGS)
4116 AC_SUBST(x_CXXFLAGS)
4117 AC_SUBST(x_OBJCFLAGS)
4118 AC_SUBST(x_OBJCXXFLAGS)
4122 # determine CPUNAME, GUIBASE, ...
4136 PLATFORMID=aix_powerpc
4146 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4153 if test "$BITNESS_OVERRIDE" = 64; then
4157 PLATFORMID=windows_x86_64
4158 OUTPATH=wntmscx$COMEX
4162 PLATFORMID=windows_x86
4163 OUTPATH=wntmsci$COMEX
4167 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4170 SCPDEFS="$SCPDEFS -D_MSC_VER"
4192 PLATFORMID=macosx_powerpc
4196 if test "$BITNESS_OVERRIDE" = 64; then
4197 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4201 PLATFORMID=macosx_x86
4205 if test "$BITNESS_OVERRIDE" = 64; then
4208 PLATFORMID=macosx_x86_64
4213 PLATFORMID=macosx_x86
4218 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4235 PLATFORMID=dragonfly_x86
4240 PLATFORMID=dragonfly_x86_64
4243 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4260 PLATFORMID=freebsd_x86
4266 PLATFORMID=freebsd_x86_64
4269 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4286 PLATFORMID=kfreebsd_x86
4293 PLATFORMID=kfreebsd_x86_64
4297 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4314 PLATFORMID=linux_alpha
4322 PLATFORMID=linux_arm_eabi
4326 PLATFORMID=linux_arm_oabi
4334 PLATFORMID=linux_hppa
4340 PLATFORMID=linux_x86
4346 PLATFORMID=linux_ia64
4353 PLATFORMID=linux_mips_eb
4359 EPM_FLAGS="-a mips64"
4360 PLATFORMID=linux_mips_eb
4366 EPM_FLAGS="-a mips64el"
4367 PLATFORMID=linux_mips_el
4373 EPM_FLAGS="-a mipsel"
4374 PLATFORMID=linux_mips_el
4380 PLATFORMID=linux_m68k
4386 PLATFORMID=linux_powerpc
4393 PLATFORMID=linux_powerpc64
4399 PLATFORMID=linux_sparc
4405 PLATFORMID=linux_s390
4412 PLATFORMID=linux_s390x
4419 PLATFORMID=linux_x86_64
4423 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4440 PLATFORMID=android_arm_eabi
4444 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4446 PLATFORMID=android_mips_el
4452 PLATFORMID=android_x86
4456 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4470 if test "$BITNESS_OVERRIDE" = 64; then
4473 PLATFORMID=windows_x86_64
4474 OUTPATH=wntgccx$COMEX
4475 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgccx"
4479 PLATFORMID=windows_x86
4480 OUTPATH=wntgcci$COMEX
4481 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgcci"
4485 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4503 PLATFORMID=netbsd_x86
4508 PLATFORMID=netbsd_powerpc
4513 PLATFORMID=netbsd_sparc
4518 PLATFORMID=netbsd_x86_64
4521 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4538 PLATFORMID=openbsd_x86
4543 PLATFORMID=openbsd_x86_64
4546 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4549 SOLARINC="$SOLARINC -I/usr/local/include"
4564 PLATFORMID=solaris_x86
4570 PLATFORMID=solaris_sparc
4576 PLATFORMID=solaris_sparc64
4580 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4583 SOLARINC="$SOLARINC -I/usr/local/include"
4587 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4591 if test "$enable_headless" = "yes"; then
4592 if test "$GUIBASE" != "unx"; then
4593 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --enable-headless])
4598 WORKDIR="${BUILDDIR}/workdir"
4599 INSTDIR="${BUILDDIR}/instdir"
4600 INSTROOT="${INSTDIR}${INSTROOTSUFFIX}"
4601 SOLARINC="-I. -I$SRC_ROOT/include $SOLARINC"
4609 AC_SUBST([INSTROOT])
4614 AC_SUBST(PLATFORMID)
4615 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4617 dnl ===================================================================
4618 dnl Test which package format to use
4619 dnl ===================================================================
4620 AC_MSG_CHECKING([which package format to use])
4621 if test -n "$with_package_format" -a "$with_package_format" != no; then
4622 for i in $with_package_format; do
4624 aix | bsd | deb | pkg | rpm | native | portable | archive | dmg | installed | msi)
4627 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4628 aix - AIX software distribution
4629 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4630 deb - Debian software distribution
4631 pkg - Solaris software distribution
4632 rpm - RedHat software distribution
4633 native - "Native" software distribution for the platform
4634 portable - Portable software distribution
4636 LibreOffice additionally supports:
4637 archive - .tar.gz or .zip
4639 installed - installation tree
4645 PKGFORMAT="$with_package_format"
4646 AC_MSG_RESULT([$PKGFORMAT])
4649 AC_MSG_RESULT([none])
4653 dnl ===================================================================
4654 dnl Set up a different compiler to produce tools to run on the build
4655 dnl machine when doing cross-compilation
4656 dnl ===================================================================
4658 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4659 if test "$cross_compiling" = "yes"; then
4660 AC_MSG_CHECKING([for BUILD platform configuration])
4662 rm -rf CONF-FOR-BUILD config_build.mk
4663 mkdir CONF-FOR-BUILD
4664 # Here must be listed all files needed when running the configure script. In particular, also
4665 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4666 # keep them in the same order as there.
4667 (cd $SRC_ROOT && tar cf - \
4669 bin/get_config_variables \
4670 solenv/bin/getcompver.awk \
4671 solenv/inc/langlist.mk \
4675 instsetoo_native/util/openoffice.lst.in \
4677 sysui/desktop/macosx/Info.plist.in \
4678 ios/lo.xcconfig.in) \
4679 | (cd CONF-FOR-BUILD && tar xf -)
4680 cp configure CONF-FOR-BUILD
4681 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4683 unset COM GUIBASE OS CPUNAME
4684 unset CC CXX SYSBASE CFLAGS
4685 unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
4686 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4687 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
4688 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4689 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4690 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4693 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4694 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4695 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4696 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4697 test -n "$with_system_boost_for_build" && sub_conf_opts="$sub_conf_opts --with-system-boost"
4698 test -n "$with_system_cppunit_for_build" && sub_conf_opts="$sub_conf_opts --with-system-cppunit"
4699 test -n "$with_system_expat_for_build" && sub_conf_opts="$sub_conf_opts --with-system-expat"
4700 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4701 test -n "$with_system_libxml_for_build" && sub_conf_opts="$sub_conf_opts --with-system-libxml"
4702 # we need the msi build tools on mingw if we are creating the
4704 if test "$WITH_MINGW" = "yes"; then
4705 enable_winegcc_for_build=
4706 for pkgformat in $PKGFORMAT; do
4707 case "$pkgformat" in
4708 msi|native) enable_winegcc_for_build=yes ;;
4711 test -n "$enable_winegcc_for_build" && sub_conf_opts="$sub_conf_opts --enable-winegcc"
4713 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4714 # Don't bother having configure look for stuff not needed for the build platform anyway
4717 --disable-graphite \
4718 --disable-pdfimport \
4719 --disable-postgresql-sdbc \
4720 --with-parallelism="$with_parallelism" \
4725 2>&1 | sed -e 's/^/ /'
4726 test -f ./config_host.mk 2>/dev/null || exit
4727 cp config_host.mk ../config_build.mk
4728 mv config.log ../config.Build.log
4729 mkdir -p ../config_build
4730 mv config_host/*.h ../config_build
4731 . ./bin/get_config_variables CC CXX INSTDIR INSTROOT LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER OS PATH SDKDIRNAME SYSTEM_LIBXSLT WORKDIR
4733 for V in CC CXX LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER OS SDKDIRNAME SYSTEM_LIBXSLT; do
4735 VV=`eval "echo $VV"`
4736 if test -n "$VV"; then
4737 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4738 echo "$line" >>build-config
4742 for V in INSTDIR INSTROOT WORKDIR; do
4744 VV=`eval "echo $VV"`
4745 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4746 if test -n "$VV"; then
4747 line="${V}_FOR_BUILD='$VV'"
4748 echo "$line" >>build-config
4752 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4753 echo "$line" >>build-config
4756 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4757 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])
4758 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4759 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4761 eval `cat CONF-FOR-BUILD/build-config`
4763 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4765 rm -rf CONF-FOR-BUILD
4769 CXX_FOR_BUILD="$CXX"
4770 INSTDIR_FOR_BUILD="$INSTDIR"
4771 INSTROOT_FOR_BUILD="$INSTROOT"
4772 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4773 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4774 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4775 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4776 WORKDIR_FOR_BUILD="$WORKDIR"
4778 AC_SUBST(OS_FOR_BUILD)
4779 AC_SUBST(INSTDIR_FOR_BUILD)
4780 AC_SUBST(INSTROOT_FOR_BUILD)
4781 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4782 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4783 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4784 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4785 AC_SUBST(WORKDIR_FOR_BUILD)
4787 dnl ===================================================================
4788 dnl Check for syslog header
4789 dnl ===================================================================
4790 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4792 dnl ===================================================================
4793 dnl Set the ENABLE_CRASHDUMP variable.
4794 dnl ===================================================================
4795 AC_MSG_CHECKING([whether to enable crashdump feature])
4796 if test "$enable_crashdump" = "yes"; then
4797 ENABLE_CRASHDUMP="TRUE"
4798 BUILD_TYPE="$BUILD_TYPE CRASHREP"
4799 AC_MSG_RESULT([yes])
4804 AC_SUBST(ENABLE_CRASHDUMP)
4807 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4808 dnl ===================================================================
4809 AC_MSG_CHECKING([whether to turn warnings to errors])
4810 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4811 ENABLE_WERROR="TRUE"
4812 AC_MSG_RESULT([yes])
4816 AC_SUBST(ENABLE_WERROR)
4818 dnl Set the ASSERT_ALWAYS_ABORT variable. (Activate --enable-assert-always-abort)
4819 dnl ===================================================================
4820 AC_MSG_CHECKING([whether to have assert to abort in release code])
4821 if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
4822 ASSERT_ALWAYS_ABORT="TRUE"
4823 AC_MSG_RESULT([yes])
4825 ASSERT_ALWAYS_ABORT="FALSE"
4828 AC_SUBST(ASSERT_ALWAYS_ABORT)
4830 # Determine whether to use ooenv for the instdir installation
4831 # ===================================================================
4832 if test $_os != "WINNT" -a $_os != "Darwin"; then
4833 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4834 if test "$enable_ooenv" = "no"; then
4838 AC_MSG_RESULT([yes])
4841 AC_SUBST(ENABLE_OOENV)
4843 if test "$enable_headless" = "yes"; then
4844 # be sure to do not mess with uneeded stuff
4852 build_gstreamer_0_10=no
4856 enable_cairo_canvas=no
4860 dnl ===================================================================
4861 dnl check for cups support
4862 dnl ===================================================================
4865 if test "$enable_cups" = "no"; then
4869 AC_MSG_CHECKING([whether to enable CUPS support])
4870 if test "$test_cups" = "yes"; then
4872 AC_MSG_RESULT([yes])
4874 AC_MSG_CHECKING([whether cups support is present])
4875 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4876 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4877 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4878 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4885 AC_SUBST(ENABLE_CUPS)
4888 if test "$test_fontconfig" = "yes"; then
4889 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4890 SYSTEM_FONTCONFIG=TRUE
4892 AC_SUBST(FONTCONFIG_CFLAGS)
4893 AC_SUBST(FONTCONFIG_LIBS)
4894 AC_SUBST([SYSTEM_FONTCONFIG])
4896 dnl whether to find & fetch external tarballs?
4897 dnl ===================================================================
4898 if test -z "$TARFILE_LOCATION"; then
4899 if test -d "$SRC_ROOT/src" ; then
4900 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4901 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4903 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4905 AbsolutePath "$TARFILE_LOCATION"
4906 PathFormat "${absolute_path}"
4907 TARFILE_LOCATION="${formatted_path}"
4909 AC_SUBST(TARFILE_LOCATION)
4911 AC_MSG_CHECKING([whether we want to fetch tarballs])
4912 if test "$enable_fetch_external" != "no"; then
4913 if test "$with_all_tarballs" = "yes"; then
4914 AC_MSG_RESULT(["yes, all of them"])
4915 DO_FETCH_TARBALLS="ALL"
4917 AC_MSG_RESULT(["yes, if we use them"])
4918 DO_FETCH_TARBALLS="TRUE"
4924 AC_SUBST(DO_FETCH_TARBALLS)
4926 AC_MSG_CHECKING([whether to build help])
4927 HELP_COMMON_ONLY=FALSE
4928 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4929 BUILD_TYPE="$BUILD_TYPE HELP"
4930 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4931 if test "$with_help" = "common" ; then
4932 HELP_COMMON_ONLY=TRUE
4933 AC_MSG_RESULT([common only])
4935 SCPDEFS="$SCPDEFS -DWITH_HELP"
4936 AC_MSG_RESULT([yes])
4941 AC_SUBST(HELP_COMMON_ONLY)
4943 dnl Test whether to include MySpell dictionaries
4944 dnl ===================================================================
4945 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4946 if test "$with_myspell_dicts" = "yes"; then
4947 AC_MSG_RESULT([yes])
4948 WITH_MYSPELL_DICTS=TRUE
4949 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4950 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4955 AC_SUBST(WITH_MYSPELL_DICTS)
4957 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
4958 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4959 if test "$with_system_dicts" = yes; then
4960 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4962 with_system_dicts=no
4965 AC_MSG_CHECKING([whether to use dicts from external paths])
4966 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4967 AC_MSG_RESULT([yes])
4969 AC_MSG_CHECKING([for spelling dictionary directory])
4970 if test -n "$with_external_dict_dir"; then
4971 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4973 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4974 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4975 DICT_SYSTEM_DIR=file:///usr/share/myspell
4978 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4979 AC_MSG_CHECKING([for hyphenation patterns directory])
4980 if test -n "$with_external_hyph_dir"; then
4981 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4983 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4985 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4986 AC_MSG_CHECKING([for thesaurus directory])
4987 if test -n "$with_external_thes_dir"; then
4988 THES_SYSTEM_DIR=file://$with_external_thes_dir
4990 THES_SYSTEM_DIR=file:///usr/share/mythes
4992 AC_MSG_RESULT([$THES_SYSTEM_DIR])
4997 AC_SUBST(SYSTEM_DICTS)
4998 AC_SUBST(DICT_SYSTEM_DIR)
4999 AC_SUBST(HYPH_SYSTEM_DIR)
5000 AC_SUBST(THES_SYSTEM_DIR)
5002 dnl ===================================================================
5003 AC_MSG_CHECKING([whether to enable pch feature])
5004 if test -n "$enable_pch" && test "$enable_pch" != "no"; then
5005 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
5007 AC_MSG_RESULT([yes])
5008 elif test "$GCC" = "yes"; then
5010 AC_MSG_RESULT([yes])
5013 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
5019 AC_SUBST(ENABLE_PCH)
5023 AC_MSG_CHECKING([the GNU make version])
5024 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5025 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5026 if test "$_make_longver" -ge "038200"; then
5027 AC_MSG_RESULT([$GNUMAKE $_make_version])
5029 elif test "$_make_longver" -ge "038100"; then
5030 if test "$build_os" = "cygwin"; then
5031 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
5033 AC_MSG_RESULT([$GNUMAKE $_make_version])
5035 dnl ===================================================================
5036 dnl Search all the common names for sha1sum
5037 dnl ===================================================================
5038 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
5039 if test -z "$SHA1SUM"; then
5040 AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
5041 elif test "$SHA1SUM" = "openssl"; then
5042 SHA1SUM="openssl sha1"
5044 AC_MSG_CHECKING([for GNU make bug 20033])
5045 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
5046 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
5047 A := \$(wildcard *.a)
5051 <TAB>@echo survived bug20033.
5055 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5068 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5069 <TAB>\$(call d1,\$(CHECKSUM)),\
5070 <TAB>\$(call d2,\$(CHECKSUM)))
5072 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5073 no_parallelism_make="YES"
5074 AC_MSG_RESULT([yes, disable parallelism])
5076 AC_MSG_RESULT([no, keep parallelism enabled])
5078 rm -rf $TESTGMAKEBUG20033
5080 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5083 # find if gnumake support file function
5084 AC_MSG_CHECKING([whether GNU make supports the 'file' function])
5085 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5086 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5087 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5089 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5090 \$(file >test.txt,Success )
5097 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5098 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5099 HAVE_GNUMAKE_FILE_FUNC=TRUE
5100 AC_MSG_RESULT([yes])
5104 rm -rf $TESTGMAKEFILEFUNC
5105 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5107 AC_SUBST(GNUMAKE_WIN_NATIVE)
5109 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`
5112 if test "$_make_ver_check" = ""; then
5116 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5117 SHELL_BASH=$(cygpath -m $(which bash))
5119 SHELL_BASH=`which bash`
5121 AC_SUBST(SHELL_BASH)
5123 HAVE_LD_HASH_STYLE=FALSE
5124 WITH_LINKER_HASH_STYLE=
5125 AC_MSG_CHECKING( for --hash-style gcc linker support )
5126 if test "$GCC" = "yes"; then
5127 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5128 hash_styles="gnu sysv"
5129 elif test "$with_linker_hash_style" = "no"; then
5132 hash_styles="$with_linker_hash_style"
5135 for hash_style in $hash_styles; do
5136 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5137 hash_style_ldflags_save=$LDFLAGS
5138 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5140 AC_LINK_IFELSE([AC_LANG_PROGRAM(
5146 [ if ./conftest$EXEEXT; then
5147 HAVE_LD_HASH_STYLE=TRUE
5148 WITH_LINKER_HASH_STYLE=$hash_style
5150 [HAVE_LD_HASH_STYLE=FALSE])
5151 LDFLAGS=$hash_style_ldflags_save
5154 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5155 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5159 LDFLAGS=$hash_style_ldflags_save
5163 AC_SUBST(HAVE_LD_HASH_STYLE)
5164 AC_SUBST(WITH_LINKER_HASH_STYLE)
5166 dnl ===================================================================
5167 dnl Check whether there's a Perl version available.
5168 dnl ===================================================================
5169 if test -z "$with_perl_home"; then
5170 AC_PATH_PROG(PERL, perl)
5172 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5173 _perl_path="$with_perl_home/bin/perl"
5174 if test -x "$_perl_path"; then
5177 AC_MSG_ERROR([$_perl_path not found])
5181 dnl ===================================================================
5182 dnl Testing for Perl version 5 or greater.
5183 dnl $] is the Perl version variable, it is returned as an integer
5184 dnl ===================================================================
5185 if test "$PERL"; then
5186 AC_MSG_CHECKING([the Perl version])
5187 ${PERL} -e "exit($]);"
5189 if test "$_perl_version" -lt 5; then
5190 AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
5192 AC_MSG_RESULT([checked (perl $_perl_version)])
5194 AC_MSG_ERROR([Perl not found, install version 5 of Perl])
5197 dnl ===================================================================
5198 dnl Testing for required Perl modules
5199 dnl ===================================================================
5201 AC_MSG_CHECKING([for required Perl modules])
5202 if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'>/dev/null 2>&1`; then
5203 AC_MSG_RESULT([all modules found])
5205 AC_MSG_RESULT([failed to find some modules])
5206 # Find out which modules are missing.
5207 missing_perl_modules=
5208 if ! `$PERL -e 'use Archive::Zip;'>/dev/null 2>&1`; then
5209 missing_perl_modules=Archive::Zip
5211 if ! `$PERL -e 'use Cwd;'>/dev/null 2>&1`; then
5212 missing_perl_modules="$missing_perl_modules Cwd"
5214 if ! `$PERL -e 'use Digest::MD5;'>/dev/null 2>&1`; then
5215 missing_perl_modules="$missing_perl_modules Digest::MD5"
5218 The missing Perl modules are: $missing_perl_modules
5219 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5222 dnl ===================================================================
5223 dnl Check for pkg-config
5224 dnl ===================================================================
5225 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5229 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5231 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5232 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5233 # explicitly. Or put /path/to/compiler in PATH yourself.
5235 AC_CHECK_TOOL(AR,ar)
5236 AC_CHECK_TOOL(NM,nm)
5237 AC_CHECK_TOOL(OBJDUMP,objdump)
5238 AC_CHECK_TOOL(RANLIB,ranlib)
5239 AC_CHECK_TOOL(STRIP,strip)
5240 if test "$_os" = "WINNT"; then
5241 AC_CHECK_TOOL(DLLTOOL,dlltool)
5242 AC_CHECK_TOOL(WINDRES,windres)
5249 AC_SUBST(PKG_CONFIG)
5254 dnl ===================================================================
5255 dnl pkg-config checks on Mac OS X
5256 dnl ===================================================================
5258 if test $_os = Darwin; then
5259 AC_MSG_CHECKING([for bogus pkg-config])
5260 if test -n "$PKG_CONFIG"; then
5261 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5262 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5264 if test "$enable_bogus_pkg_config" = "yes"; then
5265 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5267 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please remove or hide $PKG_CONFIG])
5271 AC_MSG_RESULT([no, good])
5277 # Return value: $csctest
5281 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5282 if test -n "$regvalue"; then
5290 # Return value: $altest
5294 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5295 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5296 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5305 # Return value: $frametest (that's a silly name...)
5309 for ver in 1.1 2.0; do
5310 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv$ver
5311 if test -n "$regvalue"; then
5318 find_winsdk_version()
5320 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5321 # Return value: $winsdktest
5325 # Why we look for them in this particular order I don't know. But OTOH I
5328 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5329 if test -n "$regvalue"; then
5330 winsdktest=$regvalue
5335 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5336 if test -n "$regvalue"; then
5337 winsdktest=$regvalue
5346 # Args: $1 (optional) : list of acceptable SDK versions
5347 # Return value: $winsdktest
5351 if test -n "$1"; then
5354 sdkversions="$WINDOWS_SDK_ACCEPTABLE_VERSIONS"
5357 for ver in $sdkversions; do
5358 find_winsdk_version $ver
5359 if test -n "$winsdktest"; then
5367 for ver in 10.0 11.0; do
5368 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5369 if test -n "$regvalue"; then
5370 if test -e "$regvalue/Microsoft_VC${VCVER}_CRT_x86.msm"; then
5376 if test -z "$msmdir"; then
5377 AC_MSG_NOTICE([no registry entry for Merge Module directory - trying "${COMMONPROGRAMFILES}/Merge Modules/"])
5378 msmdir="${COMMONPROGRAMFILES}/Merge Modules/"
5380 msmdir=`cygpath -m "$msmdir"`
5381 if test -z "$msmdir"; then
5382 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5383 AC_MSG_ERROR([Merge modules not found in $msmdir])
5385 AC_MSG_WARN([Merge modules not found in $msmdir])
5391 find_msvc_x64_dlls()
5393 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5394 msvcdlls="msvcp${VCVER}.dll msvcr${VCVER}.dll"
5395 for dll in $msvcdlls; do
5396 if ! test -f "$msvcdllpath/$dll"; then
5397 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5402 if test "$build_os" = "cygwin"; then
5404 AC_MSG_CHECKING([for midl.exe])
5407 if test -f "$winsdktest/Bin/midl.exe"; then
5408 MIDL_PATH="$winsdktest/Bin"
5409 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5410 MIDL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5412 if test ! -f "$MIDL_PATH/midl.exe"; then
5413 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5415 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5418 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5419 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5422 AC_MSG_CHECKING([for csc.exe])
5424 if test -f "$csctest/csc.exe"; then
5427 if test ! -f "$CSC_PATH/csc.exe"; then
5428 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5430 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5433 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5436 AC_MSG_CHECKING([for al.exe])
5438 if test -f "$winsdktest/Bin/al.exe"; then
5439 AL_PATH="$winsdktest/Bin"
5440 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5441 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5444 if test -z "$AL_PATH"; then
5446 if test -f "$altest/bin/al.exe"; then
5447 AL_PATH="$altest/bin"
5448 elif test -f "$altest/al.exe"; then
5452 if test ! -f "$AL_PATH/al.exe"; then
5453 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5455 AC_MSG_RESULT([$AL_PATH/al.exe])
5458 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5460 dnl Check mscoree.lib / .NET Framework dir
5461 AC_MSG_CHECKING(.NET Framework)
5463 if test -f "$frametest/lib/mscoree.lib"; then
5464 DOTNET_FRAMEWORK_HOME="$frametest"
5467 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/win8/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5468 DOTNET_FRAMEWORK_HOME="$winsdktest"
5472 if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/win8/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5473 AC_MSG_ERROR([mscoree.lib (.NET Framework) not found])
5475 AC_MSG_RESULT(found)
5477 PathFormat "$MIDL_PATH"
5478 MIDL_PATH="$formatted_path"
5480 PathFormat "$AL_PATH"
5481 AL_PATH="$formatted_path"
5483 PathFormat "$DOTNET_FRAMEWORK_HOME"
5484 DOTNET_FRAMEWORK_HOME="$formatted_path"
5486 PathFormat "$CSC_PATH"
5487 CSC_PATH="$formatted_path"
5490 dnl ===================================================================
5491 dnl Check if stdc headers are available excluding MSVC.
5492 dnl ===================================================================
5493 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5497 dnl ===================================================================
5498 dnl Testing for C++ compiler and version...
5499 dnl ===================================================================
5501 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5502 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5503 save_CXXFLAGS=$CXXFLAGS
5505 CXXFLAGS=$save_CXXFLAGS
5507 if test -n "$CC" -a -z "$CXX"; then
5512 dnl check for GNU C++ compiler version
5513 if test "$GXX" = "yes"; then
5514 AC_MSG_CHECKING([the GNU C++ compiler version])
5516 _gpp_version=`$CXX -dumpversion`
5517 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5519 if test "$_gpp_majmin" -lt "401"; then
5520 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
5522 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5525 dnl see https://code.google.com/p/android/issues/detail?id=41770
5526 if test "$_gpp_majmin" -ge "401"; then
5530 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5531 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5532 #include <bits/c++config.h>]],[[
5533 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5534 && !defined(_GLIBCXX__PTHREADS) \
5535 && !defined(_GLIBCXX_HAS_GTHREADS)
5538 ]])],[AC_MSG_RESULT([yes])
5539 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5541 if test $glibcxx_threads = yes; then
5542 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5546 AC_SUBST(BOOST_CXXFLAGS)
5549 # prefx CXX with ccache if needed
5551 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5552 if test "$CCACHE" != ""; then
5553 AC_MSG_CHECKING([whether $CXX is already ccached])
5555 save_CXXFLAGS=$CXXFLAGS
5556 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5557 dnl an empty program will do, we're checking the compiler flags
5558 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5559 [use_ccache=yes], [use_ccache=no])
5560 if test $use_ccache = yes; then
5561 AC_MSG_RESULT([yes])
5566 CXXFLAGS=$save_CXXFLAGS
5571 dnl ===================================================================
5572 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5573 dnl ===================================================================
5575 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5578 dnl Check whether there's a C pre-processor.
5579 dnl ===================================================================
5580 dnl When using SunStudio compiler, there is a bug with the cc
5581 dnl preprocessor, so use CC preprocessor as the cc preprocessor
5582 dnl See Issuezilla #445.
5583 dnl ===================================================================
5584 if test "$_os" = "SunOS"; then
5592 dnl ===================================================================
5593 dnl Find integral type sizes and alignments
5594 dnl ===================================================================
5596 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5598 AC_CHECK_SIZEOF(long)
5599 AC_CHECK_SIZEOF(short)
5600 AC_CHECK_SIZEOF(int)
5601 AC_CHECK_SIZEOF(long long)
5602 AC_CHECK_SIZEOF(double)
5603 AC_CHECK_SIZEOF(void*)
5605 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5606 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5607 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5608 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5609 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5611 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5612 m4_pattern_allow([AC_CHECK_ALIGNOF])
5613 m4_ifdef([AC_CHECK_ALIGNOF],
5615 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5616 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5617 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5618 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5621 case "$_os-$host_cpu" in
5623 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5624 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5625 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5626 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5629 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5630 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5631 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5632 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5635 if test -z "$ac_cv_alignof_short" -o \
5636 -z "$ac_cv_alignof_int" -o \
5637 -z "$ac_cv_alignof_long" -o \
5638 -z "$ac_cv_alignof_double"; then
5639 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.])
5645 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5646 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5647 if test $ac_cv_sizeof_long -eq 8; then
5648 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5649 elif test $ac_cv_sizeof_double -eq 8; then
5650 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5652 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5655 dnl Check for large file support
5657 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5658 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5660 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5661 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5665 SAL_TYPES_SIZEOFSHORT=2
5666 SAL_TYPES_SIZEOFINT=4
5667 SAL_TYPES_SIZEOFLONG=4
5668 SAL_TYPES_SIZEOFLONGLONG=8
5669 if test "$BITNESS_OVERRIDE" = ""; then
5670 SAL_TYPES_SIZEOFPOINTER=4
5672 SAL_TYPES_SIZEOFPOINTER=8
5674 SAL_TYPES_ALIGNMENT2=2
5675 SAL_TYPES_ALIGNMENT4=4
5676 SAL_TYPES_ALIGNMENT8=8
5679 AC_SUBST(LFS_CFLAGS)
5681 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5682 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5683 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5684 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5685 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5686 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5687 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5688 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5690 dnl ===================================================================
5691 dnl Check whether to enable runtime optimizations
5692 dnl ===================================================================
5693 ENABLE_RUNTIME_OPTIMIZATIONS=
5694 AC_MSG_CHECKING([whether to enable runtime optimizations])
5695 if test -z "$enable_runtime_optimizations"; then
5699 enable_runtime_optimizations=no
5705 if test "$enable_runtime_optimizations" != no; then
5706 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
5707 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
5708 AC_MSG_RESULT([yes])
5712 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
5714 dnl ===================================================================
5715 dnl Check if valgrind headers are available
5716 dnl ===================================================================
5718 if test "$cross_compiling" != yes; then
5719 prev_cppflags=$CPPFLAGS
5720 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5721 # or where does it come from?
5722 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5723 AC_CHECK_HEADER([valgrind/valgrind.h],
5724 [ENABLE_VALGRIND=TRUE])
5725 CPPFLAGS=$prev_cppflags
5727 AC_SUBST([ENABLE_VALGRIND])
5728 if test -z "$ENABLE_VALGRIND"; then
5731 AC_SUBST([VALGRIND_CFLAGS])
5734 dnl ===================================================================
5735 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
5736 dnl ===================================================================
5738 # We need at least the sys/sdt.h include header.
5739 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
5740 if test "$SDT_H_FOUND" = "TRUE"; then
5741 # Found sys/sdt.h header, now make sure the c++ compiler works.
5742 # Old g++ versions had problems with probes in constructors/destructors.
5743 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
5745 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5746 #include <sys/sdt.h>
5754 ProbeClass(int& v, const char *n) : ref(v), name(n)
5756 DTRACE_PROBE2(_test_, cons, name, ref);
5759 void method(int min)
5761 DTRACE_PROBE3(_test_, meth, name, ref, min);
5767 DTRACE_PROBE2(_test_, dest, name, ref);
5772 DTRACE_PROBE1(_test_, call, i);
5773 ProbeClass inst = ProbeClass(i, "call");
5775 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
5776 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
5779 AC_CONFIG_HEADERS([config_host/config_probes.h])
5781 dnl ===================================================================
5782 dnl Set the MinGW sys-root
5783 dnl ===================================================================
5784 if test "$WITH_MINGW" = "yes"; then
5785 AC_MSG_CHECKING([for MinGW sysroot])
5786 sysroot=`$CC -print-sysroot`
5787 AS_IF([test -d "$sysroot"/mingw],
5788 [MINGW_SYSROOT="$sysroot"/mingw
5789 AC_MSG_RESULT([$MINGW_SYSROOT])],
5790 [AC_MSG_RESULT([not found])
5791 AC_MSG_ERROR([cannot determine MinGW sysroot])])
5793 AC_SUBST([MINGW_DLLS])
5794 AC_SUBST([MINGW_SYSROOT])
5796 dnl ===================================================================
5797 dnl Set the MinGW include directories
5798 dnl ===================================================================
5799 if test "$WITH_MINGW" = "yes"; then
5800 AC_MSG_CHECKING([for MinGW include path])
5801 cat >conftest.$ac_ext <<_ACEOF
5803 #include <bits/c++config.h>
5805 _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`
5807 if test -z "$_mingw_lib_include_path"; then
5808 _mingw_lib_include_path="NO_LIB_INCLUDE"
5809 AC_MSG_RESULT([no MinGW include path])
5811 AC_MSG_RESULT([$_mingw_lib_include_path])
5813 MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
5814 AC_SUBST(MINGW_LIB_INCLUDE_PATH)
5818 AC_MSG_CHECKING([for dynamic libgcc])
5819 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5821 using namespace std;
5822 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
5823 MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
5824 if test -n "$MINGW_GCCDLL"; then
5825 MINGW_SHARED_GCCLIB=TRUE
5826 AC_MSG_RESULT([ $MINGW_GCCDLL])
5828 MINGW_SHARED_GCCLIB=
5831 ],[ AC_MSG_RESULT([no])
5835 AC_MSG_CHECKING([for dynamic libstdc++])
5836 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5838 using namespace std;
5839 ]], [[ cout << "Hello there." << endl; ]])],[
5840 MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
5841 if test -n "$MINGW_GXXDLL"; then
5842 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
5843 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
5844 if test "$CROSS_COMPILING" = "TRUE"; then
5846 mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
5848 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
5849 MINGW_SHARED_GXXLIB=TRUE
5850 AC_MSG_RESULT([$MINGW_GXXDLL])
5852 MINGW_SHARED_GXXLIB=
5855 ],[ AC_MSG_RESULT([no])
5861 AC_SUBST(MINGW_SHARED_GCCLIB)
5862 AC_SUBST(MINGW_SHARED_GXXLIB)
5863 AC_SUBST(MINGW_SHARED_LIBSTDCPP)
5864 AC_SUBST(MINGW_GCCDLL)
5865 AC_SUBST(MINGW_GXXDLL)
5868 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
5869 AC_DEFINE(HAVE_FMERGENEUTRALITEMS)
5872 if test "$WITH_MINGW" = "yes"; then
5873 AC_MSG_CHECKING([for fMergeNeutralItems in SCRIPT_CONTROL])
5874 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
5880 c.fMergeNeutralItems = 1;
5884 AC_DEFINE(HAVE_FMERGENEUTRALITEMS)
5886 [AC_MSG_RESULT(no)])
5889 dnl ===================================================================
5890 dnl Extra checking for the SunOS compiler
5891 dnl ===================================================================
5892 if test "$_os" = "SunOS"; then
5893 dnl SunStudio C++ compiler packaged with SunStudio C compiler
5894 if test "$CC" = "cc"; then
5895 AC_MSG_CHECKING([SunStudio C++ Compiler])
5896 if test "$CXX" != "CC"; then
5897 AC_MSG_WARN([SunStudio C++ was not found])
5898 add_warning "SunStudio C++ was not found"
5900 AC_MSG_RESULT([checked])
5905 dnl *************************************************************
5906 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
5907 dnl *************************************************************
5908 if test "$WITH_MINGW" = "yes"; then
5909 AC_MSG_CHECKING([exception type])
5911 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
5913 extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
5915 ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
5917 AC_MSG_RESULT($exceptions_type)
5921 EXCEPTIONS="$exceptions_type"
5922 AC_SUBST(EXCEPTIONS)
5924 dnl ===================================================================
5925 dnl thread-safe statics
5926 dnl ===================================================================
5927 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
5928 unset HAVE_THREADSAFE_STATICS
5929 if test "$GCC" = "yes"; then
5930 dnl -fthreadsafe-statics is available since GCC 4, so always available for
5931 dnl us. However, some C++ runtimes use a single lock for all static
5932 dnl variables, which can cause deadlock in multi-threaded applications.
5933 dnl This is not easily tested here; for POSIX-based systems, if executing
5934 dnl the following C++ program does not terminate then the tool chain
5935 dnl apparently has this problem:
5937 dnl #include <pthread.h>
5938 dnl int h() { return 0; }
5939 dnl void * g(void * unused) {
5940 dnl static int n = h();
5945 dnl pthread_create(&t, 0, g, 0);
5946 dnl pthread_join(t, 0);
5950 dnl static int n = f();
5954 dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
5955 dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
5956 dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
5957 dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
5958 dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
5959 dnl difference there. Conservative advice from Jakub Jelinek is to assume
5960 dnl it working in GCC >= 4.3, so conservative way to check here is to use
5961 dnl GCC_VERSION for GCC but resort to __GLIBCXX__ corresponding to libstdc++
5962 dnl shipped with GCC 4.3.0 (cf. <http://gcc.gnu.org/onlinedocs/libstdc++/
5963 dnl manual/abi.html#abi.versioning.history>; 4.3.0 is 20080306, 4.2.4 is
5964 dnl 20080519, 4.3.1 is 20080606) for Clang (for which GCC_VERSION is notoriously
5966 if test "$_os" != Darwin -a "$_os" != Android; then
5967 if test "$COM_GCC_IS_CLANG" = TRUE; then
5969 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5971 #if !defined __GLIBCXX__ ||(__GLIBCXX__ < 20080606 && __GLIBCXX__ != 20080306)
5974 ]])],[HAVE_THREADSAFE_STATICS=TRUE],[])
5976 elif test "${GCC_VERSION?}" -ge 0403; then
5977 HAVE_THREADSAFE_STATICS=TRUE
5980 if test "$HAVE_THREADSAFE_STATICS" = TRUE; then
5981 AC_DEFINE(HAVE_THREADSAFE_STATICS)
5982 AC_MSG_RESULT([yes])
5984 AC_MSG_RESULT([broken (i.e., no)])
5987 AC_MSG_RESULT([unknown (assuming no)])
5989 AC_SUBST(HAVE_THREADSAFE_STATICS)
5991 dnl ===================================================================
5992 dnl visibility and other gcc features
5993 dnl ===================================================================
5994 if test "$GCC" = "yes"; then
5995 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
5997 CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
5998 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
6001 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
6002 AC_MSG_RESULT([yes])
6007 AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
6009 CFLAGS="$CFLAGS -Werror -Wno-long-double"
6010 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
6012 if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
6013 AC_MSG_RESULT([yes])
6018 AC_MSG_CHECKING([whether $CC supports -mno-avx])
6020 CFLAGS="$CFLAGS -Werror -mno-avx"
6021 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
6023 if test "$HAVE_GCC_AVX" = "TRUE"; then
6024 AC_MSG_RESULT([yes])
6029 AC_MSG_CHECKING([whether $CC supports atomic functions])
6030 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6032 if (__sync_add_and_fetch(&v, 1) != 1 ||
6033 __sync_sub_and_fetch(&v, 1) != 0)
6035 __sync_synchronize();
6036 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6040 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6041 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6042 AC_MSG_RESULT([yes])
6043 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6049 [whether $CC supports pragma GCC diagnostic error/ignored/warning])
6051 CFLAGS="$CFLAGS -Werror -Wunknown-pragmas -Wunused-parameter"
6052 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6053 #pragma GCC diagnostic ignored "-Wunused-parameter"
6054 void dummy(int n) {}
6056 AC_DEFINE([HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY],[1])
6057 AC_MSG_RESULT([yes])
6058 ], [AC_MSG_RESULT([no])])
6061 AC_MSG_CHECKING([whether $CC supports pragma GCC diagnostic push/pop])
6063 CFLAGS="$CFLAGS -Werror -Wunknown-pragmas -Wunused-parameter"
6064 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6065 #pragma GCC diagnostic push
6066 #pragma GCC diagnostic ignored "-Wunused-parameter"
6067 void dummy(int n) {}
6068 #pragma GCC diagnostic pop
6070 AC_DEFINE([HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE],[1])
6071 AC_MSG_RESULT([yes])
6072 ], [AC_MSG_RESULT([no])])
6075 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
6077 CFLAGS="$CFLAGS -Werror"
6078 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6079 __attribute__((deprecated("test"))) void f();
6081 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6082 AC_MSG_RESULT([yes])
6083 ], [AC_MSG_RESULT([no])])
6086 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
6088 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6090 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6092 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6093 AC_MSG_RESULT([yes])
6094 ], [AC_MSG_RESULT([no])])
6097 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
6099 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6101 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6103 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS],[1])
6104 AC_MSG_RESULT([yes])
6105 ], [AC_MSG_RESULT([no])])
6108 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6110 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6112 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6114 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_THROW],[1])
6115 AC_MSG_RESULT([yes])
6116 ], [AC_MSG_RESULT([no])])
6119 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6121 save_CXXFLAGS=$CXXFLAGS
6122 CXXFLAGS="$CFLAGS -Werror -Wunknown-pragmas"
6123 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6124 struct __attribute__((warn_unused)) dummy {};
6126 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6127 AC_MSG_RESULT([yes])
6128 ], [AC_MSG_RESULT([no])])
6129 CXXFLAGS=$save_CXXFLAGS
6132 AC_MSG_CHECKING([whether STL uses __attribute__((warn_unused))])
6134 save_CXXFLAGS=$CXXFLAGS
6135 CXXFLAGS="$CFLAGS -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_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
6149 AC_SUBST(HAVE_GCC_AVX)
6150 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6152 dnl ===================================================================
6153 dnl Identify the C++ library
6154 dnl ===================================================================
6156 AC_MSG_CHECKING([What the C++ library is])
6158 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6164 [CPP_LIBRARY=GLIBCXX
6165 cpp_library_name="GNU libstdc++"
6167 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6169 #ifndef _LIBCPP_VERSION
6174 cpp_library_name="LLVM libc++"
6176 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6183 cpp_library_name="Microsoft"
6185 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6186 AC_MSG_RESULT([$cpp_library_name])
6188 AC_SUBST(CPP_LIBRARY)
6190 dnl ===================================================================
6192 dnl ===================================================================
6196 if test "$COM" = MSC; then
6197 AC_MSG_CHECKING([whether $CXX supports C++11])
6199 # MSVC supports (a subset of) CXX11 without any switch
6202 elif test "$GCC" = "yes"; then
6204 AC_MSG_CHECKING([whether $CXX supports C++11])
6205 for flag in -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
6206 save_CXXFLAGS=$CXXFLAGS
6207 CXXFLAGS="$CXXFLAGS $flag -Werror"
6209 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void f() {}]])],[CXXFLAGS_CXX11=$flag])
6211 CXXFLAGS=$save_CXXFLAGS
6212 if test -n "$CXXFLAGS_CXX11"; then
6217 if test "$HAVE_CXX11" = TRUE; then
6218 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6224 if test $CPP_LIBRARY = GLIBCXX -a "$HAVE_CXX11" = TRUE; then
6225 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6227 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6229 #if !defined(__GLIBCXX__)
6231 #elif __GLIBCXX__ < 20111004
6232 /* before breakage */
6233 #elif __GLIBCXX__ > 20120703
6234 /* after breakage */
6238 ]])], [AC_MSG_RESULT(no, ok)],
6239 [AC_MSG_RESULT(yes, disabling C++11)
6244 if test "$HAVE_CXX11" = TRUE; then
6245 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6246 save_CXXFLAGS=$CXXFLAGS
6247 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6250 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6253 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6269 a thinga[]={{0,0}, {1,1}};
6270 b thingb[]={{0,0}, {1,1}};
6271 size_t i = sizeof(sal_n_array_size(thinga));
6272 size_t j = sizeof(sal_n_array_size(thingb));
6273 return !(i != 0 && j != 0);
6275 ], [ AC_MSG_RESULT(yes) ],
6280 CXXFLAGS=$save_CXXFLAGS
6283 if test "$HAVE_CXX11" = TRUE; then
6284 AC_MSG_CHECKING([whether $CXX supports C++11 without __float128 compile error])
6285 save_CXXFLAGS=$CXXFLAGS
6286 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6289 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6291 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6294 ],[ AC_MSG_RESULT(yes) ],
6297 # The only reason why libstdc++ headers fail with Clang in C++11 mode is because
6298 # they use the __float128 type that Clang doesn't know (libstdc++ checks whether
6299 # __float128 is available during its build, but it's usually built using GCC,
6300 # and so c++config.h hardcodes __float128 being supported). As the only place
6301 # where __float128 is actually used is in a template specialization,
6302 # -D__float128=void will avoid the problem there while still causing a problem
6303 # if somebody actually uses the type.
6304 AC_MSG_CHECKING([whether -D__float128=void workaround helps])
6305 CXXFLAGS="$CXXFLAGS -D__float128=void"
6306 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6308 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6314 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -D__float128=void"
6323 CXXFLAGS=$save_CXXFLAGS
6326 if test "$HAVE_CXX11" = "TRUE"; then
6327 AC_DEFINE(HAVE_CXX11)
6328 elif test -n "$CXXFLAGS_CXX11"; then
6329 AC_MSG_NOTICE([Disabling C++11 support])
6331 elif test "$CPP_LIBRARY" = LIBCPP -a $_os = Darwin; then
6332 AC_MSG_ERROR([Selected libc++ but C++11 support broken])
6335 AC_SUBST(CXXFLAGS_CXX11)
6336 AC_SUBST(HAVE_CXX11)
6338 AC_MSG_CHECKING([for std::shared_ptr])
6339 if test "$HAVE_CXX11" = "TRUE" -a "$GCC" = "yes"; then
6340 save_CXXFLAGS=$CXXFLAGS
6341 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6343 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
6345 using std::shared_ptr;
6347 [ have_std_shared_ptr=yes ],
6348 [ have_std_shared_ptr=no ]
6351 CXXFLAGS=$save_CXXFLAGS
6352 elif test "$COM" = "MSC"; then
6353 have_std_shared_ptr=yes
6355 have_std_shared_ptr=no
6357 AC_MSG_RESULT([$have_std_shared_ptr])
6359 dnl ==================================
6360 dnl Check for C++11 "= delete" support
6361 dnl ==================================
6363 if test "$HAVE_CXX11" = "TRUE"; then
6364 AC_MSG_CHECKING([whether $CXX supports C++11 = delete syntax])
6365 save_CXXFLAGS=$CXXFLAGS
6366 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6368 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6371 void test() = delete;
6373 ]])],[HAVE_CXX11_DELETE=TRUE],[])
6376 CXXFLAGS=$save_CXXFLAGS
6377 if test "$HAVE_CXX11_DELETE" = "TRUE"; then
6378 AC_MSG_RESULT([yes])
6379 AC_DEFINE([HAVE_CXX11_DELETE])
6385 dnl ==================================
6386 dnl Check for C++11 "override" support
6387 dnl ==================================
6389 if test "$HAVE_CXX11" = "TRUE"; then
6390 AC_MSG_CHECKING([whether $CXX supports C++11 "override" syntax])
6391 save_CXXFLAGS=$CXXFLAGS
6392 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6394 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6397 virtual void test();
6402 virtual void test() override;
6404 ]])],[HAVE_CXX11_OVERRIDE=TRUE],[])
6407 CXXFLAGS=$save_CXXFLAGS
6408 if test "$HAVE_CXX11_OVERRIDE" = "TRUE"; then
6409 AC_MSG_RESULT([yes])
6410 AC_DEFINE([HAVE_CXX11_OVERRIDE])
6416 dnl ==================================
6417 dnl Check for C++11 "final" support
6418 dnl ==================================
6420 if test "$HAVE_CXX11" = "TRUE"; then
6421 AC_MSG_CHECKING([whether $CXX supports C++11 "final" syntax])
6422 save_CXXFLAGS=$CXXFLAGS
6423 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6425 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6426 // First check that this correct program that uses "final" compiles
6433 virtual void test();
6440 ]])],[have_final=yes],[])
6442 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6443 // Then check that the "final" works as expected,
6444 // that this program fails to compile
6452 ]])],[],[final_class_works=yes])
6454 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6455 // Also this should fail to compile
6458 virtual void test();
6470 ]])],[],[final_method_works=yes])
6473 CXXFLAGS=$save_CXXFLAGS
6475 if test "$have_final" = yes -a "$final_class_works" = yes -a "$final_method_works" = yes; then
6476 AC_MSG_RESULT([yes])
6477 AC_DEFINE([HAVE_CXX11_FINAL])
6483 dnl ===================================================================
6484 dnl Check for C++11 perfect forwarding support
6485 dnl ===================================================================
6486 if test "$HAVE_CXX11" = "TRUE"; then
6487 AC_MSG_CHECKING([whether $CXX supports C++11 perfect forwarding])
6488 save_CXXFLAGS=$CXXFLAGS
6489 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6491 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6493 template<typename T, typename... Args> T * f(Args &&... v) {
6494 return new T(std::forward<Args>(v)...);
6498 ]])], [perfect_forwarding=yes], [perfect_forwarding=no])
6500 CXXFLAGS=$save_CXXFLAGS
6501 AC_MSG_RESULT([$perfect_forwarding])
6502 if test "$perfect_forwarding" = yes; then
6503 AC_DEFINE([HAVE_CXX11_PERFECT_FORWARDING])
6507 HAVE_GCC_PRAGMA_OPERATOR=
6508 dnl _Pragma support (may require C++11)
6509 if test "$GCC" = "yes"; then
6510 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6512 save_CXXFLAGS=$CXXFLAGS
6513 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6514 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6515 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6517 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6518 HAVE_GCC_PRAGMA_OPERATOR=1
6519 AC_MSG_RESULT([yes])
6520 ], [AC_MSG_RESULT([no])])
6522 CXXFLAGS=$save_CXXFLAGS
6524 AC_SUBST(HAVE_GCC_PRAGMA_OPERATOR)
6526 dnl ===================================================================
6527 dnl system stl sanity tests
6528 dnl ===================================================================
6529 HAVE_GCC_VISIBILITY_BROKEN=
6530 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
6534 save_CPPFLAGS="$CPPFLAGS"
6535 if test -n "$MACOSX_SDK_PATH"; then
6536 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6539 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6541 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$CPP_LIBRARY" = GLIBCXX; then
6542 dnl gcc#19664, gcc#22482, rhbz#162935
6543 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6544 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6545 AC_MSG_RESULT([$stlvisok])
6546 if test "$stlvisok" = "no"; then
6547 AC_MSG_WARN([Your libstdc++ headers are not visibility safe. Disabling visibility])
6548 add_warning "Your libstdc++ headers are not visibility safe. Disabling visibility"
6549 unset HAVE_GCC_VISIBILITY_FEATURE
6553 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
6554 sharedlink_ldflags_save=$LDFLAGS
6555 LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
6557 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
6558 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6560 using namespace std;
6562 istringstream strm( "test" ); return 0;
6564 # Ugh, surely bad to assume an error message will contain
6565 # the word "unresolvable", a problem with
6566 # -fvisibility-inlines-hidden and STL headers might cause
6567 # some more obscure message on some platform, and anway,
6568 # the error message could be localised.
6569 [$EGREP -q unresolvable conftest.err;
6570 if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
6572 AC_MSG_RESULT([$gccvisok])
6573 if test "$gccvisok" = "no"; then
6574 AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
6575 add_warning "Your gcc is not -fvisibility-inlines-hidden safe, disabling that."
6576 HAVE_GCC_VISIBILITY_BROKEN="TRUE"
6579 LDFLAGS=$sharedlink_ldflags_save
6582 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6583 # when we don't make any dynamic libraries?
6584 if test "$DISABLE_DYNLOADING" = "" -a "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
6585 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6586 cat > conftestlib1.cc <<_ACEOF
6587 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6588 struct S2: S1<int> { virtual ~S2(); };
6591 cat > conftestlib2.cc <<_ACEOF
6592 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6593 struct S2: S1<int> { virtual ~S2(); };
6594 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6596 gccvisinlineshiddenok=yes
6597 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6598 gccvisinlineshiddenok=no
6600 dnl At least Clang -fsanitize=address is known to not work with
6601 dnl -z defs (unsetting which makes the test moot, though):
6602 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6603 if test "$COM_GCC_IS_CLANG" = TRUE; then
6607 my_linkflagsnoundefs=
6613 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6614 gccvisinlineshiddenok=no
6619 AC_MSG_RESULT([$gccvisinlineshiddenok])
6620 if test "$gccvisinlineshiddenok" = "no"; then
6621 AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
6622 add_warning "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that."
6623 HAVE_GCC_VISIBILITY_BROKEN="TRUE"
6627 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
6628 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6629 cat >visibility.cxx <<_ACEOF
6630 #pragma GCC visibility push(hidden)
6631 struct __attribute__ ((visibility ("default"))) TestStruct {
6634 __attribute__ ((visibility ("default"))) void TestFunc() {
6638 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
6643 if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
6646 if $EGREP -q '@PLT|@GOT' visibility.s; then
6658 rm -f visibility.s visibility.cxx
6660 AC_MSG_RESULT([$gccvisbroken])
6661 if test "$gccvisbroken" = "yes"; then
6662 AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
6663 add_warning "Your gcc is not -fvisibility=hidden safe. Disabling visibility"
6664 unset HAVE_GCC_VISIBILITY_FEATURE
6668 CPPFLAGS="$save_CPPFLAGS"
6673 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
6674 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
6676 dnl ===================================================================
6678 dnl ===================================================================
6680 HAVE_GCC_FNO_DEFAULT_INLINE=
6681 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6682 if test "$GCC" = "yes"; then
6683 AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
6684 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6685 # Option just ignored and silly warning that isn't a real
6690 save_CXXFLAGS=$CXXFLAGS
6691 CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
6692 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
6693 CXXFLAGS=$save_CXXFLAGS
6696 if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
6697 AC_MSG_RESULT([yes])
6702 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6703 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6708 save_CXXFLAGS=$CXXFLAGS
6709 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6710 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6711 CXXFLAGS=$save_CXXFLAGS
6714 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6715 AC_MSG_RESULT([yes])
6720 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
6721 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6723 dnl ===================================================================
6724 dnl Compiler plugins
6725 dnl ===================================================================
6728 # currently only Clang
6729 if test "$COM_GCC_IS_CLANG" = "TRUE"; then
6730 if test -n "$enable_compiler_plugins"; then
6731 compiler_plugins="$enable_compiler_plugins"
6732 elif test -n "$ENABLE_DBGUTIL"; then
6733 compiler_plugins=test
6737 if test "$compiler_plugins" != "no"; then
6738 dnl The prefix where Clang resides, override to where Clang resides if
6739 dnl using a source build:
6740 if test -z "$CLANGDIR"; then
6744 save_CPPFLAGS=$CPPFLAGS
6746 # compiler plugins must be built with "native" bitness of clang
6747 # because they link against clang libraries
6748 CXX=`echo $CXX | sed -e s/-m64// -e s/-m32//`
6749 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include -I$CLANGDIR/tools/clang/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
6750 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
6751 [COMPILER_PLUGINS=TRUE],
6753 if test "$compiler_plugins" = "yes"; then
6754 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
6756 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
6757 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
6761 CPPFLAGS=$save_CPPFLAGS
6765 if test "$enable_compiler_plugins" = "yes"; then
6766 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
6769 AC_SUBST(COMPILER_PLUGINS)
6772 # Plugin to help linker.
6773 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
6774 # This makes --enable-lto build with clang work.
6777 dnl ===================================================================
6779 dnl ===================================================================
6780 AC_MSG_CHECKING([which memory allocator to use])
6781 if test "$with_alloc" = "system"; then
6782 AC_MSG_RESULT([system])
6785 if test "$with_alloc" = "tcmalloc"; then
6786 AC_MSG_RESULT(tcmalloc)
6787 if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
6788 AC_MSG_ERROR([tcmalloc only available/usable on ix86])
6790 AC_CHECK_LIB([tcmalloc], [malloc], [:],
6791 [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
6794 if test "$with_alloc" = "jemalloc"; then
6795 if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
6796 AC_MSG_RESULT(jemalloc)
6798 CFLAGS="$CFLAGS -pthread"
6799 AC_CHECK_LIB([jemalloc], [malloc], [:],
6800 [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
6804 AC_MSG_RESULT([system])
6808 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
6809 AC_MSG_RESULT([internal])
6811 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6812 AC_SUBST(HAVE_POSIX_FALLOCATE)
6815 dnl ===================================================================
6816 dnl Custom build version
6817 dnl ===================================================================
6819 AC_MSG_CHECKING([whether to add custom build version])
6820 if test "$with_build_version" != ""; then
6821 BUILD_VER_STRING=$with_build_version
6822 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6827 AC_SUBST(BUILD_VER_STRING)
6829 JITC_PROCESSOR_TYPE=""
6830 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6831 # IBMs JDK needs this...
6832 JITC_PROCESSOR_TYPE=6
6833 export JITC_PROCESSOR_TYPE
6835 AC_SUBST([JITC_PROCESSOR_TYPE])
6837 # Misc Windows Stuff
6838 if test $_os = "WINNT" -a "$WITH_MINGW" != yes; then
6841 MSVC_DLL_PATH="$msvcdllpath"
6842 MSVC_DLLS="$msvcdlls"
6844 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6847 AC_SUBST(MSVC_DLL_PATH)
6851 dnl ===================================================================
6853 dnl ===================================================================
6854 if test "$ENABLE_JAVA" != ""; then
6856 # Windows-specific tests
6857 if test "$build_os" = "cygwin"; then
6858 if test "$BITNESS_OVERRIDE" = 64; then
6864 if test -z "$with_jdk_home"; then
6865 for ver in 1.8 1.7 1.6; do
6866 reg_get_value_$bitness "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
6867 if test -n "$regvalue"; then
6872 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
6873 with_jdk_home="$_jdk_home"
6874 howfound="found automatically"
6876 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
6879 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
6880 howfound="you passed"
6884 # 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.
6885 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
6886 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
6887 with_jdk_home=`/usr/libexec/java_home`
6890 JAVA_HOME=; export JAVA_HOME
6891 if test -z "$with_jdk_home"; then
6892 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
6894 _java_path="$with_jdk_home/bin/$with_java"
6895 dnl Check if there is a Java interpreter at all.
6896 if test -x "$_java_path"; then
6897 JAVAINTERPRETER=$_java_path
6899 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
6903 if test "$build_os" = "cygwin"; then
6904 # Check that the JDK found is correct architecture
6905 # Why is this necessary, we don't link with any library from the JDK I think,
6907 shortjdkhome=`cygpath -d "$with_jdk_home"`
6908 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
6909 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
6910 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6911 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
6912 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6913 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6916 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6917 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6919 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
6920 elif test $_os = Darwin -a "$BITNESS_OVERRIDE" = ""; then
6921 dnl HACK: There currently is only a 32 bit version of LibreOffice for Mac OS X,
6922 dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
6923 dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
6924 AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
6925 if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
6926 AC_MSG_RESULT([yes])
6931 elif test "$cross_compiling" != "yes"; then
6932 # at least 2 reasons to check: officebean needs to link -ljawt,
6933 # and libjpipe.so needs to be loaded by java to run JunitTests.
6935 AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64)
6936 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
6937 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
6938 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6941 *) # assumption: everything else 32-bit
6942 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
6943 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6944 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6952 dnl ===================================================================
6954 dnl ===================================================================
6956 # Note that JAVA_HOME as for now always means the *build* platform's
6957 # JAVA_HOME. Whether all the complexity here actually is needed any
6958 # more or not, no idea.
6960 if test "$ENABLE_JAVA" != ""; then
6962 AC_MSG_CHECKING([the installed JDK])
6963 if test -n "$JAVAINTERPRETER"; then
6964 dnl java -version sends output to stderr!
6965 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6966 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6967 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6969 AC_MSG_RESULT([checked (gcj)])
6970 _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
6971 _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6973 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6974 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6975 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6978 dnl IBM JDK specific tests
6979 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6980 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6982 if test "$_jdk_ver" -lt 10500; then
6983 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
6985 if test "$_jdk_ver" -ge 10600; then
6989 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6991 if test "$with_jdk_home" = ""; then
6992 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6993 you must use the "--with-jdk-home" configure option explicitly])
6996 JAVA_HOME=$with_jdk_home
7000 dnl Sun JDK specific tests
7001 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
7002 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
7004 if test "$_jdk_ver" -lt 10500; then
7005 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
7007 if test "$_jdk_ver" -gt 10600; then
7008 JAVA_CLASSPATH_NOT_SET="1"
7010 if test "$_jdk_ver" -ge 10600; then
7014 AC_MSG_RESULT([checked (JDK $_jdk)])
7015 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
7016 if test "$_os" = "WINNT"; then
7017 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
7021 AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
7025 JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
7027 AC_SUBST([HAVE_JAVA6])
7029 dnl ===================================================================
7030 dnl Set target Java bytecode version
7031 dnl ===================================================================
7032 if test "$ENABLE_JAVA" != ""; then
7033 _java_target_ver="1.5"
7035 JAVA_SOURCE_VER="$_java_target_ver"
7036 JAVA_TARGET_VER="$_java_target_ver"
7039 dnl ===================================================================
7040 dnl Checks for javac
7041 dnl ===================================================================
7042 if test "$ENABLE_JAVA" != ""; then
7043 if test "$JDK" = "gcj"; then
7044 javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
7046 javacompiler="javac"
7048 if test -z "$with_jdk_home"; then
7049 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
7051 _javac_path="$with_jdk_home/bin/$javacompiler"
7052 dnl Check if there is a Java compiler at all.
7053 if test -x "$_javac_path"; then
7054 JAVACOMPILER=$_javac_path
7057 if test -z "$JAVACOMPILER"; then
7058 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
7060 if test "$build_os" = "cygwin"; then
7061 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
7062 JAVACOMPILER="${JAVACOMPILER}.exe"
7064 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
7067 if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
7068 AC_MSG_CHECKING([re-checking JDK])
7070 AC_MSG_RESULT([checked (ecj)])
7071 _gij_longver="40200"
7076 dnl ===================================================================
7077 dnl Checks that javac is gcj
7078 dnl ===================================================================
7079 if test "$ENABLE_JAVA" != ""; then
7080 if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
7084 AC_SUBST(JAVACISGCJ)
7086 dnl ===================================================================
7087 dnl Checks for javadoc
7088 dnl ===================================================================
7089 if test "$ENABLE_JAVA" != ""; then
7090 if test -z "$with_jdk_home"; then
7091 AC_PATH_PROG(JAVADOC, javadoc)
7093 _javadoc_path="$with_jdk_home/bin/javadoc"
7094 dnl Check if there is a javadoc at all.
7095 if test -x "$_javadoc_path"; then
7096 JAVADOC=$_javadoc_path
7098 AC_PATH_PROG(JAVADOC, javadoc)
7101 if test -z "$JAVADOC"; then
7102 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
7104 if test "$build_os" = "cygwin"; then
7105 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
7106 JAVADOC="${JAVADOC}.exe"
7108 JAVADOC=`win_short_path_for_make "$JAVADOC"`
7111 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
7112 JAVADOCISGJDOC="yes"
7115 AC_SUBST(JAVADOCISGJDOC)
7117 if test "$ENABLE_JAVA" != ""; then
7118 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
7119 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
7120 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
7121 # try to recover first by looking whether we have a alternatives
7122 # system as in Debian or newer SuSEs where following /usr/bin/javac
7123 # over /etc/alternatives/javac leads to the right bindir where we
7124 # just need to strip a bit away to get a valid JAVA_HOME
7125 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7126 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7127 # maybe only one level of symlink (e.g. on Mac)
7128 JAVA_HOME=$(readlink $JAVACOMPILER)
7129 if test "$(dirname $JAVA_HOME)" = "."; then
7130 # we've got no path to trim back
7135 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7136 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7137 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7138 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7140 dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
7141 if test "$JAVA_HOME" != "/usr"; then
7142 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7143 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7144 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7145 dnl Tiger already returns a JDK path..
7146 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7148 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7152 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7154 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7155 if test -z "$JAVA_HOME"; then
7156 if test "x$with_jdk_home" = "x"; then
7157 cat > findhome.java <<_ACEOF
7158 [import java.io.File;
7162 public static void main(String args[])
7164 String jrelocation = System.getProperty("java.home");
7165 File jre = new File(jrelocation);
7166 System.out.println(jre.getParent());
7170 AC_MSG_CHECKING([if javac works])
7171 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7172 AC_TRY_EVAL(javac_cmd)
7173 if test $? = 0 -a -f ./findhome.class; then
7174 AC_MSG_RESULT([javac works])
7176 echo "configure: javac test failed" >&5
7177 cat findhome.java >&5
7178 AC_MSG_ERROR([javac does not work - java projects will not build!])
7180 AC_MSG_CHECKING([if gij knows its java.home])
7181 JAVA_HOME=`$JAVAINTERPRETER findhome`
7182 if test $? = 0 -a "$JAVA_HOME" != ""; then
7183 AC_MSG_RESULT([$JAVA_HOME])
7185 echo "configure: java test failed" >&5
7186 cat findhome.java >&5
7187 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7189 # clean-up after ourselves
7190 rm -f ./findhome.java ./findhome.class
7192 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7196 dnl second sanity check JAVA_HOME if possible
7197 if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
7198 # now check if $JAVA_HOME is really valid
7199 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7200 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7203 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7206 if test "$JAVA_HOME_OK" = "NO"; then
7207 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7208 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7209 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
7210 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7211 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7212 add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
7215 PathFormat "$JAVA_HOME"
7216 JAVA_HOME="$formatted_path"
7219 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7222 AC_MSG_CHECKING([for JAWT lib])
7223 if test "$_os" = WINNT; then
7224 if test "$WITH_MINGW" = yes; then
7225 # The path is taken care of in gb_LinkTarget__use_jawt
7226 # in RepositoryExternal.mk:
7229 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7253 my_java_arch=$host_cpu
7256 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7258 AC_MSG_RESULT([$JAWTLIB])
7262 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7266 JAVAINC="-I$JAVA_HOME/include"
7267 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7268 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7272 JAVAINC="-I$JAVA_HOME/include/win32"
7273 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7277 if test -d "$JAVA_HOME/include/darwin"; then
7278 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7280 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7285 JAVAINC="-I$JAVA_HOME/include"
7286 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7290 JAVAINC="-I$JAVA_HOME/include"
7291 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7292 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7293 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7294 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7298 JAVAINC="-I$JAVA_HOME/include"
7299 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7303 JAVAINC="-I$JAVA_HOME/include"
7304 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7305 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7309 JAVAINC="-I$JAVA_HOME/include"
7313 JAVAINC="-I$JAVA_HOME/include"
7314 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7315 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7319 JAVAINC="-I$JAVA_HOME/include"
7320 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7321 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7325 JAVAINC="-I$JAVA_HOME/include"
7326 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7327 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7331 SOLARINC="$SOLARINC $JAVAINC"
7333 AC_SUBST(JAVACOMPILER)
7335 AC_SUBST(JAVAINTERPRETER)
7336 AC_SUBST(JAVAIFLAGS)
7337 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7339 AC_SUBST(JAVA_SOURCE_VER)
7340 AC_SUBST(JAVA_TARGET_VER)
7343 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7344 if test -n "$with_idlc_cpp"; then
7345 AC_MSG_RESULT([$with_idlc_cpp])
7346 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7348 AC_MSG_RESULT([ucpp])
7349 AC_MSG_CHECKING([which ucpp tp use])
7350 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7351 AC_MSG_RESULT([external])
7352 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7354 AC_MSG_RESULT([internal])
7355 BUILD_TYPE="$BUILD_TYPE UCPP"
7358 AC_SUBST(SYSTEM_UCPP)
7360 dnl ===================================================================
7361 dnl Check for epm (not needed for Windows)
7362 dnl ===================================================================
7363 AC_MSG_CHECKING([whether to enable EPM for packing])
7364 if test "$enable_epm" = "yes"; then
7365 AC_MSG_RESULT([yes])
7366 if test "$_os" != "WINNT"; then
7367 if test $_os = Darwin; then
7369 elif test -n "$with_epm"; then
7372 AC_PATH_PROG(EPM, epm, no)
7374 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7375 echo "EPM will be built."
7376 BUILD_TYPE="$BUILD_TYPE EPM"
7377 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7379 # Gentoo has some epm which is something different...
7380 AC_MSG_CHECKING([whether the found epm is the right epm])
7381 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7382 AC_MSG_RESULT([yes])
7384 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7386 AC_MSG_CHECKING([epm version])
7387 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7388 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7389 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7390 AC_MSG_RESULT([OK, >= 3.7])
7392 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7393 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7398 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7399 AC_MSG_CHECKING([for rpm])
7400 for a in "$RPM" rpmbuild rpm; do
7401 $a --usage >/dev/null 2> /dev/null
7402 if test $? -eq 0; then
7406 $a --version >/dev/null 2> /dev/null
7407 if test $? -eq 0; then
7413 if test -z "$RPM"; then
7414 AC_MSG_ERROR([not found])
7415 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7416 RPM_PATH=`which $RPM`
7417 AC_MSG_RESULT([$RPM_PATH])
7418 SCPDEFS="$SCPDEFS -DWITH_RPM"
7420 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7423 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7424 AC_PATH_PROG(DPKG, dpkg, no)
7425 if test "$DPKG" = "no"; then
7426 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7429 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7430 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7431 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7432 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7433 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7434 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
7435 AC_MSG_RESULT([yes])
7438 if echo "$PKGFORMAT" | $GREP -q rpm; then
7440 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7441 add_warning "the rpms will need to be installed with --nodeps"
7445 AC_MSG_WARN([the ${_pt}s will not be relocateable])
7446 add_warning "the ${_pt}s will not be relocateable"
7447 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7448 relocation will work, you need to patch your epm with the
7449 patch in epm/epm-3.7.patch or build with
7450 --with-epm=internal which will build a suitable epm])
7455 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7456 AC_PATH_PROG(PKGMK, pkgmk, no)
7457 if test "$PKGMK" = "no"; then
7458 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7465 for i in $PKGFORMAT; do
7467 aix | bsd | deb | pkg | rpm | native | portable)
7469 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7478 dnl ===================================================================
7479 dnl We need winegcc when building MinGW build to be able to cross-build msi tools
7480 dnl ===================================================================
7482 if test "$enable_winegcc" = "yes"; then
7483 AC_PATH_PROG(WINEGCC, winegcc)
7484 if test "$WINEGCC" = ""; then
7485 AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
7488 ac_exeext_save="$ac_exeext"
7491 AC_LINK_IFELSE([AC_LANG_PROGRAM([
7494 printf ("hello world\n");
7496 [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
7499 ac_exeext="$ac_exeext_save"
7503 if test $_os = iOS; then
7504 enable_mpl_subset=yes
7506 enable_lotuswordpro=no
7509 enable_postgresql_sdbc=no
7510 enable_extension_integration=no
7511 enable_report_builder=no
7517 if test "$enable_lotuswordpro" = "yes"; then
7519 SCPDEFS="$SCPDEFS -DDISABLE_LWP"
7521 AC_SUBST(ENABLE_LWP)
7523 dnl ===================================================================
7525 dnl ===================================================================
7526 AC_PATH_PROG(GPERF, gperf)
7527 if test -z "$GPERF"; then
7528 AC_MSG_ERROR([gperf not found but needed. Install it.])
7530 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
7531 GPERF=`cygpath -m $GPERF`
7533 AC_MSG_CHECKING([gperf version])
7534 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
7537 AC_MSG_ERROR([too old, you need at least 3.0.0])
7541 dnl ===================================================================
7542 dnl Check for building ODK
7543 dnl ===================================================================
7544 if test "$enable_odk" = no; then
7547 if test "$with_doxygen" = no; then
7548 AC_MSG_CHECKING([for doxygen])
7552 if test "$with_doxygen" = yes; then
7553 AC_PATH_PROG([DOXYGEN], [doxygen])
7554 if test -z "$DOXYGEN"; then
7555 if test "$enable_odk" = "" ; then
7558 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7562 AC_MSG_CHECKING([for doxygen])
7563 DOXYGEN=$with_doxygen
7564 AC_MSG_RESULT([$DOXYGEN])
7566 if test -n "$DOXYGEN"; then
7567 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7568 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7569 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7570 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7577 AC_MSG_CHECKING([whether to build the ODK])
7578 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7579 AC_MSG_RESULT([yes])
7581 if test "$with_java" != "no"; then
7582 AC_MSG_CHECKING([whether to build unowinreg.dll])
7583 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7584 # build on Win by default
7585 enable_build_unowinreg=yes
7587 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7591 AC_MSG_RESULT([yes])
7592 BUILD_UNOWINREG=TRUE
7594 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7595 if test -z "$with_mingw_cross_compiler"; then
7597 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7598 elif test -x "$with_mingw_cross_compiler"; then
7599 MINGWCXX="$with_mingw_cross_compiler"
7601 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7604 if test "$MINGWCXX" = "false"; then
7605 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7608 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7609 if test -x "$mingwstrip_test"; then
7610 MINGWSTRIP="$mingwstrip_test"
7612 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7615 if test "$MINGWSTRIP" = "false"; then
7616 AC_MSG_ERROR(MinGW32 binutils not found.)
7620 BUILD_TYPE="$BUILD_TYPE ODK"
7625 AC_SUBST(BUILD_UNOWINREG)
7627 AC_SUBST(MINGWSTRIP)
7629 dnl ===================================================================
7630 dnl Check for system zlib
7631 dnl ===================================================================
7632 if test "$with_system_zlib" = "auto"; then
7635 with_system_zlib="$with_system_libs"
7638 with_system_zlib=yes
7643 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
7644 dnl and has no pkg-config for it at least on some tinderboxes,
7645 dnl so leaving that out for now
7646 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7647 AC_MSG_CHECKING([which zlib to use])
7648 if test "$with_system_zlib" = "yes"; then
7649 AC_MSG_RESULT([external])
7651 AC_CHECK_HEADER(zlib.h, [],
7652 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7653 AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
7654 [AC_MSG_ERROR(zlib not found or functional)], [])
7656 AC_MSG_RESULT([internal])
7658 BUILD_TYPE="$BUILD_TYPE ZLIB"
7659 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7662 AC_SUBST(ZLIB_CFLAGS)
7664 AC_SUBST(SYSTEM_ZLIB)
7666 dnl ===================================================================
7667 dnl Check for system jpeg
7668 dnl ===================================================================
7669 AC_MSG_CHECKING([which jpeg to use])
7670 if test "$with_system_jpeg" = "auto"; then
7672 WINNT|Darwin|iOS|Android)
7673 with_system_jpeg="$with_system_libs"
7676 with_system_jpeg=yes
7681 if test "$with_system_jpeg" = "yes"; then
7682 AC_MSG_RESULT([external])
7684 AC_CHECK_HEADER(jpeglib.h, [],
7685 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7686 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
7687 [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
7688 libo_MINGW_CHECK_DLL([libjpeg])
7690 AC_MSG_RESULT([internal])
7692 BUILD_TYPE="$BUILD_TYPE JPEG"
7694 AC_SUBST(SYSTEM_JPEG)
7697 dnl ===================================================================
7698 dnl Check for system clucene
7699 dnl ===================================================================
7700 dnl we should rather be using
7701 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
7702 dnl but the contribs-lib check seems tricky
7703 AC_MSG_CHECKING([which clucene to use])
7704 if test "$with_system_clucene" = "yes"; then
7705 AC_MSG_RESULT([external])
7707 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
7708 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
7710 save_CXXFLAGS=$CXXFLAGS
7711 save_CPPFLAGS=$CPPFLAGS
7712 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
7713 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
7714 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
7715 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
7716 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
7717 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
7718 CXXFLAGS=$save_CXXFLAGS
7719 CPPFLAGS=$save_CPPFLAGS
7722 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
7724 AC_MSG_RESULT([internal])
7726 BUILD_TYPE="$BUILD_TYPE CLUCENE"
7728 AC_SUBST(SYSTEM_CLUCENE)
7729 AC_SUBST(CLUCENE_CFLAGS)
7730 AC_SUBST(CLUCENE_LIBS)
7732 dnl ===================================================================
7733 dnl Check for system expat
7734 dnl ===================================================================
7735 dnl we should use libo_CHECK_SYSTEM_MODULE, but e.g. the mingw tinderbox has no
7736 dnl proper pkg-config for it. It should really be fixed on the tinderbox though.
7737 AC_MSG_CHECKING([which expat to use])
7738 if test "$with_system_expat" = "yes"; then
7739 AC_MSG_RESULT([external])
7741 AC_CHECK_HEADER(expat.h, [],
7742 [AC_MSG_ERROR(expat.h not found. install expat)], [])
7743 AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
7744 [AC_MSG_RESULT(expat library not found or functional.)], [])
7745 libo_MINGW_CHECK_DLL([libexpat])
7747 AC_MSG_RESULT([internal])
7749 BUILD_TYPE="$BUILD_TYPE EXPAT"
7751 AC_SUBST(SYSTEM_EXPAT)
7753 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
7754 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
7756 AC_DEFINE([ENABLE_EOT])
7757 AC_MSG_RESULT([yes])
7759 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
7764 AC_SUBST([ENABLE_EOT])
7766 dnl ===================================================================
7767 dnl Check for system librevenge
7768 dnl ===================================================================
7769 AS_IF([test "$COM" = "MSC"],
7770 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
7771 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
7773 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
7775 dnl ===================================================================
7776 dnl Check for system libe-book
7777 dnl ===================================================================
7778 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1 >= 0.1.1])
7780 dnl ===================================================================
7781 dnl Check for system libetonyek
7782 dnl ===================================================================
7783 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1 >= 0.1.1])
7785 dnl ===================================================================
7786 dnl Check for system libfreehand
7787 dnl ===================================================================
7788 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
7790 dnl ===================================================================
7791 dnl Check for system libodfgen
7792 dnl ===================================================================
7793 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
7795 dnl ===================================================================
7796 dnl Check for system libcdr
7797 dnl ===================================================================
7798 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
7800 dnl ===================================================================
7801 dnl Check for system libmspub
7802 dnl ===================================================================
7803 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
7805 dnl ===================================================================
7806 dnl Check for system libmwaw
7807 dnl ===================================================================
7808 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
7810 dnl ===================================================================
7811 dnl Check for system libpagemaker
7812 dnl ===================================================================
7813 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
7815 dnl ===================================================================
7816 dnl Check for system libvisio
7817 dnl ===================================================================
7818 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
7820 dnl ===================================================================
7821 dnl Check for system libcmis
7822 dnl ===================================================================
7823 # libcmis requires curl and we can't build curl for iOS
7824 if test $_os != iOS; then
7825 libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.4 >= 0.4.0])
7830 AC_SUBST(ENABLE_CMIS)
7832 dnl ===================================================================
7833 dnl Check for system libwpd
7834 dnl ===================================================================
7835 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs -lwpd-0.10"])
7837 dnl ===================================================================
7838 dnl Check for system lcms2
7839 dnl ===================================================================
7840 if test "$with_system_lcms2" = "yes"; then
7841 libo_MINGW_CHECK_DLL([liblcms2])
7845 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
7846 if test "$GCC" = "yes"; then
7847 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7849 if test "$COM" = "MSC"; then # override the above
7850 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
7853 dnl ===================================================================
7854 dnl Check for system cppunit
7855 dnl ===================================================================
7856 if test "$cross_compiling" != "yes"; then
7857 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.12.0])
7860 dnl ===================================================================
7861 dnl Check whether freetype is available
7862 dnl ===================================================================
7863 if test "$test_freetype" = "yes"; then
7864 AC_MSG_CHECKING([whether freetype is available])
7865 # FreeType has 3 different kinds of versions
7866 # * release, like 2.4.10
7867 # * libtool, like 13.0.7 (this what pkg-config returns)
7869 # FreeType's docs/VERSION.DLL provides a table mapping between the three
7872 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
7873 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7874 SYSTEM_FREETYPE=TRUE
7876 _save_cflags="$CFLAGS"
7877 LIBS="$LIBS $FREETYPE_LIBS"
7878 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
7879 AC_CHECK_FUNC(FT_Face_GetCharVariantIndex, AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX), [])
7881 CFLAGS="$_save_cflags"
7883 AC_SUBST(FREETYPE_CFLAGS)
7884 AC_SUBST(FREETYPE_LIBS)
7885 AC_SUBST([SYSTEM_FREETYPE])
7887 dnl ===================================================================
7888 dnl Check for system libabw
7889 dnl ===================================================================
7890 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
7892 dnl ===================================================================
7893 dnl Check for system libwps
7894 dnl ===================================================================
7895 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.3])
7897 dnl ===================================================================
7898 dnl Check for system libwpg
7899 dnl ===================================================================
7900 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
7902 # ===================================================================
7903 # Check for system libxslt
7904 # to prevent incompatibilities between internal libxml2 and external libxslt,
7905 # or vice versa, use with_system_libxml here
7906 # ===================================================================
7907 if test "$with_system_libxml" = "auto"; then
7910 with_system_libxml="$with_system_libs"
7913 with_system_libxml=yes
7918 AC_MSG_CHECKING([which libxslt to use])
7919 if test "$with_system_libxml" = "yes"; then
7920 AC_MSG_RESULT([external])
7922 if test "$_os" = "Darwin"; then
7923 dnl make sure to use SDK path
7924 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7925 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
7927 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
7928 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
7930 PKG_CHECK_MODULES(LIBXSLT, libxslt)
7931 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7932 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
7933 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7936 dnl Check for xsltproc
7937 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7938 if test "$XSLTPROC" = "no"; then
7939 AC_MSG_ERROR([xsltproc is required])
7942 libo_MINGW_CHECK_DLL([libxslt])
7943 libo_MINGW_CHECK_DLL([libexslt])
7944 libo_MINGW_TRY_DLL([iconv])
7946 AC_MSG_RESULT([internal])
7948 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
7950 if test "$cross_compiling" = "yes"; then
7951 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7952 if test "$XSLTPROC" = "no"; then
7953 AC_MSG_ERROR([xsltproc is required])
7957 AC_SUBST(SYSTEM_LIBXSLT)
7958 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
7959 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
7961 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
7963 AC_SUBST(LIBEXSLT_CFLAGS)
7964 AC_SUBST(LIBEXSLT_LIBS)
7965 AC_SUBST(LIBXSLT_CFLAGS)
7966 AC_SUBST(LIBXSLT_LIBS)
7969 # ===================================================================
7970 # Check for system libxml
7971 # ===================================================================
7972 AC_MSG_CHECKING([which libxml to use])
7973 if test "$with_system_libxml" = "yes"; then
7974 AC_MSG_RESULT([external])
7976 if test "$_os" = "Darwin"; then
7977 dnl make sure to use SDK path
7978 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7980 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
7981 elif test $_os = iOS; then
7982 dnl make sure to use SDK path
7983 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
7984 LIBXML_CFLAGS="-I$usr/include/libxml2"
7985 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
7987 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
7988 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7991 dnl Check for xmllint
7992 AC_PATH_PROG(XMLLINT, xmllint, no)
7993 if test "$XMLLINT" = "no"; then
7994 AC_MSG_ERROR([xmllint is required])
7997 libo_MINGW_CHECK_DLL([libxml2])
7998 libo_MINGW_TRY_DLL([zlib1])
8000 AC_MSG_RESULT([internal])
8002 BUILD_TYPE="$BUILD_TYPE LIBXML2"
8004 AC_SUBST(SYSTEM_LIBXML)
8005 AC_SUBST(LIBXML_CFLAGS)
8006 AC_SUBST(LIBXML_LIBS)
8009 # =====================================================================
8010 # Checking for a Python interpreter with version >= 2.6.
8011 # Build and runtime requires Python 3 compatible version (>= 2.6).
8012 # Optionally user can pass an option to configure, i. e.
8013 # ./configure PYTHON=/usr/bin/python
8014 # =====================================================================
8015 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
8016 # This allows a lack of system python with no error, we use internal one in that case.
8017 AM_PATH_PYTHON([2.6],, [:])
8018 # Clean PYTHON_VERSION checked below if cross-compiling
8020 if test "$PYTHON" != ":"; then
8021 PYTHON_FOR_BUILD=$PYTHON
8024 AC_SUBST(PYTHON_FOR_BUILD)
8026 # Checks for Python to use for Pyuno
8027 AC_MSG_CHECKING([which Python to use for Pyuno])
8028 case "$enable_python" in
8030 if test -z $PYTHON_FOR_BUILD; then
8031 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8032 # requirement from the choice whether to include Python stuff in the installer, but why
8034 AC_MSG_ERROR([Python is required at build time.])
8037 AC_MSG_RESULT([none])
8040 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8041 AC_MSG_RESULT([no, overridden by --disable-scripting])
8043 elif test $build_os = cygwin; then
8044 dnl When building on Windows we don't attempt to use any installed
8045 dnl "system" Python.
8047 dnl (When cross-compiling to Windows from Linux using the mingw32-cross
8048 dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
8049 dnl MinGW cross-compilation setups.)
8050 AC_MSG_RESULT([fully internal])
8051 enable_python=internal
8052 elif test "$cross_compiling" = yes; then
8053 AC_MSG_RESULT([system])
8054 enable_python=system
8056 # Unset variables set by the above AM_PATH_PYTHON so that
8057 # we actually do check anew.
8058 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
8059 AM_PATH_PYTHON([3.3],, [:])
8060 if test "$PYTHON" = ":"; then
8061 if test -z "$PYTHON_FOR_BUILD"; then
8062 AC_MSG_RESULT([fully internal])
8064 AC_MSG_RESULT([internal])
8066 enable_python=internal
8068 AC_MSG_RESULT([system])
8069 enable_python=system
8074 AC_MSG_RESULT([internal])
8077 AC_MSG_RESULT([fully internal])
8078 enable_python=internal
8081 AC_MSG_RESULT([system])
8084 AC_MSG_ERROR([Incorrect --enable-python option])
8088 if test $enable_python != no; then
8089 BUILD_TYPE="$BUILD_TYPE PYUNO"
8092 if test $enable_python = system; then
8093 if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
8094 # Make sure we use the 2.6 Python when building against the
8096 case $with_macosx_sdk in
8098 python_version=2.6;;
8100 python_version=2.7;;
8103 python_version=2.7;;
8105 PYTHON=python$python_version
8106 if test -d "$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"; then
8107 PYTHON_CFLAGS="-I$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"
8108 PYTHON_LIBS="-framework Python"
8110 PYTHON_CFLAGS="`$PYTHON-config --includes`"
8111 PYTHON_LIBS="`$PYTHON-config --libs`"
8114 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8115 # Fallback: Accept these in the environment, or as set above
8118 elif test "$cross_compiling" != yes; then
8119 # Unset variables set by the above AM_PATH_PYTHON so that
8120 # we actually do check anew.
8121 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
8122 # This causes an error if no python command is found
8123 AM_PATH_PYTHON([3.3])
8124 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8125 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8126 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8127 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8128 if test -z "$PKG_CONFIG"; then
8129 PYTHON_CFLAGS="-I$python_include"
8130 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8131 elif $PKG_CONFIG --exists python-$python_version; then
8132 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8133 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8135 PYTHON_CFLAGS="-I$python_include"
8136 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8139 dnl How to find out the cross-compilation Python installation path?
8140 dnl Let's hardocode what we know for different distributions for now...
8141 for python_version in 2.6; do
8142 if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
8143 PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
8144 PYTHON_LIBS="-L${MINGW_SYSROOT}/lib -lpython$python_version $python_libs"
8145 AC_MSG_CHECKING([for python.exe])
8146 libo_MINGW_CHECK_DLL([libpython$python_version])
8147 libo_MINGW_CHECK_DLL([libreadline6])
8148 libo_MINGW_CHECK_DLL([libtermcap])
8149 # could we somehow extract the really mingw python version from
8150 # actual distro package?
8151 # 2.6.2 currently on OpenSUSE 12.1?
8152 # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
8153 PYTHON_VERSION=$python_version.2
8154 PYTHON_VERSION_MAJOR=`echo $python_version | cut -d . -f 1`
8155 PYTHON_VERSION_MINOR=`echo $python_version | cut -d . -f 2`
8159 AC_MSG_CHECKING([for python version])
8160 AS_IF([test -n "$PYTHON_VERSION"],
8161 [AC_MSG_RESULT([$PYTHON_VERSION])],
8162 [AC_MSG_RESULT([not found])
8163 AC_MSG_ERROR([no usable python found])])
8164 test -n "$PYTHON_CFLAGS" && break
8166 # let the PYTHON_FOR_BUILD match the same python installation that
8167 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8168 # better for PythonTests.
8169 PYTHON_FOR_BUILD=$PYTHON
8172 dnl By now enable_python should be "system", "internal" or "no"
8173 case $enable_python in
8177 if test "$CROSS_COMPILING" != TRUE; then
8178 dnl Check if the headers really work
8179 save_CPPFLAGS="$CPPFLAGS"
8180 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8181 AC_CHECK_HEADER(Python.h, [],
8182 [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
8184 CPPFLAGS="$save_CPPFLAGS"
8187 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8188 AC_MSG_CHECKING([for correct python library version])
8189 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8192 int main(int argc, char **argv) {
8193 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
8194 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8197 ]])],[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])],[])
8201 dnl FIXME Check if the Python library can be linked with, too?
8207 PYTHON_VERSION_MAJOR=3
8208 PYTHON_VERSION_MINOR=3
8209 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.3
8210 BUILD_TYPE="$BUILD_TYPE PYTHON"
8211 # Embedded Python dies without Home set
8212 if test "$HOME" = ""; then
8215 # bz2 tarball and bzip2 is not standard
8216 if test -z "$BZIP2"; then
8217 AC_PATH_PROG( BZIP2, bzip2)
8218 if test -z "$BZIP2"; then
8219 AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
8228 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8232 AC_SUBST(DISABLE_PYTHON)
8233 AC_SUBST(SYSTEM_PYTHON)
8234 AC_SUBST(PYTHON_CFLAGS)
8235 AC_SUBST(PYTHON_LIBS)
8236 AC_SUBST(PYTHON_VERSION)
8237 AC_SUBST(PYTHON_VERSION_MAJOR)
8238 AC_SUBST(PYTHON_VERSION_MINOR)
8240 AC_MSG_CHECKING([whether to build the MariaDB/MySQL Connector extension])
8241 if test "x$enable_ext_mariadb_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8242 AC_MSG_RESULT([yes])
8243 ENABLE_MARIADBC=TRUE
8247 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8252 AC_SUBST(ENABLE_MARIADBC)
8253 AC_SUBST(MARIADBC_MAJOR)
8254 AC_SUBST(MARIADBC_MINOR)
8255 AC_SUBST(MARIADBC_MICRO)
8257 if test "$ENABLE_MARIADBC" = "TRUE"; then
8259 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MARIADBC"
8261 dnl ===================================================================
8262 dnl Check for system MariaDB
8263 dnl ===================================================================
8264 AC_MSG_CHECKING([which MariaDB to use])
8265 if test "$with_system_mariadb" = "yes"; then
8266 AC_MSG_RESULT([external])
8268 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8269 if test -z "$MARIADBCONFIG"; then
8270 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8271 if test -z "$MARIADBCONFIG"; then
8272 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL package.])
8273 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8276 AC_MSG_CHECKING([MariaDB version])
8277 MARIADB_VERSION=`$MARIADBCONFIG --version`
8278 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8279 if test "$MARIADB_MAJOR" -ge "5"; then
8282 AC_MSG_ERROR([too old, use 5.0.x or later])
8284 AC_MSG_CHECKING([for MariaDB Client library])
8285 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8286 if test "$COM_GCC_IS_CLANG" = TRUE; then
8287 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8289 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8290 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8291 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8293 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8294 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8295 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8296 | sed -e 's|/lib64/|/lib/|')
8298 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8299 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8300 if test "$enable_bundle_mariadb" = "yes"; then
8301 AC_MSG_RESULT([yes])
8303 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\+-l/\n/g' | grep -E '(mysqlclient|mariadb)')
8304 if test "$_os" = "Darwin"; then
8305 LIBMARIADB=${LIBMARIADB}.dylib
8306 elif test "$_os" = "WINNT"; then
8307 LIBMARIADB=${LIBMARIADB}.dll
8309 LIBMARIADB=${LIBMARIADB}.so
8311 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8312 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8313 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8314 AC_MSG_RESULT([found.])
8315 PathFormat "$LIBMARIADB_PATH"
8316 LIBMARIADB_PATH="$formatted_path"
8318 AC_MSG_ERROR([not found.])
8325 AC_MSG_RESULT([internal])
8326 AC_MSG_ERROR([libmariadb is known to be broken as of 2013-10; use libmysqlclient])
8328 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb/include"
8329 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadblib"
8330 BUILD_TYPE="$BUILD_TYPE MARIADB"
8333 AC_SUBST(SYSTEM_MARIADB)
8334 AC_SUBST(MARIADB_CFLAGS)
8335 AC_SUBST(MARIADB_LIBS)
8336 AC_SUBST(LIBMARIADB)
8337 AC_SUBST(LIBMARIADB_PATH)
8338 AC_SUBST(BUNDLE_MARIADB)
8341 dnl ===================================================================
8342 dnl Check for system MySQL C++ Connector
8343 dnl ===================================================================
8345 # who thought this too-generic cppconn dir was a good idea?
8346 AC_MSG_CHECKING([MySQL Connector/C++])
8347 if test "$with_system_mysql_cppconn" = "yes"; then
8348 AC_MSG_RESULT([external])
8349 SYSTEM_MYSQL_CPPCONN=TRUE
8351 AC_CHECK_HEADER(mysql_driver.h, [],
8352 [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
8353 AC_CHECK_LIB([mysqlcppconn], [main], [:],
8354 [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
8356 LIBS="$LIBS -lmysqlcppconn"
8357 AC_MSG_CHECKING([version])
8358 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8359 #include <mysql_driver.h>
8361 int main(int argc, char **argv) {
8362 sql::Driver *driver;
8363 driver = get_driver_instance();
8364 if (driver->getMajorVersion() > 1 || \
8365 (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
8366 (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
8371 ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
8376 AC_MSG_RESULT([internal])
8377 BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
8378 SYSTEM_MYSQL_CPPCONN=
8382 AC_SUBST(SYSTEM_MYSQL_CPPCONN)
8384 dnl ===================================================================
8385 dnl Check for system hsqldb
8386 dnl ===================================================================
8387 if test "$with_java" != "no"; then
8388 HSQLDB_USE_JDBC_4_1=
8389 AC_MSG_CHECKING([which hsqldb to use])
8390 if test "$with_system_hsqldb" = "yes"; then
8391 AC_MSG_RESULT([external])
8393 if test -z $HSQLDB_JAR; then
8394 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8396 AC_CHECK_FILE($HSQLDB_JAR, [],
8397 [AC_MSG_ERROR(hsqldb.jar not found.)], [])
8398 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8402 my $file = "$ENV{'HSQLDB_JAR'}";
8403 my $zip = Archive::Zip->new( $file );
8404 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8405 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8407 push @l, split(/\n/, $mf);
8408 foreach my $line (@l)
8410 if ($line =~ m/Specification-Version:/)
8412 ($t, $version) = split (/:/,$line);
8413 $version =~ s/^\s//;
8414 ($a, $b, $c, $d) = split (/\./,$version);
8415 if ($c == "0" && $d > "8")
8430 AC_MSG_RESULT([yes])
8432 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8435 AC_MSG_RESULT([internal])
8437 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8438 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8439 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8440 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8441 AC_MSG_RESULT([yes])
8442 HSQLDB_USE_JDBC_4_1=TRUE
8447 AC_SUBST(SYSTEM_HSQLDB)
8448 AC_SUBST(HSQLDB_JAR)
8449 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8452 dnl ===================================================================
8453 dnl Check for PostgreSQL stuff
8454 dnl ===================================================================
8455 if test "x$enable_postgresql_sdbc" != "xno"; then
8456 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8458 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8459 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8461 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8462 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8465 AC_MSG_CHECKING([PostgreSQL C interface])
8466 if test "$with_system_postgresql" = "yes"; then
8467 AC_MSG_RESULT([external PostgreSQL])
8468 SYSTEM_POSTGRESQL=TRUE
8469 if test "$_os" = Darwin; then
8471 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8472 pg_supp_path="$P_SEP$d$pg_supp_path"
8475 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8476 if test -z "$PGCONFIG"; then
8477 AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
8479 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8480 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8482 # if/when anything else than PostgreSQL uses Kerberos,
8483 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8488 # MacOS X has system MIT Kerberos 5 since 10.4
8489 if test "$with_krb5" != "no"; then
8492 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8493 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
8496 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8497 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
8498 KRB5_LIBS="$KRB5_LIBS $LIBS"
8501 if test "$with_gssapi" != "no"; then
8504 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8505 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8511 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8512 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8515 Linux|GNU|*BSD|DragonFly)
8516 if test "$with_krb5" != "no"; then
8519 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8520 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8523 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8524 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8525 KRB5_LIBS="$KRB5_LIBS $LIBS"
8528 if test "$with_gssapi" != "no"; then
8531 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8532 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8538 if test "$with_krb5" = "yes"; then
8541 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8542 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8545 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8546 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8547 KRB5_LIBS="$KRB5_LIBS $LIBS"
8550 if test "$with_gssapi" = "yes"; then
8553 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8554 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8560 if test -n "$with_libpq_path"; then
8561 SYSTEM_POSTGRESQL=TRUE
8562 AC_MSG_RESULT([external libpq])
8563 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8564 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8567 AC_MSG_RESULT([internal])
8569 POSTGRESQL_INC="%OVERRIDE_ME%"
8570 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8573 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
8574 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8576 save_CPPFLAGS=$CPPFLAGS
8578 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8579 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8580 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8581 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8582 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8584 CPPFLAGS=$save_CPPFLAGS
8587 BUILD_POSTGRESQL_SDBC=TRUE
8590 AC_SUBST(WITH_GSSAPI)
8591 AC_SUBST(GSSAPI_LIBS)
8593 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8594 AC_SUBST(SYSTEM_POSTGRESQL)
8595 AC_SUBST(POSTGRESQL_INC)
8596 AC_SUBST(POSTGRESQL_LIB)
8598 dnl ===================================================================
8599 dnl Check for Firebird stuff
8600 dnl ===================================================================
8601 ENABLE_FIREBIRD_SDBC=""
8602 if test "x$enable_firebird_sdbc" = "xyes"; then
8603 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8605 dnl ===================================================================
8606 dnl Check for system Firebird
8607 dnl ===================================================================
8608 AC_MSG_CHECKING([which Firebird to use])
8609 if test "$with_system_firebird" = "yes"; then
8610 AC_MSG_RESULT([external])
8611 SYSTEM_FIREBIRD=TRUE
8612 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8613 if test -z "$FIREBIRDCONFIG"; then
8614 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8615 PKG_CHECK_MODULES(FIREBIRD, fbembed)
8616 FIREBIRD_VERSION=`pkg-config --modversion fbembed`
8618 AC_MSG_NOTICE([fb_config found])
8619 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8620 AC_MSG_CHECKING([for Firebird Client library])
8621 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8622 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8624 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8625 AC_MSG_CHECKING([Firebird version])
8626 if test -n "${FIREBIRD_VERSION}"; then
8627 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8628 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8629 if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5"; then
8632 AC_MSG_ERROR([Ensure firebird 2.5.x is installed])
8635 __save_CFLAGS="${CFLAGS}"
8636 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
8637 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
8638 #if defined(FB_API_VER) && FB_API_VER == 25
8640 #error "Wrong Firebird API version"
8641 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x is installed]))
8642 CFLAGS="${__save_CFLAGS}"
8644 ENABLE_FIREBIRD_SDBC="TRUE"
8645 elif test "$enable_database_connectivity" != yes; then
8646 AC_MSG_RESULT([none])
8647 elif test "$cross_compiling" = "yes"; then
8648 AC_MSG_RESULT([none])
8650 dnl We need libatomic-ops for any non X86/X64 system
8651 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
8652 dnl ===================================================================
8653 dnl Check for system libatomic-ops
8654 dnl ===================================================================
8655 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
8656 if test "$with_system_libatomic_ops" = "yes"; then
8657 SYSTEM_LIBATOMIC_OPS=TRUE
8658 AC_CHECK_HEADERS(atomic_ops.h, [],
8659 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
8661 SYSTEM_LIBATOMIC_OPS=
8662 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
8663 LIBATOMIC_OPS_LIBS="-latomic_ops"
8664 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
8668 AC_MSG_RESULT([internal])
8670 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/include"
8671 FIREBIRD_LIBS="-lfbembed"
8673 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
8674 ENABLE_FIREBIRD_SDBC="TRUE"
8677 AC_SUBST(ENABLE_FIREBIRD_SDBC)
8678 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
8679 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
8680 AC_SUBST(LIBATOMIC_OPS_LIBS)
8681 AC_SUBST(SYSTEM_FIREBIRD)
8682 AC_SUBST(FIREBIRD_CFLAGS)
8683 AC_SUBST(FIREBIRD_LIBS)
8684 dnl AC_SUBST([TOMMATH_CFLAGS])
8685 dnl AC_SUBST([TOMMATH_LIBS])
8687 dnl ===================================================================
8688 dnl Check for system curl
8689 dnl ===================================================================
8690 AC_MSG_CHECKING([which libcurl to use])
8691 if test "$with_system_curl" = "auto"; then
8692 with_system_curl="$with_system_libs"
8695 if test "$with_system_curl" = "yes"; then
8696 AC_MSG_RESULT([external])
8699 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
8701 # First try PKGCONFIG and then fall back
8702 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
8704 if test -n "$CURL_PKG_ERRORS"; then
8705 AC_PATH_PROG(CURLCONFIG, curl-config)
8706 if test -z "$CURLCONFIG"; then
8707 AC_MSG_ERROR([curl developement files not found])
8709 CURL_LIBS=`$CURLCONFIG --libs`
8710 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
8711 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
8713 case $curl_version in
8714 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
8715 dnl so they need to be doubled to end up in the configure script
8716 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
8719 AC_MSG_ERROR([no, you have $curl_version])
8723 AC_MSG_RESULT([yes])
8725 libo_MINGW_CHECK_DLL([libcurl])
8726 libo_MINGW_TRY_DLL([libintl])
8727 libo_MINGW_TRY_DLL([libidn])
8728 libo_MINGW_TRY_DLL([libnspr4])
8729 libo_MINGW_TRY_DLL([nssutil3])
8730 libo_MINGW_TRY_DLL([libplc4])
8731 libo_MINGW_TRY_DLL([libplds4])
8732 libo_MINGW_TRY_DLL([nss3])
8733 libo_MINGW_TRY_DLL([ssl3])
8734 libo_MINGW_TRY_DLL([libgpg-error])
8735 libo_MINGW_TRY_DLL([libgcrypt])
8736 libo_MINGW_TRY_DLL([libssh2])
8738 elif test $_os = iOS; then
8739 # Let's see if we need curl, I think not?
8740 AC_MSG_RESULT([none])
8743 AC_MSG_RESULT([internal])
8745 BUILD_TYPE="$BUILD_TYPE CURL"
8748 AC_SUBST(SYSTEM_CURL)
8749 AC_SUBST(CURL_CFLAGS)
8751 AC_SUBST(ENABLE_CURL)
8753 dnl ===================================================================
8754 dnl Check for system boost
8755 dnl ===================================================================
8756 AC_MSG_CHECKING([which boost to use])
8757 if test "$with_system_boost" = "yes"; then
8758 AC_MSG_RESULT([external])
8763 mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
8764 libo_MINGW_TRY_DLL([$mingw_boost_date_time_dll])
8765 if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
8766 # if not found, try again with 'lib' prefix
8767 libo_MINGW_CHECK_DLL([lib$mingw_boost_date_time_dll])
8770 save_CXXFLAGS=$CXXFLAGS
8771 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS"
8772 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
8773 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
8774 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
8775 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
8776 AC_CHECK_HEADER(boost/function.hpp, [],
8777 [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
8778 CXXFLAGS="$CXXFLAGS -fno-exceptions"
8779 AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
8780 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
8781 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
8782 if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
8783 AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
8785 AC_MSG_RESULT([yes])
8787 CXXFLAGS=$save_CXXFLAGS
8790 AC_MSG_RESULT([internal])
8791 BUILD_TYPE="$BUILD_TYPE BOOST"
8794 AC_SUBST(SYSTEM_BOOST)
8796 dnl ===================================================================
8797 dnl Check for system mdds
8798 dnl ===================================================================
8799 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds >= 0.10.3], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
8801 dnl ===================================================================
8802 dnl Check for system glm
8803 dnl ===================================================================
8804 AC_MSG_CHECKING([which glm to use])
8805 if test "$with_system_glm" = "yes"; then
8806 AC_MSG_RESULT([external])
8809 AC_CHECK_HEADER([glm/glm.hpp], [],
8810 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
8813 AC_MSG_RESULT([internal])
8814 BUILD_TYPE="$BUILD_TYPE GLM"
8817 AC_SUBST([SYSTEM_GLM])
8819 dnl ===================================================================
8820 dnl Check for system glew
8821 dnl ===================================================================
8822 libo_CHECK_SYSTEM_MODULE([glew], [GLEW], [glew >= 1.10.0])
8824 dnl ===================================================================
8825 dnl Check for system vigra
8826 dnl ===================================================================
8827 AC_MSG_CHECKING([which vigra to use])
8828 if test "$with_system_vigra" = "yes"; then
8829 AC_MSG_RESULT([external])
8832 AC_CHECK_HEADER(vigra/copyimage.hxx, [],
8833 [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
8836 AC_MSG_RESULT([internal])
8837 BUILD_TYPE="$BUILD_TYPE VIGRA"
8840 AC_SUBST(SYSTEM_VIGRA)
8842 dnl ===================================================================
8843 dnl Check for system odbc
8844 dnl ===================================================================
8845 AC_MSG_CHECKING([which odbc headers to use])
8846 if test "$with_system_odbc" = "yes" ; then
8847 AC_MSG_RESULT([external])
8848 SYSTEM_ODBC_HEADERS=TRUE
8850 AC_CHECK_HEADER(sqlext.h, [],
8851 [AC_MSG_ERROR(odbc not found. install odbc)], [])
8852 elif test "$enable_database_connectivity" != yes; then
8853 AC_MSG_RESULT([none])
8855 AC_MSG_RESULT([internal])
8856 SYSTEM_ODBC_HEADERS=
8858 AC_SUBST(SYSTEM_ODBC_HEADERS)
8861 dnl ===================================================================
8862 dnl Check for system openldap
8863 dnl ===================================================================
8865 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
8866 AC_MSG_CHECKING([which openldap library to use])
8867 if test "$with_system_openldap" = "yes"; then
8868 AC_MSG_RESULT([external])
8869 SYSTEM_OPENLDAP=TRUE
8870 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
8871 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8872 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8874 AC_MSG_RESULT([internal])
8876 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
8879 AC_SUBST(SYSTEM_OPENLDAP)
8881 dnl ===================================================================
8882 dnl Check for mozilla ab connectivity for windows
8883 dnl ===================================================================
8885 if test "$_os" = "WINNT"; then
8886 AC_MSG_CHECKING([whether to enable build of Mozilla addressbook connectivity driver for Windows])
8887 if test "$enable_win_mozab_driver" = "yes" -a "$WITH_MINGW" != "YES" ; then
8889 AC_MSG_RESULT([yes, internal (old windows mozab driver)])
8890 BUILD_TYPE="$BUILD_TYPE MOZ"
8891 MSVC80_DLLS="msvcp80.dll msvcr80.dll Microsoft.VC80.CRT.manifest"
8892 MSVC80_DLL_PATH=`cygpath -u "$TARFILE_LOCATION"`
8893 for dll in $MSVC80_DLLS; do
8894 if ! test -f "$MSVC80_DLL_PATH/$dll"; then
8895 AC_MSG_ERROR([can not find $dll in $MSVC80_DLL_PATH needed for the pre-built Mozilla libraries])
8903 AC_SUBST(WITH_MOZAB4WIN)
8904 AC_SUBST(MSVC80_DLLS)
8905 AC_SUBST(MSVC80_DLL_PATH)
8907 dnl ===================================================================
8908 dnl Check for TLS/SSL and cryptographic implementation to use
8909 dnl ===================================================================
8910 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
8911 if test -n "$with_tls"; then
8914 AC_DEFINE(USE_TLS_OPENSSL)
8917 if test "$enable_openssl" != "yes"; then
8918 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
8921 # warn that OpenSSL has been selected but not all TLS code has this option
8922 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS])
8923 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS"
8926 AC_DEFINE(USE_TLS_NSS)
8930 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
8932 nss - Mozilla's Network Security Services (NSS)
8936 elif test $_os = iOS -o $_os = Android; then
8937 # We don't build NSS for iOS and Android
8938 AC_DEFINE(USE_TLS_OPENSSL)
8941 # default to using NSS, it results in smaller oox lib
8942 AC_DEFINE(USE_TLS_NSS)
8945 AC_MSG_RESULT([$TLS])
8948 dnl ===================================================================
8949 dnl Check for system NSS
8950 dnl ===================================================================
8951 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
8952 if test "$with_system_nss" = "yes"; then
8953 libo_MINGW_CHECK_DLL([libnspr4])
8954 libo_MINGW_CHECK_DLL([libplc4])
8955 libo_MINGW_CHECK_DLL([libplds4])
8956 libo_MINGW_CHECK_DLL([nss3])
8957 libo_MINGW_CHECK_DLL([nssutil3])
8958 libo_MINGW_CHECK_DLL([smime3])
8959 libo_MINGW_CHECK_DLL([ssl3])
8962 dnl ===================================================================
8963 dnl Check for system mozilla headers
8964 dnl ===================================================================
8965 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
8966 AC_MSG_CHECKING([which NPAPI headers to use])
8968 if test "$with_system_npapi_headers" = "yes"; then
8969 AC_MSG_RESULT([external])
8970 SYSTEM_NPAPI_HEADERS=TRUE
8971 # First try npapi-sdk:
8972 PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
8973 # Then go with libxul:
8974 if test "x$LOCATED" != "xyes"; then
8975 PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
8977 if test "x$LOCATED" != "xyes"; then
8978 PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
8980 # if still not found bail out
8981 if test "x$LOCATED" != "xyes"; then
8982 AC_MSG_ERROR([npapi.h header file not found])
8987 CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS"
8988 AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
8993 const char* NPP_GetMIMEDescription(void) { return "foo"; }
8995 [AC_MSG_RESULT([const char*])],
8997 AC_MSG_RESULT([char*])
8998 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
9002 NPAPI_HEADERS_CFLAGS=$(printf '%s' "$NPAPI_HEADERS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9004 AC_MSG_RESULT([internal])
9005 dnl ...but will not be built/used unless ENABLE_NPAPI_FROM_BROWSER or
9006 dnl ENABLE_NPAPI_INTO_BROWSER is TRUE
9007 SYSTEM_NPAPI_HEADERS=
9009 AC_SUBST(NPAPI_HEADERS_CFLAGS)
9010 AC_SUBST(SYSTEM_NPAPI_HEADERS)
9011 AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
9013 dnl ===================================================================
9014 dnl Check for system sane
9015 dnl ===================================================================
9016 AC_MSG_CHECKING([which sane header to use])
9017 if test "$with_system_sane" = "yes"; then
9018 AC_MSG_RESULT([external])
9019 AC_CHECK_HEADER(sane/sane.h, [],
9020 [AC_MSG_ERROR(sane not found. install sane)], [])
9022 AC_MSG_RESULT([internal])
9023 BUILD_TYPE="$BUILD_TYPE SANE"
9026 dnl ===================================================================
9027 dnl Check for system icu
9028 dnl ===================================================================
9035 ICU_RECLASSIFIED_CLOSE_PARENTHESIS="TRUE"
9036 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9037 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9038 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9039 AC_MSG_CHECKING([which icu to use])
9040 if test "$with_system_icu" = "yes"; then
9041 AC_MSG_RESULT([external])
9044 AC_MSG_CHECKING([for unicode/rbbi.h])
9045 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
9048 if test "$cross_compiling" != "yes" -o "$WITH_MINGW" = "yes"; then
9050 if test "$WITH_MINGW" = "yes"; then
9051 ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
9053 AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
9055 AC_MSG_CHECKING([ICU version])
9056 ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
9057 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9058 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9060 if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "2" \); then
9061 AC_MSG_RESULT([OK, $ICU_VERSION])
9063 AC_MSG_ERROR([not suitable, only >= 4.2 supported currently])
9067 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9068 AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
9069 ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
9070 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9071 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9072 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9073 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9074 AC_MSG_RESULT([yes])
9077 if test "$with_system_icu_for_build" != "force"; then
9078 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9079 You can use --with-system-icu-for-build=force to use it anyway.])
9084 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9085 # using the system icu tools can lead to version confusion, use the
9086 # ones from the build environment when cross-compiling
9087 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9088 if test -z "$SYSTEM_GENBRK"; then
9089 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9091 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9092 if test -z "$SYSTEM_GENCCODE"; then
9093 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9095 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9096 if test -z "$SYSTEM_GENCMN"; then
9097 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9099 if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4" \); then
9100 ICU_RECLASSIFIED_CLOSE_PARENTHESIS="TRUE"
9102 ICU_RECLASSIFIED_CLOSE_PARENTHESIS=
9104 if test "$ICU_MAJOR" -ge "49"; then
9105 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9106 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9107 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9109 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9110 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9111 ICU_RECLASSIFIED_HEBREW_LETTER=
9115 if test "$cross_compiling" = "yes"; then
9116 if test "$ICU_MAJOR" -ge "50"; then
9117 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9122 libo_MINGW_CHECK_DLL([icudata][$ICU_MAJOR][$ICU_MINOR])
9123 libo_MINGW_CHECK_DLL([icui18n][$ICU_MAJOR][$ICU_MINOR])
9124 libo_MINGW_CHECK_DLL([icuuc][$ICU_MAJOR][$ICU_MINOR])
9126 AC_MSG_RESULT([internal])
9128 BUILD_TYPE="$BUILD_TYPE ICU"
9129 # surprisingly set these only for "internal" (to be used by various other
9130 # external libs): the system icu-config is quite unhelpful and spits out
9131 # dozens of weird flags and also default path -I/usr/include
9132 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9133 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9135 AC_SUBST(SYSTEM_ICU)
9136 AC_SUBST(SYSTEM_GENBRK)
9137 AC_SUBST(SYSTEM_GENCCODE)
9138 AC_SUBST(SYSTEM_GENCMN)
9141 AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
9142 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9143 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9144 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9145 AC_SUBST(ICU_CFLAGS)
9148 dnl ===================================================================
9150 dnl ===================================================================
9152 AC_MSG_CHECKING([whether to enable graphite support])
9153 if test $_os != Darwin -a $_os != Android -a $_os != iOS -a \( -z "$enable_graphite" -o "$enable_graphite" != no \); then
9154 AC_MSG_RESULT([yes])
9155 ENABLE_GRAPHITE="TRUE"
9156 AC_DEFINE(ENABLE_GRAPHITE)
9157 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3])
9158 if test "$with_system_graphite" = "yes"; then
9159 libo_MINGW_CHECK_DLL([libgraphite2])
9164 AC_SUBST(ENABLE_GRAPHITE)
9166 dnl ===================================================================
9168 dnl ===================================================================
9170 AC_MSG_CHECKING([whether to enable orcus])
9171 if test -z "$enable_orcus" -o "$enable_orcus" != no; then
9172 AC_MSG_RESULT([yes])
9174 AC_DEFINE(ENABLE_ORCUS)
9176 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.8 >= 0.7.0])
9177 if test "$with_system_orcus" != "yes"; then
9178 if test "$SYSTEM_BOOST" = "TRUE"; then
9179 # ===========================================================
9180 # Determine if we are going to need to link with Boost.System
9181 # ===========================================================
9182 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9183 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9184 dnl in documentation has no effect.
9185 AC_MSG_CHECKING([if we need to link with Boost.System])
9187 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9188 @%:@include <boost/version.hpp>
9190 #if BOOST_VERSION >= 105000
9191 # error yes, we need to link with Boost.System
9196 AC_MSG_RESULT([yes])
9202 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9203 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9204 AC_SUBST([BOOST_SYSTEM_LIB])
9205 AC_SUBST(SYSTEM_LIBORCUS)
9210 AC_SUBST(ENABLE_ORCUS)
9212 dnl ===================================================================
9214 dnl ===================================================================
9215 AC_MSG_CHECKING([whether to enable HarfBuzz support])
9216 if test $_os != WINNT -a $_os != Darwin -a $_os != iOS; then
9217 AC_MSG_RESULT([yes])
9218 ENABLE_HARFBUZZ="TRUE"
9219 if $PKG_CONFIG --atleast-version 0.9.18 harfbuzz; then
9220 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.18],["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz -lharfbuzz-icu"])
9222 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz >= 0.9.10],[-I${WORKDIR}/UnpackedTarball/harfbuzz/src],["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz -lharfbuzz-icu"])
9227 AC_SUBST(ENABLE_HARFBUZZ)
9229 dnl ===================================================================
9230 dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
9231 dnl ===================================================================
9232 AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
9233 # Obviously no such thing on iOS or Android. Also not possible when building
9234 # 64-bit OS X code as the plugin code uses QuickTime and Carbon.
9235 if test "$_os" != Android -a "$_os" != iOS -a \( $_os != Darwin -o "$BITNESS_OVERRIDE" = "" \) -a \
9236 "$enable_headless" != yes -a "$enable_mpl_subset" != yes
9238 AC_MSG_RESULT([yes])
9239 ENABLE_NPAPI_FROM_BROWSER=TRUE
9242 ENABLE_NPAPI_FROM_BROWSER=
9244 AC_SUBST(ENABLE_NPAPI_FROM_BROWSER)
9246 dnl ===================================================================
9247 dnl Check for NPAPI interface to plug LibreOffice into browser windows
9248 dnl ===================================================================
9249 AC_MSG_CHECKING([whether to plug LibreOffice into browser windows])
9250 if test "$enable_mpl_subset" != yes -a \( "$_os" = WINNT -o "$_os" != Android -a "$_os" != Darwin -a "$_os" != iOS -a \
9251 "$enable_headless" != yes -a "$enable_gtk" != no \)
9253 AC_MSG_RESULT([yes])
9254 ENABLE_NPAPI_INTO_BROWSER=TRUE
9257 ENABLE_NPAPI_INTO_BROWSER=
9259 AC_SUBST(ENABLE_NPAPI_INTO_BROWSER)
9261 AC_MSG_CHECKING([whether to use X11])
9262 dnl ***************************************
9263 dnl testing for X libraries and includes...
9264 dnl ***************************************
9266 if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
9268 AC_DEFINE(HAVE_FEATURE_X11)
9270 AC_MSG_RESULT([$WANT_X11])
9272 if test "$WANT_X11" = "yes"; then
9275 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9277 if test -z "$x_includes"; then
9278 x_includes="default_x_includes"
9280 if test -z "$x_libraries"; then
9281 x_libraries="default_x_libraries"
9283 CFLAGS="$CFLAGS $X_CFLAGS"
9284 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9285 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9287 x_includes="no_x_includes"
9288 x_libraries="no_x_libraries"
9291 if test "$WANT_X11" = "yes"; then
9292 dnl ===================================================================
9293 dnl Check for Composite.h for Mozilla plugin
9294 dnl ===================================================================
9295 AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
9296 [#include <X11/Intrinsic.h>])
9298 # ENABLE_NPAPI_FROM_BROWSER requires Xt library
9299 AC_CHECK_LIB([Xt], [XtToolkitInitialize], [:],
9300 [AC_MSG_ERROR(Xt library not found)])
9302 dnl ===================================================================
9303 dnl Check for extension headers
9304 dnl ===================================================================
9305 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9306 [#include <X11/extensions/shape.h>])
9308 # vcl needs ICE and SM
9309 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9310 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9311 [AC_MSG_ERROR(ICE library not found)])
9312 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9313 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9314 [AC_MSG_ERROR(SM library not found)])
9317 dnl ===================================================================
9318 dnl Check for system Xrender
9319 dnl ===================================================================
9320 AC_MSG_CHECKING([whether to use Xrender])
9321 if test "$WANT_X11" = "yes" -a "$test_xrender" = "yes"; then
9322 AC_MSG_RESULT([yes])
9323 PKG_CHECK_MODULES(XRENDER, xrender)
9324 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9325 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9326 [AC_MSG_ERROR(libXrender not found or functional)], [])
9327 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9328 [AC_MSG_ERROR(Xrender not found. install X)], [])
9332 AC_SUBST(XRENDER_CFLAGS)
9333 AC_SUBST(XRENDER_LIBS)
9335 dnl ===================================================================
9336 dnl Check for XRandr
9337 dnl ===================================================================
9338 AC_MSG_CHECKING([whether to enable RandR support])
9339 if test "$WANT_X11" = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9340 if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
9341 XRANDR_DLOPEN="TRUE"
9342 AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
9344 AC_MSG_RESULT([yes])
9345 XRANDR_DLOPEN="FALSE"
9346 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9347 if test "$ENABLE_RANDR" != "TRUE"; then
9348 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9349 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9351 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9352 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9353 XRANDR_LIBS="-lXrandr "
9356 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9362 AC_SUBST(XRANDR_DLOPEN)
9363 AC_SUBST(XRANDR_CFLAGS)
9364 AC_SUBST(XRANDR_LIBS)
9365 AC_SUBST(ENABLE_RANDR)
9367 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9370 if test $_os = iOS -o $_os = Android; then
9373 AC_MSG_CHECKING([for webdav library])
9374 case "$WITH_WEBDAV" in
9376 AC_MSG_RESULT([serf])
9377 # Check for system apr-util
9378 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9379 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9380 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9381 if test "$COM" = "MSC"; then
9383 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9384 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9387 # Check for system serf
9388 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9389 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9390 if test "$COM" = "MSC"; then
9391 SERF_LIB_DIR="Release"
9392 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9393 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9397 AC_MSG_RESULT([neon])
9398 # Check for system neon
9399 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9400 if test "$with_system_neon" = "yes"; then
9401 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9402 libo_MINGW_CHECK_DLL([libneon])
9403 libo_MINGW_TRY_DLL([libtasn1])
9404 libo_MINGW_TRY_DLL([libgnutls])
9408 AC_SUBST(NEON_VERSION)
9411 AC_MSG_RESULT([none, disabled])
9415 AC_SUBST(WITH_WEBDAV)
9417 dnl ===================================================================
9418 dnl Check for disabling cve_tests
9419 dnl ===================================================================
9420 AC_MSG_CHECKING([whether to execute CVE tests])
9421 if test "$enable_cve_tests" = "no"; then
9423 DISABLE_CVE_TESTS=TRUE
9424 AC_SUBST(DISABLE_CVE_TESTS)
9426 AC_MSG_RESULT([yes])
9429 dnl ===================================================================
9430 dnl Check for enabling chart XShape tests
9431 dnl ===================================================================
9432 AC_MSG_CHECKING([whether to execute chart XShape tests])
9433 if test "$enable_chart_tests" = "yes"; then
9434 AC_MSG_RESULT([yes])
9435 ENABLE_CHART_TESTS=TRUE
9436 AC_SUBST(ENABLE_CHART_TESTS)
9441 dnl ===================================================================
9442 dnl Check for system openssl
9443 dnl ===================================================================
9445 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9446 if test "$enable_openssl" = "yes"; then
9448 if test "$_os" = Darwin -a "${MAC_OS_X_VERSION_MIN_REQUIRED:-0}" -ge 1070; then
9449 # OpenSSL is deprecated when building for 10.7 or later.
9451 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9452 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9454 with_system_openssl=no
9455 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9456 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9457 && test "$with_system_openssl" != "no"; then
9458 with_system_openssl=yes
9461 OPENSSL_LIBS="-lssl -lcrypto"
9463 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9465 if test "$with_system_openssl" = "yes"; then
9466 libo_MINGW_CHECK_DLL([libssl])
9467 libo_MINGW_CHECK_DLL([libcrypto])
9468 AC_MSG_CHECKING([whether openssl supports SHA512])
9470 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9472 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9476 AC_MSG_RESULT([yes])
9477 DISABLE_OPENSSL=TRUE
9479 # warn that although OpenSSL is disabled, system libraries may be depending on it
9480 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9481 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9484 AC_SUBST([DISABLE_OPENSSL])
9486 dnl ===================================================================
9487 dnl Check for building gnutls
9488 dnl ===================================================================
9489 AC_MSG_CHECKING([whether to use gnutls])
9490 if test "$WITH_WEBDAV" = "neon" && test "$enable_openssl" = "no"; then
9491 AC_MSG_RESULT([yes])
9493 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9494 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9495 available in the system to use as replacement.]]))
9498 AC_SUBST([LIBGCRYPT_CFLAGS])
9499 AC_SUBST([LIBGCRYPT_LIBS])
9501 dnl ===================================================================
9502 dnl Check for system redland
9503 dnl ===================================================================
9504 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9505 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9506 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9507 if test "$with_system_redland" = "yes"; then
9508 libo_MINGW_CHECK_DLL([librdf])
9509 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9510 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9511 libo_MINGW_TRY_DLL([libraptor])
9512 libo_MINGW_TRY_DLL([librasqal])
9513 libo_MINGW_TRY_DLL([libsqlite3])
9519 AC_SUBST(RAPTOR_MAJOR)
9520 AC_SUBST(RASQAL_MAJOR)
9521 AC_SUBST(REDLAND_MAJOR)
9523 dnl ===================================================================
9524 dnl Check for system hunspell
9525 dnl ===================================================================
9526 AC_MSG_CHECKING([which libhunspell to use])
9527 if test "$with_system_hunspell" = "yes"; then
9528 AC_MSG_RESULT([external])
9529 SYSTEM_HUNSPELL=TRUE
9531 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9532 if test "$HUNSPELL_PC" != "TRUE"; then
9533 AC_CHECK_HEADER(hunspell.hxx, [],
9535 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9536 [AC_MSG_ERROR(hunspell headers not found.)], [])
9538 AC_CHECK_LIB([hunspell], [main], [:],
9539 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9540 HUNSPELL_LIBS=-lhunspell
9543 libo_MINGW_CHECK_DLL([libhunspell-1.3])
9544 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9546 AC_MSG_RESULT([internal])
9548 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9549 if test "$COM" = "MSC"; then
9550 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9552 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.3"
9554 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9556 AC_SUBST(SYSTEM_HUNSPELL)
9557 AC_SUBST(HUNSPELL_CFLAGS)
9558 AC_SUBST(HUNSPELL_LIBS)
9560 dnl ===================================================================
9561 dnl Checking for altlinuxhyph
9562 dnl ===================================================================
9563 AC_MSG_CHECKING([which altlinuxhyph to use])
9564 if test "$with_system_altlinuxhyph" = "yes"; then
9565 AC_MSG_RESULT([external])
9567 AC_CHECK_HEADER(hyphen.h, [],
9568 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9569 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9570 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9571 [#include <hyphen.h>])
9572 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9573 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9574 if test -z "$HYPHEN_LIB"; then
9575 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9576 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9578 if test -z "$HYPHEN_LIB"; then
9579 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9580 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9582 libo_MINGW_CHECK_DLL([libhyphen])
9584 AC_MSG_RESULT([internal])
9586 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9587 if test "$COM" = "MSC"; then
9588 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9590 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9593 AC_SUBST(SYSTEM_HYPH)
9594 AC_SUBST(HYPHEN_LIB)
9596 dnl ===================================================================
9597 dnl Checking for mythes
9598 dnl ===================================================================
9599 AC_MSG_CHECKING([which mythes to use])
9600 if test "$with_system_mythes" = "yes"; then
9601 AC_MSG_RESULT([external])
9604 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9605 if test "$MYTHES_PKGCONFIG" = "no"; then
9606 AC_CHECK_HEADER(mythes.hxx, [],
9607 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9608 AC_CHECK_LIB([mythes-1.2], [main], [:],
9609 [ MYTHES_FOUND=no], [])
9610 if test "$MYTHES_FOUND" = "no"; then
9611 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9612 [ MYTHES_FOUND=no], [])
9614 if test "$MYTHES_FOUND" = "no"; then
9615 AC_MSG_ERROR([mythes library not found!.])
9619 libo_MINGW_CHECK_DLL([libmythes-1.2])
9620 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9622 AC_MSG_RESULT([internal])
9624 BUILD_TYPE="$BUILD_TYPE MYTHES"
9625 if test "$COM" = "MSC"; then
9626 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9628 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9631 AC_SUBST(SYSTEM_MYTHES)
9632 AC_SUBST(MYTHES_CFLAGS)
9633 AC_SUBST(MYTHES_LIBS)
9635 dnl ===================================================================
9636 dnl How should we build the linear programming solver ?
9637 dnl ===================================================================
9640 AC_MSG_CHECKING([whether to build with CoinMP])
9641 if test "$enable_coinmp" != "no"; then
9643 AC_MSG_RESULT([yes])
9644 # Should we check for system CoinMP ? How to do that ?
9645 BUILD_TYPE="$BUILD_TYPE COINMP"
9649 AC_SUBST(ENABLE_COINMP)
9652 AC_MSG_CHECKING([whether to build with lpsolve])
9653 if test "$enable_lpsolve" != "no"; then
9655 AC_MSG_RESULT([yes])
9659 AC_SUBST(ENABLE_LPSOLVE)
9661 if test "$ENABLE_LPSOLVE" = TRUE; then
9662 AC_MSG_CHECKING([which lpsolve to use])
9663 if test "$with_system_lpsolve" = "yes"; then
9664 AC_MSG_RESULT([external])
9666 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9667 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9669 # some systems need this. Like Ubuntu....
9670 AC_CHECK_LIB(m, floor)
9671 AC_CHECK_LIB(dl, dlopen)
9672 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9673 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9675 libo_MINGW_CHECK_DLL([lpsolve55])
9677 AC_MSG_RESULT([internal])
9679 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9682 AC_SUBST(SYSTEM_LPSOLVE)
9684 dnl ===================================================================
9685 dnl Checking for libexttextcat
9686 dnl ===================================================================
9687 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.1.1])
9688 if test "$with_system_libexttextcat" = "yes"; then
9689 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9691 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9693 dnl ***************************************
9694 dnl testing libc version for Linux...
9695 dnl ***************************************
9696 if test "$_os" = "Linux"; then
9697 AC_MSG_CHECKING([whether libc is >= 2.1.1])
9698 exec 6>/dev/null # no output
9699 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
9700 exec 6>&1 # output on again
9701 if test "$HAVE_LIBC"; then
9702 AC_MSG_RESULT([yes])
9704 AC_MSG_ERROR([no, upgrade libc])
9708 dnl =========================================
9709 dnl Check for the Windows SDK.
9710 dnl =========================================
9711 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
9712 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
9713 if test "$_os" = "WINNT"; then
9714 AC_MSG_CHECKING([for Windows SDK])
9715 if test "$build_os" = "cygwin"; then
9717 WINDOWS_SDK_HOME=$winsdktest
9719 # normalize if found
9720 if test -n "$WINDOWS_SDK_HOME"; then
9721 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
9722 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
9726 if test -n "$WINDOWS_SDK_HOME"; then
9727 # Remove a possible trailing backslash
9728 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
9730 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
9731 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
9732 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
9733 have_windows_sdk_headers=yes
9734 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
9735 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
9736 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
9737 have_windows_sdk_headers=yes
9739 have_windows_sdk_headers=no
9742 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
9743 have_windows_sdk_libs=yes
9744 elif test -f "$WINDOWS_SDK_HOME/lib/win8/um/$WINDOWS_SDK_ARCH/user32.lib"; then
9745 have_windows_sdk_libs=yes
9747 have_windows_sdk_libs=no
9750 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
9751 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
9752 the Windows SDK are installed.])
9755 if test ! -f "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
9756 -o ! -f "$WINDOWS_SDK_HOME/bin/msidb.exe" \
9757 -o ! -f "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
9758 -o ! -f "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
9759 elif test ! -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
9760 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
9761 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
9762 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
9764 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
9768 if test -z "$WINDOWS_SDK_HOME"; then
9769 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
9770 elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
9771 WINDOWS_SDK_VERSION=60
9772 AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
9773 elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
9774 WINDOWS_SDK_VERSION=61
9775 AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
9776 elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
9777 WINDOWS_SDK_VERSION=70
9778 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
9779 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
9780 WINDOWS_SDK_VERSION=80
9781 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
9782 # compatibility warning if usind VS 2012 and not explicitly choosing the 80 SDK
9783 if test "$VCVER" = "110" -a -z "$with_windows_sdk"; then
9784 AC_MSG_WARN([If a build created with VS 2012 should run on Windows XP,])
9785 AC_MSG_WARN([use --with-windows-sdk=7.1A (requires VS 2012 Update 1 or newer)])
9786 add_warning "If a build created with VS 2012 should run on Windows XP,"
9787 add_warning "use --with-windows-sdk=7.1A (requires VS 2012 Update 1 or newer)"
9790 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
9792 PathFormat "$WINDOWS_SDK_HOME"
9793 WINDOWS_SDK_HOME="$formatted_path"
9794 if test "$build_os" = "cygwin"; then
9795 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
9796 if test -d "$WINDOWS_SDK_HOME/include/um"; then
9797 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
9801 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
9802 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
9803 dnl but not in v8.0), so allow this to be overridden with a
9804 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
9805 dnl and configuration error if no WiLangId.vbs is found would arguably be
9806 dnl better, but I do not know under which conditions exactly it is needed by
9808 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
9809 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
9810 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9811 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
9813 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9814 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.0/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
9816 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9817 AC_MSG_WARN([WiLangId.vbs not found - building translated packages will fail])
9818 add_warning "WiLangId.vbs not found - building translated packages will fail"
9822 AC_SUBST(WINDOWS_SDK_HOME)
9823 AC_SUBST(WINDOWS_SDK_VERSION)
9824 AC_SUBST(WINDOWS_SDK_WILANGID)
9826 dnl =========================================
9827 dnl Check for uuidgen
9828 dnl =========================================
9829 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9830 if test "$WITH_MINGW" = "yes"; then
9831 AC_PATH_PROG([UUIDGEN], [uuid])
9832 if test -z "$UUIDGEN"; then
9833 AC_MSG_WARN([uuid is needed for dev-install])
9836 # presence is already tested above in the WINDOWS_SDK_HOME check
9841 AC_PATH_PROG([UUIDGEN], [uuidgen])
9842 if test -z "$UUIDGEN"; then
9843 AC_MSG_WARN([uuid is needed for dev-install])
9847 dnl =========================================
9848 dnl Check for the Microsoft DirectX SDK.
9849 dnl =========================================
9850 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
9851 AC_MSG_CHECKING([for DirectX SDK])
9852 if test "$build_os" = "cygwin"; then
9853 dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
9854 if test -n "$DXSDK_DIR"; then
9855 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
9856 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
9858 # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
9859 # the "DirectX SDK not found" error later.
9862 # Remove a possible trailing backslash
9863 DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
9866 if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h"; then
9867 HAVE_DIRECTXSDK_H="yes"
9869 HAVE_DIRECTXSDK_H="no"
9872 if test "$BITNESS_OVERRIDE" = 64; then
9873 DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x64"
9875 DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
9877 PathFormat "$DIRECTXSDK_LIB"
9878 DIRECTXSDK_LIB="$formatted_path"
9880 if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib"; then
9881 HAVE_DIRECTXSDK_LIB="yes"
9883 HAVE_DIRECTXSDK_LIB="no"
9886 if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
9887 AC_MSG_RESULT([found])
9889 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
9891 if test -n "$DIRECTXSDK_HOME"; then
9892 PathFormat "$DIRECTXSDK_HOME"
9893 DIRECTXSDK_HOME="$formatted_path"
9894 SOLARINC="$SOLARINC -I$DIRECTXSDK_HOME/include"
9897 AC_SUBST(DIRECTXSDK_HOME)
9899 dnl ***************************************
9900 dnl Checking for bison and flex
9901 dnl ***************************************
9902 AC_PATH_PROG(BISON, bison)
9903 if test -z "$BISON"; then
9904 AC_MSG_ERROR([no bison found in \$PATH, install it])
9906 AC_MSG_CHECKING([the bison version])
9907 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9908 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9909 # Accept newer than 2.0
9910 if test "$_bison_longver" -lt 2000; then
9911 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
9915 AC_PATH_PROG(FLEX, flex)
9916 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9917 FLEX=`cygpath -m $FLEX`
9919 if test -z "$FLEX"; then
9920 AC_MSG_ERROR([no flex found in \$PATH, install it])
9922 AC_MSG_CHECKING([the flex version])
9923 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
9924 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
9925 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
9929 dnl ***************************************
9930 dnl Checking for patch
9931 dnl ***************************************
9932 AC_PATH_PROG(PATCH, patch)
9933 if test -z "$PATCH"; then
9934 AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
9937 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9938 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9939 if test -z "$with_gnu_patch"; then
9942 if test -x "$with_gnu_patch"; then
9943 GNUPATCH=$with_gnu_patch
9945 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9949 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9950 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9951 AC_MSG_RESULT([yes])
9953 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9959 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9960 GNUPATCH=`cygpath -m $GNUPATCH`
9963 dnl We also need to check for --with-gnu-cp
9965 if test -z "$with_gnu_cp"; then
9966 # check the place where the good stuff is hidden on Solaris...
9967 if test -x /usr/gnu/bin/cp; then
9968 GNUCP=/usr/gnu/bin/cp
9970 AC_PATH_PROGS(GNUCP, gnucp cp)
9972 if test -z $GNUCP; then
9973 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9976 if test -x "$with_gnu_cp"; then
9979 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9983 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9984 GNUCP=`cygpath -m $GNUCP`
9987 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9988 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9989 AC_MSG_RESULT([yes])
9990 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9991 AC_MSG_RESULT([yes])
9994 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9997 AC_MSG_RESULT([no gnucp found - using the system's cp command])
10000 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
10009 dnl ***************************************
10010 dnl testing assembler path
10011 dnl ***************************************
10013 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
10014 if test "$BITNESS_OVERRIDE" = ""; then
10019 assembler_bin=bin/amd64
10022 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
10023 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
10024 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
10025 AC_MSG_RESULT([found])
10026 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
10028 AC_MSG_ERROR([Configure did not find $assembler assembler.])
10031 PathFormat "$ASM_HOME"
10032 ASM_HOME="$formatted_path"
10039 dnl ===================================================================
10040 dnl We need zip and unzip
10041 dnl ===================================================================
10042 AC_PATH_PROG(ZIP, zip)
10043 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10044 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10045 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],,)
10048 AC_PATH_PROG(UNZIP, unzip)
10049 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10051 dnl ===================================================================
10052 dnl Zip must be a specific type for different build types.
10053 dnl ===================================================================
10054 if test $build_os = cygwin; then
10055 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10056 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10060 dnl ===================================================================
10061 dnl We need touch with -h option support.
10062 dnl ===================================================================
10063 AC_PATH_PROG(TOUCH, touch)
10064 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10066 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10067 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],,)
10070 dnl ===================================================================
10071 dnl Test which vclplugs have to be built.
10072 dnl ===================================================================
10077 if test "x$enable_gtk3" = "xyes"; then
10078 if test "$with_system_cairo" = no; then
10079 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10081 : ${with_system_cairo:=yes}
10082 PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 gtk+-unix-print-3.0 gmodule-no-export-2.0 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
10083 if test "x$ENABLE_GTK3" = "xTRUE"; then
10086 AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
10088 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10090 AC_SUBST(GTK3_LIBS)
10091 AC_SUBST(GTK3_CFLAGS)
10092 AC_SUBST(ENABLE_GTK3)
10094 AC_MSG_CHECKING([which VCLplugs shall be built])
10095 if test "$GUIBASE" != "unx" -o "$enable_headless" = "yes"; then
10099 if test "x$enable_gtk" = "xyes"; then
10100 if test "$with_system_cairo" = no; then
10101 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10103 : ${with_system_cairo:=yes}
10105 AC_DEFINE(ENABLE_GTK)
10108 AC_SUBST(ENABLE_GTK)
10111 if test "x$enable_tde" = "xyes"; then
10112 # Libs kab and tdeab in connectivity and kdeab and tdeab in shell
10113 # are built from the same sources. So we only allow one of them.
10114 if test "x$enable_kde" = "xyes"; then
10115 AC_MSG_ERROR([enabling both KDE and TDE is not supported])
10118 AC_DEFINE(ENABLE_TDE)
10121 AC_SUBST(ENABLE_TDE)
10124 if test "x$enable_kde" = "xyes"; then
10126 AC_DEFINE(ENABLE_KDE)
10129 AC_SUBST(ENABLE_KDE)
10132 if test "x$enable_kde4" = "xyes"; then
10134 AC_DEFINE(ENABLE_KDE4)
10137 AC_SUBST(ENABLE_KDE4)
10140 if test "x$enable_headless" = "xyes"; then
10141 ENABLE_HEADLESS="TRUE"
10142 SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
10145 AC_SUBST(ENABLE_HEADLESS)
10147 if test -z "$R"; then
10148 AC_MSG_RESULT([none])
10150 AC_MSG_RESULT([$R])
10153 dnl ===================================================================
10155 dnl ===================================================================
10158 AC_MSG_CHECKING([whether to enable GConf support])
10159 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "iOS" -a "$enable_gconf" = "yes"; then
10160 ENABLE_GCONF="TRUE"
10161 AC_MSG_RESULT([yes])
10162 PKG_CHECK_MODULES( GCONF, gconf-2.0 gobject-2.0 )
10163 GCONF_CFLAGS=$(printf '%s' "$GCONF_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10165 AC_MSG_RESULT([no])
10167 AC_SUBST(GCONF_LIBS)
10168 AC_SUBST(GCONF_CFLAGS)
10169 AC_SUBST(ENABLE_GCONF)
10171 dnl ===================================================================
10172 dnl Gnome VFS check
10173 dnl ===================================================================
10176 AC_MSG_CHECKING([whether to enable GNOME VFS support])
10177 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
10178 ENABLE_GNOMEVFS="TRUE"
10179 AC_MSG_RESULT([yes])
10180 PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
10181 GNOMEVFS_CFLAGS=$(printf '%s' "$GNOMEVFS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10182 AC_DEFINE(ENABLE_GNOME_VFS)
10184 AC_MSG_RESULT([no])
10186 AC_SUBST(GNOMEVFS_LIBS)
10187 AC_SUBST(GNOMEVFS_CFLAGS)
10188 AC_SUBST(ENABLE_GNOMEVFS)
10190 dnl ===================================================================
10191 dnl check for dbus support
10192 dnl ===================================================================
10197 if test "$enable_dbus" = "no"; then
10201 AC_MSG_CHECKING([whether to enable DBUS support])
10202 if test "$test_dbus" = "yes"; then
10204 AC_MSG_RESULT([yes])
10205 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
10206 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10208 AC_MSG_RESULT([no])
10211 AC_SUBST(ENABLE_DBUS)
10212 AC_SUBST(DBUS_CFLAGS)
10213 AC_SUBST(DBUS_LIBS)
10215 AC_MSG_CHECKING([whether to enable font install via packagekit])
10216 if test "$ENABLE_DBUS" = "TRUE"; then
10217 if test -n "$enable_packagekit" -a "$enable_packagekit" != "no"; then
10218 ENABLE_PACKAGEKIT=TRUE
10219 AC_MSG_RESULT([yes])
10222 AC_MSG_RESULT([no])
10225 AC_MSG_RESULT([no, dbus disabled.])
10227 AC_SUBST(ENABLE_PACKAGEKIT)
10229 AC_MSG_CHECKING([whether to enable Impress remote control])
10230 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10231 AC_MSG_RESULT([yes])
10232 ENABLE_SDREMOTE=TRUE
10233 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10235 # If not explicitly enabled or disabled, default
10236 if test -z "$enable_sdremote_bluetooth"; then
10239 # Default to yes for these
10240 enable_sdremote_bluetooth=yes
10244 enable_sdremote_bluetooth=no
10248 # $enable_sdremote_bluetooth is guaranteed non-empty now
10250 if test "$enable_sdremote_bluetooth" != "no"; then
10251 if test "$OS" = "LINUX"; then
10252 if test "$ENABLE_DBUS" = "TRUE"; then
10253 AC_MSG_RESULT([yes])
10254 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10255 dnl ===================================================================
10256 dnl Check for system bluez
10257 dnl ===================================================================
10258 AC_MSG_CHECKING([which Bluetooth header to use])
10259 if test "$with_system_bluez" = "yes"; then
10260 AC_MSG_RESULT([external])
10261 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10262 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10265 AC_MSG_RESULT([internal])
10269 AC_MSG_RESULT([no, dbus disabled])
10270 ENABLE_SDREMOTE_BLUETOOTH=
10274 AC_MSG_RESULT([yes])
10275 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10279 AC_MSG_RESULT([no])
10280 ENABLE_SDREMOTE_BLUETOOTH=
10286 AC_MSG_RESULT([no])
10288 AC_SUBST(ENABLE_SDREMOTE)
10289 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10290 AC_SUBST(SYSTEM_BLUEZ)
10292 AC_MSG_CHECKING([whether to enable Impress remote control android app])
10293 if echo "$host_os" | grep -q linux-android || test "$enable_sdremote_android" = "yes"; then
10294 AC_MSG_RESULT([yes])
10295 ENABLE_SDREMOTE_ANDROID=TRUE
10297 AC_MSG_RESULT([no])
10298 ENABLE_SDREMOTE_ANDROID=
10300 AC_SUBST(ENABLE_SDREMOTE_ANDROID)
10302 dnl ===================================================================
10303 dnl Check whether the gtk 2.0 libraries are available.
10304 dnl ===================================================================
10308 ENABLE_SYSTRAY_GTK=""
10309 if test "$test_gtk" = "yes"; then
10311 if test "$ENABLE_GTK" = "TRUE"; then
10312 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
10313 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10314 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]))
10315 BUILD_TYPE="$BUILD_TYPE GTK"
10316 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10318 AC_MSG_CHECKING([whether to enable the systray quickstarter])
10319 if test "x$enable_systray" = "xyes"; then
10320 AC_MSG_RESULT([yes])
10321 PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
10322 [ ENABLE_SYSTRAY_GTK="TRUE" ],
10323 [ ENABLE_SYSTRAY_GTK="" ])
10325 AC_MSG_RESULT([no])
10328 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10329 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10330 [ENABLE_GTK_PRINT="TRUE"],
10331 [ENABLE_GTK_PRINT=""])
10332 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10334 AC_MSG_CHECKING([whether to enable GIO support])
10335 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10336 if test "$ENABLE_GNOMEVFS" = "TRUE"; then
10337 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
10339 dnl Need at least 2.26 for the dbus support.
10340 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10341 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10342 if test "$ENABLE_GIO" = "TRUE"; then
10343 AC_DEFINE(ENABLE_GIO)
10344 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10347 AC_MSG_RESULT([no])
10351 AC_SUBST(ENABLE_GIO)
10352 AC_SUBST(GIO_CFLAGS)
10354 AC_SUBST(ENABLE_SYSTRAY_GTK)
10355 AC_SUBST(GTK_CFLAGS)
10357 AC_SUBST(GTHREAD_CFLAGS)
10358 AC_SUBST(GTHREAD_LIBS)
10359 AC_SUBST([ENABLE_GTK_PRINT])
10360 AC_SUBST([GTK_PRINT_CFLAGS])
10361 AC_SUBST([GTK_PRINT_LIBS])
10364 dnl ===================================================================
10365 dnl Check whether the Telepathy libraries are available.
10366 dnl ===================================================================
10368 ENABLE_TELEPATHY=""
10369 TELEPATHY_CFLAGS=""
10372 AC_MSG_CHECKING([whether to enable Telepathy support])
10373 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
10374 ENABLE_TELEPATHY="TRUE"
10375 AC_DEFINE(ENABLE_TELEPATHY)
10376 AC_MSG_RESULT([yes])
10377 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.4 )
10378 TELEPATHY_CFLAGS=$(printf '%s' "$TELEPATHY_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10380 AC_MSG_RESULT([no])
10383 AC_SUBST(ENABLE_TELEPATHY)
10384 AC_SUBST(TELEPATHY_CFLAGS)
10385 AC_SUBST(TELEPATHY_LIBS)
10388 dnl ===================================================================
10390 SPLIT_APP_MODULES=""
10391 if test "$enable_split_app_modules" = "yes"; then
10392 SPLIT_APP_MODULES="TRUE"
10394 AC_SUBST(SPLIT_APP_MODULES)
10396 SPLIT_OPT_FEATURES=""
10397 if test "$enable_split_opt_features" = "yes"; then
10398 SPLIT_OPT_FEATURES="TRUE"
10400 AC_SUBST(SPLIT_OPT_FEATURES)
10402 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10403 if test "$enable_cairo_canvas" = yes; then
10404 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10406 enable_cairo_canvas=no
10407 elif test -z "$enable_cairo_canvas"; then
10408 enable_cairo_canvas=yes
10411 ENABLE_CAIRO_CANVAS=""
10412 if test "$enable_cairo_canvas" = "yes"; then
10414 ENABLE_CAIRO_CANVAS="TRUE"
10416 AC_SUBST(ENABLE_CAIRO_CANVAS)
10418 dnl ===================================================================
10419 dnl Check whether the GStreamer libraries are available.
10420 dnl ===================================================================
10422 ENABLE_GSTREAMER=""
10424 if test "$build_gstreamer" = "yes"; then
10426 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10427 if test "$enable_avmedia" = yes -a "$enable_gstreamer" != no; then
10428 ENABLE_GSTREAMER="TRUE"
10429 AC_MSG_RESULT([yes])
10430 PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
10431 GSTREAMER_CFLAGS=$(printf '%s' "$GSTREAMER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10433 AC_MSG_RESULT([no])
10436 AC_SUBST(GSTREAMER_CFLAGS)
10437 AC_SUBST(GSTREAMER_LIBS)
10438 AC_SUBST(ENABLE_GSTREAMER)
10441 ENABLE_GSTREAMER_0_10=""
10442 if test "$build_gstreamer_0_10" = "yes"; then
10444 AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
10445 if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10446 ENABLE_GSTREAMER_0_10="TRUE"
10447 AC_MSG_RESULT([yes])
10448 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
10449 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10] )
10451 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10453 AC_MSG_RESULT([no])
10457 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10458 AC_SUBST(GSTREAMER_0_10_LIBS)
10459 AC_SUBST(ENABLE_GSTREAMER_0_10)
10461 dnl ===================================================================
10462 dnl Check whether to build the VLC avmedia backend
10463 dnl ===================================================================
10467 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10468 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10470 AC_MSG_RESULT([yes])
10472 AC_MSG_RESULT([no])
10474 AC_SUBST(ENABLE_VLC)
10476 dnl ===================================================================
10477 dnl Check whether the OpenGL libraries are available
10478 dnl ===================================================================
10480 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
10483 if test -z "$enable_opengl"; then
10484 if test $_os = WINNT; then
10485 # By default disable the OpenGL transitions for Windows (the code compiles but works very
10486 # badly and crashes). In other words, use --enable-opengl only if you plan to hack on that
10487 # code for Windows.
10489 elif test $_os = iOS; then
10490 # As such with some suitable minor tweaks the Mac OpenGL transitions code would presumably
10491 # build fine for iOS, too, but let's leave that for later
10493 elif test "$enable_headless" = "yes"; then
10500 if test "x$enable_opengl" = "xno"; then
10501 AC_MSG_RESULT([no])
10502 elif test "$_os" = "Darwin"; then
10503 # We use frameworks on Mac OS X, no need for detail checks
10505 ENABLE_OPENGL_CANVAS=
10506 add_warning "openGL canvas not adapted for Mac yet - disabling"
10507 SYSTEM_MESA_HEADERS=TRUE
10508 AC_MSG_RESULT([yes])
10509 elif test $_os = WINNT; then
10510 # Experimental: try to use OpenGL on Windows
10512 ENABLE_OPENGL_CANVAS=TRUE
10513 # We need the internal "Mesa" headers.
10514 SYSTEM_MESA_HEADERS=
10515 BUILD_TYPE="$BUILD_TYPE MESA"
10516 AC_MSG_RESULT([yes])
10518 save_LDFLAGS=$LDFLAGS
10519 LDFLAGS="$LDFLAGS -lm"
10520 AC_MSG_RESULT([yes])
10521 AC_CHECK_LIB([GL], [main],
10522 [AC_CHECK_LIB([GL], [glCreateShader], [ENABLE_OPENGL_CANVAS=TRUE],
10523 [add_warning "no shader support in libGL - will enable openGL transitions, but not openGL canvas"
10524 AC_MSG_WARN([no shader support in libGL - will enable openGL transitions, but not openGL canvas])
10525 ENABLE_OPENGL_CANVAS=], [])],
10526 [AC_MSG_ERROR(libGL not installed or functional)], [])
10527 LDFLAGS="$LDFLAGS -lGL"
10528 AC_CHECK_LIB([GLU], [main], [:],
10529 [AC_MSG_ERROR(libGLU not installed or functional)], [])
10531 LDFLAGS=$save_LDFLAGS
10533 dnl ===================================================================
10534 dnl Check for system Mesa
10535 dnl ===================================================================
10536 AC_MSG_CHECKING([which Mesa headers to use])
10537 if test "$with_system_mesa_headers" = "yes"; then
10538 AC_MSG_RESULT([external])
10539 SYSTEM_MESA_HEADERS=TRUE
10541 AC_CHECK_HEADER(GL/glxext.h, [],
10542 [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
10543 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
10544 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
10547 AC_MSG_RESULT([internal])
10548 SYSTEM_MESA_HEADERS=
10549 BUILD_TYPE="$BUILD_TYPE MESA"
10553 AC_SUBST(SYSTEM_MESA_HEADERS)
10554 AC_SUBST(ENABLE_OPENGL)
10555 AC_SUBST(ENABLE_OPENGL_CANVAS)
10557 dnl =================================================
10558 dnl Check whether to build with OpenCL support.
10559 dnl =================================================
10561 AC_MSG_CHECKING([whether to build with the OpenCL support.])
10564 if test $_os != iOS -a $_os != Android -a "x$enable_opencl" != "xno"; then
10565 if test $_os = Darwin -a "$with_macosx_sdk" = "10.5"; then
10566 AC_MSG_RESULT([disabled on OS X 10.5])
10568 AC_MSG_RESULT([yes])
10570 AC_DEFINE(HAVE_FEATURE_OPENCL)
10573 AC_MSG_RESULT([no])
10576 AC_SUBST(ENABLE_OPENCL)
10578 dnl ===================================================================
10579 dnl Check whether to enable glTF support
10580 dnl ===================================================================
10581 AC_MSG_CHECKING([whether to enable glTF support])
10583 if test "x$enable_gltf" != "xno" -a $_os != Darwin -a $_os != iOS -a $_os != Android; then
10585 AC_MSG_RESULT([yes])
10586 AC_DEFINE(HAVE_FEATURE_GLTF,1)
10587 BUILD_TYPE="$BUILD_TYPE LIBGLTF"
10588 # otherwise build fails in collada2gltf external because of std::shared_ptr
10589 if test "$have_std_shared_ptr" = "yes"; then
10590 BUILD_TYPE="$BUILD_TYPE COLLADA2GLTF"
10593 AC_MSG_RESULT([no])
10595 AC_SUBST(ENABLE_GLTF)
10598 AC_MSG_CHECKING([whether to build the PDF import feature])
10600 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10601 AC_MSG_RESULT([yes])
10602 ENABLE_PDFIMPORT=TRUE
10604 dnl ===================================================================
10605 dnl Check for system poppler
10606 dnl ===================================================================
10607 AC_MSG_CHECKING([which PDF import backend to use])
10608 if test "$with_system_poppler" = "yes"; then
10609 AC_MSG_RESULT([external])
10610 SYSTEM_POPPLER=TRUE
10611 PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
10612 AC_LANG_PUSH([C++])
10613 save_CXXFLAGS=$CXXFLAGS
10614 save_CPPFLAGS=$CPPFLAGS
10615 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10616 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10617 AC_CHECK_HEADER([cpp/poppler-version.h], [],
10618 [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
10619 CXXFLAGS=$save_CXXFLAGS
10620 CPPFLAGS=$save_CPPFLAGS
10622 libo_MINGW_CHECK_DLL([libpoppler])
10623 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10625 AC_MSG_RESULT([internal])
10627 BUILD_TYPE="$BUILD_TYPE POPPLER"
10630 AC_MSG_RESULT([no])
10632 AC_SUBST(ENABLE_PDFIMPORT)
10633 AC_SUBST(SYSTEM_POPPLER)
10634 AC_SUBST(POPPLER_CFLAGS)
10635 AC_SUBST(POPPLER_LIBS)
10637 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10638 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10639 AC_MSG_RESULT([yes])
10640 ENABLE_MEDIAWIKI=TRUE
10641 BUILD_TYPE="$BUILD_TYPE XSLTML"
10642 if test "x$with_java" = "xno"; then
10643 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10646 AC_MSG_RESULT([no])
10648 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10650 AC_SUBST(ENABLE_MEDIAWIKI)
10652 AC_MSG_CHECKING([whether to build the Report Builder])
10653 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10654 AC_MSG_RESULT([yes])
10655 ENABLE_REPORTBUILDER=TRUE
10656 AC_MSG_CHECKING([which jfreereport libs to use])
10657 if test "$with_system_jfreereport" = "yes"; then
10658 SYSTEM_JFREEREPORT=TRUE
10659 AC_MSG_RESULT([external])
10660 if test -z $SAC_JAR; then
10661 SAC_JAR=/usr/share/java/sac.jar
10663 AC_CHECK_FILE($SAC_JAR, [],
10664 [AC_MSG_ERROR(sac.jar not found.)], [])
10666 if test -z $LIBXML_JAR; then
10667 AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
10668 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
10670 AC_CHECK_FILE(/usr/share/java/libxml.jar,
10671 [ LIBXML_JAR=/usr/share/java/libxml.jar ],
10672 [AC_MSG_ERROR(libxml.jar replacement not found.)]
10677 AC_CHECK_FILE($LIBXML_JAR, [],
10678 [AC_MSG_ERROR(libxml.jar not found.)], [])
10681 if test -z $FLUTE_JAR; then
10682 AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
10683 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
10685 AC_CHECK_FILE(/usr/share/java/flute.jar,
10686 [ FLUTE_JAR=/usr/share/java/flute.jar ],
10687 [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
10692 AC_CHECK_FILE($FLUTE_JAR, [],
10693 [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
10696 if test -z $JFREEREPORT_JAR; then
10697 AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
10698 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
10700 AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
10701 [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
10702 [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
10707 AC_CHECK_FILE($JFREEREPORT_JAR, [],
10708 [AC_MSG_ERROR(jfreereport.jar not found.)], [])
10711 if test -z $LIBLAYOUT_JAR; then
10712 AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
10713 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
10715 AC_CHECK_FILE(/usr/share/java/liblayout.jar,
10716 [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
10717 [AC_MSG_ERROR(liblayout.jar replacement not found.)]
10722 AC_CHECK_FILE($LIBLAYOUT_JAR, [],
10723 [AC_MSG_ERROR(liblayout.jar not found.)], [])
10726 if test -z $LIBLOADER_JAR; then
10727 AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
10728 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
10730 AC_CHECK_FILE(/usr/share/java/libloader.jar,
10731 [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
10732 [AC_MSG_ERROR(libloader.jar replacement not found.)]
10737 AC_CHECK_FILE($LIBLOADER_JAR, [],
10738 [AC_MSG_ERROR(libloader.jar not found.)], [])
10741 if test -z $LIBFORMULA_JAR; then
10742 AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
10743 [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
10745 AC_CHECK_FILE(/usr/share/java/libformula.jar,
10746 [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
10747 [AC_MSG_ERROR(libformula.jar replacement not found.)]
10752 AC_CHECK_FILE($LIBFORMULA_JAR, [],
10753 [AC_MSG_ERROR(libformula.jar not found.)], [])
10756 if test -z $LIBREPOSITORY_JAR; then
10757 AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
10758 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
10760 AC_CHECK_FILE(/usr/share/java/librepository.jar,
10761 [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
10762 [AC_MSG_ERROR(librepository.jar replacement not found.)]
10767 AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
10768 [AC_MSG_ERROR(librepository.jar not found.)], [])
10771 if test -z $LIBFONTS_JAR; then
10772 AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
10773 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
10775 AC_CHECK_FILE(/usr/share/java/libfonts.jar,
10776 [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
10777 [AC_MSG_ERROR(libfonts.jar replacement not found.)]
10782 AC_CHECK_FILE($LIBFONTS_JAR, [],
10783 [AC_MSG_ERROR(libfonts.jar not found.)], [])
10786 if test -z $LIBSERIALIZER_JAR; then
10787 AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
10788 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
10790 AC_CHECK_FILE(/usr/share/java/libserializer.jar,
10791 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
10792 [AC_MSG_ERROR(libserializer.jar replacement not found.)]
10797 AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
10798 [AC_MSG_ERROR(libserializer.jar not found.)], [])
10801 if test -z $LIBBASE_JAR; then
10802 AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
10803 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
10805 AC_CHECK_FILE(/usr/share/java/libbase.jar,
10806 [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
10807 [AC_MSG_ERROR(libbase.jar replacement not found.)]
10812 AC_CHECK_FILE($LIBBASE_JAR, [],
10813 [AC_MSG_ERROR(libbase.jar not found.)], [])
10817 AC_MSG_RESULT([internal])
10818 SYSTEM_JFREEREPORT=
10819 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10822 AC_MSG_RESULT([no])
10823 ENABLE_REPORTBUILDER=
10824 SYSTEM_JFREEREPORT=
10826 AC_SUBST(ENABLE_REPORTBUILDER)
10827 AC_SUBST(SYSTEM_JFREEREPORT)
10829 AC_SUBST(LIBXML_JAR)
10830 AC_SUBST(FLUTE_JAR)
10831 AC_SUBST(JFREEREPORT_JAR)
10832 AC_SUBST(LIBBASE_JAR)
10833 AC_SUBST(LIBLAYOUT_JAR)
10834 AC_SUBST(LIBLOADER_JAR)
10835 AC_SUBST(LIBFORMULA_JAR)
10836 AC_SUBST(LIBREPOSITORY_JAR)
10837 AC_SUBST(LIBFONTS_JAR)
10838 AC_SUBST(LIBSERIALIZER_JAR)
10840 # this has to be here because both the Wiki Publisher and the SRB use
10842 if test "$ENABLE_MEDIAWIKI" = "TRUE" -o "$ENABLE_REPORTBUILDER" = "TRUE"; then
10843 AC_MSG_CHECKING([which Apache commons-* libs to use])
10844 if test "$with_system_apache_commons" = "yes"; then
10845 SYSTEM_APACHE_COMMONS=TRUE
10846 AC_MSG_RESULT([external])
10847 if test "$ENABLE_MEDIAWIKI" = "TRUE"; then
10848 if test -z $COMMONS_CODEC_JAR; then
10849 _commons_codec_path=""
10850 if test "$HAVE_JAVA6" = "TRUE"; then
10851 _commons_codec_path="/usr/share/java/commons-codec-1.9.jar"
10853 _commons_codec_path="/usr/share/java/commons-codec-1.6.jar"
10855 AC_CHECK_FILE($_commons_codec_path,
10856 [ COMMONS_CODEC_JAR=$_commons_codec_path ],
10858 AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
10859 [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
10860 [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
10865 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
10866 [AC_MSG_ERROR(commons-codec.jar not found.)], [])
10869 if test -z $COMMONS_LANG_JAR; then
10870 _commons_lang_path=""
10871 if test "$HAVE_JAVA6" = "TRUE"; then
10872 _commons_lang_path="/usr/share/java/commons-lang3-3.3.1-src.tar.gz"
10874 _commons_lang_path="/usr/share/java/commons-lang-2.4.jar"
10876 AC_CHECK_FILE($_commons_lang_path,
10877 [ COMMONS_LANG_JAR=$commons_lang_path ],
10879 AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
10880 [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
10881 [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
10886 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
10887 [AC_MSG_ERROR(commons-lang.jar not found.)], [])
10890 if test -z $COMMONS_HTTPCLIENT_JAR; then
10891 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
10892 [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
10894 AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
10895 [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
10896 [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
10901 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
10902 [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
10905 if test "$ENABLE_MEDIAWIKI" = "TRUE" -o "$ENABLE_REPORTBUILDER" = "TRUE"; then
10906 if test -z $COMMONS_LOGGING_JAR; then
10907 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.3.jar,
10908 [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.3.jar ],
10910 AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
10911 [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
10912 [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
10917 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
10918 [AC_MSG_ERROR(commons-logging.jar not found.)], [])
10922 AC_MSG_RESULT([internal])
10923 SYSTEM_APACHE_COMMONS=
10924 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
10927 AC_SUBST(SYSTEM_APACHE_COMMONS)
10928 AC_SUBST(COMMONS_CODEC_JAR)
10929 AC_SUBST(COMMONS_LANG_JAR)
10930 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
10931 AC_SUBST(COMMONS_LOGGING_JAR)
10933 # scripting provider for BeanShell?
10934 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10935 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10936 AC_MSG_RESULT([yes])
10937 ENABLE_SCRIPTING_BEANSHELL=TRUE
10939 dnl ===================================================================
10940 dnl Check for system beanshell
10941 dnl ===================================================================
10942 AC_MSG_CHECKING([which beanshell to use])
10943 if test "$with_system_beanshell" = "yes"; then
10944 AC_MSG_RESULT([external])
10946 if test -z $BSH_JAR; then
10947 BSH_JAR=/usr/share/java/bsh.jar
10949 AC_CHECK_FILE($BSH_JAR, [],
10950 [AC_MSG_ERROR(bsh.jar not found.)], [])
10952 AC_MSG_RESULT([internal])
10954 BUILD_TYPE="$BUILD_TYPE BSH"
10957 AC_MSG_RESULT([no])
10958 ENABLE_SCRIPTING_BEANSHELL=
10959 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10961 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10962 AC_SUBST(SYSTEM_BSH)
10965 # scripting provider for JavaScript?
10966 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10967 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10968 AC_MSG_RESULT([yes])
10969 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10971 dnl ===================================================================
10972 dnl Check for system rhino
10973 dnl ===================================================================
10974 AC_MSG_CHECKING([which rhino to use])
10975 if test "$with_system_rhino" = "yes"; then
10976 AC_MSG_RESULT([external])
10978 if test -z $RHINO_JAR; then
10979 RHINO_JAR=/usr/share/java/js.jar
10981 AC_CHECK_FILE($RHINO_JAR, [],
10982 [AC_MSG_ERROR(js.jar not found.)], [])
10984 AC_MSG_RESULT([internal])
10986 BUILD_TYPE="$BUILD_TYPE RHINO"
10989 AC_MSG_RESULT([no])
10990 ENABLE_SCRIPTING_JAVASCRIPT=
10991 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10993 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10994 AC_SUBST(SYSTEM_RHINO)
10995 AC_SUBST(RHINO_JAR)
10998 case "$host_cpu" in
10999 x86_64 | powerpc64 | s390x)
11000 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
11001 supports_multilib="yes"
11008 dnl ===================================================================
11009 dnl Check whether the TQt and TDE libraries are available.
11010 dnl ===================================================================
11014 if test "$_os" != "OpenBSD"; then
11017 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
11018 dnl Search paths for TQt and TDE
11019 if test -z "$supports_multilib"; then
11020 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"
11021 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"
11023 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"
11024 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"
11026 if test -n "$TQTDIR"; then
11027 tqt_incdirs="$TQTDIR/include $tqt_incdirs"
11028 if test -z "$supports_multilib"; then
11029 tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
11031 tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
11034 if test -z "$supports_multilib"; then
11035 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"
11036 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"
11038 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"
11039 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"
11041 if test -n "$TDEDIR"; then
11042 tde_incdirs="$TDEDIR/include $tde_incdirs"
11043 if test -z "$supports_multilib"; then
11044 tde_libdirs="$TDEDIR/lib $tde_libdirs"
11046 tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
11051 tqt_test_include="ntqstyle.h"
11052 tde_test_include="kapp.h"
11054 if test "$_os" != "OpenBSD"; then
11055 tqt_test_library="libtqt-mt.so"
11056 tde_test_library="libDCOP.so"
11058 tqt_test_library="libtqt-mt.so*"
11059 tde_test_library="libDCOP.so*"
11062 dnl Check for TQt headers
11063 AC_MSG_CHECKING([for TQt headers])
11065 for tde_check in $tqt_incdirs; do
11066 if test -r "$tde_check/$tqt_test_include"; then
11067 tqt_incdir="$tde_check"
11071 AC_MSG_RESULT([$tqt_incdir])
11072 if test "x$tqt_incdir" = "xno"; then
11073 AC_MSG_ERROR([TQt headers not found. Please specify the root of
11074 your TQt installation by exporting TQTDIR before running "configure".])
11077 dnl Check for TQt libraries
11078 AC_MSG_CHECKING([for TQt libraries])
11080 for tqt_check in $tqt_libdirs; do
11081 if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
11082 tqt_libdir="$tqt_check"
11086 AC_MSG_RESULT([$tqt_libdir])
11087 if test "x$tqt_libdir" = "xno"; then
11088 AC_MSG_ERROR([TQt libraries not found. Please specify the root of
11089 your TQt installation by exporting TQTDIR before running "configure".])
11092 dnl Check for Meta Object Compiler
11093 AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
11094 if test "$MOC" = "no"; then
11095 AC_MSG_ERROR([TQt Meta Object Compiler not found. Please specify
11096 the root of your TQt installation by exporting TQTDIR before running "configure".])
11099 dnl Check for TDE headers
11100 AC_MSG_CHECKING([for TDE headers])
11102 for tde_check in $tde_incdirs; do
11103 if test -r "$tde_check/$tde_test_include"; then
11104 tde_incdir="$tde_check"
11108 AC_MSG_RESULT([$tde_incdir])
11109 if test "x$tde_incdir" = "xno"; then
11110 AC_MSG_ERROR([TDE headers not found. Please specify the root of
11111 your TDE installation by exporting TDEDIR before running "configure".])
11114 dnl Check for TDE libraries
11115 AC_MSG_CHECKING([for TDE libraries])
11117 for tde_check in $tde_libdirs; do
11118 if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
11119 tde_libdir="$tde_check"
11123 AC_MSG_RESULT([$tde_libdir])
11124 if test "x$tde_libdir" = "xno"; then
11125 AC_MSG_ERROR([TDE libraries not found. Please specify the root of
11126 your TDE installation by exporting TDEDIR before running "configure".])
11129 dnl Set the variables
11130 TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11131 TDE_LIBS="-L$tde_libdir -L$tqt_libdir -ltdeio -ltdeui -ltdecore -ltqt -ltqt-mt"
11133 AC_SUBST(TDE_CFLAGS)
11137 dnl ===================================================================
11138 dnl Check whether the Qt3 and KDE3 libraries are available.
11139 dnl ===================================================================
11143 if test "$_os" != "OpenBSD"; then
11146 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE"; then
11147 dnl Search paths for Qt3 and KDE3
11148 if test -z "$supports_multilib"; then
11149 qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt3/include /usr/lib/qt/include /usr/share/qt3/include /usr/local/include/X11/qt3 $x_includes"
11150 qt_libdirs="$QTLIB /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib /usr/local/lib/qt3 $x_libraries"
11152 qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib64/qt3/include /usr/lib64/qt/include /usr/share/qt3/include /usr/lib/qt3/include /usr/lib/qt/include /usr/local/include/X11/qt3 $x_includes"
11153 qt_libdirs="$QTLIB /usr/local/qt/lib64 /usr/lib64/qt /usr/lib64 /usr/X11R6/lib64/X11/qt /usr/X11R6/lib64/qt /usr/lib64/qt3/lib64 /usr/lib64/qt/lib64 /usr/share/qt3/lib64 /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib /usr/local/lib/qt3 $x_libraries"
11155 if test -n "$QTDIR"; then
11156 qt_incdirs="$QTDIR/include $qt_incdirs"
11157 if test -z "$supports_multilib"; then
11158 qt_libdirs="$QTDIR/lib $qt_libdirs"
11160 qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
11163 if test -z "$supports_multilib"; then
11164 kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
11165 kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib $x_libraries"
11167 kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
11168 kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib64 $x_libraries"
11170 if test -n "$KDEDIR"; then
11171 kde_incdirs="$KDEDIR/include $kde_incdirs"
11172 if test -z "$supports_multilib"; then
11173 kde_libdirs="$KDEDIR/lib $kde_libdirs"
11175 kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
11180 qt_test_include="qstyle.h"
11181 kde_test_include="kapp.h"
11183 if test "$_os" != "OpenBSD"; then
11184 qt_test_library="libqt-mt.so"
11185 kde_test_library="libDCOP.so"
11187 qt_test_library="libqt-mt.so*"
11188 kde_test_library="libDCOP.so*"
11191 dnl Check for Qt3 headers
11192 AC_MSG_CHECKING([for Qt3 headers])
11194 for kde_check in $qt_incdirs; do
11195 if test -r "$kde_check/$qt_test_include"; then
11196 qt_incdir="$kde_check"
11200 AC_MSG_RESULT([$qt_incdir])
11201 if test "x$qt_incdir" = "xno"; then
11202 AC_MSG_ERROR([Qt3 headers not found. Please specify the root of
11203 your Qt3 installation by exporting QTDIR before running "configure".])
11206 dnl Check for Qt3 libraries
11207 AC_MSG_CHECKING([for Qt3 libraries])
11209 for qt_check in $qt_libdirs; do
11210 if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`"; then
11211 qt_libdir="$qt_check"
11215 AC_MSG_RESULT([$qt_libdir])
11216 if test "x$qt_libdir" = "xno"; then
11217 AC_MSG_ERROR([Qt3 libraries not found. Please specify the root of
11218 your Qt3 installation by exporting QTDIR before running "configure".])
11221 dnl Check for Meta Object Compiler
11222 AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
11223 if test "$MOC" = "no"; then
11224 AC_MSG_ERROR([Qt3 Meta Object Compiler not found. Please specify
11225 the root of your Qt3 installation by exporting QTDIR before running "configure".])
11228 dnl Check for KDE3 headers
11229 AC_MSG_CHECKING([for KDE3 headers])
11231 for kde_check in $kde_incdirs; do
11232 if test -r "$kde_check/$kde_test_include"; then
11233 kde_incdir="$kde_check"
11237 AC_MSG_RESULT([$kde_incdir])
11238 if test "x$kde_incdir" = "xno"; then
11239 AC_MSG_ERROR([KDE3 headers not found. Please specify the root of
11240 your KDE3 installation by exporting KDEDIR before running "configure".])
11243 dnl Check for KDE3 libraries
11244 AC_MSG_CHECKING([for KDE3 libraries])
11246 for kde_check in $kde_libdirs; do
11247 if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`"; then
11248 kde_libdir="$kde_check"
11252 AC_MSG_RESULT([$kde_libdir])
11253 if test "x$kde_libdir" = "xno"; then
11254 AC_MSG_ERROR([KDE3 libraries not found. Please specify the root of
11255 your KDE3 installation by exporting KDEDIR before running "configure".])
11258 dnl Set the variables
11259 KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11260 KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
11261 KDE_CFLAGS=$(printf '%s' "$KDE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11263 AC_SUBST(KDE_CFLAGS)
11267 dnl ===================================================================
11268 dnl KDE4 Integration
11269 dnl ===================================================================
11278 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
11279 qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
11280 qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
11282 kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
11283 kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
11285 if test -n "$supports_multilib"; then
11286 qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
11287 kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
11290 if test -n "$QTDIR"; then
11291 qt_incdirs="$QTDIR/include $qt_incdirs"
11292 if test -z "$supports_multilib"; then
11293 qt_libdirs="$QTDIR/lib $qt_libdirs"
11295 qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
11298 if test -n "$QT4DIR"; then
11299 qt_incdirs="$QT4DIR/include $qt_incdirs"
11300 if test -z "$supports_multilib"; then
11301 qt_libdirs="$QT4DIR/lib $qt_libdirs"
11303 qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
11307 if test -n "$KDEDIR"; then
11308 kde_incdirs="$KDEDIR/include $kde_incdirs"
11309 if test -z "$supports_multilib"; then
11310 kde_libdirs="$KDEDIR/lib $kde_libdirs"
11312 kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
11315 if test -n "$KDE4DIR"; then
11316 kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
11317 if test -z "$supports_multilib"; then
11318 kde_libdirs="$KDE4DIR/lib $kde_libdirs"
11320 kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
11324 qt_test_include="Qt/qobject.h"
11325 qt_test_library="libQtNetwork.so"
11326 kde_test_include="kwindowsystem.h"
11327 kde_test_library="libsolid.so"
11329 AC_MSG_CHECKING([for Qt4 headers])
11331 for inc_dir in $qt_incdirs; do
11332 if test -r "$inc_dir/$qt_test_include"; then
11333 qt_header_dir="$inc_dir"
11338 AC_MSG_RESULT([$qt_header_dir])
11339 if test "x$qt_header_dir" = "xno"; then
11340 AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11343 dnl Check for qmake
11344 AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
11346 if test "$QMAKE4" = "no"; then
11347 AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
11348 if test "$QMAKE4" = "no"; then
11349 AC_MSG_ERROR([Qmake not found. Please specify
11350 the root of your Qt installation by exporting QT4DIR before running "configure".])
11354 qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
11355 AC_MSG_CHECKING([for Qt4 libraries])
11357 for lib_dir in $qt_libdirs; do
11358 if test -r "$lib_dir/$qt_test_library"; then
11359 qt_lib_dir="$lib_dir"
11360 PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
11365 AC_MSG_RESULT([$qt_lib_dir])
11367 if test "x$qt_lib_dir" = "xno"; then
11368 AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11371 dnl Check for Meta Object Compiler
11373 AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11375 if test "$MOC4" = "no"; then
11376 AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11377 if test "$MOC4" = "no"; then
11378 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11379 the root of your Qt installation by exporting QT4DIR before running "configure".])
11383 dnl Check for KDE4 headers
11384 AC_MSG_CHECKING([for KDE4 headers])
11386 for kde_check in $kde_incdirs; do
11387 if test -r "$kde_check/$kde_test_include"; then
11388 kde_incdir="$kde_check"
11392 AC_MSG_RESULT([$kde_incdir])
11393 if test "x$kde_incdir" = "xno"; then
11394 AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11397 dnl Check for KDE4 libraries
11398 AC_MSG_CHECKING([for KDE4 libraries])
11400 for kde_check in $kde_libdirs; do
11401 if test -r "$kde_check/$kde_test_library"; then
11402 kde_libdir="$kde_check"
11407 AC_MSG_RESULT([$kde_libdir])
11408 if test "x$kde_libdir" = "xno"; then
11409 AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11412 PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
11413 KDE4_CFLAGS="-I$kde_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11414 KDE4_LIBS="-L$kde_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt_lib_dir $QT4_LIBS"
11415 KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11417 AC_LANG_PUSH([C++])
11418 save_CXXFLAGS=$CXXFLAGS
11419 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11420 AC_MSG_CHECKING([whether KDE is >= 4.2])
11421 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11422 #include <kdeversion.h>
11424 int main(int argc, char **argv) {
11425 if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
11428 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11429 CXXFLAGS=$save_CXXFLAGS
11432 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11433 # Sets also KDE_GLIB_CFLAGS/KDE_GLIB_LIBS if successful.
11434 PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
11437 AC_DEFINE(KDE_HAVE_GLIB,1)
11438 KDE_GLIB_CFLAGS=$(printf '%s' "$KDE_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11442 AC_LANG_PUSH([C++])
11443 save_CXXFLAGS=$CXXFLAGS
11444 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11446 LIBS="$LIBS $KDE4_LIBS"
11447 AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
11449 # Prepare meta object data
11450 TSTBASE="tst_exclude_socket_notifiers"
11451 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11452 ln -fs "${TSTMOC}.hxx"
11453 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11455 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11456 #include "tst_exclude_socket_notifiers.moc"
11458 int main(int argc, char *argv[])
11460 QCoreApplication app(argc, argv);
11461 exit(tst_processEventsExcludeSocket());
11465 AC_MSG_RESULT([yes])
11467 AC_MSG_RESULT([no])
11468 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11469 if test -z "$qt4_fix_warning"; then
11470 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11473 add_warning " https://bugreports.qt-project.org/browse/QTBUG-37380 (needed)"
11476 # Remove meta object data
11477 rm -f "${TSTBASE}."*
11479 AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
11481 # Prepare meta object data
11482 TSTBASE="tst_exclude_posted_events"
11483 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11484 ln -fs "${TSTMOC}.hxx"
11485 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11487 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11488 #include "tst_exclude_posted_events.moc"
11490 int main(int argc, char *argv[])
11492 QCoreApplication app(argc, argv);
11493 exit(tst_excludePostedEvents());
11497 AC_MSG_RESULT([yes])
11499 AC_MSG_RESULT([no])
11500 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11501 if test -z "$qt4_fix_warning"; then
11502 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11505 add_warning " https://bugreports.qt-project.org/browse/QTBUG-34614 (needed)"
11508 # Remove meta object data
11509 rm -f "${TSTBASE}."*
11511 if test -n "$qt4_fix_warning"; then
11512 add_warning " https://bugreports.qt-project.org/browse/QTBUG-38585 (recommended)"
11516 CXXFLAGS=$save_CXXFLAGS
11519 AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
11521 AC_SUBST(KDE4_CFLAGS)
11522 AC_SUBST(KDE4_LIBS)
11524 AC_SUBST(KDE_GLIB_CFLAGS)
11525 AC_SUBST(KDE_GLIB_LIBS)
11526 AC_SUBST(KDE_HAVE_GLIB)
11528 dnl ===================================================================
11529 dnl Test for the enabling the lockdown pieces
11530 dnl ===================================================================
11531 AC_MSG_CHECKING([whether to enable the lockdown pieces])
11533 if test -n "$enable_lockdown" -a "$enable_lockdown" != "no"; then
11534 ENABLE_LOCKDOWN=TRUE
11535 AC_MSG_RESULT([yes])
11537 AC_MSG_RESULT([no])
11539 AC_SUBST(ENABLE_LOCKDOWN)
11541 dnl ===================================================================
11542 dnl Test whether to include Evolution 2 support
11543 dnl ===================================================================
11544 AC_MSG_CHECKING([whether to enable evolution 2 support])
11545 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11546 AC_MSG_RESULT([yes])
11547 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11548 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11549 ENABLE_EVOAB2="TRUE"
11552 AC_MSG_RESULT([no])
11554 AC_SUBST(ENABLE_EVOAB2)
11555 AC_SUBST(GOBJECT_CFLAGS)
11556 AC_SUBST(GOBJECT_LIBS)
11558 dnl ===================================================================
11559 dnl Test whether to include TDE AB support
11560 dnl ===================================================================
11561 AC_MSG_CHECKING([whether to enable TDE address book support])
11562 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
11563 AC_MSG_RESULT([yes])
11564 AC_LANG_PUSH([C++])
11565 save_CXXFLAGS=$CXXFLAGS
11566 CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
11567 AC_MSG_CHECKING([whether TDE is at least R14.0])
11568 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11569 #include <tdeversion.h>
11571 int main(int argc, char **argv) {
11572 if (TDE_VERSION_MAJOR >= 14) return 0;
11575 ]])],[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])],[])
11576 CXXFLAGS=$save_CXXFLAGS
11580 AC_MSG_RESULT([no])
11583 AC_SUBST(ENABLE_TDEAB)
11585 dnl ===================================================================
11586 dnl Test whether to include KDE AB support
11587 dnl ===================================================================
11588 AC_MSG_CHECKING([whether to enable KDE address book support])
11589 if test "$enable_kdeab" = "yes" -a "$enable_kde" = "yes"; then
11590 AC_MSG_RESULT([yes])
11591 AC_LANG_PUSH([C++])
11592 save_CXXFLAGS=$CXXFLAGS
11593 CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
11594 AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
11595 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11596 #include <kdeversion.h>
11598 int main(int argc, char **argv) {
11599 if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
11602 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old or too recent, please use another version of KDE or disable KDE address book support])],[])
11603 CXXFLAGS=$save_CXXFLAGS
11607 AC_MSG_RESULT([no])
11610 AC_SUBST(ENABLE_KAB)
11612 dnl ===================================================================
11613 dnl Test which themes to include
11614 dnl ===================================================================
11615 AC_MSG_CHECKING([which themes to include])
11616 # if none given use default subset of available themes
11617 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11618 with_theme="crystal default galaxy hicontrast oxygen tango sifr"
11619 test -z "$ENABLE_RELEASE_BUILD" && with_theme="$with_theme tango_testing"
11623 if test "x$with_theme" != "xno"; then
11624 for theme in $with_theme; do
11626 crystal|default|galaxy|hicontrast|human|industrial|oxygen|sifr|tango|tango_testing) : ;;
11627 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11629 WITH_THEMES="$WITH_THEMES $theme"
11632 AC_MSG_RESULT([$WITH_THEMES])
11633 AC_SUBST([WITH_THEMES])
11635 dnl ===================================================================
11636 dnl Test whether to integrate helppacks into the product's installer
11637 dnl ===================================================================
11638 AC_MSG_CHECKING([for helppack integration])
11639 if test "$with_helppack_integration" = "no"; then
11640 WITH_HELPPACK_INTEGRATION=
11641 AC_MSG_RESULT([no integration])
11643 WITH_HELPPACK_INTEGRATION=TRUE
11644 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11645 AC_MSG_RESULT([integration])
11647 AC_SUBST(WITH_HELPPACK_INTEGRATION)
11649 ###############################################################################
11650 # Extensions checking
11651 ###############################################################################
11652 AC_MSG_CHECKING([for extensions integration])
11653 if test "x$enable_extension_integration" != "xno"; then
11654 WITH_EXTENSION_INTEGRATION=TRUE
11655 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11656 AC_MSG_RESULT([yes, use integration])
11658 WITH_EXTENSION_INTEGRATION=
11659 AC_MSG_RESULT([no, do not integrate])
11661 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11663 dnl Should any extra extensions be included?
11664 dnl There are standalone tests for each of these below.
11665 WITH_EXTRA_EXTENSIONS=
11666 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11668 libo_CHECK_EXTENSION([Watch Window],[WATCH_WINDOW],[watch_window],[watch-window],[23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt])
11669 libo_CHECK_EXTENSION([SmART Gallery (Diagram)],[DIAGRAM],[diagram],[diagram],[8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt])
11670 libo_CHECK_EXTENSION([Validator],[VALIDATOR],[validator],[validator],[bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt])
11671 libo_CHECK_EXTENSION([Barcode],[BARCODE],[barcode],[barcode],[3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt])
11672 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11673 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11674 libo_CHECK_EXTENSION([Hungarian Cross-reference Toolbar],[HUNART],[hunart],[hunart],[b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt])
11675 libo_CHECK_EXTENSION([Typography Toolbar],[TYPO],[typo],[typo],[9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt])
11676 libo_CHECK_EXTENSION([Google Docs],[GOOGLE_DOCS],[google_docs],[google-docs],[27211596cf0ad97cab7321239406fde0-gdocs_3.0.1_modified.oxt])
11677 if test "x$with_java" != "xno"; then
11678 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11679 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11682 dnl ===================================================================
11683 dnl Test whether to include Sun Professional Template Pack
11684 dnl ===================================================================
11685 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
11686 if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
11687 AC_MSG_RESULT([no integration])
11689 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
11690 sun_supported_langs="en-US de it fr es hu"
11691 if test "$with_sun_templates" = "yes"; then
11692 wanted_sun_templates="$sun_supported_langs"
11694 # check whether the langs are supported by Sun
11695 wanted_sun_templates=
11696 for lang in $with_sun_templates; do
11697 if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
11698 wanted_sun_templates="$wanted_sun_templates $lang"
11703 SUNTEMPLATES_DE_PACK=
11704 SUNTEMPLATES_EN_US_PACK=
11705 SUNTEMPLATES_ES_PACK=
11706 SUNTEMPLATES_FR_PACK=
11707 SUNTEMPLATES_HU_PACK=
11708 SUNTEMPLATES_IT_PACK=
11709 # check whether the langs are requested at all
11710 for lang in $wanted_sun_templates; do
11711 if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
11712 SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
11714 "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
11715 "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
11716 "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
11717 "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
11718 "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
11719 "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
11723 WITH_EXTRA_EXTENSIONS=TRUE
11724 AC_MSG_RESULT([$SUNTEMPLATES_LANG])
11726 AC_SUBST(SUNTEMPLATES_DE_PACK)
11727 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
11728 AC_SUBST(SUNTEMPLATES_ES_PACK)
11729 AC_SUBST(SUNTEMPLATES_FR_PACK)
11730 AC_SUBST(SUNTEMPLATES_HU_PACK)
11731 AC_SUBST(SUNTEMPLATES_IT_PACK)
11733 TEST_FONTS_MISSING=0
11736 # $2+ = accepted font mappings
11740 AC_MSG_CHECKING([font mapping for '$FONT'])
11741 FONTFILE="$(basename `$FCMATCH -f '%{file}' "$FONT"`)"
11742 FONTFILE_LOWER="$(echo $FONTFILE | $AWK '{print tolower($0)}')"
11744 TESTEXPR="'${FONTFILE_LOWER}' = '$(echo $FONT | $AWK '{print tolower($0)}').ttf'"
11746 MAPPING="$(echo $1 | $AWK '{print tolower($0)}')"; shift
11747 test -n "$MAPPING" || break
11748 TESTEXPR="${TESTEXPR} -o '${FONTFILE_LOWER}' = '$MAPPING-regular.ttf'"
11752 AC_MSG_RESULT([ok])
11754 AC_MSG_RESULT([unknown ($FONTFILE)])
11755 TEST_FONTS_MISSING=1
11759 dnl ===================================================================
11760 dnl Test whether to include fonts
11761 dnl ===================================================================
11762 AC_MSG_CHECKING([whether to include third-party fonts])
11763 if test "$with_fonts" != "no"; then
11764 AC_MSG_RESULT([yes])
11766 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11768 AC_MSG_RESULT([no])
11770 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11771 if test "$test_fontconfig" = "yes"; then
11772 AC_PATH_PROG([FCMATCH], [fc-match])
11773 if test -z "$FCMATCH"; then
11774 AC_MSG_WARN([Unable to query installed fonts - unit tests disabled.])
11775 TEST_FONTS_MISSING=1
11777 test_font_map 'Calibri' 'Carlito'
11778 if test ${TEST_FONTS_MISSING} -eq 1
11780 AC_MSG_WARN([Unknown font mappings - unit tests disabled.])
11784 TEST_FONTS_MISSING=0
11787 AC_SUBST(WITH_FONTS)
11788 AC_DEFINE_UNQUOTED([TEST_FONTS_MISSING], $TEST_FONTS_MISSING)
11790 dnl ===================================================================
11791 dnl Test whether to include ppds
11792 dnl ===================================================================
11793 AC_MSG_CHECKING([whether to include PPDs])
11794 if test "$with_ppds" != "no"; then
11795 AC_MSG_RESULT([yes])
11798 AC_MSG_RESULT([no])
11800 SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
11802 AC_SUBST(WITHOUT_PPDS)
11804 dnl ===================================================================
11805 dnl Test whether to include extra galleries
11806 dnl ===================================================================
11807 AC_MSG_CHECKING([whether to include extra galleries])
11808 if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
11809 AC_MSG_RESULT([no])
11810 WITH_EXTRA_GALLERY=
11811 OOOP_GALLERY_PACK=""
11813 AC_MSG_RESULT([yes])
11814 WITH_EXTRA_GALLERY=TRUE
11815 BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
11816 SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
11817 OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
11819 AC_SUBST(WITH_EXTRA_GALLERY)
11820 AC_SUBST(OOOP_GALLERY_PACK)
11822 dnl ===================================================================
11823 dnl Test whether to include extra templates
11824 dnl ===================================================================
11825 AC_MSG_CHECKING([whether to include extra templates])
11826 if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
11827 AC_MSG_RESULT([no])
11828 WITH_EXTRA_TEMPLATE=
11829 OOOP_TEMPLATES_PACK=""
11831 AC_MSG_RESULT([yes])
11832 WITH_EXTRA_TEMPLATE=TRUE
11833 BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
11834 SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
11835 OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
11837 AC_SUBST(WITH_EXTRA_TEMPLATE)
11838 AC_SUBST(OOOP_TEMPLATES_PACK)
11840 dnl ===================================================================
11841 dnl Test whether to include extra samples
11842 dnl ===================================================================
11843 AC_MSG_CHECKING([whether to include extra samples])
11844 if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
11845 AC_MSG_RESULT([no])
11847 OOOP_SAMPLES_PACK=""
11849 AC_MSG_RESULT([yes])
11850 WITH_EXTRA_SAMPLE=TRUE
11851 BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
11852 SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
11853 OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
11855 AC_SUBST(WITH_EXTRA_SAMPLE)
11856 AC_SUBST(OOOP_SAMPLES_PACK)
11858 dnl ===================================================================
11859 dnl Test whether to include extra fonts
11860 dnl ===================================================================
11861 AC_MSG_CHECKING([whether to include extra fonts])
11862 if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
11863 AC_MSG_RESULT([no])
11867 AC_MSG_RESULT([yes])
11868 WITH_EXTRA_FONT=TRUE
11869 BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
11870 SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
11871 OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
11873 AC_SUBST(WITH_EXTRA_FONT)
11874 AC_SUBST(OOOP_FONTS_PACK)
11876 dnl ===================================================================
11877 dnl Test whether to enable online update service
11878 dnl ===================================================================
11879 AC_MSG_CHECKING([whether to enable online update])
11880 ENABLE_ONLINE_UPDATE=
11881 if test "$enable_online_update" = ""; then
11882 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11883 AC_MSG_RESULT([yes])
11884 ENABLE_ONLINE_UPDATE="TRUE"
11886 AC_MSG_RESULT([no])
11889 if test "$enable_online_update" = "yes"; then
11890 AC_MSG_RESULT([yes])
11891 ENABLE_ONLINE_UPDATE="TRUE"
11893 AC_MSG_RESULT([no])
11896 AC_SUBST(ENABLE_ONLINE_UPDATE)
11898 dnl ===================================================================
11899 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11900 dnl ===================================================================
11901 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11902 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11903 AC_MSG_RESULT([no])
11906 AC_MSG_RESULT([yes])
11907 ENABLE_SILENT_MSI=TRUE
11908 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11910 AC_SUBST(ENABLE_SILENT_MSI)
11912 AC_MSG_CHECKING([whether and how to use Xinerama])
11913 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11914 if test "$x_libraries" = "default_x_libraries"; then
11915 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11916 if test "x$XINERAMALIB" = x; then
11917 XINERAMALIB="/usr/lib"
11920 XINERAMALIB="$x_libraries"
11922 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11923 # we have both versions, let the user decide but use the dynamic one
11926 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11927 XINERAMA_LINK=dynamic
11929 XINERAMA_LINK=static
11931 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11932 # we have only the dynamic version
11934 XINERAMA_LINK=dynamic
11935 elif test -e "$XINERAMALIB/libXinerama.a"; then
11937 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11939 XINERAMA_LINK=static
11949 if test "$USE_XINERAMA" = "TRUE"; then
11950 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11951 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11952 [AC_MSG_ERROR(Xinerama header not found.)], [])
11953 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11954 if test "x$XEXTLIB" = x; then
11955 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11957 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11958 if test "$_os" = "FreeBSD"; then
11959 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11961 if test "$_os" = "Linux"; then
11962 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11964 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11965 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11967 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11972 AC_MSG_RESULT([no])
11974 AC_SUBST(USE_XINERAMA)
11975 AC_SUBST(XINERAMA_LINK)
11977 dnl ===================================================================
11978 dnl Test whether to build cairo or rely on the system version
11979 dnl ===================================================================
11981 if test "$GUIBASE" = "unx"; then
11982 # Used in vcl/Library_vclplug_gen.mk
11986 if test "$test_cairo" = "yes"; then
11987 AC_MSG_CHECKING([whether to use the system cairo])
11989 : ${with_system_cairo:=$with_system_libs}
11990 if test "$with_system_cairo" = "yes"; then
11992 AC_MSG_RESULT([yes])
11994 PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
11995 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11997 if test "$test_xrender" = "yes"; then
11998 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
12000 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
12001 #ifdef PictStandardA8
12005 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
12009 libo_MINGW_CHECK_DLL([libcairo])
12010 libo_MINGW_TRY_DLL([libfontconfig])
12011 libo_MINGW_TRY_DLL([libfreetype])
12012 libo_MINGW_TRY_DLL([libpixman])
12013 libo_MINGW_TRY_DLL([libpng15])
12016 AC_MSG_RESULT([no])
12018 BUILD_TYPE="$BUILD_TYPE CAIRO"
12019 SCPDEFS="$SCPDEFS -DNEED_CAIRO"
12023 AC_SUBST(SYSTEM_CAIRO)
12024 AC_SUBST(CAIRO_CFLAGS)
12025 AC_SUBST(CAIRO_LIBS)
12027 dnl ===================================================================
12028 dnl Test whether to use avahi
12029 dnl ===================================================================
12030 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
12031 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
12032 [ENABLE_AVAHI="TRUE"])
12033 AC_DEFINE(HAVE_FEATURE_AVAHI)
12034 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12037 AC_SUBST(ENABLE_AVAHI)
12038 AC_SUBST(AVAHI_CFLAGS)
12039 AC_SUBST(AVAHI_LIBS)
12041 dnl ===================================================================
12042 dnl Test whether to use liblangtag
12043 dnl ===================================================================
12046 AC_MSG_CHECKING([whether to use liblangtag])
12047 if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a $_os != Android -a $_os != iOS \); then
12048 ENABLE_LIBLANGTAG=TRUE
12049 AC_MSG_RESULT([yes])
12050 AC_MSG_CHECKING([whether to use system liblangtag])
12051 if test "$with_system_liblangtag" = yes; then
12052 SYSTEM_LIBLANGTAG=TRUE
12053 AC_MSG_RESULT([yes])
12054 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
12055 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
12056 libo_MINGW_CHECK_DLL([liblangtag])
12059 AC_MSG_RESULT([no])
12060 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
12061 if test "$COM" = "MSC"; then
12062 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs/liblangtag.lib"
12064 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs -llangtag"
12068 AC_MSG_RESULT([no])
12070 AC_SUBST(ENABLE_LIBLANGTAG)
12071 AC_SUBST(SYSTEM_LIBLANGTAG)
12072 AC_SUBST(LIBLANGTAG_CFLAGS)
12073 AC_SUBST(LIBLANGTAG_LIBS)
12075 dnl ===================================================================
12076 dnl Test whether to build libpng or rely on the system version
12077 dnl ===================================================================
12079 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/png"],["-L${WORKDIR}/LinkTarget/StaticLibrary -lpng"])
12081 dnl ===================================================================
12082 dnl Check for runtime JVM search path
12083 dnl ===================================================================
12084 if test "$ENABLE_JAVA" != ""; then
12085 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
12086 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
12087 AC_MSG_RESULT([yes])
12088 if ! test -d "$with_jvm_path"; then
12089 AC_MSG_ERROR(["$with_jvm_path" not a directory])
12091 if ! test -d "$with_jvm_path"jvm; then
12092 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
12094 JVM_ONE_PATH_CHECK="$with_jvm_path"
12095 AC_SUBST(JVM_ONE_PATH_CHECK)
12097 AC_MSG_RESULT([no])
12101 dnl ===================================================================
12102 dnl Test for the presence of Ant and that it works
12103 dnl ===================================================================
12105 if test "$ENABLE_JAVA" != ""; then
12106 ANT_HOME=; export ANT_HOME
12107 WITH_ANT_HOME=; export WITH_ANT_HOME
12108 if test -z "$with_ant_home"; then
12109 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
12111 if test "$_os" = "WINNT"; then
12112 # AC_PATH_PROGS needs unix path
12113 with_ant_home=`cygpath -u "$with_ant_home"`
12115 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
12116 WITH_ANT_HOME=$with_ant_home
12117 ANT_HOME=$with_ant_home
12120 if test -z "$ANT"; then
12121 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
12123 # resolve relative or absolute symlink
12124 while test -h "$ANT"; do
12126 a_basename=`basename "$ANT"`
12127 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
12128 cd "`dirname "$ANT"`"
12129 cd "`dirname "$a_script"`"
12130 ANT="`pwd`"/"`basename "$a_script"`"
12134 AC_MSG_CHECKING([if $ANT works])
12135 cat > conftest.java << EOF
12136 public class conftest {
12137 int testmethod(int a, int b) {
12143 cat > conftest.xml << EOF
12144 <project name="conftest" default="conftest">
12145 <target name="conftest">
12146 <javac srcdir="." includes="conftest.java">
12152 oldJAVA_HOME=$JAVA_HOME
12153 if test "$JAVACISGCJ" = "yes"; then
12154 JAVA_HOME=; export JAVA_HOME
12155 ant_gcj="-Dbuild.compiler=gcj"
12157 AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
12158 if test $? = 0 -a -f ./conftest.class; then
12159 AC_MSG_RESULT([Ant works])
12160 if test -z "$WITH_ANT_HOME"; then
12161 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
12162 if test -z "$ANT_HOME"; then
12163 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
12166 ANT_HOME="$WITH_ANT_HOME"
12169 echo "configure: Ant test failed" >&5
12170 cat conftest.java >&5
12171 cat conftest.xml >&5
12172 AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
12174 add_warning "Ant does not work - Some Java projects will not build!"
12176 JAVA_HOME=$oldJAVA_HOME
12177 rm -f conftest* core core.* *.core
12179 if test -z "$ANT_HOME"; then
12180 ANT_HOME="NO_ANT_HOME"
12182 PathFormat "$ANT_HOME"
12183 ANT_HOME="$formatted_path"
12185 ANT="$formatted_path"
12190 dnl Checking for ant.jar
12191 if test "$ANT_HOME" != "NO_ANT_HOME"; then
12192 AC_MSG_CHECKING([Ant lib directory])
12193 if test -f $ANT_HOME/lib/ant.jar; then
12194 ANT_LIB="$ANT_HOME/lib"
12196 if test -f $ANT_HOME/ant.jar; then
12197 ANT_LIB="$ANT_HOME"
12199 if test -f /usr/share/java/ant.jar; then
12200 ANT_LIB=/usr/share/java
12202 if test -f /usr/share/ant-core/lib/ant.jar; then
12203 ANT_LIB=/usr/share/ant-core/lib
12205 if test -f $ANT_HOME/lib/ant/ant.jar; then
12206 ANT_LIB="$ANT_HOME/lib/ant"
12208 if test -f /usr/share/lib/ant/ant.jar; then
12209 ANT_LIB=/usr/share/lib/ant
12211 AC_MSG_ERROR([Ant libraries not found!])
12218 PathFormat "$ANT_LIB"
12219 ANT_LIB="$formatted_path"
12220 AC_MSG_RESULT([Ant lib directory found.])
12225 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
12227 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
12228 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
12229 ant_version_major=`echo $ant_version | cut -d. -f1`
12230 ant_version_minor=`echo $ant_version | cut -d. -f2`
12231 echo "configure: ant_version $ant_version " >&5
12232 echo "configure: ant_version_major $ant_version_major " >&5
12233 echo "configure: ant_version_minor $ant_version_minor " >&5
12234 if test "$ant_version_major" -ge "2"; then
12235 AC_MSG_RESULT([yes, $ant_version])
12236 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
12237 AC_MSG_RESULT([yes, $ant_version])
12239 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
12242 if test "$ENABLE_MEDIAWIKI" = "TRUE"; then
12243 AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
12246 cat > conftest.java << EOF
12247 public class conftest {
12248 int testmethod(int a, int b) {
12254 cat > conftest.xml << EOF
12255 <project name="conftest" default="conftest">
12256 <target name="conftest" depends="copytest">
12257 <javac srcdir="." includes="conftest.java">
12260 <target name="copytest">
12261 <copy todir="confdir">
12262 <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
12264 <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
12270 if test "$JAVACISGCJ" = "yes"; then
12271 JAVA_HOME=; export JAVA_HOME
12272 ant_gcj="-Dbuild.compiler=gcj"
12274 AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
12275 if test $? = 0 -a -f ./conftest.class; then
12276 AC_MSG_RESULT([yes])
12279 echo "configure: Ant test failed" >&5
12280 cat conftest.java >&5
12281 cat conftest.xml >&5
12283 AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
12286 rm -f conftest* core core.* *.core
12290 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12291 AC_MSG_CHECKING([for JUnit 4])
12292 if test "$with_junit" = "yes"; then
12293 if test -e /usr/share/java/junit4.jar; then
12294 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
12296 if test -e /usr/share/lib/java/junit.jar; then
12297 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
12299 OOO_JUNIT_JAR=/usr/share/java/junit.jar
12303 OOO_JUNIT_JAR=$with_junit
12305 if test "$_os" = "WINNT"; then
12306 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
12308 printf 'import org.junit.Before; import org.hamcrest.BaseDescription;' \
12310 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
12311 AC_MSG_RESULT([$OOO_JUNIT_JAR])
12314 [cannot find JUnit 4 jar, or JUnit 4 jar does not provide Hamcrest; please
12315 install one in the default location (/usr/share/java), specify its pathname via
12316 --with-junit=..., or disable it via --without-junit])
12318 rm -f conftestj.class conftestj.java
12319 if test $OOO_JUNIT_JAR != ""; then
12320 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
12323 AC_SUBST(OOO_JUNIT_JAR)
12329 # check for wget and curl
12334 if test "$enable_fetch_external" != "no"; then
12336 CURL=`which curl 2>/dev/null`
12338 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12339 eval "$i --version" > /dev/null 2>&1
12341 if test $ret -eq 0; then
12347 if test -z "$WGET" -a -z "$CURL"; then
12348 AC_MSG_ERROR([neither wget nor curl found!])
12361 for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
12362 if test "$i" = "md5"; then
12363 eval "$i -x" > /dev/null 2>&1
12365 eval "$i --version" > /dev/null 2>&1
12368 if test $ret -eq 0; then
12374 if test "$MD5SUM" = "md5"; then
12375 if md5 -r < /dev/null > /dev/null 2>/dev/null; then
12376 MD5SUM="$MD5SUM -r"
12377 elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
12378 MD5SUM="$MD5SUM -n"
12382 if test -z "$MD5SUM"; then
12383 AC_MSG_ERROR([no md5sum: found!])
12388 dnl ===================================================================
12389 dnl Dealing with l10n options
12390 dnl ===================================================================
12391 AC_MSG_CHECKING([which languages to be built])
12392 # get list of all languages
12393 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12394 # the sed command does the following:
12395 # + if a line ends with a backslash, append the next line to it
12396 # + adds " on the beginning of the value (after =)
12397 # + adds " at the end of the value
12398 # + removes en-US; we want to put it on the beginning
12399 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12400 [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)]
12401 ALL_LANGS="en-US $completelangiso"
12402 # check the configured localizations
12403 WITH_LANG="$with_lang"
12404 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12405 AC_MSG_RESULT([en-US])
12407 AC_MSG_RESULT([$WITH_LANG])
12408 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12410 # check that the list is valid
12411 for lang in $WITH_LANG; do
12412 test "$lang" = "ALL" && continue
12413 # need to check for the exact string, so add space before and after the list of all languages
12414 for vl in $ALL_LANGS; do
12415 if test "$vl" = "$lang"; then
12419 if test "$vl" != "$lang"; then
12420 # if you're reading this - you prolly quoted your languages remove the quotes ...
12421 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12424 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12425 echo $WITH_LANG | grep -q en-US
12426 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12428 # list with substituted ALL
12429 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12430 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12431 test "$WITH_LANG" = "en-US" && WITH_LANG=
12432 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12433 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12434 ALL_LANGS=`echo $ALL_LANGS qtz`
12436 AC_SUBST(ALL_LANGS)
12437 AC_SUBST(WITH_LANG)
12438 AC_SUBST(WITH_LANG_LIST)
12439 AC_SUBST(GIT_NEEDED_SUBMODULES)
12441 WITH_POOR_HELP_LOCALIZATIONS=
12442 if test -d "$SRC_ROOT/translations/source"; then
12443 for l in `ls -1 $SRC_ROOT/translations/source`; do
12444 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12445 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12449 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12451 if test -n "$with_locales"; then
12452 WITH_LOCALES="$with_locales"
12454 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12455 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12456 # config_host/config_locales.h.in
12457 for locale in $WITH_LOCALES; do
12460 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12464 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12467 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12472 AC_DEFINE(WITH_LOCALE_ALL)
12474 AC_SUBST(WITH_LOCALES)
12476 dnl git submodule update --reference
12477 dnl ===================================================================
12478 if test -n "${GIT_REFERENCE_SRC}"; then
12479 for repo in ${GIT_NEEDED_SUBMODULES}; do
12480 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12481 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12485 AC_SUBST(GIT_REFERENCE_SRC)
12487 dnl git submodules linked dirs
12488 dnl ===================================================================
12489 if test -n "${GIT_LINK_SRC}"; then
12490 for repo in ${GIT_NEEDED_SUBMODULES}; do
12491 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12492 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12496 AC_SUBST(GIT_LINK_SRC)
12499 dnl ===================================================================
12500 AC_MSG_CHECKING([for alternative branding images directory])
12501 # initialize mapped arrays
12502 BRAND_INTRO_IMAGES="flat_logo.svg intro.png"
12503 brand_files="$BRAND_INTRO_IMAGES about.svg"
12505 if test -z "$with_branding" -o "$with_branding" = "no"; then
12506 AC_MSG_RESULT([none])
12507 DEFAULT_BRAND_IMAGES="$brand_files"
12509 if ! test -d $with_branding ; then
12510 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12512 AC_MSG_RESULT([$with_branding])
12513 CUSTOM_BRAND_DIR="$with_branding"
12514 for lfile in $brand_files
12516 if ! test -f $with_branding/$lfile ; then
12517 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12518 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12520 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12523 check_for_progress="yes"
12526 AC_SUBST([BRAND_INTRO_IMAGES])
12527 AC_SUBST([CUSTOM_BRAND_DIR])
12528 AC_SUBST([CUSTOM_BRAND_IMAGES])
12529 AC_SUBST([DEFAULT_BRAND_IMAGES])
12532 AC_MSG_CHECKING([for 'intro' progress settings])
12536 PROGRESSFRAMECOLOR=
12538 PROGRESSTEXTBASELINE=
12540 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12541 source "$with_branding/progress.conf"
12542 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12544 AC_MSG_RESULT([none])
12547 AC_SUBST(PROGRESSBARCOLOR)
12548 AC_SUBST(PROGRESSSIZE)
12549 AC_SUBST(PROGRESSPOSITION)
12550 AC_SUBST(PROGRESSFRAMECOLOR)
12551 AC_SUBST(PROGRESSTEXTCOLOR)
12552 AC_SUBST(PROGRESSTEXTBASELINE)
12555 AC_MSG_CHECKING([for extra build ID])
12556 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12557 EXTRA_BUILDID="$with_extra_buildid"
12559 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12560 if test -n "$EXTRA_BUILDID" ; then
12561 AC_MSG_RESULT([$EXTRA_BUILDID])
12563 AC_MSG_RESULT([not set])
12565 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12568 AC_MSG_CHECKING([for vendor])
12569 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12570 OOO_VENDOR="$USERNAME"
12572 if test -z "$OOO_VENDOR"; then
12576 if test -z "$OOO_VENDOR"; then
12577 OOO_VENDOR="`id -u -n`"
12580 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12582 OOO_VENDOR="$with_vendor"
12583 AC_MSG_RESULT([$OOO_VENDOR])
12585 AC_SUBST(OOO_VENDOR)
12587 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12588 if test "$with_compat_oowrappers" = "yes"; then
12589 WITH_COMPAT_OOWRAPPERS=TRUE
12592 WITH_COMPAT_OOWRAPPERS=
12595 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12597 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12598 AC_MSG_CHECKING([for install dirname])
12599 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12600 INSTALLDIRNAME="$with_install_dirname"
12602 AC_MSG_RESULT([$INSTALLDIRNAME])
12603 AC_SUBST(INSTALLDIRNAME)
12605 AC_MSG_CHECKING([for prefix])
12606 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12607 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12608 PREFIXDIR="$prefix"
12609 AC_MSG_RESULT([$PREFIXDIR])
12610 AC_SUBST(PREFIXDIR)
12612 LIBDIR=[$(eval echo $(eval echo $libdir))]
12615 DATADIR=[$(eval echo $(eval echo $datadir))]
12618 MANDIR=[$(eval echo $(eval echo $mandir))]
12621 DOCDIR=[$(eval echo $(eval echo $docdir))]
12624 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12625 AC_SUBST(INSTALLDIR)
12627 TESTINSTALLDIR="${BUILDDIR}/test-install"
12628 AC_SUBST(TESTINSTALLDIR)
12631 # ===================================================================
12632 # OAuth2 id and secrets
12633 # ===================================================================
12635 AC_MSG_CHECKING([for Google Drive client id and secret])
12636 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12637 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12638 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12639 GDRIVE_CLIENT_ID="\"\""
12642 if test "$with_gdrive_client_secret" = "no" -o -z "$with_gdrive_client_secret"; then
12643 GDRIVE_CLIENT_SECRET="\"\""
12646 if test -z "$GDRIVE_CLIENT_ID" -o -z "$GDRIVE_CLIENT_SECRET"; then
12647 AC_MSG_RESULT([not set])
12649 AC_MSG_RESULT([set])
12652 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12653 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12655 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12656 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12657 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12658 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12659 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12662 if test "$with_alfresco_cloud_client_secret" = "no" -o -z "$with_alfresco_cloud_client_secret"; then
12663 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12666 if test -z "$ALFRESCO_CLOUD_CLIENT_ID" -o -z "$ALFRESCO_CLOUD_CLIENT_SECRET"; then
12667 AC_MSG_RESULT([not set])
12669 AC_MSG_RESULT([set])
12671 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12672 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12674 # ===================================================================
12675 # De- or increase default verbosity of build process
12676 # ===================================================================
12677 AC_MSG_CHECKING([build verbosity])
12678 if test -n "$enable_verbose"; then
12679 if test "$enable_verbose" = "yes"; then
12681 AC_MSG_RESULT([high])
12683 if test "$enable_verbose" = "no"; then
12685 AC_MSG_RESULT([low])
12688 AC_MSG_RESULT([not set])
12692 dnl ===================================================================
12693 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12694 dnl --enable-dependency-tracking configure option
12695 dnl ===================================================================
12696 AC_MSG_CHECKING([whether to enable dependency tracking])
12697 if test "$enable_dependency_tracking" = "no"; then
12699 AC_MSG_RESULT([no])
12701 AC_MSG_RESULT([yes])
12705 dnl ===================================================================
12706 dnl Number of CPUs to use during the build
12707 dnl ===================================================================
12708 AC_MSG_CHECKING([for number of processors to use])
12709 # plain --with-parallelism is just the default
12710 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12711 if test "$with_parallelism" = "no"; then
12714 PARALLELISM=$with_parallelism
12717 if test "$enable_icecream" = "yes"; then
12722 Darwin|FreeBSD|NetBSD|OpenBSD)
12723 PARALLELISM=`sysctl -n hw.ncpu`
12727 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12729 # what else than above does profit here *and* has /proc?
12731 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12735 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12736 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12740 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12741 if test -z "$with_parallelism"; then
12742 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12743 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12746 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."
12750 if test $PARALLELISM -eq 0; then
12751 AC_MSG_RESULT([explicit make -j option needed])
12753 AC_MSG_RESULT([$PARALLELISM])
12755 AC_SUBST(PARALLELISM)
12758 # Set up ILIB for MSVC build
12760 if test "$build_os" = "cygwin"; then
12762 if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
12763 ILIB="$ILIB;$JAVA_HOME/lib"
12765 if test "$BITNESS_OVERRIDE" = 64; then
12766 ILIB="$ILIB;$COMPATH/lib/amd64"
12767 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12768 if test "$WINDOWS_SDK_VERSION" = "80"; then
12769 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x64"
12772 ILIB="$ILIB;$COMPATH/lib"
12773 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12774 if test "$WINDOWS_SDK_VERSION" = "80"; then
12775 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x86"
12778 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12780 if test "$ENABLE_DIRECTX" = "TRUE"; then
12781 ILIB="$ILIB;$DIRECTXSDK_LIB"
12787 # ===================================================================
12788 # Creating bigger shared library to link against
12789 # ===================================================================
12790 AC_MSG_CHECKING([whether to create huge library])
12793 if test $_os = iOS -o $_os = Android; then
12794 # Never any point in mergelibs for these as we build just static
12795 # libraries anyway...
12796 enable_mergelibs=no
12799 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12800 if test $_os != Linux -a $_os != WINNT; then
12801 add_warning "--enable-mergelibs is not tested for this platform"
12803 if test "$enable_mergelibs" = "all"; then
12806 AC_DEFINE(STATIC_LINKING)
12810 AC_MSG_RESULT([yes])
12812 AC_MSG_RESULT([no])
12814 AC_SUBST([MERGELIBS])
12815 AC_SUBST([URELIBS])
12817 # ===================================================================
12818 # Create hardlinks on deliver instead of copying for smaller size and speed up
12819 # ===================================================================
12820 AC_MSG_CHECKING([whether to create hardlinks for delivering files])
12822 if test "$enable_hardlink_deliver" = "yes"; then
12823 HARDLINKDELIVER="TRUE"
12824 AC_MSG_RESULT([yes])
12826 AC_MSG_RESULT([no])
12828 AC_SUBST(HARDLINKDELIVER)
12830 dnl ===================================================================
12831 dnl icerun is a wrapper that stops us spawning tens of processes
12832 dnl locally - for tools that can't be executed on the compile cluster
12833 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12834 dnl ===================================================================
12835 AC_MSG_CHECKING([whether to use icerun wrapper])
12837 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12838 ICECREAM_RUN=icerun
12839 AC_MSG_RESULT([yes])
12841 AC_MSG_RESULT([no])
12843 AC_SUBST(ICECREAM_RUN)
12845 dnl ===================================================================
12847 AC_MSG_CHECKING([MPL subset])
12850 if test "$enable_mpl_subset" = "yes"; then
12852 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12854 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12857 if test "$warn_report" = "true"; then
12858 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12860 if test "x$enable_postgresql_sdbc" != "xno"; then
12861 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the postgress database backend.])
12863 if test "$enable_lotuswordpro" = "yes"; then
12864 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12866 if test "$WITH_WEBDAV" = "neon"; then
12867 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12869 if test "x$enable_ext_mariadb_connector" = "xyes"; then
12870 AC_MSG_ERROR([need to --disable-ext-mariadb-connector - mariadb/mysql support.])
12872 if test -n "$ENABLE_PDFIMPORT"; then
12873 if test "x$SYSTEM_POPPLER" != "x"; then
12874 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12877 # cf. m4/libo_check_extension.m4
12878 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12879 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12881 for theme in $WITH_THEMES; do
12883 crystal|default|hicontrast|human|oxygen|sifr)
12884 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12888 if test "$enable_opengl" != "no" -o "x$ENABLE_OPENGL" = "xTRUE"; then
12889 AC_MSG_ERROR([need to --disable-opengl - GL transitions support.])
12891 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12892 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12896 AC_DEFINE(MPL_HAVE_SUBSET)
12897 AC_MSG_RESULT([only])
12899 AC_MSG_RESULT([no restrictions])
12901 AC_SUBST(MPL_SUBSET)
12904 dnl ===================================================================
12905 dnl Setting up the environment.
12906 dnl ===================================================================
12907 echo "setting up the build environment variables..."
12911 if test "$build_os" = "cygwin"; then
12912 if test "$DISABLE_ACTIVEX" = "TRUE"; then
12913 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12914 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12916 ATL_LIB="$COMPATH/atlmfc/lib"
12917 ATL_INCLUDE="$COMPATH/atlmfc/include"
12919 if test "$BITNESS_OVERRIDE" = 64; then
12920 ATL_LIB="$ATL_LIB/amd64"
12922 PathFormat "/usr/bin/grep.exe"
12923 WIN_GREP="$formatted_path"
12924 PathFormat "/usr/bin/find.exe"
12925 WIN_FIND="$formatted_path"
12926 PathFormat "/usr/bin/ls.exe"
12927 WIN_LS="$formatted_path"
12928 PathFormat "/usr/bin/touch.exe"
12929 WIN_TOUCH="$formatted_path"
12932 AC_SUBST(ATL_INCLUDE)
12937 AC_SUBST(WIN_TOUCH)
12939 AC_SUBST(BUILD_TYPE)
12944 PERL="$formatted_path"
12947 if test -n "$TMPDIR"; then
12948 TEMP_DIRECTORY="$TMPDIR"
12950 TEMP_DIRECTORY="/tmp"
12952 if test "$build_os" = "cygwin"; then
12953 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12955 AC_SUBST(TEMP_DIRECTORY)
12957 # setup the PATH for the environment
12958 if test -n "$LO_PATH_FOR_BUILD"; then
12959 LO_PATH="$LO_PATH_FOR_BUILD"
12965 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12966 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12967 pathmunge "$JAVA_HOME/bin" "after"
12972 # Win32 make needs native paths
12973 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12974 LO_PATH=`cygpath -p -m "$PATH"`
12976 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12977 pathmunge "$ASM_HOME" "before"
12978 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12979 pathmunge "$CSC_PATH" "before"
12980 pathmunge "$MIDL_PATH" "before"
12981 pathmunge "$AL_PATH" "before"
12982 pathmunge "$MSPDB_PATH" "before"
12983 if test "$BITNESS_OVERRIDE" = 64; then
12984 pathmunge "$COMPATH/bin/amd64" "before"
12985 pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12987 pathmunge "$COMPATH/bin" "before"
12988 pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12990 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12991 if test -d "$JAVA_HOME/jre/bin/client"; then
12992 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12994 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12995 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12997 pathmunge "$JAVA_HOME/bin" "before"
13002 pathmunge "/usr/css/bin" "before"
13003 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
13004 pathmunge "$JAVA_HOME/bin" "after"
13009 pathmunge "$SRC_ROOT/solenv/bin" "before"
13010 pathmunge "." "before"
13015 # Generate a configuration md5 we can use for deps
13016 if test -f config_host.mk; then
13017 config_md5=`$MD5SUM config_host.mk | sed "s/ .*//"`
13020 AC_CONFIG_FILES([config_host.mk
13023 instsetoo_native/util/openoffice.lst
13024 sysui/desktop/macosx/Info.plist
13026 AC_CONFIG_HEADERS([config_host/config_buildid.h])
13027 AC_CONFIG_HEADERS([config_host/config_clang.h])
13028 AC_CONFIG_HEADERS([config_host/config_eot.h])
13029 AC_CONFIG_HEADERS([config_host/config_features.h])
13030 AC_CONFIG_HEADERS([config_host/config_folders.h])
13031 AC_CONFIG_HEADERS([config_host/config_gcc.h])
13032 AC_CONFIG_HEADERS([config_host/config_global.h])
13033 AC_CONFIG_HEADERS([config_host/config_graphite.h])
13034 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
13035 AC_CONFIG_HEADERS([config_host/config_locales.h])
13036 AC_CONFIG_HEADERS([config_host/config_mpl.h])
13037 AC_CONFIG_HEADERS([config_host/config_orcus.h])
13038 AC_CONFIG_HEADERS([config_host/config_kde4.h])
13039 AC_CONFIG_HEADERS([config_host/config_mingw.h])
13040 AC_CONFIG_HEADERS([config_host/config_oox.h])
13041 AC_CONFIG_HEADERS([config_host/config_options.h])
13042 AC_CONFIG_HEADERS([config_host/config_test.h])
13043 AC_CONFIG_HEADERS([config_host/config_telepathy.h])
13044 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
13045 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
13046 AC_CONFIG_HEADERS([config_host/config_version.h])
13047 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
13050 if test "$CROSS_COMPILING" = TRUE; then
13051 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
13054 # touch the config timestamp file
13055 if test ! -f config_host.mk.stamp; then
13056 echo > config_host.mk.stamp
13057 elif test "$config_md5" = `$MD5SUM config_host.mk | sed "s/ .*//"`; then
13058 echo "Configuration unchanged - avoiding scp2 stamp update"
13060 echo > config_host.mk.stamp
13064 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
13066 cygwin_arch=`echo $MACHTYPE | sed 's/-.*//'`
13067 if test "$cygwin_arch" = "x86_64"; then
13068 download_make_url=http://users.freedesktop.org/~michael/x86_64/make
13070 download_make_url=http://dev-www.libreoffice.org/bin/cygwin/make
13074 ****************************************************************************
13076 Your make version is known to be horribly slow, and hard to debug
13077 problems with. To get a reasonably functional make please do:
13079 to install a pre-compiled binary make for cygwin
13081 mkdir -p /opt/lo/bin
13083 wget $download_make_url
13086 to install from source:
13087 place yourself in a working directory of you choice.
13089 git clone https://gerrit.libreoffice.org/p/gnu-make-lo.git
13092 ./configure --prefix=/opt/lo
13096 Then re-run autogen.sh
13098 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
13099 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
13105 ****************************************************************************
13115 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
13117 After the build has finished, you can immediately run it using:
13118 instdir/program/soffice
13120 If you want to run the smoketest, issue:
13126 if test -f warn; then
13131 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: