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.2.10.29],[],[],[https://libreoffice-from-collabora.com/])
16 if test -n "$BUILD_TYPE"; then
17 AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
25 GIT_NEEDED_SUBMODULES=""
26 LO_PATH= # used by path_munge to construct a PATH variable
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 formatted_path=`cygpath -d "$formatted_path"`
43 if test $? -ne 0; then
44 AC_MSG_ERROR([path conversion failed for "$1".])
47 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
48 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
49 if test "$fp_count_slash$fp_count_colon" != "00"; then
50 if test "$fp_count_colon" = "0"; then
51 formatted_path=`realpath "$formatted_path"`
52 if test $? -ne 0; then
53 AC_MSG_ERROR([realpath failed for "$1".])
56 formatted_path=`cygpath -m "$formatted_path"`
57 if test $? -ne 0; then
58 AC_MSG_ERROR([path conversion failed for "$1".])
68 if test "$have_WARNINGS" = "no"; then
69 echo "*************************************" > warn
71 if which tput >/dev/null 2>/dev/null && test `tput colors` -ge 8; then
72 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
73 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
75 COLORWARN="* WARNING :"
78 echo "$COLORWARN $@" >> warn
81 echo "********************************************************************"
83 echo "* Running ${PACKAGE_NAME} build configuration."
85 echo "********************************************************************"
88 dnl ===================================================================
89 dnl checks build and host OSes
90 dnl do this before argument processing to allow for platform dependent defaults
91 dnl ===================================================================
94 AC_MSG_CHECKING([for product name])
95 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
96 PRODUCTNAME=AC_PACKAGE_NAME"Dev"
98 PRODUCTNAME=AC_PACKAGE_NAME
100 AC_MSG_RESULT([$PRODUCTNAME])
101 AC_SUBST(PRODUCTNAME)
103 dnl ===================================================================
104 dnl Our version is defined by the AC_INIT() at the top of this script.
105 dnl ===================================================================
107 set `echo AC_PACKAGE_VERSION | sed "s/\./ /g"`
109 LIBO_VERSION_MAJOR=$1
110 LIBO_VERSION_MINOR=$2
111 LIBO_VERSION_MICRO=$3
112 LIBO_VERSION_PATCH=$4
114 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
115 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
116 # no way to encode that into an integer in general.
117 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
119 LIBO_VERSION_SUFFIX=$5
120 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
121 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
122 # they get undoubled before actually passed to sed.
123 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
124 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
125 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
126 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
128 AC_SUBST(LIBO_VERSION_MAJOR)
129 AC_SUBST(LIBO_VERSION_MINOR)
130 AC_SUBST(LIBO_VERSION_MICRO)
131 AC_SUBST(LIBO_VERSION_PATCH)
132 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
133 AC_SUBST(LIBO_VERSION_SUFFIX)
134 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
136 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
137 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
138 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
139 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
141 LIBO_THIS_YEAR=`date +%Y`
142 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
144 # This UPD silly thing must go away soon
145 UPD="${LIBO_VERSION_MAJOR}${LIBO_VERSION_MINOR}0"
148 # This too should go away
149 SOURCEVERSION="OOO$UPD"
150 AC_SUBST(SOURCEVERSION)
152 dnl ===================================================================
154 dnl ===================================================================
155 AC_MSG_CHECKING([for product version])
156 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
157 AC_MSG_RESULT([$PRODUCTVERSION])
158 AC_SUBST(PRODUCTVERSION)
161 # AC_PROG_EGREP doesn't set GREP on all systems as well
162 AC_PATH_PROG(GREP, grep)
170 if test "$build_os" = "cygwin"; then
171 PathFormat "$SRC_ROOT"
172 SRC_ROOT="$formatted_path"
173 PathFormat "$BUILDDIR"
174 BUILDDIR="$formatted_path"
181 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
182 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
184 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
185 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
188 # need sed in os checks...
189 AC_PATH_PROGS(SED, sed)
190 if test -z "$SED"; then
191 AC_MSG_ERROR([install sed to run this script])
194 dnl ===================================================================
195 dnl When building for Android, --with-android-ndk,
196 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
198 dnl ===================================================================
200 AC_ARG_WITH(android-ndk,
201 AS_HELP_STRING([--with-android-ndk],
202 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
205 AC_ARG_WITH(android-ndk-toolchain-version,
206 AS_HELP_STRING([--with-android-ndk-toolchain-version],
207 [Specify which toolchain version to use, of those present in the
208 Android NDK you are using. Mandatory if the NDK used has several
209 toolchain versions for the host architecture you are building for.]), ,)
211 AC_ARG_WITH(android-sdk,
212 AS_HELP_STRING([--with-android-sdk],
213 [Specify location of the Android SDK. Mandatory when building for Android,
214 or when building the Impress Remote Android app.]),
218 if test -n "$with_android_ndk"; then
219 ANDROID_NDK_HOME=$with_android_ndk
221 # Set up a lot of pre-canned defaults
223 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
224 AC_MSG_ERROR([Unrecognized Android NDK. Only r8* versions supported.])
226 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
228 case $ANDROID_NDK_VERSION in
232 AC_MSG_ERROR([Unsupported NDK version $ANDROID_NDK_VERSION, only r8* and r9* versions are supported])
236 if test $host_cpu = arm; then
238 android_platform_prefix=$android_cpu-linux-androideabi
239 elif test $host_cpu = mips; then
241 android_platform_prefix=$android_cpu-linux-androideabi
243 # host_cpu is something like "i386" or "i686" I guess, NDK uses
244 # "x86" in some contexts
246 android_platform_prefix=$android_cpu
249 case "$with_android_ndk_toolchain_version" in
251 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$with_android_ndk_toolchain_version
252 ANDROID_COMPILER_DIR=$ANDROID_BINUTILS_DIR
255 AC_MSG_WARN([Building with the Clang tool-chain is known to break in the bridges module, fix that please])
256 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-4.6
257 ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm-${with_android_ndk_toolchain_version#clang}
258 ANDROID_USING_CLANG=true
262 if test ! -d $ANDROID_BINUTILS_DIR; then
263 AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
264 elif test $ANDROID_COMPILER_DIR != $ANDROID_BINUTILS_DIR -a ! -d $ANDROID_COMPILER_DIR; then
265 AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
268 # Check if there is a 64-bit tool-chain. Google provides a NDK with 64-bit tool-chain binaries in
269 # NDK r8e and later, and for earlier NDKs it was possible to build one yourself. Using a 64-bit
270 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
271 # manage to link the (app-specific) single huge .so that is built for the apps in
272 # android/experimental/* if there is debug information in a significant part of the object files.
273 # (A 64-bit ld.gold grows to much over 10 gigabytes of virtual space when linking such a .so if
274 # all objects have been built with debug information.)
276 if test $build_os = linux-gnu; then
277 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/linux-x86/bin
278 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/linux-x86
279 if test $build_cpu = x86_64; then
280 if test -d $ANDROID_COMPILER_DIR/prebuilt/linux-x86_64; then
281 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/linux-x86_64/bin
283 if test -d $ANDROID_BINUTILS_DIR/prebuilt/linux-x86_64; then
284 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/linux-x86_64
287 ANDROID_BINUTILS_BIN=$ANDROID_BINUTILS_PREBUILT_ROOT/bin
290 # This stays empty if there is just one version of the toolchain in the NDK
291 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=
292 case "`echo $ANDROID_NDK_HOME/toolchains/$android_cpu*-*/prebuilt/*/bin`" in
294 # Trailing slash intentional and necessary, compare to how this is used
295 if test -n "$ANDROID_USING_CLANG"; then
296 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=4.6/
298 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
303 if test $host_cpu = arm; then
304 android_gnu_prefix=arm-linux-androideabi
305 elif test $host_cpu = mips; then
306 android_gnu_prefix=mipsel-linux-android
307 elif test $ANDROID_NDK_VERSION = r8; then
308 # The prefix used for the x86 tool-chain changed between NDK r8 and r8b
309 android_gnu_prefix=i686-android-linux
311 android_gnu_prefix=i686-linux-android
314 test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu
315 test -z "$AR" && AR=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ar
316 test -z "$NM" && NM=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-nm
317 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-objdump
318 test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ranlib
319 test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-strip
321 if test $host_cpu = arm; then
322 ANDROID_APP_ABI=armeabi-v7a
323 if test -n "$ANDROID_USING_CLANG"; then
324 ANDROIDCFLAGS="-gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT"
325 ANDROIDCFLAGS="$ANDROIDCFLAGS -target armv7-none-linux-androideabi"
326 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes"
330 ANDROIDCFLAGS="$ANDROIDCFLAGS -mthumb"
331 ANDROIDCFLAGS="$ANDROIDCFLAGS -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
332 elif test $host_cpu = mips; then
337 ANDROIDCFLAGS="-march=atom"
339 ANDROIDCFLAGS="$ANDROIDCFLAGS -ffunction-sections"
340 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/$ANDROID_APP_ABI"
341 ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu"
342 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wl,--fix-cortex-a8"
344 if test -n "$ANDROID_USING_CLANG"; then
345 ANDROIDCFLAGS="$ANDROIDCFLAGS -Qunused-arguments"
347 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wno-psabi"
350 # When using the 4.6 or newer toolchain, use the gold linker
351 case "$with_android_ndk_toolchain_version" in
352 4.[[6789]]*|[[56789]].*|clang*)
353 # The NDK doesn't have ld.gold for MIPS for some reason
354 if test "$host_cpu" != mips; then
355 ANDROIDCFLAGS="$ANDROIDCFLAGS -fuse-ld=gold"
360 # gdbserver can be in different locations
361 if test -f $ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver; then
362 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver
363 elif test -f $ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver; then
364 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver
366 AC_MSG_ERROR([Can't find gdbserver for your Android target])
369 if test $host_cpu = arm; then
370 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"
371 elif test $host_cpu = mips; then
372 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"
374 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"
377 if test -z "$CC"; then
378 case "$with_android_ndk_toolchain_version" in
380 CC="$ANDROID_COMPILER_BIN/$android_gnu_prefix-gcc $ANDROIDCFLAGS"
383 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
386 if test -z "$CXX"; then
387 case "$with_android_ndk_toolchain_version" in
389 CXX="$ANDROID_COMPILER_BIN/$android_gnu_prefix-g++ $ANDROIDCXXFLAGS"
392 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
397 AC_SUBST(ANDROID_NDK_GDBSERVER)
398 AC_SUBST(ANDROID_APP_ABI)
400 dnl ===================================================================
401 dnl Also --with-android-sdk is mandatory
402 dnl ===================================================================
404 if test -n "$with_android_sdk"; then
405 ANDROID_SDK_HOME=$with_android_sdk
406 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
408 AC_SUBST(ANDROID_SDK_HOME)
410 dnl ===================================================================
411 dnl The following is a list of supported systems.
412 dnl Sequential to keep the logic very simple
413 dnl These values may be checked and reset later.
414 dnl ===================================================================
415 #defaults unless the os test overrides this:
423 # Default values, as such probably valid just for Linux, set
424 # differently below just for Mac OSX,but at least better than
425 # hardcoding these as we used to do. Much of this is duplicated also
426 # in solenv for old build system and for gbuild, ideally we should
427 # perhaps define stuff like this only here in configure.ac?
429 LINKFLAGSSHL="-shared"
433 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
443 build_gstreamer_0_10=yes
450 dnl ===========================================================
451 dnl Check whether we're using Solaris 10 - SPARC or Intel.
452 dnl ===========================================================
453 AC_MSG_CHECKING([the Solaris operating system release])
454 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
455 if test "$_os_release" -lt "10"; then
456 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
458 AC_MSG_RESULT([ok ($_os_release)])
461 dnl Check whether we're using a SPARC or i386 processor
462 AC_MSG_CHECKING([the processor type])
463 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
464 AC_MSG_RESULT([ok ($host_cpu)])
466 AC_MSG_ERROR([only SPARC and i386 processors are supported])
470 linux-gnu*|k*bsd*-gnu*)
473 build_gstreamer_0_10=yes
487 cygwin*|interix*|mingw32*)
489 # When building on Windows normally with MSVC under Cygwin,
490 # configure thinks that the host platform (the platform the
491 # built code will run on) is Cygwin, even if it obviously is
492 # Windows, which in Autoconf terminology is called
493 # "mingw32". (Which is misleading as MinGW is the name of the
494 # tool-chain, not an operating system.)
496 # Somewhat confusing, yes. But this configure script doesn't
497 # look at $host etc that much, it mostly uses its own $_os
498 # variable, set here in this case statement.
500 # When cross-compiling to Windows from Unix, the host platform
501 # is "mingw32" (because in that case it is the MinGW
502 # tool-chain that is used).
515 # If the host OS matches "mingw32*", that means we are using the
516 # MinGW cross-compiler, because we don't see the point in building
517 # LibreOffice using MinGW on Windows. If you want to build on
518 # Windows, use MSVC. If you want to use MinGW, surely you want to
519 # cross-compile (from Linux or some other Unix).
524 if test -z "$CC"; then
525 CC="$host_cpu-$host_vendor-$host_os-gcc"
527 if test -z "$CXX"; then
528 CXX="$host_cpu-$host_vendor-$host_os-g++"
534 darwin*) # Mac OS X or iOS
541 if test "$host_cpu" = "arm"; then
547 INSTROOTSUFFIX=/$PRODUCTNAME.app/Contents
548 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
551 # See comment above the case "$host_os"
552 LINKFLAGSSHL="-dynamiclib -single_module"
559 # -undefined error is the default
566 build_gstreamer_0_10=yes
571 AC_MSG_CHECKING([the FreeBSD operating system release])
572 if test -n "$with_os_version"; then
573 OSVERSION="$with_os_version"
575 OSVERSION=`/sbin/sysctl -n kern.osreldate`
577 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
578 AC_MSG_CHECKING([which thread library to use])
579 if test "$OSVERSION" -lt "500016"; then
580 PTHREAD_CFLAGS="-D_THREAD_SAFE"
581 PTHREAD_LIBS="-pthread"
582 elif test "$OSVERSION" -lt "502102"; then
583 PTHREAD_CFLAGS="-D_THREAD_SAFE"
587 PTHREAD_LIBS="-pthread"
589 AC_MSG_RESULT([$PTHREAD_LIBS])
596 build_gstreamer_0_10=yes
601 PTHREAD_LIBS="-pthread -lpthread"
608 PTHREAD_LIBS=-pthread
617 PTHREAD_CFLAGS="-D_THREAD_SAFE"
618 PTHREAD_LIBS="-pthread"
625 build_gstreamer_0_10=yes
630 PTHREAD_LIBS="-pthread"
636 build_gstreamer_0_10=no
637 enable_lotuswordpro=no
638 enable_mpl_subset=yes
642 enable_report_builder=no
656 if test -z "$with_android_ndk"; then
657 AC_MSG_ERROR([the --with-android-ndk option is mandatory])
660 if test -z "$with_android_ndk_toolchain_version"; then
661 AC_MSG_ERROR([the --with-android-ndk-toolchain-version option is mandatory])
664 # Verify that the NDK and SDK options are proper
665 if test ! -f "$ANDROID_NDK_HOME/platforms/android-9/arch-arm/usr/lib/libc.a"; then
666 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
669 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
670 BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
674 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
678 if echo "$host_os" | grep -q linux-android || test "$enable_sdremote_android" = "yes"; then
679 if test -z "$with_android_sdk"; then
680 AC_MSG_ERROR([the --with-android-sdk option is mandatory])
683 if test ! -d "$ANDROID_SDK_HOME/platforms"; then
684 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
688 if test "$_os" = "AIX"; then
689 AC_PATH_PROG(GAWK, gawk)
690 if test -z "$GAWK"; then
691 AC_MSG_ERROR([gawk not found in \$PATH])
698 AC_SUBST(PTHREAD_CFLAGS)
699 AC_SUBST(PTHREAD_LIBS)
701 ###############################################################################
702 # Extensions switches --enable/--disable
703 ###############################################################################
704 # By default these should be enabled unless having extra dependencies.
705 # If there is extra dependency over configure options then the enable should
706 # be automagic based on whether the requiring feature is enabled or not.
707 # All this options change anything only with --enable-extension-integration.
709 # The name of this option and its help string makes it sound as if
710 # extensions are built anyway, just not integrated in the installer,
711 # if you use --disable-extension-integration. Is that really the
714 AC_ARG_ENABLE(extension-integration,
715 AS_HELP_STRING([--disable-extension-integration],
716 [Disable integration of the built extensions in the installer of the
717 product. Use this switch to disable the integration.])
720 AC_ARG_ENABLE(export,
721 AS_HELP_STRING([--disable-export],
722 [Disable (some) code for document export. Useful when building viewer-only apps that lack
723 save/export functionality, to avoid having an excessive amount of code and data used
724 only for exporrt linked in. Work in progress, use only if you are hacking on it.])
727 AC_ARG_ENABLE(database-connectivity,
728 AS_HELP_STRING([--disable-database-connectivity],
729 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
732 # This doesn't mean not building (or "integrating") extensions
733 # (although it probably should; i.e. it should imply
734 # --disable-extension-integration I guess), it means not supporting
735 # any extension mechanism at all
736 AC_ARG_ENABLE(extensions,
737 AS_HELP_STRING([--disable-extensions],
738 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
741 AC_ARG_ENABLE(scripting,
742 AS_HELP_STRING([--disable-scripting],
743 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
746 # This is mainly for Android and iOS, but could potentially be used in some
747 # special case otherwise, too, so factored out as a separate setting
749 AC_ARG_ENABLE(dynamic-loading,
750 AS_HELP_STRING([--disable-dynamic-loading],
751 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
754 AC_ARG_ENABLE(ext-mariadb-connector,
755 AS_HELP_STRING([--enable-ext-mariadb-connector],
756 [Enable the build of the MariaDB/MySQL Connector extension.])
759 AC_ARG_ENABLE(report-builder,
760 AS_HELP_STRING([--disable-report-builder],
761 [Disable the Report Builder.])
764 AC_ARG_ENABLE(ext-wiki-publisher,
765 AS_HELP_STRING([--enable-ext-wiki-publisher],
766 [Enable the Wiki Publisher extension.])
769 AC_ARG_ENABLE(lpsolve,
770 AS_HELP_STRING([--disable-lpsolve],
771 [Disable compilation of the lp solve solver ])
774 AC_ARG_ENABLE(pdfimport,
775 AS_HELP_STRING([--disable-pdfimport],
776 [Disable building the PDF import feature.])
779 ###############################################################################
781 dnl ---------- *** ----------
783 AC_ARG_ENABLE([hardlink-deliver],
784 AS_HELP_STRING([--enable-hardlink-deliver],
785 [Put files into deliver folder as hardlinks instead of copying them
786 over. Saves space and speeds up build.])
789 AC_ARG_ENABLE(mergelibs,
790 AS_HELP_STRING([--enable-mergelibs=<all/yes>],
791 [Enables linking of big, merged, library. Experimental feature tested
792 only for Linux. 'all' will link a lot of libraries into libmerged
793 while 'yes' will do it for just a core set of libraries.])
796 AC_ARG_ENABLE(graphite,
797 AS_HELP_STRING([--enable-graphite],
798 [Enables the compilation of Graphite smart font rendering.])
802 AS_HELP_STRING([--enable-orcus],
803 [Enables orcus for extra file import filters for Calc.])
806 AC_ARG_ENABLE(fetch-external,
807 AS_HELP_STRING([--disable-fetch-external],
808 [Disables fetching external tarballs from web sources.])
811 AC_ARG_ENABLE(lockdown,
812 AS_HELP_STRING([--disable-lockdown],
813 [Disables the gconf integration work in LibreOffice.]),
817 AS_HELP_STRING([--disable-vba],
818 [Disables the vba compatibility feature.])
822 AS_HELP_STRING([--enable-pch],
823 [Enables precompiled header support for C++.])
826 AC_ARG_ENABLE(win-mozab-driver,
827 AS_HELP_STRING([--enable-win-mozab-driver],
828 [LibreOffice includes a driver to connect to Mozilla
829 address books under Windows, to build with this version, use this option.])
833 AS_HELP_STRING([--enable-epm],
834 [LibreOffice includes self-packaging code, that requires epm, however epm is
835 useless for large scale package building.])
839 AS_HELP_STRING([--disable-odk],
840 [LibreOffice includes an ODK, office development kit which some packagers may
841 wish to build without.])
844 AC_ARG_ENABLE(mpl-subset,
845 AS_HELP_STRING([--enable-mpl-subset],
846 [Don't compile any pieces which are not MPL or more liberally licensed])
849 AC_ARG_ENABLE(evolution2,
850 AS_HELP_STRING([--enable-evolution2],
851 [Allows the built-in evolution 2 addressbook connectivity build to be
855 AC_ARG_ENABLE(directx,
856 AS_HELP_STRING([--disable-directx],
857 [Remove DirectX implementation for the new XCanvas interface.
858 The DirectX support requires more stuff installed on Windows to
859 compile. (DirectX SDK, GDI+ libs)])
862 AC_ARG_ENABLE(activex,
863 AS_HELP_STRING([--disable-activex],
864 [Disable the use of ActiveX for a Windows build.
865 This switch is mandatory when using an Express edition of Visual Studio.])
869 AS_HELP_STRING([--disable-atl],
870 [Disable the use of ATL for a Windows build.])
872 This switch is mandatory when using an Express edition of Visual Studio.
877 AS_HELP_STRING([--enable-avahi],
878 [Determines whether to use Avahi to advertise Impress to remote controls.]),
881 AC_ARG_ENABLE(werror,
882 AS_HELP_STRING([--enable-werror],
883 [Turn warnings to errors. (Has no effect in modules where the treating
884 of warnings as errors is disabled explicitly.)]),
887 AC_ARG_ENABLE(assert-always-abort,
888 AS_HELP_STRING([--enable-assert-always-abort],
889 [make assert() abort even in release code.]),
892 AC_ARG_ENABLE(dbgutil,
893 AS_HELP_STRING([--enable-dbgutil],
894 [Provide debugging support from --enable-debug and include additional debugging
895 utilities such as object counting or more expensive checks.
896 This is the recommended option for developers.
897 Note that this makes the build ABI incompatible, it is not possible to mix object
898 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
901 AS_HELP_STRING([--enable-debug],
902 [Include debugging information, disable compiler optimization and inlining plus
903 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
905 AC_ARG_ENABLE(selective-debuginfo,
906 AS_HELP_STRING([--enable-selective-debuginfo],
907 [If --enable-debug or --enable-dbgutil is used, build debugging information
908 (-g compiler flag) only for the specified gbuild build targets
909 (where all means everything, - prepended means not to enable, / appended means
910 everything in the directory; there is no ordering, more specific overrides
911 more general, and disabling takes precedence).
912 Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
914 AC_ARG_ENABLE(symbols,
915 AS_HELP_STRING([--enable-symbols],
916 [Include debugging symbols in output while preserve optimization.
917 This enables -g compiler flag for GCC or equivalent,
918 without changing anything else compared to productive code.]))
920 AC_ARG_ENABLE(compiler-plugins,
921 AS_HELP_STRING([--enable-compiler-plugins],
922 [Enable compiler plugins that will perform additional checks during
923 building. Enabled automatically by --enable-dbgutil.]))
926 AS_HELP_STRING([--disable-ooenv],
927 [Disable ooenv for the instdir installation.]))
930 AS_HELP_STRING([--enable-lto],
931 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
932 longer but libraries and executables are optimized for speed. (For GCC, best to use GCC 4.6
933 or later and 'gold' linker. Works fine (and is turned on automatically in an optimising
934 build) for MSVC, otherwise experimental work in progress that shouldn't be used unless you
935 are working on it.)]))
937 AC_ARG_ENABLE(crashdump,
938 AS_HELP_STRING([--enable-crashdump],
939 [Enable the crashdump feature.]))
941 AC_ARG_ENABLE(python,
942 AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
943 [Enables or disables Python support at run-time and build-time.
944 Also specifies what Python to use. 'auto' is the
945 default. Note that Python can be disabled with
946 --disable-python or --enable-python=no only if no
947 translations are required.]))
950 AS_HELP_STRING([--disable-gtk],
951 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
955 AS_HELP_STRING([--enable-gtk3],
956 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
959 AC_ARG_ENABLE(systray,
960 AS_HELP_STRING([--disable-systray],
961 [Determines whether to build the systray quickstarter.]),
964 AC_ARG_ENABLE(split-app-modules,
965 AS_HELP_STRING([--enable-split-app-modules],
966 [Split file lists for app modules, e.g. base, calc.
967 Has effect only with make distro-pack-install]),
970 AC_ARG_ENABLE(split-opt-features,
971 AS_HELP_STRING([--enable-split-opt-features],
972 [Split file lists for some optional features, .e.g. pyuno, testtool.
973 Has effect only with make distro-pack-install]),
976 AC_ARG_ENABLE(cairo-canvas,
977 [ --disable-cairo-canvas Determines whether to build the Cairo canvas on
978 platforms where Cairo is available.
981 AC_ARG_ENABLE(opengl,
982 AS_HELP_STRING([--disable-opengl],
983 [Determines whether to build the OpenGL 3D slide transitions and canvas component.]))
985 AC_ARG_ENABLE(opencl,
986 AS_HELP_STRING([--disable-opencl],
987 [Determines whether to build with OpenCL support.]))
990 AS_HELP_STRING([--disable-dbus],
991 [Determines whether to enable features that depend on dbus.
992 e.g. Presentation mode screensaver control, bluetooth presentation control]),
995 AC_ARG_ENABLE(packagekit,
996 AS_HELP_STRING([--enable-packagekit],
997 [Determines whether to enable features using packagekit.
998 Right now that is auto font install]),
1001 AC_ARG_ENABLE(sdremote,
1002 AS_HELP_STRING([--disable-sdremote],
1003 [Determines whether to enable Impress remote control (i.e. the server component).]),
1004 ,enable_sdremote=yes)
1006 AC_ARG_ENABLE(sdremote-bluetooth,
1007 AS_HELP_STRING([--disable-sdremote-bluetooth],
1008 [Determines whether to build sdremote with bluetooth support.
1009 Requires dbus on Linux.]))
1011 AC_ARG_ENABLE(sdremote-android,
1012 AS_HELP_STRING([--enable-sdremote-android],
1013 [Determines whether to build the Impress Remote Android app -- requires
1014 a correctly configured android sdk.]),
1015 ,enable_sdremote_android=no)
1017 AC_ARG_ENABLE(gconf,
1018 AS_HELP_STRING([--disable-gconf],
1019 [Determines whether to use the GConf support.]),
1022 AC_ARG_ENABLE(gnome-vfs,
1023 AS_HELP_STRING([--enable-gnome-vfs],
1024 [Determines whether to use the Gnome Virtual Filing System on platforms
1025 where that VFS is available.]),
1026 ,enable_gnome_vfs=no)
1029 AS_HELP_STRING([--disable-gio],
1030 [Determines whether to use the GIO support.]),
1033 AC_ARG_ENABLE(telepathy,
1034 AS_HELP_STRING([--enable-telepathy],
1035 [Determines whether to enable Telepathy for collaboration.]),
1036 ,enable_telepathy=no)
1039 AS_HELP_STRING([--enable-tde],
1040 [Determines whether to use TQt/TDE vclplug on platforms where TQt and
1041 TDE are available.]),
1044 AC_ARG_ENABLE(tdeab,
1045 AS_HELP_STRING([--disable-tdeab],
1046 [Disable the TDE address book support.]),
1048 if test "$enable_tde" = "yes"; then
1054 AS_HELP_STRING([--enable-kde],
1055 [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
1056 KDE3 are available.]),
1059 AC_ARG_ENABLE(kdeab,
1060 AS_HELP_STRING([--disable-kdeab],
1061 [Disable the KDE3 address book support.]),
1063 if test "$enable_kde" = "yes"; then
1069 AS_HELP_STRING([--enable-kde4],
1070 [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
1071 KDE4 are available. May be used with --enable-kde if you want to support
1072 both KDE3 and KDE4.]),
1075 AC_ARG_ENABLE(headless,
1076 AS_HELP_STRING([--enable-headless],
1077 [Disable building of GUIs to reduce dependencies. Useful for
1078 server usage. Work in progress, use only if you are hacking on
1079 it. Not related to the --headless option.]), ,)
1081 AC_ARG_ENABLE(randr,
1082 AS_HELP_STRING([--disable-randr],
1083 [Disable RandR support in the vcl project.]),
1086 AC_ARG_ENABLE(randr-link,
1087 AS_HELP_STRING([--disable-randr-link],
1088 [Disable linking with libXrandr, instead dynamically open it at runtime.]),
1089 ,enable_randr_link=yes)
1091 AC_ARG_ENABLE(gstreamer,
1092 AS_HELP_STRING([--enable-gstreamer],
1093 [Enable building with the new gstreamer 1.0 avmedia backend.]),
1094 ,enable_gstreamer=no)
1096 AC_ARG_ENABLE(gstreamer-0-10,
1097 AS_HELP_STRING([--disable-gstreamer-0-10],
1098 [Disable building the gstreamer avmedia backend.]),
1099 ,enable_gstreamer_0_10=yes)
1102 AS_HELP_STRING([--enable-vlc],
1103 [Enable building with the VLC avmedia backend.]),
1107 AS_HELP_STRING([--disable-neon],
1108 [Disable neon and the compilation of webdav binding.]),
1111 AC_ARG_ENABLE([eot],
1112 [AS_HELP_STRING([--enable-eot],
1113 [Enable support for Embedded OpenType fonts.])],
1116 AC_ARG_ENABLE(cve-tests,
1117 AS_HELP_STRING([--disable-cve-tests],
1118 [Prevent CVE tests to be executed]),
1121 AC_ARG_ENABLE(build-unowinreg,
1122 AS_HELP_STRING([--enable-build-unowinreg],
1123 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1124 compiler is needed on Linux.])
1126 Usage: --enable-build-unowinreg
1130 AC_ARG_ENABLE(verbose,
1131 AS_HELP_STRING([--enable-verbose],
1132 [Increase build verbosity.])[
1133 --disable-verbose Decrease build verbosity.],
1136 AC_ARG_ENABLE(dependency-tracking,
1137 AS_HELP_STRING([--enable-dependency-tracking],
1138 [Do not reject slow dependency extractors.])[
1139 --disable-dependency-tracking
1140 Disables generation of dependency information.
1141 Speed up one-time builds.],
1144 AC_ARG_ENABLE(icecream,
1145 AS_HELP_STRING([--enable-icecream],
1146 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1147 It defaults to /opt/icecream for the location of the icecream gcc/g++
1148 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1152 AS_HELP_STRING([--disable-cups],
1153 [Do not build cups support.])
1156 AC_ARG_ENABLE(ccache,
1157 AS_HELP_STRING([--disable-ccache],
1158 [Do not try to use ccache automatically.
1159 By default, we will try to detect if ccache is available; in that case if
1160 CC/CXX are not yet set, and --enable-icecream is not given, we
1161 attempt to use ccache. --disable-ccache disables ccache completely.
1165 AC_ARG_ENABLE(64-bit,
1166 AS_HELP_STRING([--enable-64-bit],
1167 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit. Works fine for OS
1168 X. In other cases this option is experimental and possibly quite broken, use only if you are
1169 hacking on 64-bit support.]), ,)
1171 AC_ARG_ENABLE(extra-gallery,
1172 AS_HELP_STRING([--enable-extra-gallery],
1173 [Add extra gallery content.]),
1176 AC_ARG_ENABLE(extra-template,
1177 AS_HELP_STRING([--enable-extra-template],
1178 [Add extra template content.]),
1181 AC_ARG_ENABLE(extra-sample,
1182 AS_HELP_STRING([--enable-extra-sample],
1183 [Add extra sample content.]),
1186 AC_ARG_ENABLE(extra-font,
1187 AS_HELP_STRING([--enable-extra-font],
1188 [Add extra font content.]),
1191 AC_ARG_ENABLE(online-update,
1192 AS_HELP_STRING([--enable-online-update],
1193 [Enable the online update service that will check for new versions of
1194 LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
1197 AC_ARG_ENABLE(release-build,
1198 AS_HELP_STRING([--enable-release-build],
1199 [Enable release build.
1200 See http://wiki.documentfoundation.org/DevBuild]),
1203 AC_ARG_ENABLE(windows-build-signing,
1204 AS_HELP_STRING([--enable-windows-build-signing],
1205 [Enable signing of windows binaries (*.exe, *.dll)]),
1208 AC_ARG_ENABLE(silent-msi,
1209 AS_HELP_STRING([--enable-silent-msi],
1210 [Enable MSI with LIMITUI=1 (silent install).]),
1213 AC_ARG_ENABLE(macosx-code-signing,
1214 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1215 [Sign executables, dylibs, frameworks and the app bundle. If you
1216 don't provide an identity the first suitable certificate
1217 in your keychain is used.]),
1220 AC_ARG_ENABLE(macosx-package-signing,
1221 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1222 [Create a .pkg suitable for uploading to the Mac App Store and sign
1223 it. If you don't provide an identity the first suitable certificate
1224 in your keychain is used.]),
1227 AC_ARG_ENABLE(macosx-sandbox,
1228 AS_HELP_STRING([--enable-macosx-sandbox],
1229 [Make the app bundle run in a sandbox. Requires code signing.
1230 Is required by apps distributed in the Mac App Store, and implies
1231 adherence to App Store rules.]),
1234 AC_ARG_WITH(macosx-teamid,
1235 AS_HELP_STRING([--with-macosx-teamid=<teamid>],
1236 [The "team id" to be used for com.apple.application-identifier
1237 in the entitlements when building a sandboxed LibreOffice.]),
1240 AC_ARG_ENABLE(canonical-installation-tree-structure,
1241 AS_HELP_STRING([--enable-canonical-installation-tree-structure],
1242 [Make the installation tree structure be more canonical for
1243 the platform. Implemented only for OS X. Experimental and currently broken.]),
1247 AC_ARG_WITH(macosx-bundle-identifier,
1248 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1249 [Define the OS X bundle identifier. Default is the somewhat weird
1250 org.libreoffice.script ("script", huh?).]),
1251 ,with_macosx_bundle_identifier=org.libreoffice.script)
1253 AC_ARG_WITH(macosx-app-name,
1254 AS_HELP_STRING([--with-macosx-app-name='My Own Office Suite'],
1255 [Define the OS X app name. Default is AC_PACKAGE_NAME.]),
1256 ,with_macosx_app_name=$PRODUCTNAME)
1258 AC_ARG_ENABLE(libc++,
1259 AS_HELP_STRING([--enable-libc++],
1260 [Use the libc++ C++ library instead of GNU libstdc++ on OS X. Only effective
1261 if --with-macosx-version-min-required is 10.7 or later. Experimental work in
1262 progress, very likely breaks something, don't use unless you plan to fix that.]),
1265 AC_ARG_ENABLE(ios-simulator,
1266 AS_HELP_STRING([--enable-ios-simulator],
1267 [Build for the iOS Simulator, not iOS device.]),
1270 AC_ARG_ENABLE(readonly-installset,
1271 AS_HELP_STRING([--enable-readonly-installset],
1272 [Prevents any attempts by LibreOffice to write into its installation. That means
1273 at least that no "system-wide" extensions can be added. Experimental work in
1277 AC_ARG_ENABLE(postgresql-sdbc,
1278 AS_HELP_STRING([--disable-postgresql-sdbc],
1279 [Disable the build of the PostgreSQL-SDBC driver.])
1282 AC_ARG_ENABLE(lotuswordpro,
1283 AS_HELP_STRING([--disable-lotuswordpro],
1284 [Disable the build of the Lotus Word Pro filter.]),
1285 ,enable_lotuswordpro=yes)
1287 AC_ARG_ENABLE(firebird-sdbc,
1288 AS_HELP_STRING([--disable-firebird-sdbc],
1289 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1290 ,enable_firebird_sdbc=yes)
1292 AC_ARG_ENABLE(coretext,
1293 AS_HELP_STRING([--disable-coretext],
1294 [Don't use CoreText on Mac (but the obsolete ATSU instead).
1295 In a 64-bit LibreOffice CoreText is by necessity always used.]),
1298 AC_ARG_ENABLE(winegcc,
1299 AS_HELP_STRING([--enable-winegcc],
1300 [Enable use of winegcc during the build, in order to create msi* tools
1301 needed for MinGW cross-compilation.]),
1304 AC_ARG_ENABLE(liblangtag,
1305 AS_HELP_STRING([--disable-liblangtag],
1306 [Disable use of liblangtag, and instead use an own simple
1310 AC_ARG_ENABLE(bogus-pkg-config,
1311 AS_HELP_STRING([--enable-bogus-pkg-config],
1312 [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.]),
1315 AC_ARG_ENABLE(openssl,
1316 AS_HELP_STRING([--disable-openssl],
1317 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1318 components will either use GNUTLS or NSS. Work in progress,
1319 use only if you are hacking on it.]),
1320 ,enable_openssl=yes)
1322 AC_ARG_ENABLE(library-bin-tar,
1323 AS_HELP_STRING([--enable-library-bin-tar],
1324 [Enable the building and reused of tarball of binary build for some 'external' libraries
1325 Some libraries can save their build result in a tarball
1326 stored in TARFILE_LOCATION. that binary tarball is
1327 uniquely identified by the source tarbal,
1328 the content of the config_host.mk file and the content
1329 of the top-level directory in core for that library
1330 If this option is enabled, then if such a tarfile exist, it will be untarred
1331 isntead of the source tarfile, and the build step will be skipped for that
1333 If a proper tarfile does not exist, then the normal source-based
1334 build is done for taht library and a proper binary tarfile is created
1335 for the next time.]),
1338 dnl ===================================================================
1339 dnl Optional Packages (--with/without-)
1340 dnl ===================================================================
1342 AC_ARG_WITH(gnu-patch,
1343 AS_HELP_STRING([--with-gnu-patch],
1344 [Specify location of GNU patch on Solaris or FreeBSD.]),
1347 AC_ARG_WITH(build-platform-configure-options,
1348 [Specify options for the configure script run for the *build* platform in a cross-compilation])
1351 AS_HELP_STRING([--with-gnu-cp],
1352 [Specify location of GNU cp on Solaris or FreeBSD.]),
1355 AC_ARG_WITH(external-tar,
1356 AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
1357 [Specify path to tarfiles manually.]),
1358 TARFILE_LOCATION=$withval ,
1361 AC_ARG_WITH(referenced-git,
1362 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1363 [Specify another checkout directory to reference. This makes use of
1364 git submodule update --reference, and saves a lot of diskspace
1365 when having multiple trees side-by-side.]),
1366 GIT_REFERENCE_SRC=$withval ,
1369 AC_ARG_WITH(linked-git,
1370 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1371 [Specify a directory where the repositories of submodules are located.
1372 This uses a method similar to git-new-workdir to get submodules.]),
1373 GIT_LINK_SRC=$withval ,
1376 AC_ARG_WITH(galleries,
1377 AS_HELP_STRING([--with-galleries],
1378 [Specify how galleries should be built. It is possible either to
1379 build these internally from source ("build"), or to (optionally
1380 download and) unpack them them from a package ("package"), or
1381 to disable them ("no")]),
1385 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1386 [Choose which themes to include. By default those themes with an '*' are included.
1387 Possible choices: *crystal, *default (galaxy), *hicontrast, human, industrial, *oxygen, *sifr, *tango, *tango_testing.]),
1390 AC_ARG_WITH(helppack-integration,
1392 --without-helppack-integration It will not integrate the helppacks to the installer
1394 Please use this switch to use the online help or separate help packages.],
1398 AS_HELP_STRING([--without-fonts],
1399 [LibreOffice includes some third-party fonts to provide a reliable basis for
1400 help content, templates, samples, etc. When these fonts are already
1401 known to be available on the system then you should use this option.]),
1405 AS_HELP_STRING([--without-ppds],
1406 [Removes Postscript Printer definition files from LibreOffice
1407 installation set, for people building for specific distributions where
1408 PPDs are known to be already available (every recent distro with CUPS backend).]),
1412 AS_HELP_STRING([--without-afms],
1413 [Removes bitmap font files from LibreOffice installation set, for people
1414 building for specific distributions where AFM files or TrueType Fonts
1415 are known to be available.]),
1419 AS_HELP_STRING([--with-epm],
1420 [Decides which epm to use. Default is to use the one from the system if
1421 one is built. When either this is not there or you say =internal epm
1425 AC_ARG_WITH(package-format,
1426 AS_HELP_STRING([--with-package-format],
1427 [Specify package format(s) for LibreOffice installation sets. The
1428 implicit --without-package-format leads to no installation sets being
1429 generated. Possible values: aix, archive, bsd, deb, dmg,
1430 installed, msi, native, pkg, portable, and rpm.
1431 Example: --with-package-format='deb rpm']),
1435 AS_HELP_STRING([--with-tls],
1436 [Decides which TLS/SSL and cryptographic implementations to use for
1437 LibreOffice's code. Notice that this doesn't apply for depending
1438 libraries like "neon", for example. Default is to use OpenSSL
1439 although NSS is also possible. Notice that selecting NSS restricts
1440 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1441 restrict by now the usage of NSS in LO's code. Possible values:
1442 openssl, nss. Example: --with-tls="nss"]),
1445 AC_ARG_WITH(system-libs,
1446 AS_HELP_STRING([--with-system-libs],
1447 [Use libraries already on system -- enables all --with-system-* flags.]),
1450 AC_ARG_WITH(system-headers,
1451 AS_HELP_STRING([--with-system-headers],
1452 [Use headers already on system -- enables all --with-system-* flags for
1453 external packages whose headers are the only entities used i.e.
1454 boost/vigra/odbc/sane-header(s).]),,
1455 [with_system_headers="$with_system_libs"])
1457 AC_ARG_WITH(system-jars,
1458 AS_HELP_STRING([--without-system-jars],
1459 [When building with --with-system-libs, also the needed jars are expected
1460 on the system. Use this to disable that]),,
1461 [with_system_jars="$with_system_libs"])
1463 AC_ARG_WITH(system-cairo,
1464 AS_HELP_STRING([--with-system-cairo],
1465 [Use cairo libraries already on system. Happens automatically for
1466 (implicit) --enable-gtk and for --enable-gtk3.]))
1468 AC_ARG_WITH(myspell-dicts,
1469 AS_HELP_STRING([--with-myspell-dicts],
1470 [Adds myspell dictionaries to the LibreOffice installation set]),
1473 AC_ARG_WITH(system-dicts,
1474 AS_HELP_STRING([--without-system-dicts],
1475 [Do not use dictionaries from system paths.]),
1478 AC_ARG_WITH(external-dict-dir,
1479 AS_HELP_STRING([--with-external-dict-dir],
1480 [Specify external dictionary dir.]),
1483 AC_ARG_WITH(external-hyph-dir,
1484 AS_HELP_STRING([--with-external-hyph-dir],
1485 [Specify external hyphenation pattern dir.]),
1488 AC_ARG_WITH(external-thes-dir,
1489 AS_HELP_STRING([--with-external-thes-dir],
1490 [Specify external thesaurus dir.]),
1493 AC_ARG_WITH(system-zlib,
1494 AS_HELP_STRING([--with-system-zlib],
1495 [Use zlib already on system.]),,
1496 [with_system_zlib=auto])
1498 AC_ARG_WITH(system-jpeg,
1499 AS_HELP_STRING([--with-system-jpeg],
1500 [Use jpeg already on system.]),,
1501 [with_system_jpeg=auto])
1503 AC_ARG_WITH(system-clucene,
1504 AS_HELP_STRING([--with-system-clucene],
1505 [Use clucene already on system.]),,
1506 [with_system_clucene="$with_system_libs"])
1508 AC_ARG_WITH(system-expat,
1509 AS_HELP_STRING([--with-system-expat],
1510 [Use expat already on system.]),,
1511 [with_system_expat="$with_system_libs"])
1513 AC_ARG_WITH(system-libeot,
1514 AS_HELP_STRING([--with-system-libeot],
1515 [Use libeot already on system.]),,
1516 [with_system_libeot="$with_system_libs"])
1518 AC_ARG_WITH(system-libxml,
1519 AS_HELP_STRING([--with-system-libxml],
1520 [Use libxml/libxslt already on system.]),,
1521 [with_system_libxml=auto])
1523 AC_ARG_WITH(system-icu,
1524 AS_HELP_STRING([--with-system-icu],
1525 [Use icu already on system.]),,
1526 [with_system_icu="$with_system_libs"])
1528 AC_ARG_WITH(system-ucpp,
1529 AS_HELP_STRING([--with-system-ucpp],
1530 [Use ucpp already on system.]),,
1533 AC_ARG_WITH(system-openldap,
1534 AS_HELP_STRING([--with-system-openldap],
1535 [Use the OpenLDAP LDAP SDK already on system.]),,
1536 [with_system_openldap="$with_system_libs"])
1538 AC_ARG_WITH(system-poppler,
1539 AS_HELP_STRING([--with-system-poppler],
1540 [Use system poppler (only needed for PDF import).]),,
1541 [with_system_poppler="$with_system_libs"])
1543 AC_ARG_WITH(system-apache-commons,
1544 AS_HELP_STRING([--with-system-apache-commons],
1545 [Use Apache commons libraries already on system.]),,
1546 [with_system_apache_commons="$with_system_jars"])
1548 AC_ARG_WITH(system-mariadb,
1549 AS_HELP_STRING([--with-system-mariadb],
1550 [Use MariaDB/MySQL libraries already on system, for building the MariaDB Connector/LibreOffice
1552 [with_system_mariadb="$with_system_libs"])
1554 AC_ARG_ENABLE(bundle-mariadb,
1555 AS_HELP_STRING([--enable-bundle-mariadb],
1556 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice extension.])
1559 AC_ARG_WITH(system-mysql-cppconn,
1560 AS_HELP_STRING([--with-system-mysql-cppconn],
1561 [Use MySQL C++ Connector libraries already on system.]),,
1562 [with_system_mysql_cppconn="$with_system_libs"])
1564 AC_ARG_WITH(system-postgresql,
1565 AS_HELP_STRING([--with-system-postgresql],
1566 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1567 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1568 [with_system_postgresql="$with_system_libs"])
1570 AC_ARG_WITH(libpq-path,
1571 AS_HELP_STRING([--with-libpq-path],
1572 [Use this PostgreSQL C interface (libpq) installation for building
1573 the PostgreSQL-SDBC extension.])
1575 Usage: --with-libpq-path=<absolute path to
1576 your libpq installation>
1580 AC_ARG_WITH(system-firebird,
1581 AS_HELP_STRING([--with-system-firebird],
1582 [Use Firebird libraries already on system, for building the Firebird-SDBC
1583 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1584 [with_system_firebird="$with_system_libs"])
1586 AC_ARG_WITH(system-hsqldb,
1587 AS_HELP_STRING([--with-system-hsqldb],
1588 [Use hsqldb already on system.]))
1590 AC_ARG_WITH(hsqldb-jar,
1591 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1592 [Specify path to jarfile manually.]),
1593 HSQLDB_JAR=$withval)
1595 AC_ARG_ENABLE(scripting-beanshell,
1596 AS_HELP_STRING([--disable-scripting-beanshell],
1597 [Disable support for scripts in BeanShell.]),
1601 AC_ARG_WITH(system-beanshell,
1602 AS_HELP_STRING([--with-system-beanshell],
1603 [Use beanshell already on system.]),,
1604 [with_system_beanshell="$with_system_jars"])
1606 AC_ARG_WITH(beanshell-jar,
1607 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1608 [Specify path to jarfile manually.]),
1611 AC_ARG_ENABLE(scripting-javascript,
1612 AS_HELP_STRING([--disable-scripting-javascript],
1613 [Disable support for scripts in JavaScript.]),
1617 AC_ARG_WITH(system-rhino,
1618 AS_HELP_STRING([--with-system-rhino],
1619 [Use rhino already on system.]),,)
1620 # [with_system_rhino="$with_system_jars"])
1621 # Above is not used as we have different debug interface
1622 # patched into internal rhino. This code needs to be fixed
1623 # before we can enable it by default.
1625 AC_ARG_WITH(rhino-jar,
1626 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1627 [Specify path to jarfile manually.]),
1630 AC_ARG_WITH(commons-codec-jar,
1631 AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1632 [Specify path to jarfile manually.]),
1633 COMMONS_CODEC_JAR=$withval)
1635 AC_ARG_WITH(commons-lang-jar,
1636 AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1637 [Specify path to jarfile manually.]),
1638 COMMONS_LANG_JAR=$withval)
1640 AC_ARG_WITH(commons-httpclient-jar,
1641 AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1642 [Specify path to jarfile manually.]),
1643 COMMONS_HTTPCLIENT_JAR=$withval)
1645 AC_ARG_WITH(commons-logging-jar,
1646 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1647 [Specify path to jarfile manually.]),
1648 COMMONS_LOGGING_JAR=$withval)
1650 AC_ARG_WITH(system-jfreereport,
1651 AS_HELP_STRING([--with-system-jfreereport],
1652 [Use JFreeReport already on system.]),,
1653 [with_system_jfreereport="$with_system_jars"])
1655 AC_ARG_WITH(sac-jar,
1656 AS_HELP_STRING([--with-sac-jar=JARFILE],
1657 [Specify path to jarfile manually.]),
1660 AC_ARG_WITH(libxml-jar,
1661 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1662 [Specify path to jarfile manually.]),
1663 LIBXML_JAR=$withval)
1665 AC_ARG_WITH(flute-jar,
1666 AS_HELP_STRING([--with-flute-jar=JARFILE],
1667 [Specify path to jarfile manually.]),
1670 AC_ARG_WITH(jfreereport-jar,
1671 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1672 [Specify path to jarfile manually.]),
1673 JFREEREPORT_JAR=$withval)
1675 AC_ARG_WITH(liblayout-jar,
1676 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1677 [Specify path to jarfile manually.]),
1678 LIBLAYOUT_JAR=$withval)
1680 AC_ARG_WITH(libloader-jar,
1681 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1682 [Specify path to jarfile manually.]),
1683 LIBLOADER_JAR=$withval)
1685 AC_ARG_WITH(libloader-jar,
1686 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1687 [Specify path to jarfile manually.]),
1688 LIBLOADER_JAR=$withval)
1690 AC_ARG_WITH(libformula-jar,
1691 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1692 [Specify path to jarfile manually.]),
1693 LIBFORMULA_JAR=$withval)
1695 AC_ARG_WITH(librepository-jar,
1696 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1697 [Specify path to jarfile manually.]),
1698 LIBREPOSITORY_JAR=$withval)
1700 AC_ARG_WITH(libfonts-jar,
1701 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1702 [Specify path to jarfile manually.]),
1703 LIBFONTS_JAR=$withval)
1705 AC_ARG_WITH(libserializer-jar,
1706 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1707 [Specify path to jarfile manually.]),
1708 LIBSERIALIZER_JAR=$withval)
1710 AC_ARG_WITH(libbase-jar,
1711 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1712 [Specify path to jarfile manually.]),
1713 LIBBASE_JAR=$withval)
1715 AC_ARG_WITH(system-odbc,
1716 AS_HELP_STRING([--with-system-odbc],
1717 [Use the odbc headers already on system.]),,
1718 [with_system_odbc="$with_system_headers"])
1720 AC_ARG_WITH(system-sane,
1721 AS_HELP_STRING([--with-system-sane],
1722 [Use sane.h already on system.]),,
1723 [with_system_sane="$with_system_headers"])
1725 AC_ARG_WITH(system-bluez,
1726 AS_HELP_STRING([--with-system-bluez],
1727 [Use bluetooth.h already on system.]),,
1728 [with_system_bluez="$with_system_headers"])
1730 AC_ARG_WITH(system-mesa-headers,
1731 AS_HELP_STRING([--with-system-mesa-headers],
1732 [Use Mesa headers already on system.]),,
1733 [with_system_mesa_headers="$with_system_headers"])
1735 AC_ARG_WITH(system-curl,
1736 AS_HELP_STRING([--with-system-curl],
1737 [Use curl already on system.]),,
1738 [with_system_curl=auto])
1740 AC_ARG_WITH(system-boost,
1741 AS_HELP_STRING([--with-system-boost],
1742 [Use boost already on system.]),,
1743 [with_system_boost="$with_system_headers"])
1745 AC_ARG_WITH(system-vigra,
1746 AS_HELP_STRING([--with-system-vigra],
1747 [Use vigra already on system.]),,
1748 [with_system_vigra="$with_system_headers"])
1750 AC_ARG_WITH(system-hunspell,
1751 AS_HELP_STRING([--with-system-hunspell],
1752 [Use libhunspell already on system.]),,
1753 [with_system_hunspell="$with_system_libs"])
1755 AC_ARG_WITH(system-mythes,
1756 AS_HELP_STRING([--with-system-mythes],
1757 [Use mythes already on system.]),,
1758 [with_system_mythes="$with_system_libs"])
1760 AC_ARG_WITH(system-altlinuxhyph,
1761 AS_HELP_STRING([--with-system-altlinuxhyph],
1762 [Use ALTLinuxhyph already on system.]),,
1763 [with_system_altlinuxhyph="$with_system_libs"])
1765 AC_ARG_WITH(system-lpsolve,
1766 AS_HELP_STRING([--with-system-lpsolve],
1767 [Use lpsolve already on system.]),,
1768 [with_system_lpsolve="$with_system_libs"])
1770 AC_ARG_WITH(system-liblangtag,
1771 AS_HELP_STRING([--with-system-liblangtag],
1772 [Use liblangtag library already on system.]),,
1773 [with_system_liblangtag="$with_system_libs"])
1775 AC_ARG_WITH(system-npapi-headers,
1776 AS_HELP_STRING([--with-system-npapi-headers],
1777 [Use NPAPI headers provided by system instead of bundled ones. Used in
1778 extensions/source/nsplugin (ENABLE_NPAPI_INTO_BROWSER=TRUE) and
1779 extensions/source/plugin (ENABLE_NPAPI_FROM_BROWSER=TRUE)]),,
1780 [with_system_npapi_headers="$with_system_headers"]
1784 AS_HELP_STRING([--with-webdav],
1785 [Specify which library to use for webdav implementation.
1786 Possible values: "neon", "serf", "no". The default value is "neon".
1787 Example: --with-webdav="serf"]),
1788 WITH_WEBDAV=$withval,
1791 AC_ARG_WITH(linker-hash-style,
1792 AS_HELP_STRING([--with-linker-hash-style],
1793 [Use linker with --hash-style=<style> when linking shared objects.
1794 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1795 if supported on the build system, and "sysv" otherwise.]))
1797 AC_ARG_WITH(jdk-home,
1798 AS_HELP_STRING([--with-jdk-home],
1799 [If you have installed JDK 1.3 or later on your system please supply the
1800 path here. Note that this is not the location of the java command but the
1801 location of the entire distribution.])
1803 Usage: --with-jdk-home=<absolute path to JDK home>
1808 AS_HELP_STRING([--with-help],
1809 [Enable the build of help. There is a special parameter "common" that
1810 can be used to bundle only the common part, .e.g help-specific icons.
1811 This is useful when you build the helpcontent separately.])
1813 Usage: --with-help build the entire local help
1814 --without-help no local help (default)
1815 --with-help=common bundle common files for the local
1816 help but do not build the whole help
1821 AS_HELP_STRING([--with-java],
1822 [Specify the name of the Java interpreter command. Typically "java"
1823 which is the default.
1825 To build without support for Java components, applets, accessibility
1826 or the XML filters written in Java, use --without-java or --with-java=no.])
1828 Usage: --with-java==<java command>
1831 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1835 AC_ARG_WITH(jvm-path,
1836 AS_HELP_STRING([--with-jvm-path],
1837 [Use a specific JVM search path at runtime.])
1839 Usage: --with-jvm-path=<absolute path to parent of jvm home>
1841 e. g.: --with-jvm-path=/usr/lib/
1842 to find JRE/JDK in /usr/lib/jvm/
1846 AC_ARG_WITH(ant-home,
1847 AS_HELP_STRING([--with-ant-home],
1848 [If you have installed Jakarta Ant on your system, please supply the path here.
1849 Note that this is not the location of the Ant binary but the location
1850 of the entire distribution.])
1852 Usage: --with-ant-home=<absolute path to Ant home>
1857 AS_HELP_STRING([--with-junit],
1858 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1859 --without-junit disables those tests. Not relevant in the --without-java case.])
1861 Usage: --with-junit=<absolute path to JUnit 4 jar>
1865 AC_ARG_WITH(perl-home,
1866 AS_HELP_STRING([--with-perl-home],
1867 [If you have installed Perl 5 Distribution, on your system, please
1868 supply the path here. Note that this is not the location of the Perl
1869 binary but the location of the entire distribution.])
1871 Usage: --with-perl-home=<abs. path to Perl 5 home>
1879 [Specifies the doxygen executable to use when generating ODK C/C++
1880 documentation. --without-doxygen disables generation of ODK C/C++
1881 documentation. Not relevant in the --disable-odk case.])
1883 Usage: --with-doxygen=<absolute path to doxygen executable>
1887 AC_ARG_WITH(visual-studio,
1888 AS_HELP_STRING([--with-visual-studio=<2012/2010/2013>],
1889 [Specify which Visual Studio version to use in case several are
1890 are installed. If not specified, the order of preference is
1891 2012, 2010, 2013 (including Express editions).])
1893 Usage: --with-visual-studio=<2012/2010/2013>
1897 AC_ARG_WITH(windows-sdk,
1898 AS_HELP_STRING([--with-windows-sdk=<6.0(A)/7.0(A)/7.1(A)/8.0(A)>],
1899 [Specify which Windows SDK, or "Windows Kit", version to use
1900 in case the one that came with the selected Visual Studio
1901 is not what you want for some reason. Note that not all compiler/SDK
1902 combinations are supported. The intent is that this option should not
1905 Usage: --with-windows-sdk=6.0(A)/7.0(A)/7.1(A)/8.0(A)>
1910 AS_HELP_STRING([--with-lang],
1911 [Use this option to build LibreOffice with additional language support.
1912 English (US) is always included by default.
1913 Separate multiple languages with space.
1914 For all languages, use --with-lang=ALL.])
1916 Usage: --with-lang="es sw tu cs sk"
1920 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
1922 AS_HELP_STRING([--with-krb5],
1923 [Enable MIT Kerberos 5 support in modules that support it.
1924 By default automatically enabled on platforms
1925 where a good system Kerberos 5 is available.]),
1929 AS_HELP_STRING([--with-gssapi],
1930 [Enable GSSAPI support in modules that support it.
1931 By default automatically enabled on platforms
1932 where a good system GSSAPI is available.]),
1935 dnl ===================================================================
1937 dnl ===================================================================
1939 AC_ARG_WITH(branding,
1940 AS_HELP_STRING([--with-branding],
1941 [Use given path to retrieve branding images set.])
1943 Search for intro.png about.svg flat_logo.svg
1944 backing_left.png backing_right.png
1945 backing_rtl_left.png backing_rtl_right.png
1946 backing_space.png. If any is missing, default
1947 ones will be used instead.
1949 Search also progress.conf for progress
1950 settings on intro screen :
1952 PROGRESSBARCOLOR="255,255,255" Set color of
1953 progress bar. Comma separated RGB decimal values.
1954 PROGRESSSIZE="407,6" Set size of progress bar.
1955 Comma separated decimal values (width, height).
1956 PROGRESSPOSITION="61,317" Set position of progress
1957 bar from left,top. Comma separated decimal values.
1958 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
1959 bar frame. Comma separated RGB decimal values.
1960 PROGRESSTEXTCOLOR="255,255,255" Set color of progress
1961 bar text. Comma separated RGB decimal values.
1962 PROGRESSTEXTBASELINE="287" Set vertical position of
1963 progress bar text from top. Decimal value.
1965 Default values will be used if not found.
1967 Usage: --with-branding=/path/to/images
1972 AC_ARG_WITH(extra-buildid,
1973 AS_HELP_STRING([--with-extra-buildid],
1974 [Show addition build identification in about dialog.])
1976 Usage: --with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"
1982 AS_HELP_STRING([--with-vendor],
1983 [Set vendor of the build.])
1985 Usage: --with-vendor="John the Builder"
1989 AC_ARG_WITH(compat-oowrappers,
1990 AS_HELP_STRING([--with-compat-oowrappers],
1991 [Install oo* wrappers in parallel with
1992 lo* ones to keep backward compatibility.
1993 Has effect only with make distro-pack-install]),
1996 AC_ARG_WITH(os-version,
1997 AS_HELP_STRING([--with-os-version],
1998 [For FreeBSD users, use this option option to override the detected OSVERSION.])
2000 Usage: --with-os-version=<OSVERSION>
2004 AC_ARG_WITH(mingw-cross-compiler,
2005 AS_HELP_STRING([--with-mingw-cross-compiler],
2006 [Specify the MinGW cross-compiler to use.])
2008 Usage: --with-mingw-cross-compiler=<mingw32-g++ command>
2010 When building on the ODK on Unix and building unowinreg.dll,
2011 specify the MinGW C++ cross-compiler.
2015 AC_ARG_WITH(idlc-cpp,
2016 AS_HELP_STRING([--with-idlc-cpp],
2017 [Specify the C Preprocessor to use for idlc.])
2019 Usage: --with-idlc-cpp=cpp
2025 AC_ARG_WITH(build-version,
2026 AS_HELP_STRING([--with-build-version],
2027 [Allows the builder to add a custom version tag that will appear in the
2028 Help/About box for QA purposes.])
2030 Usage: --with-build-version="Built by Jim"
2032 with_build_version=$withval ,
2036 AS_HELP_STRING([--with-alloc],
2037 [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
2038 Note that on FreeBSD/NetBSD system==jemalloc]),
2041 AC_ARG_WITH(sun-templates,
2042 AS_HELP_STRING([--with-sun-templates],
2043 [Integrate Sun template packages.]),
2046 AC_ARG_WITH(parallelism,
2047 AS_HELP_STRING([--with-parallelism],
2048 [Number of jobs to run simultaneously during build. Parallel builds can
2049 save a lot of time on multi-cpu machines. Defaults to the number of
2050 CPUs on the machine, unless you configure --enable-icecream - then to
2054 AC_ARG_WITH(check-jobs,
2055 AS_HELP_STRING([--with-check-jobs],
2056 [Maximum number of jobs that will be issued at the same time during 'make subsequenttest'.
2057 Default value is the same as 'parallelism'. Useful because the subsequent tests are very lightweight.]),
2060 AC_ARG_WITH(all-tarballs,
2061 AS_HELP_STRING([--with-all-tarballs],
2062 [Download all external tarballs unconditionally]))
2064 AC_ARG_WITH(gdrive-client-id,
2065 AS_HELP_STRING([--with-gdrive-client-id],
2066 [Provides the client id of the application for OAuth2 authentication
2067 on Google Drive. If either this or --with-gdrive-client-secret is
2068 empty, the feature will be disabled]),
2071 AC_ARG_WITH(gdrive-client-secret,
2072 AS_HELP_STRING([--with-gdrive-client-secret],
2073 [Provides the client secret of the application for OAuth2
2074 authentication on Google Drive. If either this or
2075 --with-gdrive-client-id is empty, the feature will be disabled]),
2078 AC_ARG_WITH(alfresco-cloud-client-id,
2079 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2080 [Provides the client id of the application for OAuth2 authentication
2081 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2082 empty, the feature will be disabled]),
2085 AC_ARG_WITH(alfresco-cloud-client-secret,
2086 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2087 [Provides the client secret of the application for OAuth2
2088 authentication on Alfresco Cloud. If either this or
2089 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2092 dnl ===================================================================
2093 dnl Do we want to use pre-build binary tarball for recompile
2094 dnl ===================================================================
2096 if test "$enable_library_bin_tar" = "yes" ; then
2097 USE_LIBRARY_BIN_TAR=YES
2099 USE_LIBRARY_BIN_TAR=NO
2101 AC_SUBST(USE_LIBRARY_BIN_TAR)
2103 dnl ===================================================================
2104 dnl Test whether build target is Release Build
2105 dnl ===================================================================
2106 AC_MSG_CHECKING([whether build target is Release Build])
2107 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2109 ENABLE_RELEASE_BUILD=
2111 AC_MSG_RESULT([yes])
2112 ENABLE_RELEASE_BUILD=TRUE
2114 AC_SUBST(ENABLE_RELEASE_BUILD)
2116 dnl ===================================================================
2117 dnl Test whether to sign Windows Build
2118 dnl ===================================================================
2119 AC_MSG_CHECKING([whether to sign windows build])
2120 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
2121 AC_MSG_RESULT([yes])
2122 WINDOWS_BUILD_SIGNING="TRUE"
2125 WINDOWS_BUILD_SIGNING="FALSE"
2127 AC_SUBST(WINDOWS_BUILD_SIGNING)
2129 dnl ===================================================================
2130 dnl MacOSX build and runtime environment options
2131 dnl ===================================================================
2133 AC_ARG_WITH(macosx-sdk,
2134 AS_HELP_STRING([--with-macosx-sdk],
2135 [Use a specific SDK for building.])
2137 Usage: --with-macosx-sdk=<version>
2139 e. g.: --with-macosx-sdk=10.6
2141 there are 3 options to control the MacOSX build:
2142 --with-macosx-sdk (refered as 'sdk' below)
2143 --with-macosx-version-min-required (refered as 'min' below)
2144 --with-macosx-version-max-allowed (refered as 'max' below)
2146 the connection between these value and the default they take is as follow:
2147 ( ? means not specified on the command line, s means the SDK version found,
2148 constraint: x <= y <= z)
2150 ==========================================
2151 command line || config result
2152 ==========================================
2153 min | max | sdk || min | max | sdk |
2154 ? | ? | ? || 10.6 | 10.s | 10.s |
2155 ? | ? | 10.x || 10.6 | 10.x | 10.x |
2156 ? | 10.x | ? || 10.6 | 10.s | 10.s |
2157 ? | 10.x | 10.y || 10.6 | 10.x | 10.y |
2158 10.x | ? | ? || 10.x | 10.s | 10.s |
2159 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2160 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2161 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2164 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2165 for a detailled technical explanation of these variables
2167 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2169 Note that even if in theory using a --with-macosx-version-max-allowed
2170 (i.e. the MAC_OS_X_VERSION_MAX_ALLOWED macro) less than the SDK version
2171 should work, in practice Apple doesn't seem to test that, and at least
2172 compiling with -DMAC_OS_X_VERSION_MAX_ALLOWED=1060 against the 10.7 SDK
2173 fails in a couple of places. Just because of oversights in ifdefs in the SDK
2178 AC_ARG_WITH(macosx-version-min-required,
2179 AS_HELP_STRING([--with-macosx-version-min-required],
2180 [set the minimum OS version needed to run the built LibreOffice])
2182 Usage: --with-macosx-version-min-required=<version>
2184 e. g.: --with-macos-version-min-required=10.6
2185 see --with-macosx-sdk for more info
2189 AC_ARG_WITH(macosx-version-max-allowed,
2190 AS_HELP_STRING([--with-macosx-version-max-allowed],
2191 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2193 Usage: --with-macosx-version-max-allowed=<version>
2195 e. g.: --with-macos-version-max-allowed=10.6
2196 see --with-macosx-sdk for more info
2201 dnl ===================================================================
2202 dnl options for stuff used during cross-compilation build
2203 dnl These are superseded by --with-build-platform-configure-options.
2204 dnl Or are they? Look for the complicated tests for "$cross_compiling" = "yes" -a \(
2205 dnl "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \)
2206 dnl far below. Could whoever understands MinGW cross-compilation clean up this please.
2207 dnl ===================================================================
2209 AC_ARG_WITH(system-boost-for-build,
2210 AS_HELP_STRING([--with-system-boost-for-build],
2211 [Use boost already on system for build tools (cross-compilation only).]))
2213 AC_ARG_WITH(system-cppunit-for-build,
2214 AS_HELP_STRING([--with-system-cppunit-for-build],
2215 [Use cppunit already on system for build tools (cross-compilation only).]))
2217 AC_ARG_WITH(system-expat-for-build,
2218 AS_HELP_STRING([--with-system-expat-for-build],
2219 [Use expat already on system for build tools (cross-compilation only).]))
2221 AC_ARG_WITH(system-icu-for-build,
2222 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2223 [Use icu already on system for build tools (cross-compilation only).]))
2225 AC_ARG_WITH(system-libxml-for-build,
2226 AS_HELP_STRING([--with-system-libxml-for-build],
2227 [Use libxml/libxslt already on system for build tools (cross-compilation only).]))
2230 dnl ===================================================================
2231 dnl check for required programs (grep, awk, sed, bash)
2232 dnl ===================================================================
2236 if test -n "$1"; then
2237 if test "$build_os" = "cygwin"; then
2239 new_path=`cygpath -u "$formatted_path"`
2243 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2244 if test "$2" = "after"; then
2245 LO_PATH="$LO_PATH:$new_path"
2247 LO_PATH="$new_path:$LO_PATH"
2255 AC_PATH_PROG( AWK, $AWK)
2256 if test -z "$AWK"; then
2257 AC_MSG_ERROR([install awk to run this script])
2260 AC_PATH_PROG(BASH, bash)
2261 if test -z "$BASH"; then
2262 AC_MSG_ERROR([bash not found in \$PATH])
2266 AC_MSG_CHECKING([for GNU or BSD tar])
2267 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
2268 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2269 if test $? -eq 0; then
2274 AC_MSG_RESULT($GNUTAR)
2275 if test -z "$GNUTAR"; then
2276 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2280 AC_MSG_CHECKING([for tar's option to strip components])
2281 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2282 if test $? -eq 0; then
2283 STRIP_COMPONENTS="--strip-components"
2285 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2286 if test $? -eq 0; then
2287 STRIP_COMPONENTS="--strip-path"
2289 STRIP_COMPONENTS="unsupported"
2292 AC_MSG_RESULT($STRIP_COMPONENTS)
2293 if test x$STRIP_COMPONENTS = xunsupported; then
2294 AC_MSG_ERROR([you need a tar that is able to strip components.])
2296 AC_SUBST(STRIP_COMPONENTS)
2298 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2299 dnl desktop OSes from "mobile" ones.
2301 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2302 dnl In other words, that when building for an OS that is not a
2303 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2305 dnl Note the direction of the implication; there is no assumption that
2306 dnl cross-compiling would imply a non-desktop OS.
2308 if test $_os != iOS -a $_os != Android; then
2309 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2310 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2311 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2315 if test "$enable_export" != no; then
2316 BUILD_TYPE="$BUILD_TYPE EXPORT"
2318 DISABLE_EXPORT='TRUE'
2319 SCPDEFS="$SCPDES -DDISABLE_EXPORT"
2321 AC_SUBST(DISABLE_EXPORT)
2323 dnl Decide whether to build database connectivity stuff (including
2324 dnl Base) or not. We probably don't want to on non-desktop OSes.
2326 if test -z "$enable_database_connectivity"; then
2327 # Do enable database connectivity for Android for now as otherwise
2328 # we presumably will get linking errors... We are not as far in
2329 # the work for iOS, so we might as well disable it for iOS already.
2331 # And actually, do enable it for iOS, too. Let's get back to
2332 # figuring out what to do with this later, if ever.
2334 # (Note that with "enable", I mean "enable building the related
2335 # code". Very likely little of it will make any sense at run-time
2336 # on Android or iOS and won't even be shipped with/linked into any
2339 #if test $_os != iOS; then
2340 enable_database_connectivity=yes
2344 DISABLE_DBCONNECTIVITY=''
2345 if test "$enable_database_connectivity" = yes; then
2346 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2348 DISABLE_DBCONNECTIVITY='TRUE'
2349 SCPDEFS="$SCPDEFS -DDISABLE_DBCONNECTIVITY"
2351 AC_SUBST(DISABLE_DBCONNECTIVITY)
2353 if test -z "$enable_extensions"; then
2354 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2355 if test $_os != iOS -a $_os != Android; then
2356 enable_extensions=yes
2360 if test "$enable_extensions" = yes; then
2361 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2362 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2365 if test -z "$enable_scripting"; then
2366 # Disable scripting for iOS unless specifically overridden
2367 # with --enable-scripting.
2368 if test $_os != iOS; then
2369 enable_scripting=yes
2373 DISABLE_SCRIPTING=''
2374 if test "$enable_scripting" = yes; then
2375 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2377 DISABLE_SCRIPTING='TRUE'
2378 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2380 AC_SUBST(DISABLE_SCRIPTING)
2382 if test $_os = iOS -o $_os = Android; then
2383 # Disable dynamic_loading always for iOS and Android
2384 enable_dynamic_loading=no
2385 elif test -z "$enable_dynamic_loading"; then
2386 # Otherwise enable it unless speficically disabled
2387 enable_dynamic_loading=yes
2390 DISABLE_DYNLOADING=''
2391 if test "$enable_dynamic_loading" = yes; then
2392 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2394 DISABLE_DYNLOADING='TRUE'
2395 SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
2397 AC_SUBST(DISABLE_DYNLOADING)
2399 # remenber SYSBASE value
2402 dnl ===================================================================
2403 dnl Sort out various gallery compilation options
2404 dnl ===================================================================
2405 AC_MSG_CHECKING([how to build and package galleries])
2406 if test -n "${with_galleries}"; then
2407 if test "$with_galleries" = "build"; then
2408 WITH_GALLERY_BUILD=YES
2409 AC_MSG_RESULT([build from source images internally])
2410 elif test "$with_galleries" = "package"; then
2411 WITH_GALLERY_BUILD=PACKAGE
2412 AC_MSG_ERROR([FIXME - implement build from pre-compiled package])
2413 elif test "$with_galleries" = "no"; then
2415 AC_MSG_RESULT([disable non-internal gallery build])
2417 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2420 if test $_os != iOS -a $_os != Android; then
2421 WITH_GALLERY_BUILD=YES
2422 AC_MSG_RESULT([internal src images for desktop])
2425 AC_MSG_RESULT([disable src imgage build])
2428 AC_SUBST(WITH_GALLERY_BUILD)
2430 dnl ===================================================================
2431 dnl Checks if ccache is available
2432 dnl ===================================================================
2433 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2434 case "%$CC%$CXX%" in
2435 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some verison number etc),
2436 # assume that's good then
2437 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2438 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2441 AC_PATH_PROG([CCACHE],[ccache],[not found])
2442 if test "$CCACHE" = "not found"; then
2445 # Need to check for ccache version: otherwise prevents
2446 # caching of the results (like "-x objective-c++" for Mac)
2447 if test $_os = Darwin -o $_os = iOS; then
2448 # Check ccache version
2449 AC_MSG_CHECKING([whether version of ccache is suitable])
2450 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2451 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2452 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2453 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2455 AC_MSG_RESULT([no, $CCACHE_VERSION])
2466 if test "$CCACHE" != ""; then
2467 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2468 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2469 if test "$ccache_size" = ""; then
2470 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2471 if test "$ccache_size" = ""; then
2474 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2475 if test $ccache_size -lt 1024; then
2477 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
2478 add_warning "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled"
2480 # warn that ccache may be too small for debug build
2481 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2482 add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
2485 if test $ccache_size -lt 5; then
2486 #warn that ccache may be too small for debug build
2487 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2488 add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
2493 dnl ===================================================================
2494 dnl Checks for C compiler,
2495 dnl The check for the C++ compiler is later on.
2496 dnl ===================================================================
2497 if test "$_os" != "WINNT" -a "$WITH_MINGW" != "yes"; then
2499 AC_MSG_CHECKING([gcc home])
2500 if test -z "$with_gcc_home"; then
2501 if test "$enable_icecream" = "yes"; then
2502 if test -d "/usr/lib/icecc/bin"; then
2503 GCC_HOME="/usr/lib/icecc/"
2505 GCC_HOME="/opt/icecream/"
2508 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2509 GCC_HOME_SET="false"
2512 GCC_HOME="$with_gcc_home"
2514 AC_MSG_RESULT($GCC_HOME)
2517 if test "$GCC_HOME_SET" = "true"; then
2518 if test -z "$CC"; then
2519 CC="$GCC_HOME/bin/gcc"
2521 if test -z "$CXX"; then
2522 CXX="$GCC_HOME/bin/g++"
2527 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
2528 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2529 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
2535 COMPATH=`dirname "$CC"`
2536 if test "$COMPATH" = "."; then
2537 AC_PATH_PROGS(COMPATH, $CC)
2538 dnl double square bracket to get single because of M4 quote...
2539 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2541 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2543 # Set the ENABLE_LTO variable
2544 # ===================================================================
2545 AC_MSG_CHECKING([whether to use link-time optimization])
2546 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
2548 AC_MSG_RESULT([yes])
2553 AC_SUBST(ENABLE_LTO)
2555 dnl ===================================================================
2557 dnl ===================================================================
2558 AC_MSG_CHECKING([whether to build with Java support])
2559 if test "$with_java" != "no"; then
2560 if test "$DISABLE_SCRIPTING" = TRUE; then
2561 AC_MSG_RESULT([no, overridden by --disable-scripting])
2565 AC_MSG_RESULT([yes])
2567 AC_DEFINE(HAVE_FEATURE_JAVA)
2574 AC_SUBST(ENABLE_JAVA)
2576 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2578 dnl ENABLE_JAVA="" indicate no Java support at all
2580 dnl ===================================================================
2581 dnl Test the Solaris compiler version
2582 dnl ===================================================================
2583 if test "$_os" = "SunOS"; then
2584 if test "$CC" = "cc"; then
2585 AC_PATH_PROGS(_cc, cc)
2586 COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2587 AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2588 dnl cc -V outputs to standard error!!!!
2589 _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2590 _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2591 _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2592 if test "$_sunstudio_major" != "5"; then
2593 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2595 _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" }'`
2596 if test "$_sunstudio_minor" = "false"; then
2597 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2599 dnl compiler will do
2600 AC_MSG_RESULT([checked])
2607 dnl ===================================================================
2608 dnl Check OS X SDK and compiler
2609 dnl ===================================================================
2611 if test $_os = Darwin; then
2613 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2620 # If no --with-macosx-sdk option is given, look for 10.6, 10.7,
2621 # 10.8 and 10.9 SDKs, in that order. If not found in some (old)
2622 # default locations, try the xcode-select tool.
2624 # The intent is that for "most" Mac-based developers, a suitable
2625 # SDK will be found automatically without any configure options.
2627 # For developers still using Xcode 3, in /Developer, either
2628 # because it is the only Xcode they have, or they have that in
2629 # addition to Xcode 4 in /Applications/Xcode.app, the 10.6 SDK
2632 # For developers with a current Xcode, the lowest-numbered SDK
2635 AC_MSG_CHECKING([what Mac OS X SDK to use])
2637 if test -z "$with_macosx_sdk"; then
2638 if test -d /Developer/SDKs/MacOSX10.6.sdk; then
2639 with_macosx_sdk=10.6
2640 elif test -d /Developer-old/SDKs/MacOSX10.6.sdk; then
2641 with_macosx_sdk=10.6
2642 elif test -d /Xcode3/SDKs/MacOSX10.6.sdk; then
2643 with_macosx_sdk=10.6
2644 elif test -d /Developer/SDKs/MacOSX10.7.sdk; then
2645 with_macosx_sdk=10.7
2646 elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
2647 with_macosx_sdk=10.6
2648 elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"; then
2649 with_macosx_sdk=10.7
2650 elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"; then
2651 with_macosx_sdk=10.8
2652 elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"; then
2653 with_macosx_sdk=10.9
2654 elif test -x /usr/bin/xcode-select; then
2655 xcodepath="`xcode-select -print-path`"
2656 if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
2657 with_macosx_sdk=10.6
2658 elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"; then
2659 with_macosx_sdk=10.7
2660 elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"; then
2661 with_macosx_sdk=10.8
2662 elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"; then
2663 with_macosx_sdk=10.9
2666 if test -z "$with_macosx_sdk"; then
2667 AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2671 case $with_macosx_sdk in
2673 MACOSX_SDK_VERSION=1060
2676 MACOSX_SDK_VERSION=1070
2679 MACOSX_SDK_VERSION=1080
2682 MACOSX_SDK_VERSION=1090
2685 MACOSX_SDK_VERSION=101000
2688 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.6--10])
2692 # Next find it (again, if we deduced its version above by finding
2693 # it... but we need to look for it once more in case
2694 # --with-macosx-sdk was given so that the above search did not
2696 if test -z "$MACOSX_SDK_PATH"; then
2697 case $with_macosx_sdk in
2699 if test -d /Developer/SDKs/MacOSX10.6.sdk; then
2700 MACOSX_SDK_PATH=/Developer/SDKs/MacOSX10.6.sdk
2701 elif test -d /Developer-old/SDKs/MacOSX10.6.sdk; then
2702 MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX10.6.sdk
2703 elif test -d /Xcode3/SDKs/MacOSX10.6.sdk; then
2704 MACOSX_SDK_PATH=/Xcode3/SDKs/MacOSX10.6.sdk
2705 elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
2706 MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk
2707 elif test -x /usr/bin/xcode-select; then
2708 xcodepath="`xcode-select -print-path`"
2709 if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
2710 MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
2715 if test -d /Developer/SDKs/MacOSX$with_macosx_sdk.sdk; then
2716 MACOSX_SDK_PATH=/Developer/SDKs/MacOSX$with_macosx_sdk.sdk
2717 elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
2718 MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk
2719 elif test -x /usr/bin/xcode-select; then
2720 xcodepath="`xcode-select -print-path`"
2721 if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
2722 MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
2727 xcodepath="`xcode-select -print-path`"
2728 if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
2729 MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
2733 if test -z "$MACOSX_SDK_PATH"; then
2734 AC_MSG_ERROR([Could not figure out the location of Mac OS X $with_macosx_sdk SDK])
2737 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2739 if test "$with_macosx_version_min_required" = ""; then
2740 with_macosx_version_min_required="10.6"
2743 if test "$with_macosx_version_max_allowed" = ""; then
2744 with_macosx_version_max_allowed="$with_macosx_sdk"
2747 # export this so that "xcrun" invocations later return matching values
2748 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2749 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2750 export DEVELOPER_DIR
2751 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2752 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2754 case "$with_macosx_version_min_required" in
2756 MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2759 MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2762 MAC_OS_X_VERSION_MIN_REQUIRED="1080"
2765 MAC_OS_X_VERSION_MIN_REQUIRED="1090"
2768 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2771 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.6--10])
2775 if test "$BITNESS_OVERRIDE" = ""; then
2776 case "$with_macosx_version_min_required" in
2778 case "$with_macosx_sdk" in
2782 AC_MSG_WARN([Building with a SDK > 10.6 possibly breaks 10.6 compatibility. Do not use for the TDF build])
2783 add_warning "Building with a SDK > 10.6 possibly breaks 10.6 compatibility. Do not use for the TDF build"
2788 AC_MSG_WARN([Building with a minimum version requirement > 10.6 breaks 10.6 compatibility. Do not use for the TDF build])
2789 add_warning "Building with a minimum version requirement > 10.6 breaks 10.6 compatibility. Do not use for the TDF build"
2794 # If no CC and CXX environment vars, try to guess where the compiler is
2796 if test -z "$save_CC"; then
2797 AC_MSG_CHECKING([what compiler to use])
2798 case $with_macosx_sdk in
2800 if test "$enable_libc__" = yes; then
2801 AC_MSG_ERROR([--enable-libc++ requires --with-macosx-version-min-required >= 10.7])
2803 # did someone copy her 10.6 sdk into xcode 4 (needed on Mountain Lion)?
2804 if test "$(echo $MACOSX_SDK_PATH | cut -c1-23)" = "/Applications/Xcode.app"; then
2805 CC="`xcrun -find gcc` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2806 CXX="`xcrun -find g++` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2808 CC="gcc-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2809 CXX="g++-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2811 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2814 10.7|10.8|10.9|10.10)
2815 if test "$enable_libc__" = yes; then
2816 if test "$with_macosx_version_min_required" = 10.6; then
2817 AC_MSG_ERROR([--enable-libc++ requires --with-macosx-version-min-required >= 10.7])
2819 # Use libc++ instead of libstdc++ when possible
2820 stdlib=-stdlib=libc++
2822 if test "$ENABLE_LTO" = TRUE; then
2825 CC="`xcrun -find clang` $bitness $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2826 CXX="`xcrun -find clang++` $bitness $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2827 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2830 STRIP=`xcrun -find strip`
2831 LIBTOOL=`xcrun -find libtool`
2832 RANLIB=`xcrun -find ranlib`
2835 AC_MSG_RESULT([$CC and $CXX])
2838 case "$with_macosx_version_max_allowed" in
2840 MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2843 MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2846 MAC_OS_X_VERSION_MAX_ALLOWED="1080"
2849 MAC_OS_X_VERSION_MAX_ALLOWED="1090"
2852 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2855 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.6--10])
2859 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2860 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2861 AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2866 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2867 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2868 AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2872 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2873 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2875 AC_MSG_CHECKING([whether to do code signing])
2877 if test "$enable_macosx_code_signing" = yes; then
2878 # By default use the first suitable certificate (?).
2880 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2881 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2882 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2883 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the the
2884 # "Developer ID Application" one.
2886 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | awk '{print $2}' |head -1`
2887 if test -n "$identity"; then
2888 MACOSX_CODESIGNING_IDENTITY=$identity
2889 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2890 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2892 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2893 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2894 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2895 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2900 AC_MSG_CHECKING([whether to create a Mac App Store package])
2902 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2903 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2904 elif test "$enable_macosx_package_signing" = yes; then
2905 # By default use the first suitable certificate.
2906 # It should be a "3rd Party Mac Developer Installer" one
2908 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2909 if test -n "$identity"; then
2910 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2911 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2912 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2914 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2916 elif test -n "$enable_macosx_package_signing"; then
2917 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2918 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2919 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2924 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2925 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2928 AC_MSG_CHECKING([whether to sandbox the application])
2930 if test -n "$with_macosx_teamid" -a "$with_macosx_teamid != yes -a "$with_macosx_teamid != no; then
2931 MACOSX_TEAMID="$with_macosx_teamid"
2934 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2935 AC_MSG_ERROR([OS X sandboxing requires code signing])
2936 elif test -z "$MACOSX_TEAMID" -a "$enable_macosx_sandbox" = yes; then
2937 AC_MSG_ERROR([OS X sandboxing requires a team id])
2938 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
2939 AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
2940 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
2941 ENABLE_MACOSX_SANDBOX=TRUE
2942 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
2943 AC_MSG_RESULT([yes])
2948 AC_MSG_CHECKING([what OS X app bundle identifier to use])
2949 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
2950 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
2952 AC_MSG_CHECKING([what OS X app name to use])
2953 MACOSX_APP_NAME="$with_macosx_app_name"
2954 AC_MSG_RESULT([$MACOSX_APP_NAME])
2956 AC_SUBST(MACOSX_SDK_PATH)
2957 AC_SUBST(MACOSX_SDK_VERSION)
2958 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2959 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2960 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2961 AC_SUBST(INSTALL_NAME_TOOL)
2962 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
2963 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2964 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
2965 AC_SUBST(ENABLE_MACOSX_SANDBOX)
2966 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
2967 AC_SUBST(MACOSX_TEAMID)
2968 AC_SUBST(MACOSX_APP_NAME)
2970 dnl ===================================================================
2971 dnl Check iOS SDK and compiler
2972 dnl ===================================================================
2974 if test $_os = iOS; then
2976 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2982 AC_MSG_CHECKING([what iOS SDK to use])
2984 if test "$enable_ios_simulator" = yes; then
2985 platform=iPhoneSimulator
2990 xcode_developer=`xcode-select -print-path`
2993 for sdkver in 7.0 6.1 6.0; do
2994 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3002 if test -z "$sysroot"; then
3003 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${pref_sdk_ver}])
3006 AC_MSG_RESULT($sysroot)
3008 if test "$enable_ios_simulator" = yes; then
3009 if test "$BITNESS_OVERRIDE" = 64; then
3011 versionmin=-mios-simulator-version-min=7.0
3016 versionmin=-mios-simulator-version-min=6.1
3019 versionmin=-mmacosx-version-min=10.7
3025 if test "$BITNESS_OVERRIDE" = 64; then
3027 versionmin=-miphoneos-version-min=7.0
3030 versionmin=-miphoneos-version-min=6.1
3034 # LTO is not really recommended for iOS builds,
3035 # the link time will be astronomical
3036 if test "$ENABLE_LTO" = TRUE; then
3039 # Just add -fvisibility=hidden to CC and CXX directly so that the 3rd-party libs also
3040 # get compiled with it, to avoid ld warnings when linking all that together into one
3042 # Use libc++ if opted in only, and only when building against iOS 7 SDK or newer.
3044 XCODE_CLANG_CXX_LIBRARY=libstdc++
3047 if test "$enable_libc__" = yes; then
3048 AC_MSG_ERROR([--enable-libc++ requires using Xcode 5 and iOS SDK 7 or newer it seems])
3052 if test "$enable_libc__" = yes; then
3053 XCODE_CLANG_CXX_LIBRARY=libc++
3058 stdlib="-stdlib=$XCODE_CLANG_CXX_LIBRARY"
3060 CC="`xcrun -find clang` -arch $arch -fvisibility=hidden -isysroot $sysroot $lto $versionmin"
3061 CXX="`xcrun -find clang++` -arch $arch -fvisibility=hidden $stdlib -isysroot $sysroot $lto $versionmin"
3063 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3066 STRIP=`xcrun -find strip`
3067 LIBTOOL=`xcrun -find libtool`
3068 RANLIB=`xcrun -find ranlib`
3071 AC_SUBST(XCODE_CLANG_CXX_LIBRARY)
3073 AC_MSG_CHECKING([whether to treat the installation as read-only])
3075 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3076 "$enable_extensions" != yes; then
3077 enable_readonly_installset=yes
3079 if test "$enable_readonly_installset" = yes; then
3080 AC_MSG_RESULT([yes])
3081 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3086 dnl ===================================================================
3087 dnl Structure of install set
3088 dnl ===================================================================
3090 if test $_os = Darwin -a "$enable_canonical_installation_tree_structure" = yes; then
3091 LIBO_BIN_FOLDER=MacOS
3092 LIBO_ETC_FOLDER=Resources
3093 LIBO_LIBEXEC_FOLDER=MacOS
3094 LIBO_LIB_FOLDER=Frameworks
3095 LIBO_SHARE_FOLDER=Resources
3096 LIBO_SHARE_HELP_FOLDER=Resources/help
3097 LIBO_SHARE_JAVA_FOLDER=Resources/java
3098 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3099 LIBO_LIB_PYUNO_FOLDER=Resources
3100 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3101 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3102 LIBO_URE_BIN_FOLDER=MacOS
3103 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3104 LIBO_URE_LIB_FOLDER=Frameworks
3105 LIBO_URE_SHARE_FOLDER=Resources/ure/share
3106 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3107 ENABLE_MACOSX_MACLIKE_APP_STRUCTURE=TRUE
3108 AC_DEFINE(HAVE_FEATURE_MACOSX_MACLIKE_APP_STRUCTURE)
3109 elif test $_os = Darwin; then
3110 LIBO_BIN_FOLDER=MacOS
3111 LIBO_ETC_FOLDER=MacOS
3112 LIBO_LIBEXEC_FOLDER=MacOS
3113 LIBO_LIB_FOLDER=MacOS
3114 LIBO_LIB_PYUNO_FOLDER=MacOS
3115 LIBO_SHARE_FOLDER=share
3116 LIBO_SHARE_HELP_FOLDER=help
3117 LIBO_SHARE_JAVA_FOLDER=MacOS/classes
3118 LIBO_SHARE_PRESETS_FOLDER=presets
3119 LIBO_SHARE_RESOURCE_FOLDER=MacOS/resource
3120 LIBO_SHARE_SHELL_FOLDER=MacOS/shell
3121 LIBO_URE_BIN_FOLDER=ure-link/bin
3122 LIBO_URE_ETC_FOLDER=ure-link/lib
3123 LIBO_URE_LIB_FOLDER=ure-link/lib
3124 LIBO_URE_SHARE_FOLDER=ure-link/share
3125 LIBO_URE_SHARE_JAVA_FOLDER=ure-link/share/java
3126 elif test $_os = WINNT; then
3127 LIBO_BIN_FOLDER=program
3128 LIBO_ETC_FOLDER=program
3129 LIBO_LIBEXEC_FOLDER=program
3130 LIBO_LIB_FOLDER=program
3131 LIBO_LIB_PYUNO_FOLDER=program
3132 LIBO_SHARE_FOLDER=share
3133 LIBO_SHARE_HELP_FOLDER=help
3134 LIBO_SHARE_JAVA_FOLDER=program/classes
3135 LIBO_SHARE_PRESETS_FOLDER=presets
3136 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3137 LIBO_SHARE_SHELL_FOLDER=program/shell
3138 LIBO_URE_BIN_FOLDER=URE/bin
3139 LIBO_URE_ETC_FOLDER=URE/bin
3140 LIBO_URE_LIB_FOLDER=URE/bin
3141 LIBO_URE_SHARE_FOLDER=URE
3142 LIBO_URE_SHARE_JAVA_FOLDER=URE/java
3144 LIBO_BIN_FOLDER=program
3145 LIBO_ETC_FOLDER=program
3146 LIBO_LIBEXEC_FOLDER=program
3147 LIBO_LIB_FOLDER=program
3148 LIBO_LIB_PYUNO_FOLDER=program
3149 LIBO_SHARE_FOLDER=share
3150 LIBO_SHARE_HELP_FOLDER=help
3151 LIBO_SHARE_JAVA_FOLDER=program/classes
3152 LIBO_SHARE_PRESETS_FOLDER=presets
3153 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3154 LIBO_SHARE_SHELL_FOLDER=program/shell
3155 LIBO_URE_BIN_FOLDER=ure/bin
3156 LIBO_URE_ETC_FOLDER=ure/lib
3157 LIBO_URE_LIB_FOLDER=ure/lib
3158 LIBO_URE_SHARE_FOLDER=ure/share
3159 LIBO_URE_SHARE_JAVA_FOLDER=ure/share/java
3161 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3162 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3163 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3164 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3165 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3166 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3167 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3168 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3169 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3170 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3171 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3172 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3173 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3174 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3175 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_FOLDER,"$LIBO_URE_SHARE_FOLDER")
3176 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3178 # Not all of them needed in config_host.mk, add more if need arises
3179 AC_SUBST(LIBO_BIN_FOLDER)
3180 AC_SUBST(LIBO_ETC_FOLDER)
3181 AC_SUBST(LIBO_LIB_FOLDER)
3182 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3183 AC_SUBST(LIBO_SHARE_FOLDER)
3184 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3185 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3186 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3187 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3188 AC_SUBST(LIBO_URE_BIN_FOLDER)
3189 AC_SUBST(LIBO_URE_ETC_FOLDER)
3190 AC_SUBST(LIBO_URE_LIB_FOLDER)
3191 AC_SUBST(LIBO_URE_SHARE_FOLDER)
3192 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3193 AC_SUBST(ENABLE_MACOSX_MACLIKE_APP_STRUCTURE)
3195 dnl ===================================================================
3196 dnl Windows specific tests and stuff
3197 dnl ===================================================================
3199 # Get a value from the 32-bit side of the Registry
3202 # Return value: $regvalue
3204 _regvalue=`cat "/proc/registry32/$1" 2> /dev/null`
3206 if test $? -eq 0; then
3211 # Get a value from the 64-bit side of the Registry
3214 # Return value: $regvalue
3216 _regvalue=`cat "/proc/registry64/$1" 2> /dev/null`
3218 if test $? -eq 0; then
3223 if test "$_os" = "WINNT"; then
3224 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3225 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3227 WINDOWS_SDK_ARCH="x86"
3229 AC_MSG_RESULT([yes])
3230 WINDOWS_SDK_ARCH="x64"
3235 if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
3236 AC_MSG_CHECKING([whether to use DirectX])
3237 if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
3238 ENABLE_DIRECTX="TRUE"
3239 AC_MSG_RESULT([yes])
3245 AC_MSG_CHECKING([whether to use ActiveX])
3246 if test "$enable_activex" = "yes" -o "$enable_activex" = ""; then
3248 AC_MSG_RESULT([yes])
3250 DISABLE_ACTIVEX="TRUE"
3254 AC_MSG_CHECKING([whether to use ATL])
3255 if test "$enable_atl" = "yes" -o "$enable_atl" = ""; then
3257 AC_MSG_RESULT([yes])
3264 DISABLE_ACTIVEX="TRUE"
3268 AC_SUBST(ENABLE_DIRECTX)
3269 AC_SUBST(DISABLE_ACTIVEX)
3270 AC_SUBST(DISABLE_ATL)
3272 if test "$cross_compiling" = "yes"; then
3274 SCPDEFS="$SCPDEFS -DCROSS_COMPILING"
3277 BUILD_TYPE="$BUILD_TYPE NATIVE"
3279 AC_SUBST(CROSS_COMPILING)
3281 dnl ===================================================================
3282 dnl Is GCC actually Clang?
3283 dnl ===================================================================
3286 if test "$GCC" = "yes"; then
3287 AC_MSG_CHECKING([whether GCC is actually Clang])
3288 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3294 [AC_MSG_RESULT([yes])
3295 COM_GCC_IS_CLANG=TRUE],
3296 [AC_MSG_RESULT([no])])
3298 if test "$COM_GCC_IS_CLANG" = TRUE; then
3299 AC_MSG_CHECKING([the Clang version])
3300 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
3301 CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
3302 CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3303 AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3304 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3307 AC_SUBST(COM_GCC_IS_CLANG)
3309 if test "$CCACHE" != "" -a "$COM_GCC_IS_CLANG" = TRUE; then
3310 if test -z "$CCACHE_CPP2"; then
3311 AC_MSG_WARN([Using ccache with Clang without CCACHE_CPP2 set causes spurious warnings.])
3312 add_warning "Using ccache with Clang without CCACHE_CPP2 set causes spurious warnings."
3316 dnl ===================================================================
3317 dnl Test the gcc version
3318 dnl ===================================================================
3319 if test "$GCC" = "yes" -a -z "$COM_GCC_IS_CLANG"; then
3320 AC_MSG_CHECKING([the GCC version])
3321 _gcc_version=`$CC -dumpversion`
3322 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3324 AC_MSG_RESULT([gcc $_gcc_version])
3325 if test "$GCC_VERSION" -lt 0401; then
3326 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.1.0])
3329 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3330 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3331 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3332 # (which reports itself as GCC 4.2.1).
3335 AC_SUBST(GCC_VERSION)
3337 # ===================================================================
3338 # check various GCC options that Clang does not support now but maybe
3339 # will somewhen in the future, check them even for GCC, so that the
3341 # ===================================================================
3344 HAVE_GCC_FINLINE_LIMIT=
3345 HAVE_GCC_FNO_INLINE=
3346 if test "$GCC" = "yes"; then
3347 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3348 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3349 # Option just ignored and silly warning that isn't a real
3354 CFLAGS="$CFLAGS -Werror -ggdb2"
3355 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3358 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3359 AC_MSG_RESULT([yes])
3364 AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3365 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3370 CFLAGS="$CFLAGS -Werror -finline-limit=0"
3371 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3374 if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3375 AC_MSG_RESULT([yes])
3380 AC_MSG_CHECKING([whether $CC supports -fno-inline])
3381 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3386 CFLAGS="$CFLAGS -Werror -fno-inline"
3387 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3390 if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3391 AC_MSG_RESULT([yes])
3396 AC_SUBST(HAVE_GCC_GGDB2)
3397 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3398 AC_SUBST(HAVE_GCC_FNO_INLINE)
3400 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3401 if test "$GCC" = "yes"; then
3402 AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
3403 bsymbolic_functions_ldflags_save=$LDFLAGS
3404 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
3405 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3408 printf ("hello world\n");
3409 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3410 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3411 AC_MSG_RESULT( found )
3413 AC_MSG_RESULT( not found )
3415 LDFLAGS=$bsymbolic_functions_ldflags_save
3417 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3419 # Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers.
3420 # NOTE: must _not_ be used for bundled external libraries!
3422 if test "$GCC" = "yes"; then
3423 AC_MSG_CHECKING( for -isystem )
3425 CFLAGS="$CFLAGS -Werror"
3426 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM=-isystem ],[])
3428 if test -n "$ISYSTEM"; then
3434 if test -z "$ISYSTEM"; then
3435 # fall back to using -I
3440 dnl ===================================================================
3441 dnl Check which Visual Studio or MinGW compiler is used
3442 dnl ===================================================================
3444 map_vs_year_to_version()
3446 # Return value: $vsversion
3458 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3462 vs_versions_to_check()
3464 # Args: $1 (optional) : versions to check, in the order of preference
3465 # Return value: $vsversions
3469 if test -n "$1"; then
3470 map_vs_year_to_version "$1"
3471 vsversions=$vsversion
3473 # By default we prefer 2012, then 2010, then 2013
3474 vsversions="11.0 10.0 12.0"
3480 # Find Visual Studio 2012/2010/2013
3481 # Args: $1 (optional) : versions to check, in the order of preference
3482 # Return value: $vstest
3486 vs_versions_to_check "$1"
3488 for ver in $vsversions; do
3489 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/ProductDir
3490 if test -n "$regvalue"; then
3494 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VS/ProductDir
3495 if test -n "$regvalue"; then
3504 # Find Visual C++ 2012/2010/2013
3505 # Args: $1 (optional) : The VS version year
3506 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot
3508 unset vctest vcnum vcnumwithdot
3510 vs_versions_to_check "$1"
3512 for ver in $vsversions; do
3513 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3514 if test -n "$regvalue"; then
3518 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VC/ProductDir
3519 if test -n "$regvalue"; then
3524 if test -n "$vctest"; then
3526 case "$vcnumwithdot" in
3543 SHOWINCLUDES_PREFIX=
3544 if test "$_os" = "WINNT"; then
3545 if test "$WITH_MINGW" != "yes"; then
3546 AC_MSG_CHECKING([Visual C++])
3548 find_msvc "$with_visual_studio"
3550 if test -z "$vctest"; then
3551 if test -n "$with_visual_studio"; then
3552 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3554 AC_MSG_ERROR([No Visual Studio 2012, 2010 or 2013 installation found])
3558 if test "$BITNESS_OVERRIDE" = ""; then
3559 if test -f "$vctest/bin/cl.exe"; then
3560 VC_PRODUCT_DIR=$vctest
3562 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3565 if test -f "$vctest/bin/amd64/cl.exe"; then
3566 VC_PRODUCT_DIR=$vctest
3568 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/amd64/cl.exe])
3572 VC_PRODUCT_DIR=`cygpath -d "$VC_PRODUCT_DIR"`
3573 VC_PRODUCT_DIR=`cygpath -u "$VC_PRODUCT_DIR"`
3574 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3576 dnl ===========================================================
3577 dnl Check for the corresponding mspdb*.dll
3578 dnl ===========================================================
3582 if test "$BITNESS_OVERRIDE" = ""; then
3583 if test "$vcnum" = "120"; then
3584 MSPDB_PATH="$VC_PRODUCT_DIR/../VC/bin"
3586 MSPDB_PATH="$VC_PRODUCT_DIR/../Common7/IDE"
3589 MSPDB_PATH="$VC_PRODUCT_DIR/bin/amd64"
3594 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3595 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3598 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3599 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3601 dnl The path needs to be added before cl is called
3602 PATH="$MSPDB_PATH:$PATH"
3604 AC_MSG_CHECKING([cl.exe])
3606 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3607 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3608 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3611 if test -z "$CC"; then
3612 if test "$BITNESS_OVERRIDE" = ""; then
3613 if test -f "$VC_PRODUCT_DIR/bin/cl.exe"; then
3614 CC="$VC_PRODUCT_DIR/bin/cl.exe"
3617 if test -f "$VC_PRODUCT_DIR/bin/amd64/cl.exe"; then
3618 CC="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3622 # This gives us a posix path with 8.3 filename restrictions
3623 CC=`cygpath -d "$CC"`
3624 CC=`cygpath -u "$CC"`
3627 if test -n "$CC"; then
3628 # Remove /cl.exe from CC case insensitive
3629 AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
3630 if test "$BITNESS_OVERRIDE" = ""; then
3631 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
3633 if test -n "$VC_PRODUCT_DIR"; then
3634 # Huh, why not just an assignment?
3635 COMPATH=`echo $VC_PRODUCT_DIR`
3638 export INCLUDE=`cygpath -d "$COMPATH/Include"`
3640 PathFormat "$COMPATH"
3641 COMPATH="$formatted_path"
3646 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3647 # are always "better", we list them in reverse chronological order.
3652 WINDOWS_SDK_ACCEPTABLE_VERSIONS="7.1A 7.1 7.0A 6.0A"
3653 if test "$ENABLE_LTO" = TRUE; then
3655 AC_MSG_WARN([LTO is known to cause problems with MSVC 2010])
3656 add_warning "LTO is known to cause problems with MSVC 2010"
3661 WINDOWS_SDK_ACCEPTABLE_VERSIONS="8.0 7.1A"
3665 WINDOWS_SDK_ACCEPTABLE_VERSIONS="8.1A 8.1 8.0"
3669 # The expectation is that --with-windows-sdk should not need to be used
3670 if test -n "$with_windows_sdk"; then
3671 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3672 *" "$with_windows_sdk" "*)
3673 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3676 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work witn VS $MSVSVER])
3681 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3686 AC_MSG_ERROR([Visual C++ not found after all, huh])
3689 dnl We need to guess the prefix of the -showIncludes output, it can be
3691 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3692 echo "#include <stdlib.h>" > conftest.c
3693 SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
3694 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3695 rm -f conftest.c conftest.obj
3696 if test -z "$SHOWINCLUDES_PREFIX"; then
3697 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3699 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3702 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3703 # version of the Explorer extension (and maybe other small
3704 # bits, too) needed when installing a 32-bit LibreOffice on a
3705 # 64-bit OS. The 64-bit Explorer extension is a feature that
3706 # has been present since long in OOo. Don't confuse it with
3707 # building LibreOffice itself as 64-bit code, which is
3708 # unfinished work and highly experimental.
3714 if test "$BITNESS_OVERRIDE" = ""; then
3715 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3716 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3717 # Prefer native x64 compiler to cross-compiler, in case we are running
3718 # the build on a 64-bit OS.
3719 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3721 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3722 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3723 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3725 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3726 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3729 if test "$BUILD_X64" = TRUE; then
3730 AC_MSG_RESULT([found])
3732 AC_MSG_RESULT([not found])
3733 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3738 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3739 AC_SUBST(CXX_X64_BINARY)
3740 AC_SUBST(LINK_X64_BINARY)
3742 AC_MSG_CHECKING([the compiler is MinGW])
3743 MACHINE_PREFIX=`$CC -dumpmachine`
3744 if echo $MACHINE_PREFIX | $GREP -q mingw32; then
3745 COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
3746 AC_MSG_RESULT([yes])
3748 AC_MSG_ERROR([Compiler is not MinGW.])
3753 PathFormat "$MSPDB_PATH"
3754 MSPDB_PATH="$formatted_path"
3755 AC_SUBST(SHOWINCLUDES_PREFIX)
3760 if test "$_os" = "WINNT"; then
3761 BUILD_TYPE="$BUILD_TYPE DBGHELP"
3767 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3768 AC_SUBST(UNOWINREG_DLL)
3771 # prefix C with ccache if needed
3773 if test "$CCACHE" != ""; then
3774 AC_MSG_CHECKING([whether $CC is already ccached])
3778 CFLAGS="$CFLAGS --ccache-skip -O2"
3779 dnl an empty program will do, we're checking the compiler flags
3780 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3781 [use_ccache=yes], [use_ccache=no])
3782 if test $use_ccache = yes; then
3783 AC_MSG_RESULT([yes])
3792 dnl Set the ENABLE_DBGUTIL variable
3793 dnl ===================================================================
3794 AC_MSG_CHECKING([whether to build with additional debug utilities])
3795 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3796 ENABLE_DBGUTIL="TRUE"
3797 # this is an extra var so it can have different default on different MSVC
3798 # versions (in case there are version specific problems with it)
3799 MSVC_USE_DEBUG_RUNTIME="TRUE"
3801 AC_MSG_RESULT([yes])
3802 # cppunit and graphite expose STL in public headers
3803 if test "$with_system_cppunit" = "yes"; then
3804 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3806 with_system_cppunit=no
3808 if test "$with_system_graphite" = "yes"; then
3809 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3811 with_system_graphite=no
3813 if test "$with_system_mysql_cppconn" = "yes"; then
3814 AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
3816 with_system_mysql_cppconn=no
3818 if test "$with_system_orcus" = "yes"; then
3819 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3821 with_system_orcus=no
3823 if test "$with_system_libcmis" = "yes"; then
3824 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3826 with_system_libcmis=no
3828 if test "$enable_win_mozab_driver" = "yes"; then
3829 AC_MSG_ERROR([--enable-win-mozab-driver conflicts with --enable-dbgutil])
3833 MSVC_USE_DEBUG_RUNTIME=""
3836 AC_SUBST(ENABLE_DBGUTIL)
3837 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3839 dnl Set the ENABLE_DEBUG variable.
3840 dnl ===================================================================
3841 AC_MSG_CHECKING([whether to do a debug build])
3842 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3843 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3845 if test -n "$ENABLE_DBGUTIL"; then
3846 if test "$enable_debug" = "no"; then
3847 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3850 AC_MSG_RESULT([yes (dbgutil)])
3851 elif test -n "$enable_debug" && test "$enable_debug" != "no"; then
3853 AC_MSG_RESULT([yes])
3858 AC_SUBST(ENABLE_DEBUG)
3860 dnl Selective debuginfo
3861 ENABLE_DEBUGINFO_FOR=
3862 if test -n "$ENABLE_DEBUG"; then
3863 AC_MSG_CHECKING([whether to use selective debuginfo])
3864 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3865 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3866 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3868 ENABLE_DEBUGINFO_FOR=all
3869 AC_MSG_RESULT([no, for all])
3872 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3874 dnl Check for enable symbols option
3875 dnl ===================================================================
3876 AC_MSG_CHECKING([whether to include symbols while preserve optimization])
3877 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
3878 ENABLE_SYMBOLS="TRUE"
3879 if test -n "$ENABLE_DBGUTIL"; then
3880 AC_MSG_ERROR([--enable-dbgutil cannot be used with --enable-symbols])
3881 elif test -n "$ENABLE_DEBUG"; then
3882 AC_MSG_ERROR([--enable-debug cannot be used with --enable-symbols])
3884 AC_MSG_RESULT([yes])
3886 if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
3887 ENABLE_SYMBOLS="FALSE"
3893 AC_SUBST(ENABLE_SYMBOLS)
3895 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
3896 # By default use the ones specified by our build system,
3897 # but explicit override is possible.
3898 AC_MSG_CHECKING(for explicit AFLAGS)
3899 if test -n "$AFLAGS"; then
3900 AC_MSG_RESULT([$AFLAGS])
3906 AC_MSG_CHECKING(for explicit CFLAGS)
3907 if test -n "$CFLAGS"; then
3908 AC_MSG_RESULT([$CFLAGS])
3914 AC_MSG_CHECKING(for explicit CXXFLAGS)
3915 if test -n "$CXXFLAGS"; then
3916 AC_MSG_RESULT([$CXXFLAGS])
3922 AC_MSG_CHECKING(for explicit OBJCFLAGS)
3923 if test -n "$OBJCFLAGS"; then
3924 AC_MSG_RESULT([$OBJCFLAGS])
3930 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
3931 if test -n "$OBJCXXFLAGS"; then
3932 AC_MSG_RESULT([$OBJCXXFLAGS])
3938 AC_MSG_CHECKING(for explicit LDFLAGS)
3939 if test -n "$LDFLAGS"; then
3940 AC_MSG_RESULT([$LDFLAGS])
3950 AC_SUBST(OBJCXXFLAGS)
3954 AC_SUBST(x_CXXFLAGS)
3955 AC_SUBST(x_OBJCFLAGS)
3956 AC_SUBST(x_OBJCXXFLAGS)
3960 # determine CPUNAME, GUIBASE, ...
3974 PLATFORMID=aix_powerpc
3988 if test "$BITNESS_OVERRIDE" = 64; then
3992 PLATFORMID=windows_x86_64
3993 OUTPATH=wntmscx$COMEX
3997 PLATFORMID=windows_x86
3998 OUTPATH=wntmsci$COMEX
4002 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4005 SCPDEFS="$SCPDEFS -D_MSC_VER"
4025 if test "$BITNESS_OVERRIDE" = 64; then
4026 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4030 PLATFORMID=macosx_x86
4034 if test "$BITNESS_OVERRIDE" = 64; then
4037 PLATFORMID=macosx_x86_64
4042 PLATFORMID=macosx_x86
4047 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4064 PLATFORMID=dragonfly_x86
4069 PLATFORMID=dragonfly_x86_64
4072 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4089 PLATFORMID=freebsd_x86
4095 PLATFORMID=freebsd_x86_64
4098 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4115 PLATFORMID=kfreebsd_x86
4122 PLATFORMID=kfreebsd_x86_64
4126 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4143 PLATFORMID=linux_alpha
4151 PLATFORMID=linux_arm_eabi
4155 PLATFORMID=linux_arm_oabi
4163 PLATFORMID=linux_hppa
4169 PLATFORMID=linux_x86
4175 PLATFORMID=linux_ia64
4182 PLATFORMID=linux_mips_eb
4188 EPM_FLAGS="-a mips64"
4189 PLATFORMID=linux_mips_eb
4195 EPM_FLAGS="-a mips64el"
4196 PLATFORMID=linux_mips_el
4202 EPM_FLAGS="-a mipsel"
4203 PLATFORMID=linux_mips_el
4209 PLATFORMID=linux_m68k
4215 PLATFORMID=linux_powerpc
4222 PLATFORMID=linux_powerpc_64
4228 PLATFORMID=linux_sparc
4234 PLATFORMID=linux_s390
4241 PLATFORMID=linux_s390x
4248 PLATFORMID=linux_x86_64
4252 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4269 PLATFORMID=android_arm_eabi
4273 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4275 PLATFORMID=android_mips_el
4281 PLATFORMID=android_x86
4285 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4299 if test "$BITNESS_OVERRIDE" = 64; then
4302 PLATFORMID=windows_x86_64
4303 OUTPATH=wntgccx$COMEX
4304 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgccx"
4308 PLATFORMID=windows_x86
4309 OUTPATH=wntgcci$COMEX
4310 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgcci"
4314 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4333 PLATFORMID=netbsd_x86
4338 PLATFORMID=netbsd_powerpc
4343 PLATFORMID=netbsd_sparc
4348 PLATFORMID=netbsd_x86_64
4351 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4368 PLATFORMID=openbsd_x86
4373 PLATFORMID=openbsd_x86_64
4376 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4379 SOLARINC="$SOLARINC -I/usr/local/include"
4380 SOLARLIB="$SOLARLIB -L/usr/local/lib"
4396 PLATFORMID=solaris_x86
4402 PLATFORMID=solaris_sparc
4408 PLATFORMID=solaris_sparc64
4412 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4415 SOLARINC="$SOLARINC -I/usr/local/include"
4416 SOLARLIB="$SOLARLIB -L$COMPATH/lib"
4417 SOLARLIB="$SOLARLIB -L/usr/local/bin -L/usr/dt/lib -L/usr/openwin/lib"
4421 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4425 if test "$enable_headless" = "yes"; then
4426 if test "$GUIBASE" != "unx"; then
4427 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --enable-headless])
4432 WORKDIR="${BUILDDIR}/workdir"
4433 INSTDIR="${BUILDDIR}/instdir"
4434 INSTROOT="${INSTDIR}${INSTROOTSUFFIX}"
4435 SOLARINC="-I. -I$SRC_ROOT/include $SOLARINC"
4443 AC_SUBST([INSTROOT])
4448 AC_SUBST(PLATFORMID)
4449 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4451 dnl ===================================================================
4452 dnl Test which package format to use
4453 dnl ===================================================================
4454 AC_MSG_CHECKING([which package format to use])
4455 if test -n "$with_package_format" -a "$with_package_format" != no; then
4456 for i in $with_package_format; do
4458 aix | bsd | deb | pkg | rpm | native | portable | archive | dmg | installed | msi)
4461 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4462 aix - AIX software distribution
4463 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4464 deb - Debian software distribution
4465 pkg - Solaris software distribution
4466 rpm - RedHat software distribution
4467 native - "Native" software distribution for the platform
4468 portable - Portable software distribution
4470 LibreOffice additionally supports:
4471 archive - .tar.gz or .zip
4473 installed - installation tree
4479 PKGFORMAT="$with_package_format"
4480 AC_MSG_RESULT([$PKGFORMAT])
4483 AC_MSG_RESULT([none])
4487 dnl ===================================================================
4488 dnl Set up a different compiler to produce tools to run on the build
4489 dnl machine when doing cross-compilation
4490 dnl ===================================================================
4492 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4493 if test "$cross_compiling" = "yes"; then
4494 AC_MSG_CHECKING([for BUILD platform configuration])
4496 rm -rf CONF-FOR-BUILD config_build.mk
4497 mkdir CONF-FOR-BUILD
4498 # Here must be listed all files needed when running the configure script. In particular, also
4499 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4500 # keep them in the same order as there.
4501 (cd $SRC_ROOT && tar cf - \
4503 bin/get_config_variables \
4504 solenv/bin/getcompver.awk \
4505 solenv/inc/langlist.mk \
4509 instsetoo_native/util/openoffice.lst.in \
4511 sysui/desktop/macosx/Info.plist.in \
4512 ios/lo.xcconfig.in \
4513 ure/source/unorc.in) \
4514 | (cd CONF-FOR-BUILD && tar xf -)
4515 cp configure CONF-FOR-BUILD
4516 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4518 unset COM GUIBASE OS CPUNAME
4519 unset CC CXX SYSBASE CFLAGS
4520 unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
4521 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4522 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
4523 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4524 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4525 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4528 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4529 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4530 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4531 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4532 test -n "$with_system_boost_for_build" && sub_conf_opts="$sub_conf_opts --with-system-boost"
4533 test -n "$with_system_cppunit_for_build" && sub_conf_opts="$sub_conf_opts --with-system-cppunit"
4534 test -n "$with_system_expat_for_build" && sub_conf_opts="$sub_conf_opts --with-system-expat"
4535 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4536 test -n "$with_system_libxml_for_build" && sub_conf_opts="$sub_conf_opts --with-system-libxml"
4537 # we need the msi build tools on mingw if we are creating the
4539 if test "$WITH_MINGW" = "yes"; then
4540 enable_winegcc_for_build=
4541 for pkgformat in $PKGFORMAT; do
4542 case "$pkgformat" in
4543 msi|native) enable_winegcc_for_build=yes ;;
4546 test -n "$enable_winegcc_for_build" && sub_conf_opts="$sub_conf_opts --enable-winegcc"
4548 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4549 # Don't bother having configure look for stuff not needed for the build platform anyway
4551 --disable-graphite \
4552 --disable-pdfimport \
4553 --disable-postgresql-sdbc \
4554 --with-parallelism="$with_parallelism" \
4559 2>&1 | sed -e 's/^/ /'
4560 test -f ./config_host.mk 2>/dev/null || exit
4561 cp config_host.mk ../config_build.mk
4562 mv config.log ../config.Build.log
4563 mkdir -p ../config_build
4564 mv config_host/*.h ../config_build
4565 . ./bin/get_config_variables CC CXX INSTDIR INSTROOT LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER OS PATH SDKDIRNAME SYSTEM_LIBXSLT WORKDIR
4567 for V in CC CXX LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER OS SDKDIRNAME SYSTEM_LIBXSLT; do
4569 VV=`eval "echo $VV"`
4570 if test -n "$VV"; then
4571 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4572 echo "$line" >>build-config
4576 for V in INSTDIR INSTROOT WORKDIR; do
4578 VV=`eval "echo $VV"`
4579 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4580 if test -n "$VV"; then
4581 line="${V}_FOR_BUILD='$VV'"
4582 echo "$line" >>build-config
4586 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4587 echo "$line" >>build-config
4590 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4591 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])
4592 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4593 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4595 eval `cat CONF-FOR-BUILD/build-config`
4597 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4599 rm -rf CONF-FOR-BUILD
4603 CXX_FOR_BUILD="$CXX"
4604 INSTDIR_FOR_BUILD="$INSTDIR"
4605 INSTROOT_FOR_BUILD="$INSTROOT"
4606 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4607 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4608 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4609 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4610 WORKDIR_FOR_BUILD="$WORKDIR"
4612 AC_SUBST(OS_FOR_BUILD)
4613 AC_SUBST(INSTDIR_FOR_BUILD)
4614 AC_SUBST(INSTROOT_FOR_BUILD)
4615 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4616 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4617 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4618 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4619 AC_SUBST(WORKDIR_FOR_BUILD)
4621 dnl ===================================================================
4622 dnl Check for syslog header
4623 dnl ===================================================================
4624 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4626 dnl ===================================================================
4627 dnl Set the ENABLE_CRASHDUMP variable.
4628 dnl ===================================================================
4629 AC_MSG_CHECKING([whether to enable crashdump feature])
4630 if test "$enable_crashdump" = "yes"; then
4631 ENABLE_CRASHDUMP="TRUE"
4632 BUILD_TYPE="$BUILD_TYPE CRASHREP"
4633 AC_MSG_RESULT([yes])
4638 AC_SUBST(ENABLE_CRASHDUMP)
4641 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4642 dnl ===================================================================
4643 AC_MSG_CHECKING([whether to turn warnings to errors])
4644 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4645 EXTERNAL_WARNINGS_NOT_ERRORS="FALSE"
4646 AC_MSG_RESULT([yes])
4648 EXTERNAL_WARNINGS_NOT_ERRORS="TRUE"
4651 AC_SUBST(EXTERNAL_WARNINGS_NOT_ERRORS)
4653 dnl Set the ASSERT_ALWAYS_ABORT variable. (Activate --enable-assert-always-abort)
4654 dnl ===================================================================
4655 AC_MSG_CHECKING([whether to have assert to abort in release code])
4656 if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
4657 ASSERT_ALWAYS_ABORT="TRUE"
4658 AC_MSG_RESULT([yes])
4660 ASSERT_ALWAYS_ABORT="FALSE"
4663 AC_SUBST(ASSERT_ALWAYS_ABORT)
4665 # Determine whether to use ooenv for the instdir installation
4666 # ===================================================================
4667 if test $_os != "WINNT" -a $_os != "Darwin"; then
4668 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4669 if test "$enable_ooenv" = "no"; then
4673 AC_MSG_RESULT([yes])
4676 AC_SUBST(ENABLE_OOENV)
4678 if test "$enable_headless" = "yes"; then
4679 # be sure to do not mess with uneeded stuff
4687 build_gstreamer_0_10=no
4691 enable_cairo_canvas=no
4695 dnl ===================================================================
4696 dnl check for cups support
4697 dnl ===================================================================
4700 if test "$enable_cups" = "no"; then
4704 AC_MSG_CHECKING([whether to enable CUPS support])
4705 if test "$test_cups" = "yes"; then
4707 AC_MSG_RESULT([yes])
4709 AC_MSG_CHECKING([whether cups support is present])
4710 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4711 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4712 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4713 AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups-devel.])
4720 AC_SUBST(ENABLE_CUPS)
4723 if test "$test_fontconfig" = "yes"; then
4724 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
4725 SYSTEM_FONTCONFIG=YES
4727 AC_SUBST(FONTCONFIG_CFLAGS)
4728 AC_SUBST(FONTCONFIG_LIBS)
4729 AC_SUBST([SYSTEM_FONTCONFIG])
4731 dnl whether to find & fetch external tarballs?
4732 dnl ===================================================================
4733 if test -z "$TARFILE_LOCATION"; then
4734 TARFILE_LOCATION="$SRC_ROOT/src"
4736 AC_SUBST(TARFILE_LOCATION)
4738 AC_MSG_CHECKING([whether we want to fetch tarballs])
4739 if test "$enable_fetch_external" != "no"; then
4740 if test "$with_all_tarballs" = "yes"; then
4741 AC_MSG_RESULT(["yes, all of them"])
4742 DO_FETCH_TARBALLS="ALL"
4744 AC_MSG_RESULT(["yes, if we use them"])
4745 DO_FETCH_TARBALLS="YES"
4749 DO_FETCH_TARBALLS="NO"
4751 AC_SUBST(DO_FETCH_TARBALLS)
4753 AC_MSG_CHECKING([whether to build help])
4754 HELP_COMMON_ONLY=FALSE
4755 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4756 BUILD_TYPE="$BUILD_TYPE HELP"
4757 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4758 if test "$with_help" = "common" ; then
4759 HELP_COMMON_ONLY=TRUE
4760 AC_MSG_RESULT([common only])
4762 SCPDEFS="$SCPDEFS -DWITH_HELP"
4763 AC_MSG_RESULT([yes])
4768 AC_SUBST(HELP_COMMON_ONLY)
4770 dnl Test whether to include MySpell dictionaries
4771 dnl ===================================================================
4772 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4773 if test "$with_myspell_dicts" = "yes"; then
4774 AC_MSG_RESULT([yes])
4775 WITH_MYSPELL_DICTS=YES
4776 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4777 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4780 WITH_MYSPELL_DICTS=NO
4782 AC_SUBST(WITH_MYSPELL_DICTS)
4784 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
4785 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4786 if test "$with_system_dicts" = yes; then
4787 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4789 with_system_dicts=no
4792 AC_MSG_CHECKING([whether to use dicts from external paths])
4793 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4794 AC_MSG_RESULT([yes])
4796 AC_MSG_CHECKING([for spelling dictionary directory])
4797 if test -n "$with_external_dict_dir"; then
4798 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4800 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4801 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4802 DICT_SYSTEM_DIR=file:///usr/share/myspell
4805 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4806 AC_MSG_CHECKING([for hyphenation patterns directory])
4807 if test -n "$with_external_hyph_dir"; then
4808 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4810 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4812 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4813 AC_MSG_CHECKING([for thesaurus directory])
4814 if test -n "$with_external_thes_dir"; then
4815 THES_SYSTEM_DIR=file://$with_external_thes_dir
4817 THES_SYSTEM_DIR=file:///usr/share/mythes
4819 AC_MSG_RESULT([$THES_SYSTEM_DIR])
4824 AC_SUBST(SYSTEM_DICTS)
4825 AC_SUBST(DICT_SYSTEM_DIR)
4826 AC_SUBST(HYPH_SYSTEM_DIR)
4827 AC_SUBST(THES_SYSTEM_DIR)
4829 dnl ===================================================================
4830 AC_MSG_CHECKING([whether to enable pch feature])
4831 if test -n "$enable_pch" && test "$enable_pch" != "no"; then
4832 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
4834 AC_MSG_RESULT([yes])
4835 elif test "$GCC" = "yes"; then
4837 AC_MSG_RESULT([yes])
4840 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
4846 AC_SUBST(ENABLE_PCH)
4848 dnl ===================================================================
4849 dnl Search all the common names for GNU make
4850 dnl ===================================================================
4851 AC_MSG_CHECKING([for GNU make])
4853 # try to use our own make if it is available and GNUMAKE was not already defined
4854 if test -z "$GNUMAKE"; then
4855 if test -x "/opt/lo/bin/make"; then
4856 GNUMAKE="/opt/lo/bin/make"
4860 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
4861 if test -n "$a"; then
4862 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
4863 if test $? -eq 0; then
4864 if test "$build_os" = "cygwin"; then
4865 if test -n "$($a -v | grep 'Built for Windows')" ; then
4866 AC_MSG_NOTICE([$a is a native Win32 make, which is not supported on this old branch.])
4879 AC_MSG_RESULT($GNUMAKE)
4880 if test -z "$GNUMAKE"; then
4881 AC_MSG_ERROR([not found. install GNU make.])
4886 AC_MSG_CHECKING([the GNU make version])
4887 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4888 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4889 if test "$_make_longver" -ge "038200"; then
4890 AC_MSG_RESULT([$GNUMAKE $_make_version])
4892 elif test "$_make_longver" -ge "038100"; then
4893 if test "$build_os" = "cygwin"; then
4894 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4896 AC_MSG_RESULT([$GNUMAKE $_make_version])
4898 dnl ===================================================================
4899 dnl Search all the common names for sha1sum
4900 dnl ===================================================================
4901 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
4902 if test -z "$SHA1SUM"; then
4903 AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
4904 elif test "$SHA1SUM" = "openssl"; then
4905 SHA1SUM="openssl sha1"
4907 AC_MSG_CHECKING([for GNU make bug 20033])
4908 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4909 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
4910 A := \$(wildcard *.a)
4914 <TAB>@echo survived bug20033.
4918 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
4931 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
4932 <TAB>\$(call d1,\$(CHECKSUM)),\
4933 <TAB>\$(call d2,\$(CHECKSUM)))
4935 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
4936 no_parallelism_make="YES"
4937 AC_MSG_RESULT([yes, disable parallelism])
4939 AC_MSG_RESULT([no, keep parallelism enabled])
4941 rm -rf $TESTGMAKEBUG20033
4943 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
4946 # find if gnumake support file function
4947 AC_MSG_CHECKING([whether GNU make supports the 'file' function])
4948 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
4949 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
4950 \$(file >test.txt,Success )
4957 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
4958 if test -f $TESTGMAKEFILEFUNC/test.txt; then
4959 HAVE_GNUMAKE_FILE_FUNC="YES"
4960 AC_MSG_RESULT([yes])
4964 rm -rf $TESTGMAKEFILEFUNC
4965 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
4968 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`
4971 if test "$_make_ver_check" = ""; then
4975 HAVE_LD_HASH_STYLE=FALSE
4976 WITH_LINKER_HASH_STYLE=
4977 AC_MSG_CHECKING( for --hash-style gcc linker support )
4978 if test "$GCC" = "yes"; then
4979 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
4980 hash_styles="gnu sysv"
4981 elif test "$with_linker_hash_style" = "no"; then
4984 hash_styles="$with_linker_hash_style"
4987 for hash_style in $hash_styles; do
4988 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4989 hash_style_ldflags_save=$LDFLAGS
4990 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
4992 AC_LINK_IFELSE([AC_LANG_PROGRAM(
4998 [ if ./conftest$EXEEXT; then
4999 HAVE_LD_HASH_STYLE=TRUE
5000 WITH_LINKER_HASH_STYLE=$hash_style
5002 [HAVE_LD_HASH_STYLE=FALSE])
5003 LDFLAGS=$hash_style_ldflags_save
5006 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5007 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5011 LDFLAGS=$hash_style_ldflags_save
5015 AC_SUBST(HAVE_LD_HASH_STYLE)
5016 AC_SUBST(WITH_LINKER_HASH_STYLE)
5018 dnl ===================================================================
5019 dnl Check whether there's a Perl version available.
5020 dnl ===================================================================
5021 if test -z "$with_perl_home"; then
5022 AC_PATH_PROG(PERL, perl)
5024 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5025 _perl_path="$with_perl_home/bin/perl"
5026 if test -x "$_perl_path"; then
5029 AC_MSG_ERROR([$_perl_path not found])
5033 dnl ===================================================================
5034 dnl Testing for Perl version 5 or greater.
5035 dnl $] is the Perl version variable, it is returned as an integer
5036 dnl ===================================================================
5037 if test "$PERL"; then
5038 AC_MSG_CHECKING([the Perl version])
5039 ${PERL} -e "exit($]);"
5041 if test "$_perl_version" -lt 5; then
5042 AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
5044 AC_MSG_RESULT([checked (perl $_perl_version)])
5046 AC_MSG_ERROR([Perl not found, install version 5 of Perl])
5049 dnl ===================================================================
5050 dnl Testing for required Perl modules
5051 dnl ===================================================================
5053 AC_MSG_CHECKING([for required Perl modules])
5054 if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'>/dev/null 2>&1`; then
5055 AC_MSG_RESULT([all modules found])
5057 AC_MSG_RESULT([failed to find some modules])
5058 # Find out which modules are missing.
5059 missing_perl_modules=
5060 if ! `$PERL -e 'use Archive::Zip;'>/dev/null 2>&1`; then
5061 missing_perl_modules=Archive::Zip
5063 if ! `$PERL -e 'use Cwd;'>/dev/null 2>&1`; then
5064 missing_perl_modules="$missing_perl_modules Cwd"
5066 if ! `$PERL -e 'use Digest::MD5;'>/dev/null 2>&1`; then
5067 missing_perl_modules="$missing_perl_modules Digest::MD5"
5070 The missing Perl modules are: $missing_perl_modules
5071 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5074 dnl ===================================================================
5075 dnl Check for pkg-config
5076 dnl ===================================================================
5077 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5081 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5083 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5084 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5085 # explicitly. Or put /path/to/compiler in PATH yourself.
5087 AC_CHECK_TOOL(AR,ar)
5088 AC_CHECK_TOOL(NM,nm)
5089 AC_CHECK_TOOL(OBJDUMP,objdump)
5090 AC_CHECK_TOOL(RANLIB,ranlib)
5091 AC_CHECK_TOOL(STRIP,strip)
5092 if test "$_os" = "WINNT"; then
5093 AC_CHECK_TOOL(DLLTOOL,dlltool)
5094 AC_CHECK_TOOL(WINDRES,windres)
5101 AC_SUBST(PKG_CONFIG)
5106 dnl ===================================================================
5107 dnl pkg-config checks on Mac OS X
5108 dnl ===================================================================
5110 if test $_os = Darwin; then
5111 AC_MSG_CHECKING([for bogus pkg-config])
5112 if test -n "$PKG_CONFIG"; then
5113 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5114 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5116 if test "$enable_bogus_pkg_config" = "yes"; then
5117 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5119 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please remove or hide $PKG_CONFIG])
5123 AC_MSG_RESULT([no, good])
5129 # Return value: $csctest
5133 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5134 if test -n "$regvalue"; then
5142 # Return value: $altest
5146 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5147 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5148 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5157 # Return value: $frametest (that's a silly name...)
5161 for ver in 1.1 2.0; do
5162 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv$ver
5163 if test -n "$regvalue"; then
5170 find_winsdk_version()
5172 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5173 # Return value: $winsdktest
5177 # Why we look for them in this particular order I don't know. But OTOH I
5180 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5181 if test -n "$regvalue"; then
5182 winsdktest=$regvalue
5187 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5188 if test -n "$regvalue"; then
5189 winsdktest=$regvalue
5198 # Args: $1 (optional) : list of acceptable SDK versions
5199 # Return value: $winsdktest
5203 if test -n "$1"; then
5206 sdkversions="$WINDOWS_SDK_ACCEPTABLE_VERSIONS"
5209 for ver in $sdkversions; do
5210 find_winsdk_version $ver
5211 if test -n "$winsdktest"; then
5219 for ver in 10.0 11.0; do
5220 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5221 if test -n "$regvalue"; then
5222 if test -e "$regvalue/Microsoft_VC${VCVER}_CRT_x86.msm"; then
5228 if test -z "$msmdir"; then
5229 AC_MSG_NOTICE([no registry entry for Merge Module directory - trying "$COMMONPROGRAMFILES\Merge Modules"])
5230 msmdir="$COMMONPROGRAMFILES\Merge Modules"
5232 msmdir=`cygpath -m "$msmdir"`
5233 if test -z "$msmdir"; then
5234 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5235 AC_MSG_ERROR([Merge modules not found in $msmdir])
5237 AC_MSG_WARN([Merge modules not found in $msmdir])
5243 find_msvc_x64_dlls()
5245 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5246 msvcdlls="msvcp${VCVER}.dll msvcr${VCVER}.dll"
5247 for dll in $msvcdlls; do
5248 if ! test -f "$msvcdllpath/$dll"; then
5249 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5254 if test "$build_os" = "cygwin"; then
5256 AC_MSG_CHECKING([for midl.exe])
5259 if test -f "$winsdktest/Bin/midl.exe"; then
5260 MIDL_PATH="$winsdktest/Bin"
5261 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5262 MIDL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5264 if test ! -f "$MIDL_PATH/midl.exe"; then
5265 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5267 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5270 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5271 MIDL_PATH=`cygpath -d "$MIDL_PATH"`
5272 MIDL_PATH=`cygpath -u "$MIDL_PATH"`
5275 AC_MSG_CHECKING([for csc.exe])
5277 if test -f "$csctest/csc.exe"; then
5280 if test ! -f "$CSC_PATH/csc.exe"; then
5281 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5283 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5286 CSC_PATH=`cygpath -d "$CSC_PATH"`
5287 CSC_PATH=`cygpath -u "$CSC_PATH"`
5290 AC_MSG_CHECKING([for al.exe])
5292 if test -f "$winsdktest/Bin/al.exe"; then
5293 AL_PATH="$winsdktest/Bin"
5294 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5295 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5298 if test -z "$AL_PATH"; then
5300 if test -f "$altest/bin/al.exe"; then
5301 AL_PATH="$altest/bin"
5302 elif test -f "$altest/al.exe"; then
5306 if test ! -f "$AL_PATH/al.exe"; then
5307 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5309 AC_MSG_RESULT([$AL_PATH/al.exe])
5312 AL_PATH=`cygpath -d "$AL_PATH"`
5313 AL_PATH=`cygpath -u "$AL_PATH"`
5315 dnl Check mscoree.lib / .NET Framework dir
5316 AC_MSG_CHECKING(.NET Framework)
5318 if test -f "$frametest/lib/mscoree.lib"; then
5319 DOTNET_FRAMEWORK_HOME="$frametest"
5322 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/win8/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5323 DOTNET_FRAMEWORK_HOME="$winsdktest"
5327 if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/win8/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5328 AC_MSG_ERROR([mscoree.lib (.NET Framework) not found])
5330 AC_MSG_RESULT(found)
5332 PathFormat "$MIDL_PATH"
5333 MIDL_PATH="$formatted_path"
5335 PathFormat "$AL_PATH"
5336 AL_PATH="$formatted_path"
5338 PathFormat "$DOTNET_FRAMEWORK_HOME"
5339 DOTNET_FRAMEWORK_HOME="$formatted_path"
5341 PathFormat "$CSC_PATH"
5342 CSC_PATH="$formatted_path"
5345 dnl ===================================================================
5346 dnl Check if stdc headers are available excluding MSVC.
5347 dnl ===================================================================
5348 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5352 dnl ===================================================================
5353 dnl Testing for C++ compiler and version...
5354 dnl ===================================================================
5356 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5357 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5358 save_CXXFLAGS=$CXXFLAGS
5360 CXXFLAGS=$save_CXXFLAGS
5362 if test -n "$CC" -a -z "$CXX"; then
5367 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
5368 if test "$GXX" = "yes"; then
5369 AC_MSG_CHECKING([the GNU C++ compiler version])
5371 _gpp_version=`$CXX -dumpversion`
5372 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5374 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5376 if test "$_gpp_majmin" = "304"; then
5377 AC_MSG_CHECKING([whether $CXX has the enum bug])
5378 AC_RUN_IFELSE([AC_LANG_SOURCE([[
5379 extern "C" void abort (void);
5380 extern "C" void exit (int status);
5382 enum E { E0, E1, E2, E3, E4, E5 };
5384 void test (enum E e)
5386 if (e == E2 || e == E3 || e == E1)
5397 ]])],[AC_MSG_ERROR([your version of the GNU C++ compile has a bug which prevents LibreOffice from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details.])],[AC_MSG_RESULT([no])],[])
5399 dnl see https://code.google.com/p/android/issues/detail?id=41770
5400 if test "$_gpp_majmin" -ge "407"; then
5404 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5405 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5406 #include <bits/c++config.h>]],[[
5407 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5408 && !defined(_GLIBCXX__PTHREADS) \
5409 && !defined(_GLIBCXX_HAS_GTHREADS)
5412 ]])],[AC_MSG_RESULT([yes])
5413 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5415 if test $glibcxx_threads = yes; then
5416 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5420 AC_SUBST(BOOST_CXXFLAGS)
5423 # prefx CXX with ccache if needed
5425 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5426 if test "$CCACHE" != ""; then
5427 AC_MSG_CHECKING([whether $CXX is already ccached])
5429 save_CXXFLAGS=$CXXFLAGS
5430 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5431 dnl an empty program will do, we're checking the compiler flags
5432 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5433 [use_ccache=yes], [use_ccache=no])
5434 if test $use_ccache = yes; then
5435 AC_MSG_RESULT([yes])
5440 CXXFLAGS=$save_CXXFLAGS
5445 dnl ===================================================================
5446 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5447 dnl ===================================================================
5449 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5452 dnl Check whether there's a C pre-processor.
5453 dnl ===================================================================
5454 dnl When using SunStudio compiler, there is a bug with the cc
5455 dnl preprocessor, so use CC preprocessor as the cc preprocessor
5456 dnl See Issuezilla #445.
5457 dnl ===================================================================
5458 if test "$_os" = "SunOS"; then
5466 dnl ===================================================================
5467 dnl Find integral type sizes and alignments
5468 dnl ===================================================================
5470 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5472 AC_CHECK_SIZEOF(long)
5473 AC_CHECK_SIZEOF(short)
5474 AC_CHECK_SIZEOF(int)
5475 AC_CHECK_SIZEOF(long long)
5476 AC_CHECK_SIZEOF(double)
5477 AC_CHECK_SIZEOF(void*)
5479 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5480 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5481 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5482 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5483 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5485 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5486 m4_pattern_allow([AC_CHECK_ALIGNOF])
5487 m4_ifdef([AC_CHECK_ALIGNOF],
5489 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5490 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5491 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5492 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5495 case "$_os-$host_cpu" in
5497 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5498 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5499 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5500 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5503 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5504 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5505 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5506 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5509 if test -z "$ac_cv_alignof_short" -o \
5510 -z "$ac_cv_alignof_int" -o \
5511 -z "$ac_cv_alignof_long" -o \
5512 -z "$ac_cv_alignof_double"; then
5513 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.])
5519 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5520 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5521 if test $ac_cv_sizeof_long -eq 8; then
5522 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5523 elif test $ac_cv_sizeof_double -eq 8; then
5524 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5526 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5529 dnl Check for large file support
5531 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5532 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5534 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5535 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5539 SAL_TYPES_SIZEOFSHORT=2
5540 SAL_TYPES_SIZEOFINT=4
5541 SAL_TYPES_SIZEOFLONG=4
5542 SAL_TYPES_SIZEOFLONGLONG=8
5543 if test "$BITNESS_OVERRIDE" = ""; then
5544 SAL_TYPES_SIZEOFPOINTER=4
5546 SAL_TYPES_SIZEOFPOINTER=8
5548 SAL_TYPES_ALIGNMENT2=2
5549 SAL_TYPES_ALIGNMENT4=4
5550 SAL_TYPES_ALIGNMENT8=8
5553 AC_SUBST(LFS_CFLAGS)
5555 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5556 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5557 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5558 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5559 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5560 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5561 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5562 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5564 dnl ===================================================================
5565 dnl Check if valgrind headers are available
5566 dnl ===================================================================
5568 if test "$cross_compiling" != yes; then
5569 prev_cppflags=$CPPFLAGS
5570 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5571 # or where does it come from?
5572 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5573 AC_CHECK_HEADER([valgrind/valgrind.h],
5574 [ENABLE_VALGRIND=TRUE])
5575 CPPFLAGS=$prev_cppflags
5577 AC_SUBST([ENABLE_VALGRIND])
5578 if test -z "$ENABLE_VALGRIND"; then
5581 AC_SUBST([VALGRIND_CFLAGS])
5584 dnl ===================================================================
5585 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
5586 dnl ===================================================================
5588 # We need at least the sys/sdt.h include header.
5589 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
5590 if test "$SDT_H_FOUND" = "TRUE"; then
5591 # Found sys/sdt.h header, now make sure the c++ compiler works.
5592 # Old g++ versions had problems with probes in constructors/destructors.
5593 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
5595 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5596 #include <sys/sdt.h>
5604 ProbeClass(int& v, const char *n) : ref(v), name(n)
5606 DTRACE_PROBE2(_test_, cons, name, ref);
5609 void method(int min)
5611 DTRACE_PROBE3(_test_, meth, name, ref, min);
5617 DTRACE_PROBE2(_test_, dest, name, ref);
5622 DTRACE_PROBE1(_test_, call, i);
5623 ProbeClass inst = ProbeClass(i, "call");
5625 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
5626 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
5629 AC_CONFIG_HEADERS([config_host/config_probes.h])
5631 dnl ===================================================================
5632 dnl Compiler plugins
5633 dnl ===================================================================
5636 # currently only Clang
5637 if test "$COM_GCC_IS_CLANG" = "TRUE"; then
5638 if test -n "$enable_compiler_plugins"; then
5639 compiler_plugins="$enable_compiler_plugins"
5640 elif test -n "$ENABLE_DBGUTIL"; then
5641 compiler_plugins=test
5645 if test "$compiler_plugins" != "no"; then
5646 dnl The prefix where Clang resides, override to where Clang resides if
5647 dnl using a source build:
5648 if test -z "$CLANGDIR"; then
5651 dnl The build directory (different from CLANGDIR if using a Clang out-
5652 dnl of-source build):
5653 if test -z "$CLANGBUILD"; then
5657 save_CPPFLAGS=$CPPFLAGS
5658 CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -I$CLANGDIR/tools/clang/include -I$CLANGBUILD/include -I$CLANGBUILD/tools/clang/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
5659 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
5660 [COMPILER_PLUGINS=TRUE],
5662 if test "$compiler_plugins" = "yes"; then
5663 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
5665 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
5666 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
5669 CPPFLAGS=$save_CPPFLAGS
5673 if test "$enable_compiler_plugins" = "yes"; then
5674 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
5677 AC_SUBST(COMPILER_PLUGINS)
5679 AC_SUBST(CLANGBUILD)
5681 dnl ===================================================================
5682 dnl Set the MinGW sys-root
5683 dnl ===================================================================
5684 if test "$WITH_MINGW" = "yes"; then
5685 AC_MSG_CHECKING([for MinGW sysroot])
5686 sysroot=`$CC -print-sysroot`
5687 AS_IF([test -d "$sysroot"/mingw],
5688 [MINGW_SYSROOT="$sysroot"/mingw
5689 AC_MSG_RESULT([$MINGW_SYSROOT])],
5690 [AC_MSG_RESULT([not found])
5691 AC_MSG_ERROR([cannot determine MinGW sysroot])])
5693 AC_SUBST([MINGW_DLLS])
5694 AC_SUBST([MINGW_SYSROOT])
5696 dnl ===================================================================
5697 dnl Set the MinGW include directories
5698 dnl ===================================================================
5699 if test "$WITH_MINGW" = "yes"; then
5700 AC_MSG_CHECKING([for MinGW include path])
5701 cat >conftest.$ac_ext <<_ACEOF
5703 #include <bits/c++config.h>
5705 _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`
5707 if test -z "$_mingw_lib_include_path"; then
5708 _mingw_lib_include_path="NO_LIB_INCLUDE"
5709 AC_MSG_RESULT([no MinGW include path])
5711 AC_MSG_RESULT([$_mingw_lib_include_path])
5713 MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
5714 AC_SUBST(MINGW_LIB_INCLUDE_PATH)
5718 AC_MSG_CHECKING([for dynamic libgcc])
5719 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5721 using namespace std;
5722 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
5723 MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
5724 if test -n "$MINGW_GCCDLL"; then
5725 MINGW_SHARED_GCCLIB=YES
5726 AC_MSG_RESULT([ $MINGW_GCCDLL])
5728 MINGW_SHARED_GCCLIB=NO
5731 ],[ AC_MSG_RESULT([no])
5735 AC_MSG_CHECKING([for dynamic libstdc++])
5736 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5738 using namespace std;
5739 ]], [[ cout << "Hello there." << endl; ]])],[
5740 MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
5741 if test -n "$MINGW_GXXDLL"; then
5742 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
5743 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
5744 if test "$CROSS_COMPILING" = "YES"; then
5746 mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
5748 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
5749 MINGW_SHARED_GXXLIB=YES
5750 AC_MSG_RESULT([$MINGW_GXXDLL])
5752 MINGW_SHARED_GXXLIB=NO
5755 ],[ AC_MSG_RESULT([no])
5761 AC_SUBST(MINGW_SHARED_GCCLIB)
5762 AC_SUBST(MINGW_SHARED_GXXLIB)
5763 AC_SUBST(MINGW_SHARED_LIBSTDCPP)
5764 AC_SUBST(MINGW_GCCDLL)
5765 AC_SUBST(MINGW_GXXDLL)
5768 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
5769 AC_DEFINE(HAVE_FMERGENEUTRALITEMS)
5772 if test "$WITH_MINGW" = "yes"; then
5773 AC_MSG_CHECKING([for fMergeNeutralItems in SCRIPT_CONTROL])
5774 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
5780 c.fMergeNeutralItems = 1;
5784 AC_DEFINE(HAVE_FMERGENEUTRALITEMS)
5786 [AC_MSG_RESULT(no)])
5789 dnl ===================================================================
5790 dnl Extra checking for the SunOS compiler
5791 dnl ===================================================================
5792 if test "$_os" = "SunOS"; then
5793 dnl SunStudio C++ compiler packaged with SunStudio C compiler
5794 if test "$CC" = "cc"; then
5795 AC_MSG_CHECKING([SunStudio C++ Compiler])
5796 if test "$CXX" != "CC"; then
5797 AC_MSG_WARN([SunStudio C++ was not found])
5798 add_warning "SunStudio C++ was not found"
5800 AC_MSG_RESULT([checked])
5805 dnl *************************************************************
5806 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
5807 dnl *************************************************************
5808 if test "$WITH_MINGW" = "yes"; then
5809 AC_MSG_CHECKING([exception type])
5811 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
5813 extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
5815 ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
5817 AC_MSG_RESULT($exceptions_type)
5821 EXCEPTIONS="$exceptions_type"
5822 AC_SUBST(EXCEPTIONS)
5824 dnl ===================================================================
5825 dnl thread-safe statics
5826 dnl ===================================================================
5827 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
5828 unset HAVE_THREADSAFE_STATICS
5829 if test "$GCC" = "yes"; then
5830 dnl -fthreadsafe-statics is available since GCC 4, so always available for
5831 dnl us. However, some C++ runtimes use a single lock for all static
5832 dnl variables, which can cause deadlock in multi-threaded applications.
5833 dnl This is not easily tested here; for POSIX-based systems, if executing
5834 dnl the following C++ program does not terminate then the tool chain
5835 dnl apparently has this problem:
5837 dnl #include <pthread.h>
5838 dnl int h() { return 0; }
5839 dnl void * g(void * unused) {
5840 dnl static int n = h();
5845 dnl pthread_create(&t, 0, g, 0);
5846 dnl pthread_join(t, 0);
5850 dnl static int n = f();
5854 dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
5855 dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
5856 dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
5857 dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
5858 dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
5859 dnl difference there. Conservative advice from Jakub Jelinek is to assume
5860 dnl it working in GCC >= 4.3, so conservative way to check here is to use
5861 dnl GCC_VERSION for GCC but resort to __GLIBCXX__ corresponding to libstdc++
5862 dnl shipped with GCC 4.3.0 (cf. <http://gcc.gnu.org/onlinedocs/libstdc++/
5863 dnl manual/abi.html#abi.versioning.history>; 4.3.0 is 20080306, 4.2.4 is
5864 dnl 20080519, 4.3.1 is 20080606) for Clang (for which GCC_VERSION is notoriously
5866 if test "$_os" != Darwin -a "$_os" != Android; then
5867 if test "$COM_GCC_IS_CLANG" = TRUE; then
5869 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5871 #if !defined __GLIBCXX__ ||(__GLIBCXX__ < 20080606 && __GLIBCXX__ != 20080306)
5874 ]])],[HAVE_THREADSAFE_STATICS=TRUE],[])
5876 elif test "${GCC_VERSION?}" -ge 0403; then
5877 HAVE_THREADSAFE_STATICS=TRUE
5880 if test "$HAVE_THREADSAFE_STATICS" = TRUE; then
5881 AC_DEFINE(HAVE_THREADSAFE_STATICS)
5882 AC_MSG_RESULT([yes])
5884 AC_MSG_RESULT([broken (i.e., no)])
5887 AC_MSG_RESULT([unknown (assuming no)])
5889 AC_SUBST(HAVE_THREADSAFE_STATICS)
5891 dnl ===================================================================
5892 dnl visibility and other gcc features
5893 dnl ===================================================================
5894 if test "$GCC" = "yes"; then
5895 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
5897 CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
5898 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
5901 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5902 AC_MSG_RESULT([yes])
5907 AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
5909 CFLAGS="$CFLAGS -Werror -Wno-long-double"
5910 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
5912 if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
5913 AC_MSG_RESULT([yes])
5918 AC_MSG_CHECKING([whether $CC supports -mno-avx])
5920 CFLAGS="$CFLAGS -Werror -mno-avx"
5921 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5923 if test "$HAVE_GCC_AVX" = "TRUE"; then
5924 AC_MSG_RESULT([yes])
5929 AC_MSG_CHECKING([whether $CC supports atomic functions])
5930 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5932 if (__sync_add_and_fetch(&v, 1) != 1 ||
5933 __sync_sub_and_fetch(&v, 1) != 0)
5935 __sync_synchronize();
5936 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
5940 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
5941 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
5942 AC_MSG_RESULT([yes])
5943 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
5949 [whether $CC supports pragma GCC diagnostic error/ignored/warning])
5951 CFLAGS="$CFLAGS -Werror -Wunknown-pragmas -Wunused-parameter"
5952 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5953 #pragma GCC diagnostic ignored "-Wunused-parameter"
5954 void dummy(int n) {}
5956 AC_DEFINE([HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY],[1])
5957 AC_MSG_RESULT([yes])
5958 ], [AC_MSG_RESULT([no])])
5961 AC_MSG_CHECKING([whether $CC supports pragma GCC diagnostic push/pop])
5963 CFLAGS="$CFLAGS -Werror -Wunknown-pragmas -Wunused-parameter"
5964 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5965 #pragma GCC diagnostic push
5966 #pragma GCC diagnostic ignored "-Wunused-parameter"
5967 void dummy(int n) {}
5968 #pragma GCC diagnostic pop
5970 AC_DEFINE([HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE],[1])
5971 AC_MSG_RESULT([yes])
5972 ], [AC_MSG_RESULT([no])])
5975 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
5977 CFLAGS="$CFLAGS -Werror"
5978 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5979 __attribute__((deprecated("test"))) void f();
5981 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
5982 AC_MSG_RESULT([yes])
5983 ], [AC_MSG_RESULT([no])])
5986 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
5988 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
5990 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
5992 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
5993 AC_MSG_RESULT([yes])
5994 ], [AC_MSG_RESULT([no])])
5997 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
5999 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6001 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6003 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS],[1])
6004 AC_MSG_RESULT([yes])
6005 ], [AC_MSG_RESULT([no])])
6008 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6010 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6012 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6014 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_THROW],[1])
6015 AC_MSG_RESULT([yes])
6016 ], [AC_MSG_RESULT([no])])
6019 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6021 save_CXXFLAGS=$CXXFLAGS
6022 CXXFLAGS="$CFLAGS -Werror -Wunknown-pragmas"
6023 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6024 struct __attribute__((warn_unused)) dummy {};
6026 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6027 AC_MSG_RESULT([yes])
6028 ], [AC_MSG_RESULT([no])])
6029 CXXFLAGS=$save_CXXFLAGS
6032 AC_MSG_CHECKING([whether STL uses __attribute__((warn_unused))])
6034 save_CXXFLAGS=$CXXFLAGS
6035 CXXFLAGS="$CFLAGS -Werror -Wunused"
6036 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6038 void f() { std::string s; }
6042 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED_STL],[1])
6043 AC_MSG_RESULT([yes])])
6044 CXXFLAGS=$save_CXXFLAGS
6048 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
6049 AC_SUBST(HAVE_GCC_AVX)
6050 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6052 dnl ===================================================================
6053 dnl Identify the C++ library
6054 dnl ===================================================================
6056 AC_MSG_CHECKING([What the C++ library is])
6058 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6064 [CPP_LIBRARY=GLIBCXX
6065 cpp_library_name="GNU libstdc++"
6067 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6069 #ifndef _LIBCPP_VERSION
6074 cpp_library_name="LLVM libc++"
6076 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6083 cpp_library_name="Microsoft"
6085 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6086 AC_MSG_RESULT([$cpp_library_name])
6088 AC_SUBST(CPP_LIBRARY)
6090 dnl ===================================================================
6092 dnl ===================================================================
6096 if test "$COM" = MSC; then
6097 AC_MSG_CHECKING([whether $CXX supports C++11])
6099 # MSVC supports (a subset of) CXX11 without any switch
6102 elif test "$GCC" = "yes"; then
6104 AC_MSG_CHECKING([whether $CXX supports C++11])
6105 for flag in -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
6106 save_CXXFLAGS=$CXXFLAGS
6107 CXXFLAGS="$CXXFLAGS $flag -Werror"
6109 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void f() {}]])],[CXXFLAGS_CXX11=$flag])
6111 CXXFLAGS=$save_CXXFLAGS
6112 if test -n "$CXXFLAGS_CXX11"; then
6117 if test "$HAVE_CXX11" = TRUE; then
6118 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6124 if test $CPP_LIBRARY = GLIBCXX -a "$HAVE_CXX11" = TRUE; then
6125 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6127 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6129 #if !defined(__GLIBCXX__)
6131 #elif __GLIBCXX__ < 20111004
6132 /* before breakage */
6133 #elif __GLIBCXX__ > 20120703
6134 /* after breakage */
6138 ]])], [AC_MSG_RESULT(no, ok)],
6139 [AC_MSG_RESULT(yes, disabling C++11)
6144 if test "$HAVE_CXX11" = TRUE; then
6145 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6146 save_CXXFLAGS=$CXXFLAGS
6147 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6150 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6153 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6169 a thinga[]={{0,0}, {1,1}};
6170 b thingb[]={{0,0}, {1,1}};
6171 size_t i = sizeof(sal_n_array_size(thinga));
6172 size_t j = sizeof(sal_n_array_size(thingb));
6173 return !(i != 0 && j != 0);
6175 ], [ AC_MSG_RESULT(yes) ],
6180 CXXFLAGS=$save_CXXFLAGS
6183 if test "$HAVE_CXX11" = TRUE; then
6184 AC_MSG_CHECKING([whether $CXX supports C++11 without __float128 compile error])
6185 save_CXXFLAGS=$CXXFLAGS
6186 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6189 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6191 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6194 ],[ AC_MSG_RESULT(yes) ],
6197 # The only reason why libstdc++ headers fail with Clang in C++11 mode is because
6198 # they use the __float128 type that Clang doesn't know (libstdc++ checks whether
6199 # __float128 is available during its build, but it's usually built using GCC,
6200 # and so c++config.h hardcodes __float128 being supported). As the only place
6201 # where __float128 is actually used is in a template specialization,
6202 # -D__float128=void will avoid the problem there while still causing a problem
6203 # if somebody actually uses the type.
6204 AC_MSG_CHECKING([whether -D__float128=void workaround helps])
6205 CXXFLAGS="$CXXFLAGS -D__float128=void"
6206 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6208 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6214 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -D__float128=void"
6223 CXXFLAGS=$save_CXXFLAGS
6226 if test "$HAVE_CXX11" = "TRUE"; then
6227 AC_DEFINE(HAVE_CXX11)
6228 elif test -n "$CXXFLAGS_CXX11"; then
6229 AC_MSG_NOTICE([Disabling C++11 support])
6231 elif test "$CPP_LIBRARY" = LIBCPP -a $_os = Darwin; then
6232 AC_MSG_ERROR([Selected libc++ but C++11 support broken])
6235 AC_SUBST(CXXFLAGS_CXX11)
6236 AC_SUBST(HAVE_CXX11)
6238 dnl ==================================
6239 dnl Check for C++11 "= delete" support
6240 dnl ==================================
6242 if test "$HAVE_CXX11" = "TRUE"; then
6243 AC_MSG_CHECKING([whether $CXX supports C++11 = delete syntax])
6244 save_CXXFLAGS=$CXXFLAGS
6245 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6247 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6250 void test() = delete;
6252 ]])],[HAVE_CXX11_DELETE=TRUE],[])
6255 CXXFLAGS=$save_CXXFLAGS
6256 if test "$HAVE_CXX11_DELETE" = "TRUE"; then
6257 AC_MSG_RESULT([yes])
6258 AC_DEFINE([HAVE_CXX11_DELETE])
6264 dnl ==================================
6265 dnl Check for C++11 "override" support
6266 dnl ==================================
6268 if test "$HAVE_CXX11" = "TRUE"; then
6269 AC_MSG_CHECKING([whether $CXX supports C++11 "override" syntax])
6270 save_CXXFLAGS=$CXXFLAGS
6271 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6273 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6276 virtual void test();
6281 virtual void test() override;
6283 ]])],[HAVE_CXX11_OVERRIDE=TRUE],[])
6286 CXXFLAGS=$save_CXXFLAGS
6287 if test "$HAVE_CXX11_OVERRIDE" = "TRUE"; then
6288 AC_MSG_RESULT([yes])
6289 AC_DEFINE([HAVE_CXX11_OVERRIDE])
6295 dnl ==================================
6296 dnl Check for C++11 "final" support
6297 dnl ==================================
6299 if test "$HAVE_CXX11" = "TRUE"; then
6300 AC_MSG_CHECKING([whether $CXX supports C++11 "final" syntax])
6301 save_CXXFLAGS=$CXXFLAGS
6302 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6304 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6305 // First check that this correct program that uses "final" compiles
6312 virtual void test();
6319 ]])],[have_final=yes],[])
6321 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6322 // Then check that the "final" works as expected,
6323 // that this program fails to compile
6331 ]])],[],[final_class_works=yes])
6333 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6334 // Also this should fail to compile
6337 virtual void test();
6349 ]])],[],[final_method_works=yes])
6352 CXXFLAGS=$save_CXXFLAGS
6354 if test "$have_final" = yes -a "$final_class_works" = yes -a "$final_method_works" = yes; then
6355 AC_MSG_RESULT([yes])
6356 AC_DEFINE([HAVE_CXX11_FINAL])
6362 dnl ===================================================================
6363 dnl Check for C++11 perfect forwarding support
6364 dnl ===================================================================
6365 if test "$HAVE_CXX11" = "TRUE"; then
6366 AC_MSG_CHECKING([whether $CXX supports C++11 perfect forwarding])
6367 save_CXXFLAGS=$CXXFLAGS
6368 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6370 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6372 template<typename T, typename... Args> T * f(Args &&... v) {
6373 return new T(std::forward<Args>(v)...);
6377 ]])], [perfect_forwarding=yes], [perfect_forwarding=no])
6379 CXXFLAGS=$save_CXXFLAGS
6380 AC_MSG_RESULT([$perfect_forwarding])
6381 if test "$perfect_forwarding" = yes; then
6382 AC_DEFINE([HAVE_CXX11_PERFECT_FORWARDING])
6386 HAVE_GCC_PRAGMA_OPERATOR=
6387 dnl _Pragma support (may require C++11)
6388 if test "$GCC" = "yes"; then
6389 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6391 save_CXXFLAGS=$CXXFLAGS
6392 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6393 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6394 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6396 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6397 HAVE_GCC_PRAGMA_OPERATOR=1
6398 AC_MSG_RESULT([yes])
6399 ], [AC_MSG_RESULT([no])])
6401 CXXFLAGS=$save_CXXFLAGS
6403 AC_SUBST(HAVE_GCC_PRAGMA_OPERATOR)
6405 dnl ===================================================================
6406 dnl system stl sanity tests
6407 dnl ===================================================================
6408 HAVE_GCC_VISIBILITY_BROKEN=
6409 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
6413 save_CPPFLAGS="$CPPFLAGS"
6414 if test -n "$MACOSX_SDK_PATH"; then
6415 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6418 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6420 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$CPP_LIBRARY" = GLIBCXX; then
6421 dnl gcc#19664, gcc#22482, rhbz#162935
6422 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6423 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6424 AC_MSG_RESULT([$stlvisok])
6425 if test "$stlvisok" = "no"; then
6426 AC_MSG_WARN([Your libstdc++ headers are not visibility safe. Disabling visibility])
6427 add_warning "Your libstdc++ headers are not visibility safe. Disabling visibility"
6428 unset HAVE_GCC_VISIBILITY_FEATURE
6432 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
6433 sharedlink_ldflags_save=$LDFLAGS
6434 LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
6436 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
6437 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6439 using namespace std;
6441 istringstream strm( "test" ); return 0;
6443 # Ugh, surely bad to assume an error message will contain
6444 # the word "unresolvable", a problem with
6445 # -fvisibility-inlines-hidden and STL headers might cause
6446 # some more obscure message on some platform, and anway,
6447 # the error message could be localised.
6448 [$EGREP -q unresolvable conftest.err;
6449 if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
6451 AC_MSG_RESULT([$gccvisok])
6452 if test "$gccvisok" = "no"; then
6453 AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
6454 add_warning "Your gcc is not -fvisibility-inlines-hidden safe, disabling that."
6455 HAVE_GCC_VISIBILITY_BROKEN="TRUE"
6458 LDFLAGS=$sharedlink_ldflags_save
6461 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6462 # when we don't make any dynamic libraries?
6463 if test "$DISABLE_DYNLOADING" = "" -a "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
6464 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6465 cat > conftestlib1.cc <<_ACEOF
6466 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6467 struct S2: S1<int> { virtual ~S2(); };
6470 cat > conftestlib2.cc <<_ACEOF
6471 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6472 struct S2: S1<int> { virtual ~S2(); };
6473 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6475 gccvisinlineshiddenok=yes
6476 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6477 gccvisinlineshiddenok=no
6479 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $LINKFLAGSNOUNDEFS -o libconftest2$DLLPOST >/dev/null 2>&5; then
6480 gccvisinlineshiddenok=no
6485 AC_MSG_RESULT([$gccvisinlineshiddenok])
6486 if test "$gccvisinlineshiddenok" = "no"; then
6487 AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
6488 add_warning "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that."
6489 HAVE_GCC_VISIBILITY_BROKEN="TRUE"
6493 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
6494 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6495 cat >visibility.cxx <<_ACEOF
6496 #pragma GCC visibility push(hidden)
6497 struct __attribute__ ((visibility ("default"))) TestStruct {
6500 __attribute__ ((visibility ("default"))) void TestFunc() {
6504 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
6509 if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
6512 if $EGREP -q '@PLT|@GOT' visibility.s; then
6524 rm -f visibility.s visibility.cxx
6526 AC_MSG_RESULT([$gccvisbroken])
6527 if test "$gccvisbroken" = "yes"; then
6528 AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
6529 add_warning "Your gcc is not -fvisibility=hidden safe. Disabling visibility"
6530 unset HAVE_GCC_VISIBILITY_FEATURE
6534 CPPFLAGS="$save_CPPFLAGS"
6539 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
6540 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
6542 dnl ===================================================================
6544 dnl ===================================================================
6546 HAVE_GCC_FNO_DEFAULT_INLINE=
6547 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6548 if test "$GCC" = "yes"; then
6549 AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
6550 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6551 # Option just ignored and silly warning that isn't a real
6556 save_CXXFLAGS=$CXXFLAGS
6557 CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
6558 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
6559 CXXFLAGS=$save_CXXFLAGS
6562 if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
6563 AC_MSG_RESULT([yes])
6568 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6569 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6574 save_CXXFLAGS=$CXXFLAGS
6575 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6576 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6577 CXXFLAGS=$save_CXXFLAGS
6580 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6581 AC_MSG_RESULT([yes])
6586 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
6587 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6590 dnl ===================================================================
6592 dnl ===================================================================
6593 AC_MSG_CHECKING([which memory allocator to use])
6594 if test "$with_alloc" = "system"; then
6595 AC_MSG_RESULT([system])
6597 AC_CHECK_FUNCS([malloc realloc calloc free])
6599 if test "$with_alloc" = "tcmalloc"; then
6600 AC_MSG_RESULT(tcmalloc)
6601 if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
6602 AC_MSG_ERROR([tcmalloc only available/usable on ix86])
6604 AC_CHECK_LIB([tcmalloc], [malloc], [:],
6605 [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
6608 if test "$with_alloc" = "jemalloc"; then
6609 if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
6610 AC_MSG_RESULT(jemalloc)
6612 CFLAGS="$CFLAGS -pthread"
6613 AC_CHECK_LIB([jemalloc], [malloc], [:],
6614 [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
6618 AC_MSG_RESULT([system])
6620 AC_CHECK_FUNCS([malloc realloc calloc free])
6623 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
6624 AC_MSG_RESULT([internal])
6626 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6627 AC_SUBST(HAVE_POSIX_FALLOCATE)
6630 dnl ===================================================================
6631 dnl Custom build version
6632 dnl ===================================================================
6634 AC_MSG_CHECKING([whether to add custom build version])
6635 if test "$with_build_version" != ""; then
6636 BUILD_VER_STRING=$with_build_version
6637 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6642 AC_SUBST(BUILD_VER_STRING)
6644 JITC_PROCESSOR_TYPE=""
6645 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6646 # IBMs JDK needs this...
6647 JITC_PROCESSOR_TYPE=6
6648 export JITC_PROCESSOR_TYPE
6650 AC_SUBST([JITC_PROCESSOR_TYPE])
6652 # Misc Windows Stuff
6653 if test $_os = "WINNT" -a "$WITH_MINGW" != yes; then
6656 MSVC_DLL_PATH="$msvcdllpath"
6657 MSVC_DLLS="$msvcdlls"
6659 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6662 AC_SUBST(MSVC_DLL_PATH)
6666 dnl ===================================================================
6668 dnl ===================================================================
6669 if test "$ENABLE_JAVA" != ""; then
6671 # Windows-specific tests
6672 if test "$build_os" = "cygwin"; then
6673 if test "$BITNESS_OVERRIDE" = 64; then
6679 if test -z "$with_jdk_home"; then
6680 for ver in 1.7 1.6; do
6681 reg_get_value_$bitness "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
6682 if test -n "$regvalue"; then
6687 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
6688 with_jdk_home="$_jdk_home"
6689 howfound="found automatically"
6691 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
6694 test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
6695 howfound="you passed"
6699 JAVA_HOME=; export JAVA_HOME
6700 if test -z "$with_jdk_home"; then
6701 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
6703 _java_path="$with_jdk_home/bin/$with_java"
6704 dnl Check if there is a Java interpreter at all.
6705 if test -x "$_java_path"; then
6706 JAVAINTERPRETER=$_java_path
6708 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
6712 if test "$build_os" = "cygwin"; then
6713 # Check that the JDK found is correct architecture
6714 # Why is this necessary, we don't link with any library from the JDK I think,
6716 shortjdkhome=`cygpath -d "$with_jdk_home"`
6717 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
6718 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
6719 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6720 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
6721 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6722 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6725 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6726 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6728 JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
6729 JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
6730 elif test $_os = Darwin -a "$BITNESS_OVERRIDE" = ""; then
6731 dnl HACK: There currently is only a 32 bit version of LibreOffice for Mac OS X,
6732 dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
6733 dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
6734 AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
6735 if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
6736 AC_MSG_RESULT([yes])
6744 dnl ===================================================================
6746 dnl ===================================================================
6748 # Note that JAVA_HOME as for now always means the *build* platform's
6749 # JAVA_HOME. Whether all the complexity here actually is needed any
6750 # more or not, no idea.
6752 if test "$ENABLE_JAVA" != ""; then
6754 AC_MSG_CHECKING([the installed JDK])
6755 if test -n "$JAVAINTERPRETER"; then
6756 dnl java -version sends output to stderr!
6757 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6758 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6759 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6761 AC_MSG_RESULT([checked (gcj)])
6762 _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
6763 _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6765 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6766 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6767 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6770 dnl IBM JDK specific tests
6771 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6772 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6774 if test "$_jdk_ver" -lt 10500; then
6775 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
6778 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6780 if test "$with_jdk_home" = ""; then
6781 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6782 you must use the "--with-jdk-home" configure option explicitly])
6785 JAVA_HOME=$with_jdk_home
6790 dnl Sun JDK specific tests
6791 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6792 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6794 if test "$_jdk_ver" -lt 10500; then
6795 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
6797 if test "$_jdk_ver" -gt 10600; then
6798 JAVA_CLASSPATH_NOT_SET="1"
6801 AC_MSG_RESULT([checked (JDK $_jdk)])
6802 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6803 if test "$_os" = "WINNT"; then
6804 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6808 AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
6812 JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
6815 dnl ===================================================================
6816 dnl Set target Java bytecode version
6817 dnl ===================================================================
6818 if test "$ENABLE_JAVA" != ""; then
6819 _java_target_ver="1.5"
6821 JAVA_SOURCE_VER="$_java_target_ver"
6822 JAVA_TARGET_VER="$_java_target_ver"
6825 dnl ===================================================================
6826 dnl Checks for javac
6827 dnl ===================================================================
6828 if test "$ENABLE_JAVA" != ""; then
6829 if test "$JDK" = "gcj"; then
6830 javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
6832 javacompiler="javac"
6834 if test -z "$with_jdk_home"; then
6835 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
6837 _javac_path="$with_jdk_home/bin/$javacompiler"
6838 dnl Check if there is a Java compiler at all.
6839 if test -x "$_javac_path"; then
6840 JAVACOMPILER=$_javac_path
6843 if test -z "$JAVACOMPILER"; then
6844 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
6846 if test "$build_os" = "cygwin"; then
6847 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
6848 JAVACOMPILER="${JAVACOMPILER}.exe"
6850 JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
6851 JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
6854 if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
6855 AC_MSG_CHECKING([re-checking JDK])
6857 AC_MSG_RESULT([checked (ecj)])
6858 _gij_longver="40200"
6863 dnl ===================================================================
6864 dnl Checks that javac is gcj
6865 dnl ===================================================================
6866 if test "$ENABLE_JAVA" != ""; then
6867 if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
6871 AC_SUBST(JAVACISGCJ)
6873 dnl ===================================================================
6874 dnl Checks for javadoc
6875 dnl ===================================================================
6876 if test "$ENABLE_JAVA" != ""; then
6877 if test -z "$with_jdk_home"; then
6878 AC_PATH_PROG(JAVADOC, javadoc)
6880 _javadoc_path="$with_jdk_home/bin/javadoc"
6881 dnl Check if there is a javadoc at all.
6882 if test -x "$_javadoc_path"; then
6883 JAVADOC=$_javadoc_path
6885 AC_PATH_PROG(JAVADOC, javadoc)
6888 if test -z "$JAVADOC"; then
6889 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
6891 if test "$build_os" = "cygwin"; then
6892 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
6893 JAVADOC="${JAVADOC}.exe"
6895 JAVADOC=`cygpath -d "$JAVADOC"`
6896 JAVADOC=`cygpath -u "$JAVADOC"`
6899 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
6900 JAVADOCISGJDOC="yes"
6903 AC_SUBST(JAVADOCISGJDOC)
6905 if test "$ENABLE_JAVA" != ""; then
6906 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
6907 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
6908 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
6909 # try to recover first by looking whether we have a alternatives
6910 # system as in Debian or newer SuSEs where following /usr/bin/javac
6911 # over /etc/alternatives/javac leads to the right bindir where we
6912 # just need to strip a bit away to get a valid JAVA_HOME
6913 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
6914 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
6915 # maybe only one level of symlink (e.g. on Mac)
6916 JAVA_HOME=$(readlink $JAVACOMPILER)
6917 if test "$(dirname $JAVA_HOME)" = "."; then
6918 # we've got no path to trim back
6923 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
6924 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
6925 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
6926 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
6928 dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
6929 if test "$JAVA_HOME" != "/usr"; then
6930 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6931 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
6932 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
6933 dnl Tiger already returns a JDK path..
6934 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
6936 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
6940 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
6942 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
6943 if test -z "$JAVA_HOME"; then
6944 if test "x$with_jdk_home" = "x"; then
6945 cat > findhome.java <<_ACEOF
6946 [import java.io.File;
6950 public static void main(String args[])
6952 String jrelocation = System.getProperty("java.home");
6953 File jre = new File(jrelocation);
6954 System.out.println(jre.getParent());
6958 AC_MSG_CHECKING([if javac works])
6959 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
6960 AC_TRY_EVAL(javac_cmd)
6961 if test $? = 0 -a -f ./findhome.class; then
6962 AC_MSG_RESULT([javac works])
6964 echo "configure: javac test failed" >&5
6965 cat findhome.java >&5
6966 AC_MSG_ERROR([javac does not work - java projects will not build!])
6968 AC_MSG_CHECKING([if gij knows its java.home])
6969 JAVA_HOME=`$JAVAINTERPRETER findhome`
6970 if test $? = 0 -a "$JAVA_HOME" != ""; then
6971 AC_MSG_RESULT([$JAVA_HOME])
6973 echo "configure: java test failed" >&5
6974 cat findhome.java >&5
6975 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
6977 # clean-up after ourselves
6978 rm -f ./findhome.java ./findhome.class
6980 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
6984 dnl second sanity check JAVA_HOME if possible
6985 if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
6986 # now check if $JAVA_HOME is really valid
6987 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6988 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
6991 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
6994 if test "$JAVA_HOME_OK" = "NO"; then
6995 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
6996 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
6997 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
6998 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
6999 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7000 add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
7003 PathFormat "$JAVA_HOME"
7004 JAVA_HOME="$formatted_path"
7009 if test "$ENABLE_JAVA" != ""; then
7010 AC_MSG_CHECKING([for jawt lib name])
7011 if test "$JDK" = "gcj"; then
7013 save_LDFLAGS=$LDFLAGS
7014 CFLAGS="$CFLAGS -I$JAVA_HOME/include"
7015 LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
7016 exec 6>/dev/null # no output
7017 AC_CHECK_HEADER(jni.h, [],
7018 [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
7019 AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
7020 exec 6>&1 # output on again
7022 LDFLAGS=$save_LDFLAGS
7024 # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
7025 # A workaround is to link also against libpmawt.so
7026 if test "$JDK" = "ibm"; then
7028 save_LDFLAGS=$LDFLAGS
7029 save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
7030 CFLAGS="$CFLAGS -I$JAVA_HOME/include"
7031 LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
7032 LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
7033 export LD_LIBRARY_PATH
7034 exec 6>/dev/null # no output
7035 AC_CHECK_HEADER(jni.h, [],
7036 [AC_MSG_ERROR([jni.h could not be found.])], [])
7037 AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
7038 if test -z "$AWTLIB"; then
7039 LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
7040 AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
7042 exec 6>&1 # output on again
7044 LDFLAGS=$save_LDFLAGS
7045 LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
7047 if test -z "$AWTLIB"; then
7048 if test $_os = WINNT -a "$WITH_MINGW" != yes; then
7054 AC_MSG_RESULT([$AWTLIB])
7059 if test -n "$ENABLE_JAVA" -a \( -z "$JAVALIB" -o -z "$JAVAINC" \); then
7062 # If your platform follow the common pattern
7063 # just define JAVA_ARCH and JAVA_TOOLKIT for it
7064 # if not, leave JAVA_ARCH empty and define JAVALIB manually
7065 # if you don't want JAVALIB to be exported at all
7066 # define x_JAVALIB=[\#]
7077 JAVA_TOOLKIT="classic"
7078 JAVAINC="-I$JAVA_HOME/include"
7079 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7080 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7085 JRE_BASE_DIR="$JAVA_HOME/jre/bin"
7086 JAVALIB="-L$JRE_BASE_DIR -L$JRE_BASE_DIR/classic"
7096 JDKLIB="$JAVA_HOME/lib"
7097 JAVAINC="-I$JAVA_HOME/include/win32"
7098 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7103 JAVAINC="${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers ${ISYSTEM}$FRAMEWORKSHOME/JavaVM/Headers"
7110 JAVA_TOOLKIT="client"
7114 JAVA_TOOLKIT="server"
7117 JAVAINC="-I$JAVA_HOME/include"
7118 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7125 JAVA_TOOLKIT="client"
7128 if test "`echo $JAVA_HOME | sed -e 's,.*/,,'`" = "linux"; then
7130 JAVA_TOOLKIT="client"
7133 JAVA_TOOLKIT="server"
7137 JAVAINC="-I$JAVA_HOME/include"
7138 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7139 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7140 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7141 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7148 JAVA_TOOLKIT="client"
7152 JAVA_TOOLKIT="server"
7155 JAVAINC="-I$JAVA_HOME/include"
7156 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7165 JAVA_TOOLKIT="server"
7169 JAVA_TOOLKIT="server"
7173 JAVA_TOOLKIT="server"
7180 JRE_BASE_DIR="$JAVA_HOME/jre/bin"
7181 JAVALIB="-L$JAVA_HOME/$LIB64 -L$JRE_BASE_DIR -L$JRE_BASE_DIR/classic -L$JRE_BASE_DIR/native_thread"
7184 JAVA_TOOLKIT="jrockit"
7187 JAVA_TOOLKIT="client"
7193 JAVA_TOOLKIT="server"
7197 JAVA_TOOLKIT="server"
7199 mips|mips64|mipsel|mips64el)
7200 JAVA_ARCH="$host_cpu"
7201 JAVA_TOOLKIT="server"
7204 JAVA_ARCH="$host_cpu"
7205 JAVA_TOOLKIT="client"
7211 JAVA_TOOLKIT="classic"
7214 JAVA_TOOLKIT="client"
7217 JAVA_TOOLKIT="server"
7223 if test "$JDK" = "gcj"; then
7224 JAVA_TOOLKIT="client"
7226 JAVA_TOOLKIT="server"
7231 JAVA_TOOLKIT="server"
7235 JAVA_TOOLKIT="server"
7239 JAVA_TOOLKIT="server"
7243 JAVA_TOOLKIT="server"
7246 AC_MSG_ERROR([No JAVALIB definition host_cpu $host_cpu for host_os $host_os])
7249 JAVAINC="-I$JAVA_HOME/include"
7250 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7251 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7260 JAVA_TOOLKIT="server"
7267 JAVAINC="-I$JAVA_HOME/include"
7275 JAVA_TOOLKIT="client"
7279 JAVA_TOOLKIT="classic"
7283 JAVA_TOOLKIT="client"
7287 JAVA_TOOLKIT="client"
7290 JAVAINC="-I$JAVA_HOME/include"
7291 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7292 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7299 JAVA_TOOLKIT="client"
7303 JAVA_TOOLKIT="server"
7306 JAVAINC="-I$JAVA_HOME/include"
7307 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7308 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7322 JAVAINC="-I$JAVA_HOME/include"
7323 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7324 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7328 if test -n "$JAVA_ARCH"; then
7329 JRE_BASE_DIR="$JAVA_HOME/jre/lib/$JAVA_ARCH"
7330 JAVALIB="-L$JAVA_HOME/$LIB64"
7331 test -d "$JRE_BASE_DIR" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR"
7332 test -d "$JRE_BASE_DIR/$JAVA_TOOLKIT" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/$JAVA_TOOLKIT"
7333 test -d "$JRE_BASE_DIR/native_thread" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/native_thread"
7335 elif test -z "$ENABLE_JAVA"; then
7339 SOLARINC="$SOLARINC $JAVAINC"
7342 AC_SUBST(JAVACOMPILER)
7344 AC_SUBST(JAVAINTERPRETER)
7345 AC_SUBST(JAVAIFLAGS)
7346 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7348 AC_SUBST(JAVA_SOURCE_VER)
7349 AC_SUBST(JAVA_TARGET_VER)
7356 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7357 if test -n "$with_idlc_cpp"; then
7358 AC_MSG_RESULT([$with_idlc_cpp])
7359 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7361 AC_MSG_RESULT([ucpp])
7362 AC_MSG_CHECKING([which ucpp tp use])
7363 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7364 AC_MSG_RESULT([external])
7365 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7367 AC_MSG_RESULT([internal])
7368 BUILD_TYPE="$BUILD_TYPE UCPP"
7371 AC_SUBST(SYSTEM_UCPP)
7373 dnl ===================================================================
7374 dnl Check for epm (not needed for Windows)
7375 dnl ===================================================================
7376 AC_MSG_CHECKING([whether to enable EPM for packing])
7377 if test "$enable_epm" = "yes"; then
7378 AC_MSG_RESULT([yes])
7379 if test "$_os" != "WINNT"; then
7380 if test $_os = Darwin; then
7382 elif test -n "$with_epm"; then
7385 AC_PATH_PROG(EPM, epm, no)
7387 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7388 echo "EPM will be built."
7389 BUILD_TYPE="$BUILD_TYPE EPM"
7390 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7392 # Gentoo has some epm which is something different...
7393 AC_MSG_CHECKING([whether the found epm is the right epm])
7394 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7395 AC_MSG_RESULT([yes])
7397 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7399 AC_MSG_CHECKING([epm version])
7400 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7401 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7402 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7403 AC_MSG_RESULT([OK, >= 3.7])
7405 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7406 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7411 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7412 AC_MSG_CHECKING([for rpm])
7413 for a in "$RPM" rpmbuild rpm; do
7414 $a --usage >/dev/null 2> /dev/null
7415 if test $? -eq 0; then
7419 $a --version >/dev/null 2> /dev/null
7420 if test $? -eq 0; then
7426 if test -z "$RPM"; then
7427 AC_MSG_ERROR([not found])
7428 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7429 RPM_PATH=`which $RPM`
7430 AC_MSG_RESULT([$RPM_PATH])
7431 SCPDEFS="$SCPDEFS -DWITH_RPM"
7433 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7436 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7437 AC_PATH_PROG(DPKG, dpkg, no)
7438 if test "$DPKG" = "no"; then
7439 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7442 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7443 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7444 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7445 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7446 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7447 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
7448 AC_MSG_RESULT([yes])
7451 if echo "$PKGFORMAT" | $GREP -q rpm; then
7453 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7454 add_warning "the rpms will need to be installed with --nodeps"
7458 AC_MSG_WARN([the ${_pt}s will not be relocateable])
7459 add_warning "the ${_pt}s will not be relocateable"
7460 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7461 relocation will work, you need to patch your epm with the
7462 patch in epm/epm-3.7.patch or build with
7463 --with-epm=internal which will build a suitable epm])
7468 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7469 AC_PATH_PROG(PKGMK, pkgmk, no)
7470 if test "$PKGMK" = "no"; then
7471 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7478 for i in $PKGFORMAT; do
7480 aix | bsd | deb | pkg | rpm | native | portable)
7482 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7491 dnl ===================================================================
7492 dnl We need winegcc when building MinGW build to be able to cross-build msi tools
7493 dnl ===================================================================
7495 if test "$enable_winegcc" = "yes"; then
7496 AC_PATH_PROG(WINEGCC, winegcc)
7497 if test "$WINEGCC" = ""; then
7498 AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
7501 ac_exeext_save="$ac_exeext"
7504 AC_LINK_IFELSE([AC_LANG_PROGRAM([
7507 printf ("hello world\n");
7509 [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
7512 ac_exeext="$ac_exeext_save"
7516 if test $_os = iOS; then
7517 enable_mpl_subset=yes
7519 enable_lotuswordpro=no
7522 enable_postgresql_sdbc=no
7523 enable_lotuswordpro=no
7524 enable_extension_integration=no
7525 enable_report_builder=no
7531 if test "$enable_lotuswordpro" = "yes"; then
7533 SCPDEFS="$SCPDEFS -DDISABLE_LWP"
7535 AC_SUBST(ENABLE_LWP)
7537 dnl ===================================================================
7539 dnl ===================================================================
7540 AC_PATH_PROG(GPERF, gperf)
7541 if test -z "$GPERF"; then
7542 AC_MSG_ERROR([gperf not found but needed. Install it.])
7544 AC_MSG_CHECKING([gperf version])
7545 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
7548 AC_MSG_ERROR([too old, you need at least 3.0.0])
7552 dnl ===================================================================
7553 dnl Check for building ODK
7554 dnl ===================================================================
7555 if test "$enable_odk" = no; then
7558 if test "$with_doxygen" = no; then
7559 AC_MSG_CHECKING([for doxygen])
7563 if test "$with_doxygen" = yes; then
7564 AC_PATH_PROG([DOXYGEN], [doxygen])
7565 if test -z "$DOXYGEN"; then
7566 if test "$enable_odk" = "" ; then
7569 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7573 AC_MSG_CHECKING([for doxygen])
7574 DOXYGEN=$with_doxygen
7575 AC_MSG_RESULT([$DOXYGEN])
7577 if test -n "$DOXYGEN"; then
7578 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7579 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7580 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7581 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7588 AC_MSG_CHECKING([whether to build the ODK])
7589 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7590 AC_MSG_RESULT([yes])
7592 if test "$with_java" != "no"; then
7593 AC_MSG_CHECKING([whether to build unowinreg.dll])
7594 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7595 # build on Win by default
7596 enable_build_unowinreg=yes
7598 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7602 AC_MSG_RESULT([yes])
7605 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
7606 if test -z "$with_mingw_cross_compiler"; then
7608 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7609 elif test -x "$with_mingw_cross_compiler"; then
7610 MINGWCXX="$with_mingw_cross_compiler"
7612 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7615 if test "$MINGWCXX" = "false"; then
7616 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7619 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7620 if test -x "$mingwstrip_test"; then
7621 MINGWSTRIP="$mingwstrip_test"
7623 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7626 if test "$MINGWSTRIP" = "false"; then
7627 AC_MSG_ERROR(MinGW32 binutils not found.)
7631 BUILD_TYPE="$BUILD_TYPE ODK"
7636 AC_SUBST(BUILD_UNOWINREG)
7638 AC_SUBST(MINGWSTRIP)
7640 dnl ===================================================================
7641 dnl Check for system zlib
7642 dnl ===================================================================
7643 if test "$with_system_zlib" = "auto"; then
7646 with_system_zlib="$with_system_libs"
7649 with_system_zlib=yes
7654 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
7655 dnl and has no pkg-config for it at least on some tinderboxes,
7656 dnl so leaving that out for now
7657 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7658 AC_MSG_CHECKING([which zlib to use])
7659 if test "$with_system_zlib" = "yes"; then
7660 AC_MSG_RESULT([external])
7662 AC_CHECK_HEADER(zlib.h, [],
7663 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7664 AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
7665 [AC_MSG_ERROR(zlib not found or functional)], [])
7667 AC_MSG_RESULT([internal])
7669 BUILD_TYPE="$BUILD_TYPE ZLIB"
7670 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7673 AC_SUBST(ZLIB_CFLAGS)
7675 AC_SUBST(SYSTEM_ZLIB)
7677 dnl ===================================================================
7678 dnl Check for system jpeg
7679 dnl ===================================================================
7680 AC_MSG_CHECKING([which jpeg to use])
7681 if test "$with_system_jpeg" = "auto"; then
7683 WINNT|Darwin|iOS|Android)
7684 with_system_jpeg="$with_system_libs"
7687 with_system_jpeg=yes
7692 if test "$with_system_jpeg" = "yes"; then
7693 AC_MSG_RESULT([external])
7695 AC_CHECK_HEADER(jpeglib.h, [],
7696 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7697 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
7698 [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
7699 libo_MINGW_CHECK_DLL([libjpeg])
7701 AC_MSG_RESULT([internal])
7703 BUILD_TYPE="$BUILD_TYPE JPEG"
7705 AC_SUBST(SYSTEM_JPEG)
7708 dnl ===================================================================
7709 dnl Check for system clucene
7710 dnl ===================================================================
7711 dnl we should rather be using
7712 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
7713 dnl but the contribs-lib check seems tricky
7714 AC_MSG_CHECKING([which clucene to use])
7715 if test "$with_system_clucene" = "yes"; then
7716 AC_MSG_RESULT([external])
7718 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
7719 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
7721 save_CXXFLAGS=$CXXFLAGS
7722 save_CPPFLAGS=$CPPFLAGS
7723 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
7724 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
7725 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
7726 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
7727 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
7728 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
7729 CXXFLAGS=$save_CXXFLAGS
7730 CPPFLAGS=$save_CPPFLAGS
7733 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
7735 AC_MSG_RESULT([internal])
7737 BUILD_TYPE="$BUILD_TYPE CLUCENE"
7739 AC_SUBST(SYSTEM_CLUCENE)
7740 AC_SUBST(CLUCENE_CFLAGS)
7741 AC_SUBST(CLUCENE_LIBS)
7743 dnl ===================================================================
7744 dnl Check for system expat
7745 dnl ===================================================================
7746 dnl we should use libo_CHECK_SYSTEM_MODULE, but e.g. the mingw tinderbox has no
7747 dnl proper pkg-config for it. It should really be fixed on the tinderbox though.
7748 AC_MSG_CHECKING([which expat to use])
7749 if test "$with_system_expat" = "yes"; then
7750 AC_MSG_RESULT([external])
7752 AC_CHECK_HEADER(expat.h, [],
7753 [AC_MSG_ERROR(expat.h not found. install expat)], [])
7754 AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
7755 [AC_MSG_RESULT(expat library not found or functional.)], [])
7756 libo_MINGW_CHECK_DLL([libexpat])
7758 AC_MSG_RESULT([internal])
7760 BUILD_TYPE="$BUILD_TYPE EXPAT"
7762 AC_SUBST(SYSTEM_EXPAT)
7764 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
7765 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
7767 AC_DEFINE([ENABLE_EOT])
7768 AC_MSG_RESULT([yes])
7770 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
7775 AC_SUBST([ENABLE_EOT])
7777 dnl ===================================================================
7778 dnl Check for system libe-book
7779 dnl ===================================================================
7780 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.0 >= 0.0.2],["-I${WORKDIR}/UnpackedTarball/libebook/inc"],["-L${WORKDIR}/UnpackedTarball/libebook/src/lib/.libs -le-book-0.0"])
7782 dnl ===================================================================
7783 dnl Check for system libetonyek
7784 dnl ===================================================================
7785 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.0],["-I${WORKDIR}/UnpackedTarball/libetonyek/inc"],["-L${WORKDIR}/UnpackedTarball/libetonyek/src/lib/.libs -letonyek-0.0"])
7787 dnl ===================================================================
7788 dnl Check for system libfreehand
7789 dnl ===================================================================
7790 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.0],["-I${WORKDIR}/UnpackedTarball/libfreehand/inc"],["-L${WORKDIR}/UnpackedTarball/libfreehand/src/lib/.libs -lfreehand-0.0"])
7792 dnl ===================================================================
7793 dnl Check for system libodfgen
7794 dnl ===================================================================
7795 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.0 >= 0.0.3])
7797 dnl ===================================================================
7798 dnl Check for system libcdr
7799 dnl ===================================================================
7800 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.0 >= 0.0.5])
7802 dnl ===================================================================
7803 dnl Check for system libmspub
7804 dnl ===================================================================
7805 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.0])
7807 dnl ===================================================================
7808 dnl Check for system libmwaw
7809 dnl ===================================================================
7810 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.2])
7812 dnl ===================================================================
7813 dnl Check for system libvisio
7814 dnl ===================================================================
7815 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.0])
7817 dnl ===================================================================
7818 dnl Check for system libcmis
7819 dnl ===================================================================
7820 libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.4 >= 0.4.0])
7822 dnl ===================================================================
7823 dnl Check for system libwpd
7824 dnl ===================================================================
7825 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.9 >= 0.9.5 libwpd-stream-0.9 >= 0.9.5],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs -lwpd-0.9"])
7827 dnl ===================================================================
7828 dnl Check for system lcms2
7829 dnl ===================================================================
7830 if test "$with_system_lcms2" = "yes"; then
7831 libo_MINGW_CHECK_DLL([liblcms2])
7835 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
7836 if test "$GCC" = "yes"; then
7837 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7839 if test "$COM" = "MSC"; then # override the above
7840 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
7843 dnl ===================================================================
7844 dnl Check for system cppunit
7845 dnl ===================================================================
7846 if test "$cross_compiling" != "yes"; then
7847 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.12.0])
7850 dnl ===================================================================
7851 dnl Check whether freetype is available
7852 dnl ===================================================================
7853 if test "$test_freetype" = "yes"; then
7854 AC_MSG_CHECKING([whether freetype is available])
7855 # FreeType has 3 different kinds of versions
7856 # * release, like 2.4.10
7857 # * libtool, like 13.0.7 (this what pkg-config returns)
7859 # FreeType's docs/VERSION.DLL provides a table mapping between the three
7862 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
7863 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7866 _save_cflags="$CFLAGS"
7867 LIBS="$LIBS $FREETYPE_LIBS"
7868 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
7869 AC_CHECK_FUNC(FT_Face_GetCharVariantIndex, AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX), [])
7871 CFLAGS="$_save_cflags"
7873 AC_SUBST(FREETYPE_CFLAGS)
7874 AC_SUBST(FREETYPE_LIBS)
7875 AC_SUBST([SYSTEM_FREETYPE])
7877 dnl ===================================================================
7878 dnl Check for system libabw
7879 dnl ===================================================================
7880 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.0],["-I${WORKDIR}/UnpackedTarball/libabw/inc"],["-L${WORKDIR}/UnpackedTarball/libabw/src/lib/.libs -labw-0.0"])
7882 dnl ===================================================================
7883 dnl Check for system libwps
7884 dnl ===================================================================
7885 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.2],["-I${WORKDIR}/UnpackedTarball/libwps/inc"],["-L${WORKDIR}/UnpackedTarball/libwps/src/lib/.libs -lwps-0.2"])
7887 dnl ===================================================================
7888 dnl Check for system libwpg
7889 dnl ===================================================================
7890 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.2],["-I${WORKDIR}/UnpackedTarball/libwpg/inc"],["-L${WORKDIR}/UnpackedTarball/libwpg/src/lib/.libs -lwpg-0.2"])
7892 # ===================================================================
7893 # Check for system libxslt
7894 # to prevent incompatibilities between internal libxml2 and external libxslt,
7895 # or vice versa, use with_system_libxml here
7896 # ===================================================================
7897 if test "$with_system_libxml" = "auto"; then
7900 with_system_libxml="$with_system_libs"
7903 with_system_libxml=yes
7908 AC_MSG_CHECKING([which libxslt to use])
7909 if test "$with_system_libxml" = "yes"; then
7910 AC_MSG_RESULT([external])
7912 if test "$_os" = "Darwin"; then
7913 dnl make sure to use SDK path
7914 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7915 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
7917 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
7918 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
7920 PKG_CHECK_MODULES(LIBXSLT, libxslt)
7921 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7922 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
7923 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7926 dnl Check for xsltproc
7927 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7928 if test "$XSLTPROC" = "no"; then
7929 AC_MSG_ERROR([xsltproc is required])
7932 libo_MINGW_CHECK_DLL([libxslt])
7933 libo_MINGW_CHECK_DLL([libexslt])
7934 libo_MINGW_TRY_DLL([iconv])
7936 AC_MSG_RESULT([internal])
7939 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
7941 if test "$cross_compiling" = "yes"; then
7942 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7943 if test "$XSLTPROC" = "no"; then
7944 AC_MSG_ERROR([xsltproc is required])
7948 AC_SUBST(SYSTEM_LIBXSLT)
7949 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
7950 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
7952 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
7954 AC_SUBST(LIBEXSLT_CFLAGS)
7955 AC_SUBST(LIBEXSLT_LIBS)
7956 AC_SUBST(LIBXSLT_CFLAGS)
7957 AC_SUBST(LIBXSLT_LIBS)
7958 AC_SUBST(LIBXSLT_MAJOR)
7961 # ===================================================================
7962 # Check for system libxml
7963 # ===================================================================
7964 AC_MSG_CHECKING([which libxml to use])
7965 if test "$with_system_libxml" = "yes"; then
7966 AC_MSG_RESULT([external])
7968 if test "$_os" = "Darwin"; then
7969 dnl make sure to use SDK path
7970 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7972 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
7973 elif test $_os = iOS; then
7974 dnl make sure to use SDK path
7975 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
7976 LIBXML_CFLAGS="-I$usr/include/libxml2"
7977 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
7979 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
7980 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7983 dnl Check for xmllint
7984 AC_PATH_PROG(XMLLINT, xmllint, no)
7985 if test "$XMLLINT" = "no"; then
7986 AC_MSG_ERROR([xmllint is required])
7989 libo_MINGW_CHECK_DLL([libxml2])
7990 libo_MINGW_TRY_DLL([zlib1])
7992 AC_MSG_RESULT([internal])
7994 BUILD_TYPE="$BUILD_TYPE LIBXML2"
7996 AC_SUBST(SYSTEM_LIBXML)
7997 AC_SUBST(LIBXML_CFLAGS)
7998 AC_SUBST(LIBXML_LIBS)
8001 # =====================================================================
8002 # Checking for a Python interpreter with version >= 2.5 needed to build LO.
8003 # runtime requires Python 3 compatible version (>= 2.6)
8004 # Optionally user can pass an option to configure, i. e.
8005 # ./configure PYTHON=/usr/bin/python
8006 # =====================================================================
8007 if test "$build_os" != "cygwin"; then
8008 # This allows a lack of system python with no error, we use internal one in that case.
8009 AM_PATH_PYTHON([2.5],, [:])
8010 # Clean PYTHON_VERSION checked below if cross-compiling
8012 if test "$PYTHON" != ":"; then
8013 PYTHON_FOR_BUILD=$PYTHON
8016 AC_SUBST(PYTHON_FOR_BUILD)
8018 # Checks for Python to use for Pyuno
8019 AC_MSG_CHECKING([which Python to use for Pyuno])
8020 case "$enable_python" in
8022 if test -z $PYTHON_FOR_BUILD; then
8023 # Python is required to build LibreOffice. In theory we could separate the build-time Python
8024 # requirement from the choice whether to include Python stuff in the installer, but why
8026 AC_MSG_ERROR([Python is required at build time.])
8029 AC_MSG_RESULT([none])
8032 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8033 AC_MSG_RESULT([no, overridden by --disable-scripting])
8035 elif test $build_os = cygwin; then
8036 dnl When building on Windows we don't attempt to use any installed
8037 dnl "system" Python.
8039 dnl (When cross-compiling to Windows from Linux using the mingw32-cross
8040 dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
8041 dnl MinGW cross-compilation setups.)
8042 AC_MSG_RESULT([internal])
8043 enable_python=internal
8044 elif test "$cross_compiling" = yes; then
8045 AC_MSG_RESULT([system])
8046 enable_python=system
8048 # Unset variables set by the above AM_PATH_PYTHON so that
8049 # we actually do check anew.
8050 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
8051 AM_PATH_PYTHON([3.3],, [:])
8052 if test "$PYTHON" = :; then
8053 AC_MSG_RESULT([internal])
8054 enable_python=internal
8056 AC_MSG_RESULT([system])
8057 enable_python=system
8062 AC_MSG_RESULT([internal])
8065 AC_MSG_RESULT([system])
8068 AC_MSG_ERROR([Incorrect --enable-python option])
8072 if test $enable_python != no; then
8073 BUILD_TYPE="$BUILD_TYPE PYUNO"
8076 if test $enable_python = system; then
8077 if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
8078 # We already have logic above to make sure the system Python
8079 # is used only when building against SDK 10.6 or newer.
8081 # Make sure we use the 2.6 Python when building against the
8083 case $with_macosx_sdk in
8085 python_version=2.6;;
8087 python_version=2.7;;
8090 python_version=2.7;;
8092 PYTHON=python$python_version
8093 PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
8094 PYTHON_LIBS="-framework Python"
8096 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8097 # Fallback: Accept these in the environment, or as set above
8100 elif test "$cross_compiling" != yes; then
8101 # Unset variables set by the above AM_PATH_PYTHON so that
8102 # we actually do check anew.
8103 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
8104 # This causes an error if no python command is found
8105 AM_PATH_PYTHON([3.3])
8106 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8107 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8108 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8109 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8110 if test -z "$PKG_CONFIG"; then
8111 PYTHON_CFLAGS="-I$python_include"
8112 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8113 elif $PKG_CONFIG --exists python-$python_version; then
8114 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8115 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8117 PYTHON_CFLAGS="-I$python_include"
8118 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8121 dnl How to find out the cross-compilation Python installation path?
8122 dnl Let's hardocode what we know for different distributions for now...
8123 for python_version in 2.6; do
8124 if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
8125 PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
8126 PYTHON_LIBS="-L${MINGW_SYSROOT}/lib -lpython$python_version $python_libs"
8127 AC_MSG_CHECKING([for python.exe])
8128 libo_MINGW_CHECK_DLL([libpython$python_version])
8129 libo_MINGW_CHECK_DLL([libreadline6])
8130 libo_MINGW_CHECK_DLL([libtermcap])
8131 # could we somehow extract the really mingw python version from
8132 # actual distro package?
8133 # 2.6.2 currently on OpenSUSE 12.1?
8134 # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
8135 PYTHON_VERSION=$python_version.2
8136 PYTHON_VERSION_MAJOR=`echo $python_version | cut -d . -f 1`
8137 PYTHON_VERSION_MINOR=`echo $python_version | cut -d . -f 2`
8141 AC_MSG_CHECKING([for python version])
8142 AS_IF([test -n "$PYTHON_VERSION"],
8143 [AC_MSG_RESULT([$PYTHON_VERSION])],
8144 [AC_MSG_RESULT([not found])
8145 AC_MSG_ERROR([no usable python found])])
8146 test -n "$PYTHON_CFLAGS" && break
8148 # let the PYTHON_FOR_BUILD match the same python installation that
8149 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8150 # better for PythonTests.
8151 PYTHON_FOR_BUILD=$PYTHON
8154 dnl By now enable_python should be "system", "internal" or "no"
8155 case $enable_python in
8159 if test "$CROSS_COMPILING" != YES; then
8160 dnl Check if the headers really work
8161 save_CPPFLAGS="$CPPFLAGS"
8162 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8163 AC_CHECK_HEADER(Python.h, [],
8164 [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
8166 CPPFLAGS="$save_CPPFLAGS"
8169 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8170 AC_MSG_CHECKING([for correct python library version])
8171 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8174 int main(int argc, char **argv) {
8175 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
8176 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8179 ]])],[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])],[])
8183 dnl FIXME Check if the Python library can be linked with, too?
8189 PYTHON_VERSION_MAJOR=3
8190 PYTHON_VERSION_MINOR=3
8191 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.3
8192 BUILD_TYPE="$BUILD_TYPE PYTHON"
8193 # Embedded Python dies without Home set
8194 if test "$HOME" = ""; then
8197 # bz2 tarball and bzip2 is not standard
8198 if test -z "$BZIP2"; then
8199 AC_PATH_PROG( BZIP2, bzip2)
8200 if test -z "$BZIP2"; then
8201 AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
8210 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8214 AC_SUBST(DISABLE_PYTHON)
8215 AC_SUBST(SYSTEM_PYTHON)
8216 AC_SUBST(PYTHON_CFLAGS)
8217 AC_SUBST(PYTHON_LIBS)
8218 AC_SUBST(PYTHON_VERSION)
8219 AC_SUBST(PYTHON_VERSION_MAJOR)
8220 AC_SUBST(PYTHON_VERSION_MINOR)
8222 AC_MSG_CHECKING([whether to build the MariaDB/MySQL Connector extension])
8223 if test "x$enable_ext_mariadb_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8224 AC_MSG_RESULT([yes])
8225 ENABLE_MARIADBC=TRUE
8229 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8234 AC_SUBST(ENABLE_MARIADBC)
8235 AC_SUBST(MARIADBC_MAJOR)
8236 AC_SUBST(MARIADBC_MINOR)
8237 AC_SUBST(MARIADBC_MICRO)
8239 if test "$ENABLE_MARIADBC" = "TRUE"; then
8241 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MARIADBC"
8243 dnl ===================================================================
8244 dnl Check for system MariaDB
8245 dnl ===================================================================
8246 AC_MSG_CHECKING([which MariaDB to use])
8247 if test "$with_system_mariadb" = "yes"; then
8248 AC_MSG_RESULT([external])
8250 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8251 if test -z "$MARIADBCONFIG"; then
8252 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8253 if test -z "$MARIADBCONFIG"; then
8254 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL package.])
8255 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8258 AC_MSG_CHECKING([MariaDB version])
8259 MARIADB_VERSION=`$MARIADBCONFIG --version`
8260 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8261 if test "$MARIADB_MAJOR" -ge "5"; then
8264 AC_MSG_ERROR([too old, use 5.0.x or later])
8266 AC_MSG_CHECKING([for MariaDB Client library])
8267 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8268 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8269 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8270 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8271 if test "$enable_bundle_mariadb" = "yes"; then
8272 AC_MSG_RESULT([yes])
8274 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\+-l/\n/g' | grep -E '(mysqlclient|mariadb)')
8275 if test "$_os" = "Darwin"; then
8276 LIBMARIADB=${LIBMARIADB}.dylib
8277 elif test "$_os" = "WINNT"; then
8278 LIBMARIADB=${LIBMARIADB}.dll
8280 LIBMARIADB=${LIBMARIADB}.so
8282 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8283 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8284 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8285 AC_MSG_RESULT([found.])
8286 PathFormat "$LIBMARIADB_PATH"
8287 LIBMARIADB_PATH="$formatted_path"
8289 AC_MSG_ERROR([not found.])
8296 AC_MSG_RESULT([internal])
8297 AC_MSG_ERROR([libmariadb is known to be broken as of 2013-10; use libmysqlclient])
8299 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb/include"
8300 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadblib"
8301 BUILD_TYPE="$BUILD_TYPE MARIADB"
8304 AC_SUBST(SYSTEM_MARIADB)
8305 AC_SUBST(MARIADB_CFLAGS)
8306 AC_SUBST(MARIADB_LIBS)
8307 AC_SUBST(LIBMARIADB)
8308 AC_SUBST(LIBMARIADB_PATH)
8309 AC_SUBST(BUNDLE_MARIADB)
8312 dnl ===================================================================
8313 dnl Check for system MySQL C++ Connector
8314 dnl ===================================================================
8316 # who thought this too-generic cppconn dir was a good idea?
8317 AC_MSG_CHECKING([MySQL Connector/C++])
8318 if test "$with_system_mysql_cppconn" = "yes"; then
8319 AC_MSG_RESULT([external])
8320 SYSTEM_MYSQL_CPPCONN=YES
8322 AC_CHECK_HEADER(mysql_driver.h, [],
8323 [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
8324 AC_CHECK_LIB([mysqlcppconn], [main], [:],
8325 [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
8327 LIBS="$LIBS -lmysqlcppconn"
8328 AC_MSG_CHECKING([version])
8329 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8330 #include <mysql_driver.h>
8332 int main(int argc, char **argv) {
8333 sql::Driver *driver;
8334 driver = get_driver_instance();
8335 if (driver->getMajorVersion() > 1 || \
8336 (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
8337 (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
8342 ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
8347 AC_MSG_RESULT([internal])
8348 BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
8349 SYSTEM_MYSQL_CPPCONN=NO
8353 AC_SUBST(SYSTEM_MYSQL_CPPCONN)
8355 dnl ===================================================================
8356 dnl Check for system hsqldb
8357 dnl ===================================================================
8358 if test "$with_java" != "no"; then
8359 HSQLDB_USE_JDBC_4_1=
8360 AC_MSG_CHECKING([which hsqldb to use])
8361 if test "$with_system_hsqldb" = "yes"; then
8362 AC_MSG_RESULT([external])
8364 if test -z $HSQLDB_JAR; then
8365 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8367 AC_CHECK_FILE($HSQLDB_JAR, [],
8368 [AC_MSG_ERROR(hsqldb.jar not found.)], [])
8369 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8371 if $PERL -e 'use Archive::Zip;
8372 my $file = "$ENV{'HSQLDB_JAR'}";
8373 my $zip = Archive::Zip->new( $file );
8374 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8375 if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
8376 push @l, split(/\n/, $mf);
8377 foreach my $line (@l) {
8378 if ($line =~ m/Specification-Version:/) {
8379 ($t, $version) = split (/:/,$line);
8380 $version =~ s/^\s//;
8381 ($a, $b, $c, $d) = split (/\./,$version);
8382 if ($c == "0" && $d > "8") {
8392 AC_MSG_RESULT([yes])
8394 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8397 AC_MSG_RESULT([internal])
8399 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8400 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8401 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8402 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8403 AC_MSG_RESULT([yes])
8404 HSQLDB_USE_JDBC_4_1=YES
8409 AC_SUBST(SYSTEM_HSQLDB)
8410 AC_SUBST(HSQLDB_JAR)
8411 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8414 dnl ===================================================================
8415 dnl Check for PostgreSQL stuff
8416 dnl ===================================================================
8417 if test "x$enable_postgresql_sdbc" != "xno"; then
8418 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8420 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8421 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8423 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8424 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8427 AC_MSG_CHECKING([PostgreSQL C interface])
8428 if test "$with_system_postgresql" = "yes"; then
8429 AC_MSG_RESULT([external PostgreSQL])
8430 SYSTEM_POSTGRESQL=YES
8431 if test "$_os" = Darwin; then
8433 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8434 pg_supp_path="$P_SEP$d$pg_supp_path"
8437 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8438 if test -z "$PGCONFIG"; then
8439 AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
8441 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8442 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8444 # if/when anything else than PostgreSQL uses Kerberos,
8445 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8450 # MacOS X has system MIT Kerberos 5 since 10.4
8451 if test "$with_krb5" != "no"; then
8454 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8455 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
8458 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8459 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
8460 KRB5_LIBS="$KRB5_LIBS $LIBS"
8463 if test "$with_gssapi" != "no"; then
8466 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8467 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8473 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8474 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8477 Linux|GNU|*BSD|DragonFly)
8478 if test "$with_krb5" != "no"; then
8481 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8482 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8485 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8486 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8487 KRB5_LIBS="$KRB5_LIBS $LIBS"
8490 if test "$with_gssapi" != "no"; then
8493 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8494 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8500 if test "$with_krb5" = "yes"; then
8503 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8504 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8507 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8508 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8509 KRB5_LIBS="$KRB5_LIBS $LIBS"
8512 if test "$with_gssapi" = "yes"; then
8515 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8516 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8522 if test -n "$with_libpq_path"; then
8523 SYSTEM_POSTGRESQL=YES
8524 AC_MSG_RESULT([external libpq])
8525 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8526 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8528 SYSTEM_POSTGRESQL=NO
8529 AC_MSG_RESULT([internal])
8531 POSTGRESQL_INC="%OVERRIDE_ME%"
8532 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8535 if test "${SYSTEM_POSTGRESQL}" = "YES"; then
8536 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8538 save_CPPFLAGS=$CPPFLAGS
8540 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8541 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8542 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8543 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8544 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8546 CPPFLAGS=$save_CPPFLAGS
8549 BUILD_POSTGRESQL_SDBC=YES
8552 AC_SUBST(WITH_GSSAPI)
8553 AC_SUBST(GSSAPI_LIBS)
8555 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8556 AC_SUBST(SYSTEM_POSTGRESQL)
8557 AC_SUBST(POSTGRESQL_INC)
8558 AC_SUBST(POSTGRESQL_LIB)
8560 dnl ===================================================================
8561 dnl Check for Firebird stuff
8562 dnl ===================================================================
8563 ENABLE_FIREBIRD_SDBC=""
8564 if test "x$enable_firebird_sdbc" = "xyes"; then
8565 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8567 dnl ===================================================================
8568 dnl Check for system Firebird
8569 dnl ===================================================================
8570 AC_MSG_CHECKING([which Firebird to use])
8571 if test "$with_system_firebird" = "yes"; then
8572 AC_MSG_RESULT([external])
8574 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8575 if test -z "$FIREBIRDCONFIG"; then
8576 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8577 PKG_CHECK_MODULES(FIREBIRD, fbembed)
8578 FIREBIRD_VERSION=`pkg-config --modversion fbembed`
8580 AC_MSG_NOTICE([fb_config found])
8581 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8582 AC_MSG_CHECKING([for Firebird Client library])
8583 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8584 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8586 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8587 AC_MSG_CHECKING([Firebird version])
8588 if test -n "${FIREBIRD_VERSION}"; then
8589 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8590 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8591 if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5"; then
8594 AC_MSG_ERROR([Ensure firebird 2.5.x is installed])
8597 __save_CFLAGS="${CFLAGS}"
8598 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
8599 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
8600 #if defined(FB_API_VER) && FB_API_VER == 25
8602 #error "Wrong Firebird API version"
8603 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x is installed]))
8604 CFLAGS="${__save_CFLAGS}"
8606 ENABLE_FIREBIRD_SDBC="TRUE"
8607 elif test "$enable_database_connectivity" != yes; then
8608 AC_MSG_RESULT([none])
8609 elif test "$cross_compiling" = "yes"; then
8610 AC_MSG_RESULT([none])
8612 dnl We need libatomic-ops for any non X86/X64 system
8613 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
8614 dnl ===================================================================
8615 dnl Check for system libatomic-ops
8616 dnl ===================================================================
8617 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
8618 if test "$with_system_libatomic_ops" = "yes"; then
8619 SYSTEM_LIBATOMIC_OPS=YES
8620 AC_CHECK_HEADERS(atomic_ops.h, [],
8621 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
8623 SYSTEM_LIBATOMIC_OPS=NO
8624 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
8625 LIBATOMIC_OPS_LIBS="-latomic_ops"
8626 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
8630 AC_MSG_RESULT([internal])
8632 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/include"
8633 FIREBIRD_LIBS="-lfbembed"
8635 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
8636 ENABLE_FIREBIRD_SDBC="TRUE"
8640 AC_SUBST(ENABLE_FIREBIRD_SDBC)
8641 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
8642 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
8643 AC_SUBST(LIBATOMIC_OPS_LIBS)
8644 AC_SUBST(SYSTEM_FIREBIRD)
8645 AC_SUBST(FIREBIRD_CFLAGS)
8646 AC_SUBST(FIREBIRD_LIBS)
8647 dnl AC_SUBST([TOMMATH_CFLAGS])
8648 dnl AC_SUBST([TOMMATH_LIBS])
8650 dnl ===================================================================
8651 dnl Check for system curl
8652 dnl ===================================================================
8653 AC_MSG_CHECKING([which libcurl to use])
8654 if test "$with_system_curl" = "auto"; then
8657 with_system_curl=yes
8660 with_system_curl="$with_system_libs"
8665 if test "$with_system_curl" = "yes"; then
8666 AC_MSG_RESULT([external])
8670 if test "$cross_compiling" = "yes"; then
8671 dnl At least the OBS mingw32-libcurl-devel package
8672 dnl comes with a proper .pc file
8673 PKG_CHECK_MODULES(CURL, libcurl,, [:])
8674 if test -n "$CURL_PKG_ERRORS"; then
8677 curl_version=`$PKG_CONFIG --modversion libcurl`
8680 if test -z "$curl_version"; then
8681 AC_PATH_PROG(CURLCONFIG, curl-config)
8682 if test -z "$CURLCONFIG"; then
8683 AC_MSG_ERROR([install the libcurl development package])
8685 CURL_LIBS=`$CURLCONFIG --libs`
8686 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
8687 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
8690 AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
8692 case $curl_version in
8693 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
8694 dnl so they need to be doubled to end up in the configure script
8695 7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
8696 AC_MSG_RESULT([yes, you have $curl_version])
8699 AC_MSG_ERROR([no, you have $curl_version])
8703 libo_MINGW_CHECK_DLL([libcurl])
8704 libo_MINGW_TRY_DLL([libintl])
8705 libo_MINGW_TRY_DLL([libidn])
8706 libo_MINGW_TRY_DLL([libnspr4])
8707 libo_MINGW_TRY_DLL([nssutil3])
8708 libo_MINGW_TRY_DLL([libplc4])
8709 libo_MINGW_TRY_DLL([libplds4])
8710 libo_MINGW_TRY_DLL([nss3])
8711 libo_MINGW_TRY_DLL([ssl3])
8712 libo_MINGW_TRY_DLL([libgpg-error])
8713 libo_MINGW_TRY_DLL([libgcrypt])
8714 libo_MINGW_TRY_DLL([libssh2])
8716 AC_MSG_RESULT([internal])
8718 BUILD_TYPE="$BUILD_TYPE CURL"
8720 AC_SUBST(SYSTEM_CURL)
8721 AC_SUBST(CURL_CFLAGS)
8724 dnl ===================================================================
8725 dnl Check for system boost
8726 dnl ===================================================================
8727 AC_MSG_CHECKING([which boost to use])
8728 if test "$with_system_boost" = "yes"; then
8729 AC_MSG_RESULT([external])
8733 mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
8734 libo_MINGW_TRY_DLL([$mingw_boost_date_time_dll])
8735 if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
8736 # if not found, try again with 'lib' prefix
8737 libo_MINGW_CHECK_DLL([lib$mingw_boost_date_time_dll])
8740 save_CXXFLAGS=$CXXFLAGS
8741 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS"
8742 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
8743 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
8744 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
8745 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
8746 AC_CHECK_HEADER(boost/function.hpp, [],
8747 [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
8748 CXXFLAGS="$CXXFLAGS -fno-exceptions"
8749 AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
8750 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
8751 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
8752 if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
8753 AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
8755 AC_MSG_RESULT([yes])
8757 CXXFLAGS=$save_CXXFLAGS
8760 AC_MSG_RESULT([internal])
8761 BUILD_TYPE="$BUILD_TYPE BOOST"
8764 AC_SUBST(SYSTEM_BOOST)
8766 dnl ===================================================================
8767 dnl Check for system mdds
8768 dnl ===================================================================
8769 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds >= 0.10.3])
8771 dnl ===================================================================
8772 dnl Determine which hash container mdds shall use
8773 dnl ===================================================================
8774 AC_MSG_CHECKING([which hash container mdds shall use])
8775 if test "x$HAVE_CXX11" = "xTRUE" -a "x$SYSTEM_MDDS" = "xYES"; then
8776 MDDS_CPPFLAGS=$CXXFLAGS_CXX11
8777 AC_MSG_RESULT([std::unordered_map])
8779 MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
8780 AC_MSG_RESULT([boost::unordered_map])
8782 AC_SUBST([MDDS_CPPFLAGS])
8784 dnl ===================================================================
8785 dnl Check for system vigra
8786 dnl ===================================================================
8787 AC_MSG_CHECKING([which vigra to use])
8788 if test "$with_system_vigra" = "yes"; then
8789 AC_MSG_RESULT([external])
8792 AC_CHECK_HEADER(vigra/copyimage.hxx, [],
8793 [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
8796 AC_MSG_RESULT([internal])
8797 BUILD_TYPE="$BUILD_TYPE VIGRA"
8800 AC_SUBST(SYSTEM_VIGRA)
8802 dnl ===================================================================
8803 dnl Check for system odbc
8804 dnl ===================================================================
8805 AC_MSG_CHECKING([which odbc headers to use])
8806 if test "$with_system_odbc" = "yes"; then
8807 AC_MSG_RESULT([external])
8808 SYSTEM_ODBC_HEADERS=YES
8810 AC_CHECK_HEADER(sqlext.h, [],
8811 [AC_MSG_ERROR(odbc not found. install odbc)], [])
8812 elif test "$enable_database_connectivity" != yes; then
8813 AC_MSG_RESULT([none])
8815 AC_MSG_RESULT([internal])
8816 SYSTEM_ODBC_HEADERS=NO
8818 AC_SUBST(SYSTEM_ODBC_HEADERS)
8821 dnl ===================================================================
8822 dnl Check for system openldap
8823 dnl ===================================================================
8825 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
8826 AC_MSG_CHECKING([which openldap library to use])
8827 if test "$with_system_openldap" = "yes"; then
8828 AC_MSG_RESULT([external])
8830 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
8831 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8832 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8834 AC_MSG_RESULT([internal])
8836 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
8839 AC_SUBST(SYSTEM_OPENLDAP)
8841 dnl ===================================================================
8842 dnl Check for mozilla ab connectivity for windows
8843 dnl ===================================================================
8845 if test "$_os" = "WINNT"; then
8846 AC_MSG_CHECKING([whether to enable build of Mozilla addressbook connectivity driver for Windows])
8847 if test "$enable_win_mozab_driver" = "yes" -a "$WITH_MINGW" != "YES" ; then
8849 AC_MSG_RESULT([yes, internal (old windows mozab driver)])
8850 BUILD_TYPE="$BUILD_TYPE MOZ"
8851 MSVC80_DLLS="msvcp80.dll msvcr80.dll Microsoft.VC80.CRT.manifest"
8852 MSVC80_DLL_PATH=`cygpath -u "$TARFILE_LOCATION"`
8853 for dll in $MSVC80_DLLS; do
8854 if ! test -f "$MSVC80_DLL_PATH/$dll"; then
8855 AC_MSG_ERROR([can not find $dll in $MSVC80_DLL_PATH needed for the pre-built Mozilla libraries])
8863 AC_SUBST(WITH_MOZAB4WIN)
8864 AC_SUBST(MSVC80_DLLS)
8865 AC_SUBST(MSVC80_DLL_PATH)
8867 dnl ===================================================================
8868 dnl Check for TLS/SSL and cryptographic implementation to use
8869 dnl ===================================================================
8870 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
8871 if test -n "$with_tls"; then
8874 AC_DEFINE(USE_TLS_OPENSSL)
8877 if test "$enable_openssl" != "yes"; then
8878 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
8881 # warn that OpenSSL has been selected but not all TLS code has this option
8882 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS])
8883 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS"
8886 AC_DEFINE(USE_TLS_NSS)
8890 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
8892 nss - Mozilla's Network Security Services (NSS)
8896 elif test $_os = iOS -o $_os = Android; then
8897 # We don't build NSS for iOS and Android
8898 AC_DEFINE(USE_TLS_OPENSSL)
8901 # default to using NSS, it results in smaller oox lib
8902 AC_DEFINE(USE_TLS_NSS)
8905 AC_MSG_RESULT([$TLS])
8908 dnl ===================================================================
8909 dnl Check for system NSS
8910 dnl ===================================================================
8911 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
8912 if test "$with_system_nss" = "yes"; then
8913 libo_MINGW_CHECK_DLL([libnspr4])
8914 libo_MINGW_CHECK_DLL([libplc4])
8915 libo_MINGW_CHECK_DLL([libplds4])
8916 libo_MINGW_CHECK_DLL([nss3])
8917 libo_MINGW_CHECK_DLL([nssutil3])
8918 libo_MINGW_CHECK_DLL([smime3])
8919 libo_MINGW_CHECK_DLL([ssl3])
8922 dnl ===================================================================
8923 dnl Check for system mozilla headers
8924 dnl ===================================================================
8925 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
8926 AC_MSG_CHECKING([which NPAPI headers to use])
8928 if test "$with_system_npapi_headers" = "yes"; then
8929 AC_MSG_RESULT([external])
8930 SYSTEM_NPAPI_HEADERS=YES
8931 # First try npapi-sdk:
8932 PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
8933 # Then go with libxul:
8934 if test "x$LOCATED" != "xyes"; then
8935 PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
8937 if test "x$LOCATED" != "xyes"; then
8938 PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
8940 # if still not found bail out
8941 if test "x$LOCATED" != "xyes"; then
8942 AC_MSG_ERROR([npapi.h header file not found])
8947 CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS"
8948 AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
8953 const char* NPP_GetMIMEDescription(void) { return "foo"; }
8955 [AC_MSG_RESULT([const char*])],
8957 AC_MSG_RESULT([char*])
8958 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
8962 NPAPI_HEADERS_CFLAGS=$(printf '%s' "$NPAPI_HEADERS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
8964 AC_MSG_RESULT([internal])
8965 dnl ...but will not be built/used unless ENABLE_NPAPI_FROM_BROWSER or
8966 dnl ENABLE_NPAPI_INTO_BROWSER is TRUE
8967 SYSTEM_NPAPI_HEADERS=NO
8969 AC_SUBST(NPAPI_HEADERS_CFLAGS)
8970 AC_SUBST(SYSTEM_NPAPI_HEADERS)
8971 AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
8973 dnl ===================================================================
8974 dnl Check for system sane
8975 dnl ===================================================================
8976 AC_MSG_CHECKING([which sane header to use])
8977 if test "$with_system_sane" = "yes"; then
8978 AC_MSG_RESULT([external])
8979 AC_CHECK_HEADER(sane/sane.h, [],
8980 [AC_MSG_ERROR(sane not found. install sane)], [])
8982 AC_MSG_RESULT([internal])
8983 BUILD_TYPE="$BUILD_TYPE SANE"
8986 dnl ===================================================================
8987 dnl Check for system icu
8988 dnl ===================================================================
8995 ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
8996 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8997 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
8998 ICU_RECLASSIFIED_HEBREW_LETTER="YES"
8999 AC_MSG_CHECKING([which icu to use])
9000 if test "$with_system_icu" = "yes"; then
9001 AC_MSG_RESULT([external])
9004 AC_MSG_CHECKING([for unicode/rbbi.h])
9005 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
9008 if test "$cross_compiling" != "yes" -o "$WITH_MINGW" = "yes"; then
9010 if test "$WITH_MINGW" = "yes"; then
9011 ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
9013 AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
9015 AC_MSG_CHECKING([ICU version])
9016 ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
9017 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
9018 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
9020 if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "2" \); then
9021 AC_MSG_RESULT([OK, $ICU_VERSION])
9023 AC_MSG_ERROR([not suitable, only >= 4.2 supported currently])
9027 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
9028 AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
9029 ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
9030 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
9031 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
9032 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
9033 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
9034 AC_MSG_RESULT([yes])
9037 if test "$with_system_icu_for_build" != "force"; then
9038 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
9039 You can use --with-system-icu-for-build=force to use it anyway.])
9044 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9045 # using the system icu tools can lead to version confusion, use the
9046 # ones from the build environment when cross-compiling
9047 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9048 if test -z "$SYSTEM_GENBRK"; then
9049 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9051 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9052 if test -z "$SYSTEM_GENCCODE"; then
9053 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9055 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9056 if test -z "$SYSTEM_GENCMN"; then
9057 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9059 if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4" \); then
9060 ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
9062 ICU_RECLASSIFIED_CLOSE_PARENTHESIS="NO"
9064 if test "$ICU_MAJOR" -ge "49"; then
9065 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
9066 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
9067 ICU_RECLASSIFIED_HEBREW_LETTER="YES"
9069 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO"
9070 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="NO"
9071 ICU_RECLASSIFIED_HEBREW_LETTER="NO"
9075 if test "$cross_compiling" = "yes"; then
9076 if test "$ICU_MAJOR" -ge "50"; then
9077 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9082 libo_MINGW_CHECK_DLL([icudata][$ICU_MAJOR][$ICU_MINOR])
9083 libo_MINGW_CHECK_DLL([icui18n][$ICU_MAJOR][$ICU_MINOR])
9084 libo_MINGW_CHECK_DLL([icuuc][$ICU_MAJOR][$ICU_MINOR])
9086 AC_MSG_RESULT([internal])
9088 BUILD_TYPE="$BUILD_TYPE ICU"
9089 # surprisingly set these only for "internal" (to be used by various other
9090 # external libs): the system icu-config is quite unhelpful and spits out
9091 # dozens of weird flags and also default path -I/usr/include
9092 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9093 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9095 AC_SUBST(SYSTEM_ICU)
9096 AC_SUBST(SYSTEM_GENBRK)
9097 AC_SUBST(SYSTEM_GENCCODE)
9098 AC_SUBST(SYSTEM_GENCMN)
9101 AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
9102 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9103 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9104 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9105 AC_SUBST(ICU_CFLAGS)
9108 dnl ===================================================================
9110 dnl ===================================================================
9112 AC_MSG_CHECKING([whether to enable graphite support])
9113 if test $_os != Darwin -a $_os != Android -a $_os != iOS -a \( -z "$enable_graphite" -o "$enable_graphite" != no \); then
9114 AC_MSG_RESULT([yes])
9115 ENABLE_GRAPHITE="TRUE"
9116 AC_DEFINE(ENABLE_GRAPHITE)
9117 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3])
9118 if test "$with_system_graphite" = "yes"; then
9119 libo_MINGW_CHECK_DLL([libgraphite2])
9124 AC_SUBST(ENABLE_GRAPHITE)
9126 dnl ===================================================================
9128 dnl ===================================================================
9130 AC_MSG_CHECKING([whether to enable orcus])
9131 if test -z "$enable_orcus" -o "$enable_orcus" != no; then
9132 AC_MSG_RESULT([yes])
9134 AC_DEFINE(ENABLE_ORCUS)
9136 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.6 >= 0.5.0])
9137 if test "$with_system_orcus" != "yes"; then
9138 if test "$SYSTEM_BOOST" = "YES"; then
9139 # ===========================================================
9140 # Determine if we are going to need to link with Boost.System
9141 # ===========================================================
9142 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9143 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9144 dnl in documentation has no effect.
9145 AC_MSG_CHECKING([if we need to link with Boost.System])
9147 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9148 @%:@include <boost/version.hpp>
9150 #if BOOST_VERSION >= 105000
9151 # error yes, we need to link with Boost.System
9156 AC_MSG_RESULT([yes])
9162 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9163 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9164 AC_SUBST([BOOST_SYSTEM_LIB])
9165 AC_SUBST(SYSTEM_LIBORCUS)
9170 AC_SUBST(ENABLE_ORCUS)
9172 dnl ===================================================================
9174 dnl ===================================================================
9175 AC_MSG_CHECKING([whether to enable HarfBuzz support])
9176 if test $_os != WINNT -a $_os != Darwin -a $_os != iOS; then
9177 AC_MSG_RESULT([yes])
9178 ENABLE_HARFBUZZ="TRUE"
9179 if $PKG_CONFIG --atleast-version 0.9.18 harfbuzz; then
9180 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"])
9182 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz >= 0.9.10],[-I${WORKDIR}/UnpackedTarball/harfbuzz/src],["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz -lharfbuzz-icu"])
9187 AC_SUBST(ENABLE_HARFBUZZ)
9189 dnl ===================================================================
9190 dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
9191 dnl ===================================================================
9192 AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
9193 # Obviously no such thing on iOS or Android. Also not possible when building
9194 # 64-bit OS X code as the plugin code uses QuickTime and Carbon.
9195 if test "$_os" != Android -a "$_os" != iOS -a \( $_os != Darwin -o "$BITNESS_OVERRIDE" = "" \) -a \
9196 "$enable_headless" != yes -a "$enable_mpl_subset" != yes
9198 AC_MSG_RESULT([yes])
9199 ENABLE_NPAPI_FROM_BROWSER=TRUE
9202 ENABLE_NPAPI_FROM_BROWSER=
9204 AC_SUBST(ENABLE_NPAPI_FROM_BROWSER)
9206 dnl ===================================================================
9207 dnl Check for NPAPI interface to plug LibreOffice into browser windows
9208 dnl ===================================================================
9209 AC_MSG_CHECKING([whether to plug LibreOffice into browser windows])
9210 if test "$enable_mpl_subset" != yes -a \( "$_os" = WINNT -o "$_os" != Android -a "$_os" != Darwin -a "$_os" != iOS -a \
9211 "$enable_headless" != yes -a "$enable_gtk" != no \)
9213 AC_MSG_RESULT([yes])
9214 ENABLE_NPAPI_INTO_BROWSER=TRUE
9217 ENABLE_NPAPI_INTO_BROWSER=
9219 AC_SUBST(ENABLE_NPAPI_INTO_BROWSER)
9221 AC_MSG_CHECKING([whether to use X11])
9222 dnl ***************************************
9223 dnl testing for X libraries and includes...
9224 dnl ***************************************
9226 if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
9228 AC_DEFINE(HAVE_FEATURE_X11)
9230 AC_MSG_RESULT([$WANT_X11])
9232 if test "$WANT_X11" = "yes"; then
9235 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9237 if test -z "$x_includes"; then
9238 x_includes="default_x_includes"
9240 if test -z "$x_libraries"; then
9241 x_libraries="default_x_libraries"
9243 CFLAGS="$CFLAGS $X_CFLAGS"
9244 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9245 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9247 x_includes="no_x_includes"
9248 x_libraries="no_x_libraries"
9251 if test "$WANT_X11" = "yes"; then
9252 dnl ===================================================================
9253 dnl Check for Composite.h for Mozilla plugin
9254 dnl ===================================================================
9255 AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
9256 [#include <X11/Intrinsic.h>])
9258 # ENABLE_NPAPI_FROM_BROWSER requires Xt library
9259 AC_CHECK_LIB([Xt], [XtToolkitInitialize], [:],
9260 [AC_MSG_ERROR(Xt library not found)])
9262 dnl ===================================================================
9263 dnl Check for extension headers
9264 dnl ===================================================================
9265 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9266 [#include <X11/extensions/shape.h>])
9268 # vcl needs ICE and SM
9269 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9270 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9271 [AC_MSG_ERROR(ICE library not found)])
9272 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9273 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9274 [AC_MSG_ERROR(SM library not found)])
9277 dnl ===================================================================
9278 dnl Check for system Xrender
9279 dnl ===================================================================
9280 AC_MSG_CHECKING([whether to use Xrender])
9281 if test "$WANT_X11" = "yes" -a "$test_xrender" = "yes"; then
9282 AC_MSG_RESULT([yes])
9283 PKG_CHECK_MODULES(XRENDER, xrender)
9284 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9285 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9286 [AC_MSG_ERROR(libXrender not found or functional)], [])
9287 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9288 [AC_MSG_ERROR(Xrender not found. install X)], [])
9292 AC_SUBST(XRENDER_CFLAGS)
9293 AC_SUBST(XRENDER_LIBS)
9295 dnl ===================================================================
9296 dnl Check for XRandr
9297 dnl ===================================================================
9298 AC_MSG_CHECKING([whether to enable RandR support])
9299 if test "$WANT_X11" = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9300 if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
9301 XRANDR_DLOPEN="TRUE"
9302 AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
9304 AC_MSG_RESULT([yes])
9305 XRANDR_DLOPEN="FALSE"
9306 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9307 if test "$ENABLE_RANDR" != "TRUE"; then
9308 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9309 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9311 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9312 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9313 XRANDR_LIBS="-lXrandr "
9316 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9322 AC_SUBST(XRANDR_DLOPEN)
9323 AC_SUBST(XRANDR_CFLAGS)
9324 AC_SUBST(XRANDR_LIBS)
9325 AC_SUBST(ENABLE_RANDR)
9327 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9330 if test $_os = iOS -o $_os = Android; then
9333 AC_MSG_CHECKING([for webdav library])
9334 case "$WITH_WEBDAV" in
9336 AC_MSG_RESULT([serf])
9337 # Check for system apr-util
9338 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9339 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9340 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9341 if test "$COM" = "MSC"; then
9343 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9344 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9347 # Check for system serf
9348 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9349 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9350 if test "$COM" = "MSC"; then
9351 SERF_LIB_DIR="Release"
9352 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9353 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9357 AC_MSG_RESULT([neon])
9358 # Check for system neon
9359 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9360 if test "$with_system_neon" = "yes"; then
9361 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9362 libo_MINGW_CHECK_DLL([libneon])
9363 libo_MINGW_TRY_DLL([libtasn1])
9364 libo_MINGW_TRY_DLL([libgnutls])
9366 SCPDEFS="$SCPDEFS -DNEED_NEON"
9369 AC_SUBST(NEON_VERSION)
9372 AC_MSG_RESULT([none, disabled])
9376 AC_SUBST(WITH_WEBDAV)
9378 dnl ===================================================================
9379 dnl Check for disabling cve_tests
9380 dnl ===================================================================
9381 AC_MSG_CHECKING([whether to execute CVE tests])
9382 if test "$enable_cve_tests" = "no"; then
9384 DISABLE_CVE_TESTS=TRUE
9385 AC_SUBST(DISABLE_CVE_TESTS)
9387 AC_MSG_RESULT([yes])
9390 dnl ===================================================================
9391 dnl Check for system openssl
9392 dnl ===================================================================
9394 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9395 if test "$enable_openssl" = "yes"; then
9397 if test "$_os" = Darwin -a "${MAC_OS_X_VERSION_MIN_REQUIRED:-0}" -ge 1070; then
9398 # OpenSSL is deprecated when building for 10.7 or later.
9400 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9401 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9403 # They apparently got fed up with the unstable ABI of
9404 # OpenSSL, or something, and recommend you either move to
9405 # their "Common Crypto Architecture", or, if you have to stay
9406 # with OpenSSL, just build it yourself statically and bundle
9407 # with your application.
9409 with_system_openssl=no
9410 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9411 elif test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
9412 "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
9413 # Mac OS builds should get out without extra stuff is the Mac porters'
9414 # wish. And pkg-config is although Xcode ships a .pc for openssl
9415 with_system_openssl=yes
9418 OPENSSL_LIBS="-lssl -lcrypto"
9420 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9422 if test "$with_system_openssl" = "yes"; then
9423 libo_MINGW_CHECK_DLL([libssl])
9424 libo_MINGW_CHECK_DLL([libcrypto])
9425 AC_MSG_CHECKING([whether openssl supports SHA512])
9427 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9429 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9433 AC_MSG_RESULT([yes])
9434 DISABLE_OPENSSL=TRUE
9436 # warn that although OpenSSL is disabled, system libraries may be depending on it
9437 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9438 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9441 AC_SUBST([DISABLE_OPENSSL])
9443 dnl ===================================================================
9444 dnl Check for building gnutls
9445 dnl ===================================================================
9446 AC_MSG_CHECKING([whether to use gnutls])
9447 if test "$WITH_WEBDAV" = "neon" && test "$enable_openssl" = "no"; then
9448 AC_MSG_RESULT([yes])
9450 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9451 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9452 available in the system to use as replacement.]]))
9455 AC_SUBST([LIBGCRYPT_CFLAGS])
9456 AC_SUBST([LIBGCRYPT_LIBS])
9458 dnl ===================================================================
9459 dnl Check for system redland
9460 dnl ===================================================================
9461 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9462 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9463 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9464 if test "$with_system_redland" = "yes"; then
9465 libo_MINGW_CHECK_DLL([librdf])
9466 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9467 [AC_MSG_ERROR(librdf too old. Need >= 1.16)], [])
9468 libo_MINGW_TRY_DLL([libraptor])
9469 libo_MINGW_TRY_DLL([librasqal])
9470 libo_MINGW_TRY_DLL([libsqlite3])
9476 AC_SUBST(RAPTOR_MAJOR)
9477 AC_SUBST(RASQAL_MAJOR)
9478 AC_SUBST(REDLAND_MAJOR)
9480 dnl ===================================================================
9481 dnl Check for system hunspell
9482 dnl ===================================================================
9483 AC_MSG_CHECKING([which libhunspell to use])
9484 if test "$with_system_hunspell" = "yes"; then
9485 AC_MSG_RESULT([external])
9488 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9489 if test "$HUNSPELL_PC" != "TRUE"; then
9490 AC_CHECK_HEADER(hunspell.hxx, [],
9492 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9493 [AC_MSG_ERROR(hunspell headers not found.)], [])
9495 AC_CHECK_LIB([hunspell], [main], [:],
9496 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9497 HUNSPELL_LIBS=-lhunspell
9500 libo_MINGW_CHECK_DLL([libhunspell-1.3])
9501 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9503 AC_MSG_RESULT([internal])
9505 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9506 if test "$COM" = "MSC"; then
9507 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9509 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.3"
9511 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9513 AC_SUBST(SYSTEM_HUNSPELL)
9514 AC_SUBST(HUNSPELL_CFLAGS)
9515 AC_SUBST(HUNSPELL_LIBS)
9517 dnl ===================================================================
9518 dnl Checking for altlinuxhyph
9519 dnl ===================================================================
9520 AC_MSG_CHECKING([which altlinuxhyph to use])
9521 if test "$with_system_altlinuxhyph" = "yes"; then
9522 AC_MSG_RESULT([external])
9524 AC_CHECK_HEADER(hyphen.h, [],
9525 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9526 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9527 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9528 [#include <hyphen.h>])
9529 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9530 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9531 if test -z "$HYPHEN_LIB"; then
9532 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9533 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9535 if test -z "$HYPHEN_LIB"; then
9536 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9537 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9539 libo_MINGW_CHECK_DLL([libhyphen])
9541 AC_MSG_RESULT([internal])
9543 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9544 if test "$COM" = "MSC"; then
9545 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9547 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9550 AC_SUBST(SYSTEM_HYPH)
9551 AC_SUBST(HYPHEN_LIB)
9553 dnl ===================================================================
9554 dnl Checking for mythes
9555 dnl ===================================================================
9556 AC_MSG_CHECKING([which mythes to use])
9557 if test "$with_system_mythes" = "yes"; then
9558 AC_MSG_RESULT([external])
9561 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9562 if test "$MYTHES_PKGCONFIG" = "no"; then
9563 AC_CHECK_HEADER(mythes.hxx, [],
9564 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9565 AC_CHECK_LIB([mythes-1.2], [main], [:],
9566 [ MYTHES_FOUND=no], [])
9567 if test "$MYTHES_FOUND" = "no"; then
9568 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9569 [ MYTHES_FOUND=no], [])
9571 if test "$MYTHES_FOUND" = "no"; then
9572 AC_MSG_ERROR([mythes library not found!.])
9576 libo_MINGW_CHECK_DLL([libmythes-1.2])
9577 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9579 AC_MSG_RESULT([internal])
9581 BUILD_TYPE="$BUILD_TYPE MYTHES"
9582 if test "$COM" = "MSC"; then
9583 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9585 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9588 AC_SUBST(SYSTEM_MYTHES)
9589 AC_SUBST(MYTHES_CFLAGS)
9590 AC_SUBST(MYTHES_LIBS)
9592 dnl ===================================================================
9593 dnl How should we build the linear programming solver ?
9594 dnl ===================================================================
9597 AC_MSG_CHECKING([whether to build with CoinMP])
9598 if test "$enable_coinmp" != "no"; then
9600 AC_MSG_RESULT([yes])
9601 # Should we check for system CoinMP ? How to do that ?
9602 BUILD_TYPE="$BUILD_TYPE COINMP"
9606 AC_SUBST(ENABLE_COINMP)
9609 AC_MSG_CHECKING([whether to build with lpsolve])
9610 if test "$enable_lpsolve" != "no"; then
9612 AC_MSG_RESULT([yes])
9616 AC_SUBST(ENABLE_LPSOLVE)
9618 AC_MSG_CHECKING([which lpsolve to use])
9619 if test "$with_system_lpsolve" = "yes"; then
9620 AC_MSG_RESULT([external])
9622 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9623 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9625 # some systems need this. Like Ubuntu....
9626 AC_CHECK_LIB(m, floor)
9627 AC_CHECK_LIB(dl, dlopen)
9628 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9629 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9631 libo_MINGW_CHECK_DLL([lpsolve55])
9633 AC_MSG_RESULT([internal])
9635 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9637 AC_SUBST(SYSTEM_LPSOLVE)
9641 dnl ===================================================================
9642 dnl Checking for libexttextcat
9643 dnl ===================================================================
9644 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.1.1])
9645 if test "$with_system_libexttextcat" = "yes"; then
9646 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9648 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9650 dnl ***************************************
9651 dnl testing libc version for Linux...
9652 dnl ***************************************
9653 if test "$_os" = "Linux"; then
9654 AC_MSG_CHECKING([whether libc is >= 2.1.1])
9655 exec 6>/dev/null # no output
9656 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
9657 exec 6>&1 # output on again
9658 if test "$HAVE_LIBC"; then
9659 AC_MSG_RESULT([yes])
9661 AC_MSG_ERROR([no, upgrade libc])
9665 dnl =========================================
9666 dnl Check for the Windows SDK.
9667 dnl =========================================
9668 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
9669 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
9670 if test "$_os" = "WINNT"; then
9671 AC_MSG_CHECKING([for Windows SDK])
9672 if test "$build_os" = "cygwin"; then
9674 WINDOWS_SDK_HOME=$winsdktest
9676 # normalize if found
9677 if test -n "$WINDOWS_SDK_HOME"; then
9678 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
9679 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
9683 if test -n "$WINDOWS_SDK_HOME"; then
9684 # Remove a possible trailing backslash
9685 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
9687 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
9688 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
9689 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
9690 have_windows_sdk_headers=yes
9691 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
9692 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
9693 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
9694 have_windows_sdk_headers=yes
9696 have_windows_sdk_headers=no
9699 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
9700 have_windows_sdk_libs=yes
9701 elif test -f "$WINDOWS_SDK_HOME/lib/win8/um/$WINDOWS_SDK_ARCH/user32.lib"; then
9702 have_windows_sdk_libs=yes
9704 have_windows_sdk_libs=no
9707 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
9708 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
9709 the Windows SDK are installed.])
9712 if test ! -f "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
9713 -o ! -f "$WINDOWS_SDK_HOME/bin/msidb.exe" \
9714 -o ! -f "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
9715 -o ! -f "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
9716 elif test ! -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
9717 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
9718 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
9719 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
9721 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
9725 if test -z "$WINDOWS_SDK_HOME"; then
9726 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
9727 elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
9728 WINDOWS_SDK_VERSION=60
9729 AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
9730 elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
9731 WINDOWS_SDK_VERSION=61
9732 AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
9733 elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
9734 WINDOWS_SDK_VERSION=70
9735 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
9736 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
9737 WINDOWS_SDK_VERSION=80
9738 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
9739 # compatibility warning if usind VS 2012 and not explicitly choosing the 80 SDK
9740 if test "$VCVER" = "110" -a -z "$with_windows_sdk"; then
9741 AC_MSG_WARN([If a build created with VS 2012 should run on Windows XP,])
9742 AC_MSG_WARN([use --with-windows-sdk=7.1A (requires VS 2012 Update 1 or newer)])
9743 add_warning "If a build created with VS 2012 should run on Windows XP,"
9744 add_warning "use --with-windows-sdk=7.1A (requires VS 2012 Update 1 or newer)"
9747 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
9749 PathFormat "$WINDOWS_SDK_HOME"
9750 WINDOWS_SDK_HOME="$formatted_path"
9751 if test "$build_os" = "cygwin"; then
9752 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
9753 if test -d "$WINDOWS_SDK_HOME/include/um"; then
9754 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
9758 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
9759 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
9760 dnl but not in v8.0), so allow this to be overriden with a
9761 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
9762 dnl and configuration error if no WiLangId.vbs is found would arguably be
9763 dnl better, but I do not know under which conditions exactly it is needed by
9765 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
9766 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
9767 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9768 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
9770 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9771 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.0/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
9773 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9774 AC_MSG_WARN([WiLangId.vbs not found - building translated packages will fail])
9775 add_warning "WiLangId.vbs not found - building translated packages will fail"
9779 AC_SUBST(WINDOWS_SDK_HOME)
9780 AC_SUBST(WINDOWS_SDK_VERSION)
9781 AC_SUBST(WINDOWS_SDK_WILANGID)
9783 dnl =========================================
9784 dnl Check for uuidgen
9785 dnl =========================================
9786 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9787 if test "$WITH_MINGW" = "yes"; then
9788 AC_PATH_PROG([UUIDGEN], [uuid])
9789 if test -z "$UUIDGEN"; then
9790 AC_MSG_WARN([uuid is needed for dev-install])
9793 # presence is already tested above in the WINDOWS_SDK_HOME check
9798 AC_PATH_PROG([UUIDGEN], [uuidgen])
9799 if test -z "$UUIDGEN"; then
9800 AC_MSG_WARN([uuid is needed for dev-install])
9804 dnl =========================================
9805 dnl Check for the Microsoft DirectX SDK.
9806 dnl =========================================
9807 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
9808 AC_MSG_CHECKING([for DirectX SDK])
9809 if test "$build_os" = "cygwin"; then
9810 dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
9811 if test -n "$DXSDK_DIR"; then
9812 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
9813 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
9815 # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
9816 # the "DirectX SDK not found" error later.
9819 # Remove a possible trailing backslash
9820 DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
9823 if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h"; then
9824 HAVE_DIRECTXSDK_H="yes"
9826 HAVE_DIRECTXSDK_H="no"
9829 if test "$BITNESS_OVERRIDE" = 64; then
9830 DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x64"
9832 DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
9834 PathFormat "$DIRECTXSDK_LIB"
9835 DIRECTXSDK_LIB="$formatted_path"
9837 if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib"; then
9838 HAVE_DIRECTXSDK_LIB="yes"
9840 HAVE_DIRECTXSDK_LIB="no"
9843 if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
9844 AC_MSG_RESULT([found])
9846 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
9848 if test -n "$DIRECTXSDK_HOME"; then
9849 PathFormat "$DIRECTXSDK_HOME"
9850 DIRECTXSDK_HOME="$formatted_path"
9851 SOLARINC="$SOLARINC -I$DIRECTXSDK_HOME/include"
9854 AC_SUBST(DIRECTXSDK_HOME)
9856 dnl ***************************************
9857 dnl Checking for bison and flex
9858 dnl ***************************************
9859 AC_PATH_PROG(BISON, bison)
9860 if test -z "$BISON"; then
9861 AC_MSG_ERROR([no bison found in \$PATH, install it])
9863 AC_MSG_CHECKING([the bison version])
9864 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9865 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9866 # Accept newer than 2.0
9867 if test "$_bison_longver" -lt 2000; then
9868 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
9872 AC_PATH_PROG(FLEX, flex)
9873 if test -z "$FLEX"; then
9874 AC_MSG_ERROR([no flex found in \$PATH, install it])
9876 AC_MSG_CHECKING([the flex version])
9877 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
9878 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
9879 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
9883 dnl ***************************************
9884 dnl Checking for patch
9885 dnl ***************************************
9886 AC_PATH_PROG(PATCH, patch)
9887 if test -z "$PATCH"; then
9888 AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
9891 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9892 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9893 if test -z "$with_gnu_patch"; then
9896 if test -x "$with_gnu_patch"; then
9897 GNUPATCH=$with_gnu_patch
9899 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9903 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9904 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9905 AC_MSG_RESULT([yes])
9907 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9913 dnl We also need to check for --with-gnu-cp
9915 if test -z "$with_gnu_cp"; then
9916 # check the place where the good stuff is hidden on Solaris...
9917 if test -x /usr/gnu/bin/cp; then
9918 GNUCP=/usr/gnu/bin/cp
9920 AC_PATH_PROGS(GNUCP, gnucp cp)
9922 if test -z $GNUCP; then
9923 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9926 if test -x "$with_gnu_cp"; then
9929 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9933 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9934 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9935 AC_MSG_RESULT([yes])
9936 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9937 AC_MSG_RESULT([yes])
9940 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9943 AC_MSG_RESULT([no gnucp found - using the system's cp command])
9946 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9955 dnl ***************************************
9956 dnl testing assembler path
9957 dnl ***************************************
9959 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
9960 if test "$BITNESS_OVERRIDE" = ""; then
9965 assembler_bin=bin/amd64
9968 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
9969 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
9970 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
9971 AC_MSG_RESULT([found])
9972 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
9974 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9977 PathFormat "$ASM_HOME"
9978 ASM_HOME="$formatted_path"
9985 dnl ===================================================================
9986 dnl We need zip and unzip
9987 dnl ===================================================================
9988 AC_PATH_PROG(ZIP, zip)
9989 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9990 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9991 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],,)
9994 AC_PATH_PROG(UNZIP, unzip)
9995 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9997 dnl ===================================================================
9998 dnl Zip must be a specific type for different build types.
9999 dnl ===================================================================
10000 if test $build_os = cygwin; then
10001 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10002 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10006 dnl ===================================================================
10007 dnl Test which vclplugs have to be built.
10008 dnl ===================================================================
10013 if test "x$enable_gtk3" = "xyes"; then
10014 if test "$with_system_cairo" = no; then
10015 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10017 : ${with_system_cairo:=yes}
10018 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="")
10019 if test "x$ENABLE_GTK3" = "xTRUE"; then
10022 AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
10024 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10026 AC_SUBST(GTK3_LIBS)
10027 AC_SUBST(GTK3_CFLAGS)
10028 AC_SUBST(ENABLE_GTK3)
10030 AC_MSG_CHECKING([which VCLplugs shall be built])
10031 if test "$GUIBASE" != "unx" -o "$enable_headless" = "yes"; then
10035 if test "x$enable_gtk" = "xyes"; then
10036 if test "$with_system_cairo" = no; then
10037 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10039 : ${with_system_cairo:=yes}
10041 AC_DEFINE(ENABLE_GTK)
10044 AC_SUBST(ENABLE_GTK)
10047 if test "x$enable_tde" = "xyes"; then
10048 # Libs kab and tdeab in connectivity and kdeab and tdeab in shell
10049 # are built from the same sources. So we only allow one of them.
10050 if test "x$enable_kde" = "xyes"; then
10051 AC_MSG_ERROR([enabling both KDE and TDE is not supported])
10054 AC_DEFINE(ENABLE_TDE)
10057 AC_SUBST(ENABLE_TDE)
10060 if test "x$enable_kde" = "xyes"; then
10062 AC_DEFINE(ENABLE_KDE)
10065 AC_SUBST(ENABLE_KDE)
10068 if test "x$enable_kde4" = "xyes"; then
10070 AC_DEFINE(ENABLE_KDE4)
10073 AC_SUBST(ENABLE_KDE4)
10076 if test "x$enable_headless" = "xyes"; then
10077 ENABLE_HEADLESS="TRUE"
10078 SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
10081 AC_SUBST(ENABLE_HEADLESS)
10083 if test -z "$R"; then
10084 AC_MSG_RESULT([none])
10086 AC_MSG_RESULT([$R])
10089 dnl ===================================================================
10091 dnl ===================================================================
10094 AC_MSG_CHECKING([whether to enable GConf support])
10095 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "iOS" -a "$enable_gconf" = "yes"; then
10096 ENABLE_GCONF="TRUE"
10097 AC_MSG_RESULT([yes])
10098 PKG_CHECK_MODULES( GCONF, gconf-2.0 gobject-2.0 )
10099 GCONF_CFLAGS=$(printf '%s' "$GCONF_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10101 AC_MSG_RESULT([no])
10103 AC_SUBST(GCONF_LIBS)
10104 AC_SUBST(GCONF_CFLAGS)
10105 AC_SUBST(ENABLE_GCONF)
10107 dnl ===================================================================
10108 dnl Gnome VFS check
10109 dnl ===================================================================
10112 AC_MSG_CHECKING([whether to enable GNOME VFS support])
10113 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
10114 ENABLE_GNOMEVFS="TRUE"
10115 AC_MSG_RESULT([yes])
10116 PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
10117 GNOMEVFS_CFLAGS=$(printf '%s' "$GNOMEVFS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10118 AC_DEFINE(ENABLE_GNOME_VFS)
10120 AC_MSG_RESULT([no])
10122 AC_SUBST(GNOMEVFS_LIBS)
10123 AC_SUBST(GNOMEVFS_CFLAGS)
10124 AC_SUBST(ENABLE_GNOMEVFS)
10126 dnl ===================================================================
10127 dnl check for dbus support
10128 dnl ===================================================================
10133 if test "$enable_dbus" = "no"; then
10137 AC_MSG_CHECKING([whether to enable DBUS support])
10138 if test "$test_dbus" = "yes"; then
10140 AC_MSG_RESULT([yes])
10141 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
10142 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10144 AC_MSG_RESULT([no])
10147 AC_SUBST(ENABLE_DBUS)
10148 AC_SUBST(DBUS_CFLAGS)
10149 AC_SUBST(DBUS_LIBS)
10151 AC_MSG_CHECKING([whether to enable font install via packagekit])
10152 if test "$ENABLE_DBUS" = "TRUE"; then
10153 if test -n "$enable_packagekit" -a "$enable_packagekit" != "no"; then
10154 ENABLE_PACKAGEKIT=TRUE
10155 AC_MSG_RESULT([yes])
10158 AC_MSG_RESULT([no])
10161 AC_MSG_RESULT([no, dbus disabled.])
10163 AC_SUBST(ENABLE_PACKAGEKIT)
10165 AC_MSG_CHECKING([whether to enable Impress remote control])
10166 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10167 AC_MSG_RESULT([yes])
10168 ENABLE_SDREMOTE=TRUE
10169 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10171 # If not explicitly enabled or disabled, default
10172 if test -z "$enable_sdremote_bluetooth"; then
10175 # Default to yes for these
10176 enable_sdremote_bluetooth=yes
10180 enable_sdremote_bluetooth=no
10184 # $enable_sdremote_bluetooth is guaranteed non-empty now
10186 if test "$enable_sdremote_bluetooth" != "no"; then
10187 if test "$OS" = "LINUX"; then
10188 if test "$ENABLE_DBUS" = "TRUE"; then
10189 AC_MSG_RESULT([yes])
10190 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10191 dnl ===================================================================
10192 dnl Check for system bluez
10193 dnl ===================================================================
10194 AC_MSG_CHECKING([which Bluetooth header to use])
10195 if test "$with_system_bluez" = "yes"; then
10196 AC_MSG_RESULT([external])
10197 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10198 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10201 AC_MSG_RESULT([internal])
10205 AC_MSG_RESULT([no, dbus disabled])
10206 ENABLE_SDREMOTE_BLUETOOTH=
10210 AC_MSG_RESULT([yes])
10211 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10215 AC_MSG_RESULT([no])
10216 ENABLE_SDREMOTE_BLUETOOTH=
10222 AC_MSG_RESULT([no])
10224 AC_SUBST(ENABLE_SDREMOTE)
10225 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10226 AC_SUBST(SYSTEM_BLUEZ)
10228 AC_MSG_CHECKING([whether to enable Impress remote control android app])
10229 if echo "$host_os" | grep -q linux-android || test "$enable_sdremote_android" = "yes"; then
10230 AC_MSG_RESULT([yes])
10231 ENABLE_SDREMOTE_ANDROID=TRUE
10233 AC_MSG_RESULT([no])
10234 ENABLE_SDREMOTE_ANDROID=
10236 AC_SUBST(ENABLE_SDREMOTE_ANDROID)
10238 dnl ===================================================================
10239 dnl Check whether the gtk 2.0 libraries are available.
10240 dnl ===================================================================
10244 ENABLE_SYSTRAY_GTK=""
10245 if test "$test_gtk" = "yes"; then
10247 if test "$ENABLE_GTK" = "TRUE"; then
10248 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]))
10249 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10250 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]))
10251 BUILD_TYPE="$BUILD_TYPE GTK"
10252 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10254 AC_MSG_CHECKING([whether to enable the systray quickstarter])
10255 if test "x$enable_systray" = "xyes"; then
10256 AC_MSG_RESULT([yes])
10257 PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
10258 [ ENABLE_SYSTRAY_GTK="TRUE" ],
10259 [ ENABLE_SYSTRAY_GTK="" ])
10261 AC_MSG_RESULT([no])
10264 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10265 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10266 [ENABLE_GTK_PRINT="TRUE"],
10267 [ENABLE_GTK_PRINT=""])
10268 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10270 AC_MSG_CHECKING([whether to enable GIO support])
10271 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10272 if test "$ENABLE_GNOMEVFS" = "TRUE"; then
10273 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
10275 dnl Need at least 2.26 for the dbus support.
10276 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10277 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10278 if test "$ENABLE_GIO" = "TRUE"; then
10279 AC_DEFINE(ENABLE_GIO)
10280 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10283 AC_MSG_RESULT([no])
10287 AC_SUBST(ENABLE_GIO)
10288 AC_SUBST(GIO_CFLAGS)
10290 AC_SUBST(ENABLE_SYSTRAY_GTK)
10291 AC_SUBST(GTK_CFLAGS)
10293 AC_SUBST(GTHREAD_CFLAGS)
10294 AC_SUBST(GTHREAD_LIBS)
10295 AC_SUBST([ENABLE_GTK_PRINT])
10296 AC_SUBST([GTK_PRINT_CFLAGS])
10297 AC_SUBST([GTK_PRINT_LIBS])
10300 dnl ===================================================================
10301 dnl Check whether the Telepathy libraries are available.
10302 dnl ===================================================================
10304 ENABLE_TELEPATHY=""
10305 TELEPATHY_CFLAGS=""
10308 AC_MSG_CHECKING([whether to enable Telepathy support])
10309 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
10310 ENABLE_TELEPATHY="TRUE"
10311 AC_DEFINE(ENABLE_TELEPATHY)
10312 AC_MSG_RESULT([yes])
10313 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 )
10314 TELEPATHY_CFLAGS=$(printf '%s' "$TELEPATHY_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10316 AC_MSG_RESULT([no])
10319 AC_SUBST(ENABLE_TELEPATHY)
10320 AC_SUBST(TELEPATHY_CFLAGS)
10321 AC_SUBST(TELEPATHY_LIBS)
10324 dnl ===================================================================
10326 SPLIT_APP_MODULES=""
10327 if test "$enable_split_app_modules" = "yes"; then
10328 SPLIT_APP_MODULES="YES"
10330 AC_SUBST(SPLIT_APP_MODULES)
10332 SPLIT_OPT_FEATURES=""
10333 if test "$enable_split_opt_features" = "yes"; then
10334 SPLIT_OPT_FEATURES="YES"
10336 AC_SUBST(SPLIT_OPT_FEATURES)
10338 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10339 if test "$enable_cairo_canvas" = yes; then
10340 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10342 enable_cairo_canvas=no
10343 elif test -z "$enable_cairo_canvas"; then
10344 enable_cairo_canvas=yes
10347 ENABLE_CAIRO_CANVAS=""
10348 if test "$enable_cairo_canvas" = "yes"; then
10350 ENABLE_CAIRO_CANVAS="TRUE"
10352 AC_SUBST(ENABLE_CAIRO_CANVAS)
10354 dnl ===================================================================
10355 dnl Check whether the GStreamer libraries are available.
10356 dnl ===================================================================
10358 ENABLE_GSTREAMER=""
10360 if test "$build_gstreamer" = "yes"; then
10362 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10363 if test "x$enable_gstreamer" != "xno"; then
10364 ENABLE_GSTREAMER="TRUE"
10365 AC_MSG_RESULT([yes])
10366 PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
10367 GSTREAMER_CFLAGS=$(printf '%s' "$GSTREAMER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10369 AC_MSG_RESULT([no])
10372 AC_SUBST(GSTREAMER_CFLAGS)
10373 AC_SUBST(GSTREAMER_LIBS)
10374 AC_SUBST(ENABLE_GSTREAMER)
10377 ENABLE_GSTREAMER_0_10=""
10378 if test "$build_gstreamer_0_10" = "yes"; then
10380 AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
10381 if test "x$enable_gstreamer_0_10" != "xno"; then
10382 ENABLE_GSTREAMER_0_10="TRUE"
10383 AC_MSG_RESULT([yes])
10384 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
10385 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10] )
10387 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10389 AC_MSG_RESULT([no])
10393 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10394 AC_SUBST(GSTREAMER_0_10_LIBS)
10395 AC_SUBST(ENABLE_GSTREAMER_0_10)
10397 dnl ===================================================================
10398 dnl Check whether to build the VLC avmedia backend
10399 dnl ===================================================================
10403 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10404 if test $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10406 AC_MSG_RESULT([yes])
10408 AC_MSG_RESULT([no])
10410 AC_SUBST(ENABLE_VLC)
10412 dnl ===================================================================
10413 dnl Check whether the OpenGL libraries are available
10414 dnl ===================================================================
10416 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
10419 if test -z "$enable_opengl"; then
10420 if test $_os = WINNT; then
10421 # By default disable the OpenGL transitions for Windows (the code compiles but works very
10422 # badly and crashes). In other words, use --enable-opengl only if you plan to hack on that
10423 # code for Windows.
10425 elif test $_os = iOS; then
10426 # As such with some suitable minor tweaks the Mac OpenGL transitions code would presumably
10427 # build fine for iOS, too, but let's leave that for later
10429 elif test "$enable_headless" = "yes"; then
10436 if test "x$enable_opengl" = "xno"; then
10437 AC_MSG_RESULT([no])
10438 elif test "$_os" = "Darwin"; then
10439 # We use frameworks on Mac OS X, no need for detail checks
10441 ENABLE_OPENGL_CANVAS=
10442 add_warning "openGL canvas not adapted for Mac yet - disabling"
10443 SYSTEM_MESA_HEADERS=YES
10444 AC_MSG_RESULT([yes])
10445 elif test $_os = WINNT; then
10446 # Experimental: try to use OpenGL on Windows
10448 ENABLE_OPENGL_CANVAS=TRUE
10449 # We need the internal "Mesa" headers.
10450 SYSTEM_MESA_HEADERS=NO
10451 BUILD_TYPE="$BUILD_TYPE MESA"
10452 AC_MSG_RESULT([yes])
10454 save_LDFLAGS=$LDFLAGS
10455 LDFLAGS="$LDFLAGS -lm"
10456 AC_MSG_RESULT([yes])
10457 AC_CHECK_LIB([GL], [main],
10458 [AC_CHECK_LIB([GL], [glCreateShader], [ENABLE_OPENGL_CANVAS=TRUE],
10459 [add_warning "no shader support in libGL - will enable openGL transitions, but not openGL canvas"
10460 AC_MSG_WARN([no shader support in libGL - will enable openGL transitions, but not openGL canvas])
10461 ENABLE_OPENGL_CANVAS=], [])],
10462 [AC_MSG_ERROR(libGL not installed or functional)], [])
10463 LDFLAGS="$LDFLAGS -lGL"
10464 AC_CHECK_LIB([GLU], [main], [:],
10465 [AC_MSG_ERROR(libGLU not installed or functional)], [])
10467 LDFLAGS=$save_LDFLAGS
10469 dnl ===================================================================
10470 dnl Check for system Mesa
10471 dnl ===================================================================
10472 AC_MSG_CHECKING([which Mesa headers to use])
10473 if test "$with_system_mesa_headers" = "yes"; then
10474 AC_MSG_RESULT([external])
10475 SYSTEM_MESA_HEADERS=YES
10477 AC_CHECK_HEADER(GL/glxext.h, [],
10478 [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
10479 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
10480 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
10483 AC_MSG_RESULT([internal])
10484 SYSTEM_MESA_HEADERS=NO
10485 BUILD_TYPE="$BUILD_TYPE MESA"
10489 AC_SUBST(SYSTEM_MESA_HEADERS)
10490 AC_SUBST(ENABLE_OPENGL)
10491 AC_SUBST(ENABLE_OPENGL_CANVAS)
10493 dnl =================================================
10494 dnl Check whether to build with OpenCL support.
10495 dnl =================================================
10497 AC_MSG_CHECKING([whether to build with the OpenCL support.])
10500 if test $_os != iOS -a $_os != Android -a "x$enable_opencl" != "xno"; then
10501 AC_MSG_RESULT([yes])
10504 AC_DEFINE(HAVE_FEATURE_OPENCL)
10506 AC_MSG_RESULT([no])
10510 AC_SUBST(ENABLE_OPENCL)
10513 AC_MSG_CHECKING([whether to build the PDF import feature])
10515 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10516 AC_MSG_RESULT([yes])
10517 ENABLE_PDFIMPORT=TRUE
10519 dnl ===================================================================
10520 dnl Check for system poppler
10521 dnl ===================================================================
10522 AC_MSG_CHECKING([which PDF import backend to use])
10523 if test "$with_system_poppler" = "yes"; then
10524 AC_MSG_RESULT([external])
10526 PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
10527 AC_LANG_PUSH([C++])
10528 save_CXXFLAGS=$CXXFLAGS
10529 save_CPPFLAGS=$CPPFLAGS
10530 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10531 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10532 AC_CHECK_HEADER([cpp/poppler-version.h], [],
10533 [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
10534 CXXFLAGS=$save_CXXFLAGS
10535 CPPFLAGS=$save_CPPFLAGS
10537 libo_MINGW_CHECK_DLL([libpoppler])
10538 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10540 AC_MSG_RESULT([internal])
10542 BUILD_TYPE="$BUILD_TYPE POPPLER"
10545 AC_MSG_RESULT([no])
10547 AC_SUBST(ENABLE_PDFIMPORT)
10548 AC_SUBST(SYSTEM_POPPLER)
10549 AC_SUBST(POPPLER_CFLAGS)
10550 AC_SUBST(POPPLER_LIBS)
10552 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10553 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10554 AC_MSG_RESULT([yes])
10555 ENABLE_MEDIAWIKI=TRUE
10556 BUILD_TYPE="$BUILD_TYPE XSLTML"
10557 if test "x$with_java" = "xno"; then
10558 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10561 AC_MSG_RESULT([no])
10563 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10565 AC_SUBST(ENABLE_MEDIAWIKI)
10567 AC_MSG_CHECKING([whether to build the Report Builder])
10568 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10569 AC_MSG_RESULT([yes])
10570 ENABLE_REPORTBUILDER=TRUE
10571 AC_MSG_CHECKING([which jfreereport libs to use])
10572 if test "$with_system_jfreereport" = "yes"; then
10573 SYSTEM_JFREEREPORT=YES
10574 AC_MSG_RESULT([external])
10575 if test -z $SAC_JAR; then
10576 SAC_JAR=/usr/share/java/sac.jar
10578 AC_CHECK_FILE($SAC_JAR, [],
10579 [AC_MSG_ERROR(sac.jar not found.)], [])
10581 if test -z $LIBXML_JAR; then
10582 AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
10583 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
10585 AC_CHECK_FILE(/usr/share/java/libxml.jar,
10586 [ LIBXML_JAR=/usr/share/java/libxml.jar ],
10587 [AC_MSG_ERROR(libxml.jar replacement not found.)]
10592 AC_CHECK_FILE($LIBXML_JAR, [],
10593 [AC_MSG_ERROR(libxml.jar not found.)], [])
10596 if test -z $FLUTE_JAR; then
10597 AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
10598 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
10600 AC_CHECK_FILE(/usr/share/java/flute.jar,
10601 [ FLUTE_JAR=/usr/share/java/flute.jar ],
10602 [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
10607 AC_CHECK_FILE($FLUTE_JAR, [],
10608 [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
10611 if test -z $JFREEREPORT_JAR; then
10612 AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
10613 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
10615 AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
10616 [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
10617 [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
10622 AC_CHECK_FILE($JFREEREPORT_JAR, [],
10623 [AC_MSG_ERROR(jfreereport.jar not found.)], [])
10626 if test -z $LIBLAYOUT_JAR; then
10627 AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
10628 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
10630 AC_CHECK_FILE(/usr/share/java/liblayout.jar,
10631 [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
10632 [AC_MSG_ERROR(liblayout.jar replacement not found.)]
10637 AC_CHECK_FILE($LIBLAYOUT_JAR, [],
10638 [AC_MSG_ERROR(liblayout.jar not found.)], [])
10641 if test -z $LIBLOADER_JAR; then
10642 AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
10643 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
10645 AC_CHECK_FILE(/usr/share/java/libloader.jar,
10646 [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
10647 [AC_MSG_ERROR(libloader.jar replacement not found.)]
10652 AC_CHECK_FILE($LIBLOADER_JAR, [],
10653 [AC_MSG_ERROR(libloader.jar not found.)], [])
10656 if test -z $LIBFORMULA_JAR; then
10657 AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
10658 [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
10660 AC_CHECK_FILE(/usr/share/java/libformula.jar,
10661 [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
10662 [AC_MSG_ERROR(libformula.jar replacement not found.)]
10667 AC_CHECK_FILE($LIBFORMULA_JAR, [],
10668 [AC_MSG_ERROR(libformula.jar not found.)], [])
10671 if test -z $LIBREPOSITORY_JAR; then
10672 AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
10673 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
10675 AC_CHECK_FILE(/usr/share/java/librepository.jar,
10676 [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
10677 [AC_MSG_ERROR(librepository.jar replacement not found.)]
10682 AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
10683 [AC_MSG_ERROR(librepository.jar not found.)], [])
10686 if test -z $LIBFONTS_JAR; then
10687 AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
10688 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
10690 AC_CHECK_FILE(/usr/share/java/libfonts.jar,
10691 [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
10692 [AC_MSG_ERROR(libfonts.jar replacement not found.)]
10697 AC_CHECK_FILE($LIBFONTS_JAR, [],
10698 [AC_MSG_ERROR(libfonts.jar not found.)], [])
10701 if test -z $LIBSERIALIZER_JAR; then
10702 AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
10703 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
10705 AC_CHECK_FILE(/usr/share/java/libserializer.jar,
10706 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
10707 [AC_MSG_ERROR(libserializer.jar replacement not found.)]
10712 AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
10713 [AC_MSG_ERROR(libserializer.jar not found.)], [])
10716 if test -z $LIBBASE_JAR; then
10717 AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
10718 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
10720 AC_CHECK_FILE(/usr/share/java/libbase.jar,
10721 [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
10722 [AC_MSG_ERROR(libbase.jar replacement not found.)]
10727 AC_CHECK_FILE($LIBBASE_JAR, [],
10728 [AC_MSG_ERROR(libbase.jar not found.)], [])
10732 AC_MSG_RESULT([internal])
10733 SYSTEM_JFREEREPORT=NO
10734 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10737 AC_MSG_RESULT([no])
10738 ENABLE_REPORTBUILDER=
10739 SYSTEM_JFREEREPORT=NO
10741 AC_SUBST(ENABLE_REPORTBUILDER)
10742 AC_SUBST(SYSTEM_JFREEREPORT)
10744 AC_SUBST(LIBXML_JAR)
10745 AC_SUBST(FLUTE_JAR)
10746 AC_SUBST(JFREEREPORT_JAR)
10747 AC_SUBST(LIBBASE_JAR)
10748 AC_SUBST(LIBLAYOUT_JAR)
10749 AC_SUBST(LIBLOADER_JAR)
10750 AC_SUBST(LIBFORMULA_JAR)
10751 AC_SUBST(LIBREPOSITORY_JAR)
10752 AC_SUBST(LIBFONTS_JAR)
10753 AC_SUBST(LIBSERIALIZER_JAR)
10755 # this has to be here because both the Wiki Publisher and the SRB use
10757 if test "$ENABLE_MEDIAWIKI" = "TRUE" -o "$ENABLE_REPORTBUILDER" = "TRUE"; then
10758 AC_MSG_CHECKING([which Apache commons-* libs to use])
10759 if test "$with_system_apache_commons" = "yes"; then
10760 SYSTEM_APACHE_COMMONS=YES
10761 AC_MSG_RESULT([external])
10762 if test "$ENABLE_MEDIAWIKI" = "TRUE"; then
10763 if test -z $COMMONS_CODEC_JAR; then
10764 AC_CHECK_FILE(/usr/share/java/commons-codec-1.6.jar,
10765 [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.6.jar ],
10767 AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
10768 [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
10769 [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
10774 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
10775 [AC_MSG_ERROR(commons-codec.jar not found.)], [])
10778 if test -z $COMMONS_LANG_JAR; then
10779 AC_CHECK_FILE(/usr/share/java/commons-lang-2.4.jar,
10780 [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.4.jar ],
10782 AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
10783 [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
10784 [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
10789 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
10790 [AC_MSG_ERROR(commons-lang.jar not found.)], [])
10793 if test -z $COMMONS_HTTPCLIENT_JAR; then
10794 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
10795 [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
10797 AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
10798 [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
10799 [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
10804 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
10805 [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
10808 if test "$ENABLE_MEDIAWIKI" = "TRUE" -o "$ENABLE_REPORTBUILDER" = "TRUE"; then
10809 if test -z $COMMONS_LOGGING_JAR; then
10810 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
10811 [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
10813 AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
10814 [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
10815 [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
10820 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
10821 [AC_MSG_ERROR(commons-logging.jar not found.)], [])
10825 AC_MSG_RESULT([internal])
10826 SYSTEM_APACHE_COMMONS=NO
10827 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
10830 AC_SUBST(SYSTEM_APACHE_COMMONS)
10831 AC_SUBST(COMMONS_CODEC_JAR)
10832 AC_SUBST(COMMONS_LANG_JAR)
10833 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
10834 AC_SUBST(COMMONS_LOGGING_JAR)
10836 # scripting provider for BeanShell?
10837 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10838 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10839 AC_MSG_RESULT([yes])
10840 ENABLE_SCRIPTING_BEANSHELL=TRUE
10842 dnl ===================================================================
10843 dnl Check for system beanshell
10844 dnl ===================================================================
10845 AC_MSG_CHECKING([which beanshell to use])
10846 if test "$with_system_beanshell" = "yes"; then
10847 AC_MSG_RESULT([external])
10849 if test -z $BSH_JAR; then
10850 BSH_JAR=/usr/share/java/bsh.jar
10852 AC_CHECK_FILE($BSH_JAR, [],
10853 [AC_MSG_ERROR(bsh.jar not found.)], [])
10855 AC_MSG_RESULT([internal])
10857 BUILD_TYPE="$BUILD_TYPE BSH"
10860 AC_MSG_RESULT([no])
10861 ENABLE_SCRIPTING_BEANSHELL=
10862 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10864 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10865 AC_SUBST(SYSTEM_BSH)
10868 # scripting provider for JavaScript?
10869 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10870 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10871 AC_MSG_RESULT([yes])
10872 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10874 dnl ===================================================================
10875 dnl Check for system rhino
10876 dnl ===================================================================
10877 AC_MSG_CHECKING([which rhino to use])
10878 if test "$with_system_rhino" = "yes"; then
10879 AC_MSG_RESULT([external])
10881 if test -z $RHINO_JAR; then
10882 RHINO_JAR=/usr/share/java/js.jar
10884 AC_CHECK_FILE($RHINO_JAR, [],
10885 [AC_MSG_ERROR(js.jar not found.)], [])
10887 AC_MSG_RESULT([internal])
10889 BUILD_TYPE="$BUILD_TYPE RHINO"
10892 AC_MSG_RESULT([no])
10893 ENABLE_SCRIPTING_JAVASCRIPT=
10894 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10896 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10897 AC_SUBST(SYSTEM_RHINO)
10898 AC_SUBST(RHINO_JAR)
10901 case "$host_cpu" in
10902 x86_64 | powerpc64 | s390x)
10903 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
10904 supports_multilib="yes"
10911 dnl ===================================================================
10912 dnl Check whether the TQt and TDE libraries are available.
10913 dnl ===================================================================
10917 if test "$_os" != "OpenBSD"; then
10920 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
10921 dnl Search paths for TQt and TDE
10922 if test -z "$supports_multilib"; then
10923 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"
10924 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"
10926 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"
10927 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"
10929 if test -n "$TQTDIR"; then
10930 tqt_incdirs="$TQTDIR/include $tqt_incdirs"
10931 if test -z "$supports_multilib"; then
10932 tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
10934 tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
10937 if test -z "$supports_multilib"; then
10938 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"
10939 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"
10941 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"
10942 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"
10944 if test -n "$TDEDIR"; then
10945 tde_incdirs="$TDEDIR/include $tde_incdirs"
10946 if test -z "$supports_multilib"; then
10947 tde_libdirs="$TDEDIR/lib $tde_libdirs"
10949 tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
10954 tqt_test_include="ntqstyle.h"
10955 tde_test_include="kapp.h"
10957 if test "$_os" != "OpenBSD"; then
10958 tqt_test_library="libtqt-mt.so"
10959 tde_test_library="libDCOP.so"
10961 tqt_test_library="libtqt-mt.so*"
10962 tde_test_library="libDCOP.so*"
10965 dnl Check for TQt headers
10966 AC_MSG_CHECKING([for TQt headers])
10968 for tde_check in $tqt_incdirs; do
10969 if test -r "$tde_check/$tqt_test_include"; then
10970 tqt_incdir="$tde_check"
10974 AC_MSG_RESULT([$tqt_incdir])
10975 if test "x$tqt_incdir" = "xno"; then
10976 AC_MSG_ERROR([TQt headers not found. Please specify the root of
10977 your TQt installation by exporting TQTDIR before running "configure".])
10980 dnl Check for TQt libraries
10981 AC_MSG_CHECKING([for TQt libraries])
10983 for tqt_check in $tqt_libdirs; do
10984 if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
10985 tqt_libdir="$tqt_check"
10989 AC_MSG_RESULT([$tqt_libdir])
10990 if test "x$tqt_libdir" = "xno"; then
10991 AC_MSG_ERROR([TQt libraries not found. Please specify the root of
10992 your TQt installation by exporting TQTDIR before running "configure".])
10995 dnl Check for Meta Object Compiler
10996 AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
10997 if test "$MOC" = "no"; then
10998 AC_MSG_ERROR([TQt Meta Object Compiler not found. Please specify
10999 the root of your TQt installation by exporting TQTDIR before running "configure".])
11002 dnl Check for TDE headers
11003 AC_MSG_CHECKING([for TDE headers])
11005 for tde_check in $tde_incdirs; do
11006 if test -r "$tde_check/$tde_test_include"; then
11007 tde_incdir="$tde_check"
11011 AC_MSG_RESULT([$tde_incdir])
11012 if test "x$tde_incdir" = "xno"; then
11013 AC_MSG_ERROR([TDE headers not found. Please specify the root of
11014 your TDE installation by exporting TDEDIR before running "configure".])
11017 dnl Check for TDE libraries
11018 AC_MSG_CHECKING([for TDE libraries])
11020 for tde_check in $tde_libdirs; do
11021 if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
11022 tde_libdir="$tde_check"
11026 AC_MSG_RESULT([$tde_libdir])
11027 if test "x$tde_libdir" = "xno"; then
11028 AC_MSG_ERROR([TDE libraries not found. Please specify the root of
11029 your TDE installation by exporting TDEDIR before running "configure".])
11032 dnl Set the variables
11033 TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11034 TDE_LIBS="-L$tde_libdir -L$tqt_libdir -ltdeio -ltdeui -ltdecore -ltqt -ltqt-mt"
11036 AC_SUBST(TDE_CFLAGS)
11040 dnl ===================================================================
11041 dnl Check whether the Qt3 and KDE3 libraries are available.
11042 dnl ===================================================================
11046 if test "$_os" != "OpenBSD"; then
11049 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE"; then
11050 dnl Search paths for Qt3 and KDE3
11051 if test -z "$supports_multilib"; then
11052 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"
11053 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"
11055 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"
11056 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"
11058 if test -n "$QTDIR"; then
11059 qt_incdirs="$QTDIR/include $qt_incdirs"
11060 if test -z "$supports_multilib"; then
11061 qt_libdirs="$QTDIR/lib $qt_libdirs"
11063 qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
11066 if test -z "$supports_multilib"; then
11067 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"
11068 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"
11070 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"
11071 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"
11073 if test -n "$KDEDIR"; then
11074 kde_incdirs="$KDEDIR/include $kde_incdirs"
11075 if test -z "$supports_multilib"; then
11076 kde_libdirs="$KDEDIR/lib $kde_libdirs"
11078 kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
11083 qt_test_include="qstyle.h"
11084 kde_test_include="kapp.h"
11086 if test "$_os" != "OpenBSD"; then
11087 qt_test_library="libqt-mt.so"
11088 kde_test_library="libDCOP.so"
11090 qt_test_library="libqt-mt.so*"
11091 kde_test_library="libDCOP.so*"
11094 dnl Check for Qt3 headers
11095 AC_MSG_CHECKING([for Qt3 headers])
11097 for kde_check in $qt_incdirs; do
11098 if test -r "$kde_check/$qt_test_include"; then
11099 qt_incdir="$kde_check"
11103 AC_MSG_RESULT([$qt_incdir])
11104 if test "x$qt_incdir" = "xno"; then
11105 AC_MSG_ERROR([Qt3 headers not found. Please specify the root of
11106 your Qt3 installation by exporting QTDIR before running "configure".])
11109 dnl Check for Qt3 libraries
11110 AC_MSG_CHECKING([for Qt3 libraries])
11112 for qt_check in $qt_libdirs; do
11113 if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`"; then
11114 qt_libdir="$qt_check"
11118 AC_MSG_RESULT([$qt_libdir])
11119 if test "x$qt_libdir" = "xno"; then
11120 AC_MSG_ERROR([Qt3 libraries not found. Please specify the root of
11121 your Qt3 installation by exporting QTDIR before running "configure".])
11124 dnl Check for Meta Object Compiler
11125 AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
11126 if test "$MOC" = "no"; then
11127 AC_MSG_ERROR([Qt3 Meta Object Compiler not found. Please specify
11128 the root of your Qt3 installation by exporting QTDIR before running "configure".])
11131 dnl Check for KDE3 headers
11132 AC_MSG_CHECKING([for KDE3 headers])
11134 for kde_check in $kde_incdirs; do
11135 if test -r "$kde_check/$kde_test_include"; then
11136 kde_incdir="$kde_check"
11140 AC_MSG_RESULT([$kde_incdir])
11141 if test "x$kde_incdir" = "xno"; then
11142 AC_MSG_ERROR([KDE3 headers not found. Please specify the root of
11143 your KDE3 installation by exporting KDEDIR before running "configure".])
11146 dnl Check for KDE3 libraries
11147 AC_MSG_CHECKING([for KDE3 libraries])
11149 for kde_check in $kde_libdirs; do
11150 if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`"; then
11151 kde_libdir="$kde_check"
11155 AC_MSG_RESULT([$kde_libdir])
11156 if test "x$kde_libdir" = "xno"; then
11157 AC_MSG_ERROR([KDE3 libraries not found. Please specify the root of
11158 your KDE3 installation by exporting KDEDIR before running "configure".])
11161 dnl Set the variables
11162 KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11163 KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
11164 KDE_CFLAGS=$(printf '%s' "$KDE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11166 AC_SUBST(KDE_CFLAGS)
11170 dnl ===================================================================
11171 dnl KDE4 Integration
11172 dnl ===================================================================
11181 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
11182 qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
11183 qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
11185 kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
11186 kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
11188 if test -n "$supports_multilib"; then
11189 qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
11190 kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
11193 if test -n "$QTDIR"; then
11194 qt_incdirs="$QTDIR/include $qt_incdirs"
11195 if test -z "$supports_multilib"; then
11196 qt_libdirs="$QTDIR/lib $qt_libdirs"
11198 qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
11201 if test -n "$QT4DIR"; then
11202 qt_incdirs="$QT4DIR/include $qt_incdirs"
11203 if test -z "$supports_multilib"; then
11204 qt_libdirs="$QT4DIR/lib $qt_libdirs"
11206 qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
11210 if test -n "$KDEDIR"; then
11211 kde_incdirs="$KDEDIR/include $kde_incdirs"
11212 if test -z "$supports_multilib"; then
11213 kde_libdirs="$KDEDIR/lib $kde_libdirs"
11215 kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
11218 if test -n "$KDE4DIR"; then
11219 kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
11220 if test -z "$supports_multilib"; then
11221 kde_libdirs="$KDE4DIR/lib $kde_libdirs"
11223 kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
11227 qt_test_include="Qt/qobject.h"
11228 qt_test_library="libQtNetwork.so"
11229 kde_test_include="kwindowsystem.h"
11230 kde_test_library="libsolid.so"
11232 AC_MSG_CHECKING([for Qt4 headers])
11234 for inc_dir in $qt_incdirs; do
11235 if test -r "$inc_dir/$qt_test_include"; then
11236 qt_header_dir="$inc_dir"
11241 AC_MSG_RESULT([$qt_header_dir])
11242 if test "x$qt_header_dir" = "xno"; then
11243 AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11246 dnl Check for qmake
11247 AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
11249 if test "$QMAKE4" = "no"; then
11250 AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
11251 if test "$QMAKE4" = "no"; then
11252 AC_MSG_ERROR([Qmake not found. Please specify
11253 the root of your Qt installation by exporting QT4DIR before running "configure".])
11257 qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
11258 AC_MSG_CHECKING([for Qt4 libraries])
11260 for lib_dir in $qt_libdirs; do
11261 if test -r "$lib_dir/$qt_test_library"; then
11262 qt_lib_dir="$lib_dir"
11263 PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
11268 AC_MSG_RESULT([$qt_lib_dir])
11270 if test "x$qt_lib_dir" = "xno"; then
11271 AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11274 dnl Check for Meta Object Compiler
11276 AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11278 if test "$MOC4" = "no"; then
11279 AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11280 if test "$MOC4" = "no"; then
11281 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11282 the root of your Qt installation by exporting QT4DIR before running "configure".])
11286 dnl Check for KDE4 headers
11287 AC_MSG_CHECKING([for KDE4 headers])
11289 for kde_check in $kde_incdirs; do
11290 if test -r "$kde_check/$kde_test_include"; then
11291 kde_incdir="$kde_check"
11295 AC_MSG_RESULT([$kde_incdir])
11296 if test "x$kde_incdir" = "xno"; then
11297 AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11300 dnl Check for KDE4 libraries
11301 AC_MSG_CHECKING([for KDE4 libraries])
11303 for kde_check in $kde_libdirs; do
11304 if test -r "$kde_check/$kde_test_library"; then
11305 kde_libdir="$kde_check"
11310 AC_MSG_RESULT([$kde_libdir])
11311 if test "x$kde_libdir" = "xno"; then
11312 AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11315 PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
11316 KDE4_CFLAGS="-I$kde_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11317 KDE4_LIBS="-L$kde_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt_lib_dir $QT4_LIBS"
11318 KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11320 AC_LANG_PUSH([C++])
11321 save_CXXFLAGS=$CXXFLAGS
11322 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11323 AC_MSG_CHECKING([whether KDE is >= 4.2])
11324 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11325 #include <kdeversion.h>
11327 int main(int argc, char **argv) {
11328 if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
11331 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11332 CXXFLAGS=$save_CXXFLAGS
11335 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11336 # Sets also KDE_GLIB_CFLAGS/KDE_GLIB_LIBS if successful.
11337 PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
11340 AC_DEFINE(KDE_HAVE_GLIB,1)
11341 KDE_GLIB_CFLAGS=$(printf '%s' "$KDE_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11345 AC_LANG_PUSH([C++])
11346 save_CXXFLAGS=$CXXFLAGS
11347 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11349 LIBS="$LIBS $KDE4_LIBS"
11350 AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
11352 # Prepare meta object data
11353 TSTBASE="tst_exclude_socket_notifiers"
11354 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11355 ln -fs "${TSTMOC}.hxx"
11356 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11358 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11359 #include "tst_exclude_socket_notifiers.moc"
11361 int main(int argc, char *argv[])
11363 QCoreApplication app(argc, argv);
11364 exit(tst_processEventsExcludeSocket());
11368 AC_MSG_RESULT([yes])
11370 AC_MSG_RESULT([no])
11371 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11372 if test -z "$qt4_fix_warning"; then
11373 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11376 add_warning " https://bugreports.qt-project.org/browse/QTBUG-37380 (needed)"
11379 # Remove meta object data
11380 rm -f "${TSTBASE}."*
11382 AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
11384 # Prepare meta object data
11385 TSTBASE="tst_exclude_posted_events"
11386 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11387 ln -fs "${TSTMOC}.hxx"
11388 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11390 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11391 #include "tst_exclude_posted_events.moc"
11393 int main(int argc, char *argv[])
11395 QCoreApplication app(argc, argv);
11396 exit(tst_excludePostedEvents());
11400 AC_MSG_RESULT([yes])
11402 AC_MSG_RESULT([no])
11403 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11404 if test -z "$qt4_fix_warning"; then
11405 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11408 add_warning " https://bugreports.qt-project.org/browse/QTBUG-34614 (needed)"
11411 # Remove meta object data
11412 rm -f "${TSTBASE}."*
11414 if test -n "$qt4_fix_warning"; then
11415 add_warning " https://bugreports.qt-project.org/browse/QTBUG-38585 (recommended)"
11419 CXXFLAGS=$save_CXXFLAGS
11422 AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
11424 AC_SUBST(KDE4_CFLAGS)
11425 AC_SUBST(KDE4_LIBS)
11427 AC_SUBST(KDE_GLIB_CFLAGS)
11428 AC_SUBST(KDE_GLIB_LIBS)
11429 AC_SUBST(KDE_HAVE_GLIB)
11431 dnl ===================================================================
11432 dnl Test for the enabling the lockdown pieces
11433 dnl ===================================================================
11434 AC_MSG_CHECKING([whether to enable the lockdown pieces])
11436 if test -n "$enable_lockdown" -a "$enable_lockdown" != "no"; then
11437 ENABLE_LOCKDOWN=TRUE
11438 AC_MSG_RESULT([yes])
11440 AC_MSG_RESULT([no])
11442 AC_SUBST(ENABLE_LOCKDOWN)
11444 dnl ===================================================================
11445 dnl Test whether to include Evolution 2 support
11446 dnl ===================================================================
11447 AC_MSG_CHECKING([whether to enable evolution 2 support])
11448 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11449 AC_MSG_RESULT([yes])
11450 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11451 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11452 ENABLE_EVOAB2="TRUE"
11455 AC_MSG_RESULT([no])
11457 AC_SUBST(ENABLE_EVOAB2)
11458 AC_SUBST(GOBJECT_CFLAGS)
11459 AC_SUBST(GOBJECT_LIBS)
11461 dnl ===================================================================
11462 dnl Test whether to include TDE AB support
11463 dnl ===================================================================
11464 AC_MSG_CHECKING([whether to enable TDE address book support])
11465 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
11466 AC_MSG_RESULT([yes])
11467 AC_LANG_PUSH([C++])
11468 save_CXXFLAGS=$CXXFLAGS
11469 CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
11470 AC_MSG_CHECKING([whether TDE is at least R14.0])
11471 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11472 #include <tdeversion.h>
11474 int main(int argc, char **argv) {
11475 if (TDE_VERSION_MAJOR >= 14) return 0;
11478 ]])],[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])],[])
11479 CXXFLAGS=$save_CXXFLAGS
11483 AC_MSG_RESULT([no])
11486 AC_SUBST(ENABLE_TDEAB)
11488 dnl ===================================================================
11489 dnl Test whether to include KDE AB support
11490 dnl ===================================================================
11491 AC_MSG_CHECKING([whether to enable KDE address book support])
11492 if test "$enable_kdeab" = "yes" -a "$enable_kde" = "yes"; then
11493 AC_MSG_RESULT([yes])
11494 AC_LANG_PUSH([C++])
11495 save_CXXFLAGS=$CXXFLAGS
11496 CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
11497 AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
11498 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11499 #include <kdeversion.h>
11501 int main(int argc, char **argv) {
11502 if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
11505 ]])],[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])],[])
11506 CXXFLAGS=$save_CXXFLAGS
11510 AC_MSG_RESULT([no])
11513 AC_SUBST(ENABLE_KAB)
11515 dnl ===================================================================
11516 dnl Test which themes to include
11517 dnl ===================================================================
11518 AC_MSG_CHECKING([which themes to include])
11519 # if none given use default subset of available themes
11520 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11521 with_theme="crystal default hicontrast oxygen tango sifr"
11522 test -z "$ENABLE_RELEASE_BUILD" && with_theme="$with_theme tango_testing"
11526 if test "x$with_theme" != "xno"; then
11527 for theme in $with_theme; do
11529 crystal|default|galaxy|hicontrast|human|industrial|oxygen|sifr|tango|tango_testing) : ;;
11530 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11532 WITH_THEMES="$WITH_THEMES $theme"
11535 AC_MSG_RESULT([$WITH_THEMES])
11536 AC_SUBST([WITH_THEMES])
11538 dnl ===================================================================
11539 dnl Test whether to integrate helppacks into the product's installer
11540 dnl ===================================================================
11541 AC_MSG_CHECKING([for helppack integration])
11542 if test "$with_helppack_integration" = "no"; then
11543 WITH_HELPPACK_INTEGRATION=NO
11544 AC_MSG_RESULT([no integration])
11546 WITH_HELPPACK_INTEGRATION=YES
11547 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11548 AC_MSG_RESULT([integration])
11550 AC_SUBST(WITH_HELPPACK_INTEGRATION)
11552 dnl ===================================================================
11553 dnl Test whether to use CoreText framework
11554 dnl ===================================================================
11556 if test "$_os" = "Darwin"; then
11557 AC_MSG_CHECKING([whether to use CoreText framework])
11558 if test "$enable_coretext" != no -o "$BITNESS_OVERRIDE" = 64; then
11559 AC_MSG_RESULT([yes])
11560 ENABLE_CORETEXT=TRUE
11562 AC_MSG_RESULT([no])
11565 AC_SUBST(ENABLE_CORETEXT)
11567 ###############################################################################
11568 # Extensions checking
11569 ###############################################################################
11570 AC_MSG_CHECKING([for extensions integration])
11571 if test "x$enable_extension_integration" != "xno"; then
11572 WITH_EXTENSION_INTEGRATION=YES
11573 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11574 AC_MSG_RESULT([yes, use integration])
11576 WITH_EXTENSION_INTEGRATION=NO
11577 AC_MSG_RESULT([no, do not integrate])
11579 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11581 dnl Should any extra extensions be included?
11582 dnl There are standalone tests for each of these below.
11583 WITH_EXTRA_EXTENSIONS=
11584 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11586 libo_CHECK_EXTENSION([Watch Window],[WATCH_WINDOW],[watch_window],[watch-window],[23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt])
11587 libo_CHECK_EXTENSION([SmART Gallery (Diagram)],[DIAGRAM],[diagram],[diagram],[8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt])
11588 libo_CHECK_EXTENSION([Validator],[VALIDATOR],[validator],[validator],[bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt])
11589 libo_CHECK_EXTENSION([Barcode],[BARCODE],[barcode],[barcode],[3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt])
11590 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11591 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11592 libo_CHECK_EXTENSION([Hungarian Cross-reference Toolbar],[HUNART],[hunart],[hunart],[b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt])
11593 libo_CHECK_EXTENSION([Typography Toolbar],[TYPO],[typo],[typo],[9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt])
11594 libo_CHECK_EXTENSION([Google Docs],[GOOGLE_DOCS],[google_docs],[google-docs],[27211596cf0ad97cab7321239406fde0-gdocs_3.0.1_modified.oxt])
11595 if test "x$with_java" != "xno"; then
11596 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11597 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11600 dnl ===================================================================
11601 dnl Test whether to include Sun Professional Template Pack
11602 dnl ===================================================================
11603 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
11604 if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
11605 AC_MSG_RESULT([no integration])
11607 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
11608 sun_supported_langs="en-US de it fr es hu"
11609 if test "$with_sun_templates" = "yes"; then
11610 wanted_sun_templates="$sun_supported_langs"
11612 # check whether the langs are supported by Sun
11613 wanted_sun_templates=
11614 for lang in $with_sun_templates; do
11615 if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
11616 wanted_sun_templates="$wanted_sun_templates $lang"
11621 SUNTEMPLATES_DE_PACK=
11622 SUNTEMPLATES_EN_US_PACK=
11623 SUNTEMPLATES_ES_PACK=
11624 SUNTEMPLATES_FR_PACK=
11625 SUNTEMPLATES_HU_PACK=
11626 SUNTEMPLATES_IT_PACK=
11627 # check whether the langs are requested at all
11628 for lang in $wanted_sun_templates; do
11629 if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
11630 SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
11632 "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
11633 "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
11634 "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
11635 "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
11636 "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
11637 "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
11641 WITH_EXTRA_EXTENSIONS=YES
11642 AC_MSG_RESULT([$SUNTEMPLATES_LANG])
11644 AC_SUBST(SUNTEMPLATES_DE_PACK)
11645 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
11646 AC_SUBST(SUNTEMPLATES_ES_PACK)
11647 AC_SUBST(SUNTEMPLATES_FR_PACK)
11648 AC_SUBST(SUNTEMPLATES_HU_PACK)
11649 AC_SUBST(SUNTEMPLATES_IT_PACK)
11651 dnl ===================================================================
11652 dnl Test whether to include fonts
11653 dnl ===================================================================
11654 AC_MSG_CHECKING([whether to include third-party fonts])
11655 if test "$with_fonts" != "no"; then
11656 AC_MSG_RESULT([yes])
11658 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11660 AC_MSG_RESULT([no])
11662 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11664 AC_SUBST(WITH_FONTS)
11666 dnl ===================================================================
11667 dnl Test whether to include ppds
11668 dnl ===================================================================
11669 AC_MSG_CHECKING([whether to include PPDs])
11670 if test "$with_ppds" != "no"; then
11671 AC_MSG_RESULT([yes])
11673 AC_MSG_RESULT([no])
11675 SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
11677 AC_SUBST(WITHOUT_PPDS)
11679 dnl ===================================================================
11680 dnl Test whether to include afms
11681 dnl ===================================================================
11682 AC_MSG_CHECKING([whether to include AFMs])
11683 if test "$with_afms" != "no"; then
11684 AC_MSG_RESULT([yes])
11685 BUILD_TYPE="$BUILD_TYPE AFMS"
11687 AC_MSG_RESULT([no])
11689 SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
11691 AC_SUBST(WITHOUT_AFMS)
11693 dnl ===================================================================
11694 dnl Test whether to include extra galleries
11695 dnl ===================================================================
11696 AC_MSG_CHECKING([whether to include extra galleries])
11697 if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
11698 AC_MSG_RESULT([no])
11699 WITH_EXTRA_GALLERY=NO
11700 OOOP_GALLERY_PACK=""
11702 AC_MSG_RESULT([yes])
11703 WITH_EXTRA_GALLERY=YES
11704 BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
11705 SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
11706 OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
11708 AC_SUBST(WITH_EXTRA_GALLERY)
11709 AC_SUBST(OOOP_GALLERY_PACK)
11711 dnl ===================================================================
11712 dnl Test whether to include extra templates
11713 dnl ===================================================================
11714 AC_MSG_CHECKING([whether to include extra templates])
11715 if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
11716 AC_MSG_RESULT([no])
11717 WITH_EXTRA_TEMPLATE=NO
11718 OOOP_TEMPLATES_PACK=""
11720 AC_MSG_RESULT([yes])
11721 WITH_EXTRA_TEMPLATE=YES
11722 BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
11723 SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
11724 OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
11726 AC_SUBST(WITH_EXTRA_TEMPLATE)
11727 AC_SUBST(OOOP_TEMPLATES_PACK)
11729 dnl ===================================================================
11730 dnl Test whether to include extra samples
11731 dnl ===================================================================
11732 AC_MSG_CHECKING([whether to include extra samples])
11733 if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
11734 AC_MSG_RESULT([no])
11735 WITH_EXTRA_SAMPLE=NO
11736 OOOP_SAMPLES_PACK=""
11738 AC_MSG_RESULT([yes])
11739 WITH_EXTRA_SAMPLE=YES
11740 BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
11741 SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
11742 OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
11744 AC_SUBST(WITH_EXTRA_SAMPLE)
11745 AC_SUBST(OOOP_SAMPLES_PACK)
11747 dnl ===================================================================
11748 dnl Test whether to include extra fonts
11749 dnl ===================================================================
11750 AC_MSG_CHECKING([whether to include extra fonts])
11751 if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
11752 AC_MSG_RESULT([no])
11756 AC_MSG_RESULT([yes])
11757 WITH_EXTRA_FONT=YES
11758 BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
11759 SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
11760 OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
11762 AC_SUBST(WITH_EXTRA_FONT)
11763 AC_SUBST(OOOP_FONTS_PACK)
11765 dnl ===================================================================
11766 dnl Test whether to enable online update service
11767 dnl ===================================================================
11768 AC_MSG_CHECKING([whether to enable online update])
11769 ENABLE_ONLINE_UPDATE=
11770 if test "$enable_online_update" = ""; then
11771 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11772 AC_MSG_RESULT([yes])
11773 ENABLE_ONLINE_UPDATE="TRUE"
11775 AC_MSG_RESULT([no])
11778 if test "$enable_online_update" = "yes"; then
11779 AC_MSG_RESULT([yes])
11780 ENABLE_ONLINE_UPDATE="TRUE"
11782 AC_MSG_RESULT([no])
11785 AC_SUBST(ENABLE_ONLINE_UPDATE)
11787 dnl ===================================================================
11788 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11789 dnl ===================================================================
11790 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11791 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11792 AC_MSG_RESULT([no])
11795 AC_MSG_RESULT([yes])
11796 ENABLE_SILENT_MSI=TRUE
11797 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11799 AC_SUBST(ENABLE_SILENT_MSI)
11801 AC_MSG_CHECKING([whether and how to use Xinerama])
11802 if test "$_os" = "Darwin"; then
11804 XINERAMA_LINK=dynamic
11805 AC_MSG_RESULT([yes])
11806 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11807 if test "$x_libraries" = "default_x_libraries"; then
11808 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11809 if test "x$XINERAMALIB" = x; then
11810 XINERAMALIB="/usr/lib"
11813 XINERAMALIB="$x_libraries"
11815 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11816 # we have both versions, let the user decide but use the dynamic one
11819 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11820 XINERAMA_LINK=dynamic
11822 XINERAMA_LINK=static
11824 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11825 # we have only the dynamic version
11827 XINERAMA_LINK=dynamic
11828 elif test -e "$XINERAMALIB/libXinerama.a"; then
11830 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11832 XINERAMA_LINK=static
11842 if test "$USE_XINERAMA" = "YES"; then
11843 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11844 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11845 [AC_MSG_ERROR(Xinerama header not found.)], [])
11846 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11847 if test "x$XEXTLIB" = x; then
11848 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11850 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11851 if test "$_os" = "FreeBSD"; then
11852 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11854 if test "$_os" = "Linux"; then
11855 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11857 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11858 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11860 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11865 AC_MSG_RESULT([no])
11867 AC_SUBST(USE_XINERAMA)
11868 AC_SUBST(XINERAMA_LINK)
11870 dnl ===================================================================
11871 dnl Test whether to build cairo or rely on the system version
11872 dnl ===================================================================
11874 if test "$GUIBASE" = "unx"; then
11875 # Used in vcl/Library_vclplug_gen.mk
11879 if test "$test_cairo" = "yes"; then
11880 AC_MSG_CHECKING([whether to use the system cairo])
11882 : ${with_system_cairo:=$with_system_libs}
11883 if test "$with_system_cairo" = "yes"; then
11885 AC_MSG_RESULT([yes])
11887 PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
11888 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11890 if test "$test_xrender" = "yes"; then
11891 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11893 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11894 #ifdef PictStandardA8
11898 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11902 libo_MINGW_CHECK_DLL([libcairo])
11903 libo_MINGW_TRY_DLL([libfontconfig])
11904 libo_MINGW_TRY_DLL([libfreetype])
11905 libo_MINGW_TRY_DLL([libpixman])
11906 libo_MINGW_TRY_DLL([libpng15])
11909 AC_MSG_RESULT([no])
11911 BUILD_TYPE="$BUILD_TYPE CAIRO"
11912 SCPDEFS="$SCPDEFS -DNEED_CAIRO"
11916 AC_SUBST(SYSTEM_CAIRO)
11917 AC_SUBST(CAIRO_CFLAGS)
11918 AC_SUBST(CAIRO_LIBS)
11920 dnl ===================================================================
11921 dnl Test whether to use avahi
11922 dnl ===================================================================
11923 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11924 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11925 [ENABLE_AVAHI="TRUE"])
11926 AC_DEFINE(HAVE_FEATURE_AVAHI)
11927 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11930 AC_SUBST(ENABLE_AVAHI)
11931 AC_SUBST(AVAHI_CFLAGS)
11932 AC_SUBST(AVAHI_LIBS)
11934 dnl ===================================================================
11935 dnl Test whether to use liblangtag
11936 dnl ===================================================================
11939 AC_MSG_CHECKING([whether to use liblangtag])
11940 if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a $_os != Android -a $_os != iOS \); then
11941 ENABLE_LIBLANGTAG=TRUE
11942 AC_MSG_RESULT([yes])
11943 AC_MSG_CHECKING([whether to use system liblangtag])
11944 if test "$with_system_liblangtag" = yes; then
11945 SYSTEM_LIBLANGTAG=YES
11946 AC_MSG_RESULT([yes])
11947 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11948 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11949 libo_MINGW_CHECK_DLL([liblangtag])
11951 SYSTEM_LIBLANGTAG=NO
11952 AC_MSG_RESULT([no])
11953 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11954 if test "$COM" = "MSC"; then
11955 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs/liblangtag.lib"
11957 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs -llangtag"
11961 AC_MSG_RESULT([no])
11963 AC_SUBST(ENABLE_LIBLANGTAG)
11964 AC_SUBST(SYSTEM_LIBLANGTAG)
11965 AC_SUBST(LIBLANGTAG_CFLAGS)
11966 AC_SUBST(LIBLANGTAG_LIBS)
11968 dnl ===================================================================
11969 dnl Test whether to build libpng or rely on the system version
11970 dnl ===================================================================
11972 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/png"],["-L${WORKDIR}/LinkTarget/StaticLibrary -lpng"])
11974 dnl ===================================================================
11975 dnl Check for runtime JVM search path
11976 dnl ===================================================================
11977 if test "$ENABLE_JAVA" != ""; then
11978 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11979 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11980 AC_MSG_RESULT([yes])
11981 if ! test -d "$with_jvm_path"; then
11982 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11984 if ! test -d "$with_jvm_path"jvm; then
11985 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11987 JVM_ONE_PATH_CHECK="$with_jvm_path"
11988 AC_SUBST(JVM_ONE_PATH_CHECK)
11990 AC_MSG_RESULT([no])
11994 dnl ===================================================================
11995 dnl Test for the presence of Ant and that it works
11996 dnl ===================================================================
11998 if test "$ENABLE_JAVA" != ""; then
11999 ANT_HOME=; export ANT_HOME
12000 WITH_ANT_HOME=; export WITH_ANT_HOME
12001 if test -z "$with_ant_home"; then
12002 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
12004 if test "$_os" = "WINNT"; then
12005 with_ant_home=`cygpath -u "$with_ant_home"`
12007 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
12008 WITH_ANT_HOME=$with_ant_home
12009 ANT_HOME=$with_ant_home
12012 if test -z "$ANT"; then
12013 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
12015 # resolve relative or absolute symlink
12016 while test -h "$ANT"; do
12018 a_basename=`basename "$ANT"`
12019 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
12020 cd "`dirname "$ANT"`"
12021 cd "`dirname "$a_script"`"
12022 ANT="`pwd`"/"`basename "$a_script"`"
12026 AC_MSG_CHECKING([if $ANT works])
12027 cat > conftest.java << EOF
12028 public class conftest {
12029 int testmethod(int a, int b) {
12035 cat > conftest.xml << EOF
12036 <project name="conftest" default="conftest">
12037 <target name="conftest">
12038 <javac srcdir="." includes="conftest.java">
12044 oldJAVA_HOME=$JAVA_HOME
12045 if test "$JAVACISGCJ" = "yes"; then
12046 JAVA_HOME=; export JAVA_HOME
12047 ant_gcj="-Dbuild.compiler=gcj"
12049 AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
12050 if test $? = 0 -a -f ./conftest.class; then
12051 AC_MSG_RESULT([Ant works])
12052 if test -z "$WITH_ANT_HOME"; then
12053 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
12054 if test -z "$ANT_HOME"; then
12055 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
12058 ANT_HOME="$WITH_ANT_HOME"
12061 echo "configure: Ant test failed" >&5
12062 cat conftest.java >&5
12063 cat conftest.xml >&5
12064 AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
12066 add_warning "Ant does not work - Some Java projects will not build!"
12068 JAVA_HOME=$oldJAVA_HOME
12069 rm -f conftest* core core.* *.core
12071 if test -z "$ANT_HOME"; then
12072 ANT_HOME="NO_ANT_HOME"
12074 PathFormat "$ANT_HOME"
12075 ANT_HOME="$formatted_path"
12082 dnl Checking for ant.jar
12083 if test "$ANT_HOME" != "NO_ANT_HOME"; then
12084 AC_MSG_CHECKING([Ant lib directory])
12085 if test -f $ANT_HOME/lib/ant.jar; then
12086 ANT_LIB="$ANT_HOME/lib"
12088 if test -f $ANT_HOME/ant.jar; then
12089 ANT_LIB="$ANT_HOME"
12091 if test -f /usr/share/java/ant.jar; then
12092 ANT_LIB=/usr/share/java
12094 if test -f /usr/share/ant-core/lib/ant.jar; then
12095 ANT_LIB=/usr/share/ant-core/lib
12097 if test -f $ANT_HOME/lib/ant/ant.jar; then
12098 ANT_LIB="$ANT_HOME/lib/ant"
12100 if test -f /usr/share/lib/ant/ant.jar; then
12101 ANT_LIB=/usr/share/lib/ant
12103 AC_MSG_ERROR([Ant libraries not found!])
12110 PathFormat "$ANT_LIB"
12111 ANT_LIB="$formatted_path"
12112 AC_MSG_RESULT([Ant lib directory found.])
12117 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
12119 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
12120 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
12121 ant_version_major=`echo $ant_version | cut -d. -f1`
12122 ant_version_minor=`echo $ant_version | cut -d. -f2`
12123 echo "configure: ant_version $ant_version " >&5
12124 echo "configure: ant_version_major $ant_version_major " >&5
12125 echo "configure: ant_version_minor $ant_version_minor " >&5
12126 if test "$ant_version_major" -ge "2"; then
12127 AC_MSG_RESULT([yes, $ant_version])
12128 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
12129 AC_MSG_RESULT([yes, $ant_version])
12131 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
12134 if test "$ENABLE_MEDIAWIKI" = "TRUE"; then
12135 AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
12138 cat > conftest.java << EOF
12139 public class conftest {
12140 int testmethod(int a, int b) {
12146 cat > conftest.xml << EOF
12147 <project name="conftest" default="conftest">
12148 <target name="conftest" depends="copytest">
12149 <javac srcdir="." includes="conftest.java">
12152 <target name="copytest">
12153 <copy todir="confdir">
12154 <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
12156 <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
12162 if test "$JAVACISGCJ" = "yes"; then
12163 JAVA_HOME=; export JAVA_HOME
12164 ant_gcj="-Dbuild.compiler=gcj"
12166 AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
12167 if test $? = 0 -a -f ./conftest.class; then
12168 AC_MSG_RESULT([yes])
12171 echo "configure: Ant test failed" >&5
12172 cat conftest.java >&5
12173 cat conftest.xml >&5
12175 AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
12178 rm -f conftest* core core.* *.core
12182 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
12183 AC_MSG_CHECKING([for JUnit 4])
12184 if test "$with_junit" = "yes"; then
12185 if test -e /usr/share/java/junit4.jar; then
12186 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
12188 if test -e /usr/share/lib/java/junit.jar; then
12189 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
12191 OOO_JUNIT_JAR=/usr/share/java/junit.jar
12195 OOO_JUNIT_JAR=$with_junit
12197 if test "$_os" = "WINNT"; then
12198 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
12200 "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
12201 grep org/junit/Before.class > /dev/null 2>&5
12202 if test $? -eq 0; then
12203 # check if either class-path entry is available for hamcrest or
12205 if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
12206 "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
12207 AC_MSG_RESULT([$OOO_JUNIT_JAR])
12209 AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
12210 provide a full junit jar or use --without-junit])
12213 AC_MSG_RESULT([no])
12214 AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
12215 location (/usr/share/java), specify its pathname via
12216 --with-junit=..., or disable it via --without-junit])
12218 if test $OOO_JUNIT_JAR != ""; then
12219 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
12222 AC_SUBST(OOO_JUNIT_JAR)
12228 # check for wget and curl
12233 if test "$enable_fetch_external" != "no"; then
12235 CURL=`which curl 2>/dev/null`
12237 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12238 eval "$i --version" > /dev/null 2>&1
12240 if test $ret -eq 0; then
12246 if test -z "$WGET" -a -z "$CURL"; then
12247 AC_MSG_ERROR([neither wget nor curl found!])
12260 for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
12261 if test "$i" = "md5"; then
12262 eval "$i -x" > /dev/null 2>&1
12264 eval "$i --version" > /dev/null 2>&1
12267 if test $ret -eq 0; then
12273 if test "$MD5SUM" = "md5"; then
12274 if md5 -r < /dev/null > /dev/null 2>/dev/null; then
12275 MD5SUM="$MD5SUM -r"
12276 elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
12277 MD5SUM="$MD5SUM -n"
12281 if test -z "$MD5SUM"; then
12282 AC_MSG_ERROR([no md5sum: found!])
12287 dnl ===================================================================
12288 dnl Dealing with l10n options
12289 dnl ===================================================================
12290 AC_MSG_CHECKING([which languages to be built])
12291 # get list of all languages
12292 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12293 # the sed command does the following:
12294 # + if a line ends with a backslash, append the next line to it
12295 # + adds " on the beginning of the value (after =)
12296 # + adds " at the end of the value
12297 # + removes en-US; we want to put it on the beginning
12298 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12299 [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)]
12300 ALL_LANGS="en-US $completelangiso"
12301 # check the configured localizations
12302 WITH_LANG="$with_lang"
12303 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12304 AC_MSG_RESULT([en-US])
12306 AC_MSG_RESULT([$WITH_LANG])
12307 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12309 # check that the list is valid
12310 for lang in $WITH_LANG; do
12311 test "$lang" = "ALL" && continue
12312 # need to check for the exact string, so add space before and after the list of all languages
12313 for vl in $ALL_LANGS; do
12314 if test "$vl" = "$lang"; then
12318 if test "$vl" != "$lang"; then
12319 # if you're reading this - you prolly quoted your languages remove the quotes ...
12320 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12323 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12324 echo $WITH_LANG | grep -q en-US
12325 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12327 # list with substituted ALL
12328 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12329 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12330 test "$WITH_LANG" = "en-US" && WITH_LANG=
12331 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12332 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12333 ALL_LANGS=`echo $ALL_LANGS qtz`
12335 AC_SUBST(ALL_LANGS)
12336 AC_SUBST(WITH_LANG)
12337 AC_SUBST(WITH_LANG_LIST)
12338 AC_SUBST(GIT_NEEDED_SUBMODULES)
12340 WITH_POOR_HELP_LOCALIZATIONS=
12341 if test -d "$SRC_ROOT/translations/source"; then
12342 for l in `ls -1 $SRC_ROOT/translations/source`; do
12343 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12344 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12348 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12350 dnl git submodule update --reference
12351 dnl ===================================================================
12352 if test -n "${GIT_REFERENCE_SRC}"; then
12353 for repo in ${GIT_NEEDED_SUBMODULES}; do
12354 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12355 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12359 AC_SUBST(GIT_REFERENCE_SRC)
12361 dnl git submodules linked dirs
12362 dnl ===================================================================
12363 if test -n "${GIT_LINK_SRC}"; then
12364 for repo in ${GIT_NEEDED_SUBMODULES}; do
12365 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12366 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12370 AC_SUBST(GIT_LINK_SRC)
12373 dnl ===================================================================
12374 AC_MSG_CHECKING([for alternative branding images directory])
12375 # initialize mapped arrays
12376 BRAND_INTRO_IMAGES="flat_logo.svg intro.png"
12377 brand_files="$BRAND_INTRO_IMAGES about.svg \
12378 backing_left.png backing_right.png \
12379 backing_rtl_left.png backing_rtl_right.png \
12382 if test -z "$with_branding" -o "$with_branding" = "no"; then
12383 AC_MSG_RESULT([none])
12384 DEFAULT_BRAND_IMAGES="$brand_files"
12386 if ! test -d $with_branding ; then
12387 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12389 AC_MSG_RESULT([$with_branding])
12390 CUSTOM_BRAND_DIR="$with_branding"
12391 for lfile in $brand_files
12393 if ! test -f $with_branding/$lfile ; then
12394 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12395 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12397 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12400 check_for_progress="yes"
12403 AC_SUBST([BRAND_INTRO_IMAGES])
12404 AC_SUBST([CUSTOM_BRAND_DIR])
12405 AC_SUBST([CUSTOM_BRAND_IMAGES])
12406 AC_SUBST([DEFAULT_BRAND_IMAGES])
12409 AC_MSG_CHECKING([for 'intro' progress settings])
12413 PROGRESSFRAMECOLOR=
12415 PROGRESSTEXTBASELINE=
12417 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12418 source "$with_branding/progress.conf"
12419 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12421 AC_MSG_RESULT([none])
12424 AC_SUBST(PROGRESSBARCOLOR)
12425 AC_SUBST(PROGRESSSIZE)
12426 AC_SUBST(PROGRESSPOSITION)
12427 AC_SUBST(PROGRESSFRAMECOLOR)
12428 AC_SUBST(PROGRESSTEXTCOLOR)
12429 AC_SUBST(PROGRESSTEXTBASELINE)
12432 AC_MSG_CHECKING([for extra build ID])
12433 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12434 EXTRA_BUILDID="$with_extra_buildid"
12436 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12437 if test -n "$EXTRA_BUILDID" ; then
12438 AC_MSG_RESULT([$EXTRA_BUILDID])
12440 AC_MSG_RESULT([not set])
12442 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12445 AC_MSG_CHECKING([for vendor])
12446 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12447 OOO_VENDOR="$USERNAME"
12449 if test -z "$OOO_VENDOR"; then
12453 if test -z "$OOO_VENDOR"; then
12454 OOO_VENDOR="`id -u -n`"
12457 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12459 OOO_VENDOR="$with_vendor"
12460 AC_MSG_RESULT([$OOO_VENDOR])
12462 AC_SUBST(OOO_VENDOR)
12464 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12465 if test "$with_compat_oowrappers" = "yes"; then
12466 WITH_COMPAT_OOWRAPPERS=YES
12469 WITH_COMPAT_OOWRAPPERS=
12472 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12474 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
12475 AC_MSG_CHECKING([for install dirname])
12476 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12477 INSTALLDIRNAME="$with_install_dirname"
12479 AC_MSG_RESULT([$INSTALLDIRNAME])
12480 AC_SUBST(INSTALLDIRNAME)
12482 AC_MSG_CHECKING([for prefix])
12483 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12484 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12485 PREFIXDIR="$prefix"
12486 AC_MSG_RESULT([$PREFIXDIR])
12487 AC_SUBST(PREFIXDIR)
12489 LIBDIR=[$(eval echo $(eval echo $libdir))]
12492 DATADIR=[$(eval echo $(eval echo $datadir))]
12495 MANDIR=[$(eval echo $(eval echo $mandir))]
12498 DOCDIR=[$(eval echo $(eval echo $docdir))]
12501 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12502 AC_SUBST(INSTALLDIR)
12504 TESTINSTALLDIR="${BUILDDIR}/test-install"
12505 AC_SUBST(TESTINSTALLDIR)
12508 # ===================================================================
12509 # OAuth2 id and secrets
12510 # ===================================================================
12512 AC_MSG_CHECKING([for Google Drive client id and secret])
12513 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12514 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12515 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12516 GDRIVE_CLIENT_ID="\"\""
12519 if test "$with_gdrive_client_secret" = "no" -o -z "$with_gdrive_client_secret"; then
12520 GDRIVE_CLIENT_SECRET="\"\""
12523 if test -z "$GDRIVE_CLIENT_ID" -o -z "$GDRIVE_CLIENT_SECRET"; then
12524 AC_MSG_RESULT([not set])
12526 AC_MSG_RESULT([set])
12529 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12530 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12532 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12533 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12534 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12535 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12536 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12539 if test "$with_alfresco_cloud_client_secret" = "no" -o -z "$with_alfresco_cloud_client_secret"; then
12540 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12543 if test -z "$ALFRESCO_CLOUD_CLIENT_ID" -o -z "$ALFRESCO_CLOUD_CLIENT_SECRET"; then
12544 AC_MSG_RESULT([not set])
12546 AC_MSG_RESULT([set])
12548 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12549 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12551 # ===================================================================
12552 # De- or increase default verbosity of build process
12553 # ===================================================================
12554 AC_MSG_CHECKING([build verbosity])
12555 if test -n "$enable_verbose"; then
12556 if test "$enable_verbose" = "yes"; then
12558 AC_MSG_RESULT([high])
12560 if test "$enable_verbose" = "no"; then
12562 AC_MSG_RESULT([low])
12565 AC_MSG_RESULT([not set])
12569 dnl ===================================================================
12570 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12571 dnl --enable-dependency-tracking configure option
12572 dnl ===================================================================
12573 AC_MSG_CHECKING([whether to enable dependency tracking])
12574 if test "$enable_dependency_tracking" = "no"; then
12576 AC_MSG_RESULT([no])
12578 AC_MSG_RESULT([yes])
12582 dnl ===================================================================
12583 dnl Number of CPUs to use during the build
12584 dnl ===================================================================
12585 AC_MSG_CHECKING([for number of processors to use])
12586 # plain --with-parallelism is just the default
12587 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12588 if test "$with_parallelism" = "no"; then
12591 PARALLELISM=$with_parallelism
12594 if test "$enable_icecream" = "yes"; then
12599 Darwin|FreeBSD|NetBSD|OpenBSD)
12600 PARALLELISM=`sysctl -n hw.ncpu`
12604 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12606 # what else than above does profit here *and* has /proc?
12608 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12612 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12613 # unexpected format, 'wc -l' will have returned 0.
12614 if test "$PARALLELISM" -eq 0; then
12620 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12621 if test -z "$with_parallelism"; then
12622 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12623 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12626 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."
12630 AC_MSG_RESULT([$PARALLELISM])
12631 AC_SUBST(PARALLELISM)
12634 # Set up ILIB for MSVC build
12636 if test "$build_os" = "cygwin"; then
12638 if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
12639 ILIB="$ILIB;$JAVA_HOME/lib"
12641 if test "$BITNESS_OVERRIDE" = 64; then
12642 ILIB="$ILIB;$COMPATH/lib/amd64"
12643 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12644 if test "$WINDOWS_SDK_VERSION" = "80"; then
12645 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x64"
12648 ILIB="$ILIB;$COMPATH/lib"
12649 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12650 if test "$WINDOWS_SDK_VERSION" = "80"; then
12651 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x86"
12654 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12656 if test "$ENABLE_DIRECTX" = "TRUE"; then
12657 ILIB="$ILIB;$DIRECTXSDK_LIB"
12663 # ===================================================================
12664 # Creating bigger shared library to link against
12665 # ===================================================================
12666 AC_MSG_CHECKING([whether to create huge library])
12669 if test $_os = iOS -o $_os = Android; then
12670 # Never any point in mergelibs for these as we build just static
12671 # libraries anyway...
12672 enable_mergelibs=no
12675 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12676 if test $_os != Linux -a $_os != WINNT; then
12677 add_warning "--enable-mergelibs is not tested for this platform"
12679 if test "$enable_mergelibs" = "all"; then
12685 AC_MSG_RESULT([yes])
12687 AC_MSG_RESULT([no])
12689 AC_SUBST([MERGELIBS])
12690 AC_SUBST([URELIBS])
12692 # ===================================================================
12693 # Create hardlinks on deliver instead of copying for smaller size and speed up
12694 # ===================================================================
12695 AC_MSG_CHECKING([whether to create hardlinks for delivering files])
12697 if test "$enable_hardlink_deliver" = "yes"; then
12698 HARDLINKDELIVER="TRUE"
12699 AC_MSG_RESULT([yes])
12701 AC_MSG_RESULT([no])
12703 AC_SUBST(HARDLINKDELIVER)
12705 dnl ===================================================================
12706 dnl icerun is a wrapper that stops us spawning tens of processes
12707 dnl locally - for tools that can't be executed on the compile cluster
12708 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12709 dnl ===================================================================
12710 AC_MSG_CHECKING([whether to use icerun wrapper])
12712 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12713 ICECREAM_RUN=icerun
12714 AC_MSG_RESULT([yes])
12716 AC_MSG_RESULT([no])
12718 AC_SUBST(ICECREAM_RUN)
12720 dnl ===================================================================
12722 AC_MSG_CHECKING([MPL subset])
12725 if test "$enable_mpl_subset" = "yes"; then
12727 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12729 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12732 if test "$warn_report" = "true"; then
12733 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12735 if test "x$enable_postgresql_sdbc" != "xno"; then
12736 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the postgress database backend.])
12738 if test "$enable_lotuswordpro" = "yes"; then
12739 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12741 if test "$WITH_WEBDAV" = "neon"; then
12742 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12744 if test "x$enable_ext_mariadb_connector" = "xyes"; then
12745 AC_MSG_ERROR([need to --disable-ext-mariadb-connector - mariadb/mysql support.])
12747 if test -n "$ENABLE_PDFIMPORT"; then
12748 if test "x$SYSTEM_POPPLER" = "xNO"; then
12749 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12752 # cf. m4/libo_check_extension.m4
12753 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12754 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12756 for theme in $WITH_THEMES; do
12758 crystal|default|hicontrast|human|oxygen|sifr)
12759 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12763 if test "$enable_opengl" != "no" -o "x$ENABLE_OPENGL" = "xTRUE"; then
12764 AC_MSG_ERROR([need to --disable-opengl - GL transitions support.])
12766 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12767 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12771 AC_DEFINE(MPL_HAVE_SUBSET)
12772 AC_MSG_RESULT([only])
12774 AC_MSG_RESULT([no restrictions])
12776 AC_SUBST(MPL_SUBSET)
12779 dnl ===================================================================
12780 dnl Setting up the environment.
12781 dnl ===================================================================
12782 echo "setting up the build environment variables..."
12786 if test "$build_os" = "cygwin"; then
12787 if test "$DISABLE_ACTIVEX" = "TRUE"; then
12788 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12789 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12791 ATL_LIB="$COMPATH/atlmfc/lib"
12792 ATL_INCLUDE="$COMPATH/atlmfc/include"
12794 if test "$BITNESS_OVERRIDE" = 64; then
12795 ATL_LIB="$ATL_LIB/amd64"
12797 PathFormat "/usr/bin/grep.exe"
12798 WIN_GREP="$formatted_path"
12799 PathFormat "/usr/bin/find.exe"
12800 WIN_FIND="$formatted_path"
12801 PathFormat "/usr/bin/ls.exe"
12802 WIN_LS="$formatted_path"
12803 PathFormat "/usr/bin/touch.exe"
12804 WIN_TOUCH="$formatted_path"
12807 AC_SUBST(ATL_INCLUDE)
12812 AC_SUBST(WIN_TOUCH)
12814 AC_SUBST(BUILD_TYPE)
12820 PERL="$formatted_path"
12823 if test -n "$TMPDIR"; then
12824 TEMP_DIRECTORY="$TMPDIR"
12826 TEMP_DIRECTORY="/tmp"
12828 if test "$build_os" = "cygwin"; then
12829 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12831 AC_SUBST(TEMP_DIRECTORY)
12833 # setup the PATH for the environment
12834 if test -n "$LO_PATH_FOR_BUILD"; then
12835 LO_PATH="$LO_PATH_FOR_BUILD"
12841 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12842 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12843 pathmunge "$JAVA_HOME/bin" "after"
12848 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12849 pathmunge "$ASM_HOME" "before"
12850 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12851 pathmunge "$CSC_PATH" "before"
12852 pathmunge "$MIDL_PATH" "before"
12853 pathmunge "$AL_PATH" "before"
12854 pathmunge "$MSPDB_PATH" "before"
12855 if test "$BITNESS_OVERRIDE" = 64; then
12856 pathmunge "$COMPATH/bin/amd64" "before"
12857 pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12859 pathmunge "$COMPATH/bin" "before"
12860 pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12862 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12863 if test -d "$JAVA_HOME/jre/bin/client"; then
12864 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12866 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12867 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12869 pathmunge "$JAVA_HOME/bin" "before"
12874 pathmunge "/usr/css/bin" "before"
12875 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12876 pathmunge "$JAVA_HOME/bin" "after"
12881 pathmunge "$SRC_ROOT/solenv/bin" "before"
12882 pathmunge "." "before"
12887 # Generate a configuration md5 we can use for deps
12888 if test -f config_host.mk; then
12889 config_md5=`$MD5SUM config_host.mk | sed "s/ .*//"`
12892 AC_CONFIG_FILES([config_host.mk
12895 instsetoo_native/util/openoffice.lst
12896 sysui/desktop/macosx/Info.plist
12899 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12900 AC_CONFIG_HEADERS([config_host/config_clang.h])
12901 AC_CONFIG_HEADERS([config_host/config_eot.h])
12902 AC_CONFIG_HEADERS([config_host/config_features.h])
12903 AC_CONFIG_HEADERS([config_host/config_folders.h])
12904 AC_CONFIG_HEADERS([config_host/config_gcc.h])
12905 AC_CONFIG_HEADERS([config_host/config_global.h])
12906 AC_CONFIG_HEADERS([config_host/config_graphite.h])
12907 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12908 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12909 AC_CONFIG_HEADERS([config_host/config_orcus.h])
12910 AC_CONFIG_HEADERS([config_host/config_kde4.h])
12911 AC_CONFIG_HEADERS([config_host/config_mingw.h])
12912 AC_CONFIG_HEADERS([config_host/config_oox.h])
12913 AC_CONFIG_HEADERS([config_host/config_telepathy.h])
12914 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12915 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12916 AC_CONFIG_HEADERS([config_host/config_version.h])
12917 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12920 if test "$CROSS_COMPILING" = YES; then
12921 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12924 # touch the config timestamp file
12925 if test ! -f config_host.mk.stamp; then
12926 echo > config_host.mk.stamp
12927 elif test "$config_md5" = `$MD5SUM config_host.mk | sed "s/ .*//"`; then
12928 echo "Configuration unchanged - avoiding scp2 stamp update"
12930 echo > config_host.mk.stamp
12934 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12936 ****************************************************************************
12938 Your make version is known to be horribly slow, and hard to debug
12939 problems with. To get a reasonably functional make please do:
12941 to install a pre-compiled binary make for cygwin
12943 mkdir -p /opt/lo/bin
12945 wget http://dev-www.libreoffice.org/bin/cygwin/make
12948 to install from source:
12949 place yourself in a working directory of you choice.
12951 git clone git://anongit.freedesktop.org/libreoffice/contrib/dev-tools
12952 cd dev-tools/make-3.82-gbuild
12953 ./configure --prefix=/opt/lo
12957 Then re-run autogen.sh
12959 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12960 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12966 ****************************************************************************
12976 if test $_os != WINNT -a "$CROSS_COMPILING" != YES; then
12978 After the build has finished, your can immediately run it using:
12979 instdir/program/soffice
12981 If you want to run the smoketest, issue:
12987 if test -f warn; then
12992 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: