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],[5.2.0.0.alpha0+],[],[],[http://documentfoundation.org/])
16 if test -n "$BUILD_TYPE"; then
17 AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
25 GIT_NEEDED_SUBMODULES=""
26 LO_PATH= # used by path_munge to construct a PATH variable
33 # let's start with Fedora's paths for now
34 -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
35 # ignore it: on UNIXoids it is searched by default anyway
36 # but if it's given explicitly then it may override other paths
37 # (on Mac OS X it would be an error to use it instead of SDK)
40 filteredlibs="$filteredlibs $f"
49 if test "$build_os" = "cygwin"; then
51 # spaces,parentheses,brackets,braces are problematic in pathname
53 case "$formatted_path" in
54 *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
58 if test "$pf_conv_to_dos" = "yes"; then
59 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
60 formatted_path=`cygpath -sm "$formatted_path"`
62 formatted_path=`cygpath -d "$formatted_path"`
64 if test $? -ne 0; then
65 AC_MSG_ERROR([path conversion failed for "$1".])
68 fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
69 fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
70 if test "$fp_count_slash$fp_count_colon" != "00"; then
71 if test "$fp_count_colon" = "0"; then
72 new_formatted_path=`realpath "$formatted_path"`
73 if test $? -ne 0; then
74 AC_MSG_WARN([realpath failed for "$1", not necessarily a problem.])
76 formatted_path="$new_formatted_path"
79 formatted_path=`cygpath -m "$formatted_path"`
80 if test $? -ne 0; then
81 AC_MSG_ERROR([path conversion failed for "$1".])
89 # There appears to be no simple and portable method to get an absolute and
90 # canonical path, so we try creating the directory if does not exist and
91 # utilizing the shell and pwd.
94 test ! -e "$rel" && mkdir -p "$rel"
95 if test -d "$rel" ; then
96 cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
97 absolute_path="$(pwd)"
100 AC_MSG_ERROR([Failed to resolve absolute path. "$rel" does not exist or is not a directory.])
108 if test "$have_WARNINGS" = "no"; then
109 echo "*************************************" > warn
111 if which tput >/dev/null 2>/dev/null && test `tput colors` -ge 8; then
112 dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
113 COLORWARN='*
\e@<:@1;33;40m WARNING
\e@<:@0m:'
115 COLORWARN="* WARNING :"
118 echo "$COLORWARN $@" >> warn
121 dnl Some Mac User have the bad habbit of letting a lot fo crap
122 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
123 dnl that confuse the build.
124 dnl For the ones that use LODE, let's be nice and protect them
129 mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
130 dnl a common but nevertheless necessary thing that may be in a fancy
131 dnl path location is git, so make sure we have it
132 mac_git_path=`which git 2>/dev/null`
133 if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
134 mac_path="$mac_path:`dirname $mac_git_path`"
141 echo "********************************************************************"
143 echo "* Running ${PACKAGE_NAME} build configuration."
145 echo "********************************************************************"
148 dnl ===================================================================
149 dnl checks build and host OSes
150 dnl do this before argument processing to allow for platform dependent defaults
151 dnl ===================================================================
154 AC_MSG_CHECKING([for product name])
155 PRODUCTNAME="AC_PACKAGE_NAME"
156 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
157 PRODUCTNAME="${PRODUCTNAME}Dev"
159 AC_MSG_RESULT([$PRODUCTNAME])
160 AC_SUBST(PRODUCTNAME)
162 dnl ===================================================================
163 dnl Our version is defined by the AC_INIT() at the top of this script.
164 dnl ===================================================================
166 set `echo AC_PACKAGE_VERSION | sed "s/\./ /g"`
168 LIBO_VERSION_MAJOR=$1
169 LIBO_VERSION_MINOR=$2
170 LIBO_VERSION_MICRO=$3
171 LIBO_VERSION_PATCH=$4
173 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
174 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
175 # no way to encode that into an integer in general.
176 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
178 LIBO_VERSION_SUFFIX=$5
179 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
180 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
181 # they get undoubled before actually passed to sed.
182 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
183 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
184 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
185 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
187 AC_SUBST(LIBO_VERSION_MAJOR)
188 AC_SUBST(LIBO_VERSION_MINOR)
189 AC_SUBST(LIBO_VERSION_MICRO)
190 AC_SUBST(LIBO_VERSION_PATCH)
191 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
192 AC_SUBST(LIBO_VERSION_SUFFIX)
193 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
195 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
196 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
197 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
198 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
200 LIBO_THIS_YEAR=`date +%Y`
201 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
203 dnl ===================================================================
205 dnl ===================================================================
206 AC_MSG_CHECKING([for product version])
207 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
208 AC_MSG_RESULT([$PRODUCTVERSION])
209 AC_SUBST(PRODUCTVERSION)
212 # AC_PROG_EGREP doesn't set GREP on all systems as well
213 AC_PATH_PROG(GREP, grep)
221 dnl ======================================
222 dnl Required GObject introspection version
223 dnl ======================================
224 INTROSPECTION_REQUIRED_VERSION=1.32.0
226 dnl ===================================================================
227 dnl Search all the common names for GNU Make
228 dnl ===================================================================
229 AC_MSG_CHECKING([for GNU Make])
231 # try to use our own make if it is available and GNUMAKE was not already defined
232 if test -z "$GNUMAKE"; then
233 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
234 GNUMAKE="$LODE_HOME/opt/bin/make"
235 elif test -x "/opt/lo/bin/make"; then
236 GNUMAKE="/opt/lo/bin/make"
241 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
242 if test -n "$a"; then
243 $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
244 if test $? -eq 0; then
245 if test "$build_os" = "cygwin"; then
246 if test -n "$($a -v | grep 'Built for Windows')" ; then
247 GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
248 GNUMAKE_WIN_NATIVE="TRUE"
259 AC_MSG_RESULT($GNUMAKE)
260 if test -z "$GNUMAKE"; then
261 AC_MSG_ERROR([not found. install GNU Make.])
263 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
264 AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
268 win_short_path_for_make()
270 local_short_path="$1"
271 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
272 cygpath -sm "$local_short_path"
274 cygpath -u "$(cygpath -d "$local_short_path")"
279 if test "$build_os" = "cygwin"; then
280 PathFormat "$SRC_ROOT"
281 SRC_ROOT="$formatted_path"
282 PathFormat "$BUILDDIR"
283 BUILDDIR="$formatted_path"
285 AC_MSG_CHECKING(for explicit COMSPEC)
286 if test -z "$COMSPEC"; then
287 AC_MSG_ERROR([COMSPEC not set in Environment, please set it an rerun])
294 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
295 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
297 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
298 AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
301 # need sed in os checks...
302 AC_PATH_PROGS(SED, sed)
303 if test -z "$SED"; then
304 AC_MSG_ERROR([install sed to run this script])
307 # Set the ENABLE_LTO variable
308 # ===================================================================
309 AC_MSG_CHECKING([whether to use link-time optimization])
310 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
313 AC_DEFINE(STATIC_LINKING)
320 dnl ===================================================================
321 dnl When building for Android, --with-android-ndk,
322 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
324 dnl ===================================================================
326 AC_ARG_WITH(android-ndk,
327 AS_HELP_STRING([--with-android-ndk],
328 [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
331 AC_ARG_WITH(android-ndk-toolchain-version,
332 AS_HELP_STRING([--with-android-ndk-toolchain-version],
333 [Specify which toolchain version to use, of those present in the
334 Android NDK you are using. The default is 4.9 currently.]), ,)
336 AC_ARG_WITH(android-sdk,
337 AS_HELP_STRING([--with-android-sdk],
338 [Specify location of the Android SDK. Mandatory when building for Android,
339 or when building the Impress Remote Android app.]),
343 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
344 with_android_ndk="$SRC_ROOT/external/android-ndk"
346 if test -n "$with_android_ndk"; then
347 ANDROID_NDK_HOME=$with_android_ndk
349 # Set up a lot of pre-canned defaults
351 if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
352 AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT file in $ANDROID_NDK_HOME.])
354 ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
356 case $ANDROID_NDK_VERSION in
360 AC_MSG_ERROR([Unsupported NDK version $ANDROID_NDK_VERSION, only r9* and r10* versions are supported])
364 if test $host_cpu = arm; then
366 android_platform_prefix=$android_cpu-linux-androideabi
367 elif test $host_cpu = aarch64; then
369 android_platform_prefix=$android_cpu-linux-android
370 elif test $host_cpu = mips; then
372 android_platform_prefix=$android_cpu-linux-androideabi
374 # host_cpu is something like "i386" or "i686" I guess, NDK uses
375 # "x86" in some contexts
377 android_platform_prefix=$android_cpu
380 if test -z "$with_android_ndk_toolchain_version"; then
382 with_android_ndk_toolchain_version=4.9
385 case "$with_android_ndk_toolchain_version" in
387 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$with_android_ndk_toolchain_version
388 ANDROID_COMPILER_DIR=$ANDROID_BINUTILS_DIR
391 AC_MSG_WARN([Building with the Clang tool-chain is known to break in the bridges module, fix that please])
392 ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-4.8
393 ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm-${with_android_ndk_toolchain_version#clang}
394 ANDROID_USING_CLANG=true
397 AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option])
400 if test ! -d $ANDROID_BINUTILS_DIR; then
401 AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
402 elif test $ANDROID_COMPILER_DIR != $ANDROID_BINUTILS_DIR -a ! -d $ANDROID_COMPILER_DIR; then
403 AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
406 # Check if there is a 64-bit tool-chain. Google provides a NDK with 64-bit tool-chain binaries in
407 # NDK r8e and later, and for earlier NDKs it was possible to build one yourself. Using a 64-bit
408 # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
409 # manage to link the (app-specific) single huge .so that is built for the app in
410 # android/source/ if there is debug information in a significant part of the object files.
411 # (A 64-bit ld.gold grows to much over 10 gigabytes of virtual space when linking such a .so if
412 # all objects have been built with debug information.)
422 AC_MSG_ERROR([We only support building for Android from Linux or OS X])
426 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86/bin
427 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86
428 if test $build_cpu = x86_64; then
429 if test -d $ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64; then
430 ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64/bin
432 if test -d $ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64; then
433 ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64
436 ANDROID_BINUTILS_BIN=$ANDROID_BINUTILS_PREBUILT_ROOT/bin
438 # This stays empty if there is just one version of the toolchain in the NDK
439 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=
440 case "`echo $ANDROID_NDK_HOME/toolchains/$android_cpu*-*/prebuilt/*/bin`" in
442 # Trailing slash intentional and necessary, compare to how this is used
443 if test -n "$ANDROID_USING_CLANG"; then
444 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=4.8/
446 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
452 if test $host_cpu = arm; then
453 android_gnu_prefix=arm-linux-androideabi
454 elif test $host_cpu = aarch64; then
455 android_gnu_prefix=aarch64-linux-android
456 ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
458 elif test $host_cpu = mips; then
459 android_gnu_prefix=mipsel-linux-android
460 elif test $ANDROID_NDK_VERSION = r8; then
461 # The prefix used for the x86 tool-chain changed between NDK r8 and r8b
462 android_gnu_prefix=i686-android-linux
464 android_gnu_prefix=i686-linux-android
467 ANDROID_ARCH=$android_cpu
468 if test $host_cpu = arm; then
469 ANDROID_APP_ABI=armeabi-v7a
470 if test -n "$ANDROID_USING_CLANG"; then
471 ANDROIDCFLAGS="-gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT"
472 ANDROIDCFLAGS="$ANDROIDCFLAGS -target armv7-none-linux-androideabi"
473 ANDROIDCFLAGS="$ANDROIDCFLAGS -no-canonical-prefixes"
477 ANDROIDCFLAGS="$ANDROIDCFLAGS -mthumb"
478 ANDROIDCFLAGS="$ANDROIDCFLAGS -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
479 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wl,--fix-cortex-a8"
480 elif test $host_cpu = aarch64; then
481 ANDROID_APP_ABI=arm64-v8a
483 elif test $host_cpu = mips; then
488 ANDROIDCFLAGS="-march=atom"
490 ANDROIDCFLAGS="$ANDROIDCFLAGS -ffunction-sections -fdata-sections"
491 ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/$ANDROID_APP_ABI"
492 ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}"
493 export PKG_CONFIG_LIBDIR="$ANDROID_BINUTILS_PREBUILT_ROOT/lib/pkgconfig"
495 if test -n "$ANDROID_USING_CLANG"; then
496 ANDROIDCFLAGS="$ANDROIDCFLAGS -Qunused-arguments"
498 ANDROIDCFLAGS="$ANDROIDCFLAGS -Wno-psabi"
501 test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}
502 test -z "$AR" && AR=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ar
503 test -z "$NM" && NM=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-nm
504 test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-objdump
505 test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-ranlib
506 test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_BIN/$android_gnu_prefix-strip
508 # When using the 4.6 or newer toolchain, use the gold linker
509 case "$with_android_ndk_toolchain_version" in
510 4.[[6789]]*|[[56789]].*|clang*)
511 if test "$host_cpu" = arm -a "$ENABLE_LTO" != TRUE; then
512 ANDROIDCFLAGS="$ANDROIDCFLAGS -fuse-ld=gold"
517 if test "$ENABLE_LTO" = TRUE; then
518 # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
519 # $CC and $CXX when building external libraries
520 if test "$COM_IS_CLANG" = TRUE; then
521 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto"
523 ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
527 # gdbserver can be in different locations
528 if test -f $ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver; then
529 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver
530 elif test -f $ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver; then
531 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver
532 elif test $android_cpu = aarch64; then
533 ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-arm64/gdbserver/gdbserver
535 AC_MSG_ERROR([Can't find gdbserver for your Android target])
538 if test $host_cpu = arm; then
539 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"
540 elif test $host_cpu = mips; then
541 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"
543 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"
546 if test -z "$CC"; then
547 case "$with_android_ndk_toolchain_version" in
549 CC="$ANDROID_COMPILER_BIN/$android_gnu_prefix-gcc $ANDROIDCFLAGS"
552 CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
555 if test -z "$CXX"; then
556 case "$with_android_ndk_toolchain_version" in
558 CXX="$ANDROID_COMPILER_BIN/$android_gnu_prefix-g++ $ANDROIDCXXFLAGS"
561 CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
566 # remember to download the ownCloud Android library later
567 BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
569 AC_SUBST(ANDROID_NDK_GDBSERVER)
570 AC_SUBST(ANDROID_APP_ABI)
572 dnl ===================================================================
573 dnl --with-android-sdk
574 dnl ===================================================================
576 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
577 with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
579 if test -n "$with_android_sdk"; then
580 ANDROID_SDK_HOME=$with_android_sdk
581 PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
583 AC_SUBST(ANDROID_SDK_HOME)
585 dnl ===================================================================
586 dnl The following is a list of supported systems.
587 dnl Sequential to keep the logic very simple
588 dnl These values may be checked and reset later.
589 dnl ===================================================================
590 #defaults unless the os test overrides this:
598 # Default values, as such probably valid just for Linux, set
599 # differently below just for Mac OSX,but at least better than
600 # hardcoding these as we used to do. Much of this is duplicated also
601 # in solenv for old build system and for gbuild, ideally we should
602 # perhaps define stuff like this only here in configure.ac?
604 LINKFLAGSSHL="-shared"
608 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
617 build_gstreamer_1_0=yes
618 build_gstreamer_0_10=yes
623 dnl ===========================================================
624 dnl Check whether we're using Solaris 10 - SPARC or Intel.
625 dnl ===========================================================
626 AC_MSG_CHECKING([the Solaris operating system release])
627 _os_release=`echo $host_os | $SED -e s/solaris2\.//`
628 if test "$_os_release" -lt "10"; then
629 AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
631 AC_MSG_RESULT([ok ($_os_release)])
634 dnl Check whether we're using a SPARC or i386 processor
635 AC_MSG_CHECKING([the processor type])
636 if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
637 AC_MSG_RESULT([ok ($host_cpu)])
639 AC_MSG_ERROR([only SPARC and i386 processors are supported])
643 linux-gnu*|k*bsd*-gnu*)
645 build_gstreamer_1_0=yes
646 build_gstreamer_0_10=yes
659 cygwin*|interix*|mingw32*)
661 # When building on Windows normally with MSVC under Cygwin,
662 # configure thinks that the host platform (the platform the
663 # built code will run on) is Cygwin, even if it obviously is
664 # Windows, which in Autoconf terminology is called
665 # "mingw32". (Which is misleading as MinGW is the name of the
666 # tool-chain, not an operating system.)
668 # Somewhat confusing, yes. But this configure script doesn't
669 # look at $host etc that much, it mostly uses its own $_os
670 # variable, set here in this case statement.
672 # When cross-compiling to Windows from Unix, the host platform
673 # is "mingw32" (because in that case it is the MinGW
674 # tool-chain that is used).
687 # If the host OS matches "mingw32*", that means we are using the
688 # MinGW cross-compiler, because we don't see the point in building
689 # LibreOffice using MinGW on Windows. If you want to build on
690 # Windows, use MSVC. If you want to use MinGW, surely you want to
691 # cross-compile (from Linux or some other Unix).
696 if test -z "$CC"; then
697 CC="$host_cpu-$host_vendor-$host_os-gcc"
699 if test -z "$CXX"; then
700 CXX="$host_cpu-$host_vendor-$host_os-g++"
706 darwin*) # Mac OS X or iOS
713 if test "$host_cpu" = "arm"; then
719 if test -n "$LODE_HOME" ; then
721 AC_MSG_NOTICE([sanitized the PATH to $PATH])
723 INSTROOTSUFFIX=/$PRODUCTNAME.app/Contents
724 SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
727 # See comment above the case "$host_os"
728 LINKFLAGSSHL="-dynamiclib -single_module"
735 # -undefined error is the default
741 build_gstreamer_1_0=yes
742 build_gstreamer_0_10=yes
746 AC_MSG_CHECKING([the FreeBSD operating system release])
747 if test -n "$with_os_version"; then
748 OSVERSION="$with_os_version"
750 OSVERSION=`/sbin/sysctl -n kern.osreldate`
752 AC_MSG_RESULT([found OSVERSION=$OSVERSION])
753 AC_MSG_CHECKING([which thread library to use])
754 if test "$OSVERSION" -lt "500016"; then
755 PTHREAD_CFLAGS="-D_THREAD_SAFE"
756 PTHREAD_LIBS="-pthread"
757 elif test "$OSVERSION" -lt "502102"; then
758 PTHREAD_CFLAGS="-D_THREAD_SAFE"
762 PTHREAD_LIBS="-pthread"
764 AC_MSG_RESULT([$PTHREAD_LIBS])
770 build_gstreamer_1_0=yes
771 build_gstreamer_0_10=yes
775 PTHREAD_LIBS="-pthread -lpthread"
782 PTHREAD_LIBS=-pthread
790 PTHREAD_CFLAGS="-D_THREAD_SAFE"
791 PTHREAD_LIBS="-pthread"
797 build_gstreamer_1_0=yes
798 build_gstreamer_0_10=yes
802 PTHREAD_LIBS="-pthread"
807 build_gstreamer_1_0=no
808 build_gstreamer_0_10=no
809 enable_lotuswordpro=no
810 enable_mpl_subset=yes
813 enable_report_builder=no
815 enable_postgresql_sdbc=no
829 if test -z "$with_android_ndk"; then
830 AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
833 if test -z "$with_android_ndk_toolchain_version"; then
834 AC_MSG_ERROR([the --with-android-ndk-toolchain-version option is mandatory])
837 # Verify that the NDK and SDK options are proper
838 if test ! -f "$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}/usr/lib/libc.a"; then
839 AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
842 AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
843 BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
847 build_gstreamer_1_0=no
848 build_gstreamer_0_10=no
849 enable_lotuswordpro=no
850 enable_mpl_subset=yes
853 enable_report_builder=no
868 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
872 if echo "$host_os" | grep -q linux-android ; then
873 if test -z "$with_android_sdk"; then
874 AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
877 if test ! -d "$ANDROID_SDK_HOME/platforms"; then
878 AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
881 BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
882 if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
883 AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
884 $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
885 or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
886 add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
887 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
888 add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
890 if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
891 AC_MSG_WARN([android support repository not found - install with
892 $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
893 to allow the build to download the specified version of the android support libraries])
894 add_warning "android support repository not found - install with"
895 add_warning " $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
896 add_warning "to allow the build to download the specified version of the android support libraries"
900 if test "$_os" = "AIX"; then
901 AC_PATH_PROG(GAWK, gawk)
902 if test -z "$GAWK"; then
903 AC_MSG_ERROR([gawk not found in \$PATH])
910 AC_SUBST(PTHREAD_CFLAGS)
911 AC_SUBST(PTHREAD_LIBS)
913 if test $_os != "WINNT"; then
915 AC_SEARCH_LIBS([dlsym], [dl],
916 [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
917 [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
920 AC_SUBST(DLOPEN_LIBS)
922 ###############################################################################
923 # Extensions switches --enable/--disable
924 ###############################################################################
925 # By default these should be enabled unless having extra dependencies.
926 # If there is extra dependency over configure options then the enable should
927 # be automagic based on whether the requiring feature is enabled or not.
928 # All this options change anything only with --enable-extension-integration.
930 # The name of this option and its help string makes it sound as if
931 # extensions are built anyway, just not integrated in the installer,
932 # if you use --disable-extension-integration. Is that really the
935 AC_ARG_ENABLE(extension-integration,
936 AS_HELP_STRING([--disable-extension-integration],
937 [Disable integration of the built extensions in the installer of the
938 product. Use this switch to disable the integration.])
941 AC_ARG_ENABLE(export,
942 AS_HELP_STRING([--disable-export],
943 [Disable (some) code for document export. Useful when building viewer-only apps that lack
944 save/export functionality, to avoid having an excessive amount of code and data used
945 only for exporrt linked in. Work in progress, use only if you are hacking on it.])
948 AC_ARG_ENABLE(avmedia,
949 AS_HELP_STRING([--disable-avmedia],
950 [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
953 AC_ARG_ENABLE(database-connectivity,
954 AS_HELP_STRING([--disable-database-connectivity],
955 [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
958 # This doesn't mean not building (or "integrating") extensions
959 # (although it probably should; i.e. it should imply
960 # --disable-extension-integration I guess), it means not supporting
961 # any extension mechanism at all
962 AC_ARG_ENABLE(extensions,
963 AS_HELP_STRING([--disable-extensions],
964 [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
967 AC_ARG_ENABLE(scripting,
968 AS_HELP_STRING([--disable-scripting],
969 [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
972 # This is mainly for Android and iOS, but could potentially be used in some
973 # special case otherwise, too, so factored out as a separate setting
975 AC_ARG_ENABLE(dynamic-loading,
976 AS_HELP_STRING([--disable-dynamic-loading],
977 [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
980 AC_ARG_ENABLE(ext-mariadb-connector,
981 AS_HELP_STRING([--enable-ext-mariadb-connector],
982 [Enable the build of the MariaDB/MySQL Connector extension.])
985 AC_ARG_ENABLE(report-builder,
986 AS_HELP_STRING([--disable-report-builder],
987 [Disable the Report Builder.])
990 AC_ARG_ENABLE(ext-wiki-publisher,
991 AS_HELP_STRING([--enable-ext-wiki-publisher],
992 [Enable the Wiki Publisher extension.])
995 AC_ARG_ENABLE(lpsolve,
996 AS_HELP_STRING([--disable-lpsolve],
997 [Disable compilation of the lp solve solver ])
999 AC_ARG_ENABLE(coinmp,
1000 AS_HELP_STRING([--disable-coinmp],
1001 [Disable compilation of the CoinMP solver ])
1004 AC_ARG_ENABLE(pdfimport,
1005 AS_HELP_STRING([--disable-pdfimport],
1006 [Disable building the PDF import feature.])
1009 ###############################################################################
1011 dnl ---------- *** ----------
1013 AC_ARG_ENABLE([hardlink-deliver],
1014 AS_HELP_STRING([--enable-hardlink-deliver],
1015 [Put files into deliver folder as hardlinks instead of copying them
1016 over. Saves space and speeds up build.])
1019 AC_ARG_ENABLE(mergelibs,
1020 AS_HELP_STRING([--enable-mergelibs],
1021 [Enables linking of big, merged, library. Experimental feature, tested
1022 only for Linux at some stage in history, but possibly does not work even
1023 for Linux any more. This will link a core set of libraries into libmerged.])
1026 AC_ARG_ENABLE(graphite,
1027 AS_HELP_STRING([--disable-graphite],
1028 [Disables the compilation of Graphite smart font rendering.])
1031 AC_ARG_ENABLE(orcus,
1032 AS_HELP_STRING([--enable-orcus],
1033 [Enables orcus for extra file import filters for Calc.])
1036 AC_ARG_ENABLE(fetch-external,
1037 AS_HELP_STRING([--disable-fetch-external],
1038 [Disables fetching external tarballs from web sources.])
1042 AS_HELP_STRING([--enable-pch],
1043 [Enables precompiled header support for C++. Forced default on Windows/VC build])
1047 AS_HELP_STRING([--enable-epm],
1048 [LibreOffice includes self-packaging code, that requires epm, however epm is
1049 useless for large scale package building.])
1053 AS_HELP_STRING([--disable-odk],
1054 [LibreOffice includes an ODK, office development kit which some packagers may
1055 wish to build without.])
1058 AC_ARG_ENABLE(mpl-subset,
1059 AS_HELP_STRING([--enable-mpl-subset],
1060 [Don't compile any pieces which are not MPL or more liberally licensed])
1063 AC_ARG_ENABLE(evolution2,
1064 AS_HELP_STRING([--enable-evolution2],
1065 [Allows the built-in evolution 2 addressbook connectivity build to be
1069 AC_ARG_ENABLE(directx,
1070 AS_HELP_STRING([--disable-directx],
1071 [Remove DirectX implementation for the new XCanvas interface.
1072 The DirectX support requires more stuff installed on Windows to
1073 compile. (DirectX SDK, GDI+ libs)])
1076 AC_ARG_ENABLE(activex,
1077 AS_HELP_STRING([--disable-activex],
1078 [Disable the use of ActiveX for a Windows build.
1079 This switch is mandatory when using an Express edition of Visual Studio.])
1083 AS_HELP_STRING([--disable-atl],
1084 [Disable the use of ATL for a Windows build.])
1086 This switch is mandatory when using an Express edition of Visual Studio.
1090 AC_ARG_ENABLE(avahi,
1091 AS_HELP_STRING([--enable-avahi],
1092 [Determines whether to use Avahi to advertise Impress to remote controls.]),
1095 AC_ARG_ENABLE(werror,
1096 AS_HELP_STRING([--enable-werror],
1097 [Turn warnings to errors. (Has no effect in modules where the treating
1098 of warnings as errors is disabled explicitly.)]),
1101 AC_ARG_ENABLE(assert-always-abort,
1102 AS_HELP_STRING([--enable-assert-always-abort],
1103 [make assert() abort even in release code.]),
1106 AC_ARG_ENABLE(dbgutil,
1107 AS_HELP_STRING([--enable-dbgutil],
1108 [Provide debugging support from --enable-debug and include additional debugging
1109 utilities such as object counting or more expensive checks.
1110 This is the recommended option for developers.
1111 Note that this makes the build ABI incompatible, it is not possible to mix object
1112 files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
1114 AC_ARG_ENABLE(debug,
1115 AS_HELP_STRING([--enable-debug],
1116 [Include debugging information, disable compiler optimization and inlining plus
1117 extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
1119 AC_ARG_ENABLE(sal-log,
1120 AS_HELP_STRING([--enable-sal-log],
1121 [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
1123 AC_ARG_ENABLE(selective-debuginfo,
1124 AS_HELP_STRING([--enable-selective-debuginfo],
1125 [If --enable-debug or --enable-dbgutil is used, build debugging information
1126 (-g compiler flag) only for the specified gbuild build targets
1127 (where all means everything, - prepended means not to enable, / appended means
1128 everything in the directory; there is no ordering, more specific overrides
1129 more general, and disabling takes precedence).
1130 Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
1132 AC_ARG_ENABLE(symbols,
1133 AS_HELP_STRING([--enable-symbols],
1134 [Include debugging symbols in output while preserve optimization.
1135 This enables -g compiler flag for GCC or equivalent,
1136 without changing anything else compared to productive code.]))
1138 AC_ARG_ENABLE(runtime-optimizations,
1139 AS_HELP_STRING([--disable-runtime-optimizations],
1140 [Statically disable certain runtime optimizations (like rtl/alloc.h or
1141 JVM JIT) that are known to interact badly with certain dynamic analysis
1142 tools (like -fsanitize=address or Valgrind). By default, disabled iff
1143 CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations
1144 are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
1146 AC_ARG_ENABLE(compiler-plugins,
1147 AS_HELP_STRING([--enable-compiler-plugins],
1148 [Enable compiler plugins that will perform additional checks during
1149 building. Enabled automatically by --enable-dbgutil.]))
1151 AC_ARG_ENABLE(ooenv,
1152 AS_HELP_STRING([--disable-ooenv],
1153 [Disable ooenv for the instdir installation.]))
1156 AS_HELP_STRING([--enable-lto],
1157 [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
1158 longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
1159 linker. For MSVC, this option is broken at the moment. This is experimental work
1160 in progress that shouldn't be used unless you are working on it.)]))
1162 AC_ARG_ENABLE(crashdump,
1163 AS_HELP_STRING([--enable-crashdump],
1164 [Enable the crashdump feature.]))
1166 AC_ARG_ENABLE(python,
1167 AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
1168 [Enables or disables Python support at run-time and build-time.
1169 Also specifies what Python to use. 'auto' is the default.
1170 'fully-internal' even forces the internal version for uses of Python
1171 during the build.]))
1174 AS_HELP_STRING([--disable-gtk],
1175 [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
1179 AS_HELP_STRING([--enable-gtk3],
1180 [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.
1181 This is experimental and may not work.]),
1184 AC_ARG_ENABLE(systray,
1185 AS_HELP_STRING([--disable-systray],
1186 [Determines whether to build the systray quickstarter.]),
1187 ,enable_systray=yes)
1189 AC_ARG_ENABLE(split-app-modules,
1190 AS_HELP_STRING([--enable-split-app-modules],
1191 [Split file lists for app modules, e.g. base, calc.
1192 Has effect only with make distro-pack-install]),
1195 AC_ARG_ENABLE(split-opt-features,
1196 AS_HELP_STRING([--enable-split-opt-features],
1197 [Split file lists for some optional features, .e.g. pyuno, testtool.
1198 Has effect only with make distro-pack-install]),
1201 AC_ARG_ENABLE(cairo-canvas,
1202 [ --disable-cairo-canvas Determines whether to build the Cairo canvas on
1203 platforms where Cairo is available.
1207 AS_HELP_STRING([--disable-dbus],
1208 [Determines whether to enable features that depend on dbus.
1209 e.g. Presentation mode screensaver control, bluetooth presentation control]),
1212 AC_ARG_ENABLE(packagekit,
1213 AS_HELP_STRING([--enable-packagekit],
1214 [Determines whether to enable features using packagekit.
1215 Right now that is auto font install]),
1218 AC_ARG_ENABLE(sdremote,
1219 AS_HELP_STRING([--disable-sdremote],
1220 [Determines whether to enable Impress remote control (i.e. the server component).]),
1221 ,enable_sdremote=yes)
1223 AC_ARG_ENABLE(sdremote-bluetooth,
1224 AS_HELP_STRING([--disable-sdremote-bluetooth],
1225 [Determines whether to build sdremote with bluetooth support.
1226 Requires dbus on Linux.]))
1229 AS_HELP_STRING([--disable-gio],
1230 [Determines whether to use the GIO support.]),
1233 AC_ARG_ENABLE(telepathy,
1234 AS_HELP_STRING([--enable-telepathy],
1235 [Determines whether to enable Telepathy for collaboration.]),
1236 ,enable_telepathy=no)
1239 AS_HELP_STRING([--enable-tde],
1240 [Determines whether to use TQt/TDE vclplug on platforms where TQt and
1241 TDE are available.]),
1244 AC_ARG_ENABLE(tdeab,
1245 AS_HELP_STRING([--disable-tdeab],
1246 [Disable the TDE address book support.]),
1248 if test "$enable_tde" = "yes"; then
1254 AS_HELP_STRING([--enable-kde4],
1255 [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
1256 KDE4 are available.]),
1259 AC_ARG_ENABLE(randr,
1260 AS_HELP_STRING([--disable-randr],
1261 [Disable RandR support in the vcl project.]),
1264 AC_ARG_ENABLE(gstreamer-1-0,
1265 AS_HELP_STRING([--disable-gstreamer-1-0],
1266 [Disable building with the new gstreamer 1.0 avmedia backend.]),
1267 ,enable_gstreamer_1_0=yes)
1269 AC_ARG_ENABLE(gstreamer-0-10,
1270 AS_HELP_STRING([--enable-gstreamer-0-10],
1271 [Enable building with the gstreamer 0.10 avmedia backend.]),
1272 ,enable_gstreamer_0_10=no)
1275 AS_HELP_STRING([--enable-vlc],
1276 [Enable building with the (experimental) VLC avmedia backend.]),
1280 AS_HELP_STRING([--disable-neon],
1281 [Disable neon and the compilation of webdav binding.]),
1284 AC_ARG_ENABLE([eot],
1285 [AS_HELP_STRING([--enable-eot],
1286 [Enable support for Embedded OpenType fonts.])],
1289 AC_ARG_ENABLE(cve-tests,
1290 AS_HELP_STRING([--disable-cve-tests],
1291 [Prevent CVE tests to be executed]),
1294 AC_ARG_ENABLE(chart-tests,
1295 AS_HELP_STRING([--enable-chart-tests],
1296 [Executes chart XShape tests. In a perfect world these tests would be
1297 stable and everyone could run them, in reality it is best to run them
1298 only on a few machines that are known to work and maintained by people
1299 who can judge if a test failure is a regression or not.]),
1302 AC_ARG_ENABLE(build-unowinreg,
1303 AS_HELP_STRING([--enable-build-unowinreg],
1304 [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
1305 compiler is needed on Linux.])
1307 Usage: --enable-build-unowinreg
1311 AC_ARG_ENABLE(dependency-tracking,
1312 AS_HELP_STRING([--enable-dependency-tracking],
1313 [Do not reject slow dependency extractors.])[
1314 --disable-dependency-tracking
1315 Disables generation of dependency information.
1316 Speed up one-time builds.],
1319 AC_ARG_ENABLE(icecream,
1320 AS_HELP_STRING([--enable-icecream],
1321 [Use the 'icecream' distributed compiling tool to speedup the compilation.
1322 It defaults to /opt/icecream for the location of the icecream gcc/g++
1323 wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1327 AS_HELP_STRING([--disable-cups],
1328 [Do not build cups support.])
1331 AC_ARG_ENABLE(ccache,
1332 AS_HELP_STRING([--disable-ccache],
1333 [Do not try to use ccache automatically.
1334 By default, unless on Windows, we will try to detect if ccache is available; in that case if
1335 CC/CXX are not yet set, and --enable-icecream is not given, we
1336 attempt to use ccache. --disable-ccache disables ccache completely.
1340 AC_ARG_ENABLE(64-bit,
1341 AS_HELP_STRING([--enable-64-bit],
1342 [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
1343 At the moment meaningful only for iOS and Windows. On Windows this option is
1344 experimental and possibly quite broken, and you should use it only if you are
1345 hacking on 64-bitness support.]), ,)
1347 AC_ARG_ENABLE(extra-gallery,
1348 AS_HELP_STRING([--enable-extra-gallery],
1349 [Add extra gallery content.]),
1352 AC_ARG_ENABLE(extra-template,
1353 AS_HELP_STRING([--enable-extra-template],
1354 [Add extra template content.]),
1357 AC_ARG_ENABLE(extra-sample,
1358 AS_HELP_STRING([--enable-extra-sample],
1359 [Add extra sample content.]),
1362 AC_ARG_ENABLE(extra-font,
1363 AS_HELP_STRING([--enable-extra-font],
1364 [Add extra font content.]),
1367 AC_ARG_ENABLE(online-update,
1368 AS_HELP_STRING([--enable-online-update],
1369 [Enable the online update service that will check for new versions of
1370 LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
1371 If the value is "mar", the experimental Mozilla-like update will be
1372 enabled instead of the traditional update mechanism.]),
1375 AC_ARG_ENABLE(extension-update,
1376 AS_HELP_STRING([--disable-extension-update],
1377 [Disable possibility to update installed extensions.]),
1380 AC_ARG_ENABLE(release-build,
1381 AS_HELP_STRING([--enable-release-build],
1382 [Enable release build.
1383 See http://wiki.documentfoundation.org/DevBuild]),
1386 AC_ARG_ENABLE(windows-build-signing,
1387 AS_HELP_STRING([--enable-windows-build-signing],
1388 [Enable signing of windows binaries (*.exe, *.dll)]),
1391 AC_ARG_ENABLE(silent-msi,
1392 AS_HELP_STRING([--enable-silent-msi],
1393 [Enable MSI with LIMITUI=1 (silent install).]),
1396 AC_ARG_ENABLE(macosx-code-signing,
1397 AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
1398 [Sign executables, dylibs, frameworks and the app bundle. If you
1399 don't provide an identity the first suitable certificate
1400 in your keychain is used.]),
1403 AC_ARG_ENABLE(macosx-package-signing,
1404 AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
1405 [Create a .pkg suitable for uploading to the Mac App Store and sign
1406 it. If you don't provide an identity the first suitable certificate
1407 in your keychain is used.]),
1410 AC_ARG_ENABLE(macosx-sandbox,
1411 AS_HELP_STRING([--enable-macosx-sandbox],
1412 [Make the app bundle run in a sandbox. Requires code signing.
1413 Is required by apps distributed in the Mac App Store, and implies
1414 adherence to App Store rules.]),
1417 AC_ARG_WITH(macosx-bundle-identifier,
1418 AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
1419 [Define the OS X bundle identifier. Default is the somewhat weird
1420 org.libreoffice.script ("script", huh?).]),
1421 ,with_macosx_bundle_identifier=org.libreoffice.script)
1423 AC_ARG_WITH(macosx-app-name,
1424 AS_HELP_STRING([--with-macosx-app-name='My Own Office Suite'],
1425 [Define the OS X app name. Default is AC_PACKAGE_NAME.]),
1426 ,with_macosx_app_name=$PRODUCTNAME)
1428 AC_ARG_ENABLE(ios-simulator,
1429 AS_HELP_STRING([--enable-ios-simulator],
1430 [Build for the iOS Simulator, not iOS device.]),
1433 AC_ARG_ENABLE(readonly-installset,
1434 AS_HELP_STRING([--enable-readonly-installset],
1435 [Prevents any attempts by LibreOffice to write into its installation. That means
1436 at least that no "system-wide" extensions can be added. Experimental work in
1440 AC_ARG_ENABLE(postgresql-sdbc,
1441 AS_HELP_STRING([--disable-postgresql-sdbc],
1442 [Disable the build of the PostgreSQL-SDBC driver.])
1445 AC_ARG_ENABLE(lotuswordpro,
1446 AS_HELP_STRING([--disable-lotuswordpro],
1447 [Disable the build of the Lotus Word Pro filter.]),
1448 ,enable_lotuswordpro=yes)
1450 AC_ARG_ENABLE(firebird-sdbc,
1451 AS_HELP_STRING([--disable-firebird-sdbc],
1452 [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
1455 AC_ARG_ENABLE(winegcc,
1456 AS_HELP_STRING([--enable-winegcc],
1457 [Enable use of winegcc during the build, in order to create msi* tools
1458 needed for MinGW cross-compilation.]),
1461 AC_ARG_ENABLE(liblangtag,
1462 AS_HELP_STRING([--disable-liblangtag],
1463 [Disable use of liblangtag, and instead use an own simple
1467 AC_ARG_ENABLE(bogus-pkg-config,
1468 AS_HELP_STRING([--enable-bogus-pkg-config],
1469 [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.]),
1472 AC_ARG_ENABLE(openssl,
1473 AS_HELP_STRING([--disable-openssl],
1474 [Disable using libssl/libcrypto from OpenSSL. If disabled,
1475 components will either use GNUTLS or NSS. Work in progress,
1476 use only if you are hacking on it.]),
1477 ,enable_openssl=yes)
1479 AC_ARG_WITH(prebuilt-openssl,
1480 AS_HELP_STRING([--with-prebuilt-openssl],
1481 [Don't build OpenSSL but use prebuilt binaries. Only for use on Windows, when you can't build it,
1482 thanks to the Cygwin fork() problem when running the Perl disaster in OpenSSL's build system.]))
1484 AC_ARG_ENABLE(library-bin-tar,
1485 AS_HELP_STRING([--enable-library-bin-tar],
1486 [Enable the building and reused of tarball of binary build for some 'external' libraries.
1487 Some libraries can save their build result in a tarball
1488 stored in TARFILE_LOCATION. That binary tarball is
1489 uniquely identified by the source tarball,
1490 the content of the config_host.mk file and the content
1491 of the top-level directory in core for that library
1492 If this option is enabled, then if such a tarfile exist, it will be untarred
1493 instead of the source tarfile, and the build step will be skipped for that
1495 If a proper tarfile does not exist, then the normal source-based
1496 build is done for that library and a proper binary tarfile is created
1497 for the next time.]),
1501 AS_HELP_STRING([--disable-gltf],
1502 [Determines whether to build libraries related to glTF 3D model rendering.]))
1504 AC_ARG_ENABLE(collada,
1505 AS_HELP_STRING([--disable-collada],
1506 [Disable collada support (Rendering 3D models stored in *.dae and *.kmz format).]))
1508 AC_ARG_ENABLE(dconf,
1509 AS_HELP_STRING([--disable-dconf],
1510 [Disable the dconf configuration backend (enabled by default where
1513 dnl ===================================================================
1514 dnl Optional Packages (--with/without-)
1515 dnl ===================================================================
1517 AC_ARG_WITH(gnu-patch,
1518 AS_HELP_STRING([--with-gnu-patch],
1519 [Specify location of GNU patch on Solaris or FreeBSD.]),
1522 AC_ARG_WITH(build-platform-configure-options,
1523 AS_HELP_STRING([--with-build-platform-configure-options],
1524 [Specify options for the configure script run for the *build* platform in a cross-compilation]),
1528 AS_HELP_STRING([--with-gnu-cp],
1529 [Specify location of GNU cp on Solaris or FreeBSD.]),
1532 AC_ARG_WITH(external-tar,
1533 AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
1534 [Specify an absolute path of where to find (and store) tarfiles.]),
1535 TARFILE_LOCATION=$withval ,
1538 AC_ARG_WITH(referenced-git,
1539 AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1540 [Specify another checkout directory to reference. This makes use of
1541 git submodule update --reference, and saves a lot of diskspace
1542 when having multiple trees side-by-side.]),
1543 GIT_REFERENCE_SRC=$withval ,
1546 AC_ARG_WITH(linked-git,
1547 AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
1548 [Specify a directory where the repositories of submodules are located.
1549 This uses a method similar to git-new-workdir to get submodules.]),
1550 GIT_LINK_SRC=$withval ,
1553 AC_ARG_WITH(galleries,
1554 AS_HELP_STRING([--with-galleries],
1555 [Specify how galleries should be built. It is possible either to
1556 build these internally from source ("build"),
1557 or to disable them ("no")]),
1561 AS_HELP_STRING([--with-theme="theme1 theme2..."],
1562 [Choose which themes to include. By default those themes with an '*' are included.
1563 Possible choices: *breeze, crystal, *galaxy, *hicontrast, human, *oxygen, *sifr, *tango, *tango_testing.]),
1566 AC_ARG_WITH(helppack-integration,
1568 --without-helppack-integration It will not integrate the helppacks to the installer
1570 Please use this switch to use the online help or separate help packages.],
1574 AS_HELP_STRING([--without-fonts],
1575 [LibreOffice includes some third-party fonts to provide a reliable basis for
1576 help content, templates, samples, etc. When these fonts are already
1577 known to be available on the system then you should use this option.]),
1581 AS_HELP_STRING([--with-epm],
1582 [Decides which epm to use. Default is to use the one from the system if
1583 one is built. When either this is not there or you say =internal epm
1587 AC_ARG_WITH(package-format,
1588 AS_HELP_STRING([--with-package-format],
1589 [Specify package format(s) for LibreOffice installation sets. The
1590 implicit --without-package-format leads to no installation sets being
1591 generated. Possible values: aix, archive, bsd, deb, dmg,
1592 installed, msi, pkg, and rpm.
1593 Example: --with-package-format='deb rpm']),
1597 AS_HELP_STRING([--with-tls],
1598 [Decides which TLS/SSL and cryptographic implementations to use for
1599 LibreOffice's code. Notice that this doesn't apply for depending
1600 libraries like "neon", for example. Default is to use OpenSSL
1601 although NSS is also possible. Notice that selecting NSS restricts
1602 the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
1603 restrict by now the usage of NSS in LO's code. Possible values:
1604 openssl, nss. Example: --with-tls="nss"]),
1607 AC_ARG_WITH(system-libs,
1608 AS_HELP_STRING([--with-system-libs],
1609 [Use libraries already on system -- enables all --with-system-* flags.]),
1612 AC_ARG_WITH(system-bzip2,
1613 AS_HELP_STRING([--with-system-bzip2],
1614 [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
1615 [with_system_bzip2="$with_system_libs"])
1617 AC_ARG_WITH(system-headers,
1618 AS_HELP_STRING([--with-system-headers],
1619 [Use headers already on system -- enables all --with-system-* flags for
1620 external packages whose headers are the only entities used i.e.
1621 boost/odbc/sane-header(s).]),,
1622 [with_system_headers="$with_system_libs"])
1624 AC_ARG_WITH(system-jars,
1625 AS_HELP_STRING([--without-system-jars],
1626 [When building with --with-system-libs, also the needed jars are expected
1627 on the system. Use this to disable that]),,
1628 [with_system_jars="$with_system_libs"])
1630 AC_ARG_WITH(system-cairo,
1631 AS_HELP_STRING([--with-system-cairo],
1632 [Use cairo libraries already on system. Happens automatically for
1633 (implicit) --enable-gtk and for --enable-gtk3.]))
1635 AC_ARG_WITH(myspell-dicts,
1636 AS_HELP_STRING([--with-myspell-dicts],
1637 [Adds myspell dictionaries to the LibreOffice installation set]),
1640 AC_ARG_WITH(system-dicts,
1641 AS_HELP_STRING([--without-system-dicts],
1642 [Do not use dictionaries from system paths.]),
1645 AC_ARG_WITH(external-dict-dir,
1646 AS_HELP_STRING([--with-external-dict-dir],
1647 [Specify external dictionary dir.]),
1650 AC_ARG_WITH(external-hyph-dir,
1651 AS_HELP_STRING([--with-external-hyph-dir],
1652 [Specify external hyphenation pattern dir.]),
1655 AC_ARG_WITH(external-thes-dir,
1656 AS_HELP_STRING([--with-external-thes-dir],
1657 [Specify external thesaurus dir.]),
1660 AC_ARG_WITH(system-zlib,
1661 AS_HELP_STRING([--with-system-zlib],
1662 [Use zlib already on system.]),,
1663 [with_system_zlib=auto])
1665 AC_ARG_WITH(system-jpeg,
1666 AS_HELP_STRING([--with-system-jpeg],
1667 [Use jpeg already on system.]),,
1668 [with_system_jpeg="$with_system_libs"])
1670 AC_ARG_WITH(system-libgltf,
1671 AS_HELP_STRING([--with-system-libgltf],
1672 [Use libgltf already on system.]),,
1673 [with_system_libgltf="$with_system_libs"])
1675 AC_ARG_WITH(system-clucene,
1676 AS_HELP_STRING([--with-system-clucene],
1677 [Use clucene already on system.]),,
1678 [with_system_clucene="$with_system_libs"])
1680 AC_ARG_WITH(system-expat,
1681 AS_HELP_STRING([--with-system-expat],
1682 [Use expat already on system.]),,
1683 [with_system_expat="$with_system_libs"])
1685 AC_ARG_WITH(system-libxml,
1686 AS_HELP_STRING([--with-system-libxml],
1687 [Use libxml/libxslt already on system.]),,
1688 [with_system_libxml=auto])
1690 AC_ARG_WITH(system-icu,
1691 AS_HELP_STRING([--with-system-icu],
1692 [Use icu already on system.]),,
1693 [with_system_icu="$with_system_libs"])
1695 AC_ARG_WITH(system-ucpp,
1696 AS_HELP_STRING([--with-system-ucpp],
1697 [Use ucpp already on system.]),,
1700 AC_ARG_WITH(system-opencollada,
1701 AS_HELP_STRING([--with-system-opencollada],
1702 [Use openCOLLADA already on system.]),,
1703 [with_system_opencollada=no])
1705 AC_ARG_WITH(system-collada2gltf,
1706 AS_HELP_STRING([--with-system-collada2gltf],
1707 [Use collada2gltf already on system.]),,
1708 [with_system_collada2gltf=no])
1710 AC_ARG_WITH(system-openldap,
1711 AS_HELP_STRING([--with-system-openldap],
1712 [Use the OpenLDAP LDAP SDK already on system.]),,
1713 [with_system_openldap="$with_system_libs"])
1715 AC_ARG_WITH(system-poppler,
1716 AS_HELP_STRING([--with-system-poppler],
1717 [Use system poppler (only needed for PDF import).]),,
1718 [with_system_poppler="$with_system_libs"])
1720 AC_ARG_WITH(system-apache-commons,
1721 AS_HELP_STRING([--with-system-apache-commons],
1722 [Use Apache commons libraries already on system.]),,
1723 [with_system_apache_commons="$with_system_jars"])
1725 AC_ARG_WITH(system-mariadb,
1726 AS_HELP_STRING([--with-system-mariadb],
1727 [Use MariaDB/MySQL libraries already on system, for building the MariaDB Connector/LibreOffice
1729 [with_system_mariadb="$with_system_libs"])
1731 AC_ARG_ENABLE(bundle-mariadb,
1732 AS_HELP_STRING([--enable-bundle-mariadb],
1733 [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice extension.])
1736 AC_ARG_WITH(system-mysql-cppconn,
1737 AS_HELP_STRING([--with-system-mysql-cppconn],
1738 [Use MySQL C++ Connector libraries already on system.]),,
1739 [with_system_mysql_cppconn="$with_system_libs"])
1741 AC_ARG_WITH(system-postgresql,
1742 AS_HELP_STRING([--with-system-postgresql],
1743 [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1744 driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1745 [with_system_postgresql="$with_system_libs"])
1747 AC_ARG_WITH(libpq-path,
1748 AS_HELP_STRING([--with-libpq-path],
1749 [Use this PostgreSQL C interface (libpq) installation for building
1750 the PostgreSQL-SDBC extension.])
1752 Usage: --with-libpq-path=<absolute path to
1753 your libpq installation>
1757 AC_ARG_WITH(system-firebird,
1758 AS_HELP_STRING([--with-system-firebird],
1759 [Use Firebird libraries already on system, for building the Firebird-SDBC
1760 driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
1761 [with_system_firebird="$with_system_libs"])
1763 AC_ARG_WITH(system-hsqldb,
1764 AS_HELP_STRING([--with-system-hsqldb],
1765 [Use hsqldb already on system.]))
1767 AC_ARG_WITH(hsqldb-jar,
1768 AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1769 [Specify path to jarfile manually.]),
1770 HSQLDB_JAR=$withval)
1772 AC_ARG_ENABLE(scripting-beanshell,
1773 AS_HELP_STRING([--disable-scripting-beanshell],
1774 [Disable support for scripts in BeanShell.]),
1778 AC_ARG_WITH(system-beanshell,
1779 AS_HELP_STRING([--with-system-beanshell],
1780 [Use beanshell already on system.]),,
1781 [with_system_beanshell="$with_system_jars"])
1783 AC_ARG_WITH(beanshell-jar,
1784 AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1785 [Specify path to jarfile manually.]),
1788 AC_ARG_ENABLE(scripting-javascript,
1789 AS_HELP_STRING([--disable-scripting-javascript],
1790 [Disable support for scripts in JavaScript.]),
1794 AC_ARG_WITH(system-rhino,
1795 AS_HELP_STRING([--with-system-rhino],
1796 [Use rhino already on system.]),,)
1797 # [with_system_rhino="$with_system_jars"])
1798 # Above is not used as we have different debug interface
1799 # patched into internal rhino. This code needs to be fixed
1800 # before we can enable it by default.
1802 AC_ARG_WITH(rhino-jar,
1803 AS_HELP_STRING([--with-rhino-jar=JARFILE],
1804 [Specify path to jarfile manually.]),
1807 AC_ARG_WITH(commons-codec-jar,
1808 AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1809 [Specify path to jarfile manually.]),
1810 COMMONS_CODEC_JAR=$withval)
1812 AC_ARG_WITH(commons-lang-jar,
1813 AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1814 [Specify path to jarfile manually.]),
1815 COMMONS_LANG_JAR=$withval)
1817 AC_ARG_WITH(commons-httpclient-jar,
1818 AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1819 [Specify path to jarfile manually.]),
1820 COMMONS_HTTPCLIENT_JAR=$withval)
1822 AC_ARG_WITH(commons-logging-jar,
1823 AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1824 [Specify path to jarfile manually.]),
1825 COMMONS_LOGGING_JAR=$withval)
1827 AC_ARG_WITH(system-jfreereport,
1828 AS_HELP_STRING([--with-system-jfreereport],
1829 [Use JFreeReport already on system.]),,
1830 [with_system_jfreereport="$with_system_jars"])
1832 AC_ARG_WITH(sac-jar,
1833 AS_HELP_STRING([--with-sac-jar=JARFILE],
1834 [Specify path to jarfile manually.]),
1837 AC_ARG_WITH(libxml-jar,
1838 AS_HELP_STRING([--with-libxml-jar=JARFILE],
1839 [Specify path to jarfile manually.]),
1840 LIBXML_JAR=$withval)
1842 AC_ARG_WITH(flute-jar,
1843 AS_HELP_STRING([--with-flute-jar=JARFILE],
1844 [Specify path to jarfile manually.]),
1847 AC_ARG_WITH(jfreereport-jar,
1848 AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1849 [Specify path to jarfile manually.]),
1850 JFREEREPORT_JAR=$withval)
1852 AC_ARG_WITH(liblayout-jar,
1853 AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1854 [Specify path to jarfile manually.]),
1855 LIBLAYOUT_JAR=$withval)
1857 AC_ARG_WITH(libloader-jar,
1858 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1859 [Specify path to jarfile manually.]),
1860 LIBLOADER_JAR=$withval)
1862 AC_ARG_WITH(libloader-jar,
1863 AS_HELP_STRING([--with-libloader-jar=JARFILE],
1864 [Specify path to jarfile manually.]),
1865 LIBLOADER_JAR=$withval)
1867 AC_ARG_WITH(libformula-jar,
1868 AS_HELP_STRING([--with-libformula-jar=JARFILE],
1869 [Specify path to jarfile manually.]),
1870 LIBFORMULA_JAR=$withval)
1872 AC_ARG_WITH(librepository-jar,
1873 AS_HELP_STRING([--with-librepository-jar=JARFILE],
1874 [Specify path to jarfile manually.]),
1875 LIBREPOSITORY_JAR=$withval)
1877 AC_ARG_WITH(libfonts-jar,
1878 AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1879 [Specify path to jarfile manually.]),
1880 LIBFONTS_JAR=$withval)
1882 AC_ARG_WITH(libserializer-jar,
1883 AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1884 [Specify path to jarfile manually.]),
1885 LIBSERIALIZER_JAR=$withval)
1887 AC_ARG_WITH(libbase-jar,
1888 AS_HELP_STRING([--with-libbase-jar=JARFILE],
1889 [Specify path to jarfile manually.]),
1890 LIBBASE_JAR=$withval)
1892 AC_ARG_WITH(system-odbc,
1893 AS_HELP_STRING([--with-system-odbc],
1894 [Use the odbc headers already on system.]),,
1895 [with_system_odbc="auto"])
1897 AC_ARG_WITH(system-sane,
1898 AS_HELP_STRING([--with-system-sane],
1899 [Use sane.h already on system.]),,
1900 [with_system_sane="$with_system_headers"])
1902 AC_ARG_WITH(system-bluez,
1903 AS_HELP_STRING([--with-system-bluez],
1904 [Use bluetooth.h already on system.]),,
1905 [with_system_bluez="$with_system_headers"])
1907 AC_ARG_WITH(system-curl,
1908 AS_HELP_STRING([--with-system-curl],
1909 [Use curl already on system.]),,
1910 [with_system_curl=auto])
1912 AC_ARG_WITH(system-boost,
1913 AS_HELP_STRING([--with-system-boost],
1914 [Use boost already on system.]),,
1915 [with_system_boost="$with_system_headers"])
1917 AC_ARG_WITH(system-glm,
1918 AS_HELP_STRING([--with-system-glm],
1919 [Use glm already on system.]),,
1920 [with_system_glm="$with_system_headers"])
1922 AC_ARG_WITH(system-hunspell,
1923 AS_HELP_STRING([--with-system-hunspell],
1924 [Use libhunspell already on system.]),,
1925 [with_system_hunspell="$with_system_libs"])
1927 AC_ARG_WITH(system-mythes,
1928 AS_HELP_STRING([--with-system-mythes],
1929 [Use mythes already on system.]),,
1930 [with_system_mythes="$with_system_libs"])
1932 AC_ARG_WITH(system-altlinuxhyph,
1933 AS_HELP_STRING([--with-system-altlinuxhyph],
1934 [Use ALTLinuxhyph already on system.]),,
1935 [with_system_altlinuxhyph="$with_system_libs"])
1937 AC_ARG_WITH(system-lpsolve,
1938 AS_HELP_STRING([--with-system-lpsolve],
1939 [Use lpsolve already on system.]),,
1940 [with_system_lpsolve="$with_system_libs"])
1942 AC_ARG_WITH(system-coinmp,
1943 AS_HELP_STRING([--with-system-coinmp],
1944 [Use CoinMP already on system.]),,
1945 [with_system_coinmp="$with_system_libs"])
1947 AC_ARG_WITH(system-liblangtag,
1948 AS_HELP_STRING([--with-system-liblangtag],
1949 [Use liblangtag library already on system.]),,
1950 [with_system_liblangtag="$with_system_libs"])
1952 AC_ARG_WITH(jpeg-turbo,
1953 AS_HELP_STRING([--with-jpeg-turbo],
1954 [Use internal libjpeg-turbo library.]),,
1955 [with_jpeg_turbo=auto])
1958 AS_HELP_STRING([--with-webdav],
1959 [Specify which library to use for webdav implementation.
1960 Possible values: "neon", "serf", "no". The default value is "neon".
1961 Example: --with-webdav="serf"]),
1962 WITH_WEBDAV=$withval,
1965 AC_ARG_WITH(linker-hash-style,
1966 AS_HELP_STRING([--with-linker-hash-style],
1967 [Use linker with --hash-style=<style> when linking shared objects.
1968 Possible values: "sysv", "gnu", "both". The default value is "gnu"
1969 if supported on the build system, and "sysv" otherwise.]))
1971 AC_ARG_WITH(jdk-home,
1972 AS_HELP_STRING([--with-jdk-home],
1973 [If you have installed JDK 1.3 or later on your system please supply the
1974 path here. Note that this is not the location of the java command but the
1975 location of the entire distribution.])
1977 Usage: --with-jdk-home=<absolute path to JDK home>
1982 AS_HELP_STRING([--with-help],
1983 [Enable the build of help. There is a special parameter "common" that
1984 can be used to bundle only the common part, .e.g help-specific icons.
1985 This is useful when you build the helpcontent separately.])
1987 Usage: --with-help build the entire local help
1988 --without-help no local help (default)
1989 --with-help=common bundle common files for the local
1990 help but do not build the whole help
1995 AS_HELP_STRING([--with-java],
1996 [Specify the name of the Java interpreter command. Typically "java"
1997 which is the default.
1999 To build without support for Java components, applets, accessibility
2000 or the XML filters written in Java, use --without-java or --with-java=no.])
2002 Usage: --with-java==<java command>
2005 [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
2009 AC_ARG_WITH(jvm-path,
2010 AS_HELP_STRING([--with-jvm-path],
2011 [Use a specific JVM search path at runtime.])
2013 Usage: --with-jvm-path=<absolute path to parent of jvm home>
2015 e. g.: --with-jvm-path=/usr/lib/
2016 to find JRE/JDK in /usr/lib/jvm/
2020 AC_ARG_WITH(ant-home,
2021 AS_HELP_STRING([--with-ant-home],
2022 [If you have installed Jakarta Ant on your system, please supply the path here.
2023 Note that this is not the location of the Ant binary but the location
2024 of the entire distribution.])
2026 Usage: --with-ant-home=<absolute path to Ant home>
2030 AC_ARG_WITH(export-validation,
2031 AS_HELP_STRING([--with-export-validation],
2032 [If you want the exported files to be validated. Right now limited to OOXML files in calc export tests.
2033 Note: You need an executable script officeotron that takes the path to the file.])
2035 Usage: --with-export-validation
2040 AS_HELP_STRING([--with-junit],
2041 [Specifies the JUnit 4 jar file to use for JUnit-based tests.
2042 --without-junit disables those tests. Not relevant in the --without-java case.])
2044 Usage: --with-junit=<absolute path to JUnit 4 jar>
2048 AC_ARG_WITH(hamcrest,
2049 AS_HELP_STRING([--with-hamcrest],
2050 [Specifies the hamcrest jar file to use for JUnit-based tests.
2051 --without-junit disables those tests. Not relevant in the --without-java case.])
2053 Usage: --with-hamcrest=<absolute path to hamcrest jar>
2057 AC_ARG_WITH(perl-home,
2058 AS_HELP_STRING([--with-perl-home],
2059 [If you have installed Perl 5 Distribution, on your system, please
2060 supply the path here. Note that this is not the location of the Perl
2061 binary but the location of the entire distribution.])
2063 Usage: --with-perl-home=<abs. path to Perl 5 home>
2071 [Specifies the doxygen executable to use when generating ODK C/C++
2072 documentation. --without-doxygen disables generation of ODK C/C++
2073 documentation. Not relevant in the --disable-odk case.])
2075 Usage: --with-doxygen=<absolute path to doxygen executable>
2079 AC_ARG_WITH(visual-studio,
2080 AS_HELP_STRING([--with-visual-studio=<2013/2015>],
2081 [Specify which Visual Studio version to use in case several are
2082 installed. If not specified, only 2013 is detected automatically
2083 because 2015 support is currently experimental.])
2085 Usage: --with-visual-studio=<2013/2015>
2089 AC_ARG_WITH(windows-sdk,
2090 AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
2091 [Specify which Windows SDK, or "Windows Kit", version to use
2092 in case the one that came with the selected Visual Studio
2093 is not what you want for some reason. Note that not all compiler/SDK
2094 combinations are supported. The intent is that this option should not
2097 Usage: --with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>
2102 AS_HELP_STRING([--with-lang],
2103 [Use this option to build LibreOffice with additional UI language support.
2104 English (US) is always included by default.
2105 Separate multiple languages with space.
2106 For all languages, use --with-lang=ALL.])
2108 Usage: --with-lang="es sw tu cs sk"
2112 AC_ARG_WITH(locales,
2113 AS_HELP_STRING([--with-locales],
2114 [Use this option to limit the locale information built in.
2115 Separate multiple locales with space.
2116 Very experimental and might well break stuff.
2117 Just a desperate measure to shrink code and data size.
2118 By default all the locales available is included.
2119 This option is completely unrelated to --with-lang.])
2121 Affects also our character encoding conversion
2122 tables for encodings mainly targeted for a
2123 particular locale, like EUC-CN and EUC-TW for
2124 zh, ISO-2022-JP for ja.
2126 Affects also our add-on break iterator data for
2129 For the default, all locales, don't use this switch at all.
2130 Specifying just the language part of a locale means all matching
2131 locales will be included.
2133 Usage: --with-locales="en es pt fr zh kr ja"
2137 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
2139 AS_HELP_STRING([--with-krb5],
2140 [Enable MIT Kerberos 5 support in modules that support it.
2141 By default automatically enabled on platforms
2142 where a good system Kerberos 5 is available.]),
2146 AS_HELP_STRING([--with-gssapi],
2147 [Enable GSSAPI support in modules that support it.
2148 By default automatically enabled on platforms
2149 where a good system GSSAPI is available.]),
2153 AS_HELP_STRING([--with-iwyu],
2154 [Use given IWYU binary path to check unneeded includes instead of building.
2155 Use only if you are hacking on it.]),
2158 dnl ===================================================================
2160 dnl ===================================================================
2162 AC_ARG_WITH(branding,
2163 AS_HELP_STRING([--with-branding],
2164 [Use given path to retrieve branding images set.])
2166 Search for intro.png about.svg and flat_logo.svg.
2167 If any is missing, default ones will be used instead.
2169 Search also progress.conf for progress
2170 settings on intro screen :
2172 PROGRESSBARCOLOR="255,255,255" Set color of
2173 progress bar. Comma separated RGB decimal values.
2174 PROGRESSSIZE="407,6" Set size of progress bar.
2175 Comma separated decimal values (width, height).
2176 PROGRESSPOSITION="61,317" Set position of progress
2177 bar from left,top. Comma separated decimal values.
2178 PROGRESSFRAMECOLOR="20,136,3" Set color of progress
2179 bar frame. Comma separated RGB decimal values.
2180 PROGRESSTEXTCOLOR="255,255,255" Set color of progress
2181 bar text. Comma separated RGB decimal values.
2182 PROGRESSTEXTBASELINE="287" Set vertical position of
2183 progress bar text from top. Decimal value.
2185 Default values will be used if not found.
2187 Usage: --with-branding=/path/to/images
2192 AC_ARG_WITH(extra-buildid,
2193 AS_HELP_STRING([--with-extra-buildid],
2194 [Show addition build identification in about dialog.])
2196 Usage: --with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"
2202 AS_HELP_STRING([--with-vendor],
2203 [Set vendor of the build.])
2205 Usage: --with-vendor="John the Builder"
2209 AC_ARG_WITH(android-package-name,
2210 AS_HELP_STRING([--with-android-package-name],
2211 [Set Android package name of the build.])
2213 Usage: --with-android-package-name="org.libreoffice"
2217 AC_ARG_WITH(compat-oowrappers,
2218 AS_HELP_STRING([--with-compat-oowrappers],
2219 [Install oo* wrappers in parallel with
2220 lo* ones to keep backward compatibility.
2221 Has effect only with make distro-pack-install]),
2224 AC_ARG_WITH(os-version,
2225 AS_HELP_STRING([--with-os-version],
2226 [For FreeBSD users, use this option option to override the detected OSVERSION.])
2228 Usage: --with-os-version=<OSVERSION>
2232 AC_ARG_WITH(mingw-cross-compiler,
2233 AS_HELP_STRING([--with-mingw-cross-compiler],
2234 [Specify the MinGW cross-compiler to use.])
2236 Usage: --with-mingw-cross-compiler=<mingw32-g++ command>
2238 When building on the ODK on Unix and building unowinreg.dll,
2239 specify the MinGW C++ cross-compiler.
2243 AC_ARG_WITH(idlc-cpp,
2244 AS_HELP_STRING([--with-idlc-cpp],
2245 [Specify the C Preprocessor to use for idlc.])
2247 Usage: --with-idlc-cpp=cpp
2253 AC_ARG_WITH(build-version,
2254 AS_HELP_STRING([--with-build-version],
2255 [Allows the builder to add a custom version tag that will appear in the
2256 Help/About box for QA purposes.])
2258 Usage: --with-build-version="Built by Jim"
2260 with_build_version=$withval ,
2264 AS_HELP_STRING([--with-alloc],
2265 [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
2266 Note that on FreeBSD/NetBSD system==jemalloc]),
2269 AC_ARG_WITH(sun-templates,
2270 AS_HELP_STRING([--with-sun-templates],
2271 [Integrate Sun template packages.]),
2274 AC_ARG_WITH(parallelism,
2275 AS_HELP_STRING([--with-parallelism],
2276 [Number of jobs to run simultaneously during build. Parallel builds can
2277 save a lot of time on multi-cpu machines. Defaults to the number of
2278 CPUs on the machine, unless you configure --enable-icecream - then to
2282 AC_ARG_WITH(all-tarballs,
2283 AS_HELP_STRING([--with-all-tarballs],
2284 [Download all external tarballs unconditionally]))
2286 AC_ARG_WITH(gdrive-client-id,
2287 AS_HELP_STRING([--with-gdrive-client-id],
2288 [Provides the client id of the application for OAuth2 authentication
2289 on Google Drive. If either this or --with-gdrive-client-secret is
2290 empty, the feature will be disabled]),
2293 AC_ARG_WITH(gdrive-client-secret,
2294 AS_HELP_STRING([--with-gdrive-client-secret],
2295 [Provides the client secret of the application for OAuth2
2296 authentication on Google Drive. If either this or
2297 --with-gdrive-client-id is empty, the feature will be disabled]),
2300 AC_ARG_WITH(alfresco-cloud-client-id,
2301 AS_HELP_STRING([--with-alfresco-cloud-client-id],
2302 [Provides the client id of the application for OAuth2 authentication
2303 on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
2304 empty, the feature will be disabled]),
2307 AC_ARG_WITH(alfresco-cloud-client-secret,
2308 AS_HELP_STRING([--with-alfresco-cloud-client-secret],
2309 [Provides the client secret of the application for OAuth2
2310 authentication on Alfresco Cloud. If either this or
2311 --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
2314 AC_ARG_WITH(onedrive-client-id,
2315 AS_HELP_STRING([--with-onedrive-client-id],
2316 [Provides the client id of the application for OAuth2 authentication
2317 on OneDrive. If either this or --with-onedrive-client-secret is
2318 empty, the feature will be disabled]),
2321 AC_ARG_WITH(onedrive-client-secret,
2322 AS_HELP_STRING([--with-onedrive-client-secret],
2323 [Provides the client secret of the application for OAuth2
2324 authentication on OneDrive. If either this or
2325 --with-onedrive-client-id is empty, the feature will be disabled]),
2327 dnl ===================================================================
2328 dnl Do we want to use pre-build binary tarball for recompile
2329 dnl ===================================================================
2331 if test "$enable_library_bin_tar" = "yes" ; then
2332 USE_LIBRARY_BIN_TAR=TRUE
2334 USE_LIBRARY_BIN_TAR=
2336 AC_SUBST(USE_LIBRARY_BIN_TAR)
2338 dnl ===================================================================
2339 dnl Test whether build target is Release Build
2340 dnl ===================================================================
2341 AC_MSG_CHECKING([whether build target is Release Build])
2342 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2344 ENABLE_RELEASE_BUILD=
2346 AC_MSG_RESULT([yes])
2347 ENABLE_RELEASE_BUILD=TRUE
2349 AC_SUBST(ENABLE_RELEASE_BUILD)
2351 dnl ===================================================================
2352 dnl Test whether to sign Windows Build
2353 dnl ===================================================================
2354 AC_MSG_CHECKING([whether to sign windows build])
2355 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
2356 AC_MSG_RESULT([yes])
2357 WINDOWS_BUILD_SIGNING="TRUE"
2360 WINDOWS_BUILD_SIGNING="FALSE"
2362 AC_SUBST(WINDOWS_BUILD_SIGNING)
2364 dnl ===================================================================
2365 dnl MacOSX build and runtime environment options
2366 dnl ===================================================================
2368 AC_ARG_WITH(macosx-sdk,
2369 AS_HELP_STRING([--with-macosx-sdk],
2370 [Use a specific SDK for building.])
2372 Usage: --with-macosx-sdk=<version>
2374 e. g.: --with-macosx-sdk=10.8
2376 there are 3 options to control the MacOSX build:
2377 --with-macosx-sdk (referred as 'sdk' below)
2378 --with-macosx-version-min-required (referred as 'min' below)
2379 --with-macosx-version-max-allowed (referred as 'max' below)
2381 the connection between these value and the default they take is as follow:
2382 ( ? means not specified on the command line, s means the SDK version found,
2383 constraint: 8 <= x <= y <= z)
2385 ==========================================
2386 command line || config result
2387 ==========================================
2388 min | max | sdk || min | max | sdk |
2389 ? | ? | ? || 10.8 | 10.s | 10.s |
2390 ? | ? | 10.x || 10.8 | 10.x | 10.x |
2391 ? | 10.x | ? || 10.8 | 10.s | 10.s |
2392 ? | 10.x | 10.y || 10.8 | 10.x | 10.y |
2393 10.x | ? | ? || 10.x | 10.s | 10.s |
2394 10.x | ? | 10.y || 10.x | 10.y | 10.y |
2395 10.x | 10.y | ? || 10.x | 10.y | 10.y |
2396 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2399 see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2400 for a detailed technical explanation of these variables
2402 Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2406 AC_ARG_WITH(macosx-version-min-required,
2407 AS_HELP_STRING([--with-macosx-version-min-required],
2408 [set the minimum OS version needed to run the built LibreOffice])
2410 Usage: --with-macosx-version-min-required=<version>
2412 e. g.: --with-macos-version-min-required=10.8
2413 see --with-macosx-sdk for more info
2417 AC_ARG_WITH(macosx-version-max-allowed,
2418 AS_HELP_STRING([--with-macosx-version-max-allowed],
2419 [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2421 Usage: --with-macosx-version-max-allowed=<version>
2423 e. g.: --with-macos-version-max-allowed=10.8
2424 see --with-macosx-sdk for more info
2429 dnl ===================================================================
2430 dnl options for stuff used during cross-compilation build
2431 dnl Not quite superseded by --with-build-platform-configure-options.
2432 dnl TODO: check, if the "force" option is still needed anywhere.
2433 dnl ===================================================================
2435 AC_ARG_WITH(system-icu-for-build,
2436 AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2437 [Use icu already on system for build tools (cross-compilation only).]))
2440 dnl ===================================================================
2441 dnl check for required programs (grep, awk, sed, bash)
2442 dnl ===================================================================
2446 if test -n "$1"; then
2447 if test "$build_os" = "cygwin"; then
2448 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
2450 new_path=`cygpath -sm "$formatted_path"`
2453 new_path=`cygpath -u "$formatted_path"`
2458 if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2459 if test "$2" = "after"; then
2460 LO_PATH="$LO_PATH${P_SEP}$new_path"
2462 LO_PATH="$new_path${P_SEP}$LO_PATH"
2470 AC_PATH_PROG( AWK, $AWK)
2471 if test -z "$AWK"; then
2472 AC_MSG_ERROR([install awk to run this script])
2475 AC_PATH_PROG(BASH, bash)
2476 if test -z "$BASH"; then
2477 AC_MSG_ERROR([bash not found in \$PATH])
2481 AC_MSG_CHECKING([for GNU or BSD tar])
2482 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
2483 $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
2484 if test $? -eq 0; then
2489 AC_MSG_RESULT($GNUTAR)
2490 if test -z "$GNUTAR"; then
2491 AC_MSG_ERROR([not found. install GNU or BSD tar.])
2495 AC_MSG_CHECKING([for tar's option to strip components])
2496 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2497 if test $? -eq 0; then
2498 STRIP_COMPONENTS="--strip-components"
2500 $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2501 if test $? -eq 0; then
2502 STRIP_COMPONENTS="--strip-path"
2504 STRIP_COMPONENTS="unsupported"
2507 AC_MSG_RESULT($STRIP_COMPONENTS)
2508 if test x$STRIP_COMPONENTS = xunsupported; then
2509 AC_MSG_ERROR([you need a tar that is able to strip components.])
2511 AC_SUBST(STRIP_COMPONENTS)
2513 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2514 dnl desktop OSes from "mobile" ones.
2516 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2517 dnl In other words, that when building for an OS that is not a
2518 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2520 dnl Note the direction of the implication; there is no assumption that
2521 dnl cross-compiling would imply a non-desktop OS.
2523 if test $_os != iOS -a $_os != Android; then
2524 BUILD_TYPE="$BUILD_TYPE DESKTOP"
2525 AC_DEFINE(HAVE_FEATURE_DESKTOP)
2526 AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
2530 if test "$enable_export" != no; then
2531 BUILD_TYPE="$BUILD_TYPE EXPORT"
2533 DISABLE_EXPORT='TRUE'
2534 SCPDEFS="$SCPDES -DDISABLE_EXPORT"
2536 AC_SUBST(DISABLE_EXPORT)
2538 # Whether to build "avmedia" functionality or not.
2540 if test -z "$enable_avmedia"; then
2544 if test "$enable_avmedia" = yes; then
2545 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
2546 AC_DEFINE(HAVE_FEATURE_AVMEDIA)
2548 SCPDEFS="$SCPDEFS -DDISABLE_AVMEDIA"
2551 # Decide whether to build database connectivity stuff (including
2552 # Base) or not. We probably don't want to on non-desktop OSes.
2554 if test -z "$enable_database_connectivity"; then
2555 # --disable-database-connectivity is unfinished work in progress
2556 # and the iOS test app doesn't link if we actually try to use it.
2557 # if test $_os != iOS -a $_os != Android; then
2558 enable_database_connectivity=yes
2562 if test "$enable_database_connectivity" = yes; then
2563 BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2564 AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
2567 if test -z "$enable_extensions"; then
2568 # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
2569 if test $_os != iOS -a $_os != Android; then
2570 enable_extensions=yes
2574 if test "$enable_extensions" = yes; then
2575 BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2576 AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
2579 if test -z "$enable_scripting"; then
2580 # Disable scripting for iOS unless specifically overridden
2581 # with --enable-scripting.
2582 if test $_os != iOS; then
2583 enable_scripting=yes
2587 DISABLE_SCRIPTING=''
2588 if test "$enable_scripting" = yes; then
2589 BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2590 AC_DEFINE(HAVE_FEATURE_SCRIPTING)
2592 DISABLE_SCRIPTING='TRUE'
2593 SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2596 if test $_os = iOS -o $_os = Android; then
2597 # Disable dynamic_loading always for iOS and Android
2598 enable_dynamic_loading=no
2599 elif test -z "$enable_dynamic_loading"; then
2600 # Otherwise enable it unless speficically disabled
2601 enable_dynamic_loading=yes
2604 DISABLE_DYNLOADING=''
2605 if test "$enable_dynamic_loading" = yes; then
2606 BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2608 DISABLE_DYNLOADING='TRUE'
2609 SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
2611 AC_SUBST(DISABLE_DYNLOADING)
2613 # remenber SYSBASE value
2616 dnl ===================================================================
2617 dnl Sort out various gallery compilation options
2618 dnl ===================================================================
2619 AC_MSG_CHECKING([how to build and package galleries])
2620 if test -n "${with_galleries}"; then
2621 if test "$with_galleries" = "build"; then
2622 WITH_GALLERY_BUILD=TRUE
2623 AC_MSG_RESULT([build from source images internally])
2624 elif test "$with_galleries" = "no"; then
2626 AC_MSG_RESULT([disable non-internal gallery build])
2628 AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
2631 if test $_os != iOS -a $_os != Android; then
2632 WITH_GALLERY_BUILD=TRUE
2633 AC_MSG_RESULT([internal src images for desktop])
2636 AC_MSG_RESULT([disable src imgage build])
2639 AC_SUBST(WITH_GALLERY_BUILD)
2641 dnl ===================================================================
2642 dnl Checks if ccache is available
2643 dnl ===================================================================
2644 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
2645 # on windows/VC build do not use ccache
2647 elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2648 case "%$CC%$CXX%" in
2649 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
2650 # assume that's good then
2651 *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2652 AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2655 AC_PATH_PROG([CCACHE],[ccache],[not found])
2656 if test "$CCACHE" = "not found"; then
2659 # Need to check for ccache version: otherwise prevents
2660 # caching of the results (like "-x objective-c++" for Mac)
2661 if test $_os = Darwin -o $_os = iOS; then
2662 # Check ccache version
2663 AC_MSG_CHECKING([whether version of ccache is suitable])
2664 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2665 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2666 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2667 AC_MSG_RESULT([yes, $CCACHE_VERSION])
2669 AC_MSG_RESULT([no, $CCACHE_VERSION])
2680 if test "$CCACHE" != ""; then
2681 ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2682 ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2683 if test "$ccache_size" = ""; then
2684 ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2685 if test "$ccache_size" = ""; then
2688 # we could not determine the size or it was less than 1GB -> disable auto-ccache
2689 if test $ccache_size -lt 1024; then
2691 AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
2692 add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
2694 # warn that ccache may be too small for debug build
2695 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2696 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2699 if test $ccache_size -lt 5; then
2700 #warn that ccache may be too small for debug build
2701 AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
2702 add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
2707 dnl ===================================================================
2708 dnl Checks for C compiler,
2709 dnl The check for the C++ compiler is later on.
2710 dnl ===================================================================
2711 if test "$_os" != "WINNT" -a "$WITH_MINGW" != "yes"; then
2713 AC_MSG_CHECKING([gcc home])
2714 if test -z "$with_gcc_home"; then
2715 if test "$enable_icecream" = "yes"; then
2716 if test -d "/usr/lib/icecc/bin"; then
2717 GCC_HOME="/usr/lib/icecc/"
2719 GCC_HOME="/opt/icecream/"
2722 GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2723 GCC_HOME_SET="false"
2726 GCC_HOME="$with_gcc_home"
2728 AC_MSG_RESULT($GCC_HOME)
2731 if test "$GCC_HOME_SET" = "true"; then
2732 if test -z "$CC"; then
2733 CC="$GCC_HOME/bin/gcc"
2735 if test -z "$CXX"; then
2736 CXX="$GCC_HOME/bin/g++"
2741 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
2742 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2743 # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
2749 COMPATH=`dirname "$CC"`
2750 if test "$COMPATH" = "."; then
2751 AC_PATH_PROGS(COMPATH, $CC)
2752 dnl double square bracket to get single because of M4 quote...
2753 COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2755 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2757 dnl ===================================================================
2759 dnl ===================================================================
2760 AC_MSG_CHECKING([whether to build with Java support])
2761 if test "$with_java" != "no"; then
2762 if test "$DISABLE_SCRIPTING" = TRUE; then
2763 AC_MSG_RESULT([no, overridden by --disable-scripting])
2767 AC_MSG_RESULT([yes])
2769 AC_DEFINE(HAVE_FEATURE_JAVA)
2776 AC_SUBST(ENABLE_JAVA)
2778 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
2780 dnl ENABLE_JAVA="" indicate no Java support at all
2782 dnl ===================================================================
2783 dnl Export file validation
2784 dnl ===================================================================
2785 AC_MSG_CHECKING([whether to enable export file validation])
2786 if test "$with_export_validation" = yes; then
2787 AC_MSG_RESULT([yes])
2788 AC_DEFINE(HAVE_EXPORT_VALIDATION)
2790 AC_CHECK_PROGS(ODFVALIDATOR, odfvalidator)
2791 if test -z "$ODFVALIDATOR"; then
2792 AC_MSG_ERROR([odfvalidator not found, but required by --with-export-validation])
2794 AC_SUBST(ODFVALIDATOR)
2795 AC_CHECK_PROGS(OFFICEOTRON, officeotron)
2796 if test -z "$OFFICEOTRON"; then
2797 AC_MSG_ERROR([officeotron not found, but required by --with-export-validation])
2799 AC_SUBST(OFFICEOTRON)
2805 dnl ===================================================================
2806 dnl Check OS X SDK and compiler
2807 dnl ===================================================================
2809 if test $_os = Darwin; then
2811 # If no --with-macosx-sdk option is given, look for one
2813 # The intent is that for "most" Mac-based developers, a suitable
2814 # SDK will be found automatically without any configure options.
2816 # For developers with a current Xcode, the lowest-numbered SDK
2817 # higher than or equal to the minimum required should be found.
2819 AC_MSG_CHECKING([what Mac OS X SDK to use])
2821 for _macosx_sdk in $with_macosx_sdk 10.8 10.9 10.10 10.11; do
2822 MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
2823 if test -d "$MACOSX_SDK_PATH"; then
2824 with_macosx_sdk="${_macosx_sdk}"
2827 MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
2828 if test -d "$MACOSX_SDK_PATH"; then
2829 with_macosx_sdk="${_macosx_sdk}"
2834 if test ! -d "$MACOSX_SDK_PATH"; then
2835 AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2837 AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2839 case $with_macosx_sdk in
2841 MACOSX_SDK_VERSION=1080
2844 MACOSX_SDK_VERSION=1090
2847 MACOSX_SDK_VERSION=101000
2850 MACOSX_SDK_VERSION=101100
2853 AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.8--11])
2857 if test "$with_macosx_version_min_required" = "" ; then
2858 with_macosx_version_min_required="10.8";
2861 if test "$with_macosx_version_max_allowed" = "" ; then
2862 with_macosx_version_max_allowed="$with_macosx_sdk"
2865 # export this so that "xcrun" invocations later return matching values
2866 DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
2867 DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
2868 export DEVELOPER_DIR
2869 FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2870 MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2872 case "$with_macosx_version_min_required" in
2874 MAC_OS_X_VERSION_MIN_REQUIRED="1080"
2877 MAC_OS_X_VERSION_MIN_REQUIRED="1090"
2880 MAC_OS_X_VERSION_MIN_REQUIRED="101000"
2883 MAC_OS_X_VERSION_MIN_REQUIRED="101100"
2886 AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.8--11])
2891 INSTALL_NAME_TOOL=install_name_tool
2892 if test -z "$save_CC"; then
2893 AC_MSG_CHECKING([what compiler to use])
2894 stdlib=-stdlib=libc++
2895 if test "$ENABLE_LTO" = TRUE; then
2898 CC="`xcrun -find clang` -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2899 CXX="`xcrun -find clang++` -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2900 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
2903 STRIP=`xcrun -find strip`
2904 LIBTOOL=`xcrun -find libtool`
2905 RANLIB=`xcrun -find ranlib`
2906 AC_MSG_RESULT([$CC and $CXX])
2909 case "$with_macosx_version_max_allowed" in
2911 MAC_OS_X_VERSION_MAX_ALLOWED="1080"
2914 MAC_OS_X_VERSION_MAX_ALLOWED="1090"
2917 MAC_OS_X_VERSION_MAX_ALLOWED="101000"
2920 MAC_OS_X_VERSION_MAX_ALLOWED="101100"
2923 AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.8--11])
2927 AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2928 if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2929 AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2934 AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2935 if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2936 AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
2940 AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2941 AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2943 AC_MSG_CHECKING([whether to do code signing])
2945 if test "$enable_macosx_code_signing" = yes; then
2946 # By default use the first suitable certificate (?).
2948 # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2949 # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2950 # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2951 # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
2952 # "Developer ID Application" one.
2954 identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
2955 if test -n "$identity"; then
2956 MACOSX_CODESIGNING_IDENTITY=$identity
2957 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2958 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2960 AC_MSG_ERROR([cannot determine identity to use])
2962 elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
2963 MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2964 pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2965 AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2970 AC_MSG_CHECKING([whether to create a Mac App Store package])
2972 if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
2973 AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
2974 elif test "$enable_macosx_package_signing" = yes; then
2975 # By default use the first suitable certificate.
2976 # It should be a "3rd Party Mac Developer Installer" one
2978 identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
2979 if test -n "$identity"; then
2980 MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
2981 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2982 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2984 AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
2986 elif test -n "$enable_macosx_package_signing"; then
2987 MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
2988 pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2989 AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
2994 if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
2995 AC_MSG_ERROR([You should not use the same identity for code and package signing])
2998 AC_MSG_CHECKING([whether to sandbox the application])
3000 if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3001 AC_MSG_ERROR([OS X sandboxing requires code signing])
3002 elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
3003 AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
3004 elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
3005 ENABLE_MACOSX_SANDBOX=TRUE
3006 AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
3007 AC_MSG_RESULT([yes])
3012 AC_MSG_CHECKING([what OS X app bundle identifier to use])
3013 MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
3014 AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
3016 AC_MSG_CHECKING([what OS X app name to use])
3017 MACOSX_APP_NAME="$with_macosx_app_name"
3018 AC_MSG_RESULT([$MACOSX_APP_NAME])
3021 AC_SUBST(MACOSX_SDK_PATH)
3022 AC_SUBST(MACOSX_SDK_VERSION)
3023 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3024 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
3025 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
3026 AC_SUBST(INSTALL_NAME_TOOL)
3027 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
3028 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
3029 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
3030 AC_SUBST(ENABLE_MACOSX_SANDBOX)
3031 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
3032 AC_SUBST(MACOSX_APP_NAME)
3034 dnl ===================================================================
3035 dnl Check iOS SDK and compiler
3036 dnl ===================================================================
3038 if test $_os = iOS; then
3040 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3046 AC_MSG_CHECKING([what iOS SDK to use])
3048 if test "$enable_ios_simulator" = yes; then
3049 platform=iPhoneSimulator
3054 xcode_developer=`xcode-select -print-path`
3057 for sdkver in 9.2 9.1 9.0 8.4 8.3 8.2 8.1 8.0; do
3058 t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
3066 if test -z "$sysroot"; then
3067 AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}])
3070 AC_MSG_RESULT($sysroot)
3072 XCODEBUILD_SDK=`echo $platform | tr A-Z a-z`$ios_sdk
3074 if test "$enable_ios_simulator" = yes; then
3075 if test "$BITNESS_OVERRIDE" = 64; then
3077 versionmin=-mios-simulator-version-min=7.0
3080 versionmin=-mios-simulator-version-min=7.0
3084 if test "$BITNESS_OVERRIDE" = 64; then
3089 versionmin=-miphoneos-version-min=7.0
3092 # LTO is not really recommended for iOS builds,
3093 # the link time will be astronomical
3094 if test "$ENABLE_LTO" = TRUE; then
3097 # Just add -fvisibility=hidden to CC and CXX directly so that the 3rd-party libs also
3098 # get compiled with it, to avoid ld warnings when linking all that together into one
3101 XCODE_CLANG_CXX_LIBRARY=libc++
3102 stdlib="-stdlib=$XCODE_CLANG_CXX_LIBRARY"
3104 CC="`xcrun -find clang` -arch $XCODE_ARCHS -fvisibility=hidden -isysroot $sysroot $lto $versionmin"
3105 CXX="`xcrun -find clang++` -arch $XCODE_ARCHS -fvisibility=hidden $stdlib -isysroot $sysroot $lto $versionmin"
3107 INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
3110 STRIP=`xcrun -find strip`
3111 LIBTOOL=`xcrun -find libtool`
3112 RANLIB=`xcrun -find ranlib`
3115 AC_SUBST(XCODE_CLANG_CXX_LIBRARY)
3116 AC_SUBST(XCODE_ARCHS)
3117 AC_SUBST(XCODEBUILD_SDK)
3119 AC_MSG_CHECKING([whether to treat the installation as read-only])
3121 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
3122 "$enable_extensions" != yes; then
3123 enable_readonly_installset=yes
3125 if test "$enable_readonly_installset" = yes; then
3126 AC_MSG_RESULT([yes])
3127 AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
3132 dnl ===================================================================
3133 dnl Structure of install set
3134 dnl ===================================================================
3136 if test $_os = Darwin; then
3137 LIBO_BIN_FOLDER=MacOS
3138 LIBO_ETC_FOLDER=Resources
3139 LIBO_LIBEXEC_FOLDER=MacOS
3140 LIBO_LIB_FOLDER=Frameworks
3141 LIBO_LIB_PYUNO_FOLDER=Resources
3142 LIBO_SHARE_FOLDER=Resources
3143 LIBO_SHARE_HELP_FOLDER=Resources/help
3144 LIBO_SHARE_JAVA_FOLDER=Resources/java
3145 LIBO_SHARE_PRESETS_FOLDER=Resources/presets
3146 LIBO_SHARE_READMES_FOLDER=Resources/readmes
3147 LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
3148 LIBO_SHARE_SHELL_FOLDER=Resources/shell
3149 LIBO_URE_BIN_FOLDER=MacOS
3150 LIBO_URE_ETC_FOLDER=Resources/ure/etc
3151 LIBO_URE_LIB_FOLDER=Frameworks
3152 LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
3153 LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
3154 elif test $_os = WINNT; then
3155 LIBO_BIN_FOLDER=program
3156 LIBO_ETC_FOLDER=program
3157 LIBO_LIBEXEC_FOLDER=program
3158 LIBO_LIB_FOLDER=program
3159 LIBO_LIB_PYUNO_FOLDER=program
3160 LIBO_SHARE_FOLDER=share
3161 LIBO_SHARE_HELP_FOLDER=help
3162 LIBO_SHARE_JAVA_FOLDER=program/classes
3163 LIBO_SHARE_PRESETS_FOLDER=presets
3164 LIBO_SHARE_READMES_FOLDER=readmes
3165 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3166 LIBO_SHARE_SHELL_FOLDER=program/shell
3167 LIBO_URE_BIN_FOLDER=program
3168 LIBO_URE_ETC_FOLDER=program
3169 LIBO_URE_LIB_FOLDER=program
3170 LIBO_URE_MISC_FOLDER=program
3171 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3173 LIBO_BIN_FOLDER=program
3174 LIBO_ETC_FOLDER=program
3175 LIBO_LIBEXEC_FOLDER=program
3176 LIBO_LIB_FOLDER=program
3177 LIBO_LIB_PYUNO_FOLDER=program
3178 LIBO_SHARE_FOLDER=share
3179 LIBO_SHARE_HELP_FOLDER=help
3180 LIBO_SHARE_JAVA_FOLDER=program/classes
3181 LIBO_SHARE_PRESETS_FOLDER=presets
3182 LIBO_SHARE_READMES_FOLDER=readmes
3183 LIBO_SHARE_RESOURCE_FOLDER=program/resource
3184 LIBO_SHARE_SHELL_FOLDER=program/shell
3185 LIBO_URE_BIN_FOLDER=program
3186 LIBO_URE_ETC_FOLDER=program
3187 LIBO_URE_LIB_FOLDER=program
3188 LIBO_URE_MISC_FOLDER=program
3189 LIBO_URE_SHARE_JAVA_FOLDER=program/classes
3191 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
3192 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
3193 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
3194 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
3195 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
3196 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
3197 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
3198 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
3199 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
3200 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
3201 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
3202 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
3203 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
3204 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
3205 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
3206 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
3208 # Not all of them needed in config_host.mk, add more if need arises
3209 AC_SUBST(LIBO_BIN_FOLDER)
3210 AC_SUBST(LIBO_ETC_FOLDER)
3211 AC_SUBST(LIBO_LIB_FOLDER)
3212 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
3213 AC_SUBST(LIBO_SHARE_FOLDER)
3214 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
3215 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
3216 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
3217 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
3218 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
3219 AC_SUBST(LIBO_URE_BIN_FOLDER)
3220 AC_SUBST(LIBO_URE_ETC_FOLDER)
3221 AC_SUBST(LIBO_URE_LIB_FOLDER)
3222 AC_SUBST(LIBO_URE_MISC_FOLDER)
3223 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
3225 dnl ===================================================================
3226 dnl Windows specific tests and stuff
3227 dnl ===================================================================
3229 # Get a value from the 32-bit side of the Registry
3232 # Return value: $regvalue
3234 _regvalue=`cat "/proc/registry32/$1" 2> /dev/null`
3236 if test $? -eq 0; then
3241 # Get a value from the 64-bit side of the Registry
3244 # Return value: $regvalue
3246 _regvalue=`cat "/proc/registry64/$1" 2> /dev/null`
3248 if test $? -eq 0; then
3253 if test "$_os" = "WINNT"; then
3254 AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
3255 if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
3257 WINDOWS_SDK_ARCH="x86"
3259 AC_MSG_RESULT([yes])
3260 WINDOWS_SDK_ARCH="x64"
3265 if test "$cross_compiling" = "yes"; then
3266 export CROSS_COMPILING=TRUE
3267 SCPDEFS="$SCPDEFS -DCROSS_COMPILING"
3270 BUILD_TYPE="$BUILD_TYPE NATIVE"
3272 AC_SUBST(CROSS_COMPILING)
3274 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3275 if test "$GCC" = "yes"; then
3276 AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
3277 bsymbolic_functions_ldflags_save=$LDFLAGS
3278 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
3279 AC_LINK_IFELSE([AC_LANG_PROGRAM([
3282 printf ("hello world\n");
3283 ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3284 if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3285 AC_MSG_RESULT( found )
3287 AC_MSG_RESULT( not found )
3289 LDFLAGS=$bsymbolic_functions_ldflags_save
3291 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3293 # Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers.
3294 # NOTE: must _not_ be used for bundled external libraries!
3296 if test "$GCC" = "yes"; then
3297 AC_MSG_CHECKING( for -isystem )
3299 CFLAGS="$CFLAGS -Werror"
3300 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
3302 if test -n "$ISYSTEM"; then
3308 if test -z "$ISYSTEM"; then
3309 # fall back to using -I
3314 dnl ===================================================================
3315 dnl Check which Visual Studio or MinGW compiler is used
3316 dnl ===================================================================
3318 map_vs_year_to_version()
3320 # Return value: $vsversion
3330 AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
3334 vs_versions_to_check()
3336 # Args: $1 (optional) : versions to check, in the order of preference
3337 # Return value: $vsversions
3341 if test -n "$1"; then
3342 map_vs_year_to_version "$1"
3343 vsversions=$vsversion
3345 # By default we prefer 2013
3352 # Find Visual Studio 2013/2015
3353 # Args: $1 (optional) : versions to check, in the order of preference
3354 # Return value: $vstest
3358 vs_versions_to_check "$1"
3360 for ver in $vsversions; do
3361 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/ProductDir
3362 if test -n "$regvalue"; then
3366 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VS/ProductDir
3367 if test -n "$regvalue"; then
3376 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot10"
3377 if test -n "$regvalue"; then
3379 ucrtdir=10.0.10240.0
3385 # Find Visual C++ 2013/2015
3386 # Args: $1 (optional) : The VS version year
3387 # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot
3389 unset vctest vcnum vcnumwithdot vcexpress
3391 vs_versions_to_check "$1"
3393 for ver in $vsversions; do
3394 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
3395 if test -n "$regvalue"; then
3399 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VC/ProductDir
3400 if test -n "$regvalue"; then
3405 if test -n "$vctest"; then
3407 case "$vcnumwithdot" in
3417 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$vcnumwithdot/Setup/VC/ProductDir
3418 if test -n "$regvalue" -a "$regvalue" = "$vctest" ; then
3425 SHOWINCLUDES_PREFIX=
3428 if test "$_os" = "WINNT"; then
3429 if test "$WITH_MINGW" != "yes"; then
3430 AC_MSG_CHECKING([Visual C++])
3432 find_msvc "$with_visual_studio"
3434 if test -z "$vctest"; then
3435 if test -n "$with_visual_studio"; then
3436 AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
3438 AC_MSG_ERROR([No Visual Studio 2013/2015 installation found])
3442 if test "$BITNESS_OVERRIDE" = ""; then
3443 if test -f "$vctest/bin/cl.exe"; then
3444 VC_PRODUCT_DIR=$vctest
3446 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
3449 if test -f "$vctest/bin/amd64/cl.exe"; then
3450 VC_PRODUCT_DIR=$vctest
3452 if test -f "$vctest/bin/x86_amd64/cl.exe" -a "$vcexpress" = "Express"; then
3453 VC_PRODUCT_DIR=$vctest
3455 AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/amd64/cl.exe or $vctest/bin/x86_amd64/cl.exe])
3460 VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
3461 AC_MSG_RESULT([$VC_PRODUCT_DIR])
3463 AC_MSG_CHECKING([Is Visual C++ Express])
3464 if test "$vcexpress" = "Express" ; then
3465 AC_MSG_RESULT([Yes])
3470 AC_MSG_CHECKING([whether UCRT is needed for this compiler version])
3471 if test "$vcnum" = "120"; then
3474 AC_MSG_RESULT([Yes])
3475 AC_MSG_CHECKING([for UCRT location])
3477 if test -n "$ucrttest"; then
3478 AC_MSG_RESULT([found])
3479 PathFormat "$ucrttest"
3480 ucrtincpath_formatted="$formatted_path/Include/$ucrtdir/ucrt"
3481 # SOLARINC is used for external modules and must be set too.
3482 # And no, it's not sufficient to set SOLARINC only, as configure
3483 # itself doesn't honour it.
3484 SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
3485 CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
3486 CXXFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
3488 AC_MSG_ERROR([not found])
3492 # Find the proper version of MSBuild.exe to use based on the VS version
3493 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
3494 if test -n "$regvalue" ; then
3495 MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
3498 # Find the version of devenv.exe
3499 DEVENV="$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe"
3500 if test ! -e "$DEVENV" -a "$vcnum" = "120"; then
3501 # for Visual Studio 2013 Express, fall back
3502 DEVENV="$VC_PRODUCT_DIR/../Common7/IDE/WDExpress.exe"
3504 if test ! -e "$DEVENV"; then
3505 AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
3508 dnl ===========================================================
3509 dnl Check for the corresponding mspdb*.dll
3510 dnl ===========================================================
3514 if test "$BITNESS_OVERRIDE" = ""; then
3515 if test "$vcnum" = "120"; then
3516 MSPDB_PATH="$VC_PRODUCT_DIR/../VC/bin"
3518 MSPDB_PATH="$VC_PRODUCT_DIR/../Common7/IDE"
3521 if test "$vcexpress" = "Express"; then
3522 MSPDB_PATH="$VC_PRODUCT_DIR/bin"
3524 MSPDB_PATH="$VC_PRODUCT_DIR/bin/amd64"
3530 if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
3531 AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
3534 MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3535 MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3537 dnl The path needs to be added before cl is called
3538 PATH="$MSPDB_PATH:$PATH"
3540 AC_MSG_CHECKING([cl.exe])
3542 # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
3543 # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
3544 # location, isn't it likely that lots of other things needs changes, too, and just setting CC
3547 if test -z "$CC"; then
3548 if test "$BITNESS_OVERRIDE" = ""; then
3549 if test -f "$VC_PRODUCT_DIR/bin/cl.exe"; then
3550 CC="$VC_PRODUCT_DIR/bin/cl.exe"
3553 if test "$vcexpress" = "Express"; then
3554 if test -f "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"; then
3555 CC="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3558 if test -f "$VC_PRODUCT_DIR/bin/amd64/cl.exe"; then
3559 CC="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3564 # This gives us a posix path with 8.3 filename restrictions
3565 CC=`win_short_path_for_make "$CC"`
3568 if test -n "$CC"; then
3569 # Remove /cl.exe from CC case insensitive
3570 AC_MSG_RESULT([found Visual C++ $vcyear $vcexpress ($CC)])
3571 if test "$BITNESS_OVERRIDE" = ""; then
3572 COMPATH=`echo "$CC" | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
3574 if test -n "$VC_PRODUCT_DIR"; then
3575 COMPATH=$VC_PRODUCT_DIR
3578 if test "$BITNESS_OVERRIDE" = ""; then
3579 dnl since MSVC 2012, default for x86 is -arch:SSE2:
3582 export INCLUDE=`cygpath -d "$COMPATH/Include"`
3584 PathFormat "$COMPATH"
3585 COMPATH="$formatted_path"
3590 # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess... Assuming newer ones
3591 # are always "better", we list them in reverse chronological order.
3596 WINDOWS_SDK_ACCEPTABLE_VERSIONS="8.1A 8.1 8.0 7.1A"
3600 WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0A 8.1A 8.1 8.0 7.1A"
3604 # The expectation is that --with-windows-sdk should not need to be used
3605 if test -n "$with_windows_sdk"; then
3606 case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
3607 *" "$with_windows_sdk" "*)
3608 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
3611 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
3616 # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
3621 AC_MSG_ERROR([Visual C++ not found after all, huh])
3624 dnl We need to guess the prefix of the -showIncludes output, it can be
3626 AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3627 echo "#include <stdlib.h>" > conftest.c
3628 dnl Filter out -FIIntrin.h when CC points at clang-cl.exe and needs to
3629 dnl explicitly state that argument:
3640 SHOWINCLUDES_PREFIX=`$my_CC $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
3641 grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3642 rm -f conftest.c conftest.obj
3643 if test -z "$SHOWINCLUDES_PREFIX"; then
3644 AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3646 AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3649 # Check for 64-bit (cross-)compiler to use to build the 64-bit
3650 # version of the Explorer extension (and maybe other small
3651 # bits, too) needed when installing a 32-bit LibreOffice on a
3652 # 64-bit OS. The 64-bit Explorer extension is a feature that
3653 # has been present since long in OOo. Don't confuse it with
3654 # building LibreOffice itself as 64-bit code, which is
3655 # unfinished work and highly experimental.
3661 if test "$BITNESS_OVERRIDE" = ""; then
3662 AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3663 if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
3664 # Prefer native x64 compiler to cross-compiler, in case we are running
3665 # the build on a 64-bit OS.
3666 if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3668 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
3669 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
3670 elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3672 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
3673 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
3676 if test "$BUILD_X64" = TRUE; then
3677 AC_MSG_RESULT([found])
3679 AC_MSG_RESULT([not found])
3680 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3685 # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
3686 AC_SUBST(CXX_X64_BINARY)
3687 AC_SUBST(LINK_X64_BINARY)
3689 AC_MSG_CHECKING([the compiler is MinGW])
3690 MACHINE_PREFIX=`$CC -dumpmachine`
3691 if echo $MACHINE_PREFIX | $GREP -q mingw32; then
3692 COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
3693 AC_MSG_RESULT([yes])
3695 AC_MSG_ERROR([Compiler is not MinGW.])
3701 PathFormat "$MSPDB_PATH"
3702 MSPDB_PATH="$formatted_path"
3703 AC_SUBST(SHOWINCLUDES_PREFIX)
3705 if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
3706 AC_MSG_CHECKING([whether to use DirectX])
3707 if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
3708 ENABLE_DIRECTX="TRUE"
3709 AC_MSG_RESULT([yes])
3715 AC_MSG_CHECKING([whether to use ActiveX])
3716 if test "$enable_activex" = "yes" -o "$enable_activex" = "" -a "$vcexpress" != Express; then
3718 AC_MSG_RESULT([yes])
3720 DISABLE_ACTIVEX="TRUE"
3724 AC_MSG_CHECKING([whether to use ATL])
3725 if test "$enable_atl" = "yes" -o "$enable_atl" = "" -a "$vcexpress" != Express; then
3727 AC_MSG_RESULT([yes])
3734 DISABLE_ACTIVEX="TRUE"
3738 AC_SUBST(ENABLE_DIRECTX)
3739 AC_SUBST(DISABLE_ACTIVEX)
3740 AC_SUBST(DISABLE_ATL)
3745 if test "$_os" = "WINNT"; then
3746 BUILD_TYPE="$BUILD_TYPE DBGHELP"
3752 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3753 AC_SUBST(UNOWINREG_DLL)
3756 AC_MSG_CHECKING([whether the compiler is actually Clang])
3757 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3763 [AC_MSG_RESULT([yes])
3765 [AC_MSG_RESULT([no])])
3767 if test "$COM_IS_CLANG" = TRUE; then
3768 AC_MSG_CHECKING([the Clang version])
3769 clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | ${CC%-cl.exe*} -E -P -`
3770 CLANG_FULL_VERSION=`echo __clang_version__ | ${CC%-cl.exe*} -E -P -`
3771 CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3772 AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3773 AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
3775 AC_SUBST(COM_IS_CLANG)
3777 if test "$CCACHE" != "" -a "$COM_IS_CLANG" = TRUE; then
3778 if test -z "$CCACHE_CPP2"; then
3779 AC_MSG_WARN([Using ccache with Clang without CCACHE_CPP2 set causes spurious warnings.])
3780 add_warning "Using ccache with Clang without CCACHE_CPP2 set causes spurious warnings."
3785 # prefix C with ccache if needed
3787 if test "$CCACHE" != ""; then
3788 AC_MSG_CHECKING([whether $CC is already ccached])
3792 CFLAGS="$CFLAGS --ccache-skip -O2"
3793 dnl an empty program will do, we're checking the compiler flags
3794 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3795 [use_ccache=yes], [use_ccache=no])
3796 if test $use_ccache = yes; then
3797 AC_MSG_RESULT([yes])
3806 # ===================================================================
3807 # check various GCC options that Clang does not support now but maybe
3808 # will somewhen in the future, check them even for GCC, so that the
3810 # ===================================================================
3813 HAVE_GCC_FINLINE_LIMIT=
3814 HAVE_GCC_FNO_INLINE=
3815 if test "$GCC" = "yes"; then
3816 AC_MSG_CHECKING([whether $CC supports -ggdb2])
3817 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3818 # Option just ignored and silly warning that isn't a real
3823 CFLAGS="$CFLAGS -Werror -ggdb2"
3824 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3827 if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3828 AC_MSG_RESULT([yes])
3833 AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3834 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3839 CFLAGS="$CFLAGS -Werror -finline-limit=0"
3840 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3843 if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3844 AC_MSG_RESULT([yes])
3849 AC_MSG_CHECKING([whether $CC supports -fno-inline])
3850 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3855 CFLAGS="$CFLAGS -Werror -fno-inline"
3856 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3859 if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3860 AC_MSG_RESULT([yes])
3865 AC_SUBST(HAVE_GCC_GGDB2)
3866 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3867 AC_SUBST(HAVE_GCC_FNO_INLINE)
3869 dnl ===================================================================
3870 dnl Test the gcc version
3871 dnl ===================================================================
3872 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
3873 AC_MSG_CHECKING([the GCC version])
3874 _gcc_version=`$CC -dumpversion`
3875 GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
3877 AC_MSG_RESULT([gcc $_gcc_version])
3879 if test "$GCC_VERSION" -lt 0407; then
3880 AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.7.0])
3883 # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
3884 # GCC version should generally be checked only when handling GCC-specific bugs, for testing
3885 # things like features configure checks should be used, otherwise they may e.g. fail with Clang
3886 # (which reports itself as GCC 4.2.1).
3889 AC_SUBST(GCC_VERSION)
3891 dnl Set the ENABLE_DBGUTIL variable
3892 dnl ===================================================================
3893 AC_MSG_CHECKING([whether to build with additional debug utilities])
3894 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3895 ENABLE_DBGUTIL="TRUE"
3896 # this is an extra var so it can have different default on different MSVC
3897 # versions (in case there are version specific problems with it)
3898 MSVC_USE_DEBUG_RUNTIME="TRUE"
3900 AC_MSG_RESULT([yes])
3901 # cppunit and graphite expose STL in public headers
3902 if test "$with_system_cppunit" = "yes"; then
3903 AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3905 with_system_cppunit=no
3907 if test "$with_system_graphite" = "yes"; then
3908 AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3910 with_system_graphite=no
3912 if test "$with_system_mysql_cppconn" = "yes"; then
3913 AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
3915 with_system_mysql_cppconn=no
3917 if test "$with_system_orcus" = "yes"; then
3918 AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3920 with_system_orcus=no
3922 if test "$with_system_libcmis" = "yes"; then
3923 AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
3925 with_system_libcmis=no
3927 if test "$with_system_libgltf" = "yes"; then
3928 AC_MSG_ERROR([--with-system-libgltf conflicts with --enable-dbgutil])
3930 with_system_libgltf=no
3934 MSVC_USE_DEBUG_RUNTIME=""
3937 AC_SUBST(ENABLE_DBGUTIL)
3938 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
3940 dnl Set the ENABLE_DEBUG variable.
3941 dnl ===================================================================
3942 AC_MSG_CHECKING([whether to do a debug build])
3943 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3944 AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3946 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
3947 AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3950 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
3952 if test -n "$ENABLE_DBGUTIL" ; then
3953 AC_MSG_RESULT([yes (dbgutil)])
3955 AC_MSG_RESULT([yes])
3961 AC_SUBST(ENABLE_DEBUG)
3963 if test "$enable_sal_log" = yes; then
3966 AC_SUBST(ENABLE_SAL_LOG)
3968 dnl Selective debuginfo
3969 ENABLE_DEBUGINFO_FOR=
3970 if test -n "$ENABLE_DEBUG"; then
3971 AC_MSG_CHECKING([whether to use selective debuginfo])
3972 if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3973 if test "$enable_selective_debuginfo" = "yes"; then
3974 AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
3976 ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3977 AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3979 ENABLE_DEBUGINFO_FOR=all
3980 AC_MSG_RESULT([no, for all])
3983 if test -n "$enable_selective_debuginfo"; then
3984 AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
3987 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3989 dnl Check for enable symbols option
3990 dnl ===================================================================
3991 AC_MSG_CHECKING([whether to include symbols while preserve optimization])
3992 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
3993 ENABLE_SYMBOLS="TRUE"
3994 if test -n "$ENABLE_DBGUTIL"; then
3995 AC_MSG_ERROR([--enable-dbgutil cannot be used with --enable-symbols])
3996 elif test -n "$ENABLE_DEBUG"; then
3997 AC_MSG_ERROR([--enable-debug cannot be used with --enable-symbols])
3999 AC_MSG_RESULT([yes])
4001 if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
4002 ENABLE_SYMBOLS="FALSE"
4008 AC_SUBST(ENABLE_SYMBOLS)
4010 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
4011 # Building on Android with full symbols: without enough memory the linker never finishes currently.
4012 AC_MSG_CHECKING([whether enough memory is available for linking])
4013 mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
4014 # Check for 15GB, as Linux reports a bit less than the physical memory size.
4015 if test -n "$mem_size" -a $mem_size -lt 15728640; then
4016 AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
4018 AC_MSG_RESULT([yes])
4022 # Debug information format for iOS. Running dsymutil takes a long time... you really need a separate
4023 # .dSYM only if running Instruments, I think. (Not for normal debugging in Xcode.) To enable a
4024 # separate .dSYM, either use --enable-release-build or change manually to "DWARF with DSYM" in Xcode.
4025 XCODE_DEBUG_INFORMATION_FORMAT=dwarf-with-dsym
4026 if test "$enable_release_build" != yes -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \); then
4027 XCODE_DEBUG_INFORMATION_FORMAT=dwarf
4029 AC_SUBST(XCODE_DEBUG_INFORMATION_FORMAT)
4031 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
4032 # By default use the ones specified by our build system,
4033 # but explicit override is possible.
4034 AC_MSG_CHECKING(for explicit AFLAGS)
4035 if test -n "$AFLAGS"; then
4036 AC_MSG_RESULT([$AFLAGS])
4042 AC_MSG_CHECKING(for explicit CFLAGS)
4043 if test -n "$CFLAGS"; then
4044 AC_MSG_RESULT([$CFLAGS])
4050 AC_MSG_CHECKING(for explicit CXXFLAGS)
4051 if test -n "$CXXFLAGS"; then
4052 AC_MSG_RESULT([$CXXFLAGS])
4058 AC_MSG_CHECKING(for explicit OBJCFLAGS)
4059 if test -n "$OBJCFLAGS"; then
4060 AC_MSG_RESULT([$OBJCFLAGS])
4066 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
4067 if test -n "$OBJCXXFLAGS"; then
4068 AC_MSG_RESULT([$OBJCXXFLAGS])
4074 AC_MSG_CHECKING(for explicit LDFLAGS)
4075 if test -n "$LDFLAGS"; then
4076 AC_MSG_RESULT([$LDFLAGS])
4086 AC_SUBST(OBJCXXFLAGS)
4090 AC_SUBST(x_CXXFLAGS)
4091 AC_SUBST(x_OBJCFLAGS)
4092 AC_SUBST(x_OBJCXXFLAGS)
4096 # determine CPUNAME, OS, ...
4097 # The USING_X11 flag tells whether the host os uses X by default. Can be overriden with the --without-x option.
4108 PLATFORMID=aix_powerpc
4117 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4124 if test "$BITNESS_OVERRIDE" = 64; then
4127 PLATFORMID=windows_x86_64
4129 SCPDEFS="$SCPDEFS -DWINDOWS_X64"
4133 PLATFORMID=windows_x86
4137 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4140 SCPDEFS="$SCPDEFS -D_MSC_VER"
4158 AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
4163 PLATFORMID=macosx_x86_64
4166 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4182 PLATFORMID=dragonfly_x86
4187 PLATFORMID=dragonfly_x86_64
4190 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4206 PLATFORMID=freebsd_x86
4211 PLATFORMID=freebsd_x86_64
4214 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4231 PLATFORMID=kfreebsd_x86
4236 PLATFORMID=kfreebsd_x86_64
4239 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4255 PLATFORMID=linux_aarch64
4261 PLATFORMID=linux_alpha
4267 PLATFORMID=linux_arm_eabi
4271 PLATFORMID=linux_arm_oabi
4279 PLATFORMID=linux_hppa
4284 PLATFORMID=linux_x86
4289 PLATFORMID=linux_ia64
4295 PLATFORMID=linux_mips_eb
4300 EPM_FLAGS="-a mips64"
4301 PLATFORMID=linux_mips64_eb
4306 EPM_FLAGS="-a mips64el"
4307 PLATFORMID=linux_mips64_el
4312 EPM_FLAGS="-a mipsel"
4313 PLATFORMID=linux_mips_el
4318 PLATFORMID=linux_m68k
4323 PLATFORMID=linux_powerpc
4328 PLATFORMID=linux_powerpc64
4332 RTL_ARCH=PowerPC_64_LE
4333 PLATFORMID=linux_powerpc64_le
4338 PLATFORMID=linux_sparc
4343 PLATFORMID=linux_s390
4348 PLATFORMID=linux_s390x
4353 PLATFORMID=linux_x86_64
4356 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4373 PLATFORMID=android_arm_eabi
4378 PLATFORMID=android_aarch64
4381 CPUNAME=GODSON # Weird, but maybe that's the LO convention?
4383 PLATFORMID=android_mips_el
4388 PLATFORMID=android_x86
4391 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4404 PLATFORMID=linux_x86
4416 if test "$BITNESS_OVERRIDE" = 64; then
4419 PLATFORMID=windows_x86_64
4420 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgccx"
4424 PLATFORMID=windows_x86
4425 SOLARINC="$SOLARINC -I$SRC_ROOT/include/wntgcci"
4429 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4445 PLATFORMID=netbsd_x86
4450 PLATFORMID=netbsd_powerpc
4455 PLATFORMID=netbsd_sparc
4460 PLATFORMID=netbsd_x86_64
4463 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4479 PLATFORMID=openbsd_x86
4484 PLATFORMID=openbsd_x86_64
4487 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4490 SOLARINC="$SOLARINC -I/usr/local/include"
4504 PLATFORMID=solaris_x86
4509 PLATFORMID=solaris_sparc
4514 PLATFORMID=solaris_sparc64
4517 AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4520 SOLARINC="$SOLARINC -I/usr/local/include"
4524 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4528 if test "$with_x" = "no"; then
4529 if test "$USING_X11" != TRUE; then
4530 AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --without-x])
4535 WORKDIR="${BUILDDIR}/workdir"
4536 INSTDIR="${BUILDDIR}/instdir"
4537 INSTROOT="${INSTDIR}${INSTROOTSUFFIX}"
4538 SOLARINC="-I. -I$SRC_ROOT/include $SOLARINC"
4546 AC_SUBST([INSTROOT])
4550 AC_SUBST(PLATFORMID)
4551 AC_SUBST(WINDOWS_X64)
4552 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
4554 dnl ===================================================================
4555 dnl Test which package format to use
4556 dnl ===================================================================
4557 AC_MSG_CHECKING([which package format to use])
4558 if test -n "$with_package_format" -a "$with_package_format" != no; then
4559 for i in $with_package_format; do
4561 aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
4564 AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4565 aix - AIX software distribution
4566 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4567 deb - Debian software distribution
4568 pkg - Solaris software distribution
4569 rpm - RedHat software distribution
4571 LibreOffice additionally supports:
4572 archive - .tar.gz or .zip
4574 installed - installation tree
4580 PKGFORMAT="$with_package_format"
4581 AC_MSG_RESULT([$PKGFORMAT])
4584 AC_MSG_RESULT([none])
4588 dnl ===================================================================
4589 dnl Set up a different compiler to produce tools to run on the build
4590 dnl machine when doing cross-compilation
4591 dnl ===================================================================
4593 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4594 m4_pattern_allow([PKG_CONFIG_LIBDIR])
4595 if test "$cross_compiling" = "yes"; then
4596 AC_MSG_CHECKING([for BUILD platform configuration])
4598 rm -rf CONF-FOR-BUILD config_build.mk
4599 mkdir CONF-FOR-BUILD
4600 # Here must be listed all files needed when running the configure script. In particular, also
4601 # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
4602 # keep them in the same order as there.
4603 (cd $SRC_ROOT && tar cf - \
4605 bin/get_config_variables \
4606 solenv/bin/getcompver.awk \
4607 solenv/inc/langlist.mk \
4609 config_host_lang.mk.in \
4612 instsetoo_native/util/openoffice.lst.in \
4614 sysui/desktop/macosx/Info.plist.in \
4615 ios/lo.xcconfig.in) \
4616 | (cd CONF-FOR-BUILD && tar xf -)
4617 cp configure CONF-FOR-BUILD
4618 test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
4620 unset COM USING_X11 OS CPUNAME
4621 unset CC CXX SYSBASE CFLAGS
4622 unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
4623 unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4624 unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
4625 test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4626 test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4627 test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4630 test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4631 test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4632 test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4633 test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4634 test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4635 # we need the msi build tools on mingw if we are creating the
4637 if test "$WITH_MINGW" = "yes"; then
4638 enable_winegcc_for_build=
4639 for pkgformat in $PKGFORMAT; do
4640 case "$pkgformat" in
4641 msi|native) enable_winegcc_for_build=yes ;;
4644 test -n "$enable_winegcc_for_build" && sub_conf_opts="$sub_conf_opts --enable-winegcc"
4646 sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4647 # Don't bother having configure look for stuff not needed for the build platform anyway
4650 --disable-graphite \
4652 --disable-pdfimport \
4653 --disable-postgresql-sdbc \
4654 --with-parallelism="$with_parallelism" \
4659 2>&1 | sed -e 's/^/ /'
4660 test -f ./config_host.mk 2>/dev/null || exit
4661 cp config_host.mk ../config_build.mk
4662 cp config_host_lang.mk ../config_build_lang.mk
4663 mv config.log ../config.Build.log
4664 mkdir -p ../config_build
4665 mv config_host/*.h ../config_build
4666 . ./bin/get_config_variables CC CXX INSTDIR INSTROOT LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER OS PATH SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT WORKDIR
4668 for V in CC CXX LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER OS SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT; do
4670 VV=`eval "echo $VV"`
4671 if test -n "$VV"; then
4672 line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4673 echo "$line" >>build-config
4677 for V in INSTDIR INSTROOT WORKDIR; do
4679 VV=`eval "echo $VV"`
4680 VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
4681 if test -n "$VV"; then
4682 line="${V}_FOR_BUILD='$VV'"
4683 echo "$line" >>build-config
4687 line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4688 echo "$line" >>build-config
4691 test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4692 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])
4693 perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
4694 -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
4696 eval `cat CONF-FOR-BUILD/build-config`
4698 AC_MSG_RESULT([checking for BUILD platform configuration... done])
4700 rm -rf CONF-FOR-BUILD
4704 CXX_FOR_BUILD="$CXX"
4705 INSTDIR_FOR_BUILD="$INSTDIR"
4706 INSTROOT_FOR_BUILD="$INSTROOT"
4707 LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
4708 LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
4709 LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
4710 SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
4711 WORKDIR_FOR_BUILD="$WORKDIR"
4713 AC_SUBST(OS_FOR_BUILD)
4714 AC_SUBST(INSTDIR_FOR_BUILD)
4715 AC_SUBST(INSTROOT_FOR_BUILD)
4716 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
4717 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
4718 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
4719 AC_SUBST(SDKDIRNAME_FOR_BUILD)
4720 AC_SUBST(WORKDIR_FOR_BUILD)
4722 dnl ===================================================================
4723 dnl Check for syslog header
4724 dnl ===================================================================
4725 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
4727 # placeholder for future crash reporter feature
4729 AC_SUBST(ENABLE_CRASHDUMP)
4731 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4732 dnl ===================================================================
4733 AC_MSG_CHECKING([whether to turn warnings to errors])
4734 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4735 ENABLE_WERROR="TRUE"
4736 AC_MSG_RESULT([yes])
4738 if test -n "$LODE_HOME" -a -z "$enable_werror"; then
4739 ENABLE_WERROR="TRUE"
4740 AC_MSG_RESULT([yes])
4745 AC_SUBST(ENABLE_WERROR)
4747 dnl Set the ASSERT_ALWAYS_ABORT variable. (Activate --enable-assert-always-abort)
4748 dnl ===================================================================
4749 AC_MSG_CHECKING([whether to have assert to abort in release code])
4750 if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
4751 ASSERT_ALWAYS_ABORT="TRUE"
4752 AC_MSG_RESULT([yes])
4754 ASSERT_ALWAYS_ABORT="FALSE"
4757 AC_SUBST(ASSERT_ALWAYS_ABORT)
4759 # Determine whether to use ooenv for the instdir installation
4760 # ===================================================================
4761 if test $_os != "WINNT" -a $_os != "Darwin"; then
4762 AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
4763 if test "$enable_ooenv" = "no"; then
4767 AC_MSG_RESULT([yes])
4770 AC_SUBST(ENABLE_OOENV)
4772 if test "$USING_X11" != TRUE; then
4773 # be sure to do not mess with unneeded stuff
4779 build_gstreamer_1_0=no
4780 build_gstreamer_0_10=no
4783 enable_cairo_canvas=no
4786 dnl ===================================================================
4787 dnl check for cups support
4788 dnl ===================================================================
4791 if test "$enable_cups" = "no"; then
4795 AC_MSG_CHECKING([whether to enable CUPS support])
4796 if test "$test_cups" = "yes"; then
4798 AC_MSG_RESULT([yes])
4800 AC_MSG_CHECKING([whether cups support is present])
4801 AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4802 AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4803 if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
4804 AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
4806 AC_DEFINE(ENABLE_CUPS)
4811 AC_SUBST(ENABLE_CUPS)
4814 if test "$test_fontconfig" = "yes"; then
4815 PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
4816 SYSTEM_FONTCONFIG=TRUE
4817 FilterLibs "${FONTCONFIG_LIBS}"
4818 FONTCONFIG_LIBS="${filteredlibs}"
4820 AC_SUBST(FONTCONFIG_CFLAGS)
4821 AC_SUBST(FONTCONFIG_LIBS)
4822 AC_SUBST([SYSTEM_FONTCONFIG])
4824 dnl whether to find & fetch external tarballs?
4825 dnl ===================================================================
4826 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
4827 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
4828 TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
4830 TARFILE_LOCATION="$LODE_HOME/ext_tar"
4833 if test -z "$TARFILE_LOCATION"; then
4834 if test -d "$SRC_ROOT/src" ; then
4835 mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
4836 ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
4838 TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
4840 AbsolutePath "$TARFILE_LOCATION"
4841 PathFormat "${absolute_path}"
4842 TARFILE_LOCATION="${formatted_path}"
4844 AC_SUBST(TARFILE_LOCATION)
4846 AC_MSG_CHECKING([whether we want to fetch tarballs])
4847 if test "$enable_fetch_external" != "no"; then
4848 if test "$with_all_tarballs" = "yes"; then
4849 AC_MSG_RESULT(["yes, all of them"])
4850 DO_FETCH_TARBALLS="ALL"
4852 AC_MSG_RESULT(["yes, if we use them"])
4853 DO_FETCH_TARBALLS="TRUE"
4859 AC_SUBST(DO_FETCH_TARBALLS)
4861 AC_MSG_CHECKING([whether to build help])
4862 HELP_COMMON_ONLY=FALSE
4863 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4864 BUILD_TYPE="$BUILD_TYPE HELP"
4865 GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4866 if test "$with_help" = "common" ; then
4867 HELP_COMMON_ONLY=TRUE
4868 AC_MSG_RESULT([common only])
4870 SCPDEFS="$SCPDEFS -DWITH_HELP"
4871 AC_MSG_RESULT([yes])
4876 AC_SUBST(HELP_COMMON_ONLY)
4878 dnl Test whether to include MySpell dictionaries
4879 dnl ===================================================================
4880 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4881 if test "$with_myspell_dicts" = "yes"; then
4882 AC_MSG_RESULT([yes])
4883 WITH_MYSPELL_DICTS=TRUE
4884 BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4885 GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4890 AC_SUBST(WITH_MYSPELL_DICTS)
4892 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
4893 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
4894 if test "$with_system_dicts" = yes; then
4895 AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
4897 with_system_dicts=no
4900 AC_MSG_CHECKING([whether to use dicts from external paths])
4901 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4902 AC_MSG_RESULT([yes])
4904 AC_MSG_CHECKING([for spelling dictionary directory])
4905 if test -n "$with_external_dict_dir"; then
4906 DICT_SYSTEM_DIR=file://$with_external_dict_dir
4908 DICT_SYSTEM_DIR=file:///usr/share/hunspell
4909 if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4910 DICT_SYSTEM_DIR=file:///usr/share/myspell
4913 AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4914 AC_MSG_CHECKING([for hyphenation patterns directory])
4915 if test -n "$with_external_hyph_dir"; then
4916 HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4918 HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4920 AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4921 AC_MSG_CHECKING([for thesaurus directory])
4922 if test -n "$with_external_thes_dir"; then
4923 THES_SYSTEM_DIR=file://$with_external_thes_dir
4925 THES_SYSTEM_DIR=file:///usr/share/mythes
4927 AC_MSG_RESULT([$THES_SYSTEM_DIR])
4932 AC_SUBST(SYSTEM_DICTS)
4933 AC_SUBST(DICT_SYSTEM_DIR)
4934 AC_SUBST(HYPH_SYSTEM_DIR)
4935 AC_SUBST(THES_SYSTEM_DIR)
4937 dnl ===================================================================
4938 dnl enable pch by default on windows
4939 dnl enable it explicitely otherwise
4940 AC_MSG_CHECKING([whether to enable pch feature])
4942 if test "$enable_pch" != "no"; then
4943 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
4945 AC_MSG_RESULT([yes])
4946 elif test -n "$enable_pch" && test "$GCC" = "yes"; then
4948 AC_MSG_RESULT([yes])
4949 elif test -n "$enable_pch"; then
4950 AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
4957 AC_SUBST(ENABLE_PCH)
4961 AC_MSG_CHECKING([the GNU Make version])
4962 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4963 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4964 if test "$_make_longver" -ge "038200"; then
4965 AC_MSG_RESULT([$GNUMAKE $_make_version])
4967 elif test "$_make_longver" -ge "038100"; then
4968 if test "$build_os" = "cygwin"; then
4969 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4971 AC_MSG_RESULT([$GNUMAKE $_make_version])
4973 dnl ===================================================================
4974 dnl Search all the common names for sha1sum
4975 dnl ===================================================================
4976 AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
4977 if test -z "$SHA1SUM"; then
4978 AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
4979 elif test "$SHA1SUM" = "openssl"; then
4980 SHA1SUM="openssl sha1"
4982 AC_MSG_CHECKING([for GNU Make bug 20033])
4983 TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4984 $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
4985 A := \$(wildcard *.a)
4989 <TAB>@echo survived bug20033.
4993 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
5006 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
5007 <TAB>\$(call d1,\$(CHECKSUM)),\
5008 <TAB>\$(call d2,\$(CHECKSUM)))
5010 if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
5011 no_parallelism_make="YES"
5012 AC_MSG_RESULT([yes, disable parallelism])
5014 AC_MSG_RESULT([no, keep parallelism enabled])
5016 rm -rf $TESTGMAKEBUG20033
5018 AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
5021 # find if gnumake support file function
5022 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
5023 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
5024 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
5025 TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
5027 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
5028 \$(file >test.txt,Success )
5035 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
5036 if test -f $TESTGMAKEFILEFUNC/test.txt; then
5037 HAVE_GNUMAKE_FILE_FUNC=TRUE
5038 AC_MSG_RESULT([yes])
5042 rm -rf $TESTGMAKEFILEFUNC
5043 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
5044 AC_SUBST(GNUMAKE_WIN_NATIVE)
5046 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
5048 if test "$_make_ver_check" = ""; then
5052 HAVE_LD_HASH_STYLE=FALSE
5053 WITH_LINKER_HASH_STYLE=
5054 AC_MSG_CHECKING( for --hash-style gcc linker support )
5055 if test "$GCC" = "yes"; then
5056 if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
5057 hash_styles="gnu sysv"
5058 elif test "$with_linker_hash_style" = "no"; then
5061 hash_styles="$with_linker_hash_style"
5064 for hash_style in $hash_styles; do
5065 test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
5066 hash_style_ldflags_save=$LDFLAGS
5067 LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
5069 AC_RUN_IFELSE([AC_LANG_PROGRAM(
5076 HAVE_LD_HASH_STYLE=TRUE
5077 WITH_LINKER_HASH_STYLE=$hash_style
5079 [HAVE_LD_HASH_STYLE=FALSE],
5080 [HAVE_LD_HASH_STYLE=FALSE])
5081 LDFLAGS=$hash_style_ldflags_save
5084 if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
5085 AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
5089 LDFLAGS=$hash_style_ldflags_save
5093 AC_SUBST(HAVE_LD_HASH_STYLE)
5094 AC_SUBST(WITH_LINKER_HASH_STYLE)
5096 dnl ===================================================================
5097 dnl Check whether there's a Perl version available.
5098 dnl ===================================================================
5099 if test -z "$with_perl_home"; then
5100 AC_PATH_PROG(PERL, perl)
5102 test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
5103 _perl_path="$with_perl_home/bin/perl"
5104 if test -x "$_perl_path"; then
5107 AC_MSG_ERROR([$_perl_path not found])
5111 dnl ===================================================================
5112 dnl Testing for Perl version 5 or greater.
5113 dnl $] is the Perl version variable, it is returned as an integer
5114 dnl ===================================================================
5115 if test "$PERL"; then
5116 AC_MSG_CHECKING([the Perl version])
5117 ${PERL} -e "exit($]);"
5119 if test "$_perl_version" -lt 5; then
5120 AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
5122 AC_MSG_RESULT([checked (perl $_perl_version)])
5124 AC_MSG_ERROR([Perl not found, install version 5 of Perl])
5127 dnl ===================================================================
5128 dnl Testing for required Perl modules
5129 dnl ===================================================================
5131 AC_MSG_CHECKING([for required Perl modules])
5132 if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'>/dev/null 2>&1`; then
5133 AC_MSG_RESULT([all modules found])
5135 AC_MSG_RESULT([failed to find some modules])
5136 # Find out which modules are missing.
5137 missing_perl_modules=
5138 if ! `$PERL -e 'use Archive::Zip;'>/dev/null 2>&1`; then
5139 missing_perl_modules=Archive::Zip
5141 if ! `$PERL -e 'use Cwd;'>/dev/null 2>&1`; then
5142 missing_perl_modules="$missing_perl_modules Cwd"
5144 if ! `$PERL -e 'use Digest::MD5;'>/dev/null 2>&1`; then
5145 missing_perl_modules="$missing_perl_modules Digest::MD5"
5148 The missing Perl modules are: $missing_perl_modules
5149 Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
5152 dnl ===================================================================
5153 dnl Check for pkg-config
5154 dnl ===================================================================
5155 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5159 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5161 # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
5162 # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
5163 # explicitly. Or put /path/to/compiler in PATH yourself.
5165 # Use wrappers for LTO
5166 if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
5167 AC_CHECK_TOOL(AR,gcc-ar)
5168 AC_CHECK_TOOL(NM,gcc-nm)
5169 AC_CHECK_TOOL(RANLIB,gcc-ranlib)
5171 AC_CHECK_TOOL(AR,ar)
5172 AC_CHECK_TOOL(NM,nm)
5173 AC_CHECK_TOOL(RANLIB,ranlib)
5175 AC_CHECK_TOOL(OBJDUMP,objdump)
5176 AC_CHECK_TOOL(READELF,readelf)
5177 AC_CHECK_TOOL(STRIP,strip)
5178 if test "$_os" = "WINNT"; then
5179 AC_CHECK_TOOL(DLLTOOL,dlltool)
5180 AC_CHECK_TOOL(WINDRES,windres)
5187 AC_SUBST(PKG_CONFIG)
5193 dnl ===================================================================
5194 dnl pkg-config checks on Mac OS X
5195 dnl ===================================================================
5197 if test $_os = Darwin; then
5198 AC_MSG_CHECKING([for bogus pkg-config])
5199 if test -n "$PKG_CONFIG"; then
5200 if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
5201 AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
5203 if test "$enable_bogus_pkg_config" = "yes"; then
5204 AC_MSG_RESULT([yes, user-approved from unknown origin.])
5206 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please modify your PATH variable so that $PKG_CONFIG is no longer found by configure scripts.])
5210 AC_MSG_RESULT([no, good])
5216 # Return value: $csctest
5220 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
5221 if test -n "$regvalue"; then
5229 # Return value: $altest
5233 for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
5234 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
5235 if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
5244 # Return value: $frametest (that's a silly name...)
5248 for ver in 1.1 2.0; do
5249 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv$ver
5250 if test -n "$regvalue"; then
5262 # TODO(davido): Do we need to take care about 32bit?
5263 reg_get_value_64 "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
5264 if test -n "$regvalue"; then
5271 find_winsdk_version()
5273 # Args: $1 : SDK version as in "6.0A", "7.0" etc
5274 # Return values: $winsdktest, $winsdklibsubdir
5276 unset winsdktest winsdklibsubdir
5278 # Why we look for them in this particular order I don't know. But OTOH I
5281 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
5282 if test -n "$regvalue"; then
5283 winsdktest=$regvalue
5289 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
5290 if test -n "$regvalue"; then
5291 winsdktest=$regvalue
5292 winsdklibsubdir=winv6.3
5297 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
5298 if test -n "$regvalue"; then
5299 winsdktest=$regvalue
5300 winsdklibsubdir=win8
5305 reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot10"
5306 if test -n "$regvalue"; then
5307 winsdktest=$regvalue
5308 winsdklibsubdir=10.0.10056.0
5317 # Args: $1 (optional) : list of acceptable SDK versions
5318 # Return value: $winsdktest
5322 for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
5323 find_winsdk_version $ver
5324 if test -n "$winsdktest"; then
5332 my_msm_file=Microsoft_VC${VCVER}_CRT_x86.msm
5333 AC_MSG_CHECKING([for $my_msm_file])
5335 for ver in 12.0 14.0; do
5336 reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
5337 if test -n "$regvalue"; then
5338 if test -e "$regvalue/$my_msm_file"; then
5344 dnl Is the following fallback really necessary, or was it added in response
5345 dnl to never having started Visual Studio on a given machine, so the
5346 dnl registry keys checked above had presumably not yet been created?
5347 dnl Anyway, if it really is necessary, it might be worthwhile to extend it
5348 dnl to also check %CommonProgramFiles(X86)% (typically expanding to
5349 dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
5350 dnl expanding to "C:\Program Files\Common Files"), which would need
5351 dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
5352 dnl obtain its value from cygwin:
5353 if test -z "$msmdir"; then
5354 my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
5355 if test -e "$my_msm_dir/$my_msm_file"; then
5359 if test -n "$msmdir"; then
5360 msmdir=`cygpath -m "$msmdir"`
5361 AC_MSG_RESULT([$msmdir])
5363 if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
5364 AC_MSG_ERROR([not found])
5366 AC_MSG_WARN([not found])
5371 find_msvc_x64_dlls()
5373 msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
5374 # http://blogs.msdn.com/b/vcblog/archive/2014/06/03/visual-studio-14-ctp.aspx
5375 # Refactored C Runtime (CRT): This CTP contains the first preview of the substantially refactored CRT.
5376 # msvcr140.dll no longer exists. It is replaced by a trio of DLLs: vcruntime140.dll, appcrt140.dll,
5377 # and desktopcrt140.dll.
5378 if test "$VCVER" = 140; then
5379 msvcdlls="msvcp${VCVER}.dll vcruntime${VCVER}.dll"
5381 msvcdlls="msvcp${VCVER}.dll msvcr${VCVER}.dll"
5383 for dll in $msvcdlls; do
5384 if ! test -f "$msvcdllpath/$dll"; then
5385 AC_MSG_ERROR([can not find $dll in $msvcdllpath])
5390 if test "$build_os" = "cygwin"; then
5392 AC_MSG_CHECKING([for midl.exe])
5395 if test -f "$winsdktest/Bin/midl.exe"; then
5396 MIDL_PATH="$winsdktest/Bin"
5397 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
5398 MIDL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5400 if test ! -f "$MIDL_PATH/midl.exe"; then
5401 AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
5403 AC_MSG_RESULT([$MIDL_PATH/midl.exe])
5406 # Convert to posix path with 8.3 filename restrictions ( No spaces )
5407 MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
5410 AC_MSG_CHECKING([for csc.exe])
5412 if test -f "$csctest/csc.exe"; then
5415 if test ! -f "$CSC_PATH/csc.exe"; then
5416 AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
5418 AC_MSG_RESULT([$CSC_PATH/csc.exe])
5421 CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
5424 AC_MSG_CHECKING([for al.exe])
5426 if test -f "$winsdktest/Bin/al.exe"; then
5427 AL_PATH="$winsdktest/Bin"
5428 elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
5429 AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
5432 if test -z "$AL_PATH"; then
5434 if test -f "$altest/bin/al.exe"; then
5435 AL_PATH="$altest/bin"
5436 elif test -f "$altest/al.exe"; then
5440 if test ! -f "$AL_PATH/al.exe"; then
5441 AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
5443 AC_MSG_RESULT([$AL_PATH/al.exe])
5446 AL_PATH=`win_short_path_for_make "$AL_PATH"`
5448 dnl Check mscoree.lib / .NET Framework dir
5449 AC_MSG_CHECKING(.NET Framework find_dotnetsdk)
5451 if test -f "$frametest/lib/mscoree.lib"; then
5452 DOTNET_FRAMEWORK_HOME="$frametest"
5454 AC_MSG_CHECKING(.NET Framework find_winsdk)
5456 if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5457 DOTNET_FRAMEWORK_HOME="$winsdktest"
5459 AC_MSG_CHECKING(.NET Framework find_dotnetsdk46)
5461 PathFormat "$frametest"
5462 frametest="$formatted_path"
5463 AC_MSG_CHECKING(found: $frametest/um/$WINDOWS_SDK_ARCH/mscoree.lib)
5464 if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5465 DOTNET_FRAMEWORK_HOME="$frametest"
5470 if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
5471 AC_MSG_ERROR([mscoree.lib not found])
5473 AC_MSG_RESULT(found)
5475 PathFormat "$MIDL_PATH"
5476 MIDL_PATH="$formatted_path"
5478 PathFormat "$AL_PATH"
5479 AL_PATH="$formatted_path"
5481 PathFormat "$DOTNET_FRAMEWORK_HOME"
5482 DOTNET_FRAMEWORK_HOME="$formatted_path"
5484 PathFormat "$CSC_PATH"
5485 CSC_PATH="$formatted_path"
5488 dnl ===================================================================
5489 dnl Check if stdc headers are available excluding MSVC.
5490 dnl ===================================================================
5491 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5495 dnl ===================================================================
5496 dnl Testing for C++ compiler and version...
5497 dnl ===================================================================
5499 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5500 # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5501 save_CXXFLAGS=$CXXFLAGS
5503 CXXFLAGS=$save_CXXFLAGS
5505 if test -n "$CC" -a -z "$CXX"; then
5510 dnl check for GNU C++ compiler version
5511 if test "$GXX" = "yes" -a "$CXX" != "emcc"; then
5512 AC_MSG_CHECKING([the GNU C++ compiler version])
5514 _gpp_version=`$CXX -dumpversion`
5515 _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5517 if test "$_gpp_majmin" -lt "401"; then
5518 AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
5520 AC_MSG_RESULT([checked (g++ $_gpp_version)])
5523 dnl see https://code.google.com/p/android/issues/detail?id=41770
5524 if test "$_gpp_majmin" -ge "401"; then
5528 AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
5529 AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
5530 #include <bits/c++config.h>]],[[
5531 #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
5532 && !defined(_GLIBCXX__PTHREADS) \
5533 && !defined(_GLIBCXX_HAS_GTHREADS)
5536 ]])],[AC_MSG_RESULT([yes])
5537 glibcxx_threads=yes],[AC_MSG_RESULT([no])])
5539 if test $glibcxx_threads = yes; then
5540 BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
5544 AC_SUBST(BOOST_CXXFLAGS)
5547 # prefx CXX with ccache if needed
5549 if test "$CCACHE" != ""; then
5550 AC_MSG_CHECKING([whether $CXX is already ccached])
5552 save_CXXFLAGS=$CXXFLAGS
5553 CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5554 dnl an empty program will do, we're checking the compiler flags
5555 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5556 [use_ccache=yes], [use_ccache=no])
5557 if test $use_ccache = yes; then
5558 AC_MSG_RESULT([yes])
5563 CXXFLAGS=$save_CXXFLAGS
5567 dnl ===================================================================
5568 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5569 dnl ===================================================================
5571 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5574 dnl Check whether there's a C pre-processor.
5579 dnl ===================================================================
5580 dnl Find integral type sizes and alignments
5581 dnl ===================================================================
5583 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5585 AC_CHECK_SIZEOF(long)
5586 AC_CHECK_SIZEOF(short)
5587 AC_CHECK_SIZEOF(int)
5588 AC_CHECK_SIZEOF(long long)
5589 AC_CHECK_SIZEOF(double)
5590 AC_CHECK_SIZEOF(void*)
5592 SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
5593 SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
5594 SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
5595 SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
5596 SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
5598 dnl Allow build without AC_CHECK_ALIGNOF, grrr
5599 m4_pattern_allow([AC_CHECK_ALIGNOF])
5600 m4_ifdef([AC_CHECK_ALIGNOF],
5602 AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5603 AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5604 AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5605 AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5608 case "$_os-$host_cpu" in
5610 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5611 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5612 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5613 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5616 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5617 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5618 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5619 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5622 if test -z "$ac_cv_alignof_short" -o \
5623 -z "$ac_cv_alignof_int" -o \
5624 -z "$ac_cv_alignof_long" -o \
5625 -z "$ac_cv_alignof_double"; then
5626 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.])
5632 SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
5633 SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
5634 if test $ac_cv_sizeof_long -eq 8; then
5635 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
5636 elif test $ac_cv_sizeof_double -eq 8; then
5637 SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
5639 AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
5642 dnl Check for large file support
5644 if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5645 LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5647 if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5648 LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5652 SAL_TYPES_SIZEOFSHORT=2
5653 SAL_TYPES_SIZEOFINT=4
5654 SAL_TYPES_SIZEOFLONG=4
5655 SAL_TYPES_SIZEOFLONGLONG=8
5656 if test "$BITNESS_OVERRIDE" = ""; then
5657 SAL_TYPES_SIZEOFPOINTER=4
5659 SAL_TYPES_SIZEOFPOINTER=8
5661 SAL_TYPES_ALIGNMENT2=2
5662 SAL_TYPES_ALIGNMENT4=4
5663 SAL_TYPES_ALIGNMENT8=8
5666 AC_SUBST(LFS_CFLAGS)
5668 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
5669 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
5670 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
5671 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
5672 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
5673 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
5674 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
5675 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
5677 dnl ===================================================================
5678 dnl Check whether to enable runtime optimizations
5679 dnl ===================================================================
5680 ENABLE_RUNTIME_OPTIMIZATIONS=
5681 AC_MSG_CHECKING([whether to enable runtime optimizations])
5682 if test -z "$enable_runtime_optimizations"; then
5686 enable_runtime_optimizations=no
5692 if test "$enable_runtime_optimizations" != no; then
5693 ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
5694 AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
5695 AC_MSG_RESULT([yes])
5699 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
5701 dnl ===================================================================
5702 dnl Check if valgrind headers are available
5703 dnl ===================================================================
5705 if test "$cross_compiling" != yes; then
5706 prev_cppflags=$CPPFLAGS
5707 # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
5708 # or where does it come from?
5709 CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5710 AC_CHECK_HEADER([valgrind/valgrind.h],
5711 [ENABLE_VALGRIND=TRUE])
5712 CPPFLAGS=$prev_cppflags
5714 AC_SUBST([ENABLE_VALGRIND])
5715 if test -z "$ENABLE_VALGRIND"; then
5718 AC_SUBST([VALGRIND_CFLAGS])
5721 dnl ===================================================================
5722 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
5723 dnl ===================================================================
5725 # We need at least the sys/sdt.h include header.
5726 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
5727 if test "$SDT_H_FOUND" = "TRUE"; then
5728 # Found sys/sdt.h header, now make sure the c++ compiler works.
5729 # Old g++ versions had problems with probes in constructors/destructors.
5730 AC_MSG_CHECKING([working sys/sdt.h and c++ support])
5732 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5733 #include <sys/sdt.h>
5741 ProbeClass(int& v, const char *n) : ref(v), name(n)
5743 DTRACE_PROBE2(_test_, cons, name, ref);
5746 void method(int min)
5748 DTRACE_PROBE3(_test_, meth, name, ref, min);
5754 DTRACE_PROBE2(_test_, dest, name, ref);
5759 DTRACE_PROBE1(_test_, call, i);
5760 ProbeClass inst = ProbeClass(i, "call");
5762 ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
5763 [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
5766 AC_CONFIG_HEADERS([config_host/config_probes.h])
5768 dnl ===================================================================
5769 dnl Set the MinGW sys-root
5770 dnl ===================================================================
5771 if test "$WITH_MINGW" = "yes"; then
5772 AC_MSG_CHECKING([for MinGW sysroot])
5773 sysroot=`$CC -print-sysroot`
5774 AS_IF([test -d "$sysroot"/mingw],
5775 [MINGW_SYSROOT="$sysroot"/mingw
5776 AC_MSG_RESULT([$MINGW_SYSROOT])],
5777 [AC_MSG_RESULT([not found])
5778 AC_MSG_ERROR([cannot determine MinGW sysroot])])
5780 AC_SUBST([MINGW_DLLS])
5781 AC_SUBST([MINGW_SYSROOT])
5783 dnl ===================================================================
5784 dnl Set the MinGW include directories
5785 dnl ===================================================================
5786 if test "$WITH_MINGW" = "yes"; then
5787 AC_MSG_CHECKING([for MinGW include path])
5788 cat >conftest.$ac_ext <<_ACEOF
5790 #include <bits/c++config.h>
5792 _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`
5794 if test -z "$_mingw_lib_include_path"; then
5795 _mingw_lib_include_path="NO_LIB_INCLUDE"
5796 AC_MSG_RESULT([no MinGW include path])
5798 AC_MSG_RESULT([$_mingw_lib_include_path])
5800 MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
5801 AC_SUBST(MINGW_LIB_INCLUDE_PATH)
5805 AC_MSG_CHECKING([for dynamic libgcc])
5806 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5808 using namespace std;
5809 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
5810 MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
5811 if test -n "$MINGW_GCCDLL"; then
5812 MINGW_SHARED_GCCLIB=TRUE
5813 AC_MSG_RESULT([ $MINGW_GCCDLL])
5815 MINGW_SHARED_GCCLIB=
5818 ],[ AC_MSG_RESULT([no])
5822 AC_MSG_CHECKING([for dynamic libstdc++])
5823 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5825 using namespace std;
5826 ]], [[ cout << "Hello there." << endl; ]])],[
5827 MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
5828 if test -n "$MINGW_GXXDLL"; then
5829 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
5830 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
5831 if test "$CROSS_COMPILING" = "TRUE"; then
5833 mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
5835 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
5836 MINGW_SHARED_GXXLIB=TRUE
5837 AC_MSG_RESULT([$MINGW_GXXDLL])
5839 MINGW_SHARED_GXXLIB=
5842 ],[ AC_MSG_RESULT([no])
5848 AC_SUBST(MINGW_SHARED_GCCLIB)
5849 AC_SUBST(MINGW_SHARED_GXXLIB)
5850 AC_SUBST(MINGW_SHARED_LIBSTDCPP)
5851 AC_SUBST(MINGW_GCCDLL)
5852 AC_SUBST(MINGW_GXXDLL)
5855 dnl *************************************************************
5856 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
5857 dnl *************************************************************
5858 if test "$WITH_MINGW" = "yes"; then
5859 AC_MSG_CHECKING([exception type])
5861 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
5863 extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
5865 ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
5867 AC_MSG_RESULT($exceptions_type)
5871 EXCEPTIONS="$exceptions_type"
5872 AC_SUBST(EXCEPTIONS)
5874 dnl ===================================================================
5875 dnl thread-safe statics
5876 dnl ===================================================================
5877 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
5878 unset HAVE_THREADSAFE_STATICS
5879 if test "$GCC" = "yes"; then
5880 dnl -fthreadsafe-statics is available since GCC 4, so always available for
5881 dnl us. However, some C++ runtimes use a single lock for all static
5882 dnl variables, which can cause deadlock in multi-threaded applications.
5883 dnl This is not easily tested here; for POSIX-based systems, if executing
5884 dnl the following C++ program does not terminate then the tool chain
5885 dnl apparently has this problem:
5887 dnl #include <pthread.h>
5888 dnl int h() { return 0; }
5889 dnl void * g(void * unused) {
5890 dnl static int n = h();
5895 dnl pthread_create(&t, 0, g, 0);
5896 dnl pthread_join(t, 0);
5900 dnl static int n = f();
5904 dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
5905 dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
5906 dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
5907 dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
5908 dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
5909 dnl difference there. Conservative advice from Jakub Jelinek is to assume
5910 dnl it working in GCC >= 4.3, so conservative way to check here is to use
5911 dnl GCC_VERSION for GCC but resort to __GLIBCXX__ corresponding to libstdc++
5912 dnl shipped with GCC 4.3.0 (cf. <http://gcc.gnu.org/onlinedocs/libstdc++/
5913 dnl manual/abi.html#abi.versioning.history>; 4.3.0 is 20080306, 4.2.4 is
5914 dnl 20080519, 4.3.1 is 20080606) for Clang (for which GCC_VERSION is notoriously
5916 if test "$_os" = Darwin; then
5917 dnl On Mac OS X, both /usr/lib/libstdc++.6.dylib and
5918 dnl /usr/lib/libc++1.dylib delegate to /usr/lib/libc++abi.dylib for the
5919 dnl __cxa_guard_* functionality; up to 10.8, libc++abi.dylib is
5920 dnl apparently provided by a libcppabi project that has broken semantics
5921 dnl (cf. <http://www.opensource.apple.com/source/libcppabi/libcppabi-26/
5922 dnl src/cxa_guard.cxx>), while in 10.9 (verified at least on 10.9.4) it
5923 dnl is apparently provided by LLVM's libcxxabi project, which has good
5924 dnl semantics (cf. <http://llvm.org/svn/llvm-project/libcxxabi/trunk/
5925 dnl src/cxa_guard.cpp>):
5926 if test "$MAC_OS_X_VERSION_MIN_REQUIRED" -ge 1090; then
5927 HAVE_THREADSAFE_STATICS=TRUE
5929 elif test "$_os" != Android; then
5930 if test "$COM_IS_CLANG" = TRUE; then
5932 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5934 #if !defined __GLIBCXX__ ||(__GLIBCXX__ < 20080606 && __GLIBCXX__ != 20080306)
5937 ]])],[HAVE_THREADSAFE_STATICS=TRUE],[])
5939 else # known to work in GCC since version 4.3
5940 HAVE_THREADSAFE_STATICS=TRUE
5943 if test "$HAVE_THREADSAFE_STATICS" = TRUE; then
5944 AC_DEFINE(HAVE_THREADSAFE_STATICS)
5945 AC_MSG_RESULT([yes])
5947 AC_MSG_RESULT([broken (i.e., no)])
5950 # MSVC has sprouted C++11 thread-safe statics in 2015
5951 # http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
5952 if test "$COM" = "MSC" -a "$VCVER" -ge "140"; then
5953 AC_DEFINE(HAVE_THREADSAFE_STATICS)
5954 AC_MSG_RESULT([yes])
5959 AC_SUBST(HAVE_THREADSAFE_STATICS)
5961 dnl ===================================================================
5962 dnl visibility and other gcc features
5963 dnl ===================================================================
5964 if test "$GCC" = "yes"; then
5965 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
5967 CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
5968 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
5971 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5972 AC_MSG_RESULT([yes])
5977 AC_MSG_CHECKING([whether $CC supports -mno-avx])
5979 CFLAGS="$CFLAGS -Werror -mno-avx"
5980 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5982 if test "$HAVE_GCC_AVX" = "TRUE"; then
5983 AC_MSG_RESULT([yes])
5988 AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong])
5990 CFLAGS="$CFLAGS -Werror -fstack-protector-strong"
5991 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
5993 if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
5994 AC_MSG_RESULT([yes])
5999 AC_MSG_CHECKING([whether $CC supports atomic functions])
6000 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
6002 if (__sync_add_and_fetch(&v, 1) != 1 ||
6003 __sync_sub_and_fetch(&v, 1) != 0)
6005 __sync_synchronize();
6006 if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
6010 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
6011 if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
6012 AC_MSG_RESULT([yes])
6013 AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
6018 AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
6020 CFLAGS="$CFLAGS -Werror"
6021 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6022 __attribute__((deprecated("test"))) void f();
6024 AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
6025 AC_MSG_RESULT([yes])
6026 ], [AC_MSG_RESULT([no])])
6029 AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
6031 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6033 void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
6035 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
6036 AC_MSG_RESULT([yes])
6037 ], [AC_MSG_RESULT([no])])
6040 AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
6042 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6044 void * f() { return __cxxabiv1::__cxa_get_globals(); }
6046 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS],[1])
6047 AC_MSG_RESULT([yes])
6048 ], [AC_MSG_RESULT([no])])
6051 AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
6053 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6055 void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
6057 AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_THROW],[1])
6058 AC_MSG_RESULT([yes])
6059 ], [AC_MSG_RESULT([no])])
6062 AC_MSG_CHECKING([whether STL uses __attribute__((warn_unused))])
6064 save_CXXFLAGS=$CXXFLAGS
6065 CXXFLAGS="$CXXFLAGS -Werror -Wunused"
6066 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6068 void f() { std::string s; }
6072 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED_STL],[1])
6073 AC_MSG_RESULT([yes])])
6074 CXXFLAGS=$save_CXXFLAGS
6078 AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
6080 save_CXXFLAGS=$CXXFLAGS
6081 CXXFLAGS="$CXXFLAGS -Werror -Wunknown-pragmas"
6082 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6083 struct __attribute__((warn_unused)) dummy {};
6085 AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
6086 AC_MSG_RESULT([yes])
6087 ], [AC_MSG_RESULT([no])])
6088 CXXFLAGS=$save_CXXFLAGS
6091 AC_SUBST(HAVE_GCC_AVX)
6092 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
6093 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
6095 dnl ===================================================================
6096 dnl Identify the C++ library
6097 dnl ===================================================================
6099 AC_MSG_CHECKING([What the C++ library is])
6101 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6107 [CPP_LIBRARY=GLIBCXX
6108 cpp_library_name="GNU libstdc++"
6110 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6112 #ifndef _LIBCPP_VERSION
6117 cpp_library_name="LLVM libc++"
6119 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6126 cpp_library_name="Microsoft"
6128 AC_MSG_ERROR([Could not figure out what C++ library this is]))))
6129 AC_MSG_RESULT([$cpp_library_name])
6132 dnl ===================================================================
6134 dnl ===================================================================
6137 if test "$COM" = MSC; then
6138 AC_MSG_CHECKING([whether $CXX supports C++11])
6140 # MSVC supports (a subset of) CXX11 without any switch
6141 elif test "$GCC" = "yes"; then
6143 AC_MSG_CHECKING([whether $CXX supports C++14 or C++11])
6144 for flag in -std=gnu++14 -std=gnu++1y -std=c++14 -std=c++1y -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
6145 save_CXXFLAGS=$CXXFLAGS
6146 CXXFLAGS="$CXXFLAGS $flag -Werror"
6148 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6149 #include <algorithm>
6150 #include <functional>
6152 void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
6153 std::sort(v.begin(), v.end(), fn);
6155 ]])],[CXXFLAGS_CXX11=$flag])
6157 CXXFLAGS=$save_CXXFLAGS
6158 if test -n "$CXXFLAGS_CXX11"; then
6163 if test "$HAVE_CXX11" = TRUE; then
6164 AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
6170 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
6171 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
6172 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
6173 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
6174 dnl again towards 4.7.2:
6175 if test $CPP_LIBRARY = GLIBCXX; then
6176 AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
6178 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6180 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
6181 // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
6182 // GCC 4.7.0: 20120322
6183 // GCC 4.7.1: 20120614
6184 // and using a range check is not possible as the mapping between
6185 // __GLIBCXX__ values and GCC versions is not monotonic
6190 ]])], [AC_MSG_RESULT(no, ok)],
6191 [AC_MSG_ERROR(yes)])
6195 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
6196 save_CXXFLAGS=$CXXFLAGS
6197 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6200 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6203 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
6219 a thinga[]={{0,0}, {1,1}};
6220 b thingb[]={{0,0}, {1,1}};
6221 size_t i = sizeof(sal_n_array_size(thinga));
6222 size_t j = sizeof(sal_n_array_size(thingb));
6223 return !(i != 0 && j != 0);
6225 ], [ AC_MSG_RESULT(yes) ],
6226 [ AC_MSG_ERROR(no)])
6228 CXXFLAGS=$save_CXXFLAGS
6230 AC_MSG_CHECKING([whether $CXX supports C++11 without __float128 compile error])
6231 save_CXXFLAGS=$CXXFLAGS
6232 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6235 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6237 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6240 ],[ AC_MSG_RESULT(yes) ],
6243 # The only reason why libstdc++ headers fail with Clang in C++11 mode is because
6244 # they use the __float128 type that Clang doesn't know (libstdc++ checks whether
6245 # __float128 is available during its build, but it's usually built using GCC,
6246 # and so c++config.h hardcodes __float128 being supported). As the only place
6247 # where __float128 is actually used is in a template specialization,
6248 # -D__float128=void will avoid the problem there while still causing a problem
6249 # if somebody actually uses the type.
6250 AC_MSG_CHECKING([whether -D__float128=void workaround helps])
6251 CXXFLAGS="$CXXFLAGS -D__float128=void"
6252 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6254 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
6260 CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -D__float128=void"
6268 CXXFLAGS=$save_CXXFLAGS
6270 AC_SUBST(CXXFLAGS_CXX11)
6272 AC_MSG_CHECKING([whether $CXX supports C++11 constexpr])
6273 save_CXXFLAGS=$CXXFLAGS
6274 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6276 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6279 constexpr S(int n): n_(n) {}
6281 ]])], [cxx11_constexpr=yes], [cxx11_constexpr=no])
6283 CXXFLAGS=$save_CXXFLAGS
6284 AC_MSG_RESULT([$cxx11_constexpr])
6285 if test "$cxx11_constexpr" = yes; then
6286 AC_DEFINE([HAVE_CXX11_CONSTEXPR])
6289 AC_MSG_CHECKING([whether $CXX supports C++14 constexpr])
6290 save_CXXFLAGS=$CXXFLAGS
6291 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6292 if test "$ENABLE_DEBUG" != TRUE -a "$ENABLE_DBGUTIL" != TRUE \
6293 -a "$ASSERT_ALWAYS_ABORT" != TRUE
6295 CXXFLAGS="$CXXFLAGS -DNDEBUG"
6298 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6299 // A somewhat over-complicated way of checking for
6300 // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "ICE using __func__
6301 // in constexpr function":
6303 template<typename T> inline constexpr T f(T x) { return x; }
6304 template<typename T> inline constexpr T g(T x) {
6305 assert(f(static_cast<int>(x)));
6313 constexpr bool f() {
6316 while (n > 0) { --n; ++i; }
6320 ]])], [cxx14_constexpr=yes], [cxx14_constexpr=no])
6322 CXXFLAGS=$save_CXXFLAGS
6323 AC_MSG_RESULT([$cxx14_constexpr])
6324 if test "$cxx14_constexpr" = yes; then
6325 AC_DEFINE([HAVE_CXX14_CONSTEXPR])
6328 AC_MSG_CHECKING([whether $CXX supports C++11 ref-qualifier])
6329 save_CXXFLAGS=$CXXFLAGS
6330 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6332 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
6337 ]])], [cxx11_ref_qualifier=yes], [cxx11_ref_qualifier=no])
6339 CXXFLAGS=$save_CXXFLAGS
6340 AC_MSG_RESULT([$cxx11_ref_qualifier])
6341 if test "$cxx11_ref_qualifier" = yes; then
6342 AC_DEFINE([HAVE_CXX11_REF_QUALIFIER])
6345 AC_MSG_CHECKING([whether $CXX supports C++14 sized deallocation])
6346 dnl At least Clang -fsanitize=address causes "multiple definition of
6347 dnl `operator delete(void*, unsigned long)'" also defined in
6348 dnl projects/compiler-rt/lib/asan/asan_new_delete.cc:
6350 if test "$COM_IS_CLANG" = TRUE; then
6363 save_CXXFLAGS=$CXXFLAGS
6364 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
6366 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
6369 void operator delete(void *) throw () { std::exit(1); }
6370 void operator delete(void *, std::size_t) throw () { std::exit(0); }
6371 struct S { S() { throw 0; } };
6373 try { new S; } catch (...) {}
6375 ]])], [cxx14_sized_deallocation=yes], [cxx14_sized_deallocation=no], [cxx14_sized_deallocation=no])
6378 CXXFLAGS=$save_CXXFLAGS
6379 AC_MSG_RESULT([$cxx14_sized_deallocation])
6380 if test "$cxx14_sized_deallocation" = yes; then
6381 AC_DEFINE([HAVE_CXX14_SIZED_DEALLOCATION])
6384 HAVE_GCC_PRAGMA_OPERATOR=
6385 dnl _Pragma support (may require C++11)
6386 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
6387 AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
6389 save_CXXFLAGS=$CXXFLAGS
6390 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
6391 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
6392 _Pragma("GCC diagnostic ignored \"-Wformat\"")
6394 AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
6395 HAVE_GCC_PRAGMA_OPERATOR=1
6396 AC_MSG_RESULT([yes])
6397 ], [AC_MSG_RESULT([no])])
6399 CXXFLAGS=$save_CXXFLAGS
6401 AC_SUBST(HAVE_GCC_PRAGMA_OPERATOR)
6403 dnl ===================================================================
6404 dnl system stl sanity tests
6405 dnl ===================================================================
6406 HAVE_GCC_VISIBILITY_BROKEN=
6407 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
6411 save_CPPFLAGS="$CPPFLAGS"
6412 if test -n "$MACOSX_SDK_PATH"; then
6413 CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
6416 # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
6418 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$CPP_LIBRARY" = GLIBCXX; then
6419 dnl gcc#19664, gcc#22482, rhbz#162935
6420 AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
6421 AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
6422 AC_MSG_RESULT([$stlvisok])
6423 if test "$stlvisok" = "no"; then
6424 AC_MSG_WARN([Your libstdc++ headers are not visibility safe. Disabling visibility])
6425 add_warning "Your libstdc++ headers are not visibility safe. Disabling visibility"
6426 unset HAVE_GCC_VISIBILITY_FEATURE
6430 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
6431 sharedlink_ldflags_save=$LDFLAGS
6432 LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
6434 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
6435 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
6437 using namespace std;
6439 istringstream strm( "test" ); return 0;
6441 # Ugh, surely bad to assume an error message will contain
6442 # the word "unresolvable", a problem with
6443 # -fvisibility-inlines-hidden and STL headers might cause
6444 # some more obscure message on some platform, and anway,
6445 # the error message could be localised.
6446 [$EGREP -q unresolvable conftest.err;
6447 if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
6449 AC_MSG_RESULT([$gccvisok])
6450 if test "$gccvisok" = "no"; then
6451 AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
6452 add_warning "Your gcc is not -fvisibility-inlines-hidden safe, disabling that."
6453 HAVE_GCC_VISIBILITY_BROKEN="TRUE"
6456 LDFLAGS=$sharedlink_ldflags_save
6459 # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
6460 # when we don't make any dynamic libraries?
6461 if test "$DISABLE_DYNLOADING" = "" -a "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
6462 AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
6463 cat > conftestlib1.cc <<_ACEOF
6464 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6465 struct S2: S1<int> { virtual ~S2(); };
6468 cat > conftestlib2.cc <<_ACEOF
6469 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
6470 struct S2: S1<int> { virtual ~S2(); };
6471 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
6473 gccvisinlineshiddenok=yes
6474 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
6475 gccvisinlineshiddenok=no
6477 dnl At least Clang -fsanitize=address and -fsanitize=undefined are
6478 dnl known to not work with -z defs (unsetting which makes the test
6480 my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
6481 if test "$COM_IS_CLANG" = TRUE; then
6485 my_linkflagsnoundefs=
6491 if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
6492 gccvisinlineshiddenok=no
6497 AC_MSG_RESULT([$gccvisinlineshiddenok])
6498 if test "$gccvisinlineshiddenok" = "no"; then
6499 AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
6500 add_warning "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that."
6501 HAVE_GCC_VISIBILITY_BROKEN="TRUE"
6505 if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
6506 AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
6507 cat >visibility.cxx <<_ACEOF
6508 #pragma GCC visibility push(hidden)
6509 struct __attribute__ ((visibility ("default"))) TestStruct {
6512 __attribute__ ((visibility ("default"))) void TestFunc() {
6516 if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
6521 if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
6524 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
6536 rm -f visibility.s visibility.cxx
6538 AC_MSG_RESULT([$gccvisbroken])
6539 if test "$gccvisbroken" = "yes"; then
6540 AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
6541 add_warning "Your gcc is not -fvisibility=hidden safe. Disabling visibility"
6542 unset HAVE_GCC_VISIBILITY_FEATURE
6546 CPPFLAGS="$save_CPPFLAGS"
6551 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
6552 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
6554 dnl ===================================================================
6556 dnl ===================================================================
6558 HAVE_GCC_FNO_DEFAULT_INLINE=
6559 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
6560 if test "$GCC" = "yes"; then
6561 AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
6562 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6563 # Option just ignored and silly warning that isn't a real
6568 save_CXXFLAGS=$CXXFLAGS
6569 CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
6570 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
6571 CXXFLAGS=$save_CXXFLAGS
6574 if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
6575 AC_MSG_RESULT([yes])
6580 AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
6581 if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
6586 save_CXXFLAGS=$CXXFLAGS
6587 CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
6588 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
6589 CXXFLAGS=$save_CXXFLAGS
6592 if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
6593 AC_MSG_RESULT([yes])
6598 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
6599 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
6601 dnl ===================================================================
6602 dnl Compiler plugins
6603 dnl ===================================================================
6606 # currently only Clang
6607 if test "$COM_IS_CLANG" = "TRUE"; then
6608 if test -n "$enable_compiler_plugins"; then
6609 compiler_plugins="$enable_compiler_plugins"
6610 elif test -n "$ENABLE_DBGUTIL"; then
6611 compiler_plugins=test
6615 if test "$compiler_plugins" != "no"; then
6616 dnl The prefix where Clang resides, override to where Clang resides if
6617 dnl using a source build:
6618 if test -z "$CLANGDIR"; then
6622 save_CPPFLAGS=$CPPFLAGS
6624 # compiler plugins must be built with "native" bitness of clang
6625 # because they link against clang libraries
6626 CXX=`echo $CXX | sed -e s/-m64// -e s/-m32//`
6627 CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11 -I$CLANGDIR/include -I$CLANGDIR/tools/clang/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
6628 AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
6629 [COMPILER_PLUGINS=TRUE],
6631 if test "$compiler_plugins" = "yes"; then
6632 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
6634 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
6635 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
6639 CPPFLAGS=$save_CPPFLAGS
6643 if test "$enable_compiler_plugins" = "yes"; then
6644 AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
6647 AC_SUBST(COMPILER_PLUGINS)
6650 # Plugin to help linker.
6651 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
6652 # This makes --enable-lto build with clang work.
6655 dnl ===================================================================
6657 dnl ===================================================================
6658 AC_MSG_CHECKING([which memory allocator to use])
6659 if test "$with_alloc" = "system"; then
6660 AC_MSG_RESULT([system])
6663 if test "$with_alloc" = "tcmalloc"; then
6664 AC_MSG_RESULT(tcmalloc)
6665 if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
6666 AC_MSG_ERROR([tcmalloc only available/usable on ix86])
6668 AC_CHECK_LIB([tcmalloc], [malloc], [:],
6669 [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
6672 if test "$with_alloc" = "jemalloc"; then
6673 if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
6674 AC_MSG_RESULT(jemalloc)
6676 CFLAGS="$CFLAGS -pthread"
6677 AC_CHECK_LIB([jemalloc], [malloc], [:],
6678 [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
6682 AC_MSG_RESULT([system])
6686 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
6687 AC_MSG_RESULT([internal])
6689 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
6690 AC_SUBST(HAVE_POSIX_FALLOCATE)
6693 dnl ===================================================================
6694 dnl Custom build version
6695 dnl ===================================================================
6697 AC_MSG_CHECKING([whether to add custom build version])
6698 if test "$with_build_version" != ""; then
6699 BUILD_VER_STRING=$with_build_version
6700 AC_MSG_RESULT([yes, $BUILD_VER_STRING])
6705 AC_SUBST(BUILD_VER_STRING)
6707 JITC_PROCESSOR_TYPE=""
6708 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
6709 # IBMs JDK needs this...
6710 JITC_PROCESSOR_TYPE=6
6711 export JITC_PROCESSOR_TYPE
6713 AC_SUBST([JITC_PROCESSOR_TYPE])
6715 # Misc Windows Stuff
6716 if test $_os = "WINNT" -a "$WITH_MINGW" != yes; then
6719 MSVC_DLL_PATH="$msvcdllpath"
6720 MSVC_DLLS="$msvcdlls"
6722 SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
6725 AC_SUBST(MSVC_DLL_PATH)
6729 dnl ===================================================================
6731 dnl ===================================================================
6732 if test "$ENABLE_JAVA" != ""; then
6734 # Windows-specific tests
6735 if test "$build_os" = "cygwin"; then
6736 if test "$BITNESS_OVERRIDE" = 64; then
6742 if test -z "$with_jdk_home"; then
6743 for ver in 1.8 1.7 1.6; do
6744 reg_get_value_$bitness "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
6745 if test -n "$regvalue"; then
6750 if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
6751 with_jdk_home="$_jdk_home"
6752 howfound="found automatically"
6754 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
6757 test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
6758 howfound="you passed"
6762 # MacOS X: /usr/libexec/java_home helps to set the current JDK_HOME. Actually JDK_HOME should NOT be set where java (/usr/bin/java) is located.
6763 # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
6764 if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
6765 with_jdk_home=`/usr/libexec/java_home`
6768 JAVA_HOME=; export JAVA_HOME
6769 if test -z "$with_jdk_home"; then
6770 AC_PATH_PROG(JAVAINTERPRETER, $with_java)
6772 _java_path="$with_jdk_home/bin/$with_java"
6773 dnl Check if there is a Java interpreter at all.
6774 if test -x "$_java_path"; then
6775 JAVAINTERPRETER=$_java_path
6777 AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
6781 dnl Check that the JDK found is correct architecture (at least 2 reasons to
6782 dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
6783 dnl loaded by java to run JunitTests:
6784 if test "$build_os" = "cygwin"; then
6785 shortjdkhome=`cygpath -d "$with_jdk_home"`
6786 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
6787 AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
6788 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6789 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
6790 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6791 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6794 if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6795 JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6797 JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
6798 elif test "$cross_compiling" != "yes"; then
6800 AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
6801 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
6802 AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
6803 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
6806 *) # assumption: everything else 32-bit
6807 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
6808 AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
6809 AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
6818 dnl ===================================================================
6820 dnl ===================================================================
6822 # Note that JAVA_HOME as for now always means the *build* platform's
6823 # JAVA_HOME. Whether all the complexity here actually is needed any
6824 # more or not, no idea.
6826 if test "$ENABLE_JAVA" != ""; then
6828 AC_MSG_CHECKING([the installed JDK])
6829 if test -n "$JAVAINTERPRETER"; then
6830 dnl java -version sends output to stderr!
6831 if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6832 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6833 elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6835 AC_MSG_RESULT([checked (gcj)])
6836 _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
6837 _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6839 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6840 AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6841 elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6844 dnl IBM JDK specific tests
6845 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6846 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6848 if test "$_jdk_ver" -lt 10500; then
6849 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
6851 if test "$_jdk_ver" -ge 10600; then
6855 AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6857 if test "$with_jdk_home" = ""; then
6858 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6859 you must use the "--with-jdk-home" configure option explicitly])
6862 JAVA_HOME=$with_jdk_home
6866 dnl Sun JDK specific tests
6867 _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6868 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6870 if test "$_jdk_ver" -lt 10500; then
6871 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
6873 if test "$_jdk_ver" -gt 10600; then
6874 JAVA_CLASSPATH_NOT_SET="1"
6876 if test "$_jdk_ver" -ge 10600; then
6879 if test "$_jdk_ver" -ge 10900; then
6883 AC_MSG_RESULT([checked (JDK $_jdk)])
6884 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6885 if test "$_os" = "WINNT"; then
6886 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6889 # set to limit VM usage for JunitTests
6891 # set to limit VM usage for javac
6892 JAVAFLAGS=-J-Xmx128M
6895 AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
6899 JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
6901 AC_SUBST([HAVE_JAVA6])
6902 AC_SUBST([HAVE_JAVA9])
6904 dnl ===================================================================
6905 dnl Set target Java bytecode version
6906 dnl ===================================================================
6907 if test "$ENABLE_JAVA" != ""; then
6908 if test "$HAVE_JAVA9" = "TRUE"; then
6909 _java_target_ver="1.6"
6911 _java_target_ver="1.5"
6913 JAVA_SOURCE_VER="$_java_target_ver"
6914 JAVA_TARGET_VER="$_java_target_ver"
6917 dnl ===================================================================
6918 dnl Checks for javac
6919 dnl ===================================================================
6920 if test "$ENABLE_JAVA" != ""; then
6921 if test "$JDK" = "gcj"; then
6922 javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
6924 javacompiler="javac"
6926 if test -z "$with_jdk_home"; then
6927 AC_PATH_PROG(JAVACOMPILER, $javacompiler)
6929 _javac_path="$with_jdk_home/bin/$javacompiler"
6930 dnl Check if there is a Java compiler at all.
6931 if test -x "$_javac_path"; then
6932 JAVACOMPILER=$_javac_path
6935 if test -z "$JAVACOMPILER"; then
6936 AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
6938 if test "$build_os" = "cygwin"; then
6939 if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
6940 JAVACOMPILER="${JAVACOMPILER}.exe"
6942 JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
6945 if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
6946 AC_MSG_CHECKING([re-checking JDK])
6948 AC_MSG_RESULT([checked (ecj)])
6949 _gij_longver="40200"
6954 dnl ===================================================================
6955 dnl Checks that javac is gcj
6956 dnl ===================================================================
6957 if test "$ENABLE_JAVA" != ""; then
6958 if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
6962 AC_SUBST(JAVACISGCJ)
6964 dnl ===================================================================
6965 dnl Checks for javadoc
6966 dnl ===================================================================
6967 if test "$ENABLE_JAVA" != ""; then
6968 if test -z "$with_jdk_home"; then
6969 AC_PATH_PROG(JAVADOC, javadoc)
6971 _javadoc_path="$with_jdk_home/bin/javadoc"
6972 dnl Check if there is a javadoc at all.
6973 if test -x "$_javadoc_path"; then
6974 JAVADOC=$_javadoc_path
6976 AC_PATH_PROG(JAVADOC, javadoc)
6979 if test -z "$JAVADOC"; then
6980 AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
6982 if test "$build_os" = "cygwin"; then
6983 if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
6984 JAVADOC="${JAVADOC}.exe"
6986 JAVADOC=`win_short_path_for_make "$JAVADOC"`
6989 if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
6990 JAVADOCISGJDOC="yes"
6993 AC_SUBST(JAVADOCISGJDOC)
6995 if test "$ENABLE_JAVA" != ""; then
6996 # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
6997 if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
6998 if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
6999 # try to recover first by looking whether we have a alternatives
7000 # system as in Debian or newer SuSEs where following /usr/bin/javac
7001 # over /etc/alternatives/javac leads to the right bindir where we
7002 # just need to strip a bit away to get a valid JAVA_HOME
7003 JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
7004 elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
7005 # maybe only one level of symlink (e.g. on Mac)
7006 JAVA_HOME=$(readlink $JAVACOMPILER)
7007 if test "$(dirname $JAVA_HOME)" = "."; then
7008 # we've got no path to trim back
7013 AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
7014 AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
7015 add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
7016 add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
7018 dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
7019 if test "$JAVA_HOME" != "/usr"; then
7020 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7021 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
7022 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
7023 dnl Tiger already returns a JDK path..
7024 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
7026 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
7030 # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
7032 dnl now if JAVA_HOME has been set to empty, then call findhome to find it
7033 if test -z "$JAVA_HOME"; then
7034 if test "x$with_jdk_home" = "x"; then
7035 cat > findhome.java <<_ACEOF
7036 [import java.io.File;
7040 public static void main(String args[])
7042 String jrelocation = System.getProperty("java.home");
7043 File jre = new File(jrelocation);
7044 System.out.println(jre.getParent());
7048 AC_MSG_CHECKING([if javac works])
7049 javac_cmd="$JAVACOMPILER findhome.java 1>&2"
7050 AC_TRY_EVAL(javac_cmd)
7051 if test $? = 0 -a -f ./findhome.class; then
7052 AC_MSG_RESULT([javac works])
7054 echo "configure: javac test failed" >&5
7055 cat findhome.java >&5
7056 AC_MSG_ERROR([javac does not work - java projects will not build!])
7058 AC_MSG_CHECKING([if gij knows its java.home])
7059 JAVA_HOME=`$JAVAINTERPRETER findhome`
7060 if test $? = 0 -a "$JAVA_HOME" != ""; then
7061 AC_MSG_RESULT([$JAVA_HOME])
7063 echo "configure: java test failed" >&5
7064 cat findhome.java >&5
7065 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
7067 # clean-up after ourselves
7068 rm -f ./findhome.java ./findhome.class
7070 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
7074 dnl second sanity check JAVA_HOME if possible
7075 if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
7076 # now check if $JAVA_HOME is really valid
7077 if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
7078 if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
7081 elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
7084 if test "$JAVA_HOME_OK" = "NO"; then
7085 AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
7086 AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
7087 AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
7088 add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
7089 add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
7090 add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
7093 PathFormat "$JAVA_HOME"
7094 JAVA_HOME="$formatted_path"
7097 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
7100 AC_MSG_CHECKING([for JAWT lib])
7101 if test "$_os" = WINNT; then
7102 if test "$WITH_MINGW" = yes; then
7103 # The path is taken care of in gb_LinkTarget__use_jawt
7104 # in RepositoryExternal.mk:
7107 # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
7128 AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
7129 JAVA_ARCH=$my_java_arch
7135 my_java_arch=$host_cpu
7138 JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
7139 AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
7141 AC_MSG_RESULT([$JAWTLIB])
7145 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
7149 JAVAINC="-I$JAVA_HOME/include"
7150 JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
7151 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7155 JAVAINC="-I$JAVA_HOME/include/win32"
7156 JAVAINC="$JAVAINC -I$JAVA_HOME/include"
7160 if test -d "$JAVA_HOME/include/darwin"; then
7161 JAVAINC="-I$JAVA_HOME/include -I$JAVA_HOME/include/darwin"
7163 JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
7168 JAVAINC="-I$JAVA_HOME/include"
7169 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7173 JAVAINC="-I$JAVA_HOME/include"
7174 JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
7175 JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
7176 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7177 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7181 JAVAINC="-I$JAVA_HOME/include"
7182 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7183 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7187 JAVAINC="-I$JAVA_HOME/include"
7188 JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
7189 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7193 JAVAINC="-I$JAVA_HOME/include"
7197 JAVAINC="-I$JAVA_HOME/include"
7198 JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
7199 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7203 JAVAINC="-I$JAVA_HOME/include"
7204 JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
7205 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7209 JAVAINC="-I$JAVA_HOME/include"
7210 JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
7211 test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
7215 SOLARINC="$SOLARINC $JAVAINC"
7217 AC_SUBST(JAVACOMPILER)
7219 AC_SUBST(JAVAINTERPRETER)
7220 AC_SUBST(JAVAIFLAGS)
7222 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
7224 AC_SUBST(JAVA_SOURCE_VER)
7225 AC_SUBST(JAVA_TARGET_VER)
7228 AC_MSG_CHECKING([which C preprocessor to use in idlc])
7229 if test -n "$with_idlc_cpp"; then
7230 AC_MSG_RESULT([$with_idlc_cpp])
7231 AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
7233 AC_MSG_RESULT([ucpp])
7234 AC_MSG_CHECKING([which ucpp tp use])
7235 if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
7236 AC_MSG_RESULT([external])
7237 AC_PATH_PROG(SYSTEM_UCPP, ucpp)
7239 AC_MSG_RESULT([internal])
7240 BUILD_TYPE="$BUILD_TYPE UCPP"
7243 AC_SUBST(SYSTEM_UCPP)
7245 dnl ===================================================================
7246 dnl Check for epm (not needed for Windows)
7247 dnl ===================================================================
7248 AC_MSG_CHECKING([whether to enable EPM for packing])
7249 if test "$enable_epm" = "yes"; then
7250 AC_MSG_RESULT([yes])
7251 if test "$_os" != "WINNT"; then
7252 if test $_os = Darwin; then
7254 elif test -n "$with_epm"; then
7257 AC_PATH_PROG(EPM, epm, no)
7259 if test "$EPM" = "no" -o "$EPM" = "internal"; then
7260 AC_MSG_NOTICE([EPM will be built.])
7261 BUILD_TYPE="$BUILD_TYPE EPM"
7262 EPM=${WORKDIR}/UnpackedTarball/epm/epm
7264 # Gentoo has some epm which is something different...
7265 AC_MSG_CHECKING([whether the found epm is the right epm])
7266 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
7267 AC_MSG_RESULT([yes])
7269 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7271 AC_MSG_CHECKING([epm version])
7272 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
7273 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
7274 test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
7275 AC_MSG_RESULT([OK, >= 3.7])
7277 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
7278 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
7283 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
7284 AC_MSG_CHECKING([for rpm])
7285 for a in "$RPM" rpmbuild rpm; do
7286 $a --usage >/dev/null 2> /dev/null
7287 if test $? -eq 0; then
7291 $a --version >/dev/null 2> /dev/null
7292 if test $? -eq 0; then
7298 if test -z "$RPM"; then
7299 AC_MSG_ERROR([not found])
7300 elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
7301 RPM_PATH=`which $RPM`
7302 AC_MSG_RESULT([$RPM_PATH])
7303 SCPDEFS="$SCPDEFS -DWITH_RPM"
7305 AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
7308 if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
7309 AC_PATH_PROG(DPKG, dpkg, no)
7310 if test "$DPKG" = "no"; then
7311 AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
7314 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
7315 echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7316 if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
7317 if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
7318 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
7319 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
7320 AC_MSG_RESULT([yes])
7323 if echo "$PKGFORMAT" | $GREP -q rpm; then
7325 AC_MSG_WARN([the rpms will need to be installed with --nodeps])
7326 add_warning "the rpms will need to be installed with --nodeps"
7330 AC_MSG_WARN([the ${_pt}s will not be relocateable])
7331 add_warning "the ${_pt}s will not be relocateable"
7332 AC_MSG_WARN([if you want to make sure installation without --nodeps and
7333 relocation will work, you need to patch your epm with the
7334 patch in epm/epm-3.7.patch or build with
7335 --with-epm=internal which will build a suitable epm])
7340 if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
7341 AC_PATH_PROG(PKGMK, pkgmk, no)
7342 if test "$PKGMK" = "no"; then
7343 AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
7350 for i in $PKGFORMAT; do
7352 aix | bsd | deb | pkg | rpm | native | portable)
7354 [--with-package-format='$PKGFORMAT' requires --enable-epm])
7363 dnl ===================================================================
7364 dnl We need winegcc when building MinGW build to be able to cross-build msi tools
7365 dnl ===================================================================
7367 if test "$enable_winegcc" = "yes"; then
7368 AC_PATH_PROG(WINEGCC, winegcc)
7369 if test "$WINEGCC" = ""; then
7370 AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
7373 ac_exeext_save="$ac_exeext"
7376 AC_LINK_IFELSE([AC_LANG_PROGRAM([
7379 printf ("hello world\n");
7381 [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
7384 ac_exeext="$ac_exeext_save"
7388 if test $_os = iOS; then
7389 enable_mpl_subset=yes
7390 enable_lotuswordpro=no
7393 enable_postgresql_sdbc=no
7394 enable_extension_integration=no
7395 enable_report_builder=no
7401 if test "$enable_lotuswordpro" = "yes"; then
7403 SCPDEFS="$SCPDEFS -DDISABLE_LWP"
7405 AC_SUBST(ENABLE_LWP)
7407 dnl ===================================================================
7409 dnl ===================================================================
7410 AC_PATH_PROG(GPERF, gperf)
7411 if test -z "$GPERF"; then
7412 AC_MSG_ERROR([gperf not found but needed. Install it.])
7414 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
7415 GPERF=`cygpath -m $GPERF`
7417 AC_MSG_CHECKING([gperf version])
7418 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
7421 AC_MSG_ERROR([too old, you need at least 3.0.0])
7425 dnl ===================================================================
7426 dnl Check for building ODK
7427 dnl ===================================================================
7428 if test "$enable_odk" = no; then
7431 if test "$with_doxygen" = no; then
7432 AC_MSG_CHECKING([for doxygen])
7436 if test "$with_doxygen" = yes; then
7437 AC_PATH_PROG([DOXYGEN], [doxygen])
7438 if test -z "$DOXYGEN"; then
7439 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
7442 AC_MSG_CHECKING([for doxygen])
7443 DOXYGEN=$with_doxygen
7444 AC_MSG_RESULT([$DOXYGEN])
7446 if test -n "$DOXYGEN"; then
7447 DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
7448 DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
7449 if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
7450 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
7457 AC_MSG_CHECKING([whether to build the ODK])
7458 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
7459 AC_MSG_RESULT([yes])
7461 if test "$with_java" != "no"; then
7462 AC_MSG_CHECKING([whether to build unowinreg.dll])
7463 if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
7464 # build on Win by default
7465 enable_build_unowinreg=yes
7467 if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
7471 AC_MSG_RESULT([yes])
7472 BUILD_UNOWINREG=TRUE
7474 if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
7475 if test -z "$with_mingw_cross_compiler"; then
7477 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
7478 elif test -x "$with_mingw_cross_compiler"; then
7479 MINGWCXX="$with_mingw_cross_compiler"
7481 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
7484 if test "$MINGWCXX" = "false"; then
7485 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
7488 mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
7489 if test -x "$mingwstrip_test"; then
7490 MINGWSTRIP="$mingwstrip_test"
7492 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
7495 if test "$MINGWSTRIP" = "false"; then
7496 AC_MSG_ERROR(MinGW32 binutils not found.)
7500 BUILD_TYPE="$BUILD_TYPE ODK"
7505 AC_SUBST(BUILD_UNOWINREG)
7507 AC_SUBST(MINGWSTRIP)
7509 dnl ===================================================================
7510 dnl Check for system zlib
7511 dnl ===================================================================
7512 if test "$with_system_zlib" = "auto"; then
7515 with_system_zlib="$with_system_libs"
7518 with_system_zlib=yes
7523 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
7524 dnl and has no pkg-config for it at least on some tinderboxes,
7525 dnl so leaving that out for now
7526 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
7527 AC_MSG_CHECKING([which zlib to use])
7528 if test "$with_system_zlib" = "yes"; then
7529 AC_MSG_RESULT([external])
7531 if test "$_os" != "Emscripten"; then
7532 # Emscripten provides its own zlib, don't check for that
7533 AC_CHECK_HEADER(zlib.h, [],
7534 [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
7535 AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
7536 [AC_MSG_ERROR(zlib not found or functional)], [])
7539 AC_MSG_RESULT([internal])
7541 BUILD_TYPE="$BUILD_TYPE ZLIB"
7542 ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
7543 ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
7545 AC_SUBST(ZLIB_CFLAGS)
7547 AC_SUBST(SYSTEM_ZLIB)
7549 dnl ===================================================================
7550 dnl Check for system jpeg
7551 dnl ===================================================================
7552 AC_MSG_CHECKING([which libjpeg to use])
7553 if test "$with_jpeg_turbo" = "auto"; then
7554 # TODO use jpeg-turbo on Darwin too
7565 if test "$with_system_jpeg" = "yes"; then
7566 AC_MSG_RESULT([external])
7568 AC_CHECK_HEADER(jpeglib.h, [],
7569 [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
7570 AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
7571 [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
7572 libo_MINGW_CHECK_DLL([libjpeg])
7575 if test "$with_jpeg_turbo" = "yes"; then
7576 AC_MSG_RESULT([internal, jpeg-turbo])
7577 BUILD_TYPE="$BUILD_TYPE JPEG_TURBO"
7578 AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
7580 if test -z "$NASM" -a "$build_os" = "cygwin"; then
7581 if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
7582 NASM="$LODE_HOME/opt/bin/nasm"
7583 elif test -x "/opt/lo/bin/nasm"; then
7584 NASM="/opt/lo/bin/nasm"
7587 if test -z "$NASM"; then
7589 ****************************************************************************
7590 You need nasm (Netwide Assembler) to build internal jpeg library.
7591 To get one please do:
7594 if test "$build_os" = "cygwin"; then
7596 install a pre-compiled binary for Win32
7598 mkdir -p /opt/lo/bin
7600 wget http://dev-www.libreoffice.org/bin/cygwin/nasm.exe
7605 consult http://svn.code.sf.net/p/libjpeg-turbo/code/trunk/BUILDING.txt
7610 or get and install one from http://www.nasm.us/
7612 Then re-run autogen.sh
7614 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
7615 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
7618 AC_MSG_ERROR([no nasm (Netwide Assembler) found])
7621 AC_MSG_RESULT([internal, jpeg])
7622 BUILD_TYPE="$BUILD_TYPE JPEG"
7626 AC_SUBST(SYSTEM_JPEG)
7628 dnl ===================================================================
7629 dnl Check for system clucene
7630 dnl ===================================================================
7631 dnl we should rather be using
7632 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
7633 dnl but the contribs-lib check seems tricky
7634 AC_MSG_CHECKING([which clucene to use])
7635 if test "$with_system_clucene" = "yes"; then
7636 AC_MSG_RESULT([external])
7638 PKG_CHECK_MODULES(CLUCENE, libclucene-core)
7639 CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
7640 FilterLibs "${CLUCENE_LIBS}"
7641 CLUCENE_LIBS="${filteredlibs}"
7643 save_CXXFLAGS=$CXXFLAGS
7644 save_CPPFLAGS=$CPPFLAGS
7645 CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
7646 CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
7647 dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
7648 dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
7649 AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
7650 [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
7651 CXXFLAGS=$save_CXXFLAGS
7652 CPPFLAGS=$save_CPPFLAGS
7655 CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
7657 AC_MSG_RESULT([internal])
7659 BUILD_TYPE="$BUILD_TYPE CLUCENE"
7661 AC_SUBST(SYSTEM_CLUCENE)
7662 AC_SUBST(CLUCENE_CFLAGS)
7663 AC_SUBST(CLUCENE_LIBS)
7665 dnl ===================================================================
7666 dnl Check for system expat
7667 dnl ===================================================================
7668 dnl we should use libo_CHECK_SYSTEM_MODULE, but e.g. the mingw tinderbox has no
7669 dnl proper pkg-config for it. It should really be fixed on the tinderbox though.
7670 AC_MSG_CHECKING([which expat to use])
7671 if test "$with_system_expat" = "yes"; then
7672 AC_MSG_RESULT([external])
7674 AC_CHECK_HEADER(expat.h, [],
7675 [AC_MSG_ERROR(expat.h not found. install expat)], [])
7676 AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
7677 [AC_MSG_RESULT(expat library not found or functional.)], [])
7678 libo_MINGW_CHECK_DLL([libexpat])
7680 AC_MSG_RESULT([internal])
7682 BUILD_TYPE="$BUILD_TYPE EXPAT"
7684 AC_SUBST(SYSTEM_EXPAT)
7686 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
7687 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
7689 AC_DEFINE([ENABLE_EOT])
7690 AC_MSG_RESULT([yes])
7692 libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
7697 AC_SUBST([ENABLE_EOT])
7699 dnl ===================================================================
7700 dnl Check for system librevenge
7701 dnl ===================================================================
7702 AS_IF([test "$COM" = "MSC"],
7703 [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
7704 [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
7706 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
7708 dnl ===================================================================
7709 dnl Check for system libe-book
7710 dnl ===================================================================
7711 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
7712 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
7714 dnl ===================================================================
7715 dnl Check for system libetonyek
7716 dnl ===================================================================
7717 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
7718 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.5])
7720 dnl ===================================================================
7721 dnl Check for system libfreehand
7722 dnl ===================================================================
7723 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
7725 dnl ===================================================================
7726 dnl Check for system libodfgen
7727 dnl ===================================================================
7728 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
7730 dnl ===================================================================
7731 dnl Check for system libcdr
7732 dnl ===================================================================
7733 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
7735 dnl ===================================================================
7736 dnl Check for system libmspub
7737 dnl ===================================================================
7738 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
7740 dnl ===================================================================
7741 dnl Check for system libmwaw
7742 dnl ===================================================================
7743 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
7744 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.7])
7746 dnl ===================================================================
7747 dnl Check for system libpagemaker
7748 dnl ===================================================================
7749 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
7751 dnl ===================================================================
7752 dnl Check for system libvisio
7753 dnl ===================================================================
7754 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
7756 dnl ===================================================================
7757 dnl Check for system libcmis
7758 dnl ===================================================================
7759 # libcmis requires curl and we can't build curl for iOS
7760 if test $_os != iOS; then
7761 libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.5 >= 0.5.0])
7766 AC_SUBST(ENABLE_CMIS)
7768 dnl ===================================================================
7769 dnl Check for system libwpd
7770 dnl ===================================================================
7771 AS_IF([test "$COM" = "MSC"],
7772 [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
7773 [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
7775 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
7777 dnl ===================================================================
7778 dnl Check for system lcms2
7779 dnl ===================================================================
7780 if test "$with_system_lcms2" = "yes"; then
7781 libo_MINGW_CHECK_DLL([liblcms2])
7785 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
7786 if test "$GCC" = "yes"; then
7787 LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7789 if test "$COM" = "MSC"; then # override the above
7790 LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
7793 dnl ===================================================================
7794 dnl Check for system cppunit
7795 dnl ===================================================================
7796 if test "$cross_compiling" != "yes"; then
7797 libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.12.0])
7800 dnl ===================================================================
7801 dnl Check whether freetype is available
7802 dnl ===================================================================
7803 if test "$test_freetype" = "yes"; then
7804 AC_MSG_CHECKING([whether freetype is available])
7805 # FreeType has 3 different kinds of versions
7806 # * release, like 2.4.10
7807 # * libtool, like 13.0.7 (this what pkg-config returns)
7809 # FreeType's docs/VERSION.DLL provides a table mapping between the three
7812 PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
7813 FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7814 FilterLibs "${FREETYPE_LIBS}"
7815 FREETYPE_LIBS="${filteredlibs}"
7816 SYSTEM_FREETYPE=TRUE
7818 _save_cflags="$CFLAGS"
7819 LIBS="$LIBS $FREETYPE_LIBS"
7820 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
7821 AC_CHECK_FUNC(FT_Face_GetCharVariantIndex, AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX), [])
7823 CFLAGS="$_save_cflags"
7825 AC_SUBST(FREETYPE_CFLAGS)
7826 AC_SUBST(FREETYPE_LIBS)
7827 AC_SUBST([SYSTEM_FREETYPE])
7829 dnl ===================================================================
7830 dnl Check for system libabw
7831 dnl ===================================================================
7832 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
7834 dnl ===================================================================
7835 dnl Check for system libwps
7836 dnl ===================================================================
7837 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
7838 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.2])
7840 dnl ===================================================================
7841 dnl Check for system libwpg
7842 dnl ===================================================================
7843 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
7845 # ===================================================================
7846 # Check for system libxslt
7847 # to prevent incompatibilities between internal libxml2 and external libxslt,
7848 # or vice versa, use with_system_libxml here
7849 # ===================================================================
7850 if test "$with_system_libxml" = "auto"; then
7853 with_system_libxml="$with_system_libs"
7856 with_system_libxml=yes
7861 AC_MSG_CHECKING([which libxslt to use])
7862 if test "$with_system_libxml" = "yes"; then
7863 AC_MSG_RESULT([external])
7865 if test "$_os" = "Darwin"; then
7866 dnl make sure to use SDK path
7867 LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7868 LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
7870 LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
7871 LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
7873 PKG_CHECK_MODULES(LIBXSLT, libxslt)
7874 LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7875 FilterLibs "${LIBXSLT_LIBS}"
7876 LIBXSLT_LIBS="${filteredlibs}"
7877 PKG_CHECK_MODULES(LIBEXSLT, libexslt)
7878 LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7879 FilterLibs "${LIBEXSLT_LIBS}"
7880 LIBEXSLT_LIBS="${filteredlibs}"
7883 dnl Check for xsltproc
7884 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7885 if test "$XSLTPROC" = "no"; then
7886 AC_MSG_ERROR([xsltproc is required])
7889 libo_MINGW_CHECK_DLL([libxslt])
7890 libo_MINGW_CHECK_DLL([libexslt])
7891 libo_MINGW_TRY_DLL([iconv])
7893 AC_MSG_RESULT([internal])
7895 BUILD_TYPE="$BUILD_TYPE LIBXSLT"
7897 if test "$cross_compiling" = "yes"; then
7898 AC_PATH_PROG(XSLTPROC, xsltproc, no)
7899 if test "$XSLTPROC" = "no"; then
7900 AC_MSG_ERROR([xsltproc is required])
7904 AC_SUBST(SYSTEM_LIBXSLT)
7905 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
7906 SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
7908 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
7910 AC_SUBST(LIBEXSLT_CFLAGS)
7911 AC_SUBST(LIBEXSLT_LIBS)
7912 AC_SUBST(LIBXSLT_CFLAGS)
7913 AC_SUBST(LIBXSLT_LIBS)
7916 # ===================================================================
7917 # Check for system libxml
7918 # ===================================================================
7919 AC_MSG_CHECKING([which libxml to use])
7920 if test "$with_system_libxml" = "yes"; then
7921 AC_MSG_RESULT([external])
7923 if test "$_os" = "Darwin"; then
7924 dnl make sure to use SDK path
7925 LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7927 LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
7928 elif test $_os = iOS; then
7929 dnl make sure to use SDK path
7930 usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
7931 LIBXML_CFLAGS="-I$usr/include/libxml2"
7932 LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
7934 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
7935 LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
7936 FilterLibs "${LIBXML_LIBS}"
7937 LIBXML_LIBS="${filteredlibs}"
7940 dnl Check for xmllint
7941 AC_PATH_PROG(XMLLINT, xmllint, no)
7942 if test "$XMLLINT" = "no"; then
7943 AC_MSG_ERROR([xmllint is required])
7946 libo_MINGW_CHECK_DLL([libxml2])
7947 libo_MINGW_TRY_DLL([zlib1])
7949 AC_MSG_RESULT([internal])
7951 LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/xml2/include"
7952 if test "$COM" = "MSC"; then
7953 LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
7955 if test "$COM" = "MSC"; then
7956 LIBXML_LIBS="${WORKDIR}/UnpackedTarball/xml2/win32/bin.msvc/libxml2.lib"
7958 LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/xml2/.libs -lxml2"
7960 BUILD_TYPE="$BUILD_TYPE LIBXML2"
7962 AC_SUBST(SYSTEM_LIBXML)
7963 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
7964 SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
7966 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
7967 AC_SUBST(LIBXML_CFLAGS)
7968 AC_SUBST(LIBXML_LIBS)
7971 # =====================================================================
7972 # Checking for a Python interpreter with version >= 2.6.
7973 # Build and runtime requires Python 3 compatible version (>= 2.6).
7974 # Optionally user can pass an option to configure, i. e.
7975 # ./configure PYTHON=/usr/bin/python
7976 # =====================================================================
7977 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
7978 # This allows a lack of system python with no error, we use internal one in that case.
7979 AM_PATH_PYTHON([2.6],, [:])
7980 # Clean PYTHON_VERSION checked below if cross-compiling
7982 if test "$PYTHON" != ":"; then
7983 PYTHON_FOR_BUILD=$PYTHON
7986 AC_SUBST(PYTHON_FOR_BUILD)
7988 # Checks for Python to use for Pyuno
7989 AC_MSG_CHECKING([which Python to use for Pyuno])
7990 case "$enable_python" in
7992 if test -z $PYTHON_FOR_BUILD; then
7993 # Python is required to build LibreOffice. In theory we could separate the build-time Python
7994 # requirement from the choice whether to include Python stuff in the installer, but why
7996 AC_MSG_ERROR([Python is required at build time.])
7999 AC_MSG_RESULT([none])
8002 if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
8003 AC_MSG_RESULT([no, overridden by --disable-scripting])
8005 elif test $build_os = cygwin; then
8006 dnl When building on Windows we don't attempt to use any installed
8007 dnl "system" Python.
8009 dnl (When cross-compiling to Windows from Linux using the mingw32-cross
8010 dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
8011 dnl MinGW cross-compilation setups.)
8012 AC_MSG_RESULT([fully internal])
8013 enable_python=internal
8014 elif test "$cross_compiling" = yes; then
8015 AC_MSG_RESULT([system])
8016 enable_python=system
8018 # Unset variables set by the above AM_PATH_PYTHON so that
8019 # we actually do check anew.
8020 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
8021 AM_PATH_PYTHON([3.3],, [:])
8022 if test "$PYTHON" = ":"; then
8023 if test -z "$PYTHON_FOR_BUILD"; then
8024 AC_MSG_RESULT([fully internal])
8026 AC_MSG_RESULT([internal])
8028 enable_python=internal
8030 AC_MSG_RESULT([system])
8031 enable_python=system
8036 AC_MSG_RESULT([internal])
8039 AC_MSG_RESULT([fully internal])
8040 enable_python=internal
8043 AC_MSG_RESULT([system])
8046 AC_MSG_ERROR([Incorrect --enable-python option])
8050 if test $enable_python != no; then
8051 BUILD_TYPE="$BUILD_TYPE PYUNO"
8054 if test $enable_python = system; then
8055 if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
8057 PYTHON=python$python_version
8058 if test -d "$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"; then
8059 PYTHON_CFLAGS="-I$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"
8060 PYTHON_LIBS="-framework Python"
8062 PYTHON_CFLAGS="`$PYTHON-config --includes`"
8063 PYTHON_LIBS="`$PYTHON-config --libs`"
8066 if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
8067 # Fallback: Accept these in the environment, or as set above
8070 elif test "$cross_compiling" != yes; then
8071 # Unset variables set by the above AM_PATH_PYTHON so that
8072 # we actually do check anew.
8073 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
8074 # This causes an error if no python command is found
8075 AM_PATH_PYTHON([3.3])
8076 python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
8077 python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
8078 python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
8079 python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
8080 if test -z "$PKG_CONFIG"; then
8081 PYTHON_CFLAGS="-I$python_include"
8082 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8083 elif $PKG_CONFIG --exists python-$python_version; then
8084 PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
8085 PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
8087 PYTHON_CFLAGS="-I$python_include"
8088 PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
8090 FilterLibs "${PYTHON_LIBS}"
8091 PYTHON_LIBS="${filteredlibs}"
8093 dnl How to find out the cross-compilation Python installation path?
8094 dnl Let's hardocode what we know for different distributions for now...
8095 for python_version in 2.6; do
8096 if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
8097 PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
8098 PYTHON_LIBS="-L${MINGW_SYSROOT}/lib -lpython$python_version $python_libs"
8099 AC_MSG_CHECKING([for python.exe])
8100 libo_MINGW_CHECK_DLL([libpython$python_version])
8101 libo_MINGW_CHECK_DLL([libreadline6])
8102 libo_MINGW_CHECK_DLL([libtermcap])
8103 # could we somehow extract the really mingw python version from
8104 # actual distro package?
8105 # 2.6.2 currently on OpenSUSE 12.1?
8106 # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
8107 PYTHON_VERSION=$python_version.2
8108 PYTHON_VERSION_MAJOR=`echo $python_version | cut -d . -f 1`
8109 PYTHON_VERSION_MINOR=`echo $python_version | cut -d . -f 2`
8113 AC_MSG_CHECKING([for python version])
8114 AS_IF([test -n "$PYTHON_VERSION"],
8115 [AC_MSG_RESULT([$PYTHON_VERSION])],
8116 [AC_MSG_RESULT([not found])
8117 AC_MSG_ERROR([no usable python found])])
8118 test -n "$PYTHON_CFLAGS" && break
8120 # let the PYTHON_FOR_BUILD match the same python installation that
8121 # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
8122 # better for PythonTests.
8123 PYTHON_FOR_BUILD=$PYTHON
8126 dnl By now enable_python should be "system", "internal" or "no"
8127 case $enable_python in
8131 dnl Check if the headers really work
8132 save_CPPFLAGS="$CPPFLAGS"
8133 CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
8134 AC_CHECK_HEADER(Python.h, [],
8135 [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
8137 CPPFLAGS="$save_CPPFLAGS"
8140 CFLAGS="$CFLAGS $PYTHON_CFLAGS"
8141 AC_MSG_CHECKING([for correct python library version])
8142 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8145 int main(int argc, char **argv) {
8146 if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
8147 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
8150 ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.6 when building with Python 2])],[AC_MSG_RESULT([skipped; cross-compiling])])
8154 dnl FIXME Check if the Python library can be linked with, too?
8159 PYTHON_VERSION_MAJOR=3
8160 # On windows we are supporting two different python versions: 3.3 and 3.5.
8161 # We msut do it as long as we support MSVC 2013. Python 3.3 can be removed
8162 # when MSVC 2013 support was dropped.
8163 if test "$COM" = "MSC" -a "$VCVER" = "120"; then
8164 PYTHON_VERSION_MINOR=3
8166 PYTHON_VERSION_MINOR=5
8168 PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.0
8169 AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
8170 BUILD_TYPE="$BUILD_TYPE PYTHON"
8171 # Embedded Python dies without Home set
8172 if test "$HOME" = ""; then
8175 # bz2 tarball and bzip2 is not standard
8176 if test -z "$BZIP2"; then
8177 AC_PATH_PROG( BZIP2, bzip2)
8178 if test -z "$BZIP2"; then
8179 AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
8188 AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
8192 AC_SUBST(DISABLE_PYTHON)
8193 AC_SUBST(SYSTEM_PYTHON)
8194 AC_SUBST(PYTHON_CFLAGS)
8195 AC_SUBST(PYTHON_LIBS)
8196 AC_SUBST(PYTHON_VERSION)
8197 AC_SUBST(PYTHON_VERSION_MAJOR)
8198 AC_SUBST(PYTHON_VERSION_MINOR)
8200 AC_MSG_CHECKING([whether to build the MariaDB/MySQL Connector extension])
8201 if test "x$enable_ext_mariadb_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
8202 AC_MSG_RESULT([yes])
8203 ENABLE_MARIADBC=TRUE
8207 BUILD_TYPE="$BUILD_TYPE MARIADBC"
8212 AC_SUBST(ENABLE_MARIADBC)
8213 AC_SUBST(MARIADBC_MAJOR)
8214 AC_SUBST(MARIADBC_MINOR)
8215 AC_SUBST(MARIADBC_MICRO)
8217 if test "$ENABLE_MARIADBC" = "TRUE"; then
8219 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MARIADBC"
8221 dnl ===================================================================
8222 dnl Check for system MariaDB
8223 dnl ===================================================================
8224 AC_MSG_CHECKING([which MariaDB to use])
8225 if test "$with_system_mariadb" = "yes"; then
8226 AC_MSG_RESULT([external])
8228 #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
8229 if test -z "$MARIADBCONFIG"; then
8230 AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
8231 if test -z "$MARIADBCONFIG"; then
8232 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
8233 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
8236 AC_MSG_CHECKING([MariaDB version])
8237 MARIADB_VERSION=`$MARIADBCONFIG --version`
8238 MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
8239 if test "$MARIADB_MAJOR" -ge "5"; then
8242 AC_MSG_ERROR([too old, use 5.0.x or later])
8244 AC_MSG_CHECKING([for MariaDB Client library])
8245 MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
8246 if test "$COM_IS_CLANG" = TRUE; then
8247 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
8249 MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
8250 dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
8251 dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
8253 if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
8254 MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
8255 MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
8256 | sed -e 's|/lib64/|/lib/|')
8258 FilterLibs "${MARIADB_LIBS}"
8259 MARIADB_LIBS="${filteredlibs}"
8260 AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
8261 AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
8262 if test "$enable_bundle_mariadb" = "yes"; then
8263 AC_MSG_RESULT([yes])
8265 LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
8267 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
8269 /g' | grep -E '(mysqlclient|mariadb)')
8270 if test "$_os" = "Darwin"; then
8271 LIBMARIADB=${LIBMARIADB}.dylib
8272 elif test "$_os" = "WINNT"; then
8273 LIBMARIADB=${LIBMARIADB}.dll
8275 LIBMARIADB=${LIBMARIADB}.so
8277 LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
8278 AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
8279 if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
8280 AC_MSG_RESULT([found.])
8281 PathFormat "$LIBMARIADB_PATH"
8282 LIBMARIADB_PATH="$formatted_path"
8284 AC_MSG_ERROR([not found.])
8291 AC_MSG_RESULT([internal])
8293 MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb/include"
8294 MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadblib"
8295 BUILD_TYPE="$BUILD_TYPE MARIADB"
8298 AC_SUBST(SYSTEM_MARIADB)
8299 AC_SUBST(MARIADB_CFLAGS)
8300 AC_SUBST(MARIADB_LIBS)
8301 AC_SUBST(LIBMARIADB)
8302 AC_SUBST(LIBMARIADB_PATH)
8303 AC_SUBST(BUNDLE_MARIADB)
8306 dnl ===================================================================
8307 dnl Check for system MySQL C++ Connector
8308 dnl ===================================================================
8310 # who thought this too-generic cppconn dir was a good idea?
8311 AC_MSG_CHECKING([MySQL Connector/C++])
8312 if test "$with_system_mysql_cppconn" = "yes"; then
8313 AC_MSG_RESULT([external])
8314 SYSTEM_MYSQL_CPPCONN=TRUE
8316 AC_CHECK_HEADER(mysql_driver.h, [],
8317 [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
8318 AC_CHECK_LIB([mysqlcppconn], [main], [:],
8319 [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
8321 LIBS="$LIBS -lmysqlcppconn"
8322 AC_MSG_CHECKING([version])
8323 AC_RUN_IFELSE([AC_LANG_SOURCE([[
8324 #include <mysql_driver.h>
8326 int main(int argc, char **argv) {
8327 sql::Driver *driver;
8328 driver = get_driver_instance();
8329 if (driver->getMajorVersion() > 1 || \
8330 (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
8331 (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
8336 ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[AC_MSG_ERROR([MySQL C++ Connecter not tested with cross-compilation])])
8341 AC_MSG_RESULT([internal])
8342 BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
8343 SYSTEM_MYSQL_CPPCONN=
8347 AC_SUBST(SYSTEM_MYSQL_CPPCONN)
8349 dnl ===================================================================
8350 dnl Check for system hsqldb
8351 dnl ===================================================================
8352 if test "$with_java" != "no"; then
8353 HSQLDB_USE_JDBC_4_1=
8354 AC_MSG_CHECKING([which hsqldb to use])
8355 if test "$with_system_hsqldb" = "yes"; then
8356 AC_MSG_RESULT([external])
8358 if test -z $HSQLDB_JAR; then
8359 HSQLDB_JAR=/usr/share/java/hsqldb.jar
8361 if ! test -f $HSQLDB_JAR; then
8362 AC_MSG_ERROR(hsqldb.jar not found.)
8364 AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
8368 my $file = "$ENV{'HSQLDB_JAR'}";
8369 my $zip = Archive::Zip->new( $file );
8370 my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
8371 if ( $mf =~ m/Specification-Version: 1.8.*/ )
8373 push @l, split(/\n/, $mf);
8374 foreach my $line (@l)
8376 if ($line =~ m/Specification-Version:/)
8378 ($t, $version) = split (/:/,$line);
8379 $version =~ s/^\s//;
8380 ($a, $b, $c, $d) = split (/\./,$version);
8381 if ($c == "0" && $d > "8")
8396 AC_MSG_RESULT([yes])
8398 AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
8401 AC_MSG_RESULT([internal])
8403 BUILD_TYPE="$BUILD_TYPE HSQLDB"
8404 AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
8405 javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
8406 if expr "$javanumver" '>=' 000100060000 > /dev/null; then
8407 AC_MSG_RESULT([yes])
8408 HSQLDB_USE_JDBC_4_1=TRUE
8413 AC_SUBST(SYSTEM_HSQLDB)
8414 AC_SUBST(HSQLDB_JAR)
8415 AC_SUBST([HSQLDB_USE_JDBC_4_1])
8418 dnl ===================================================================
8419 dnl Check for PostgreSQL stuff
8420 dnl ===================================================================
8421 if test "x$enable_postgresql_sdbc" != "xno"; then
8422 SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
8424 if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
8425 AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
8427 if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
8428 AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
8431 postgres_interface=""
8432 if test "$with_system_postgresql" = "yes"; then
8433 postgres_interface="external PostgreSQL"
8434 SYSTEM_POSTGRESQL=TRUE
8435 if test "$_os" = Darwin; then
8437 for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
8438 pg_supp_path="$P_SEP$d$pg_supp_path"
8441 AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
8442 if test -z "$PGCONFIG"; then
8443 AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
8445 POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
8446 POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
8447 FilterLibs "${POSTGRESQL_LIB}"
8448 POSTGRESQL_LIB="${filteredlibs}"
8450 # if/when anything else than PostgreSQL uses Kerberos,
8451 # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
8456 # MacOS X has system MIT Kerberos 5 since 10.4
8457 if test "$with_krb5" != "no"; then
8460 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8461 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
8464 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8465 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
8466 KRB5_LIBS="$KRB5_LIBS $LIBS"
8469 if test "$with_gssapi" != "no"; then
8472 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8473 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8479 if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
8480 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
8483 Linux|GNU|*BSD|DragonFly)
8484 if test "$with_krb5" != "no"; then
8487 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8488 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8491 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8492 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8493 KRB5_LIBS="$KRB5_LIBS $LIBS"
8496 if test "$with_gssapi" != "no"; then
8499 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8500 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8506 if test "$with_krb5" = "yes"; then
8509 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8510 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
8513 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
8514 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
8515 KRB5_LIBS="$KRB5_LIBS $LIBS"
8518 if test "$with_gssapi" = "yes"; then
8521 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
8522 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
8528 if test -n "$with_libpq_path"; then
8529 SYSTEM_POSTGRESQL=TRUE
8530 postgres_interface="external libpq"
8531 POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
8532 POSTGRESQL_INC=-I"${with_libpq_path}/include/"
8535 postgres_interface="internal"
8537 POSTGRESQL_INC="%OVERRIDE_ME%"
8538 BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
8542 AC_MSG_CHECKING([PostgreSQL C interface])
8543 AC_MSG_RESULT([$postgres_interface])
8545 if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
8546 AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
8548 save_CPPFLAGS=$CPPFLAGS
8550 CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
8551 LIBS="${LIBS} ${POSTGRESQL_LIB}"
8552 AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
8553 AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
8554 [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
8556 CPPFLAGS=$save_CPPFLAGS
8559 BUILD_POSTGRESQL_SDBC=TRUE
8562 AC_SUBST(WITH_GSSAPI)
8563 AC_SUBST(GSSAPI_LIBS)
8565 AC_SUBST(BUILD_POSTGRESQL_SDBC)
8566 AC_SUBST(SYSTEM_POSTGRESQL)
8567 AC_SUBST(POSTGRESQL_INC)
8568 AC_SUBST(POSTGRESQL_LIB)
8570 dnl ===================================================================
8571 dnl Check for Firebird stuff
8572 dnl ===================================================================
8573 ENABLE_FIREBIRD_SDBC=""
8574 if test "$enable_firebird_sdbc" = "yes" ; then
8575 SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
8577 dnl ===================================================================
8578 dnl Check for system Firebird
8579 dnl ===================================================================
8580 AC_MSG_CHECKING([which Firebird to use])
8581 if test "$with_system_firebird" = "yes"; then
8582 AC_MSG_RESULT([external])
8583 SYSTEM_FIREBIRD=TRUE
8584 AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
8585 if test -z "$FIREBIRDCONFIG"; then
8586 AC_MSG_NOTICE([No fb_config -- using pkg-config])
8587 PKG_CHECK_MODULES(FIREBIRD, fbembed)
8588 FIREBIRD_VERSION=`pkg-config --modversion fbembed`
8590 AC_MSG_NOTICE([fb_config found])
8591 FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
8592 AC_MSG_CHECKING([for Firebird Client library])
8593 FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
8594 FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
8595 FilterLibs "${FIREBIRD_LIBS}"
8596 FIREBIRD_LIBS="${filteredlibs}"
8598 AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
8599 AC_MSG_CHECKING([Firebird version])
8600 if test -n "${FIREBIRD_VERSION}"; then
8601 FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
8602 FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
8603 if test "$FIREBIRD_MAJOR" -eq "2" -a "$FIREBIRD_MINOR" -eq "5"; then
8606 AC_MSG_ERROR([Ensure firebird 2.5.x is installed])
8609 __save_CFLAGS="${CFLAGS}"
8610 CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
8611 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
8612 #if defined(FB_API_VER) && FB_API_VER == 25
8614 #error "Wrong Firebird API version"
8615 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 2.5.x is installed]))
8616 CFLAGS="${__save_CFLAGS}"
8618 ENABLE_FIREBIRD_SDBC="TRUE"
8619 elif test "$enable_database_connectivity" != yes; then
8620 AC_MSG_RESULT([none])
8621 elif test "$cross_compiling" = "yes"; then
8622 AC_MSG_RESULT([none])
8624 dnl We need libatomic-ops for any non X86/X64 system
8625 if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
8626 dnl ===================================================================
8627 dnl Check for system libatomic-ops
8628 dnl ===================================================================
8629 libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
8630 if test "$with_system_libatomic_ops" = "yes"; then
8631 SYSTEM_LIBATOMIC_OPS=TRUE
8632 AC_CHECK_HEADERS(atomic_ops.h, [],
8633 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
8635 SYSTEM_LIBATOMIC_OPS=
8636 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
8637 LIBATOMIC_OPS_LIBS="-latomic_ops"
8638 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
8642 AC_MSG_RESULT([internal])
8644 FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/include"
8645 FIREBIRD_LIBS="-lfbembed"
8647 BUILD_TYPE="$BUILD_TYPE FIREBIRD"
8648 ENABLE_FIREBIRD_SDBC="TRUE"
8651 AC_SUBST(ENABLE_FIREBIRD_SDBC)
8652 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
8653 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
8654 AC_SUBST(LIBATOMIC_OPS_LIBS)
8655 AC_SUBST(SYSTEM_FIREBIRD)
8656 AC_SUBST(FIREBIRD_CFLAGS)
8657 AC_SUBST(FIREBIRD_LIBS)
8658 dnl AC_SUBST([TOMMATH_CFLAGS])
8659 dnl AC_SUBST([TOMMATH_LIBS])
8661 dnl ===================================================================
8662 dnl Check for system curl
8663 dnl ===================================================================
8664 AC_MSG_CHECKING([which libcurl to use])
8665 if test "$with_system_curl" = "auto"; then
8666 with_system_curl="$with_system_libs"
8669 if test "$with_system_curl" = "yes"; then
8670 AC_MSG_RESULT([external])
8673 # First try PKGCONFIG and then fall back
8674 PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
8676 if test -n "$CURL_PKG_ERRORS"; then
8677 AC_PATH_PROG(CURLCONFIG, curl-config)
8678 if test -z "$CURLCONFIG"; then
8679 AC_MSG_ERROR([curl development files not found])
8681 CURL_LIBS=`$CURLCONFIG --libs`
8682 FilterLibs "${CURL_LIBS}"
8683 CURL_LIBS="${filteredlibs}"
8684 CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
8685 curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
8687 AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
8688 case $curl_version in
8689 dnl brackets doubled below because Autoconf uses them as m4 quote characters,
8690 dnl so they need to be doubled to end up in the configure script
8691 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
8692 AC_MSG_RESULT([yes])
8695 AC_MSG_ERROR([no, you have $curl_version])
8700 libo_MINGW_CHECK_DLL([libcurl])
8701 libo_MINGW_TRY_DLL([libintl])
8702 libo_MINGW_TRY_DLL([libidn])
8703 libo_MINGW_TRY_DLL([libnspr4])
8704 libo_MINGW_TRY_DLL([nssutil3])
8705 libo_MINGW_TRY_DLL([libplc4])
8706 libo_MINGW_TRY_DLL([libplds4])
8707 libo_MINGW_TRY_DLL([nss3])
8708 libo_MINGW_TRY_DLL([ssl3])
8709 libo_MINGW_TRY_DLL([libgpg-error])
8710 libo_MINGW_TRY_DLL([libgcrypt])
8711 libo_MINGW_TRY_DLL([libssh2])
8713 elif test $_os = iOS; then
8714 # Let's see if we need curl, I think not?
8715 AC_MSG_RESULT([none])
8718 AC_MSG_RESULT([internal])
8720 BUILD_TYPE="$BUILD_TYPE CURL"
8723 AC_SUBST(SYSTEM_CURL)
8724 AC_SUBST(CURL_CFLAGS)
8726 AC_SUBST(ENABLE_CURL)
8728 dnl ===================================================================
8729 dnl Check for system boost
8730 dnl ===================================================================
8731 AC_MSG_CHECKING([which boost to use])
8732 if test "$with_system_boost" = "yes"; then
8733 AC_MSG_RESULT([external])
8738 mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
8739 libo_MINGW_TRY_DLL([$mingw_boost_date_time_dll])
8740 if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
8741 # if not found, try again with 'lib' prefix
8742 libo_MINGW_CHECK_DLL([lib$mingw_boost_date_time_dll])
8745 save_CXXFLAGS=$CXXFLAGS
8746 CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
8747 AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
8748 [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
8749 AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
8750 [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
8751 AC_CHECK_HEADER(boost/function.hpp, [],
8752 [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
8753 AC_MSG_CHECKING([whether boost signals2 works])
8754 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/signals2/signal.hpp>]],
8755 [[ boost::signals2::signal<void()> s; s(); ]])],
8756 [AC_MSG_RESULT([yes])],
8757 [AC_MSG_ERROR([no, install boost >= 1.55 or use --without-system-boost])])
8758 CXXFLAGS="$CXXFLAGS -fno-exceptions"
8759 AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
8760 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
8761 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
8762 if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
8763 AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
8765 AC_MSG_RESULT([yes])
8767 CXXFLAGS=$save_CXXFLAGS
8769 # this is in m4/ax_boost_base.m4
8770 FilterLibs "${BOOST_LDFLAGS}"
8771 BOOST_LDFLAGS="${filteredlibs}"
8773 AC_MSG_RESULT([internal])
8774 BUILD_TYPE="$BUILD_TYPE BOOST"
8777 AC_SUBST(SYSTEM_BOOST)
8779 dnl ===================================================================
8780 dnl Check for system mdds
8781 dnl ===================================================================
8782 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.0 >= 1.0.0], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
8784 dnl ===================================================================
8785 dnl Check for system glm
8786 dnl ===================================================================
8787 AC_MSG_CHECKING([which glm to use])
8788 if test "$with_system_glm" = "yes"; then
8789 AC_MSG_RESULT([external])
8792 AC_CHECK_HEADER([glm/glm.hpp], [],
8793 [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
8796 AC_MSG_RESULT([internal])
8797 BUILD_TYPE="$BUILD_TYPE GLM"
8799 GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
8801 AC_SUBST([GLM_CFLAGS])
8802 AC_SUBST([SYSTEM_GLM])
8804 dnl ===================================================================
8805 dnl Check for system glew
8806 dnl ===================================================================
8807 libo_CHECK_SYSTEM_MODULE([glew], [GLEW], [glew >= 1.10.0])
8808 AS_IF([test "$with_system_glew" = "yes"],
8809 [PKG_CHECK_EXISTS([glew >= 1.12.0], [AC_DEFINE([HAVE_GLEW_1_12])])],
8810 [AC_DEFINE([HAVE_GLEW_1_12])])
8812 dnl ===================================================================
8813 dnl Check for system glyphy
8814 dnl ===================================================================
8815 dnl We currently use GLyphy only on Windows
8816 if test $_os = WINNT; then
8817 libo_CHECK_SYSTEM_MODULE([glyphy], [GLYPHY], [glyphy >= 0.12.0], ["-I${WORKDIR}/UnpackedTarball/glyphy/src"])
8820 dnl ===================================================================
8821 dnl Check for system odbc
8822 dnl ===================================================================
8823 AC_MSG_CHECKING([which odbc headers to use])
8824 if test "$with_system_odbc" = "yes" -o '(' "$with_system_headers" = "yes" -a "$with_system_odbc" = "auto" ')' -o '(' "$_os" = "WINNT" -a "$with_system_odbc" != "no" ')'; then
8825 AC_MSG_RESULT([external])
8826 SYSTEM_ODBC_HEADERS=TRUE
8828 if test "$build_os" = "cygwin"; then
8829 save_CPPFLAGS=$CPPFLAGS
8831 PathFormat "$winsdktest"
8832 CPPFLAGS="$CPPFLAGS -I$formatted_path/include/um -I$formatted_path/Include/$winsdklibsubdir/um -I$formatted_path/include -I$formatted_path/include/shared"
8833 AC_CHECK_HEADER(sqlext.h, [],
8834 [AC_MSG_ERROR(odbc not found. install odbc)],
8835 [#include <windows.h>])
8836 CPPFLAGS=$save_CPPFLAGS
8838 AC_CHECK_HEADER(sqlext.h, [],
8839 [AC_MSG_ERROR(odbc not found. install odbc)],[])
8841 elif test "$enable_database_connectivity" != yes; then
8842 AC_MSG_RESULT([none])
8844 AC_MSG_RESULT([internal])
8845 SYSTEM_ODBC_HEADERS=
8847 AC_SUBST(SYSTEM_ODBC_HEADERS)
8850 dnl ===================================================================
8851 dnl Check for system openldap
8852 dnl ===================================================================
8854 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
8855 AC_MSG_CHECKING([which openldap library to use])
8856 if test "$with_system_openldap" = "yes"; then
8857 AC_MSG_RESULT([external])
8858 SYSTEM_OPENLDAP=TRUE
8859 AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
8860 AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8861 AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8863 AC_MSG_RESULT([internal])
8865 BUILD_TYPE="$BUILD_TYPE OPENLDAP"
8868 AC_SUBST(SYSTEM_OPENLDAP)
8870 dnl ===================================================================
8871 dnl Check for TLS/SSL and cryptographic implementation to use
8872 dnl ===================================================================
8873 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
8874 if test -n "$with_tls"; then
8877 AC_DEFINE(USE_TLS_OPENSSL)
8880 if test "$enable_openssl" != "yes"; then
8881 AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
8884 # warn that OpenSSL has been selected but not all TLS code has this option
8885 AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS])
8886 add_warning "TLS/SSL implementation to use is OpenSSL but some code may still be depending on NSS or GNUTLS"
8889 AC_DEFINE(USE_TLS_NSS)
8893 AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
8895 nss - Mozilla's Network Security Services (NSS)
8899 elif test $_os = iOS -o $_os = Android; then
8900 # We don't build NSS for iOS and Android
8901 AC_DEFINE(USE_TLS_OPENSSL)
8904 # default to using NSS, it results in smaller oox lib
8905 AC_DEFINE(USE_TLS_NSS)
8908 AC_MSG_RESULT([$TLS])
8911 dnl ===================================================================
8912 dnl Check for system NSS
8913 dnl ===================================================================
8914 if test $_os != iOS; then
8915 libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
8917 if test "$with_system_nss" = "yes"; then
8918 libo_MINGW_CHECK_DLL([libnspr4])
8919 libo_MINGW_CHECK_DLL([libplc4])
8920 libo_MINGW_CHECK_DLL([libplds4])
8921 libo_MINGW_CHECK_DLL([nss3])
8922 libo_MINGW_CHECK_DLL([nssutil3])
8923 libo_MINGW_CHECK_DLL([smime3])
8924 libo_MINGW_CHECK_DLL([ssl3])
8927 if test $_os = WINNT -a -z "$ENABLE_RELEASE_BUILD" -a "$with_prebuilt_openssl" = yes; then
8928 BUILD_TYPE="$BUILD_TYPE PREBUILT_OPENSSL"
8931 dnl ===================================================================
8932 dnl Check for system sane
8933 dnl ===================================================================
8934 AC_MSG_CHECKING([which sane header to use])
8935 if test "$with_system_sane" = "yes"; then
8936 AC_MSG_RESULT([external])
8937 AC_CHECK_HEADER(sane/sane.h, [],
8938 [AC_MSG_ERROR(sane not found. install sane)], [])
8940 AC_MSG_RESULT([internal])
8941 BUILD_TYPE="$BUILD_TYPE SANE"
8944 dnl ===================================================================
8945 dnl Check for system icu
8946 dnl ===================================================================
8953 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
8954 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
8955 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
8956 AC_MSG_CHECKING([which icu to use])
8957 if test "$with_system_icu" = "yes"; then
8958 AC_MSG_RESULT([external])
8961 AC_MSG_CHECKING([for unicode/rbbi.h])
8962 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
8965 if test "$cross_compiling" != "yes" -o "$WITH_MINGW" = "yes"; then
8967 if test "$WITH_MINGW" = "yes"; then
8968 ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
8970 AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
8972 AC_MSG_CHECKING([ICU version])
8973 ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
8974 ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
8975 ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
8977 if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "6" \); then
8978 AC_MSG_RESULT([OK, $ICU_VERSION])
8980 AC_MSG_ERROR([not suitable, only >= 4.6 supported currently])
8984 if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
8985 AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
8986 ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
8987 ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
8988 ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
8989 AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
8990 if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
8991 AC_MSG_RESULT([yes])
8994 if test "$with_system_icu_for_build" != "force"; then
8995 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
8996 You can use --with-system-icu-for-build=force to use it anyway.])
9001 if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
9002 # using the system icu tools can lead to version confusion, use the
9003 # ones from the build environment when cross-compiling
9004 AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
9005 if test -z "$SYSTEM_GENBRK"; then
9006 AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
9008 AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9009 if test -z "$SYSTEM_GENCCODE"; then
9010 AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
9012 AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
9013 if test -z "$SYSTEM_GENCMN"; then
9014 AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
9016 if test "$ICU_MAJOR" -ge "49"; then
9017 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
9018 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
9019 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
9021 ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
9022 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
9023 ICU_RECLASSIFIED_HEBREW_LETTER=
9027 if test "$cross_compiling" = "yes"; then
9028 if test "$ICU_MAJOR" -ge "50"; then
9029 AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
9034 libo_MINGW_CHECK_DLL([icudata][$ICU_MAJOR][$ICU_MINOR])
9035 libo_MINGW_CHECK_DLL([icui18n][$ICU_MAJOR][$ICU_MINOR])
9036 libo_MINGW_CHECK_DLL([icuuc][$ICU_MAJOR][$ICU_MINOR])
9038 AC_MSG_RESULT([internal])
9040 BUILD_TYPE="$BUILD_TYPE ICU"
9041 # surprisingly set these only for "internal" (to be used by various other
9042 # external libs): the system icu-config is quite unhelpful and spits out
9043 # dozens of weird flags and also default path -I/usr/include
9044 ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
9045 ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
9047 AC_SUBST(SYSTEM_ICU)
9048 AC_SUBST(SYSTEM_GENBRK)
9049 AC_SUBST(SYSTEM_GENCCODE)
9050 AC_SUBST(SYSTEM_GENCMN)
9053 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
9054 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
9055 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
9056 AC_SUBST(ICU_CFLAGS)
9059 dnl ===================================================================
9061 dnl ===================================================================
9063 AC_MSG_CHECKING([whether to enable graphite support])
9064 if test $_os != Darwin -a $_os != Android -a $_os != iOS -a \( -z "$enable_graphite" -o "$enable_graphite" != no \); then
9065 AC_MSG_RESULT([yes])
9066 ENABLE_GRAPHITE="TRUE"
9067 AC_DEFINE(ENABLE_GRAPHITE)
9068 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3])
9069 if test "$with_system_graphite" = "yes"; then
9070 libo_MINGW_CHECK_DLL([libgraphite2])
9075 AC_SUBST(ENABLE_GRAPHITE)
9077 dnl ===================================================================
9079 dnl ===================================================================
9081 AC_MSG_CHECKING([whether to enable orcus])
9082 if test -z "$enable_orcus" -o "$enable_orcus" != no; then
9083 AC_MSG_RESULT([yes])
9085 AC_DEFINE(ENABLE_ORCUS)
9087 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.10 >= 0.9.0])
9088 if test "$with_system_orcus" != "yes"; then
9089 if test "$SYSTEM_BOOST" = "TRUE"; then
9090 # ===========================================================
9091 # Determine if we are going to need to link with Boost.System
9092 # ===========================================================
9093 dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
9094 dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
9095 dnl in documentation has no effect.
9096 AC_MSG_CHECKING([if we need to link with Boost.System])
9098 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9099 @%:@include <boost/version.hpp>
9101 #if BOOST_VERSION >= 105000
9102 # error yes, we need to link with Boost.System
9107 AC_MSG_RESULT([yes])
9113 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
9114 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
9115 AC_SUBST([BOOST_SYSTEM_LIB])
9116 AC_SUBST(SYSTEM_LIBORCUS)
9121 AC_SUBST(ENABLE_ORCUS)
9123 dnl ===================================================================
9125 dnl ===================================================================
9126 AC_MSG_CHECKING([whether to enable HarfBuzz support])
9127 if test $_os != WINNT -a $_os != Darwin -a $_os != iOS; then
9128 AC_MSG_RESULT([yes])
9129 ENABLE_HARFBUZZ="TRUE"
9130 if $PKG_CONFIG --atleast-version 0.9.18 harfbuzz; then
9131 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"])
9133 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz >= 0.9.10],[-I${WORKDIR}/UnpackedTarball/harfbuzz/src],["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz -lharfbuzz-icu"])
9138 AC_SUBST(ENABLE_HARFBUZZ)
9140 AC_MSG_CHECKING([whether to use X11])
9141 dnl ***************************************
9142 dnl testing for X libraries and includes...
9143 dnl ***************************************
9144 if test "$USING_X11" = TRUE; then
9145 AC_DEFINE(HAVE_FEATURE_X11)
9147 AC_MSG_RESULT([$USING_X11])
9149 if test "$USING_X11" = TRUE; then
9152 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
9154 if test -z "$x_includes"; then
9155 x_includes="default_x_includes"
9157 if test -z "$x_libraries"; then
9158 x_libraries="default_x_libraries"
9160 CFLAGS="$CFLAGS $X_CFLAGS"
9161 LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
9162 AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
9164 x_includes="no_x_includes"
9165 x_libraries="no_x_libraries"
9168 if test "$USING_X11" = TRUE; then
9169 dnl ===================================================================
9170 dnl Check for Composite.h for Mozilla plugin
9171 dnl ===================================================================
9172 AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
9173 [#include <X11/Intrinsic.h>])
9175 dnl ===================================================================
9176 dnl Check for extension headers
9177 dnl ===================================================================
9178 AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
9179 [#include <X11/extensions/shape.h>])
9181 # vcl needs ICE and SM
9182 AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
9183 AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
9184 [AC_MSG_ERROR(ICE library not found)])
9185 AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
9186 AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
9187 [AC_MSG_ERROR(SM library not found)])
9190 dnl ===================================================================
9191 dnl Check for system Xrender
9192 dnl ===================================================================
9193 AC_MSG_CHECKING([whether to use Xrender])
9194 if test "$USING_X11" = TRUE -a "$test_xrender" = "yes"; then
9195 AC_MSG_RESULT([yes])
9196 PKG_CHECK_MODULES(XRENDER, xrender)
9197 XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9198 FilterLibs "${XRENDER_LIBS}"
9199 XRENDER_LIBS="${filteredlibs}"
9200 AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
9201 [AC_MSG_ERROR(libXrender not found or functional)], [])
9202 AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
9203 [AC_MSG_ERROR(Xrender not found. install X)], [])
9207 AC_SUBST(XRENDER_CFLAGS)
9208 AC_SUBST(XRENDER_LIBS)
9210 dnl ===================================================================
9211 dnl Check for XRandr
9212 dnl ===================================================================
9213 AC_MSG_CHECKING([whether to enable RandR support])
9214 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
9215 AC_MSG_RESULT([yes])
9216 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
9217 if test "$ENABLE_RANDR" != "TRUE"; then
9218 AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
9219 [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
9221 AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
9222 [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
9223 XRANDR_LIBS="-lXrandr "
9226 XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9227 FilterLibs "${XRANDR_LIBS}"
9228 XRANDR_LIBS="${filteredlibs}"
9233 AC_SUBST(XRANDR_CFLAGS)
9234 AC_SUBST(XRANDR_LIBS)
9235 AC_SUBST(ENABLE_RANDR)
9237 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
9240 if test $_os = iOS -o $_os = Android; then
9243 AC_MSG_CHECKING([for webdav library])
9244 case "$WITH_WEBDAV" in
9246 AC_MSG_RESULT([serf])
9247 # Check for system apr-util
9248 libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
9249 ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
9250 ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
9251 if test "$COM" = "MSC"; then
9253 test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
9254 APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
9257 # Check for system serf
9258 libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
9259 ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
9260 if test "$COM" = "MSC"; then
9261 SERF_LIB_DIR="Release"
9262 test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
9263 SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
9267 AC_MSG_RESULT([neon])
9268 # Check for system neon
9269 libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
9270 if test "$with_system_neon" = "yes"; then
9271 NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
9272 libo_MINGW_CHECK_DLL([libneon])
9273 libo_MINGW_TRY_DLL([libtasn1])
9274 libo_MINGW_TRY_DLL([libgnutls])
9278 AC_SUBST(NEON_VERSION)
9281 AC_MSG_RESULT([none, disabled])
9285 AC_SUBST(WITH_WEBDAV)
9287 dnl ===================================================================
9288 dnl Check for disabling cve_tests
9289 dnl ===================================================================
9290 AC_MSG_CHECKING([whether to execute CVE tests])
9291 # If not explicitly enabled or disabled, default
9292 if test -z "$enable_cve_tests"; then
9295 # Default cves off for windows with its wild and wonderful
9296 # varienty of AV software kicking in and panicing
9301 enable_cve_tests=yes
9305 if test "$enable_cve_tests" = "no"; then
9307 DISABLE_CVE_TESTS=TRUE
9308 AC_SUBST(DISABLE_CVE_TESTS)
9310 AC_MSG_RESULT([yes])
9313 dnl ===================================================================
9314 dnl Check for enabling chart XShape tests
9315 dnl ===================================================================
9316 AC_MSG_CHECKING([whether to execute chart XShape tests])
9317 if test "$enable_chart_tests" = "yes"; then
9318 AC_MSG_RESULT([yes])
9319 ENABLE_CHART_TESTS=TRUE
9320 AC_SUBST(ENABLE_CHART_TESTS)
9325 dnl ===================================================================
9326 dnl Check for system openssl
9327 dnl ===================================================================
9329 AC_MSG_CHECKING([whether to disable OpenSSL usage])
9330 if test "$enable_openssl" = "yes"; then
9332 if test "$_os" = Darwin ; then
9333 # OpenSSL is deprecated when building for 10.7 or later.
9335 # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
9336 # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
9338 with_system_openssl=no
9339 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9340 elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
9341 && test "$with_system_openssl" != "no"; then
9342 with_system_openssl=yes
9345 OPENSSL_LIBS="-lssl -lcrypto"
9347 libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
9349 if test "$with_system_openssl" = "yes"; then
9350 libo_MINGW_CHECK_DLL([libssl])
9351 libo_MINGW_CHECK_DLL([libcrypto])
9352 AC_MSG_CHECKING([whether openssl supports SHA512])
9354 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
9356 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
9360 AC_MSG_RESULT([yes])
9361 DISABLE_OPENSSL=TRUE
9363 # warn that although OpenSSL is disabled, system libraries may be depending on it
9364 AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
9365 add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
9368 AC_SUBST([DISABLE_OPENSSL])
9370 dnl ===================================================================
9371 dnl Check for building gnutls
9372 dnl ===================================================================
9373 AC_MSG_CHECKING([whether to use gnutls])
9374 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
9375 AC_MSG_RESULT([yes])
9377 PKG_CHECK_MODULES(GNUTLS, [gnutls],,
9378 AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
9379 available in the system to use as replacement.]]))
9380 FilterLibs "${LIBGCRYPT_LIBS}"
9381 LIBGCRYPT_LIBS="${filteredlibs}"
9386 AC_SUBST([LIBGCRYPT_CFLAGS])
9387 AC_SUBST([LIBGCRYPT_LIBS])
9389 dnl ===================================================================
9390 dnl Check for system redland
9391 dnl ===================================================================
9392 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
9393 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
9394 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
9395 if test "$with_system_redland" = "yes"; then
9396 libo_MINGW_CHECK_DLL([librdf])
9397 AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
9398 [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
9399 libo_MINGW_TRY_DLL([libraptor])
9400 libo_MINGW_TRY_DLL([librasqal])
9401 libo_MINGW_TRY_DLL([libsqlite3])
9407 AC_SUBST(RAPTOR_MAJOR)
9408 AC_SUBST(RASQAL_MAJOR)
9409 AC_SUBST(REDLAND_MAJOR)
9411 dnl ===================================================================
9412 dnl Check for system hunspell
9413 dnl ===================================================================
9414 AC_MSG_CHECKING([which libhunspell to use])
9415 if test "$with_system_hunspell" = "yes"; then
9416 AC_MSG_RESULT([external])
9417 SYSTEM_HUNSPELL=TRUE
9419 PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
9420 if test "$HUNSPELL_PC" != "TRUE"; then
9421 AC_CHECK_HEADER(hunspell.hxx, [],
9423 AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
9424 [AC_MSG_ERROR(hunspell headers not found.)], [])
9426 AC_CHECK_LIB([hunspell], [main], [:],
9427 [ AC_MSG_ERROR(hunspell library not found.) ], [])
9428 HUNSPELL_LIBS=-lhunspell
9431 libo_MINGW_CHECK_DLL([libhunspell-1.3])
9432 HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9433 FilterLibs "${HUNSPELL_LIBS}"
9434 HUNSPELL_LIBS="${filteredlibs}"
9436 AC_MSG_RESULT([internal])
9438 HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
9439 if test "$COM" = "MSC"; then
9440 HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
9442 HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.3"
9444 BUILD_TYPE="$BUILD_TYPE HUNSPELL"
9446 AC_SUBST(SYSTEM_HUNSPELL)
9447 AC_SUBST(HUNSPELL_CFLAGS)
9448 AC_SUBST(HUNSPELL_LIBS)
9450 dnl ===================================================================
9451 dnl Checking for altlinuxhyph
9452 dnl ===================================================================
9453 AC_MSG_CHECKING([which altlinuxhyph to use])
9454 if test "$with_system_altlinuxhyph" = "yes"; then
9455 AC_MSG_RESULT([external])
9457 AC_CHECK_HEADER(hyphen.h, [],
9458 [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
9459 AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
9460 [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
9461 [#include <hyphen.h>])
9462 AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
9463 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9464 if test -z "$HYPHEN_LIB"; then
9465 AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
9466 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9468 if test -z "$HYPHEN_LIB"; then
9469 AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
9470 [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
9472 libo_MINGW_CHECK_DLL([libhyphen])
9474 AC_MSG_RESULT([internal])
9476 BUILD_TYPE="$BUILD_TYPE HYPHEN"
9477 if test "$COM" = "MSC"; then
9478 HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
9480 HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
9483 AC_SUBST(SYSTEM_HYPH)
9484 AC_SUBST(HYPHEN_LIB)
9486 dnl ===================================================================
9487 dnl Checking for mythes
9488 dnl ===================================================================
9489 AC_MSG_CHECKING([which mythes to use])
9490 if test "$with_system_mythes" = "yes"; then
9491 AC_MSG_RESULT([external])
9494 PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
9495 if test "$MYTHES_PKGCONFIG" = "no"; then
9496 AC_CHECK_HEADER(mythes.hxx, [],
9497 [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
9498 AC_CHECK_LIB([mythes-1.2], [main], [:],
9499 [ MYTHES_FOUND=no], [])
9500 if test "$MYTHES_FOUND" = "no"; then
9501 AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
9502 [ MYTHES_FOUND=no], [])
9504 if test "$MYTHES_FOUND" = "no"; then
9505 AC_MSG_ERROR([mythes library not found!.])
9509 libo_MINGW_CHECK_DLL([libmythes-1.2])
9510 MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9511 FilterLibs "${MYTHES_LIBS}"
9512 MYTHES_LIBS="${filteredlibs}"
9514 AC_MSG_RESULT([internal])
9516 BUILD_TYPE="$BUILD_TYPE MYTHES"
9517 if test "$COM" = "MSC"; then
9518 MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
9520 MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
9523 AC_SUBST(SYSTEM_MYTHES)
9524 AC_SUBST(MYTHES_CFLAGS)
9525 AC_SUBST(MYTHES_LIBS)
9527 dnl ===================================================================
9528 dnl How should we build the linear programming solver ?
9529 dnl ===================================================================
9532 AC_MSG_CHECKING([whether to build with CoinMP])
9533 if test "$enable_coinmp" != "no"; then
9535 AC_MSG_RESULT([yes])
9536 if test "$with_system_coinmp" = "yes"; then
9538 PKG_CHECK_MODULES( COINMP, coinmp )
9539 FilterLibs "${COINMP_LIBS}"
9540 COINMP_LIBS="${filteredlibs}"
9542 BUILD_TYPE="$BUILD_TYPE COINMP"
9547 AC_SUBST(ENABLE_COINMP)
9548 AC_SUBST(SYSTEM_COINMP)
9549 AC_SUBST(COINMP_CFLAGS)
9550 AC_SUBST(COINMP_LIBS)
9553 AC_MSG_CHECKING([whether to build with lpsolve])
9554 if test "$enable_lpsolve" != "no"; then
9556 AC_MSG_RESULT([yes])
9560 AC_SUBST(ENABLE_LPSOLVE)
9562 if test "$ENABLE_LPSOLVE" = TRUE; then
9563 AC_MSG_CHECKING([which lpsolve to use])
9564 if test "$with_system_lpsolve" = "yes"; then
9565 AC_MSG_RESULT([external])
9567 AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
9568 [ AC_MSG_ERROR(lpsolve headers not found.)], [])
9570 # some systems need this. Like Ubuntu....
9571 AC_CHECK_LIB(m, floor)
9572 AC_CHECK_LIB(dl, dlopen)
9573 AC_CHECK_LIB([lpsolve55], [make_lp], [:],
9574 [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
9576 libo_MINGW_CHECK_DLL([lpsolve55])
9578 AC_MSG_RESULT([internal])
9580 BUILD_TYPE="$BUILD_TYPE LPSOLVE"
9583 AC_SUBST(SYSTEM_LPSOLVE)
9585 dnl ===================================================================
9586 dnl Checking for libexttextcat
9587 dnl ===================================================================
9588 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
9589 if test "$with_system_libexttextcat" = "yes"; then
9590 SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
9592 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
9594 dnl ***************************************
9595 dnl testing libc version for Linux...
9596 dnl ***************************************
9597 if test "$_os" = "Linux"; then
9598 AC_MSG_CHECKING([whether libc is >= 2.1.1])
9599 exec 6>/dev/null # no output
9600 AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
9601 exec 6>&1 # output on again
9602 if test "$HAVE_LIBC"; then
9603 AC_MSG_RESULT([yes])
9605 AC_MSG_ERROR([no, upgrade libc])
9609 dnl =========================================
9610 dnl Check for the Windows SDK.
9611 dnl =========================================
9612 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
9613 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
9614 if test "$_os" = "WINNT"; then
9615 AC_MSG_CHECKING([for Windows SDK])
9616 if test "$build_os" = "cygwin"; then
9618 WINDOWS_SDK_HOME=$winsdktest
9620 # normalize if found
9621 if test -n "$WINDOWS_SDK_HOME"; then
9622 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
9623 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
9626 WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
9629 if test -n "$WINDOWS_SDK_HOME"; then
9630 # Remove a possible trailing backslash
9631 WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
9633 if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
9634 -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
9635 -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
9636 have_windows_sdk_headers=yes
9637 elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
9638 -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
9639 -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
9640 have_windows_sdk_headers=yes
9641 elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
9642 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
9643 -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
9644 have_windows_sdk_headers=yes
9646 have_windows_sdk_headers=no
9649 if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
9650 have_windows_sdk_libs=yes
9651 elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
9652 have_windows_sdk_libs=yes
9654 have_windows_sdk_libs=no
9657 if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
9658 AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
9659 the Windows SDK are installed.])
9662 if test ! -f "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
9663 -o ! -f "$WINDOWS_SDK_HOME/bin/msidb.exe" \
9664 -o ! -f "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
9665 -o ! -f "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
9666 elif test ! -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
9667 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
9668 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
9669 -o ! -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
9671 AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
9675 if test -z "$WINDOWS_SDK_HOME"; then
9676 AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
9677 elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
9678 WINDOWS_SDK_VERSION=70
9679 AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
9680 elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
9681 WINDOWS_SDK_VERSION=80
9682 AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
9683 dnl compatibility warning if not explicitly choosing the 80 SDK:
9684 if test -z "$with_windows_sdk"; then
9685 AC_MSG_WARN([If a build should run on Windows XP,])
9686 AC_MSG_WARN([use --with-windows-sdk=7.1A])
9687 add_warning "If a build should run on Windows XP,"
9688 add_warning "use --with-windows-sdk=7.1A"
9690 elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
9691 WINDOWS_SDK_VERSION=81
9692 AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
9693 elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
9694 WINDOWS_SDK_VERSION=10
9695 AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
9697 AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
9699 PathFormat "$WINDOWS_SDK_HOME"
9700 WINDOWS_SDK_HOME="$formatted_path"
9701 if test "$build_os" = "cygwin"; then
9702 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
9703 if test -d "$WINDOWS_SDK_HOME/include/um"; then
9704 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
9705 elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
9706 SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
9710 dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
9711 dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
9712 dnl but not in v8.0), so allow this to be overridden with a
9713 dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
9714 dnl and configuration error if no WiLangId.vbs is found would arguably be
9715 dnl better, but I do not know under which conditions exactly it is needed by
9717 if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
9718 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
9719 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9720 WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
9722 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9723 WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
9725 if ! test -e "$WINDOWS_SDK_WILANGID" ; then
9726 AC_MSG_WARN([WiLangId.vbs not found - building translated packages will fail])
9727 add_warning "WiLangId.vbs not found - building translated packages will fail"
9731 AC_SUBST(WINDOWS_SDK_HOME)
9732 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
9733 AC_SUBST(WINDOWS_SDK_VERSION)
9734 AC_SUBST(WINDOWS_SDK_WILANGID)
9736 dnl =========================================
9737 dnl Check for uuidgen
9738 dnl =========================================
9739 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9740 if test "$WITH_MINGW" = "yes"; then
9741 AC_PATH_PROG([UUIDGEN], [uuid])
9742 if test -z "$UUIDGEN"; then
9743 AC_MSG_WARN([uuid is needed for building installation sets])
9746 # presence is already tested above in the WINDOWS_SDK_HOME check
9751 AC_PATH_PROG([UUIDGEN], [uuidgen])
9752 if test -z "$UUIDGEN"; then
9753 AC_MSG_WARN([uuid is needed for building installation sets])
9757 dnl ***************************************
9758 dnl Checking for bison and flex
9759 dnl ***************************************
9760 AC_PATH_PROG(BISON, bison)
9761 if test -z "$BISON"; then
9762 AC_MSG_ERROR([no bison found in \$PATH, install it])
9764 AC_MSG_CHECKING([the bison version])
9765 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9766 _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9767 # Accept newer than 2.0
9768 if test "$_bison_longver" -lt 2000; then
9769 AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
9773 AC_PATH_PROG(FLEX, flex)
9774 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9775 FLEX=`cygpath -m $FLEX`
9777 if test -z "$FLEX"; then
9778 AC_MSG_ERROR([no flex found in \$PATH, install it])
9780 AC_MSG_CHECKING([the flex version])
9781 _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
9782 if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
9783 AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
9787 dnl ***************************************
9788 dnl Checking for patch
9789 dnl ***************************************
9790 AC_PATH_PROG(PATCH, patch)
9791 if test -z "$PATCH"; then
9792 AC_MSG_ERROR(["patch" not found in \$PATH, install it])
9795 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9796 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9797 if test -z "$with_gnu_patch"; then
9800 if test -x "$with_gnu_patch"; then
9801 GNUPATCH=$with_gnu_patch
9803 AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9807 AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9808 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9809 AC_MSG_RESULT([yes])
9811 AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9817 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9818 GNUPATCH=`cygpath -m $GNUPATCH`
9821 dnl We also need to check for --with-gnu-cp
9823 if test -z "$with_gnu_cp"; then
9824 # check the place where the good stuff is hidden on Solaris...
9825 if test -x /usr/gnu/bin/cp; then
9826 GNUCP=/usr/gnu/bin/cp
9828 AC_PATH_PROGS(GNUCP, gnucp cp)
9830 if test -z $GNUCP; then
9831 AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9834 if test -x "$with_gnu_cp"; then
9837 AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9841 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
9842 GNUCP=`cygpath -m $GNUCP`
9845 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9846 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9847 AC_MSG_RESULT([yes])
9848 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9849 AC_MSG_RESULT([yes])
9852 darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9855 AC_MSG_RESULT([no gnucp found - using the system's cp command])
9858 AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9867 dnl ***************************************
9868 dnl testing assembler path
9869 dnl ***************************************
9871 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
9872 if test "$BITNESS_OVERRIDE" = ""; then
9876 if test "$vcexpress" = "Express"; then
9878 assembler_bin=bin/x86_amd64
9881 assembler_bin=bin/amd64
9885 AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
9886 if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
9887 ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
9888 AC_MSG_RESULT([found])
9889 ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
9891 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9894 PathFormat "$ASM_HOME"
9895 ASM_HOME="$formatted_path"
9902 dnl ===================================================================
9903 dnl We need zip and unzip
9904 dnl ===================================================================
9905 AC_PATH_PROG(ZIP, zip)
9906 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9907 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9908 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],,)
9911 AC_PATH_PROG(UNZIP, unzip)
9912 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9914 dnl ===================================================================
9915 dnl Zip must be a specific type for different build types.
9916 dnl ===================================================================
9917 if test $build_os = cygwin; then
9918 if test -n "`$ZIP -h | $GREP -i WinNT`"; then
9919 AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
9923 dnl ===================================================================
9924 dnl We need touch with -h option support.
9925 dnl ===================================================================
9926 AC_PATH_PROG(TOUCH, touch)
9927 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
9929 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
9930 AC_MSG_ERROR([touch version with -h option support is required to build, please install it and make sure it is the one found first in PATH],,)
9933 dnl ===================================================================
9934 dnl Set vcl option: coordinate device in double or sal_Int32
9935 dnl ===================================================================
9937 AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
9938 if test "$_os" = "Darwin" -o $_os = iOS ; then
9939 AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
9940 AC_MSG_RESULT([double])
9942 AC_MSG_RESULT([sal_Int32])
9945 dnl ===================================================================
9946 dnl Test which vclplugs have to be built.
9947 dnl ===================================================================
9949 if test "$USING_X11" != TRUE; then
9956 if test "x$enable_gtk3" = "xyes"; then
9957 if test "$with_system_cairo" = no; then
9958 AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
9960 : ${with_system_cairo:=yes}
9961 PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.8 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
9962 if test "x$ENABLE_GTK3" = "xTRUE"; then
9964 dnl Avoid installed by unpackaged files for now.
9965 if test -z "$PKGFORMAT"; then
9966 GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
9969 AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
9971 GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
9972 FilterLibs "${GTK3_LIBS}"
9973 GTK3_LIBS="${filteredlibs}"
9976 AC_SUBST(GTK3_CFLAGS)
9977 AC_SUBST(ENABLE_GTK3)
9980 if test "x$enable_gtk" = "xyes"; then
9981 if test "$with_system_cairo" = no; then
9982 AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
9984 : ${with_system_cairo:=yes}
9986 AC_DEFINE(ENABLE_GTK)
9989 AC_SUBST(ENABLE_GTK)
9992 if test "x$enable_tde" = "xyes"; then
9994 AC_DEFINE(ENABLE_TDE)
9997 AC_SUBST(ENABLE_TDE)
10000 if test "x$enable_kde4" = "xyes"; then
10002 AC_DEFINE(ENABLE_KDE4)
10005 AC_SUBST(ENABLE_KDE4)
10008 if test "x$with_x" = "xno" -o "$CXX" = "emcc"; then
10009 ENABLE_HEADLESS="TRUE"
10010 SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
10013 AC_SUBST(ENABLE_HEADLESS)
10015 build_vcl_plugins="$R"
10016 if test -z "$build_vcl_plugins"; then
10017 build_vcl_plugins="none"
10019 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10021 dnl ===================================================================
10022 dnl check for dbus support
10023 dnl ===================================================================
10028 if test "$enable_dbus" = "no"; then
10032 AC_MSG_CHECKING([whether to enable DBUS support])
10033 if test "$test_dbus" = "yes"; then
10035 AC_MSG_RESULT([yes])
10036 PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
10037 DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10038 FilterLibs "${DBUS_LIBS}"
10039 DBUS_LIBS="${filteredlibs}"
10041 AC_MSG_RESULT([no])
10044 AC_SUBST(ENABLE_DBUS)
10045 AC_SUBST(DBUS_CFLAGS)
10046 AC_SUBST(DBUS_LIBS)
10048 AC_MSG_CHECKING([whether to enable font install via packagekit])
10049 if test "$ENABLE_DBUS" = "TRUE"; then
10050 if test -n "$enable_packagekit" -a "$enable_packagekit" != "no"; then
10051 ENABLE_PACKAGEKIT=TRUE
10052 AC_MSG_RESULT([yes])
10055 AC_MSG_RESULT([no])
10058 AC_MSG_RESULT([no, dbus disabled.])
10060 AC_SUBST(ENABLE_PACKAGEKIT)
10062 AC_MSG_CHECKING([whether to enable Impress remote control])
10063 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10064 AC_MSG_RESULT([yes])
10065 ENABLE_SDREMOTE=TRUE
10066 AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10068 # If not explicitly enabled or disabled, default
10069 if test -z "$enable_sdremote_bluetooth"; then
10072 # Default to yes for these
10073 enable_sdremote_bluetooth=yes
10077 enable_sdremote_bluetooth=no
10081 # $enable_sdremote_bluetooth is guaranteed non-empty now
10083 if test "$enable_sdremote_bluetooth" != "no"; then
10084 if test "$OS" = "LINUX"; then
10085 if test "$ENABLE_DBUS" = "TRUE"; then
10086 AC_MSG_RESULT([yes])
10087 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10088 dnl ===================================================================
10089 dnl Check for system bluez
10090 dnl ===================================================================
10091 AC_MSG_CHECKING([which Bluetooth header to use])
10092 if test "$with_system_bluez" = "yes"; then
10093 AC_MSG_RESULT([external])
10094 AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10095 [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10098 AC_MSG_RESULT([internal])
10102 AC_MSG_RESULT([no, dbus disabled])
10103 ENABLE_SDREMOTE_BLUETOOTH=
10107 AC_MSG_RESULT([yes])
10108 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10112 AC_MSG_RESULT([no])
10113 ENABLE_SDREMOTE_BLUETOOTH=
10119 AC_MSG_RESULT([no])
10121 AC_SUBST(ENABLE_SDREMOTE)
10122 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10123 AC_SUBST(SYSTEM_BLUEZ)
10125 dnl ===================================================================
10126 dnl Check whether the gtk 2.0 libraries are available.
10127 dnl ===================================================================
10131 ENABLE_SYSTRAY_GTK=""
10132 if test "$test_gtk" = "yes"; then
10134 if test "$ENABLE_GTK" = "TRUE"; then
10135 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0 gdk-pixbuf-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
10136 GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10137 FilterLibs "${GTK_LIBS}"
10138 GTK_LIBS="${filteredlibs}"
10139 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]))
10140 BUILD_TYPE="$BUILD_TYPE GTK"
10141 GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10142 FilterLibs "${GTHREAD_LIBS}"
10143 GTHREAD_LIBS="${filteredlibs}"
10145 if test "x$enable_systray" = "xyes"; then
10146 ENABLE_SYSTRAY_GTK="TRUE"
10149 AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10150 PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10151 [ENABLE_GTK_PRINT="TRUE"],
10152 [ENABLE_GTK_PRINT=""])
10153 GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10154 FilterLibs "${GTK_PRINT_LIBS}"
10155 GTK_PRINT_LIBS="${filteredlibs}"
10157 AC_MSG_CHECKING([whether to enable GIO support])
10158 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10159 dnl Need at least 2.26 for the dbus support.
10160 PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10161 [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10162 if test "$ENABLE_GIO" = "TRUE"; then
10163 AC_DEFINE(ENABLE_GIO)
10164 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10165 FilterLibs "${GIO_LIBS}"
10166 GIO_LIBS="${filteredlibs}"
10169 AC_MSG_RESULT([no])
10173 AC_SUBST(ENABLE_GIO)
10174 AC_SUBST(GIO_CFLAGS)
10176 AC_SUBST(ENABLE_SYSTRAY_GTK)
10177 AC_SUBST(GTK_CFLAGS)
10179 AC_SUBST(GTHREAD_CFLAGS)
10180 AC_SUBST(GTHREAD_LIBS)
10181 AC_SUBST([ENABLE_GTK_PRINT])
10182 AC_SUBST([GTK_PRINT_CFLAGS])
10183 AC_SUBST([GTK_PRINT_LIBS])
10186 dnl ===================================================================
10187 dnl Check whether the Telepathy libraries are available.
10188 dnl ===================================================================
10190 ENABLE_TELEPATHY=""
10191 TELEPATHY_CFLAGS=""
10194 AC_MSG_CHECKING([whether to enable Telepathy support])
10195 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
10196 ENABLE_TELEPATHY="TRUE"
10197 AC_DEFINE(ENABLE_TELEPATHY)
10198 AC_MSG_RESULT([yes])
10199 PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 gtk+-2.0 >= 2.18.0 )
10200 TELEPATHY_CFLAGS=$(printf '%s' "$TELEPATHY_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10201 FilterLibs "${TELEPATHY_LIBS}"
10202 TELEPATHY_LIBS="${filteredlibs}"
10204 AC_MSG_RESULT([no])
10207 AC_SUBST(ENABLE_TELEPATHY)
10208 AC_SUBST(TELEPATHY_CFLAGS)
10209 AC_SUBST(TELEPATHY_LIBS)
10212 dnl ===================================================================
10214 SPLIT_APP_MODULES=""
10215 if test "$enable_split_app_modules" = "yes"; then
10216 SPLIT_APP_MODULES="TRUE"
10218 AC_SUBST(SPLIT_APP_MODULES)
10220 SPLIT_OPT_FEATURES=""
10221 if test "$enable_split_opt_features" = "yes"; then
10222 SPLIT_OPT_FEATURES="TRUE"
10224 AC_SUBST(SPLIT_OPT_FEATURES)
10226 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10227 if test "$enable_cairo_canvas" = yes; then
10228 AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10230 enable_cairo_canvas=no
10231 elif test -z "$enable_cairo_canvas"; then
10232 enable_cairo_canvas=yes
10235 ENABLE_CAIRO_CANVAS=""
10236 if test "$enable_cairo_canvas" = "yes"; then
10238 ENABLE_CAIRO_CANVAS="TRUE"
10239 AC_DEFINE(ENABLE_CAIRO_CANVAS)
10241 AC_SUBST(ENABLE_CAIRO_CANVAS)
10243 dnl ===================================================================
10244 dnl Check whether the GStreamer libraries are available.
10245 dnl It's possible to build avmedia with both GStreamer backends!
10246 dnl ===================================================================
10248 ENABLE_GSTREAMER_1_0=""
10250 if test "$build_gstreamer_1_0" = "yes"; then
10252 AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10253 if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10254 ENABLE_GSTREAMER_1_0="TRUE"
10255 AC_MSG_RESULT([yes])
10256 PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10257 GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10258 FilterLibs "${GSTREAMER_1_0_LIBS}"
10259 GSTREAMER_1_0_LIBS="${filteredlibs}"
10261 AC_MSG_RESULT([no])
10264 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10265 AC_SUBST(GSTREAMER_1_0_LIBS)
10266 AC_SUBST(ENABLE_GSTREAMER_1_0)
10269 ENABLE_GSTREAMER_0_10=""
10270 if test "$build_gstreamer_0_10" = "yes"; then
10272 AC_MSG_CHECKING([whether to enable the GStreamer 0.10 avmedia backend])
10273 if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10274 ENABLE_GSTREAMER_0_10="TRUE"
10275 AC_MSG_RESULT([yes])
10276 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10],, [
10277 PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10] )
10279 GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10280 FilterLibs "${GSTREAMER_0_10_LIBS}"
10281 GSTREAMER_0_10_LIBS="${filteredlibs}"
10283 AC_MSG_RESULT([no])
10287 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10288 AC_SUBST(GSTREAMER_0_10_LIBS)
10289 AC_SUBST(ENABLE_GSTREAMER_0_10)
10291 dnl ===================================================================
10292 dnl Check whether to build the VLC avmedia backend
10293 dnl ===================================================================
10297 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10298 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10300 AC_MSG_RESULT([yes])
10302 AC_MSG_RESULT([no])
10304 AC_SUBST(ENABLE_VLC)
10306 # this is for opengl transitions in impress slideshow
10308 if test $_os = iOS -o $_os = Android; then
10310 elif test "$_os" = "Darwin"; then
10311 # We use frameworks on Mac OS X, no need for detail checks
10313 ENABLE_OPENGL_CANVAS=TRUE
10314 elif test $_os = WINNT; then
10316 ENABLE_OPENGL_CANVAS=TRUE
10318 if test "$USING_X11" = TRUE; then
10321 ENABLE_OPENGL_CANVAS=TRUE
10324 AC_SUBST(ENABLE_OPENGL)
10325 AC_SUBST(ENABLE_OPENGL_CANVAS)
10327 dnl =================================================
10328 dnl Check whether to build with OpenCL support.
10329 dnl =================================================
10331 if test $_os != iOS -a $_os != Android; then
10332 # OPENCL in BUILD_TYPE tells that OpenCL is potentially available on the platform (optional at run-time,
10333 # used through clew).
10334 BUILD_TYPE="$BUILD_TYPE OPENCL"
10335 AC_DEFINE(HAVE_FEATURE_OPENCL)
10338 dnl ===================================================================
10339 dnl Check whether to enable glTF support
10340 dnl ===================================================================
10341 AC_MSG_CHECKING([whether to enable glTF support])
10343 if test "x$enable_gltf" != "xno" -a $_os != iOS -a $_os != Android; then
10345 AC_MSG_RESULT([yes])
10346 AC_DEFINE(HAVE_FEATURE_GLTF,1)
10347 if test "$with_system_libgltf" = "yes"; then
10348 SYSTEM_LIBGLTF=TRUE
10349 PKG_CHECK_MODULES( LIBGLTF, [libgltf-0.0 >= 0.0.1] )
10350 FilterLibs "${LIBGLTF_LIBS}"
10351 LIBGLTF_LIBS="${filteredlibs}"
10353 BUILD_TYPE="$BUILD_TYPE LIBGLTF"
10356 AC_MSG_RESULT([no])
10358 AC_SUBST(ENABLE_GLTF)
10359 AC_SUBST(SYSTEM_LIBGLTF)
10360 AC_SUBST(LIBGLTF_CFLAGS)
10361 AC_SUBST(LIBGLTF_LIBS)
10363 dnl ===================================================================
10364 dnl Check whether to enable COLLADA support
10365 dnl ===================================================================
10366 AC_MSG_CHECKING([whether to enable COLLADA support])
10368 if test "$enable_collada" != "no" -a "$ENABLE_GLTF" = "TRUE"; then
10369 AC_MSG_RESULT([yes])
10370 ENABLE_COLLADA=TRUE
10371 AC_DEFINE(HAVE_FEATURE_COLLADA,1)
10373 AC_MSG_CHECKING([which OPENCOLLADA to use])
10374 if test "$with_system_opencollada" = "yes"; then
10375 AC_MSG_RESULT([external])
10376 SYSTEM_OPENCOLLADA=TRUE
10377 AS_IF([test -n "$OPENCOLLADA_CFLAGS"],[],[AC_MSG_ERROR([export OPENCOLLADA_CFLAGS])])
10378 AS_IF([test -n "$OPENCOLLADA_LIBS"],[],[AC_MSG_ERROR([export OPENCOLLADA_LIBS])])
10379 AC_LANG_PUSH([C++])
10380 save_CXXFLAGS=$CXXFLAGS
10381 save_CPPFLAGS=$CPPFLAGS
10382 CXXFLAGS="$CXXFLAGS $OPENCOLLADA_CFLAGS"
10383 CPPFLAGS="$CPPFLAGS $OPENCOLLADA_CFLAGS"
10387 COLLADASaxFWLLoader.h \
10388 GeneratedSaxParser.h,
10390 [AC_MSG_ERROR([openCOLLADA headers not found. Install openCOLLADA])],
10392 CXXFLAGS=$save_CXXFLAGS
10393 CPPFLAGS=$save_CPPFLAGS
10395 OPENCOLLADA_CFLAGS=$(printf '%s' "$OPENCOLLADA_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10396 FilterLibs "${OPENCOLLADA_LIBS}"
10397 OPENCOLLADA_LIBS="${filteredlibs}"
10399 AC_MSG_RESULT([internal])
10400 BUILD_TYPE="$BUILD_TYPE OPENCOLLADA"
10403 AC_MSG_CHECKING([which collada2gltf to use])
10404 if test "$with_system_collada2gltf" = "yes"; then
10405 if test "$with_system_opencollada" = "no"; then
10406 AC_MSG_ERROR([the combination of system collada2gltf and internal openCOLLADA is not allowed])
10408 AC_MSG_RESULT([external])
10409 SYSTEM_COLLADA2GLTF=TRUE
10410 AS_IF([test -n "$COLLADA2GLTF_CFLAGS"],[],[AC_MSG_ERROR([export COLLADA2GLTF_CFLAGS])])
10411 AS_IF([test -n "$COLLADA2GLTF_LIBS"],[],[AC_MSG_ERROR([export COLLADA2GLTF_LIBS])])
10412 AC_LANG_PUSH([C++])
10413 save_CXXFLAGS=$CXXFLAGS
10414 save_CPPFLAGS=$CPPFLAGS
10415 CXXFLAGS="$CXXFLAGS $COLLADA2GLTF_CFLAGS $OPENCOLLADA_CFLAGS $CXXFLAGS_CXX11"
10416 CPPFLAGS="$CPPFLAGS $COLLADA2GLTF_CFLAGS $OPENCOLLADA_CFLAGS $CXXFLAGS_CXX11"
10421 [AC_MSG_ERROR([collada2gltf headers not found. Install collada2gltf])],
10423 CXXFLAGS=$save_CXXFLAGS
10424 CPPFLAGS=$save_CPPFLAGS
10426 COLLADA2GLTF_CFLAGS=$(printf '%s' "$COLLADA2GLTF_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10427 FilterLibs "${COLLADA2GLTF_LIBS}"
10428 COLLADA2GLTF_LIBS="${filteredlibs}"
10430 AC_MSG_RESULT([internal])
10431 BUILD_TYPE="$BUILD_TYPE COLLADA2GLTF"
10434 AC_MSG_RESULT([no])
10436 AC_SUBST(ENABLE_COLLADA)
10437 AC_SUBST([OPENCOLLADA_CFLAGS])
10438 AC_SUBST([OPENCOLLADA_LIBS])
10439 AC_SUBST([SYSTEM_OPENCOLLADA])
10441 AC_SUBST([COLLADA2GLTF_CFLAGS])
10442 AC_SUBST([COLLADA2GLTF_LIBS])
10443 AC_SUBST([SYSTEM_COLLADA2GLTF])
10445 if test "$enable_dconf" != no; then
10446 PKG_CHECK_MODULES([DCONF], [dconf], [], [
10447 if test "$enable_dconf" = yes; then
10448 AC_MSG_ERROR([dconf not found])
10453 AC_MSG_CHECKING([whether to enable dconf])
10454 if test "$enable_dconf" = no; then
10458 AC_MSG_RESULT([no])
10461 AC_DEFINE(ENABLE_DCONF)
10462 AC_MSG_RESULT([yes])
10464 AC_SUBST([DCONF_CFLAGS])
10465 AC_SUBST([DCONF_LIBS])
10466 AC_SUBST([ENABLE_DCONF])
10469 AC_MSG_CHECKING([whether to build the PDF import feature])
10471 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10472 AC_MSG_RESULT([yes])
10473 ENABLE_PDFIMPORT=TRUE
10475 dnl ===================================================================
10476 dnl Check for system poppler
10477 dnl ===================================================================
10478 AC_MSG_CHECKING([which PDF import backend to use])
10479 if test "$with_system_poppler" = "yes"; then
10480 AC_MSG_RESULT([external])
10481 SYSTEM_POPPLER=TRUE
10482 PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10483 AC_LANG_PUSH([C++])
10484 save_CXXFLAGS=$CXXFLAGS
10485 save_CPPFLAGS=$CPPFLAGS
10486 CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10487 CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10488 AC_CHECK_HEADER([cpp/poppler-version.h],
10489 [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10491 CXXFLAGS=$save_CXXFLAGS
10492 CPPFLAGS=$save_CPPFLAGS
10494 libo_MINGW_CHECK_DLL([libpoppler])
10495 POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10497 FilterLibs "${POPPLER_LIBS}"
10498 POPPLER_LIBS="${filteredlibs}"
10500 AC_MSG_RESULT([internal])
10502 BUILD_TYPE="$BUILD_TYPE POPPLER"
10503 AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10505 AC_DEFINE([ENABLE_PDFIMPORT],1)
10507 AC_MSG_RESULT([no])
10509 AC_SUBST(ENABLE_PDFIMPORT)
10510 AC_SUBST(SYSTEM_POPPLER)
10511 AC_SUBST(POPPLER_CFLAGS)
10512 AC_SUBST(POPPLER_LIBS)
10514 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10515 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10516 AC_MSG_RESULT([yes])
10517 ENABLE_MEDIAWIKI=TRUE
10518 BUILD_TYPE="$BUILD_TYPE XSLTML"
10519 if test "x$with_java" = "xno"; then
10520 AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10523 AC_MSG_RESULT([no])
10525 SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10527 AC_SUBST(ENABLE_MEDIAWIKI)
10529 AC_MSG_CHECKING([whether to build the Report Builder])
10530 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10531 AC_MSG_RESULT([yes])
10532 ENABLE_REPORTBUILDER=TRUE
10533 AC_MSG_CHECKING([which jfreereport libs to use])
10534 if test "$with_system_jfreereport" = "yes"; then
10535 SYSTEM_JFREEREPORT=TRUE
10536 AC_MSG_RESULT([external])
10537 if test -z $SAC_JAR; then
10538 SAC_JAR=/usr/share/java/sac.jar
10540 if ! test -f $SAC_JAR; then
10541 AC_MSG_ERROR(sac.jar not found.)
10544 if test -z $LIBXML_JAR; then
10545 if test -f /usr/share/java/libxml-1.0.0.jar; then
10546 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
10547 elif test -f /usr/share/java/libxml.jar; then
10548 LIBXML_JAR=/usr/share/java/libxml.jar
10550 AC_MSG_ERROR(libxml.jar replacement not found.)
10552 elif ! test -f $LIBXML_JAR; then
10553 AC_MSG_ERROR(libxml.jar not found.)
10556 if test -z $FLUTE_JAR; then
10557 if test -f/usr/share/java/flute-1.3.0.jar; then
10558 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
10559 elif test -f /usr/share/java/flute.jar; then
10560 FLUTE_JAR=/usr/share/java/flute.jar
10562 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
10564 elif ! test -f $FLUTE_JAR; then
10565 AC_MSG_ERROR(flute-1.3.0.jar not found.)
10568 if test -z $JFREEREPORT_JAR; then
10569 if test -f /usr/share/java/flow-engine-0.9.2.jar; then
10570 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
10571 elif test -f /usr/share/java/flow-engine.jar; then
10572 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
10574 AC_MSG_ERROR(jfreereport.jar replacement not found.)
10576 elif ! test -f $JFREEREPORT_JAR; then
10577 AC_MSG_ERROR(jfreereport.jar not found.)
10580 if test -z $LIBLAYOUT_JAR; then
10581 if test -f /usr/share/java/liblayout-0.2.9.jar; then
10582 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
10583 elif test -f /usr/share/java/liblayout.jar; then
10584 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
10586 AC_MSG_ERROR(liblayout.jar replacement not found.)
10588 elif ! test -f $LIBLAYOUT_JAR; then
10589 AC_MSG_ERROR(liblayout.jar not found.)
10592 if test -z $LIBLOADER_JAR; then
10593 if test -f /usr/share/java/libloader-1.0.0.jar; then
10594 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
10595 elif test -f /usr/share/java/libloader.jar; then
10596 LIBLOADER_JAR=/usr/share/java/libloader.jar
10598 AC_MSG_ERROR(libloader.jar replacement not found.)
10600 elif ! test -f $LIBLOADER_JAR; then
10601 AC_MSG_ERROR(libloader.jar not found.)
10604 if test -z $LIBFORMULA_JAR; then
10605 if test -f /usr/share/java/libformula-0.2.0.jar; then
10606 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
10607 elif test -f /usr/share/java/libformula.jar; then
10608 LIBFORMULA_JAR=/usr/share/java/libformula.jar
10610 AC_MSG_ERROR(libformula.jar replacement not found.)
10612 elif ! test -f $LIBFORMULA_JAR; then
10613 AC_MSG_ERROR(libformula.jar not found.)
10616 if test -z $LIBREPOSITORY_JAR; then
10617 if test -f /usr/share/java/librepository-1.0.0.jar; then
10618 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
10619 elif test -f /usr/share/java/librepository.jar; then
10620 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
10622 AC_MSG_ERROR(librepository.jar replacement not found.)
10624 elif ! test -f $LIBREPOSITORY_JAR; then
10625 AC_MSG_ERROR(librepository.jar not found.)
10628 if test -z $LIBFONTS_JAR; then
10629 if test -f /usr/share/java/libfonts-1.0.0.jar; then
10630 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
10631 elif test -f /usr/share/java/libfonts.jar; then
10632 LIBFONTS_JAR=/usr/share/java/libfonts.jar
10634 AC_MSG_ERROR(libfonts.jar replacement not found.)
10636 elif ! test -f $LIBFONTS_JAR; then
10637 AC_MSG_ERROR(libfonts.jar not found.)
10640 if test -z $LIBSERIALIZER_JAR; then
10641 if test -f /usr/share/java/libserializer-1.0.0.jar; then
10642 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
10643 elif test -f /usr/share/java/libserializer.jar; then
10644 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
10646 AC_MSG_ERROR(libserializer.jar replacement not found.)
10648 elif ! test -f $LIBSERIALIZER_JAR; then
10649 AC_MSG_ERROR(libserializer.jar not found.)
10652 if test -z $LIBBASE_JAR; then
10653 if test -f /usr/share/java/libbase-1.0.0.jar; then
10654 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
10655 elif test -f /usr/share/java/libbase.jar; then
10656 LIBBASE_JAR=/usr/share/java/libbase.jar
10658 AC_MSG_ERROR(libbase.jar replacement not found.)
10660 elif ! test -f $LIBBASE_JAR; then
10661 AC_MSG_ERROR(libbase.jar not found.)
10665 AC_MSG_RESULT([internal])
10666 SYSTEM_JFREEREPORT=
10667 BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10670 AC_MSG_RESULT([no])
10671 ENABLE_REPORTBUILDER=
10672 SYSTEM_JFREEREPORT=
10674 AC_SUBST(ENABLE_REPORTBUILDER)
10675 AC_SUBST(SYSTEM_JFREEREPORT)
10677 AC_SUBST(LIBXML_JAR)
10678 AC_SUBST(FLUTE_JAR)
10679 AC_SUBST(JFREEREPORT_JAR)
10680 AC_SUBST(LIBBASE_JAR)
10681 AC_SUBST(LIBLAYOUT_JAR)
10682 AC_SUBST(LIBLOADER_JAR)
10683 AC_SUBST(LIBFORMULA_JAR)
10684 AC_SUBST(LIBREPOSITORY_JAR)
10685 AC_SUBST(LIBFONTS_JAR)
10686 AC_SUBST(LIBSERIALIZER_JAR)
10688 # this has to be here because both the Wiki Publisher and the SRB use
10690 COMMONS_LOGGING_VERSION=1.2
10691 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
10692 AC_MSG_CHECKING([which Apache commons-* libs to use])
10693 if test "$with_system_apache_commons" = "yes"; then
10694 SYSTEM_APACHE_COMMONS=TRUE
10695 AC_MSG_RESULT([external])
10696 if test -z $COMMONS_LOGGING_JAR; then
10697 if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
10698 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
10699 elif test -f /usr/share/java/commons-logging.jar; then
10700 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
10702 AC_MSG_ERROR(commons-logging.jar replacement not found.)
10704 elif ! test -f $COMMONS_LOGGING_JAR; then
10705 AC_MSG_ERROR(commons-logging.jar not found.)
10708 AC_MSG_RESULT([internal])
10709 SYSTEM_APACHE_COMMONS=
10710 BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
10713 AC_SUBST(SYSTEM_APACHE_COMMONS)
10714 AC_SUBST(COMMONS_LOGGING_JAR)
10715 AC_SUBST(COMMONS_LOGGING_VERSION)
10717 # scripting provider for BeanShell?
10718 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10719 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10720 AC_MSG_RESULT([yes])
10721 ENABLE_SCRIPTING_BEANSHELL=TRUE
10723 dnl ===================================================================
10724 dnl Check for system beanshell
10725 dnl ===================================================================
10726 AC_MSG_CHECKING([which beanshell to use])
10727 if test "$with_system_beanshell" = "yes"; then
10728 AC_MSG_RESULT([external])
10730 if test -z $BSH_JAR; then
10731 BSH_JAR=/usr/share/java/bsh.jar
10733 if ! test -f $BSH_JAR; then
10734 AC_MSG_ERROR(bsh.jar not found.)
10737 AC_MSG_RESULT([internal])
10739 BUILD_TYPE="$BUILD_TYPE BSH"
10742 AC_MSG_RESULT([no])
10743 ENABLE_SCRIPTING_BEANSHELL=
10744 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10746 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10747 AC_SUBST(SYSTEM_BSH)
10750 # scripting provider for JavaScript?
10751 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10752 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10753 AC_MSG_RESULT([yes])
10754 ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10756 dnl ===================================================================
10757 dnl Check for system rhino
10758 dnl ===================================================================
10759 AC_MSG_CHECKING([which rhino to use])
10760 if test "$with_system_rhino" = "yes"; then
10761 AC_MSG_RESULT([external])
10763 if test -z $RHINO_JAR; then
10764 RHINO_JAR=/usr/share/java/js.jar
10766 if ! test -f $RHINO_JAR; then
10767 AC_MSG_ERROR(js.jar not found.)
10770 AC_MSG_RESULT([internal])
10772 BUILD_TYPE="$BUILD_TYPE RHINO"
10775 AC_MSG_RESULT([no])
10776 ENABLE_SCRIPTING_JAVASCRIPT=
10777 SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10779 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10780 AC_SUBST(SYSTEM_RHINO)
10781 AC_SUBST(RHINO_JAR)
10783 # This is only used in KDE3/KDE4/TDE checks to determine if /usr/lib64
10784 # paths should be added to library search path. So lets put all 64-bit
10787 case "$host_cpu" in
10788 x86_64 | powerpc64 | powerpc64le | s390x | aarch64)
10789 if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
10790 supports_multilib="yes"
10797 dnl ===================================================================
10798 dnl Check whether the TQt and TDE libraries are available.
10799 dnl ===================================================================
10803 if test "$_os" != "OpenBSD"; then
10806 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
10807 dnl Search paths for TQt and TDE
10808 if test -z "$supports_multilib"; then
10809 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"
10810 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"
10812 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"
10813 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"
10815 if test -n "$TQTDIR"; then
10816 tqt_incdirs="$TQTDIR/include $tqt_incdirs"
10817 if test -z "$supports_multilib"; then
10818 tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
10820 tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
10823 if test -z "$supports_multilib"; then
10824 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"
10825 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"
10827 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"
10828 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"
10830 if test -n "$TDEDIR"; then
10831 tde_incdirs="$TDEDIR/include $tde_incdirs"
10832 if test -z "$supports_multilib"; then
10833 tde_libdirs="$TDEDIR/lib $tde_libdirs"
10835 tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
10840 tqt_test_include="ntqstyle.h"
10841 tde_test_include="kapp.h"
10843 if test "$_os" != "OpenBSD"; then
10844 tqt_test_library="libtqt-mt.so"
10845 tde_test_library="libDCOP.so"
10847 tqt_test_library="libtqt-mt.so*"
10848 tde_test_library="libDCOP.so*"
10851 dnl Check for TQt headers
10852 AC_MSG_CHECKING([for TQt headers])
10854 for tde_check in $tqt_incdirs; do
10855 if test -r "$tde_check/$tqt_test_include"; then
10856 tqt_incdir="$tde_check"
10860 AC_MSG_RESULT([$tqt_incdir])
10861 if test "x$tqt_incdir" = "xno"; then
10862 AC_MSG_ERROR([TQt headers not found. Please specify the root of
10863 your TQt installation by exporting TQTDIR before running "configure".])
10866 dnl Check for TQt libraries
10867 AC_MSG_CHECKING([for TQt libraries])
10869 for tqt_check in $tqt_libdirs; do
10870 if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
10871 tqt_libdir="$tqt_check"
10875 AC_MSG_RESULT([$tqt_libdir])
10876 if test "x$tqt_libdir" = "xno"; then
10877 AC_MSG_ERROR([TQt libraries not found. Please specify the root of
10878 your TQt installation by exporting TQTDIR before running "configure".])
10881 dnl Check for Meta Object Compiler
10882 AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
10883 if test "$MOC" = "no"; then
10884 AC_MSG_ERROR([TQt Meta Object Compiler not found. Please specify
10885 the root of your TQt installation by exporting TQTDIR before running "configure".])
10888 dnl Check for TDE headers
10889 AC_MSG_CHECKING([for TDE headers])
10891 for tde_check in $tde_incdirs; do
10892 if test -r "$tde_check/$tde_test_include"; then
10893 tde_incdir="$tde_check"
10897 AC_MSG_RESULT([$tde_incdir])
10898 if test "x$tde_incdir" = "xno"; then
10899 AC_MSG_ERROR([TDE headers not found. Please specify the root of
10900 your TDE installation by exporting TDEDIR before running "configure".])
10903 dnl Check for TDE libraries
10904 AC_MSG_CHECKING([for TDE libraries])
10906 for tde_check in $tde_libdirs; do
10907 if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
10908 tde_libdir="$tde_check"
10912 AC_MSG_RESULT([$tde_libdir])
10913 if test "x$tde_libdir" = "xno"; then
10914 AC_MSG_ERROR([TDE libraries not found. Please specify the root of
10915 your TDE installation by exporting TDEDIR before running "configure".])
10918 dnl Set the variables
10919 TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10920 TDE_LIBS="-L$tde_libdir -L$tqt_libdir -ltdeio -ltdeui -ltdecore -ltqt -ltqt-mt"
10922 AC_SUBST(TDE_CFLAGS)
10926 dnl ===================================================================
10927 dnl KDE4 Integration
10928 dnl ===================================================================
10937 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10938 qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10939 qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10941 kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
10942 kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10944 if test -n "$supports_multilib"; then
10945 qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10946 kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10949 if test -n "$QTDIR"; then
10950 qt_incdirs="$QTDIR/include $qt_incdirs"
10951 if test -z "$supports_multilib"; then
10952 qt_libdirs="$QTDIR/lib $qt_libdirs"
10954 qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
10957 if test -n "$QT4DIR"; then
10958 qt_incdirs="$QT4DIR/include $qt_incdirs"
10959 if test -z "$supports_multilib"; then
10960 qt_libdirs="$QT4DIR/lib $qt_libdirs"
10962 qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
10966 if test -n "$KDEDIR"; then
10967 kde_incdirs="$KDEDIR/include $kde_incdirs"
10968 if test -z "$supports_multilib"; then
10969 kde_libdirs="$KDEDIR/lib $kde_libdirs"
10971 kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
10974 if test -n "$KDE4DIR"; then
10975 kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
10976 if test -z "$supports_multilib"; then
10977 kde_libdirs="$KDE4DIR/lib $kde_libdirs"
10979 kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
10983 qt_test_include="Qt/qobject.h"
10984 qt_test_library="libQtNetwork.so"
10985 kde_test_include="kwindowsystem.h"
10986 kde_test_library="libsolid.so"
10988 AC_MSG_CHECKING([for Qt4 headers])
10990 for inc_dir in $qt_incdirs; do
10991 if test -r "$inc_dir/$qt_test_include"; then
10992 qt_header_dir="$inc_dir"
10997 AC_MSG_RESULT([$qt_header_dir])
10998 if test "x$qt_header_dir" = "xno"; then
10999 AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11002 dnl Check for qmake
11003 AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
11005 if test "$QMAKE4" = "no"; then
11006 AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
11007 if test "$QMAKE4" = "no"; then
11008 AC_MSG_ERROR([Qmake not found. Please specify
11009 the root of your Qt installation by exporting QT4DIR before running "configure".])
11013 qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
11014 AC_MSG_CHECKING([for Qt4 libraries])
11016 for lib_dir in $qt_libdirs; do
11017 if test -r "$lib_dir/$qt_test_library"; then
11018 qt_lib_dir="$lib_dir"
11019 PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
11024 AC_MSG_RESULT([$qt_lib_dir])
11026 if test "x$qt_lib_dir" = "xno"; then
11027 AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11030 dnl Check for Meta Object Compiler
11032 AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11034 if test "$MOC4" = "no"; then
11035 AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11036 if test "$MOC4" = "no"; then
11037 AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
11038 the root of your Qt installation by exporting QT4DIR before running "configure".])
11042 dnl Check for KDE4 headers
11043 AC_MSG_CHECKING([for KDE4 headers])
11045 for kde_check in $kde_incdirs; do
11046 if test -r "$kde_check/$kde_test_include"; then
11047 kde_incdir="$kde_check"
11051 AC_MSG_RESULT([$kde_incdir])
11052 if test "x$kde_incdir" = "xno"; then
11053 AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11056 dnl Check for KDE4 libraries
11057 AC_MSG_CHECKING([for KDE4 libraries])
11059 for kde_check in $kde_libdirs; do
11060 if test -r "$kde_check/$kde_test_library"; then
11061 kde_libdir="$kde_check"
11066 AC_MSG_RESULT([$kde_libdir])
11067 if test "x$kde_libdir" = "xno"; then
11068 AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11071 PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
11072 KDE4_CFLAGS="-I$kde_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11073 KDE4_LIBS="-L$kde_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt_lib_dir $QT4_LIBS"
11074 KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11075 FilterLibs "$KDE4_LIBS"
11076 KDE4_LIBS="$filteredlibs"
11078 AC_LANG_PUSH([C++])
11079 save_CXXFLAGS=$CXXFLAGS
11080 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11081 AC_MSG_CHECKING([whether KDE is >= 4.2])
11082 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11083 #include <kdeversion.h>
11085 int main(int argc, char **argv) {
11086 if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
11089 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
11090 CXXFLAGS=$save_CXXFLAGS
11093 # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11094 # Sets also KDE_GLIB_CFLAGS/KDE_GLIB_LIBS if successful.
11095 PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
11098 AC_DEFINE(KDE_HAVE_GLIB,1)
11099 KDE_GLIB_CFLAGS=$(printf '%s' "$KDE_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11100 FilterLibs "${KDE_GLIB_LIBS}"
11101 KDE_GLIB_LIBS="${filteredlibs}"
11105 AC_LANG_PUSH([C++])
11106 # tst_exclude_socket_notifiers.moc:70:28: runtime error: member access within address 0x60d00000bb20 which does not point to an object of type 'QObjectData'
11107 # 0x60d00000bb20: note: object is of type 'QObjectPrivate'
11108 # 02 00 80 3a 90 8a 4e d2 3a 00 00 00 f0 b4 b9 a7 ff 7f 00 00 00 00 00 00 00 00 00 00 20 d8 4e d2
11109 # ^~~~~~~~~~~~~~~~~~~~~~~
11110 # vptr for 'QObjectPrivate'
11112 CXX=$(printf %s "$CXX" \
11113 | sed -e 's/-fno-sanitize-recover\(=[[0-9A-Za-z,_-]]*\)*//')
11114 save_CXXFLAGS=$CXXFLAGS
11115 CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11117 LIBS="$LIBS $KDE4_LIBS"
11118 AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
11120 # Prepare meta object data
11121 TSTBASE="tst_exclude_socket_notifiers"
11122 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11123 ln -fs "${TSTMOC}.hxx"
11124 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11126 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11128 #include "tst_exclude_socket_notifiers.moc"
11130 int main(int argc, char *argv[])
11132 QCoreApplication app(argc, argv);
11133 exit(tst_processEventsExcludeSocket());
11137 AC_MSG_RESULT([yes])
11139 AC_MSG_RESULT([no])
11140 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11141 if test -z "$qt4_fix_warning"; then
11142 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11145 add_warning " https://bugreports.qt-project.org/browse/QTBUG-37380 (needed)"
11146 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11148 # Remove meta object data
11149 rm -f "${TSTBASE}."*
11151 AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
11153 # Prepare meta object data
11154 TSTBASE="tst_exclude_posted_events"
11155 TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11156 ln -fs "${TSTMOC}.hxx"
11157 $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11159 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11161 #include "tst_exclude_posted_events.moc"
11163 int main(int argc, char *argv[])
11165 QCoreApplication app(argc, argv);
11166 exit(tst_excludePostedEvents());
11170 AC_MSG_RESULT([yes])
11172 AC_MSG_RESULT([no])
11173 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11174 if test -z "$qt4_fix_warning"; then
11175 add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11178 add_warning " https://bugreports.qt-project.org/browse/QTBUG-34614 (needed)"
11179 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11181 # Remove meta object data
11182 rm -f "${TSTBASE}."*
11184 if test -n "$qt4_fix_warning"; then
11185 add_warning " https://bugreports.qt-project.org/browse/QTBUG-38585 (recommended)"
11189 CXXFLAGS=$save_CXXFLAGS
11193 AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
11195 AC_SUBST(KDE4_CFLAGS)
11196 AC_SUBST(KDE4_LIBS)
11198 AC_SUBST(KDE_GLIB_CFLAGS)
11199 AC_SUBST(KDE_GLIB_LIBS)
11200 AC_SUBST(KDE_HAVE_GLIB)
11202 dnl ===================================================================
11203 dnl Test whether to include Evolution 2 support
11204 dnl ===================================================================
11205 AC_MSG_CHECKING([whether to enable evolution 2 support])
11206 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11207 AC_MSG_RESULT([yes])
11208 PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11209 GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11210 FilterLibs "${GOBJECT_LIBS}"
11211 GOBJECT_LIBS="${filteredlibs}"
11212 ENABLE_EVOAB2="TRUE"
11215 AC_MSG_RESULT([no])
11217 AC_SUBST(ENABLE_EVOAB2)
11218 AC_SUBST(GOBJECT_CFLAGS)
11219 AC_SUBST(GOBJECT_LIBS)
11221 dnl ===================================================================
11222 dnl Test whether to include TDE AB support
11223 dnl ===================================================================
11224 AC_MSG_CHECKING([whether to enable TDE address book support])
11225 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
11226 AC_MSG_RESULT([yes])
11227 AC_LANG_PUSH([C++])
11228 save_CXXFLAGS=$CXXFLAGS
11229 CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
11230 AC_MSG_CHECKING([whether TDE is at least R14.0])
11231 AC_RUN_IFELSE([AC_LANG_SOURCE([[
11232 #include <tdeversion.h>
11234 int main(int argc, char **argv) {
11235 if (TDE_VERSION_MAJOR >= 14) return 0;
11238 ]])],[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])],
11239 [AC_MSG_ERROR([TDE support not tested with cross compilation])])
11240 CXXFLAGS=$save_CXXFLAGS
11244 AC_MSG_RESULT([no])
11247 AC_SUBST(ENABLE_TDEAB)
11249 dnl ===================================================================
11250 dnl Test which themes to include
11251 dnl ===================================================================
11252 AC_MSG_CHECKING([which themes to include])
11253 # if none given use default subset of available themes
11254 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11255 with_theme="breeze galaxy hicontrast oxygen sifr tango"
11256 test -z "$ENABLE_RELEASE_BUILD" && with_theme="$with_theme tango_testing"
11260 if test "x$with_theme" != "xno"; then
11261 for theme in $with_theme; do
11263 breeze|crystal|elementary|galaxy|hicontrast|human|oxygen|sifr|tango|tango_testing) real_theme="$theme" ;;
11264 default) real_theme=galaxy ;;
11265 *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11267 WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11270 AC_MSG_RESULT([$WITH_THEMES])
11271 AC_SUBST([WITH_THEMES])
11272 # FIXME: remove this, and the convenience default->galaxy remapping after a crace period
11273 for theme in $with_theme; do
11275 default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=galaxy]) ;;
11280 dnl ===================================================================
11281 dnl Test whether to integrate helppacks into the product's installer
11282 dnl ===================================================================
11283 AC_MSG_CHECKING([for helppack integration])
11284 if test "$with_helppack_integration" = "no"; then
11285 WITH_HELPPACK_INTEGRATION=
11286 AC_MSG_RESULT([no integration])
11288 WITH_HELPPACK_INTEGRATION=TRUE
11289 SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11290 AC_MSG_RESULT([integration])
11292 AC_SUBST(WITH_HELPPACK_INTEGRATION)
11294 ###############################################################################
11295 # Extensions checking
11296 ###############################################################################
11297 AC_MSG_CHECKING([for extensions integration])
11298 if test "x$enable_extension_integration" != "xno"; then
11299 WITH_EXTENSION_INTEGRATION=TRUE
11300 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11301 AC_MSG_RESULT([yes, use integration])
11303 WITH_EXTENSION_INTEGRATION=
11304 AC_MSG_RESULT([no, do not integrate])
11306 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11308 dnl Should any extra extensions be included?
11309 dnl There are standalone tests for each of these below.
11310 WITH_EXTRA_EXTENSIONS=
11311 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11313 libo_CHECK_EXTENSION([Watch Window],[WATCH_WINDOW],[watch_window],[watch-window],[23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt])
11314 libo_CHECK_EXTENSION([SmART Gallery (Diagram)],[DIAGRAM],[diagram],[diagram],[8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt])
11315 libo_CHECK_EXTENSION([Validator],[VALIDATOR],[validator],[validator],[bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt])
11316 libo_CHECK_EXTENSION([Barcode],[BARCODE],[barcode],[barcode],[3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt])
11317 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11318 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11319 libo_CHECK_EXTENSION([Hungarian Cross-reference Toolbar],[HUNART],[hunart],[hunart],[b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt])
11320 libo_CHECK_EXTENSION([Typography Toolbar],[TYPO],[typo],[typo],[9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt])
11321 libo_CHECK_EXTENSION([Google Docs],[GOOGLE_DOCS],[google_docs],[google-docs],[27211596cf0ad97cab7321239406fde0-gdocs_3.0.1_modified.oxt])
11322 if test "x$with_java" != "xno"; then
11323 libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11324 libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11327 dnl ===================================================================
11328 dnl Test whether to include Sun Professional Template Pack
11329 dnl ===================================================================
11330 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
11331 if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
11332 AC_MSG_RESULT([no integration])
11334 SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
11335 sun_supported_langs="en-US de it fr es hu"
11336 if test "$with_sun_templates" = "yes"; then
11337 wanted_sun_templates="$sun_supported_langs"
11339 # check whether the langs are supported by Sun
11340 wanted_sun_templates=
11341 for lang in $with_sun_templates; do
11342 if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
11343 wanted_sun_templates="$wanted_sun_templates $lang"
11348 SUNTEMPLATES_DE_PACK=
11349 SUNTEMPLATES_EN_US_PACK=
11350 SUNTEMPLATES_ES_PACK=
11351 SUNTEMPLATES_FR_PACK=
11352 SUNTEMPLATES_HU_PACK=
11353 SUNTEMPLATES_IT_PACK=
11354 # check whether the langs are requested at all
11355 for lang in $wanted_sun_templates; do
11356 if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
11357 SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
11359 "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
11360 "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
11361 "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
11362 "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
11363 "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
11364 "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
11368 WITH_EXTRA_EXTENSIONS=TRUE
11369 AC_MSG_RESULT([$SUNTEMPLATES_LANG])
11371 AC_SUBST(SUNTEMPLATES_DE_PACK)
11372 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
11373 AC_SUBST(SUNTEMPLATES_ES_PACK)
11374 AC_SUBST(SUNTEMPLATES_FR_PACK)
11375 AC_SUBST(SUNTEMPLATES_HU_PACK)
11376 AC_SUBST(SUNTEMPLATES_IT_PACK)
11378 TEST_FONTS_MISSING=0
11381 # $2+ = accepted font mappings
11385 AC_MSG_CHECKING([font mapping for '$FONT'])
11386 FONTFILE="$(basename `$FCMATCH -f '%{file}' "$FONT"`)"
11387 FONTFILE_LOWER="$(echo $FONTFILE | $AWK '{print tolower($0)}')"
11389 TESTEXPR="'${FONTFILE_LOWER}' = '$(echo $FONT | $AWK '{print tolower($0)}').ttf'"
11390 while test "$#" -ge 1 ; do
11391 MAPPING="$(echo $1 | $AWK '{print tolower($0)}')"; shift
11392 TESTEXPR="${TESTEXPR} -o '${FONTFILE_LOWER}' = '$MAPPING-regular.ttf'"
11396 AC_MSG_RESULT([ok])
11398 AC_MSG_RESULT([unknown ($FONTFILE)])
11399 TEST_FONTS_MISSING=1
11403 dnl ===================================================================
11404 dnl Test whether to include fonts
11405 dnl ===================================================================
11406 AC_MSG_CHECKING([whether to include third-party fonts])
11407 if test "$with_fonts" != "no"; then
11408 AC_MSG_RESULT([yes])
11410 BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11412 AC_MSG_RESULT([no])
11414 SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11415 if test "$test_fontconfig" = "yes"; then
11416 AC_PATH_PROG([FCMATCH], [fc-match])
11417 if test -z "$FCMATCH"; then
11418 AC_MSG_WARN([Unable to query installed fonts - unit tests disabled.])
11419 TEST_FONTS_MISSING=1
11421 test_font_map 'Calibri' 'Carlito'
11422 if test ${TEST_FONTS_MISSING} -eq 1
11424 AC_MSG_WARN([Unknown font mappings - unit tests disabled.])
11428 TEST_FONTS_MISSING=0
11431 AC_SUBST(WITH_FONTS)
11432 AC_DEFINE_UNQUOTED([TEST_FONTS_MISSING], $TEST_FONTS_MISSING)
11434 dnl ===================================================================
11435 dnl Test whether to include extra galleries
11436 dnl ===================================================================
11437 AC_MSG_CHECKING([whether to include extra galleries])
11438 if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
11439 AC_MSG_RESULT([no])
11440 WITH_EXTRA_GALLERY=
11441 OOOP_GALLERY_PACK=""
11443 AC_MSG_RESULT([yes])
11444 WITH_EXTRA_GALLERY=TRUE
11445 BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
11446 SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
11447 OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
11449 AC_SUBST(WITH_EXTRA_GALLERY)
11450 AC_SUBST(OOOP_GALLERY_PACK)
11452 dnl ===================================================================
11453 dnl Test whether to include extra templates
11454 dnl ===================================================================
11455 AC_MSG_CHECKING([whether to include extra templates])
11456 if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
11457 AC_MSG_RESULT([no])
11458 WITH_EXTRA_TEMPLATE=
11459 OOOP_TEMPLATES_PACK=""
11461 AC_MSG_RESULT([yes])
11462 WITH_EXTRA_TEMPLATE=TRUE
11463 BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
11464 SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
11465 OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
11467 AC_SUBST(WITH_EXTRA_TEMPLATE)
11468 AC_SUBST(OOOP_TEMPLATES_PACK)
11470 dnl ===================================================================
11471 dnl Test whether to include extra samples
11472 dnl ===================================================================
11473 AC_MSG_CHECKING([whether to include extra samples])
11474 if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
11475 AC_MSG_RESULT([no])
11477 OOOP_SAMPLES_PACK=""
11479 AC_MSG_RESULT([yes])
11480 WITH_EXTRA_SAMPLE=TRUE
11481 BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
11482 SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
11483 OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
11485 AC_SUBST(WITH_EXTRA_SAMPLE)
11486 AC_SUBST(OOOP_SAMPLES_PACK)
11488 dnl ===================================================================
11489 dnl Test whether to include extra fonts
11490 dnl ===================================================================
11491 AC_MSG_CHECKING([whether to include extra fonts])
11492 if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
11493 AC_MSG_RESULT([no])
11497 AC_MSG_RESULT([yes])
11498 WITH_EXTRA_FONT=TRUE
11499 BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
11500 SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
11501 OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
11503 AC_SUBST(WITH_EXTRA_FONT)
11504 AC_SUBST(OOOP_FONTS_PACK)
11506 dnl ===================================================================
11507 dnl Test whether to enable online update service
11508 dnl ===================================================================
11509 AC_MSG_CHECKING([whether to enable online update])
11510 ENABLE_ONLINE_UPDATE=
11511 ENABLE_ONLINE_UPDATE_MAR=
11512 if test "$enable_online_update" = ""; then
11513 if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11514 AC_MSG_RESULT([yes])
11515 ENABLE_ONLINE_UPDATE="TRUE"
11517 AC_MSG_RESULT([no])
11520 if test "$enable_online_update" = "mar"; then
11521 AC_MSG_RESULT([yes - MAR-based online update])
11522 ENABLE_ONLINE_UPDATE_MAR="TRUE"
11523 elif test "$enable_online_update" = "yes"; then
11524 AC_MSG_RESULT([yes])
11525 ENABLE_ONLINE_UPDATE="TRUE"
11527 AC_MSG_RESULT([no])
11530 AC_SUBST(ENABLE_ONLINE_UPDATE)
11531 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11533 dnl ===================================================================
11534 dnl Test whether we need bzip2
11535 dnl ===================================================================
11537 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11538 AC_MSG_CHECKING([whether to use system bzip2])
11539 if test "$with_system_bzip2" = yes; then
11541 AC_MSG_RESULT([yes])
11542 PKG_CHECK_MODULES(BZIP2, bzip2)
11543 FilterLibs "${BZIP2_LIBS}"
11544 BZIP2_LIBS="${filteredlibs}"
11546 AC_MSG_RESULT([no])
11547 BUILD_TYPE="$BUILD_TYPE BZIP2"
11550 AC_SUBST(SYSTEM_BZIP2)
11551 AC_SUBST(BZIP2_CFLAGS)
11552 AC_SUBST(BZIP2_LIBS)
11554 dnl ===================================================================
11555 dnl Test whether to enable extension update
11556 dnl ===================================================================
11557 AC_MSG_CHECKING([whether to enable extension update])
11558 ENABLE_EXTENSION_UPDATE=
11559 if test "x$enable_extension_update" = "xno"; then
11560 AC_MSG_RESULT([no])
11562 AC_MSG_RESULT([yes])
11563 ENABLE_EXTENSION_UPDATE="TRUE"
11564 AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11565 SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11567 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11570 dnl ===================================================================
11571 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11572 dnl ===================================================================
11573 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11574 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11575 AC_MSG_RESULT([no])
11578 AC_MSG_RESULT([yes])
11579 ENABLE_SILENT_MSI=TRUE
11580 SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11582 AC_SUBST(ENABLE_SILENT_MSI)
11584 AC_MSG_CHECKING([whether and how to use Xinerama])
11585 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11586 if test "$x_libraries" = "default_x_libraries"; then
11587 XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11588 if test "x$XINERAMALIB" = x; then
11589 XINERAMALIB="/usr/lib"
11592 XINERAMALIB="$x_libraries"
11594 if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11595 # we have both versions, let the user decide but use the dynamic one
11598 if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11599 XINERAMA_LINK=dynamic
11601 XINERAMA_LINK=static
11603 elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11604 # we have only the dynamic version
11606 XINERAMA_LINK=dynamic
11607 elif test -e "$XINERAMALIB/libXinerama.a"; then
11609 if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11611 XINERAMA_LINK=static
11621 if test "$USE_XINERAMA" = "TRUE"; then
11622 AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11623 AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11624 [AC_MSG_ERROR(Xinerama header not found.)], [])
11625 XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11626 if test "x$XEXTLIB" = x; then
11627 XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11629 XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11630 if test "$_os" = "FreeBSD"; then
11631 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11633 if test "$_os" = "Linux"; then
11634 XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11636 AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11637 [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11639 AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11644 AC_MSG_RESULT([no])
11646 AC_SUBST(USE_XINERAMA)
11647 AC_SUBST(XINERAMA_LINK)
11649 dnl ===================================================================
11650 dnl Test whether to build cairo or rely on the system version
11651 dnl ===================================================================
11653 if test "$USING_X11" = TRUE; then
11654 # Used in vcl/Library_vclplug_gen.mk
11658 if test "$test_cairo" = "yes"; then
11659 AC_MSG_CHECKING([whether to use the system cairo])
11661 : ${with_system_cairo:=$with_system_libs}
11662 if test "$with_system_cairo" = "yes"; then
11664 AC_MSG_RESULT([yes])
11666 PKG_CHECK_MODULES( CAIRO, cairo >= 1.2.0 )
11667 CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11668 FilterLibs "${CAIRO_LIBS}"
11669 CAIRO_LIBS="${filteredlibs}"
11671 if test "$test_xrender" = "yes"; then
11672 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11674 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11675 #ifdef PictStandardA8
11679 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11683 libo_MINGW_CHECK_DLL([libcairo])
11684 libo_MINGW_TRY_DLL([libfontconfig])
11685 libo_MINGW_TRY_DLL([libfreetype])
11686 libo_MINGW_TRY_DLL([libpixman])
11687 libo_MINGW_TRY_DLL([libpng15])
11690 AC_MSG_RESULT([no])
11692 BUILD_TYPE="$BUILD_TYPE CAIRO"
11693 SCPDEFS="$SCPDEFS -DNEED_CAIRO"
11697 AC_SUBST(SYSTEM_CAIRO)
11698 AC_SUBST(CAIRO_CFLAGS)
11699 AC_SUBST(CAIRO_LIBS)
11701 dnl ===================================================================
11702 dnl Test whether to use avahi
11703 dnl ===================================================================
11704 if test "$_os" = "WINNT"; then
11705 # Windows uses bundled mDNSResponder
11706 BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11707 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11708 PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11709 [ENABLE_AVAHI="TRUE"])
11710 AC_DEFINE(HAVE_FEATURE_AVAHI)
11711 AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11712 FilterLibs "${AVAHI_LIBS}"
11713 AVAHI_LIBS="${filteredlibs}"
11716 AC_SUBST(ENABLE_AVAHI)
11717 AC_SUBST(AVAHI_CFLAGS)
11718 AC_SUBST(AVAHI_LIBS)
11720 dnl ===================================================================
11721 dnl Test whether to use liblangtag
11722 dnl ===================================================================
11725 AC_MSG_CHECKING([whether to use liblangtag])
11726 if test "$enable_liblangtag" = "yes" -o \
11727 \( "$enable_liblangtag" = "" -a $_os != iOS -a $_os != Emscripten \); then
11728 ENABLE_LIBLANGTAG=TRUE
11729 AC_MSG_RESULT([yes])
11730 AC_MSG_CHECKING([whether to use system liblangtag])
11731 if test "$with_system_liblangtag" = yes; then
11732 SYSTEM_LIBLANGTAG=TRUE
11733 AC_MSG_RESULT([yes])
11734 PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11735 dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11736 PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11737 LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11738 FilterLibs "${LIBLANGTAG_LIBS}"
11739 LIBLANGTAG_LIBS="${filteredlibs}"
11740 libo_MINGW_CHECK_DLL([liblangtag])
11743 AC_MSG_RESULT([no])
11744 BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11745 LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/langtag"
11746 if test "$COM" = "MSC"; then
11747 LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs/liblangtag.lib"
11749 LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/langtag/liblangtag/.libs -llangtag"
11752 AC_DEFINE(ENABLE_LIBLANGTAG)
11754 AC_MSG_RESULT([no])
11756 AC_SUBST(ENABLE_LIBLANGTAG)
11757 AC_SUBST(SYSTEM_LIBLANGTAG)
11758 AC_SUBST(LIBLANGTAG_CFLAGS)
11759 AC_SUBST(LIBLANGTAG_LIBS)
11761 dnl ===================================================================
11762 dnl Test whether to build libpng or rely on the system version
11763 dnl ===================================================================
11765 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/png"],["-L${WORKDIR}/LinkTarget/StaticLibrary -lpng"])
11767 dnl ===================================================================
11768 dnl Check for runtime JVM search path
11769 dnl ===================================================================
11770 if test "$ENABLE_JAVA" != ""; then
11771 AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11772 if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11773 AC_MSG_RESULT([yes])
11774 if ! test -d "$with_jvm_path"; then
11775 AC_MSG_ERROR(["$with_jvm_path" not a directory])
11777 if ! test -d "$with_jvm_path"jvm; then
11778 AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11780 JVM_ONE_PATH_CHECK="$with_jvm_path"
11781 AC_SUBST(JVM_ONE_PATH_CHECK)
11783 AC_MSG_RESULT([no])
11787 dnl ===================================================================
11788 dnl Test for the presence of Ant and that it works
11789 dnl ===================================================================
11791 if test "$ENABLE_JAVA" != ""; then
11792 ANT_HOME=; export ANT_HOME
11793 WITH_ANT_HOME=; export WITH_ANT_HOME
11794 if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11795 if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11796 if test "$_os" = "WINNT"; then
11797 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11799 with_ant_home="$LODE_HOME/opt/ant"
11801 elif test -x "$LODE_HOME/opt/bin/ant" ; then
11802 with_ant_home="$LODE_HOME/opt/ant"
11805 if test -z "$with_ant_home"; then
11806 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11808 if test "$_os" = "WINNT"; then
11809 # AC_PATH_PROGS needs unix path
11810 with_ant_home=`cygpath -u "$with_ant_home"`
11812 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11813 WITH_ANT_HOME=$with_ant_home
11814 ANT_HOME=$with_ant_home
11817 if test -z "$ANT"; then
11818 AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11820 # resolve relative or absolute symlink
11821 while test -h "$ANT"; do
11823 a_basename=`basename "$ANT"`
11824 a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11825 cd "`dirname "$ANT"`"
11826 cd "`dirname "$a_script"`"
11827 ANT="`pwd`"/"`basename "$a_script"`"
11831 AC_MSG_CHECKING([if $ANT works])
11832 cat > conftest.java << EOF
11833 public class conftest {
11834 int testmethod(int a, int b) {
11840 cat > conftest.xml << EOF
11841 <project name="conftest" default="conftest">
11842 <target name="conftest">
11843 <javac srcdir="." includes="conftest.java">
11849 oldJAVA_HOME=$JAVA_HOME
11850 if test "$JAVACISGCJ" = "yes"; then
11851 JAVA_HOME=; export JAVA_HOME
11852 ant_gcj="-Dbuild.compiler=gcj"
11854 AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11855 if test $? = 0 -a -f ./conftest.class; then
11856 AC_MSG_RESULT([Ant works])
11857 if test -z "$WITH_ANT_HOME"; then
11858 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11859 if test -z "$ANT_HOME"; then
11860 ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11863 ANT_HOME="$WITH_ANT_HOME"
11866 echo "configure: Ant test failed" >&5
11867 cat conftest.java >&5
11868 cat conftest.xml >&5
11869 AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
11871 add_warning "Ant does not work - Some Java projects will not build!"
11873 JAVA_HOME=$oldJAVA_HOME
11874 rm -f conftest* core core.* *.core
11876 if test -z "$ANT_HOME"; then
11877 ANT_HOME="NO_ANT_HOME"
11879 PathFormat "$ANT_HOME"
11880 ANT_HOME="$formatted_path"
11882 ANT="$formatted_path"
11887 dnl Checking for ant.jar
11888 if test "$ANT_HOME" != "NO_ANT_HOME"; then
11889 AC_MSG_CHECKING([Ant lib directory])
11890 if test -f $ANT_HOME/lib/ant.jar; then
11891 ANT_LIB="$ANT_HOME/lib"
11893 if test -f $ANT_HOME/ant.jar; then
11894 ANT_LIB="$ANT_HOME"
11896 if test -f /usr/share/java/ant.jar; then
11897 ANT_LIB=/usr/share/java
11899 if test -f /usr/share/ant-core/lib/ant.jar; then
11900 ANT_LIB=/usr/share/ant-core/lib
11902 if test -f $ANT_HOME/lib/ant/ant.jar; then
11903 ANT_LIB="$ANT_HOME/lib/ant"
11905 if test -f /usr/share/lib/ant/ant.jar; then
11906 ANT_LIB=/usr/share/lib/ant
11908 AC_MSG_ERROR([Ant libraries not found!])
11915 PathFormat "$ANT_LIB"
11916 ANT_LIB="$formatted_path"
11917 AC_MSG_RESULT([Ant lib directory found.])
11922 ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11924 AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11925 ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11926 ant_version_major=`echo $ant_version | cut -d. -f1`
11927 ant_version_minor=`echo $ant_version | cut -d. -f2`
11928 echo "configure: ant_version $ant_version " >&5
11929 echo "configure: ant_version_major $ant_version_major " >&5
11930 echo "configure: ant_version_minor $ant_version_minor " >&5
11931 if test "$ant_version_major" -ge "2"; then
11932 AC_MSG_RESULT([yes, $ant_version])
11933 elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11934 AC_MSG_RESULT([yes, $ant_version])
11936 AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11939 rm -f conftest* core core.* *.core
11943 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11944 AC_MSG_CHECKING([for JUnit 4])
11945 if test "$with_junit" = "yes"; then
11946 if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
11947 OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
11948 elif test -e /usr/share/java/junit4.jar; then
11949 OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11951 if test -e /usr/share/lib/java/junit.jar; then
11952 OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11954 OOO_JUNIT_JAR=/usr/share/java/junit.jar
11958 OOO_JUNIT_JAR=$with_junit
11960 if test "$_os" = "WINNT"; then
11961 OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11963 printf 'import org.junit.Before;' > conftest.java
11964 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11965 AC_MSG_RESULT([$OOO_JUNIT_JAR])
11968 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
11969 specify its pathname via --with-junit=..., or disable it via --without-junit])
11971 rm -f conftest.class conftest.java
11972 if test $OOO_JUNIT_JAR != ""; then
11973 BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11976 AC_SUBST(OOO_JUNIT_JAR)
11979 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11980 AC_MSG_CHECKING([for included Hamcrest])
11981 printf 'import org.hamcrest.BaseDescription;' > conftest.java
11982 if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11983 AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
11985 AC_MSG_RESULT([Not included])
11986 AC_MSG_CHECKING([for standalone hamcrest jar.])
11987 if test "$with_hamcrest" = "yes"; then
11988 if test -e /usr/share/lib/java/hamcrest.jar; then
11989 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
11990 elif test -e /usr/share/java/hamcrest/core.jar; then
11991 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
11993 HAMCREST_JAR=/usr/share/java/hamcrest.jar
11996 HAMCREST_JAR=$with_hamcrest
11998 if test "$_os" = "WINNT"; then
11999 HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
12001 if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
12002 AC_MSG_RESULT([$HAMCREST_JAR])
12004 AC_MSG_ERROR([junit does not contain hamcrest; please use a junit jar that includes hamcrest, install a hamcrest jar in the default location (/usr/share/java),
12005 specify its path with --with-hamcrest=..., or disable junit with --without-junit])
12008 rm -f conftest.class conftest.java
12010 AC_SUBST(HAMCREST_JAR)
12016 # check for wget and curl
12021 if test "$enable_fetch_external" != "no"; then
12023 CURL=`which curl 2>/dev/null`
12025 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12026 eval "$i --version" > /dev/null 2>&1
12028 if test $ret -eq 0; then
12034 if test -z "$WGET" -a -z "$CURL"; then
12035 AC_MSG_ERROR([neither wget nor curl found!])
12048 for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
12049 if test "$i" = "md5"; then
12050 eval "$i -x" > /dev/null 2>&1
12052 eval "$i --version" > /dev/null 2>&1
12055 if test $ret -eq 0; then
12061 if test "$MD5SUM" = "md5"; then
12062 if md5 -r < /dev/null > /dev/null 2>/dev/null; then
12063 MD5SUM="$MD5SUM -r"
12064 elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
12065 MD5SUM="$MD5SUM -n"
12069 if test -z "$MD5SUM"; then
12070 AC_MSG_ERROR([no md5sum found!])
12075 dnl ===================================================================
12076 dnl Dealing with l10n options
12077 dnl ===================================================================
12078 AC_MSG_CHECKING([which languages to be built])
12079 # get list of all languages
12080 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12081 # the sed command does the following:
12082 # + if a line ends with a backslash, append the next line to it
12083 # + adds " on the beginning of the value (after =)
12084 # + adds " at the end of the value
12085 # + removes en-US; we want to put it on the beginning
12086 # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12087 [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)]
12088 ALL_LANGS="en-US $completelangiso"
12089 # check the configured localizations
12090 WITH_LANG="$with_lang"
12091 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12092 AC_MSG_RESULT([en-US])
12094 AC_MSG_RESULT([$WITH_LANG])
12095 GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12097 # check that the list is valid
12098 for lang in $WITH_LANG; do
12099 test "$lang" = "ALL" && continue
12100 # need to check for the exact string, so add space before and after the list of all languages
12101 for vl in $ALL_LANGS; do
12102 if test "$vl" = "$lang"; then
12106 if test "$vl" != "$lang"; then
12107 # if you're reading this - you prolly quoted your languages remove the quotes ...
12108 AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12111 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12112 echo $WITH_LANG | grep -q en-US
12113 test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12115 # list with substituted ALL
12116 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12117 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12118 test "$WITH_LANG" = "en-US" && WITH_LANG=
12119 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12120 test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12121 ALL_LANGS=`echo $ALL_LANGS qtz`
12123 AC_SUBST(ALL_LANGS)
12124 AC_SUBST(WITH_LANG)
12125 AC_SUBST(WITH_LANG_LIST)
12126 AC_SUBST(GIT_NEEDED_SUBMODULES)
12128 WITH_POOR_HELP_LOCALIZATIONS=
12129 if test -d "$SRC_ROOT/translations/source"; then
12130 for l in `ls -1 $SRC_ROOT/translations/source`; do
12131 if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12132 WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12136 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12138 if test -n "$with_locales"; then
12139 WITH_LOCALES="$with_locales"
12141 just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12142 # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12143 # config_host/config_locales.h.in
12144 for locale in $WITH_LOCALES; do
12147 AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12151 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12154 AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12159 AC_DEFINE(WITH_LOCALE_ALL)
12161 AC_SUBST(WITH_LOCALES)
12163 dnl git submodule update --reference
12164 dnl ===================================================================
12165 if test -n "${GIT_REFERENCE_SRC}"; then
12166 for repo in ${GIT_NEEDED_SUBMODULES}; do
12167 if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12168 AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12172 AC_SUBST(GIT_REFERENCE_SRC)
12174 dnl git submodules linked dirs
12175 dnl ===================================================================
12176 if test -n "${GIT_LINK_SRC}"; then
12177 for repo in ${GIT_NEEDED_SUBMODULES}; do
12178 if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12179 AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12183 AC_SUBST(GIT_LINK_SRC)
12186 dnl ===================================================================
12187 AC_MSG_CHECKING([for alternative branding images directory])
12188 # initialize mapped arrays
12189 BRAND_INTRO_IMAGES="flat_logo.svg intro.png"
12190 brand_files="$BRAND_INTRO_IMAGES about.svg"
12192 if test -z "$with_branding" -o "$with_branding" = "no"; then
12193 AC_MSG_RESULT([none])
12194 DEFAULT_BRAND_IMAGES="$brand_files"
12196 if ! test -d $with_branding ; then
12197 AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12199 AC_MSG_RESULT([$with_branding])
12200 CUSTOM_BRAND_DIR="$with_branding"
12201 for lfile in $brand_files
12203 if ! test -f $with_branding/$lfile ; then
12204 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12205 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12207 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12210 check_for_progress="yes"
12213 AC_SUBST([BRAND_INTRO_IMAGES])
12214 AC_SUBST([CUSTOM_BRAND_DIR])
12215 AC_SUBST([CUSTOM_BRAND_IMAGES])
12216 AC_SUBST([DEFAULT_BRAND_IMAGES])
12219 AC_MSG_CHECKING([for 'intro' progress settings])
12223 PROGRESSFRAMECOLOR=
12225 PROGRESSTEXTBASELINE=
12227 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
12228 source "$with_branding/progress.conf"
12229 AC_MSG_RESULT([settings found in $with_branding/progress.conf])
12231 AC_MSG_RESULT([none])
12234 AC_SUBST(PROGRESSBARCOLOR)
12235 AC_SUBST(PROGRESSSIZE)
12236 AC_SUBST(PROGRESSPOSITION)
12237 AC_SUBST(PROGRESSFRAMECOLOR)
12238 AC_SUBST(PROGRESSTEXTCOLOR)
12239 AC_SUBST(PROGRESSTEXTBASELINE)
12242 AC_MSG_CHECKING([for extra build ID])
12243 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
12244 EXTRA_BUILDID="$with_extra_buildid"
12246 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
12247 if test -n "$EXTRA_BUILDID" ; then
12248 AC_MSG_RESULT([$EXTRA_BUILDID])
12250 AC_MSG_RESULT([not set])
12252 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
12255 AC_MSG_CHECKING([for vendor])
12256 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
12257 OOO_VENDOR="$USERNAME"
12259 if test -z "$OOO_VENDOR"; then
12263 if test -z "$OOO_VENDOR"; then
12264 OOO_VENDOR="`id -u -n`"
12267 AC_MSG_RESULT([not set, using $OOO_VENDOR])
12269 OOO_VENDOR="$with_vendor"
12270 AC_MSG_RESULT([$OOO_VENDOR])
12272 AC_SUBST(OOO_VENDOR)
12274 if echo "$host_os" | grep -q linux-android ; then
12275 ANDROID_PACKAGE_NAME=
12276 AC_MSG_CHECKING([for Android package name])
12277 if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
12278 if test -n "$ENABLE_DEBUG"; then
12279 # Default to the package name that makes ndk-gdb happy.
12280 ANDROID_PACKAGE_NAME="org.libreoffice"
12282 ANDROID_PACKAGE_NAME="org.example.libreoffice"
12285 AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
12287 ANDROID_PACKAGE_NAME="$with_android_package_name"
12288 AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
12290 AC_SUBST(ANDROID_PACKAGE_NAME)
12293 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12294 if test "$with_compat_oowrappers" = "yes"; then
12295 WITH_COMPAT_OOWRAPPERS=TRUE
12298 WITH_COMPAT_OOWRAPPERS=
12301 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12303 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | $AWK '{print tolower($0)}'`
12304 AC_MSG_CHECKING([for install dirname])
12305 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12306 INSTALLDIRNAME="$with_install_dirname"
12308 AC_MSG_RESULT([$INSTALLDIRNAME])
12309 AC_SUBST(INSTALLDIRNAME)
12311 AC_MSG_CHECKING([for prefix])
12312 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12313 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12314 PREFIXDIR="$prefix"
12315 AC_MSG_RESULT([$PREFIXDIR])
12316 AC_SUBST(PREFIXDIR)
12318 LIBDIR=[$(eval echo $(eval echo $libdir))]
12321 DATADIR=[$(eval echo $(eval echo $datadir))]
12324 MANDIR=[$(eval echo $(eval echo $mandir))]
12327 DOCDIR=[$(eval echo $(eval echo $docdir))]
12330 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12331 AC_SUBST(INSTALLDIR)
12333 TESTINSTALLDIR="${BUILDDIR}/test-install"
12334 AC_SUBST(TESTINSTALLDIR)
12337 # ===================================================================
12338 # OAuth2 id and secrets
12339 # ===================================================================
12341 AC_MSG_CHECKING([for Google Drive client id and secret])
12342 GDRIVE_CLIENT_ID="\"$with_gdrive_client_id\""
12343 GDRIVE_CLIENT_SECRET="\"$with_gdrive_client_secret\""
12344 if test "$with_gdrive_client_id" = "no" -o -z "$with_gdrive_client_id"; then
12345 GDRIVE_CLIENT_ID="\"\""
12348 if test "$with_gdrive_client_secret" = "no" -o -z "$with_gdrive_client_secret"; then
12349 GDRIVE_CLIENT_SECRET="\"\""
12352 if test -z "$GDRIVE_CLIENT_ID" -o -z "$GDRIVE_CLIENT_SECRET"; then
12353 AC_MSG_RESULT([not set])
12355 AC_MSG_RESULT([set])
12358 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_ID, $GDRIVE_CLIENT_ID)
12359 AC_DEFINE_UNQUOTED(GDRIVE_CLIENT_SECRET, $GDRIVE_CLIENT_SECRET)
12361 AC_MSG_CHECKING([for Alfresco Cloud client id and secret])
12362 ALFRESCO_CLOUD_CLIENT_ID="\"$with_alfresco_cloud_client_id\""
12363 ALFRESCO_CLOUD_CLIENT_SECRET="\"$with_alfresco_cloud_client_secret\""
12364 if test "$with_alfresco_cloud_client_id" = "no" -o -z "$with_alfresco_cloud_client_id"; then
12365 ALFRESCO_CLOUD_CLIENT_ID="\"\""
12368 if test "$with_alfresco_cloud_client_secret" = "no" -o -z "$with_alfresco_cloud_client_secret"; then
12369 ALFRESCO_CLOUD_CLIENT_SECRET="\"\""
12372 if test -z "$ALFRESCO_CLOUD_CLIENT_ID" -o -z "$ALFRESCO_CLOUD_CLIENT_SECRET"; then
12373 AC_MSG_RESULT([not set])
12375 AC_MSG_RESULT([set])
12377 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
12378 AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
12380 AC_MSG_CHECKING([for OneDrive client id and secret])
12381 ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
12382 ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
12383 if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
12384 ONEDRIVE_CLIENT_ID="\"\""
12387 if test "$with_onedrive_client_secret" = "no" -o -z "$with_onedrive_client_secret"; then
12388 ONEDRIVE_CLIENT_SECRET="\"\""
12391 if test -z "$ONEDRIVE_CLIENT_ID" -o -z "$ONEDRIVE_CLIENT_SECRET"; then
12392 AC_MSG_RESULT([not set])
12394 AC_MSG_RESULT([set])
12396 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
12397 AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
12400 dnl ===================================================================
12401 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12402 dnl --enable-dependency-tracking configure option
12403 dnl ===================================================================
12404 AC_MSG_CHECKING([whether to enable dependency tracking])
12405 if test "$enable_dependency_tracking" = "no"; then
12407 AC_MSG_RESULT([no])
12409 AC_MSG_RESULT([yes])
12413 dnl ===================================================================
12414 dnl Number of CPUs to use during the build
12415 dnl ===================================================================
12416 AC_MSG_CHECKING([for number of processors to use])
12417 # plain --with-parallelism is just the default
12418 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12419 if test "$with_parallelism" = "no"; then
12422 PARALLELISM=$with_parallelism
12425 if test "$enable_icecream" = "yes"; then
12430 Darwin|FreeBSD|NetBSD|OpenBSD)
12431 PARALLELISM=`sysctl -n hw.ncpu`
12435 PARALLELISM=`getconf _NPROCESSORS_ONLN`
12437 # what else than above does profit here *and* has /proc?
12439 PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12443 # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12444 # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
12448 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12449 if test -z "$with_parallelism"; then
12450 AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12451 add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12454 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."
12458 if test $PARALLELISM -eq 0; then
12459 AC_MSG_RESULT([explicit make -j option needed])
12461 AC_MSG_RESULT([$PARALLELISM])
12463 AC_SUBST(PARALLELISM)
12465 IWYU_PATH="$with_iwyu"
12466 AC_SUBST(IWYU_PATH)
12467 if test ! -z "$IWYU_PATH"; then
12468 if test ! -f "$IWYU_PATH"; then
12469 AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
12474 # Set up ILIB for MSVC build
12477 if test "$build_os" = "cygwin"; then
12479 if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
12480 ILIB="$ILIB;$JAVA_HOME/lib"
12483 if test "$BITNESS_OVERRIDE" = 64; then
12484 ILIB="$ILIB;$COMPATH/lib/amd64"
12485 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/amd64"
12486 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12487 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
12488 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12489 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12490 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
12492 if test $VCVER = 140; then
12493 PathFormat "$ucrttest"
12494 ucrtlibpath_formatted="$formatted_path/lib/$ucrtdir/ucrt/x64"
12495 ILIB="$ILIB;$ucrtlibpath_formatted"
12498 ILIB="$ILIB;$COMPATH/lib"
12499 ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib"
12500 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12501 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
12502 if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
12503 ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12504 ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
12506 if test $VCVER = 140; then
12507 PathFormat "$ucrttest"
12508 ucrtlibpath_formatted="$formatted_path/lib/$ucrtdir/ucrt/x86"
12509 ILIB="$ILIB;$ucrtlibpath_formatted"
12512 if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
12513 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12515 ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
12522 [whether C++11 use of const_iterator in standard containers is broken])
12523 save_CXXFLAGS=$CXXFLAGS
12524 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12525 AC_LANG_PUSH([C++])
12526 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12530 l.erase(l.cbegin());
12532 [broken=no], [broken=yes])
12535 CXXFLAGS=$save_CXXFLAGS
12536 AC_MSG_RESULT([$broken])
12537 if test "$broken" = yes; then
12538 AC_DEFINE([HAVE_BROKEN_CONST_ITERATORS])
12542 AC_MSG_CHECKING([whether $CXX has broken static initializer_list support])
12543 save_CXXFLAGS=$CXXFLAGS
12544 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
12546 if test -n "$ILIB1"; then
12547 LIBS="$LIBS $ILIB1"
12549 AC_LANG_PUSH([C++])
12550 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
12551 // Exit with failure if the static initializer_list is stored on the
12552 // stack (as done by Clang < 3.4):
12553 #include <initializer_list>
12555 bool g(void const * p1, void const * p2) {
12557 return !((p1 > p2 && p2 > &n) || (p1 < p2 && p2 < &n));
12559 bool f(void const * p1) {
12560 static std::initializer_list<S> s { S() };
12561 return g(p1, s.begin());
12565 return f(&n) ? 0 : 1;
12566 ]])], [broken=no], [broken=yes],[broken='assuming not (cross-compiling)'])
12569 CXXFLAGS=$save_CXXFLAGS
12570 AC_MSG_RESULT([$broken])
12571 if test "$broken" = yes; then
12572 AC_DEFINE([HAVE_BROKEN_STATIC_INITILIZER_LIST])
12576 # ===================================================================
12577 # Creating bigger shared library to link against
12578 # ===================================================================
12579 AC_MSG_CHECKING([whether to create huge library])
12582 if test $_os = iOS -o $_os = Android; then
12583 # Never any point in mergelibs for these as we build just static
12584 # libraries anyway...
12585 enable_mergelibs=no
12588 if test -n "$enable_mergelibs" -a "$enable_mergelibs" != "no"; then
12589 if test $_os != Linux -a $_os != WINNT; then
12590 add_warning "--enable-mergelibs is not tested for this platform"
12593 AC_MSG_RESULT([yes])
12595 AC_MSG_RESULT([no])
12597 AC_SUBST([MERGELIBS])
12599 # ===================================================================
12600 # Create hardlinks on deliver instead of copying for smaller size and speed up
12601 # ===================================================================
12602 AC_MSG_CHECKING([whether to create hardlinks for delivering files])
12604 if test "$enable_hardlink_deliver" = "yes"; then
12605 HARDLINKDELIVER="TRUE"
12606 AC_MSG_RESULT([yes])
12608 AC_MSG_RESULT([no])
12610 AC_SUBST(HARDLINKDELIVER)
12612 dnl ===================================================================
12613 dnl icerun is a wrapper that stops us spawning tens of processes
12614 dnl locally - for tools that can't be executed on the compile cluster
12615 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12616 dnl ===================================================================
12617 AC_MSG_CHECKING([whether to use icerun wrapper])
12619 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12620 ICECREAM_RUN=icerun
12621 AC_MSG_RESULT([yes])
12623 AC_MSG_RESULT([no])
12625 AC_SUBST(ICECREAM_RUN)
12627 dnl ===================================================================
12628 dnl Setup the ICECC_VERSION for the build the same way it was set for
12629 dnl configure, so that CC/CXX and ICECC_VERSION are in sync
12630 dnl ===================================================================
12631 x_ICECC_VERSION=[\#]
12632 if test -n "$ICECC_VERSION" ; then
12635 AC_SUBST(x_ICECC_VERSION)
12636 AC_SUBST(ICECC_VERSION)
12638 dnl ===================================================================
12640 AC_MSG_CHECKING([MPL subset])
12643 if test "$enable_mpl_subset" = "yes"; then
12645 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
12647 elif test "$ENABLE_REPORTBUILDER" = "TRUE"; then
12650 if test "$warn_report" = "true"; then
12651 AC_MSG_ERROR([need to --disable-report-builder - extended database report builder.])
12653 if test "x$enable_postgresql_sdbc" != "xno"; then
12654 AC_MSG_ERROR([need to --disable-postgresql-sdbc - the postgress database backend.])
12656 if test "$enable_lotuswordpro" = "yes"; then
12657 AC_MSG_ERROR([need to --disable-lotuswordpro - a Lotus Word Pro file format import filter.])
12659 if test "$WITH_WEBDAV" = "neon"; then
12660 AC_MSG_ERROR([need --with-webdav=serf or --without-webdav - webdav support.])
12662 if test "x$enable_ext_mariadb_connector" = "xyes"; then
12663 AC_MSG_ERROR([need to --disable-ext-mariadb-connector - mariadb/mysql support.])
12665 if test -n "$ENABLE_PDFIMPORT"; then
12666 if test "x$SYSTEM_POPPLER" = "x"; then
12667 AC_MSG_ERROR([need to disable PDF import via poppler or use system library])
12670 # cf. m4/libo_check_extension.m4
12671 if test "x$WITH_EXTRA_EXTENSIONS" != "x"; then
12672 AC_MSG_ERROR([need to disable extra extensions '$WITH_EXTRA_EXTENSIONS'])
12674 for theme in $WITH_THEMES; do
12676 breeze|crystal|default|hicontrast|human|oxygen|sifr)
12677 AC_MSG_ERROR([need to disable icon themes from '$WITH_THEMES': $theme present, use --with-theme=tango]) ;;
12684 if test "$enable_lpsolve" != "no" -o "x$ENABLE_LPSOLVE" = "xTRUE"; then
12685 AC_MSG_ERROR([need to --disable-lpsolve - calc linear programming solver.])
12689 AC_DEFINE(MPL_HAVE_SUBSET)
12690 AC_MSG_RESULT([only])
12692 AC_MSG_RESULT([no restrictions])
12694 AC_SUBST(MPL_SUBSET)
12697 dnl ===================================================================
12698 dnl Setting up the environment.
12699 dnl ===================================================================
12700 AC_MSG_NOTICE([setting up the build environment variables...])
12704 if test "$build_os" = "cygwin"; then
12705 if test -d "$COMPATH/atlmfc/lib"; then
12706 ATL_LIB="$COMPATH/atlmfc/lib"
12707 ATL_INCLUDE="$COMPATH/atlmfc/include"
12709 ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12710 ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12712 if test "$BITNESS_OVERRIDE" = 64; then
12713 ATL_LIB="$ATL_LIB/amd64"
12715 # sort.exe and find.exe also exist in C:/Windows/system32 so need /usr/bin/
12716 PathFormat "/usr/bin/find.exe"
12717 FIND="$formatted_path"
12718 PathFormat "/usr/bin/sort.exe"
12719 SORT="$formatted_path"
12720 PathFormat "/usr/bin/grep.exe"
12721 WIN_GREP="$formatted_path"
12722 PathFormat "/usr/bin/ls.exe"
12723 WIN_LS="$formatted_path"
12724 PathFormat "/usr/bin/touch.exe"
12725 WIN_TOUCH="$formatted_path"
12731 AC_SUBST(ATL_INCLUDE)
12737 AC_SUBST(WIN_TOUCH)
12739 AC_SUBST(BUILD_TYPE)
12744 PERL="$formatted_path"
12747 if test -n "$TMPDIR"; then
12748 TEMP_DIRECTORY="$TMPDIR"
12750 TEMP_DIRECTORY="/tmp"
12752 if test "$build_os" = "cygwin"; then
12753 TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
12755 AC_SUBST(TEMP_DIRECTORY)
12757 # setup the PATH for the environment
12758 if test -n "$LO_PATH_FOR_BUILD"; then
12759 LO_PATH="$LO_PATH_FOR_BUILD"
12765 aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12766 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12767 pathmunge "$JAVA_HOME/bin" "after"
12772 # Win32 make needs native paths
12773 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
12774 LO_PATH=`cygpath -p -m "$PATH"`
12776 if test "$BITNESS_OVERRIDE" = 64; then
12777 # needed for msi packaging
12778 pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12780 pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12781 pathmunge "$ASM_HOME" "before"
12782 pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12783 pathmunge "$CSC_PATH" "before"
12784 pathmunge "$MIDL_PATH" "before"
12785 pathmunge "$AL_PATH" "before"
12786 pathmunge "$MSPDB_PATH" "before"
12787 if test -n "$MSBUILD_PATH" ; then
12788 pathmunge "$MSBUILD_PATH" "before"
12790 if test "$BITNESS_OVERRIDE" = 64; then
12791 if test "$vcexpress" = "Express"; then
12792 pathmunge "$COMPATH/bin/x86_amd64" "before"
12793 pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12795 pathmunge "$COMPATH/bin/amd64" "before"
12796 pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12799 pathmunge "$COMPATH/bin" "before"
12800 pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12802 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12803 if test -d "$JAVA_HOME/jre/bin/client"; then
12804 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12806 if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12807 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12809 pathmunge "$JAVA_HOME/bin" "before"
12814 pathmunge "/usr/css/bin" "before"
12815 if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
12816 pathmunge "$JAVA_HOME/bin" "after"
12824 # Generate a configuration md5 we can use for deps
12825 if test -f config_host.mk; then
12826 config_md5=`$MD5SUM config_host.mk | sed "s/ .*//"`
12828 if test -f config_host_lang.mk; then
12829 config_lang_md5=`$MD5SUM config_host_lang.mk | sed "s/ .*//"`
12832 AC_CONFIG_FILES([config_host.mk
12833 config_host_lang.mk
12836 instsetoo_native/util/openoffice.lst
12837 sysui/desktop/macosx/Info.plist
12839 AC_CONFIG_HEADERS([config_host/config_buildid.h])
12840 AC_CONFIG_HEADERS([config_host/config_clang.h])
12841 AC_CONFIG_HEADERS([config_host/config_dconf.h])
12842 AC_CONFIG_HEADERS([config_host/config_eot.h])
12843 AC_CONFIG_HEADERS([config_host/config_extension_update.h])
12844 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
12845 AC_CONFIG_HEADERS([config_host/config_cups.h])
12846 AC_CONFIG_HEADERS([config_host/config_features.h])
12847 AC_CONFIG_HEADERS([config_host/config_folders.h])
12848 AC_CONFIG_HEADERS([config_host/config_gcc.h])
12849 AC_CONFIG_HEADERS([config_host/config_global.h])
12850 AC_CONFIG_HEADERS([config_host/config_graphite.h])
12851 AC_CONFIG_HEADERS([config_host/config_java.h])
12852 AC_CONFIG_HEADERS([config_host/config_lgpl.h])
12853 AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
12854 AC_CONFIG_HEADERS([config_host/config_locales.h])
12855 AC_CONFIG_HEADERS([config_host/config_mpl.h])
12856 AC_CONFIG_HEADERS([config_host/config_orcus.h])
12857 AC_CONFIG_HEADERS([config_host/config_kde4.h])
12858 AC_CONFIG_HEADERS([config_host/config_oox.h])
12859 AC_CONFIG_HEADERS([config_host/config_opengl.h])
12860 AC_CONFIG_HEADERS([config_host/config_options.h])
12861 AC_CONFIG_HEADERS([config_host/config_test.h])
12862 AC_CONFIG_HEADERS([config_host/config_telepathy.h])
12863 AC_CONFIG_HEADERS([config_host/config_typesizes.h])
12864 AC_CONFIG_HEADERS([config_host/config_vcl.h])
12865 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
12866 AC_CONFIG_HEADERS([config_host/config_version.h])
12867 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
12868 AC_CONFIG_HEADERS([config_host/config_poppler.h])
12869 AC_CONFIG_HEADERS([config_host/config_python.h])
12870 AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
12873 if test "$CROSS_COMPILING" = TRUE; then
12874 (echo; echo export BUILD_TYPE_FOR_HOST=$BUILD_TYPE) >>config_build.mk
12877 # touch the config timestamp file
12878 if test ! -f config_host.mk.stamp; then
12879 echo > config_host.mk.stamp
12880 elif test "$config_md5" = `$MD5SUM config_host.mk | sed "s/ .*//"`; then
12881 echo "Host Configuration unchanged - avoiding scp2 stamp update"
12883 echo > config_host.mk.stamp
12886 # touch the config lang timestamp file
12887 if test ! -f config_host_lang.mk.stamp; then
12888 echo > config_host_lang.mk.stamp
12889 elif test "$config_lang_md5" = `$MD5SUM config_host_lang.mk | sed "s/ .*//"`; then
12890 echo "Language Configuration unchanged - avoiding scp2 stamp update"
12892 echo > config_host_lang.mk.stamp
12896 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12899 ****************************************************************************
12901 Your make version is known to be horribly slow, and hard to debug
12902 problems with. To get a reasonably functional make please do:
12904 to install a pre-compiled binary make for Win32
12906 mkdir -p /opt/lo/bin
12908 wget http://dev-www.libreoffice.org/bin/cygwin/make-85047eb-msvc.exe
12909 cp make-85047eb-msvc.exe make
12912 to install from source:
12913 place yourself in a working directory of you choice.
12915 git clone git://git.savannah.gnu.org/make.git
12917 [go to Start menu, click "All Programs", click "Visual Studio 2013", click "Visual Studio Tools", double-click "VS2013 x86 Native Tools Command Prompt" or "VS2013 x64 Native Tools Command Prompt"]
12918 set PATH=%PATH%;C:\Cygwin\bin
12919 [or Cygwin64, if that is what you have]
12920 cd path-to-make-repo-you-cloned-above
12921 build_w32.bat --without-guile
12923 should result in a WinRel/gnumake.exe.
12924 Copy it to to the Cygwin /opt/lo/bin directory as make.exe
12926 Then re-run autogen.sh
12928 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12929 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12935 ****************************************************************************
12940 To view some help, run:
12945 if test $_os != WINNT -a "$CROSS_COMPILING" != TRUE; then
12947 After the build has finished, you can immediately run it using:
12950 if test $_os = Darwin; then
12951 echo open instdir/$PRODUCTNAME.app
12953 echo instdir/program/soffice
12957 If you want to run the smoketest, run:
12963 if test -f warn; then
12968 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: