Paren fix for Ubu 10.04 build (and fdo#58417 ?)
[LibreOffice.git] / configure.ac
blobe293023ea537f89dc3e19beb1c6942d2106f3369
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 AC_INIT([LibreOffice],[4.0],[],[],[http://documentfoundation.org/])
6 AC_PREREQ([2.59])
8 save_CC=$CC
9 save_CXX=$CXX
11 BUILD_TYPE="LibO"
12 SCPDEFS=""
13 GIT_NEEDED_SUBMODULES=""
14 LO_PATH= # used by path_munge to construct a PATH variable
16 PathFormat()
18     formatted_path="$1"
19     if test "$build_os" = "cygwin"; then
20         pf_part1=
21         pf_conv_to_dos=
22         for pf_part in $formatted_path; do
23             if test -z "$pf_part1"; then
24                 pf_part1="$pf_part"
25             else
26                 pf_conv_to_dos="yes"
27             fi
28         done
29         if test "$pf_conv_to_dos" = "yes"; then
30             formatted_path=`cygpath -d "$formatted_path"`
31             if test $? -ne 0;  then
32                 AC_MSG_ERROR([path conversion failed for "$1".])
33             fi
34         fi
35         fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
36         fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
37         if test "$fp_count_slash$fp_count_colon" != "00"; then
38             if test "$fp_count_colon" = "0"; then
39                 formatted_path=`realpath "$formatted_path"`
40                 if test $? -ne 0;  then
41                     AC_MSG_ERROR([realpath failed for "$1".])
42                 fi
43             fi
44             formatted_path=`cygpath -m "$formatted_path"`
45             if test $? -ne 0;  then
46                 AC_MSG_ERROR([path conversion failed for "$1".])
47             fi
48         fi
49     fi
52 cat /dev/null > warn
53 have_WARNINGS="no"
54 add_warning()
56     if test "$have_WARNINGS" = "no"; then
57         echo "*************************************" >> warn
58         have_WARNINGS="yes"
59         if which tput >/dev/null 2>/dev/null && test `tput colors` -ge 8; then
60             dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
61             COLORWARN='*\e@<:@1;33;40m WARNING \e@<:@0m:'
62         else
63             COLORWARN="* WARNING :"
64         fi
65     fi
66     echo "$COLORWARN $@" >> warn
69 if test -n "$SOLARENV"; then
70     AC_MSG_ERROR([You have sourced config_host.mk in this shell.  This may lead to trouble, please run in a fresh (login) shell.])
73 echo "********************************************************************"
74 echo "*"
75 echo "*   Running ${PACKAGE_NAME} build configuration."
76 echo "*"
77 echo "********************************************************************"
78 echo ""
80 dnl ===================================================================
81 dnl checks build and host OSes
82 dnl do this before argument processing to allow for platform dependent defaults
83 dnl ===================================================================
84 AC_CANONICAL_HOST
86 AC_PROG_EGREP
87 # AC_PROG_EGREP doesn't set GREP on all systems as well
88 AC_PATH_PROG(GREP, grep)
90 if test "$build_os" = "cygwin"; then
91     EXEEXT_FOR_BUILD=.exe
92     SRC_ROOT=`pwd`
93     PathFormat "$SRC_ROOT"
94     SRC_ROOT="$formatted_path"
95     x_Cygwin=
96 else
97     EXEEXT_FOR_BUILD=
98     SRC_ROOT=`pwd`
99     x_Cygwin=[\#]
102 AC_SUBST(SRC_ROOT)
103 AC_SUBST(EXEEXT_FOR_BUILD)
104 AC_SUBST(x_Cygwin)
106 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
107     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
110 # need sed in os checks...
111 AC_PATH_PROGS(SED, sed)
112 if test -z "$SED"; then
113     AC_MSG_ERROR([install sed to run this script])
116 dnl ===================================================================
117 dnl When building for Android the --with-android-ndk is mandatory
118 dnl ===================================================================
120 AC_ARG_WITH(android-ndk,
121     AS_HELP_STRING([--with-android-ndk],
122         [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
125 AC_ARG_WITH(android-ndk-toolchain-version,
126     AS_HELP_STRING([--with-android-ndk-toolchain-version],
127         [Specify which toolchain version to use, of those present in the
128         Android NDK you are using. Mandatory if the NDK used has several
129         toolchain versions for the host architecture you are building for.]), ,)
131 AC_ARG_WITH(android-sdk,
132     AS_HELP_STRING([--with-android-sdk],
133         [Specify location of the Android SDK. Mandatory when building for Android.]),
136 ANDROID_NDK_HOME=
137 if test -n "$with_android_ndk"; then
138     ANDROID_NDK_HOME=$with_android_ndk
140     # Set up a lot of pre-canned defaults
142     if test $host_cpu = arm; then
143         android_cpu=arm
144     elif test $host_cpu = mips; then
145         android_cpu=mips
146     else
147         # host_cpu is something like "i386" or "i686" I guess, NDK uses
148         # "x86" in some contexts
149         android_cpu=x86
150     fi
152     ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$android_cpu*-*$with_android_ndk_toolchain_version/prebuilt/*/bin`
153     # Check if there are several toolchain versions
154     case "$ANDROID_ABI_PREBUILT_BIN" in
155     */bin\ */bin*)
156         AC_MSG_ERROR([Several toolchain versions in NDK, you must specify --with-android-ndk-toolchain-version])
157     esac
159     # This stays empty if there is just one version of the toolchain in the NDK
160     ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=
161     case "`echo $ANDROID_NDK_HOME/toolchains/$android_cpu*-*/prebuilt/*/bin`" in
162     */bin\ */bin*)
163         # Trailing slash intentional and necessary, compare to how this is used
164         ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
165         ;;
166     esac
168     if test $host_cpu = arm; then
169        android_gcc_prefix=arm-linux-androideabi
170     elif test $host_cpu = mips; then
171        android_gcc_prefix=mipsel-linux-android
172     elif test -f $ANDROID_ABI_PREBUILT_BIN/i686-android-linux-gcc; then
173         android_gcc_prefix=i686-android-linux
174     elif test -f $ANDROID_ABI_PREBUILT_BIN/i686-linux-android-gcc; then
175         android_gcc_prefix=i686-linux-android
176     else
177         AC_MSG_ERROR([Can't figure out the toolchain prefix])
178     fi
180     test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu
181     test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-ar
182     test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-nm
183     test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-objdump
184     test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-ranlib
185     test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-strip
187     if test $host_cpu = arm; then
188         ANDROID_APP_ABI=armeabi-v7a
189         ANDROIDCFLAGS="-march=armv7-a -mfloat-abi=softfp -mthumb -mfpu=neon -Wl,--fix-cortex-a8"
190     elif test $host_cpu = mips; then
191         ANDROID_APP_ABI=mips
192         ANDROIDCFLAGS=""
193     else # x86
194         ANDROID_APP_ABI=x86
195         ANDROIDCFLAGS="-march=atom"
196     fi
197     ANDROIDCFLAGS="$ANDROIDCFLAGS -ffunction-sections"
198     ANDROIDCFLAGS="$ANDROIDCFLAGS -Wno-psabi --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/$ANDROID_APP_ABI"
200     # When using the 4.6 or newer toolchain, use the gold linker
201     case "$with_android_ndk_toolchain_version" in
202     4.[[6789]]*|[[56789]].*)
203         # The NDK doesn't have ld.gold for MIPS for some reason
204         if test "$host_cpu" != mips; then
205             ANDROIDCFLAGS="$ANDROIDCFLAGS -fuse-ld=gold"
206         fi
207         ;;
208     esac
210     # gdbserver can be in different locations
211     if test -f $ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver; then
212         ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver
213     elif test -f $ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver; then
214         ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver
215     else
216         AC_MSG_ERROR([Can't find gdbserver for your Android target])
217     fi
219     if test $host_cpu = arm; then
220         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"
221     elif test $host_cpu = mips; then
222         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"
223     else # x86
224         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"
225     fi
227     test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-gcc $ANDROIDCFLAGS"
228     test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-g++ $ANDROIDCXXFLAGS"
230 AC_SUBST(ANDROID_NDK_HOME)
231 AC_SUBST(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)
232 AC_SUBST(ANDROID_NDK_GDBSERVER)
233 AC_SUBST(ANDROID_APP_ABI)
235 dnl ===================================================================
236 dnl Also --with-android-sdk is mandatory
237 dnl ===================================================================
238 ANDROID_SDK_HOME=
239 if test -n "$with_android_sdk"; then
240    ANDROID_SDK_HOME=$with_android_sdk
241    PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
243 AC_SUBST(ANDROID_SDK_HOME)
245 dnl ===================================================================
246 dnl The following is a list of supported systems.
247 dnl Sequential to keep the logic very simple
248 dnl These values may be checked and reset later.
249 dnl ===================================================================
250 #defaults unless the os test overrides this:
251 test_randr=yes
252 test_xrender=yes
253 test_cups=yes
254 test_dbus=yes
255 test_fontconfig=yes
256 test_cairo=no
258 # Default values, as such probably valid just for Linux, set
259 # differently below just for Mac OSX,but at least better than
260 # hardcoding these as we used to do. Much of this is duplicated also
261 # in solenv for old build system and for gbuild, ideally we should
262 # perhaps define stuff like this only here in configure.ac?
264 LINKFLAGSSHL="-shared"
265 PICSWITCH="-fpic"
266 DLLPOST=".so"
268 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
270 case "$host_os" in
272 solaris*)
273     test_gtk=yes
274     build_gstreamer=yes
275     build_gstreamer_0_10=yes
276     test_tde=yes
277     test_kde=yes
278     test_freetype=yes
279     test_gstreamer=yes
280     _os=SunOS
282     dnl ===========================================================
283     dnl Check whether we're using Solaris 10 - SPARC or Intel.
284     dnl ===========================================================
285     AC_MSG_CHECKING([the Solaris operating system release])
286     _os_release=`echo $host_os | $SED -e s/solaris2\.//`
287     if test "$_os_release" -lt "10"; then
288         AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
289     else
290         AC_MSG_RESULT([ok ($_os_release)])
291     fi
293     dnl Check whether we're using a SPARC or i386 processor
294     AC_MSG_CHECKING([the processor type])
295     if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
296         AC_MSG_RESULT([ok ($host_cpu)])
297     else
298         AC_MSG_ERROR([only SPARC and i386 processors are supported])
299     fi
300     ;;
302 linux-gnu*|k*bsd*-gnu*)
303     test_gtk=yes
304     build_gstreamer=yes
305     build_gstreamer_0_10=yes
306     test_tde=yes
307     test_kde=yes
308     test_kde4=yes
309     test_freetype=yes
310     test_unix_quickstarter=yes
311     _os=Linux
312     ;;
314 gnu)
315     test_randr=no
316     test_xrender=no
317     _os=GNU
318      ;;
320 cygwin*|interix*|mingw32*)
322     # When building on Windows normally with MSVC under Cygwin,
323     # configure thinks that the host platform (the platform the
324     # built code will run on) is Cygwin, even if it obviously is
325     # Windows, which in Autoconf terminology is called
326     # "mingw32". (Which is misleading as MinGW is the name of the
327     # tool-chain, not an operating system.)
329     # Somewhat confusing, yes. But this configure script doesn't
330     # look at $host etc that much, it mostly uses its own $_os
331     # variable, set here in this case statement.
333     # When cross-compiling to Windows from Unix, the host platform
334     # is "mingw32" (because in that case it is the MinGW
335     # tool-chain that is used).
337     test_cups=no
338     test_dbus=no
339     test_randr=no
340     test_xrender=no
341     test_freetype=no
342     test_fontconfig=no
343     _os=WINNT
344     use_shl_version="TRUE"
345     DYNAMIC_CRT="TRUE"
347     DLLPOST=".dll"
348     LINKFLAGSNOUNDEFS=
350     # If the host OS matches "mingw32*", that means we are using the
351     # MinGW cross-compiler, because we don't see the point in building
352     # LibreOffice using MinGW on Windows. If you want to build on
353     # Windows, use MSVC. If you want to use MinGW, surely you want to
354     # cross-compile (from Linux or some other Unix).
356     case "$host_os" in
357     mingw32*)
358         WITH_MINGW=yes
359         if test -z "$CC"; then
360             CC="$host_cpu-$host_vendor-$host_os-gcc"
361         fi
362         if test -z "$CXX"; then
363             CXX="$host_cpu-$host_vendor-$host_os-g++"
364         fi
365         ;;
366     esac
367     ;;
369 darwin*) # Mac OS X or iOS
370     test_gtk=yes
371     test_randr=no
372     test_xrender=no
373     test_freetype=no
374     test_fontconfig=no
375     test_dbus=no
376     if test "$host_cpu" = "arm"; then
377         _os=iOS
378         test_gtk=no
379         test_cups=no
380     else
381         _os=Darwin
382     fi
383     enable_systray=no
384     # See comment above the case "$host_os"
385     LINKFLAGSSHL="-dynamiclib -single_module"
387     # -fPIC is default
388     PICSWITCH=""
390     DLLPOST=".dylib"
392     # -undefined error is the default
393     LINKFLAGSNOUNDEFS=""
396 freebsd*)
397     test_gtk=yes
398     build_gstreamer=yes
399     build_gstreamer_0_10=yes
400     test_tde=yes
401     test_kde=yes
402     test_kde4=yes
403     test_freetype=yes
404     AC_MSG_CHECKING([the FreeBSD operating system release])
405     if test -n "$with_os_version"; then
406         OSVERSION="$with_os_version"
407     else
408         OSVERSION=`/sbin/sysctl -n kern.osreldate`
409     fi
410     AC_MSG_RESULT([found OSVERSION=$OSVERSION])
411     AC_MSG_CHECKING([which thread library to use])
412     if test "$OSVERSION" -lt "500016"; then
413         PTHREAD_CFLAGS="-D_THREAD_SAFE"
414         PTHREAD_LIBS="-pthread"
415     elif test "$OSVERSION" -lt "502102"; then
416         PTHREAD_CFLAGS="-D_THREAD_SAFE"
417         PTHREAD_LIBS="-lc_r"
418     else
419         PTHREAD_CFLAGS=""
420         PTHREAD_LIBS="-pthread"
421     fi
422     AC_MSG_RESULT([$PTHREAD_LIBS])
423     _os=FreeBSD
424     ;;
426 *netbsd*)
427     test_gtk=yes
428     build_gstreamer=yes
429     build_gstreamer_0_10=yes
430     test_tde=no
431     test_kde=no
432     test_kde4=yes
433     test_freetype=yes
434     PTHREAD_LIBS="-pthread -lpthread"
435     _os=NetBSD
436     ;;
438 aix*)
439     test_randr=no
440     test_freetype=yes
441     PTHREAD_LIBS=-pthread
442     _os=AIX
443     ;;
445 openbsd*)
446     test_gtk=yes
447     test_tde=yes
448     test_kde=yes
449     test_freetype=yes
450     PTHREAD_CFLAGS="-D_THREAD_SAFE"
451     PTHREAD_LIBS="-pthread"
452     _os=OpenBSD
453     ;;
455 dragonfly*)
456     test_gtk=yes
457     build_gstreamer=yes
458     build_gstreamer_0_10=yes
459     test_tde=yes
460     test_kde=yes
461     test_kde4=yes
462     test_freetype=yes
463     PTHREAD_LIBS="-pthread"
464     _os=DragonFly
465     ;;
467 linux-android*)
468     build_gstreamer=no
469     build_gstreamer_0_10=no
470     test_cups=no
471     test_dbus=no
472     test_fontconfig=no
473     test_freetype=no
474     test_gtk=no
475     test_tde=no
476     test_kde=no
477     test_kde4=no
478     test_randr=no
479     test_xrender=no
480     test_unix_quickstarter=no
481     _os=Android
483     if test -z "$with_android_ndk"; then
484         AC_MSG_ERROR([the --with-android-ndk option is mandatory])
485     fi
487     if test -z "$with_android_sdk"; then
488         AC_MSG_ERROR([the --with-android-sdk option is mandatory])
489     fi
491     # Verify that the NDK and SDK options are proper
492     if test ! -f "$ANDROID_NDK_HOME/platforms/android-9/arch-arm/usr/lib/libc.a"; then
493         AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
494     fi
496     if test ! -d "$ANDROID_SDK_HOME/platforms"; then
497         AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
498     fi
500     BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
501     ;;
504     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
505     ;;
506 esac
508 if test "$_os" = "AIX"; then
509     AC_PATH_PROG(GAWK, gawk)
510     if test -z "$GAWK"; then
511         AC_MSG_ERROR([gawk not found in \$PATH])
512     fi
515 AC_SUBST(use_shl_version)
516 AC_SUBST(DYNAMIC_CRT)
518 AC_SUBST(WITH_MINGW)
519 AC_SUBST(OSVERSION)
520 AC_SUBST(PTHREAD_CFLAGS)
521 AC_SUBST(PTHREAD_LIBS)
523 ###############################################################################
524 # Extensions switches --enable/--disable
525 ###############################################################################
526 # By default these should be enabled unless having extra dependencies.
527 # If there is extra dependency over configure options then the enable should
528 # be automagic based on whether the requiring feature is enabled or not.
529 # All this options change anything only with --enable-extension-integration.
531 # The name of this option and its help string makes it sound as if
532 # extensions are built anyway, just not integrated in the installer,
533 # if you use --disable-extension-integration. Is that really the
534 # case?
536 AC_ARG_ENABLE(extension-integration,
537     AS_HELP_STRING([--disable-extension-integration],
538         [Disable integration of the built extensions in the installer of the
539          product. Use this switch to disable the integration.])
542 AC_ARG_ENABLE(ext-barcode,
543     AS_HELP_STRING([--enable-ext-barcode],
544         [Enable the Barcode extension.])
547 AC_ARG_ENABLE(export,
548     AS_HELP_STRING([--disable-export],
549         [Disable (some) code for document export. Useful when building viewer-only apps that lack
550          save/export functionality, to avoid having an excessive amount of code and data used
551          only for exporrt linked in. Work in progress, use only if you are hacking on it.])
554 AC_ARG_ENABLE(database-connectivity,
555     AS_HELP_STRING([--disable-database-connectivity],
556         [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
559 # This doesn't mean not building (or "integrating") extensions
560 # (although it probably should; i.e. it should imply
561 # --disable-extension-integration I guess), it means not supporting
562 # any extension mechanism at all
563 AC_ARG_ENABLE(extensions,
564     AS_HELP_STRING([--disable-extensions],
565         [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
568 AC_ARG_ENABLE(scripting,
569     AS_HELP_STRING([--disable-scripting],
570         [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
573 # This is mainly for Android and iOS, but could potentially be used in some
574 # special case otherwise, too, so factored out as a separate setting
576 AC_ARG_ENABLE(dynamic-loading,
577     AS_HELP_STRING([--disable-dynamic-loading],
578         [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
581 AC_ARG_ENABLE(ext-diagram,
582     AS_HELP_STRING([--enable-ext-diagram],
583         [Enable the SmART Gallery (Diagram) extension.])
586 AC_ARG_ENABLE(ext-google-docs,
587     AS_HELP_STRING([--enable-ext-google-docs],
588         [Enable the Google Documents extension.])
591 AC_ARG_ENABLE(ext-hunart,
592     AS_HELP_STRING([--enable-ext-hunart],
593         [Enable the Hungarian Cross-reference Toolbar extension.])
596 AC_ARG_ENABLE(ext-languagetool,
597     AS_HELP_STRING([--enable-ext-languagetool],
598         [Enable the LanguageTool extension.])
601 AC_ARG_ENABLE(ext-mysql-connector,
602     AS_HELP_STRING([--enable-ext-mysql-connector],
603         [Enable the build of the MySQL Connector extension.])
606 AC_ARG_ENABLE(ext-nlpsolver,
607     AS_HELP_STRING([--enable-ext-nlpsolver],
608         [Enable the NLPSolver extension.])
611 AC_ARG_ENABLE(ext-ct2n,
612     AS_HELP_STRING([--enable-ext-ct2n],
613         [Enable the ConvertTextToNumber extension.])
616 AC_ARG_ENABLE(ext-numbertext,
617     AS_HELP_STRING([--enable-ext-numbertext],
618         [Enable the Numbertext extension.])
621 AC_ARG_ENABLE(ext-presenter-minimizer,
622     AS_HELP_STRING([--disable-ext-presenter-minimizer],
623         [Disable the Presentation Minimizer extension.])
626 AC_ARG_ENABLE(ext-report-builder,
627     AS_HELP_STRING([--disable-ext-report-builder],
628         [Disable the Report Builder extension.])
631 AC_ARG_ENABLE(ext-typo,
632     AS_HELP_STRING([--enable-ext-typo],
633         [Enable the Typography Toolbar extension.])
636 AC_ARG_ENABLE(ext-validator,
637     AS_HELP_STRING([--enable-ext-validator],
638         [Enable the Validator extension.])
641 AC_ARG_ENABLE(ext-watch-window,
642     AS_HELP_STRING([--enable-ext-watch-window],
643         [Enable the Watch Window extension to Calc.])
646 AC_ARG_ENABLE(ext-wiki-publisher,
647     AS_HELP_STRING([--enable-ext-wiki-publisher],
648         [Enable the Wiki Publisher extension.])
650 ###############################################################################
652 dnl ---------- *** ----------
654 AC_ARG_ENABLE([hardlink-deliver],
655     AS_HELP_STRING([--enable-hardlink-deliver],
656         [Put files into deliver folder as hardlinks instead of copying them
657         over. Saves space and speeds up build.])
660 AC_ARG_ENABLE(mergelibs,
661     AS_HELP_STRING([--enable-mergelibs],
662         [Enables linking of big, merged, library. Experimental feature tested
663         only on Linux and Android.])
666 AC_ARG_ENABLE(graphite,
667     AS_HELP_STRING([--enable-graphite],
668         [Enables the compilation of Graphite smart font rendering.])
671 AC_ARG_ENABLE(fetch-external,
672     AS_HELP_STRING([--disable-fetch-external],
673         [Disables fetching external tarballs from web sources.])
676 AC_ARG_ENABLE(lockdown,
677     AS_HELP_STRING([--disable-lockdown],
678         [Disables the gconf integration work in LibreOffice.]),
681 AC_ARG_ENABLE(vba,
682     AS_HELP_STRING([--disable-vba],
683         [Disables the vba compatibility feature.])
686 AC_ARG_ENABLE(pch,
687     AS_HELP_STRING([--enable-pch],
688         [DEPRECATED : is ignored])
691 AC_ARG_ENABLE(win-mozab-driver,
692     AS_HELP_STRING([--enable-win-mozab-driver],
693         [LibreOffice includes a driver to connect to Mozilla 
694          address books under Windows, to build with this version, use this option.])
697 AC_ARG_ENABLE(epm,
698     AS_HELP_STRING([--enable-epm],
699         [LibreOffice includes self-packaging code, that requires epm, however epm is
700          useless for large scale package building.])
703 AC_ARG_ENABLE(odk,
704     AS_HELP_STRING([--disable-odk],
705         [LibreOffice includes an ODK, office development kit which some packagers may
706          wish to build without.])
709 AC_ARG_ENABLE(mathmldtd,
710     AS_HELP_STRING([--enable-mathmldtd],
711         [Enable bundling of (modified) MathML 1.01 DTD.])
714 AC_ARG_ENABLE(evolution2,
715     AS_HELP_STRING([--enable-evolution2],
716         [Allows the built-in evolution 2 addressbook connectivity build to be
717          enabled.])
720 AC_ARG_ENABLE(directx,
721     AS_HELP_STRING([--disable-directx],
722         [Remove DirectX implementation for the new XCanvas interface.
723          The DirectX support requires more stuff installed on Windows to
724          compile. (DirectX SDK, GDI+ libs)])
727 AC_ARG_ENABLE(activex,
728     AS_HELP_STRING([--disable-activex],
729         [Disable the use of ActiveX for a Windows build.
730         This switch is mandatory when using VC++ 2008 Express.])
733 AC_ARG_ENABLE(atl,
734     AS_HELP_STRING([--disable-atl],
735         [Disable the use of ATL for a Windows build.])
736     [
737                           This switch is mandatory when using VC++ 2008 Express.
738     ],
741 AC_ARG_ENABLE(werror,
742     AS_HELP_STRING([--enable-werror],
743         [Turn warnings to errors. (Has no effect in modules where the treating
744          of warnings as errors is disabled explicitly.)]),
747 AC_ARG_ENABLE(assert-always-abort,
748     AS_HELP_STRING([--enable-assert-always-abort],
749         [make assert() abort even in release code.]),
752 AC_ARG_ENABLE(dbgutil,
753     AS_HELP_STRING([--enable-dbgutil],
754         [Provide debugging support from --enable-debug and include additional debugging
755          utilities such as object counting or more expensive checks.
756          This is the recommended option for developers.
757          Note that this makes the build ABI incompatible, it is not possible to mix object
758          files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
760 AC_ARG_ENABLE(debug,
761     AS_HELP_STRING([--enable-debug],
762         [Include debugging information, disable compiler optimization and inlining plus
763          extra debugging code like assertions. Extra large build! (enables -g compiler flag
764          and dmake debug=true).]))
766 AC_ARG_ENABLE(selective-debuginfo,
767     AS_HELP_STRING([--enable-selective-debuginfo],
768         [If --enable-debug or --enable-dbgutil is used, build debugging information
769          (-g compiler flag) only for the specified gbuild build targets
770          (where all means everything, - prepended means not to enable, / appended means
771          everything in the directory; there is no ordering, more specific overrides
772          more general, and disabling takes precedence).
773          Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
775 AC_ARG_ENABLE(symbols,
776     AS_HELP_STRING([--enable-symbols],
777         [Include debugging symbols in output while preserve optimization.
778          This enables -g compiler flag for GCC or equivalent,
779          without changing anything else compared to productive code.]))
781 AC_ARG_ENABLE(compiler-plugins,
782     AS_HELP_STRING([--enable-compiler-plugins],
783         [Enable compiler plugins that will perform additional checks during
784          building. Enabled automatically by --enable-dbgutil.]))
786 AC_ARG_ENABLE(linkoo,
787     AS_HELP_STRING([--disable-linkoo],
788         [Disable linkoo for the smoketest installation.]))
790 AC_ARG_ENABLE(lto,
791     AS_HELP_STRING([--enable-lto],
792         [Enable link-time optimization. Suitable for product builds.
793          Building takes longer but libraries are optimized for speed.
794          (possible only with gcc-4.5 or later,
795           better to use gcc-4.6 and 'gold' as linker)]))
797 AC_ARG_ENABLE(crashdump,
798     AS_HELP_STRING([--enable-crashdump],
799         [Enable the crashdump feature.]))
801 AC_ARG_ENABLE(python,
802     AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
803         [Enables or disables Python support at run-time and build-time.
804          Also specifies what Python to use. 'auto' is the
805          default. Note that Python can be disabled with
806          --disable-python or --enable-python=no only if no
807          translations are required.]))
809 AC_ARG_ENABLE(gtk,
810     AS_HELP_STRING([--disable-gtk],
811         [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
812 ,enable_gtk=yes)
814 AC_ARG_ENABLE(gtk3,
815     AS_HELP_STRING([--enable-gtk3],
816         [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
817 ,enable_gtk3=no)
819 AC_ARG_ENABLE(systray,
820     AS_HELP_STRING([--disable-systray],
821         [Determines whether to build the systray quickstarter.]),
822 ,enable_systray=yes)
824 AC_ARG_ENABLE(split-app-modules,
825     AS_HELP_STRING([--enable-split-app-modules],
826         [Split file lists for app modules, e.g. base, calc.
827          Has effect only with make distro-pack-install]),
830 AC_ARG_ENABLE(split-opt-features,
831     AS_HELP_STRING([--enable-split-opt-features],
832         [Split file lists for some optional features, .e.g. pyuno, testtool.
833          Has effect only with make distro-pack-install]),
836 AC_ARG_ENABLE(cairo-canvas,
837 [  --disable-cairo-canvas  Determines whether to build the Cairo canvas on
838                           platforms where Cairo is available.
841 AC_ARG_ENABLE(opengl,
842     AS_HELP_STRING([--disable-opengl],
843         [Determines whether to build the OpenGL 3D slide transitions component.]),
844 ,enable_opengl=yes)
846 AC_ARG_ENABLE(dbus,
847     AS_HELP_STRING([--disable-dbus],
848         [Determines whether to enable features that depend on dbus.
849          e.g. Presentation mode screensaver control, bluetooth presentation control]),
850 ,enable_dbus=yes)
852 AC_ARG_ENABLE(packagekit,
853     AS_HELP_STRING([--enable-packagekit],
854         [Determines whether to enable features using packagekit.
855          Right now that is auto font install]),
858 AC_ARG_ENABLE(sdremote,
859     AS_HELP_STRING([--disable-sdremote],
860         [Determines whether to enable Impress remote control.]),
861 ,enable_sdremote=yes)
863 AC_ARG_ENABLE(sdremote-bluetooth,
864     AS_HELP_STRING([--disable-sdremote-bluetooth],
865         [Determines whether to build sdremote with bluetooth support.
866          Requires dbus on Linux.]))
868 AC_ARG_ENABLE(gconf,
869     AS_HELP_STRING([--disable-gconf],
870         [Determines whether to use the GConf support.]),
871 ,enable_gconf=yes)
873 AC_ARG_ENABLE(gnome-vfs,
874     AS_HELP_STRING([--disable-gnome-vfs],
875         [Determines whether to use the Gnome Virtual Filing System on platforms
876          where that VFS is available.]),
877 ,enable_gnome_vfs=yes)
879 AC_ARG_ENABLE(gio,
880     AS_HELP_STRING([--enable-gio],
881         [Determines whether to use the GIO support.]),
882 ,enable_gio=no)
884 AC_ARG_ENABLE(telepathy,
885     AS_HELP_STRING([--enable-telepathy],
886         [Determines whether to enable Telepathy for collaboration.]),
887 ,enable_telepathy=no)
889 AC_ARG_ENABLE(build-mozab,
890     AS_HELP_STRING([--disable-build-mozab],
891         [Use this option if you do not want to build the Mozilla address book
892          components from the Mozilla source code but take precompiled zips.
893          Meaningful only after --enable-win-mozab-driver.]),
896 AC_ARG_ENABLE(tde,
897     AS_HELP_STRING([--enable-tde],
898         [Determines whether to use TQt/TDE vclplug on platforms where TQt and
899          TDE are available.]),
902 AC_ARG_ENABLE(tdeab,
903     AS_HELP_STRING([--disable-tdeab],
904         [Disable the TDE address book support.]),
906     if test "$enable_tde" = "yes"; then
907         enable_tdeab=yes
908     fi
911 AC_ARG_ENABLE(kde,
912     AS_HELP_STRING([--enable-kde],
913         [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
914          KDE3 are available.]),
917 AC_ARG_ENABLE(kdeab,
918     AS_HELP_STRING([--disable-kdeab],
919         [Disable the KDE3 address book support.]),
921     if test "$enable_kde" = "yes"; then
922         enable_kdeab=yes
923     fi
926 AC_ARG_ENABLE(kde4,
927     AS_HELP_STRING([--enable-kde4],
928         [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
929          KDE4 are available. May be used with --enable-kde if you want to support
930          both KDE3 and KDE4.]),
933 AC_ARG_ENABLE(headless,
934     AS_HELP_STRING([--enable-headless],
935         [Disable building of GUIs to reduce dependencies. Useful for
936         server usage. Work in progress, use only if you are hacking on
937         it. Not related to the --headless option.]), ,)
939 AC_ARG_ENABLE(unix-qstart-libpng,
940     AS_HELP_STRING([--disable-unix-qstart-libpng],
941         [On UNIX systems, we have a faster splash app, that can use libpng to
942          render its splash, if we can safely link to the system libpng then
943          enabling this is a good idea (ie. for Linux Distro packaging).]),
944 ,enable_unix_qstart_libpng=yes)
946 AC_ARG_ENABLE(rpath,
947     AS_HELP_STRING([--disable-rpath],
948         [Disable the use of relative paths in shared libraries.]),
951 AC_ARG_ENABLE(randr,
952     AS_HELP_STRING([--disable-randr],
953         [Disable RandR support in the vcl project.]),
954 ,enable_randr=yes)
956 AC_ARG_ENABLE(randr-link,
957     AS_HELP_STRING([--disable-randr-link],
958         [Disable linking with libXrandr, instead dynamically open it at runtime.]),
959 ,enable_randr_link=yes)
961 AC_ARG_ENABLE(gstreamer,
962     AS_HELP_STRING([--enable-gstreamer],
963         [Enable building with the new gstreamer 1.0 avmedia backend.]),
964 ,enable_gstreamer=no)
966 AC_ARG_ENABLE(gstreamer-0-10,
967     AS_HELP_STRING([--disable-gstreamer-0-10],
968         [Disable building the gstreamer avmedia backend.]),
969 ,enable_gstreamer_0_10=yes)
971 AC_ARG_ENABLE(neon,
972     AS_HELP_STRING([--disable-neon],
973         [Disable neon and the compilation of webdav binding.]),
976 AC_ARG_ENABLE(cve-tests,
977     AS_HELP_STRING([--disable-cve-tests],
978         [Prevent CVE tests to be executed]),
981 AC_ARG_ENABLE(build-unowinreg,
982     AS_HELP_STRING([--enable-build-unowinreg],
983         [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
984          compiler is needed on Linux.])
985     [
986                           Usage:     --enable-build-unowinreg
987     ],
990 AC_ARG_ENABLE(verbose,
991     AS_HELP_STRING([--enable-verbose],
992         [Increase build verbosity.])[
993   --disable-verbose       Decrease build verbosity.],
996 AC_ARG_ENABLE(dependency-tracking,
997     AS_HELP_STRING([--enable-dependency-tracking],
998         [Do not reject slow dependency extractors.])[
999   --disable-dependency-tracking
1000                           Disables generation of dependency information.
1001                           Speed up one-time builds.],
1004 AC_ARG_ENABLE(icecream,
1005     AS_HELP_STRING([--enable-icecream],
1006         [Use the 'icecream' distributed compiling tool to speedup the compilation.
1007          It defaults to /opt/icecream for the location of the icecream gcc/g++
1008          wrappers, you can override that using --with-gcc-home=/the/path switch.]),
1011 AC_ARG_ENABLE(zenity,
1012     AS_HELP_STRING([--disable-zenity],
1013         [Do not display a build icon in the notification area (on unix) during build.]),
1014 ,enable_zenity=yes)
1016 AC_ARG_ENABLE(cups,
1017     AS_HELP_STRING([--disable-cups],
1018         [Do not build cups support.])
1021 AC_ARG_ENABLE(ccache,
1022     AS_HELP_STRING([--disable-ccache],
1023         [Do not try to use ccache automatically.
1024          By default, we will try to detect if ccache is available; in that case if
1025          CC/CXX are not yet set, and --enable-icecream is not given, we
1026          attempt to use ccache. --disable-ccache disables ccache completely.
1030 AC_ARG_ENABLE(64-bit,
1031     AS_HELP_STRING([--enable-64-bit],
1032         [Build a 64-bit LibreOffice on platforms where the normal and only supported build
1033          is 32-bit. In other words, this option is experimental and possibly quite broken,
1034          use only if you are hacking on 64-bit support.]), ,)
1036 AC_ARG_ENABLE(extra-gallery,
1037     AS_HELP_STRING([--enable-extra-gallery],
1038         [Add extra gallery content.]),
1041 AC_ARG_ENABLE(extra-template,
1042     AS_HELP_STRING([--enable-extra-template],
1043         [Add extra template content.]),
1046 AC_ARG_ENABLE(extra-sample,
1047     AS_HELP_STRING([--enable-extra-sample],
1048         [Add extra sample content.]),
1051 AC_ARG_ENABLE(extra-font,
1052     AS_HELP_STRING([--enable-extra-font],
1053         [Add extra font content.]),
1056 AC_ARG_ENABLE(lomenubar,
1057     AS_HELP_STRING([--enable-lomenubar],
1058         [Enable global menu support.]),
1061 AC_ARG_ENABLE(online-update,
1062     AS_HELP_STRING([--enable-online-update],
1063         [Enable the online update service that will check for new versions of
1064          LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
1067 AC_ARG_ENABLE(release-build,
1068     AS_HELP_STRING([--enable-release-build],
1069         [Enable release build.
1070          See http://wiki.documentfoundation.org/DevBuild]),
1073 AC_ARG_ENABLE(windows-build-signing,
1074     AS_HELP_STRING([--enable-windows-build-signing],
1075         [Enable signing of windows binaries (*.exe, *.dll)]),
1078 AC_ARG_ENABLE(silent-msi,
1079     AS_HELP_STRING([--enable-silent-msi],
1080         [Enable MSI with LIMITUI=1 (silent install).]),
1083 AC_ARG_ENABLE(macosx-code-signing,
1084     AS_HELP_STRING([--enable-macosx-code-signing<=identity>],
1085         [Sign the app bundle being stored in the disk image. The
1086          default is to do signing if there is a suitable certificate
1087          in your keychain, so if you don't want that, use the
1088          corresponding --disable option. Experimental work in
1089          progress, don't use unless you are working on this.]),
1092 AC_ARG_ENABLE(postgresql-sdbc,
1093     AS_HELP_STRING([--disable-postgresql-sdbc],
1094         [Disable the build of the PostgreSQL-SDBC driver.])
1097 AC_ARG_ENABLE(coretext,
1098     AS_HELP_STRING([--enable-coretext],
1099         [Use CoreText framework on Mac (instead of ATSU).
1100         Known to not work properly, use only if you plan to work on that.]),
1103 AC_ARG_ENABLE(winegcc,
1104     AS_HELP_STRING([--enable-winegcc],
1105         [Enable use of winegcc during the build, in order to create msi* tools
1106          needed for MinGW cross-compilation.]),
1109 AC_ARG_ENABLE(liblangtag,
1110     AS_HELP_STRING([--disable-liblangtag],
1111         [Disable use of liblangtag, and insted use an own simple
1112          implementation.]),
1115 AC_ARG_ENABLE(bogus-pkg-config,
1116     AS_HELP_STRING([--enable-bogus-pkg-config],
1117         [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.]),
1120 dnl ===================================================================
1121 dnl Optional Packages (--with/without-)
1122 dnl ===================================================================
1124 AC_ARG_WITH(gnu-patch,
1125     AS_HELP_STRING([--with-gnu-patch],
1126         [Specify location of GNU patch on Solaris or FreeBSD.]),
1129 AC_ARG_WITH(build-platform-configure-options,
1130         [Specify options for the configure script run for the *build* platform in a cross-compilation])
1132 AC_ARG_WITH(gnu-cp,
1133     AS_HELP_STRING([--with-gnu-cp],
1134         [Specify location of GNU cp on Solaris or FreeBSD.]),
1137 AC_ARG_WITH(external-tar,
1138     AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
1139         [Specify path to tarfiles manually.]),
1140     TARFILE_LOCATION=$withval ,
1143 AC_ARG_WITH(solver-and-workdir-root,
1144     AS_HELP_STRING([--with-solver-and-workdir-root=<PATH>],
1145         [Specify path that contains SOLARVER and WORKDIR directories manually.])
1148 AC_ARG_WITH(linked-git,
1149     AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
1150         [Specify another checkout's clonedir to re-use. This makes use of
1151                  git-new-workdir, and saves a lot of diskspace when having multiple
1152                  trees side-by-side.]),
1153     GIT_LINK_SRC=$withval ,
1156 AC_ARG_WITH(vba-package-format,
1157     AS_HELP_STRING([--with-vba-package-format],
1158         [Specify package format for vba compatibility api. Specifying  "builtin"
1159          means the api component and associated type library are  part of the
1160          installation set. Specifying "extn" creates an uno extension that is
1161          part of the installation set (located in the program directory) that
1162          MUST be optionally registered using either the unopkg executeable or the
1163          extension manager gui.])
1164     [
1165                           Note: "builtin" is the default, "extn" can cause
1166                           problems.
1168                           Usage:     --with-vba-package-format="builtin" or
1169                                      --with-vba-package-format="extn"
1170     ],
1173 AC_ARG_WITH(theme,
1174     AS_HELP_STRING([--with-theme="theme1 theme2..."],
1175         [Choose which themes to include. By default those themes with an '*' are included.
1176          Possible choices: *crystal, *default (galaxy), *hicontrast, human, industrial, *oxygen, *tango, *tango_testing.]),
1179 AC_ARG_WITH(helppack-integration,
1181   --without-helppack-integration      It will not integrate the helppacks to the installer
1182                           of the product.
1183                           Please use this switch to use the online help or separate help packages.],
1186 AC_ARG_WITH(fonts,
1187     AS_HELP_STRING([--without-fonts],
1188         [LibreOffice includes some third-party fonts to provide a reliable basis for
1189          help content, templates, samples, etc. When these fonts are already
1190          known to be available on the system then you should use this option.]),
1193 AC_ARG_WITH(ppds,
1194     AS_HELP_STRING([--without-ppds],
1195         [Removes Postscript Printer definition files from LibreOffice
1196          installation set, for people building for specific distributions where
1197          PPDs are known to be already available (every recent distro with CUPS backend).]),
1200 AC_ARG_WITH(afms,
1201     AS_HELP_STRING([--without-afms],
1202         [Removes bitmap font files from LibreOffice installation set, for people
1203          building for specific distributions where AFM files or TrueType Fonts
1204          are known to be available.]),
1207 AC_ARG_WITH(agfa-monotype-fonts,
1208      AS_HELP_STRING([--with-agfa-monotype-fonts],
1209           [This switch should only be enabled for those who have the right
1210            to use or distribute the proprietary Agfa Monotype
1211            fonts.]),
1214 AC_ARG_WITH(epm,
1215     AS_HELP_STRING([--with-epm],
1216         [Decides which epm to use. Default is to use the one from the system if
1217          one is built. When either this is not there or you say =internal epm
1218          will be built.]),
1221 AC_ARG_WITH(package-format,
1222     AS_HELP_STRING([--with-package-format],
1223         [Specify package format(s) for LibreOffice installsets. Default is the
1224          "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
1225          inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
1226           installed, msi. Example: --with-package-format="deb dmg"]),
1229 AC_ARG_WITH(system-libs,
1230     AS_HELP_STRING([--with-system-libs],
1231         [Use libraries already on system -- enables all --with-system-* flags except
1232          mozilla.]),
1235 AC_ARG_WITH(system-headers,
1236     AS_HELP_STRING([--with-system-headers],
1237         [Use headers already on system -- enables all --with-system-* flags for
1238          external packages whose headers are the only entities used i.e.
1239          boost/vigra/odbc/sane-header(s).]),,
1240     [with_system_headers="$with_system_libs"])
1242 AC_ARG_WITH(system-jars,
1243     AS_HELP_STRING([--without-system-jars],
1244         [When building with --with-system-libs, also the needed jars are expected
1245          on the system. Use this to disable that]),,
1246     [with_system_jars="$with_system_libs"])
1248 AC_ARG_WITH(system-cairo,
1249     AS_HELP_STRING([--with-system-cairo],
1250         [Use Cairo libraries already on system.]),,
1251     [with_system_cairo="$with_system_libs"])
1253 AC_ARG_WITH(system-graphite,
1254     AS_HELP_STRING([--with-system-graphite],
1255         [Use graphite library already installed on system.]),,
1256     [with_system_graphite="$with_system_libs"])
1258 AC_ARG_WITH(system-nss,
1259     AS_HELP_STRING([--with-system-nss],
1260         [Use NSS/nspr libraries already on system.]),,
1261     [with_system_nss="$with_system_libs"])
1263 AC_ARG_WITH(mozilla-toolkit,
1264     AS_HELP_STRING([--with-mozilla-toolkit],
1265         [DEPRECATED : is ignored]),
1268 AC_ARG_WITH(myspell-dicts,
1269     AS_HELP_STRING([--without-myspell-dicts],
1270         [Removes myspell dictionaries from LibreOffice installation set, for
1271          people building for specific distributions where the myspell dictionaries
1272          are installed from other sources.]),
1275 AC_ARG_WITH(system-dicts,
1276     AS_HELP_STRING([--without-system-dicts],
1277         [Do not use dictionaries from system paths.]),
1280 AC_ARG_WITH(external-dict-dir,
1281     AS_HELP_STRING([--with-external-dict-dir],
1282         [Specify external dictionary dir.]),
1285 AC_ARG_WITH(external-hyph-dir,
1286     AS_HELP_STRING([--with-external-hyph-dir],
1287         [Specify external hyphenation pattern dir.]),
1290 AC_ARG_WITH(external-thes-dir,
1291     AS_HELP_STRING([--with-external-thes-dir],
1292         [Specify external thesaurus dir.]),
1295 AC_ARG_WITH(system-zlib,
1296     AS_HELP_STRING([--with-system-zlib],
1297         [Use zlib already on system.]),,
1298     [with_system_zlib=auto])
1300 AC_ARG_WITH(system-openssl,
1301     AS_HELP_STRING([--with-system-openssl],
1302         [Use OpenSSL already on system.]),,
1303     [with_system_openssl="$with_system_libs"])
1305 AC_ARG_WITH(system-jpeg,
1306     AS_HELP_STRING([--with-system-jpeg],
1307         [Use jpeg already on system.]),,
1308     [with_system_jpeg=auto])
1310 AC_ARG_WITH(system-clucene,
1311     AS_HELP_STRING([--with-system-clucene],
1312         [Use clucene already on system.]),,
1313     [with_system_clucene="$with_system_libs"])
1315 AC_ARG_WITH(system-expat,
1316     AS_HELP_STRING([--with-system-expat],
1317         [Use expat already on system.]),,
1318     [with_system_expat="$with_system_libs"])
1320 AC_ARG_WITH(system-libcmis,
1321     AS_HELP_STRING([--with-system-libcmis],
1322         [Use libcmis already on system.]),,
1323     [with_system_libcmis="$with_system_libs"])
1325 AC_ARG_WITH(system-lcms2,
1326     AS_HELP_STRING([--with-system-lcms2],
1327         [Use littlecms v2 already on system.]),,
1328     [with_system_lcms2="$with_system_libs"])
1330 AC_ARG_WITH(system-libcdr,
1331     AS_HELP_STRING([--with-system-libcdr],
1332         [Use libcdr already on system.]),,
1333     [with_system_libcdr="$with_system_libs"])
1335 AC_ARG_WITH(system-libmspub,
1336     AS_HELP_STRING([--with-system-libmspub],
1337         [Use libmspub already on system.]),,
1338     [with_system_libmspub="$with_system_libs"])
1340 AC_ARG_WITH(system-libvisio,
1341     AS_HELP_STRING([--with-system-libvisio],
1342         [Use libvisio already on system.]),,
1343     [with_system_libvisio="$with_system_libs"])
1345 AC_ARG_WITH(system-libwpd,
1346     AS_HELP_STRING([--with-system-libwpd],
1347         [Use libwpd already on system.]),,
1348     [with_system_libwpd="$with_system_libs"])
1350 AC_ARG_WITH(system-libwps,
1351     AS_HELP_STRING([--with-system-libwps],
1352         [Use libwps already on system.]),,
1353     [with_system_libwps="$with_system_libs"])
1355 AC_ARG_WITH(system-libwpg,
1356     AS_HELP_STRING([--with-system-libwpg],
1357         [Use libwpg already on system.]),,
1358     [with_system_libwpg="$with_system_libs"])
1360 AC_ARG_WITH(system-libxml,
1361     AS_HELP_STRING([--with-system-libxml],
1362         [Use libxml/libxslt already on system.]),,
1363     [with_system_libxml=auto])
1365 AC_ARG_WITH(system-icu,
1366     AS_HELP_STRING([--with-system-icu],
1367         [Use icu already on system.]),,
1368     [with_system_icu="$with_system_libs"])
1370 AC_ARG_WITH(system-ucpp,
1371     AS_HELP_STRING([--with-system-ucpp],
1372         [Use ucpp already on system.]),,
1373     [])
1375 AC_ARG_WITH(system-openldap,
1376     AS_HELP_STRING([--with-system-openldap],
1377         [Use the OpenLDAP LDAP SDK already on system.]),,
1378     [with_system_openldap="$with_system_libs"])
1380 AC_ARG_WITH(system-poppler,
1381     AS_HELP_STRING([--with-system-poppler],
1382         [Use system poppler (only needed for PDF import).]),,
1383     [with_system_poppler="$with_system_libs"])
1385 AC_ARG_WITH(system-apache-commons,
1386     AS_HELP_STRING([--with-system-apache-commons],
1387         [Use Apache commons libraries already on system.]),,
1388     [with_system_apache_commons="$with_system_jars"])
1390 AC_ARG_WITH(system-mysql,
1391     AS_HELP_STRING([--with-system-mysql],
1392         [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
1393          extension. If the the mysql_config executable is not in PATH, use MYSQLCONFIG to
1394          point to it.]),,
1395     [with_system_mysql="$with_system_libs"])
1397 AC_ARG_WITH(libmysql-path,
1398     AS_HELP_STRING([--with-libmysql-path],
1399         [Use Connector/C (libmysql) installation for building the MySQL
1400          Connector/LibreOffice extension.])
1401     [
1402                           Usage:     --with-libmysql-path=<absolute path to
1403                                                   your Connector/C installation>
1404     ],
1407 AC_ARG_WITH(system-mysql-cppconn,
1408     AS_HELP_STRING([--with-system-mysql-cppconn],
1409         [Use MySQL C++ Connector libraries already on system.]),,
1410     [with_system_mysql_cppconn="$with_system_libs"])
1412 AC_ARG_WITH(system-postgresql,
1413     AS_HELP_STRING([--with-system-postgresql],
1414         [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1415          driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1416     [with_system_postgresql="$with_system_libs"])
1418 AC_ARG_WITH(libpq-path,
1419     AS_HELP_STRING([--with-libpq-path],
1420         [Use this PostgreSQL C interface (libpq) installation for building
1421          the PostgreSQL-SDBC extension.])
1422     [
1423                           Usage:     --with-libpq-path=<absolute path to
1424                                                   your libq installation>
1425     ],
1428 AC_ARG_WITH(system-hsqldb,
1429     AS_HELP_STRING([--with-system-hsqldb],
1430         [Use hsqldb already on system.]))
1432 AC_ARG_WITH(hsqldb-jar,
1433     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1434         [Specify path to jarfile manually.]),
1435     HSQLDB_JAR=$withval)
1437 AC_ARG_ENABLE(scripting-beanshell,
1438     AS_HELP_STRING([--disable-scripting-beanshell],
1439         [Disable support for scripts in BeanShell.]),
1443 AC_ARG_WITH(system-beanshell,
1444     AS_HELP_STRING([--with-system-beanshell],
1445         [Use beanshell already on system.]),,
1446     [with_system_beanshell="$with_system_jars"])
1448 AC_ARG_WITH(beanshell-jar,
1449     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1450         [Specify path to jarfile manually.]),
1451     BSH_JAR=$withval)
1453 AC_ARG_ENABLE(scripting-javascript,
1454     AS_HELP_STRING([--disable-scripting-javascript],
1455         [Disable support for scripts in JavaScript.]),
1459 AC_ARG_WITH(system-rhino,
1460     AS_HELP_STRING([--with-system-rhino],
1461         [Use rhino already on system.]),,)
1462 #    [with_system_rhino="$with_system_jars"])
1463 # Above is not used as we have different debug interface
1464 # patched into internal rhino. This code needs to be fixed
1465 # before we can enable it by default.
1467 AC_ARG_WITH(rhino-jar,
1468     AS_HELP_STRING([--with-rhino-jar=JARFILE],
1469         [Specify path to jarfile manually.]),
1470     RHINO_JAR=$withval)
1472 AC_ARG_WITH(commons-codec-jar,
1473     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1474         [Specify path to jarfile manually.]),
1475     COMMONS_CODEC_JAR=$withval)
1477 AC_ARG_WITH(commons-lang-jar,
1478     AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1479         [Specify path to jarfile manually.]),
1480     COMMONS_LANG_JAR=$withval)
1482 AC_ARG_WITH(commons-httpclient-jar,
1483     AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1484         [Specify path to jarfile manually.]),
1485     COMMONS_HTTPCLIENT_JAR=$withval)
1487 AC_ARG_WITH(commons-logging-jar,
1488     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1489         [Specify path to jarfile manually.]),
1490     COMMONS_LOGGING_JAR=$withval)
1492 AC_ARG_WITH(system-servlet-api,
1493     AS_HELP_STRING([--with-system-servlet-api],
1494         [Use servlet-api already on system.]),,
1495     [with_system_servlet_api="$with_system_jars"])
1497 AC_ARG_WITH(servlet-api-jar,
1498     AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
1499         [Specify path to jarfile manually.]),
1500     SERVLETAPI_JAR=$withval)
1502 AC_ARG_WITH(system-jfreereport,
1503     AS_HELP_STRING([--with-system-jfreereport],
1504         [Use JFreeReport already on system.]),,
1505     [with_system_jfreereport="$with_system_jars"])
1507 AC_ARG_WITH(sac-jar,
1508     AS_HELP_STRING([--with-sac-jar=JARFILE],
1509         [Specify path to jarfile manually.]),
1510     SAC_JAR=$withval)
1512 AC_ARG_WITH(libxml-jar,
1513     AS_HELP_STRING([--with-libxml-jar=JARFILE],
1514         [Specify path to jarfile manually.]),
1515     LIBXML_JAR=$withval)
1517 AC_ARG_WITH(flute-jar,
1518     AS_HELP_STRING([--with-flute-jar=JARFILE],
1519         [Specify path to jarfile manually.]),
1520     FLUTE_JAR=$withval)
1522 AC_ARG_WITH(jfreereport-jar,
1523     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1524         [Specify path to jarfile manually.]),
1525     JFREEREPORT_JAR=$withval)
1527 AC_ARG_WITH(liblayout-jar,
1528     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1529         [Specify path to jarfile manually.]),
1530     LIBLAYOUT_JAR=$withval)
1532 AC_ARG_WITH(libloader-jar,
1533     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1534         [Specify path to jarfile manually.]),
1535     LIBLOADER_JAR=$withval)
1537 AC_ARG_WITH(libloader-jar,
1538     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1539         [Specify path to jarfile manually.]),
1540     LIBLOADER_JAR=$withval)
1542 AC_ARG_WITH(libformula-jar,
1543     AS_HELP_STRING([--with-libformula-jar=JARFILE],
1544         [Specify path to jarfile manually.]),
1545     LIBFORMULA_JAR=$withval)
1547 AC_ARG_WITH(librepository-jar,
1548     AS_HELP_STRING([--with-librepository-jar=JARFILE],
1549         [Specify path to jarfile manually.]),
1550     LIBREPOSITORY_JAR=$withval)
1552 AC_ARG_WITH(libfonts-jar,
1553     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1554         [Specify path to jarfile manually.]),
1555     LIBFONTS_JAR=$withval)
1557 AC_ARG_WITH(libserializer-jar,
1558     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1559         [Specify path to jarfile manually.]),
1560     LIBSERIALIZER_JAR=$withval)
1562 AC_ARG_WITH(libbase-jar,
1563     AS_HELP_STRING([--with-libbase-jar=JARFILE],
1564         [Specify path to jarfile manually.]),
1565     LIBBASE_JAR=$withval)
1567 AC_ARG_WITH(system-odbc,
1568     AS_HELP_STRING([--with-system-odbc],
1569         [Use the odbc headers already on system.]),,
1570     [with_system_odbc="$with_system_headers"])
1572 AC_ARG_WITH(system-sane,
1573     AS_HELP_STRING([--with-system-sane],
1574         [Use sane.h already on system.]),,
1575     [with_system_sane="$with_system_headers"])
1577 AC_ARG_WITH(system-bluez,
1578     AS_HELP_STRING([--with-system-bluez],
1579         [Use bluetooth.h already on system.]),,
1580     [with_system_bluez="$with_system_headers"])
1582 AC_ARG_WITH(system-xextensions-headers,
1583     AS_HELP_STRING([--with-system-xextensions-headers],
1584         [To build without system X11 extensions headers, use
1585          --without-system-xextensions-headers. This is possibly
1586          useful on legacy unix systems which ship with the libs
1587          but without the headers.]))
1589 AC_ARG_WITH(system-mesa-headers,
1590     AS_HELP_STRING([--with-system-mesa-headers],
1591         [Use Mesa headers already on system.]),,
1592     [with_system_mesa_headers="$with_system_headers"])
1594 AC_ARG_WITH(system-curl,
1595     AS_HELP_STRING([--with-system-curl],
1596         [Use curl already on system.]),,
1597     [with_system_curl=auto])
1599 AC_ARG_WITH(system-boost,
1600     AS_HELP_STRING([--with-system-boost],
1601         [Use boost already on system.]),,
1602     [with_system_boost="$with_system_headers"])
1604 AC_ARG_WITH(system-mdds,
1605     AS_HELP_STRING([--with-system-mdds],
1606         [Use mdds already on system.]),,
1607     [with_system_mdds="$with_system_headers"])
1609 AC_ARG_WITH(system-vigra,
1610     AS_HELP_STRING([--with-system-vigra],
1611         [Use vigra already on system.]),,
1612     [with_system_vigra="$with_system_headers"])
1614 AC_ARG_WITH(system-neon,
1615     AS_HELP_STRING([--with-system-neon],
1616         [Use neon already on system.]),,
1617     [with_system_neon="$with_system_libs"])
1619 AC_ARG_WITH(system-hunspell,
1620     AS_HELP_STRING([--with-system-hunspell],
1621         [Use libhunspell already on system.]),,
1622     [with_system_hunspell="$with_system_libs"])
1624 AC_ARG_WITH(system-mythes,
1625     AS_HELP_STRING([--with-system-mythes],
1626         [Use mythes already on system.]),,
1627     [with_system_mythes="$with_system_libs"])
1629 AC_ARG_WITH(system-altlinuxhyph,
1630     AS_HELP_STRING([--with-system-altlinuxhyph],
1631         [Use ALTLinuxhyph already on system.]),,
1632     [with_system_altlinuxhyph="$with_system_libs"])
1634 AC_ARG_WITH(system-lpsolve,
1635     AS_HELP_STRING([--with-system-lpsolve],
1636         [Use lpsolve already on system.]),,
1637     [with_system_lpsolve="$with_system_libs"])
1639 AC_ARG_WITH(system-libexttextcat,
1640     AS_HELP_STRING([--with-system-libexttextcat],
1641         [Use libexttextcat already on system.]),,
1642     [with_system_libexttextcat="$with_system_libs"])
1644 AC_ARG_WITH(system-cppunit,
1645     AS_HELP_STRING([--with-system-cppunit],
1646         [Use cppunit already on system.]),,
1647     [with_system_cppunit="$with_system_libs"])
1649 AC_ARG_WITH(system-redland,
1650     AS_HELP_STRING([--with-system-redland],
1651         [Use redland library already on system.]),,
1652     [with_system_redland="$with_system_libs"])
1654 AC_ARG_WITH(system-orcus,
1655     AS_HELP_STRING([--with-system-orcus],
1656         [Use orcus library already on system.]),,
1657     [with_system_orcus="$with_system_libs"])
1659 AC_ARG_WITH(system-liblangtag,
1660     AS_HELP_STRING([--with-system-liblangtag],
1661         [Use liblangtag library already on system.]),,
1662     [with_system_liblangtag="$with_system_libs"])
1664 AC_ARG_WITH(system-mozilla,
1665     AS_HELP_STRING([--with-system-mozilla],
1666         [DEPRECATED : is ignored]),,
1669 AC_ARG_WITH(system-npapi-headers,
1670     AS_HELP_STRING([--with-system-npapi-headers],
1671         [Use NPAPI headers provided by system instead of bundled ones. Used in
1672          extensions/source/nsplugin (ENABLE_NPAPI_INTO_BROWSER=YES) and
1673          extensions/source/plugin (ENABLE_NPAPI_FROM_BROWSER=YES)]),,
1674     [with_system_npapi_headers="$with_system_headers"]
1677 AC_ARG_WITH(system-libpng,
1678     AS_HELP_STRING([--with-system-libpng],
1679         [Use libpng already on system.]),,
1680     [with_system_libpng=auto])
1682 AC_ARG_WITH(linker-hash-style,
1683     AS_HELP_STRING([--with-linker-hash-style],
1684         [Use linker with --hash-style=<style> when linking shared objects.
1685          Possible values: "sysv", "gnu", "both". The default value is "gnu"
1686          if supported on the build system, and "sysv" otherwise.]))
1688 AC_ARG_WITH(jdk-home,
1689     AS_HELP_STRING([--with-jdk-home],
1690         [If you have installed JDK 1.3 or later on your system please supply the
1691          path here. Note that this is not the location of the java command but the
1692          location of the entire distribution.])
1693     [
1694                           Usage:     --with-jdk-home=<absolute path to JDK home>
1695     ],
1698 AC_ARG_WITH(help,
1699     AS_HELP_STRING([--without-help],
1700         [Disable the build of help.]))
1702 AC_ARG_WITH(java,
1703     AS_HELP_STRING([--with-java],
1704         [Specify the name of the Java interpreter command. Typically "java"
1705          which is the default.
1707          To build without support for Java components, applets, accessibility
1708          or the XML filters written in Java, use --without-java or --with-java=no.])
1709     [
1710                           Usage:     --with-java==<java command>
1711                                      --without-java
1712     ],
1713     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1714     [ with_java=java ]
1717 AC_ARG_WITH(jvm-path,
1718     AS_HELP_STRING([--with-jvm-path],
1719         [Use a specific JVM search path at runtime.])
1720     [
1721                           Usage:     --with-jvm-path=<absolute path to parent of jvm home>
1723                           e. g.: --with-jvm-path=/usr/lib/
1724                                  to find JRE/JDK in /usr/lib/jvm/
1725     ],
1728 AC_ARG_WITH(ant-home,
1729     AS_HELP_STRING([--with-ant-home],
1730         [If you have installed Jakarta Ant on your system, please supply the path here.
1731          Note that this is not the location of the Ant binary but the location
1732          of the entire distribution.])
1733     [
1734                           Usage:     --with-ant-home=<absolute path to Ant home>
1735     ],
1738 AC_ARG_WITH(junit,
1739     AS_HELP_STRING([--with-junit],
1740         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1741          --without-junit disables those tests. Not relevant in the --without-java case.])
1742     [
1743                           Usage:     --with-junit=<absolute path to JUnit 4 jar>
1744     ],
1745 ,with_junit=yes)
1747 AC_ARG_WITH(perl-home,
1748     AS_HELP_STRING([--with-perl-home],
1749         [If you have installed Perl 5 Distribution, on your system, please
1750          supply the path here. Note that this is not the location of the Perl
1751          binary but the location of the entire distribution.])
1752     [
1753                           Usage:     --with-perl-home=<abs. path to Perl 5 home>
1754     ],
1757 AC_ARG_WITH(
1758     [doxygen],
1759     AS_HELP_STRING(
1760         [--with-doxygen],
1761         [Specifies the doxygen executable to use when generating ODK C/C++
1762          documentation. --without-doxygen disables generation of ODK C/C++
1763          documentation. Not relevant in the --disable-odk case.])
1764     [
1765                           Usage:     --with-doxygen=<absolute path to doxygen executable>
1766     ],,
1767     [with_doxygen=yes])
1769 AC_ARG_WITH(cl-home,
1770     AS_HELP_STRING([--with-cl-home],
1771         [For Windows NT users, please supply the path for the Microsoft C/C++
1772          compiler. Note that this is not the location of the compiler binary but
1773          the location of the entire distribution.])
1774     [
1775                           Usage:     --with-cl-home=<absolute path to Microsoft
1776                                                             C/C++ compiler home>
1777     ],
1780 AC_ARG_WITH(mspdb-path,
1781     AS_HELP_STRING([--with-mspdb-path],
1782         [For Microsoft C/C++ compiler users, please supply the path pointing to
1783          the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
1784          Visual Studio 2010).])
1785     [
1786                           Usage:     --with-mspdb-path=<path to
1787                                                        mspdb80.dll/mspdb100.dll>
1788     ],
1791 AC_ARG_WITH(midl-path,
1792     AS_HELP_STRING([--with-midl-path],
1793         [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
1794     [
1795                           Usage:     --with-midl-path=<abs. path to midl.exe>
1796     ],
1799 AC_ARG_WITH(csc-path,
1800     AS_HELP_STRING([--with-csc-path],
1801         [For Windows builds, please supply the path pointing to the csc.exe.
1802          Usually found automatically when building on Windows.])
1803     [
1804                           Usage:     --with-csc-path=<abs. path to csc.exe>
1805     ],
1808 AC_ARG_WITH(dotnet-framework-home,
1809     AS_HELP_STRING([--with-dotnet-framework-home],
1810         [For Microsoft compiler users, please supply the path pointing to
1811          lib/mscoree.lib, usually something like:
1812          "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
1813     [
1814                           Note that in most cases it will be automatically
1815                           found, though.
1817                           Usage:     --with-dotnet-framework-home=<absolute path to .NET
1818                                                           Framework>
1819     ],
1822 AC_ARG_WITH(windows-sdk-home,
1823     AS_HELP_STRING([--with-windows-sdk-home],
1824         [For Windows builds, please supply the path to the Windows SDK.
1825          Usually found automatically when building on Windows.])
1826     [
1827                           Usage:     --with-windows-sdk-home=<absolute path to Windows SDK>
1828     ],
1831 AC_ARG_WITH(directx-home,
1832     AS_HELP_STRING([--with-directx-home],
1833         [For Windows users, please supply the path to the Microsoft DirectX SDK.])
1834     [
1835                           Usage:     --with-directx-home=<absolute path to
1836                                                           Microsoft DirectX SDK>
1837     ],
1840 AC_ARG_WITH(nss-build-tools,
1841     AS_HELP_STRING([--with-nss-build-tools],
1842         [For Windows users, please supply the path to the nss build tools.])
1843     [
1844                           Usage:     --with-nss-build-tools=<absolute path to
1845                                                           nss build tools>
1847                           At the moment of this writing, an installer for the
1848                           mozilla build tools can be obtained from http://ftp.
1849                           mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
1850     ],
1851     NSSBUILDTOOLS=$withval ,
1852 ) # NSSBUILDTOOLS
1854 AC_ARG_WITH(lang,
1855     AS_HELP_STRING([--with-lang],
1856         [Use this option to build LibreOffice with additional language support.
1857          English (US) is always included by default.
1858          Separate multiple languages with space.
1859          For all languages, use --with-lang=ALL.])
1860     [
1861                           Usage:     --with-lang="es sw tu cs sk"
1862     ],
1865 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
1866 AC_ARG_WITH(krb5,
1867     AS_HELP_STRING([--with-krb5],
1868         [Enable MIT Kerberos 5 support in modules that support it.
1869          By default automatically enabled on platforms
1870          where a good system Kerberos 5 is available.]),
1873 AC_ARG_WITH(gssapi,
1874     AS_HELP_STRING([--with-gssapi],
1875         [Enable GSSAPI support in modules that support it.
1876          By default automatically enabled on platforms
1877          where a good system GSSAPI is available.]),
1880 dnl ===================================================================
1881 dnl Branding
1882 dnl ===================================================================
1884 AC_ARG_WITH(branding,
1885 [  --with-branding        Use given path to retrieve all branding images.
1886                           Expects /path/intro.png ...
1887                           /path/backing_rtl_right.png to be there. Individual
1888                           images can be overridden via --with-intro-bitmap ...
1889                           --with-startcenter-rtl-left-bitmap switches.
1891                           Usage:     --with-branding=/path/to/images
1892 ],,)
1894 AC_ARG_WITH(intro-bitmap,
1895 [  --with-intro-bitmap    Prefer the specified intro bitmap over the
1896                           the default one.
1898                           Usage:     --with-intro-bitmap=/path/my_ooo_intro.png
1899 ],,)
1901 AC_ARG_WITH(intro-progressbar-color,
1902 [  --with-intro-progressbar-color    Set color of progress bar on intro screen.
1903                                      Comma separated RGB values in decimal format.
1905                           Usage: --with-intro-progressbar-color=126,170,23
1906 ],,)
1908 AC_ARG_WITH(intro-progressbar-size,
1909 [  --with-intro-progressbar-size     Set size of progress bar on intro screen.
1910                                      Comma separated values in decimal format.
1912                           Usage: --with-intro-progressbar-size=319,10
1913 ],,)
1915 AC_ARG_WITH(intro-progressbar-position,
1916 [  --with-intro-progressbar-position Set position of progress bar on intro screen.
1917                                      Comma separated values in decimal format.
1919                           Usage: --with-intro-progressbar-position=164,225
1920 ],,)
1922 AC_ARG_WITH(intro-progressbar-frame-color,
1923 [  --with-intro-progressbar-frame-color    Set color of progress bar frame on intro screen.
1924                                            Comma separated RGB values in decimal format.
1926                           Usage: --with-intro-progressbar-frame-color=207,208,211
1927 ],,)
1929 AC_ARG_WITH(intro-progressbar-text-color,
1930     AS_HELP_STRING([--with-intro-progressbar-text-color],
1931         [Set color of progress bar text on intro screen. Comma separated RGB values in decimal format.])
1932     [
1933                           Usage: --with-intro-progressbar-text-color=207,208,211
1934 ],,)
1936 AC_ARG_WITH(intro-progressbar-text-baseline,
1937     AS_HELP_STRING([--with-intro-progressbar-text-baseline],
1938         [Set vertical position of progress bar text on intro screen. Value in decimal format.])
1939     [
1940                           Usage: --with-intro-progressbar-text-baseline=250
1941 ],,)
1943 AC_ARG_WITH(flat-logo-svg,
1944 [  --with-flat-logo-svg    Allows specification of the flat Logo SVG.
1946                           Usage:     --with-flat-logo-svg=/path/my_flat_logo.svg
1947 ],,)
1949 AC_ARG_WITH(about-background-svg,
1950 [  --with-about-background-svg    Allows specification of the background SVG for the About dialog.
1952                           Usage:     --with-about-background-svg=/path/my_libo_about.svg
1953 ],,)
1955 AC_ARG_WITH(startcenter-left-bitmap,
1956 [  --with-startcenter-left-bitmap    Similarly to --with-intro-bitmap, this allows
1957                                      specification of bitmap for the Start center.
1959                           Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
1960 ],,)
1962 AC_ARG_WITH(startcenter-right-bitmap,
1963 [  --with-startcenter-right-bitmap    Similarly to --with-intro-bitmap, this allows
1964                                       specification of bitmap for the Start center.
1966                           Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
1967 ],,)
1969 AC_ARG_WITH(startcenter-rtl-left-bitmap,
1970 [  --with-startcenter-rtl-left-bitmap    Similarly to --with-intro-bitmap, this allows
1971                                          specification of bitmap for the Start center.
1973                           Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
1974 ],,)
1976 AC_ARG_WITH(startcenter-rtl-right-bitmap,
1977 [  --with-startcenter-rtl-right-bitmap    Similarly to --with-intro-bitmap, this allows
1978                                           specification of bitmap for the Start center.
1980                           Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
1981 ],,)
1983 AC_ARG_WITH(startcenter-space-bitmap,
1984 [  --with-startcenter-space-bitmap    Similarly to --with-intro-bitmap, this allows
1985                                       specification of bitmap for the Start center.
1987                           Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
1988 ],,)
1990 AC_ARG_WITH(extra-buildid,
1991     AS_HELP_STRING([--with-extra-buildid],
1992         [Show addition build identification in about dialog.])
1993     [
1994                           Usage:     --with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"
1995     ],
1999 AC_ARG_WITH(vendor,
2000     AS_HELP_STRING([--with-vendor],
2001         [Set vendor of the build.])
2002     [
2003                           Usage:     --with-vendor="John the Builder"
2004     ],
2007 AC_ARG_WITH(unix-wrapper,
2008     AS_HELP_STRING([--with-unix-wrapper],
2009         [Redefines the name of the UNIX wrapper that will be used in the desktop
2010          files and in the desktop-integration RPMs.])
2011     [
2012                           Usage:     --with-unix-wrapper=ooffice
2013     ],
2016 AC_ARG_WITH(compat-oowrappers,
2017     AS_HELP_STRING([--with-compat-oowrappers],
2018         [Install oo* wrappers in parallel with
2019          lo* ones to keep backward compatibility.
2020          Has effect only with make distro-pack-install]),
2023 AC_ARG_WITH(asm-home,
2024     AS_HELP_STRING([--with-asm-home],
2025         [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
2026     [
2027                           Usage:     --with-asm-home=<path to assembler directory>
2028     ],
2031 AC_ARG_WITH(os-version,
2032     AS_HELP_STRING([--with-os-version],
2033         [For FreeBSD users, use this option option to override the detected OSVERSION.])
2034     [
2035                           Usage:     --with-os-version=<OSVERSION>
2036     ],
2039 AC_ARG_WITH(mingw-cross-compiler,
2040     AS_HELP_STRING([--with-mingw-cross-compiler],
2041         [Specify the MinGW cross-compiler to use.])
2042     [
2043                           Usage:     --with-mingw-cross-compiler=<mingw32-g++ command>
2045                           When building on the ODK on Unix and building unowinreg.dll,
2046                           specify the MinGW C++ cross-compiler.
2047     ],
2050 AC_ARG_WITH(idlc-cpp,
2051     AS_HELP_STRING([--with-idlc-cpp],
2052         [Specify the C Preprocessor to use for idlc.])
2053     [
2054                           Usage:     --with-idlc-cpp=cpp
2056                           Default is ucpp.
2057     ]
2060 AC_ARG_WITH(build-version,
2061     AS_HELP_STRING([--with-build-version],
2062         [Allows the builder to add a custom version tag that will appear in the
2063          Help/About box for QA purposes.])
2064     [
2065                           Usage:     --with-build-version="Built by Jim"
2066     ],
2067     with_build_version=$withval ,
2070 AC_ARG_WITH(alloc,
2071     AS_HELP_STRING([--with-alloc],
2072         [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
2073          Note that on FreeBSD/NetBSD system==jemalloc]),
2076 AC_ARG_WITH(sun-templates,
2077     AS_HELP_STRING([--with-sun-templates],
2078         [Integrate Sun template packages.]),
2081 AC_ARG_WITH(parallelism,
2082     AS_HELP_STRING([--with-parallelism],
2083         [Number of jobs to run simultaneously during build. Parallel builds can save a lot
2084          of time on multi-cpu machines. The real number of jobs can get up to parallelism*parallelism
2085          for a while in the first build phase. That will not happen when dmake is removed.
2086          Defaults to the number of CPUs on the machine, unless you configure --enable-icecream - then to 10.]),
2089 AC_ARG_WITH(check-jobs,
2090     AS_HELP_STRING([--with-check-jobs],
2091         [Maximum number of jobs that will be issued at the same time during 'make subsequenttest'.
2092          Default value is the same as 'parallelism'. Useful because the subsequent tests are very lightweight.]),
2095 AC_ARG_WITH(all-tarballs,
2096     AS_HELP_STRING([--with-all-tarballs],
2097         [Download all external tarballs unconditionally]))
2099 dnl ===================================================================
2100 dnl Test whether build target is Release Build
2101 dnl ===================================================================
2102 AC_MSG_CHECKING([whether build target is Release Build])
2103 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2104     AC_MSG_RESULT([no])
2105     ENABLE_RELEASE_BUILD="FALSE"
2106 else
2107     AC_MSG_RESULT([yes])
2108     ENABLE_RELEASE_BUILD="TRUE"
2110 AC_SUBST(ENABLE_RELEASE_BUILD)
2112 dnl ===================================================================
2113 dnl Test whether to sign Windows Build
2114 dnl ===================================================================
2115 AC_MSG_CHECKING([whether to sign windows build])
2116 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
2117     AC_MSG_RESULT([yes])
2118     WINDOWS_BUILD_SIGNING="TRUE"
2119 else
2120     AC_MSG_RESULT([no])
2121     WINDOWS_BUILD_SIGNING="FALSE"
2123 AC_SUBST(WINDOWS_BUILD_SIGNING)
2125 dnl ===================================================================
2126 dnl MacOSX build and runtime environment options
2127 dnl ===================================================================
2129 AC_ARG_WITH(macosx-sdk,
2130     AS_HELP_STRING([--with-macosx-sdk],
2131         [Use a specific SDK for building.])
2132     [
2133                           Usage:     --with-macosx-sdk=<version>
2135                           e. g.: --with-macosx-sdk=10.4
2137                           there are 3 options to control the MacOSX build:
2138                           --with-macosx-sdk (refered as 'sdk' below)
2139                           --with-macosx-version-min-required (refered as 'min' below)
2140                           --with-macosx-version-max-allowed (refered as 'max' below)
2142                           the connection between these value and the default they take is as follow:
2143                           ( ? means not specified on the command line, s means the SDK version found,
2144                           constraint: x <= y <= z)
2146                           ==========================================
2147                            command line      || config result
2148                           ==========================================
2149                           min  | max  | sdk  || min  | max  | sdk  |
2150                           ?    | ?    | ?    || 10.4 | 10.s | 10.s |
2151                           ?    | ?    | 10.x || 10.4 | 10.x | 10.x |
2152                           ?    | 10.x | ?    || 10.4 | 10.s | 10.s |
2153                           ?    | 10.x | 10.y || 10.4 | 10.x | 10.y |
2154                           10.x | ?    | ?    || 10.x | 10.s | 10.s |
2155                           10.x | ?    | 10.y || 10.x | 10.y | 10.y |
2156                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
2157                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2160                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2161                           for a detailled technical explanation of these variables
2163                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2165                           Note that even if in theory using a --with-macosx-version-max-allowed
2166                           (i.e. the MAC_OS_X_VERSION_MAX_ALLOWED macro) less than the SDK version
2167                           should work, in practice Apple doesn't seem to test that, and at least
2168                           compiling with -DMAC_OS_X_VERSION_MAX_ALLOWED=1060 against the 10.7 SDK
2169                           fails in a couple of places. Just because of oversights in ifdefs in the SDK
2170                           headers, but still.
2171     ],
2174 AC_ARG_WITH(macosx-version-min-required,
2175     AS_HELP_STRING([--with-macosx-version-min-required],
2176         [set the minimum OS version needed to run the built LibreOffice])
2177     [
2178                           Usage:     --with-macosx-version-min-required=<version>
2180                           e. g.: --with-macos-version-min-required=10.4
2181                           see --with-macosx-sdk for more info
2182     ],
2185 AC_ARG_WITH(macosx-version-max-allowed,
2186     AS_HELP_STRING([--with-macosx-version-max-allowed],
2187         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2188     [
2189                           Usage:     --with-macosx-version-max-allowed=<version>
2191                           e. g.: --with-macos-version-max-allowed=10.6
2192                           see --with-macosx-sdk for more info
2193     ],
2197 dnl ===================================================================
2198 dnl options for stuff used during cross-compilation build
2199 dnl These are superseded by --with-build-platform-configure-options
2200 dnl ===================================================================
2202 AC_ARG_WITH(system-boost-for-build,
2203     AS_HELP_STRING([--with-system-boost-for-build],
2204         [Use boost already on system for build tools (cross-compilation only).]))
2206 AC_ARG_WITH(system-cppunit-for-build,
2207     AS_HELP_STRING([--with-system-cppunit-for-build],
2208         [Use cppunit already on system for build tools (cross-compilation only).]))
2210 AC_ARG_WITH(system-expat-for-build,
2211     AS_HELP_STRING([--with-system-expat-for-build],
2212         [Use expat already on system for build tools (cross-compilation only).]))
2214 AC_ARG_WITH(system-icu-for-build,
2215     AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2216         [Use icu already on system for build tools (cross-compilation only).]))
2218 AC_ARG_WITH(system-libxml-for-build,
2219     AS_HELP_STRING([--with-system-libxml-for-build],
2220         [Use libxml/libxslt already on system for build tools (cross-compilation only).]))
2223 dnl ===================================================================
2224 dnl check for required programs (grep, awk, sed, bash)
2225 dnl ===================================================================
2227 pathmunge ()
2229     if test -n "$1"; then
2230         if test "$build_os" = "cygwin"; then
2231             PathFormat "$1"
2232             new_path=`cygpath -u "$formatted_path"`
2233         else
2234             new_path="$1"
2235         fi
2236         if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2237             if test "$2" = "after"; then
2238                 LO_PATH="$LO_PATH:$new_path"
2239             else
2240                 LO_PATH="$new_path:$LO_PATH"
2241             fi
2242         fi
2243         unset new_path
2244     fi
2247 AC_PROG_AWK
2248 AC_PATH_PROG( AWK, $AWK)
2249 if test -z "$AWK"; then
2250     AC_MSG_ERROR([install awk to run this script])
2253 AC_PATH_PROG(BASH, bash)
2254 if test -z "$BASH"; then
2255     AC_MSG_ERROR([bash not found in \$PATH])
2257 AC_SUBST(BASH)
2259 AC_MSG_CHECKING([for GNU or BSD tar])
2260 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
2261     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
2262     if test $? -eq 0;  then
2263         GNUTAR=$a
2264         break
2265     fi
2266 done
2267 AC_MSG_RESULT($GNUTAR)
2268 if test -z "$GNUTAR"; then
2269     AC_MSG_ERROR([not found. install GNU or BSD tar.])
2271 AC_SUBST(GNUTAR)
2273 AC_MSG_CHECKING([for tar's option to strip components])
2274 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2275 if test $? -eq 0; then
2276     STRIP_COMPONENTS="--strip-components"
2277 else
2278     $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2279     if test $? -eq 0; then
2280         STRIP_COMPONENTS="--strip-path"
2281     else
2282         STRIP_COMPONENTS="unsupported"
2283     fi
2285 AC_MSG_RESULT($STRIP_COMPONENTS)
2286 if test x$STRIP_COMPONENTS == xunsupported; then
2287     AC_MSG_ERROR([you need a tar that is able to strip components.])
2289 AC_SUBST(STRIP_COMPONENTS)
2291 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2292 dnl desktop OSes from "mobile" ones.
2294 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2295 dnl In other words, that when building for an OS that is not a
2296 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2298 dnl Note the direction of the implication; there is no assumption that
2299 dnl cross-compiling would imply a non-desktop OS.
2301 if test $_os != iOS -a $_os != Android; then
2302     BUILD_TYPE="$BUILD_TYPE DESKTOP"
2305 # Currently we build only viewer apps for Android (and for iOS not even that yet), so to avoid getting
2306 # some pathological export-related code and data linked in, we will add some judicious #ifndef
2307 # DISABLE_EXPORT in the code in places where the linker map shows it has a big impact. Places that
2308 # generate large amounts of code or data related to export only but still gets linked in. At least
2309 # that is the theory, let's see...
2311 if test -z "$enable_export"; then
2312     if test $_os != Android -a $_os != iOS; then
2313         enable_export=yes
2314     fi
2317 DISABLE_EXPORT=''
2318 if test "$enable_export" = yes; then
2319     BUILD_TYPE="$BUILD_TYPE EXPORT"
2320 else
2321     DISABLE_EXPORT='TRUE'
2322     SCPDEFS="$SCPDES -DDISABLE_EXPORT"
2324 AC_SUBST(DISABLE_EXPORT)
2326 dnl Decide whether to build database connectivity stuff (including
2327 dnl Base) or not. We probably don't want to on non-desktop OSes.
2329 if test -z "$enable_database_connectivity"; then
2330     # Do enable database connectivity for Android for now as otherwise
2331     # we presumably will get linking errors... We are not as far in
2332     # the work for iOS, so we might as well disable it for iOS already.
2334     # And actually, do enable it for iOS, too. Let's get back to
2335     # figuring out what to do with this later, if ever.
2337     # (Note that with "enable", I mean "enable building the related
2338     # code". Very likely little of it will make any sense at run-time
2339     # on Android or iOS and won't even be shipped with/linked into any
2340     # app.)
2342     #if test $_os != iOS; then
2343         enable_database_connectivity=yes
2344     #fi
2347 DISABLE_DBCONNECTIVITY=''
2348 if test "$enable_database_connectivity" = yes; then
2349     BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2350 else
2351     DISABLE_DBCONNECTIVITY='TRUE'
2352     SCPDEFS="$SCPDEFS -DDISABLE_DBCONNECTIVITY"
2354 AC_SUBST(DISABLE_DBCONNECTIVITY)
2356 if test -z "$enable_extensions"; then
2357     # For iOS disable extensions unless specifically overridden with
2358     # --enable-extensions.
2359     if test $_os != iOS; then
2360         enable_extensions=yes
2361     fi
2364 DISABLE_EXTENSIONS=''
2365 if test "$enable_extensions" = yes; then
2366     BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2367 else
2368     DISABLE_EXTENSIONS='TRUE'
2370 AC_SUBST(DISABLE_EXTENSIONS)
2372 if test -z "$enable_scripting"; then
2373     # Disable scripting for iOS unless specifically overridden
2374     # with --enable-scripting.
2375     if test $_os != iOS; then
2376         enable_scripting=yes
2377     fi
2380 DISABLE_SCRIPTING=''
2381 if test "$enable_scripting" = yes; then
2382     BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2383 else
2384     DISABLE_SCRIPTING='TRUE'
2385     SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2387 AC_SUBST(DISABLE_SCRIPTING)
2389 if test $_os = iOS -o $_os = Android; then
2390     # Disable dynamic_loading always for iOS and Android
2391     enable_dynamic_loading=no
2392 elif test -z "$enable_dynamic_loading"; then
2393     # Otherwise enable it unless speficically disabled
2394     enable_dynamic_loading=yes
2397 DISABLE_DYNLOADING=''
2398 if test "$enable_dynamic_loading" = yes; then
2399     BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2400 else
2401     DISABLE_DYNLOADING='TRUE'
2402     SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
2404 AC_SUBST(DISABLE_DYNLOADING)
2406 if test -n "${with_solver_and_workdir_root}"; then
2407     if ! test -d ${with_solver_and_workdir_root}; then
2408       AC_MSG_ERROR([directory does not exist: ${with_solver_and_workdir_root}])
2409     fi
2410     PathFormat "${with_solver_and_workdir_root}"
2411     # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
2412     if echo ${formatted_path} | $GREP -q '/$'; then
2413         SOLARVER=${formatted_path}solver
2414     else
2415         SOLARVER=${formatted_path}/solver
2416     fi
2417 else
2418     SOLARVER=${SRC_ROOT}/solver
2421 dnl ===================================================================
2422 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
2423 dnl although MSVC is used to build other build-time tools and
2424 dnl LibreOffice itself.
2425 dnl ===================================================================
2426 if test "$build_os" = "cygwin"; then
2427     AC_MSG_CHECKING([for Cygwin gcc/g++])
2428     if which gcc > /dev/null && which g++ > /dev/null; then
2429         AC_MSG_RESULT([found])
2430     else
2431         AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
2432     fi
2435 # remenber SYSBASE value
2436 AC_SUBST(SYSBASE)
2438 dnl ===================================================================
2439 dnl  Checks if ccache is available
2440 dnl ===================================================================
2441 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2442     case "%$CC%$CXX%" in
2443     # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some verison number etc),
2444     # assume that's good then
2445     *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2446         AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2447         ;;
2448     *)
2449         AC_PATH_PROG([CCACHE],[ccache],[not found])
2450         if test "$CCACHE" = "not found"; then
2451             CCACHE=""
2452         else
2453             # Need to check for ccache version: otherwise prevents
2454             # caching of the results (like "-x objective-c++" for Mac)
2455             if test $_os = Darwin -o $_os = iOS; then
2456                 # Check ccache version
2457                 AC_MSG_CHECKING([whether version of ccache is suitable])
2458                 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2459                 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2460                 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2461                     AC_MSG_RESULT([yes, $CCACHE_VERSION])
2462                 else
2463                     AC_MSG_RESULT([no, $CCACHE_VERSION])
2464                     CCACHE=""
2465                 fi
2466             fi
2467         fi
2468         ;;
2469     esac
2470 else
2471     CCACHE=""
2474 if test "$CCACHE" != ""; then
2475     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2476     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2477     if test "$ccache_size" = ""; then
2478         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2479         if test "$ccache_size" = ""; then
2480             ccache_size=0
2481         fi
2482         # we could not determine the size or it was less than 1GB -> disable auto-ccache
2483         if test $ccache_size -lt 1024; then
2484             CCACHE=""
2485             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
2486             add_warning "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled"
2487         else
2488             # warn that ccache may be too small for debug build
2489             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2490             add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
2491         fi
2492     else
2493         if test $ccache_size -lt 5; then
2494             #warn that ccache may be too small for debug build
2495             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2496             add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
2497         fi
2498     fi
2501 dnl ===================================================================
2502 dnl  Checks for C compiler,
2503 dnl  The check for the C++ compiler is later on.
2504 dnl ===================================================================
2505 GCC_HOME_SET="true"
2506 AC_MSG_CHECKING([gcc home])
2507 if test -z "$with_gcc_home"; then
2508     if test "$enable_icecream" = "yes"; then
2509         if test -d "/usr/lib/icecc/bin"; then
2510             GCC_HOME="/usr/lib/icecc/"
2511         else
2512             GCC_HOME="/opt/icecream/"
2513         fi
2514     else
2515         GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2516         GCC_HOME_SET="false"
2517     fi
2518 else
2519     GCC_HOME="$with_gcc_home"
2521 AC_MSG_RESULT($GCC_HOME)
2522 AC_SUBST(GCC_HOME)
2524 if test "$GCC_HOME_SET" = "true"; then
2525     if test -z "$CC"; then
2526         CC="$GCC_HOME/bin/gcc"
2527     fi
2528     if test -z "$CXX"; then
2529         CXX="$GCC_HOME/bin/g++"
2530     fi
2533 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
2534 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2535     # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
2536     save_CFLAGS=$CFLAGS
2537     AC_PROG_CC
2538     CFLAGS=$save_CFLAGS
2541 COMPATH=`dirname "$CC"`
2542 if test "$COMPATH" = "."; then
2543     AC_PATH_PROGS(COMPATH, $CC)
2544     dnl double square bracket to get single because of M4 quote...
2545     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2547 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2549 dnl ===================================================================
2550 dnl  Test the Solaris compiler version
2551 dnl ===================================================================
2552 if test "$_os" = "SunOS"; then
2553     if test "$CC" = "cc"; then
2554         AC_PATH_PROGS(_cc, cc)
2555         COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2556         AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2557         dnl cc -V outputs to standard error!!!!
2558         _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2559         _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2560         _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2561         if test "$_sunstudio_major" != "5"; then
2562             AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2563         else
2564             _sunstudio_minor=`echo $_sunstudio_version | $AWK -F. '{ if ($2 == 5) print "true"; else if ($2 == 7) print "true"; else if ($2 == 8) print "true"; else if ($2 == 9) print "true"; else print "false" }'`
2565             if test "$_sunstudio_minor" = "false"; then
2566                 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2567             else
2568                 dnl compiler will do
2569                 AC_MSG_RESULT([checked])
2570             fi
2571         fi
2572     fi
2576 dnl ===================================================================
2577 dnl Check / find MacOSX SDK and compiler, version checks
2578 dnl ===================================================================
2579 if test "$_os" = "Darwin"; then
2581     if test "$build_cpu" = i386 -a "$host_cpu" = powerpc; then
2582         # Cross-compiling for PPC from Intel
2583         arch='-arch ppc'
2584     elif test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2585         bitness=-m32
2586     else
2587         bitness=-m64
2588         BITNESS_OVERRIDE=64
2589     fi
2591     # If no --with-macosx-sdk option is given, first look for the 10.4u
2592     # SDK (which is distributed with the obsolete Xcode 3), then the
2593     # 10.6, 10.7 and 10.8 SDKs, in that order. (Don't bother looking
2594     # for the 10.5 SDK, unlikely somebody would have that but not
2595     # 10.6, I think.) If not found in some (old) default locations,
2596     # try the xcode-select tool.
2598     # The intent is that for "most" Mac-based developers, a suitable
2599     # SDK will be found automatically without any configure options.
2601     # For developers still using Xcode 2 or 3, in /Developer, either
2602     # because it is the only Xcode they have, or they have that in
2603     # addition to Xcode 4 in /Applications/Xcode.app, the 10.4 SDK
2604     # should be found.
2606     # For developers with a current Xcode 4 installed from the Mac App
2607     # Store, the 10.6, 10.7 or 10.8 SDK should be found.
2609     AC_MSG_CHECKING([what Mac OS X SDK to use])
2611     if test -z "$with_macosx_sdk"; then
2612         if test -d /Developer/SDKs/MacOSX10.4u.sdk; then
2613             with_macosx_sdk=10.4
2614         elif test -d /Developer-old/SDKs/MacOSX10.4u.sdk; then
2615             with_macosx_sdk=10.4
2616         elif test -d /Xcode3/SDKs/MacOSX10.4u.sdk; then
2617             with_macosx_sdk=10.4
2618         elif test -d /Developer/SDKs/MacOSX10.6.sdk; then
2619             with_macosx_sdk=10.6
2620         elif test -d /Developer/SDKs/MacOSX10.7.sdk; then
2621             with_macosx_sdk=10.7
2622         elif test -x /usr/bin/xcode-select; then
2623             xcodepath="`xcode-select -print-path`"
2624             if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
2625                 with_macosx_sdk=10.6
2626             elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"; then
2627                 with_macosx_sdk=10.7
2628             elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"; then
2629                 with_macosx_sdk=10.8
2630             fi
2631         fi
2632         if test -z "$with_macosx_sdk"; then
2633             AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2634         fi
2635     fi
2637     case $with_macosx_sdk in
2638     10.4)
2639         MACOSX_SDK_VERSION=1040
2640         ;;
2641     10.5)
2642         MACOSX_SDK_VERSION=1050
2643         ;;
2644     10.6)
2645         MACOSX_SDK_VERSION=1060
2646         ;;
2647     10.7)
2648         MACOSX_SDK_VERSION=1070
2649         ;;
2650     10.8)
2651         MACOSX_SDK_VERSION=1080
2652         ;;
2653     *)
2654         AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported value are 10.4--8])
2655         ;;
2656     esac
2658     # Next find it (again, if we deduced its version above by finding
2659     # it... but we need to look for it once more in case
2660     # --with-macosx-sdk was given so that the aboce search did not
2661     # happen).
2662     if test -z "$MACOSX_SDK_PATH"; then
2663         case $with_macosx_sdk in
2664         10.4)
2665             if test -d /Developer/SDKs/MacOSX10.4u.sdk; then
2666                 MACOSX_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk
2667             elif test -d /Developer-old/SDKs/MacOSX10.4u.sdk; then
2668                 MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX10.4u.sdk
2669             elif test -d /Xcode3/SDKs/MacOSX10.4u.sdk; then
2670                 MACOSX_SDK_PATH=/Xcode3/SDKs/MacOSX10.4u.sdk
2671             fi
2672             ;;
2673         10.6|10.7|10.8)
2674             if test -d /Developer/SDKs/MacOSX$with_macosx_sdk.sdk; then
2675                 MACOSX_SDK_PATH=/Developer/SDKs/MacOSX$with_macosx_sdk.sdk
2676             elif test -x /usr/bin/xcode-select; then
2677                 xcodepath="`xcode-select -print-path`"
2678                 if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
2679                     MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
2680                 fi
2681             fi
2682             ;;
2683         esac
2684         if test -z "$MACOSX_SDK_PATH"; then
2685             AC_MSG_ERROR([Could not figure out the location of Mac OS X $with_macosx_sdk SDK])
2686         fi
2687     fi
2688     AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2690     if test "$with_macosx_version_min_required" = ""; then
2691         case $with_macosx_sdk in
2692         10.4|10.5)
2693             with_macosx_version_min_required="10.4";;
2694         *)
2695             with_macosx_version_min_required="10.6";;
2696         esac
2697     fi
2699     if test "$with_macosx_version_max_allowed" = ""; then
2700         with_macosx_version_max_allowed="$with_macosx_sdk"
2701     fi
2703     FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2704     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2706     case "$with_macosx_version_min_required" in
2707     10.4)
2708         MAC_OS_X_VERSION_MIN_REQUIRED="1040"
2709         ;;
2710     10.5)
2711         MAC_OS_X_VERSION_MIN_REQUIRED="1050"
2712         ;;
2713     10.6)
2714         MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2715         ;;
2716     10.7)
2717         MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2718         ;;
2719     10.8)
2720         MAC_OS_X_VERSION_MIN_REQUIRED="1080"
2721         ;;
2722     *)
2723         AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported value are 10.4--8])
2724         ;;
2725     esac
2727     if test "$BITNESS_OVERRIDE" = 64; then
2728         case $with_macosx_version_min_required in
2729         10.4|10.5)
2730             AC_MSG_ERROR([Can't build 64-bit code for with-macosx-version-min-required=$with_macosx_version_min_required])
2731             ;;
2732         esac
2733     fi
2735     if test "$BITNESS_OVERRIDE" = ""; then
2736         case "$with_macosx_version_min_required" in
2737         10.4)
2738             case "$with_macosx_sdk" in
2739             10.4)
2740                 ;;
2741             *)
2742                 AC_MSG_WARN([Building with a SDK > 10.4 possibly breaks 10.4 compatibility. Do not use for deliverable build until verified that it really works])
2743                 add_warning "Building with a SDK > 10.4 possibly breaks 10.4 compatibility. Do not use for deliverable build until verified that it really works"
2744                 ;;
2745             esac
2746             ;;
2747         *)
2748             AC_MSG_WARN([Building with a minimum version requirement > 10.4 breaks 10.4 compatibility. Do not use for deliverable build])
2749             add_warning "Building with a minimum version requirement > 10.4 breaks 10.4 compatibility. Do not use for deliverable build"
2750             ;;
2751         esac
2752     fi
2754     # If no CC and CXX environment vars, try to guess where the compiler is
2755     if test -z "$save_CC"; then
2756         AC_MSG_CHECKING([what compiler to use])
2757         case $with_macosx_sdk in
2758         10.4)
2759             case "$MACOSX_SDK_PATH" in
2760             /Developer/*)
2761                 gccprefix=""
2762                 ;;
2763             /Developer-old/*)
2764                 gccprefix=/Developer-old/usr/bin/
2765                 ;;
2766             /Xcode3/*)
2767                 gccprefix=/Xcode3/usr/bin/
2768                 ;;
2769             *)
2770                 AC_MSG_ERROR([Cannot guess gcc location for this SDK])
2771                 ;;
2772             esac
2773             CC="${gccprefix}gcc-4.0 $arch -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2774             CXX="${gccprefix}g++-4.0 $arch -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2775             ;;
2776         10.6)
2777             # Is similar logic as above needed? Is it likely somebody
2778             # has both an older Xcode with the 10.6 SDK and a current
2779             # Xcode?
2780             CC="gcc-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2781             CXX="g++-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2782             ;;
2783         10.7|10.8)
2784             CC="`xcrun -find clang` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2785             CXX="`xcrun -find clang++` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2786             XCRUN=xcrun
2787             ;;
2788         esac
2789         AC_MSG_RESULT([$CC and $CXX])
2790     fi
2792     case "$with_macosx_version_max_allowed" in
2793     10.4)
2794         MAC_OS_X_VERSION_MAX_ALLOWED="1040"
2795         ;;
2796     10.5)
2797         MAC_OS_X_VERSION_MAX_ALLOWED="1050"
2798         ;;
2799     10.6)
2800         MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2801         ;;
2802     10.7)
2803         MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2804         ;;
2805     10.8)
2806         MAC_OS_X_VERSION_MAX_ALLOWED="1080"
2807         ;;
2808     *)
2809         AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported value are 10.4--8])
2810         ;;
2811     esac
2813     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2814     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2815         AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2816     else
2817         AC_MSG_RESULT([ok])
2818     fi
2820     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2821     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2822         AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2823     else
2824         AC_MSG_RESULT([ok])
2825     fi
2826     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2827     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2829     AC_MSG_CHECKING([whether to do code signing])
2831     if test -z "$enable_macosx_code_signing" -o "$enable_macosx_code_signing" = yes; then
2832         # By default use the first suitable certificate (?).
2834         # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2835         # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2836         # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2837         # the App Store, the "3rd Party Mac Developer" one. I think it works best to the the
2838         # "Developer ID Application" one.
2840         identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | awk '{print $2}' |head -1`
2841         if test -n "$identity"; then
2842             MACOSX_CODESIGNING_IDENTITY=$identity
2843             pretty_name=`security find-identity -p codesigning -v | grep $MACOSX_CODESIGNING_IDENTITY | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2844             AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2845         fi
2846     elif test -n "$enable_macosx_code_signing"; then
2847         MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2848         pretty_name=`security find-identity -p codesigning -v | grep $MACOSX_CODESIGNING_IDENTITY | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2849         AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2850     else
2851         AC_MSG_RESULT([no])
2852     fi
2854 AC_SUBST(FRAMEWORKSHOME)
2855 AC_SUBST(MACOSX_SDK_PATH)
2856 AC_SUBST(MACOSX_SDK_VERSION)
2857 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2858 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2859 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2860 AC_SUBST(XCRUN)
2861 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2863 dnl ===================================================================
2864 dnl Windows specific tests and stuff
2865 dnl ===================================================================
2866 if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
2867     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
2868     if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2869         AC_MSG_RESULT([no])
2870         SDK_ARCH="x86"
2871     else
2872         AC_MSG_RESULT([yes])
2873         SDK_ARCH="x64"
2874         BITNESS_OVERRIDE=64
2875     fi
2877     AC_MSG_CHECKING([whether to use DirectX])
2878     if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
2879         ENABLE_DIRECTX="TRUE"
2880         AC_MSG_RESULT([yes])
2881     else
2882         ENABLE_DIRECTX=""
2883         AC_MSG_RESULT([no])
2884     fi
2886     AC_MSG_CHECKING([whether to use ActiveX])
2887     if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
2888         DISABLE_ACTIVEX=""
2889         SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
2890         AC_MSG_RESULT([yes])
2891     else
2892         DISABLE_ACTIVEX="TRUE"
2893         AC_MSG_RESULT([no])
2894     fi
2896     AC_MSG_CHECKING([whether to use ATL])
2897     if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then
2898         DISABLE_ATL=""
2899         AC_MSG_RESULT([yes])
2900     else
2901         DISABLE_ATL="TRUE"
2902         AC_MSG_RESULT([no])
2903     fi
2904 else
2905     ENABLE_DIRECTX=""
2906     DISABLE_ACTIVEX="TRUE"
2907     DISABLE_ATL="TRUE"
2910 AC_SUBST(ENABLE_DIRECTX)
2911 AC_SUBST(DISABLE_ACTIVEX)
2912 AC_SUBST(DISABLE_ATL)
2914 if test "$cross_compiling" = "yes"; then
2915     CROSS_COMPILING=YES
2916     SCPDEFS="$SCPDEFS -DCROSS_COMPILING"
2917 else
2918     CROSS_COMPILING=
2919     BUILD_TYPE="$BUILD_TYPE NATIVE"
2921 AC_SUBST(CROSS_COMPILING)
2923 dnl ===================================================================
2924 dnl  Test the gcc version
2925 dnl ===================================================================
2926 if test "$GCC" = "yes"; then
2927     AC_MSG_CHECKING([the GCC version])
2928     _gcc_version=`$CC -dumpversion`
2929     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
2930     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2932     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100"; then
2933         if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0"; then
2934             export CC="$GCC_HOME/bin/gcc-4.0"
2935             #  export CC to make it finally available to config.guess
2936             GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2937             if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100"; then
2938                 GCCVER=$GCCVER2
2939             fi
2940         fi
2941         if test "$GCCVER" -ge "040100"; then
2942             AC_MSG_ERROR([You need to use the gcc-4.0 compiler (gcc $_gcc_version won't work with the MacOSX10.4u.sdk) - set CC accordingly])
2943         else
2944             AC_MSG_RESULT([implicitly using CC=$CC])
2945         fi
2946     else
2947         AC_MSG_RESULT([gcc $_gcc_version])
2948     fi
2949     if test "$GCCVER" -lt 040000; then
2950         AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.0.0])
2951     fi
2954 dnl ===================================================================
2955 dnl  Is GCC actually Clang?
2956 dnl ===================================================================
2958 COM_GCC_IS_CLANG=
2959 if test "$GCC" = "yes"; then
2960     AC_MSG_CHECKING([whether GCC is actually Clang])
2961     AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
2962         #ifndef __clang__
2963         you lose
2964         #endif
2965         int foo=42;
2966         ]])],
2967         [AC_MSG_RESULT([yes])
2968          COM_GCC_IS_CLANG=TRUE],
2969         [AC_MSG_RESULT([no])])
2971     if test "$COM_GCC_IS_CLANG" = TRUE; then
2972         AC_MSG_CHECKING([the Clang version])
2973         clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
2974         CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
2975         CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2976         AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
2977     fi
2979 AC_SUBST(COM_GCC_IS_CLANG)
2981 # ===================================================================
2982 # check various GCC options that Clang does not support now but maybe
2983 # will somewhen in the future, check them even for GCC, so that the
2984 # flags are set
2985 # ===================================================================
2987 HAVE_GCC_GGDB2=
2988 HAVE_GCC_FINLINE_LIMIT=
2989 HAVE_GCC_FNO_INLINE=
2990 if test "$GCC" = "yes"; then
2991     AC_MSG_CHECKING([whether $CC supports -ggdb2])
2992     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
2993         # Option just ignored and silly warning that isn't a real
2994         # warning printed
2995         :
2996     else
2997         save_CFLAGS=$CFLAGS
2998         CFLAGS="$CFLAGS -Werror -ggdb2"
2999         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3000         CFLAGS=$save_CFLAGS
3001     fi
3002     if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3003         AC_MSG_RESULT([yes])
3004     else
3005         AC_MSG_RESULT([no])
3006     fi
3008     AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3009     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3010         # As above
3011         :
3012     else
3013         save_CFLAGS=$CFLAGS
3014         CFLAGS="$CFLAGS -Werror -finline-limit=0"
3015         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3016         CFLAGS=$save_CFLAGS
3017     fi
3018     if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3019         AC_MSG_RESULT([yes])
3020     else
3021         AC_MSG_RESULT([no])
3022     fi
3024     AC_MSG_CHECKING([whether $CC supports -fno-inline])
3025     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3026         # Ditto
3027         :
3028     else
3029         save_CFLAGS=$CFLAGS
3030         CFLAGS="$CFLAGS -Werror -fno-inline"
3031         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3032         CFLAGS=$save_CFLAGS
3033     fi
3034     if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3035         AC_MSG_RESULT([yes])
3036     else
3037         AC_MSG_RESULT([no])
3038     fi
3040 AC_SUBST(HAVE_GCC_GGDB2)
3041 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3042 AC_SUBST(HAVE_GCC_FNO_INLINE)
3044 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3045 if test "$GCC" = "yes"; then
3046     AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
3047     bsymbolic_functions_ldflags_save=$LDFLAGS
3048     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
3049     AC_LINK_IFELSE([AC_LANG_PROGRAM([
3050 #include <stdio.h>
3051         ],[
3052 printf ("hello world\n");
3053         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3054     if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3055         AC_MSG_RESULT( found )
3056     else
3057         AC_MSG_RESULT( not found )
3058     fi
3059     LDFLAGS=$bsymbolic_functions_ldflags_save
3061 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3063 dnl ===================================================================
3064 dnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
3065 dnl ===================================================================
3066 SHOWINCLUDES_PREFIX=
3067 if test "$_os" = "WINNT"; then
3068     if test "$WITH_MINGW" != "yes"; then
3069         AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
3070         if test -z "$with_cl_home"; then
3071             vctest=`./oowintool --msvc-productdir`
3072             if test "$BITNESS_OVERRIDE" = ""; then
3073                 if test -x "$vctest/bin/cl.exe"; then
3074                     with_cl_home=$vctest
3075                 fi
3076             else
3077                 if test -x "$vctest/bin/amd64/cl.exe"; then
3078                     with_cl_home=$vctest
3079                 fi
3080             fi
3081         else
3082             with_cl_home=`cygpath -u "$with_cl_home"`
3083         fi
3084         with_cl_home=`cygpath -d "$with_cl_home"`
3085         with_cl_home=`cygpath -u "$with_cl_home"`
3086         AC_MSG_RESULT([$with_cl_home])
3088         dnl ===========================================================
3089         dnl  Check for mspdb80.dll/mspdb100.dll/mspdb110.dll
3090         dnl ===========================================================
3091         dnl MSVS 2008/10/12 Compiler
3092         if test -n "$with_mspdb_path"; then
3093             with_mspdb_path=`cygpath -u "$with_mspdb_path"`
3094         fi
3095         if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll" -o -e "$with_mspdb_path/mspdb110.dll"; then
3096             MSPDB_PATH="$with_mspdb_path"
3097         fi
3098         dnl MSVS 2008 case
3099         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
3100             MSPDB_PATH="$with_cl_home/../Common7/IDE"
3101         fi
3102         dnl Windows SDK 6.0 case
3103         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
3104             MSPDB_PATH="$with_cl_home/bin"
3105         fi
3106         dnl MSVS 2010 case
3107         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
3108             MSPDB_PATH="$with_cl_home/../Common7/IDE"
3109         fi
3110         dnl MSVS 2012 case
3111         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb110.dll"; then
3112             MSPDB_PATH="$with_cl_home/../Common7/IDE"
3113         fi
3115         if test -z "$MSPDB_PATH"; then
3116             dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
3117             AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
3118             AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
3119             AC_PATH_PROG(MSPDB_PATH, mspdb110.dll)
3120             MSPDB_PATH=`dirname "$MSPDB_PATH"`
3121         fi
3123         if test -z "$MSPDB_PATH"; then
3124             AC_MSG_ERROR([You need a mspdb80.dll or mspdb100.dll or mspdb110.dll, make sure it is in the path or use --with-mspdb-path])
3125         fi
3126         MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3127         MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3128         dnl The path needs to be added before cl is called
3129         PATH="$MSPDB_PATH:$PATH"
3131         AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
3132         if test -z "$CC"; then
3133             if test "$BITNESS_OVERRIDE" = ""; then
3134                 if test -x "$with_cl_home/bin/cl.exe"; then
3135                     CC="$with_cl_home/bin/cl.exe"
3136                 fi
3137             else
3138                 if test -x "$with_cl_home/bin/amd64/cl.exe"; then
3139                     CC="$with_cl_home/bin/amd64/cl.exe"
3140                 fi
3141             fi
3142             if test -z "$CC"; then
3143                 AC_PATH_PROG(CC, cl.exe)
3144             fi
3145             # This gives us a posix path with 8.3 filename restrictions
3146             CC=`cygpath -d "$CC"`
3147             CC=`cygpath -u "$CC"`
3148         fi
3150         if test -n "$CC"; then
3151             # Remove /cl.exe from CC case insensitive
3152             AC_MSG_RESULT([found ($CC)])
3153             if test "$BITNESS_OVERRIDE" = ""; then
3154                 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
3155             else
3156                 if test -n "$with_cl_home"; then
3157                     COMPATH=`echo $with_cl_home`
3158                 fi
3159             fi
3160             export INCLUDE=`cygpath -d "$COMPATH/Include"`
3161             dnl  Check which Microsoft C/C++ compiler is found
3162             AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
3163             # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
3164             CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
3165                             x = match( \\\$0, /..\\...\\...../ )
3166                             CCversion = substr( \\\$0, RSTART, RLENGTH)
3167                             tokencount = split (CCversion,vertoken,\".\")
3168                             for ( i = 1 ; i <= tokencount ; i++ ) {
3169                                 printf (\"%04d\",vertoken[[i]] )
3170                             }
3171                             }"`
3172             if test "$CCNUMVER" -ge "001700000000"; then
3173                 COMEX=14
3174                 MSVSVER=2012
3175                 VCVER=110
3176             elif test "$CCNUMVER" -ge "001600000000"; then
3177                 COMEX=13
3178                 MSVSVER=2010
3179                 VCVER=100
3180             elif test "$CCNUMVER" -ge "001500000000"; then
3181                 COMEX=12
3182                 MSVSVER=2008
3183                 VCVER=90
3184             else
3185                 AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
3186             fi
3187             PathFormat "$COMPATH"
3188             COMPATH="$formatted_path"
3190             AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
3191         else
3192             AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
3193         fi
3195         dnl We need to guess the prefix of the -showIncludes output, it can be
3196         dnl localized
3197         AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3198         echo "#include <stdlib.h>" > conftest.c
3199         SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
3200             grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3201         rm -f conftest.c conftest.obj
3202         if test -z "$SHOWINCLUDES_PREFIX"; then
3203             AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3204         else
3205             AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3206         fi
3208         # Check for 64-bit (cross-)compiler to use to build the 64-bit
3209         # version of the Explorer extension (and maybe other small
3210         # bits, too) needed when installing a 32-bit LibreOffice on a
3211         # 64-bit OS. The 64-bit Explorer extension is a feature that
3212         # has been present since long in OOo. Don't confuse it with
3213         # building LibreOffice itself as 64-bit code, which is
3214         # unfished work and highly experimental.
3216         BUILD_X64=
3217         CXX_X64_BINARY=
3218         LINK_X64_BINARY=
3219         LIBMGR_X64_BINARY=
3221         if test "$BITNESS_OVERRIDE" = ""; then
3222             AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3223             if test -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
3224                 # Prefer native x64 compiler to cross-compiler, in case we are running
3225                 # the build on a 64-bit OS.
3226                 if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3227                     BUILD_X64=TRUE
3228                     CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
3229                     LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
3230                     LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
3231                 elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3232                     BUILD_X64=TRUE
3233                     CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
3234                     LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
3235                     LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
3236                 fi
3237             fi
3238             if test "$BUILD_X64" = TRUE; then
3239                 AC_MSG_RESULT([found])
3240             else
3241                 AC_MSG_RESULT([not found])
3242                 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3243             fi
3244         fi
3245         AC_SUBST(BUILD_X64)
3247         # These are passed to the environment and then used in set_wntx64.mk
3248         AC_SUBST(CXX_X64_BINARY)
3249         AC_SUBST(LINK_X64_BINARY)
3250         AC_SUBST(LIBMGR_X64_BINARY)
3252     else
3253         AC_MSG_CHECKING([the compiler is MinGW])
3254         MACHINE_PREFIX=`$CC -dumpmachine`
3255         if echo $MACHINE_PREFIX | $GREP -q mingw32; then
3256             COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
3257             AC_MSG_RESULT([yes])
3258         else
3259             AC_MSG_ERROR([Compiler is not MinGW.])
3260         fi
3261     fi
3263 AC_SUBST(COMEX)
3264 AC_SUBST(VCVER)
3265 PathFormat "$MSPDB_PATH"
3266 MSPDB_PATH="$formatted_path"
3267 AC_SUBST(SHOWINCLUDES_PREFIX)
3270 # dbghelp.dll
3272 if test "$_os" == "WINNT"; then
3273     DBGHELP_DLL="13fbc2e8b37ddf28181dd6d8081c2b8e-dbghelp.dll"
3275 AC_SUBST(DBGHELP_DLL)
3278 # unowinreg.dll
3280 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3281 AC_SUBST(UNOWINREG_DLL)
3284 # prefix C with ccache if needed
3286 if test "$CCACHE" != ""; then
3287     AC_MSG_CHECKING([whether $CC is already ccached])
3289     AC_LANG_PUSH([C])
3290     save_CFLAGS=$CFLAGS
3291     CFLAGS="$CFLAGS --ccache-skip -O2"
3292     dnl an empty program will do, we're checking the compiler flags
3293     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3294                       [use_ccache=yes], [use_ccache=no])
3295     if test $use_ccache = yes; then
3296         AC_MSG_RESULT([yes])
3297     else
3298         CC="$CCACHE $CC"
3299         AC_MSG_RESULT([no])
3300     fi
3301     CFLAGS=$save_CFLAGS
3302     AC_LANG_POP([C])
3305 dnl Set the ENABLE_DBGUTIL variable
3306 dnl ===================================================================
3307 AC_MSG_CHECKING([whether to build with additional debug utilities])
3308 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3309     ENABLE_DBGUTIL="TRUE"
3310     PROEXT=""
3311     PRODUCT=""
3313     AC_MSG_RESULT([yes])
3314     # cppunit and graphite expose STL in public headers
3315     if test "$with_system_cppunit" = "yes"; then
3316         AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3317     else
3318         with_system_cppunit=no
3319     fi
3320     if test "$with_system_graphite" = "yes"; then
3321         AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3322     else
3323         with_system_graphite=no
3324     fi
3325     if test "$with_system_mysql_cppconn" = "yes"; then
3326         AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
3327     else
3328         with_system_mysql_cppconn=no
3329     fi
3330     if test "$with_system_orcus" = "yes"; then
3331         AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3332     else
3333         with_system_orcus=no
3334     fi
3335 else
3336     ENABLE_DBGUTIL=""
3337     # PRODUCT is old concept, still used by build.pl .
3338     PRODUCT="full"
3339     PROEXT=".pro"
3340     AC_MSG_RESULT([no])
3342 AC_SUBST(ENABLE_DBGUTIL)
3343 AC_SUBST(PRODUCT)
3344 AC_SUBST(PROEXT)
3346 dnl Set the ENABLE_DEBUG variable.
3347 dnl ===================================================================
3348 AC_MSG_CHECKING([whether to do a debug build])
3349 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3350     AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3352 if test -n "$ENABLE_DBGUTIL"; then
3353     if test "$enable_debug" = "no"; then
3354         AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3355     fi
3356     ENABLE_DEBUG="TRUE"
3357     AC_MSG_RESULT([yes (dbgutil)])
3358 elif test -n "$enable_debug" && test "$enable_debug" != "no"; then
3359     ENABLE_DEBUG="TRUE"
3360     AC_MSG_RESULT([yes])
3361 else
3362     ENABLE_DEBUG=""
3363     AC_MSG_RESULT([no])
3365 AC_SUBST(ENABLE_DEBUG)
3367 dnl Selective debuginfo
3368 ENABLE_DEBUGINFO_FOR=
3369 if test -n "$ENABLE_DEBUG"; then
3370     AC_MSG_CHECKING([whether to use selective debuginfo])
3371     if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3372         ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3373         AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3374     else
3375         ENABLE_DEBUGINFO_FOR=all
3376         AC_MSG_RESULT([no, for all])
3377     fi
3379 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3381 dnl Check for enable symbols option
3382 dnl ===================================================================
3383 AC_MSG_CHECKING([whether to include symbols while preserve optimization])
3384 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
3385     ENABLE_SYMBOLS="TRUE"
3386     if test -n "$ENABLE_DBGUTIL"; then
3387         AC_MSG_ERROR([--enable-dbgutil cannot be used with --enable-symbols])
3388     elif test -n "$ENABLE_DEBUG"; then
3389         AC_MSG_ERROR([--enable-debug cannot be used with --enable-symbols])
3390     fi
3391     AC_MSG_RESULT([yes])
3392 else
3393     if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
3394         ENABLE_SYMBOLS="FALSE"
3395     else
3396         ENABLE_SYMBOLS=
3397     fi
3398     AC_MSG_RESULT([no])
3400 AC_SUBST(ENABLE_SYMBOLS)
3402 dnl Check for explicit C/CXX/OBJC/OBJCXX/LDFLAGS. We by default use the ones specified
3403 dnl by our build system, but explicit override is possible.
3404 AC_MSG_CHECKING(for explicit CFLAGS)
3405 if test -n "$CFLAGS"; then
3406     AC_MSG_RESULT([$CFLAGS])
3407     x_CFLAGS=
3408 else
3409     AC_MSG_RESULT(no)
3410     x_CFLAGS=[\#]
3412 AC_MSG_CHECKING(for explicit CXXFLAGS)
3413 if test -n "$CXXFLAGS"; then
3414     AC_MSG_RESULT([$CXXFLAGS])
3415     x_CXXFLAGS=
3416 else
3417     AC_MSG_RESULT(no)
3418     x_CXXFLAGS=[\#]
3420 AC_MSG_CHECKING(for explicit OBJCFLAGS)
3421 if test -n "$OBJCFLAGS"; then
3422     AC_MSG_RESULT([$OBJCFLAGS])
3423     x_OBJCFLAGS=
3424 else
3425     AC_MSG_RESULT(no)
3426     x_OBJCFLAGS=[\#]
3428 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
3429 if test -n "$OBJCXXFLAGS"; then
3430     AC_MSG_RESULT([$OBJCXXFLAGS])
3431     x_OBJCXXFLAGS=
3432 else
3433     AC_MSG_RESULT(no)
3434     x_OBJCXXFLAGS=[\#]
3436 AC_MSG_CHECKING(for explicit LDFLAGS)
3437 if test -n "$LDFLAGS"; then
3438     AC_MSG_RESULT([$LDFLAGS])
3439     x_LDFLAGS=
3440 else
3441     AC_MSG_RESULT(no)
3442     x_LDFLAGS=[\#]
3444 AC_SUBST(CFLAGS)
3445 AC_SUBST(CXXFLAGS)
3446 AC_SUBST(OBJCFLAGS)
3447 AC_SUBST(OBJCXXFLAGS)
3448 AC_SUBST(LDFLAGS)
3449 AC_SUBST(x_CFLAGS)
3450 AC_SUBST(x_CXXFLAGS)
3451 AC_SUBST(x_OBJCFLAGS)
3452 AC_SUBST(x_OBJCXXFLAGS)
3453 AC_SUBST(x_LDFLAGS)
3456 # determine CPU, CPUNAME, GUI, GUIBASE, ...
3458 LIB64="lib"
3459 SOLARINC=
3461 case "$host_os" in
3463 aix*)
3464     COM=GCC
3465     CPU=P
3466     CPUNAME=POWERPC
3467     GUI=UNX
3468     GUIBASE=unx
3469     OS=AIX
3470     RTL_OS=AIX
3471     RTL_ARCH=PowerPC
3472     PLATFORMID=aix_powerpc
3473     OUTPATH=unxaigppc
3474     P_SEP=:
3475     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3476     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3477     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3478     ;;
3480 cygwin*)
3481     COM=MSC
3482     GUI=WNT
3483     GUIBASE=WIN
3484     OS=WNT
3485     RTL_OS=Windows
3486     P_SEP=";"
3488     case "$host_cpu" in
3489     i*86|x86_64)
3490         if test "$BITNESS_OVERRIDE" = 64; then
3491             CPU=X
3492             CPUNAME=X86_64
3493             RTL_ARCH=X86_64
3494             LIB64="lib/x64"
3495             PLATFORMID=windows_x86_64
3496             OUTPATH=wntmscx$COMEX
3497         else
3498             CPU=I
3499             CPUNAME=INTEL
3500             RTL_ARCH=x86
3501             PLATFORMID=windows_x86
3502             OUTPATH=wntmsci$COMEX
3503         fi
3504         ;;
3505     *)
3506         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3507         ;;
3508     esac
3509     SCPDEFS="$SCPDEFS -D_MSC_VER"
3510     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3511     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3512     ;;
3514 darwin*)
3515     COM=GCC
3516     GUI=UNX
3517     # Not sure if "Aqua" is the right term to use?
3518     GUIBASE="aqua"
3519     OS=MACOSX
3520     RTL_OS=MacOSX
3521     P_SEP=:
3523     case "$host_cpu" in
3524     arm*)
3525         CPU=R
3526         CPUNAME=ARM
3527         RTL_ARCH=ARM_EABI
3528         GUIBASE=cocoatouch
3529         PLATFORMID=macosx_arm_eabi
3530         OUTPATH=unxiosr
3531         OS=IOS
3532         ;;
3533     powerpc*)
3534         CPU=P
3535         CPUNAME=POWERPC
3536         RTL_ARCH=PowerPC
3537         PLATFORMID=macosx_powerpc
3538         OUTPATH=unxmacxp
3539         ;;
3540     i*86)
3541         if test "$BITNESS_OVERRIDE" = 64; then
3542             AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
3543         fi
3544         CPU=I
3545         CPUNAME=INTEL
3546         RTL_ARCH=x86
3547         PLATFORMID=macosx_x86
3548         OUTPATH=unxmacxi
3549         ;;
3550     x86_64)
3551         if test "$BITNESS_OVERRIDE" = 64; then
3552             CPU=X
3553             CPUNAME=X86_64
3554             RTL_ARCH=X86_64
3555             PLATFORMID=macosx_x86_64
3556             OUTPATH=unxmacxx
3557         else
3558             CPU=I
3559             CPUNAME=INTEL
3560             RTL_ARCH=x86
3561             PLATFORMID=macosx_x86
3562             OUTPATH=unxmacxi
3563         fi
3564         ;;
3565     *)
3566         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3567         ;;
3568     esac
3569     SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3570     ;;
3572 dragonfly*)
3573     COM=GCC
3574     GUI=UNX
3575     GUIBASE=unx
3576     OS=DRAGONFLY
3577     RTL_OS=DragonFly
3578     OUTPATH=unxdfly
3579     P_SEP=:
3581     case "$host_cpu" in
3582     i*86)
3583         CPU=I
3584         CPUNAME=INTEL
3585         RTL_ARCH=x86
3586         PLATFORMID=dragonfly_x86
3587         ;;
3588     x86_64)
3589         CPU=X
3590         CPUNAME=X86_64
3591         RTL_ARCH=X86_64
3592         PLATFORMID=dragonfly_x86_64
3593         ;;
3594     *)
3595         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3596         ;;
3597     esac
3598     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3599     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3600     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3601     ;;
3603 freebsd*)
3604     COM=GCC
3605     GUI=UNX
3606     GUIBASE=unx
3607     RTL_OS=FreeBSD
3608     OS=FREEBSD
3609     OUTPATH=unxfbsd
3610     P_SEP=:
3612     case "$host_cpu" in
3613     i*86)
3614         CPU=I
3615         CPUNAME=INTEL
3616         RTL_ARCH=x86
3617         PLATFORMID=freebsd_x86
3618         OUTPATH=unxfbsdi
3619         ;;
3620     x86_64)
3621         CPU=X
3622         CPUNAME=X86_64
3623         RTL_ARCH=X86_64
3624         PLATFORMID=freebsd_x86_64
3625         ;;
3626     *)
3627         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3628         ;;
3629     esac
3630     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3631     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3632     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3633     ;;
3635 kfreebsd*)
3636     COM=GCC
3637     GUI=UNX
3638     GUIBASE=unx
3639     OS=LINUX
3640     RTL_OS=kFreeBSD
3641     P_SEP=:
3643     case "$host_cpu" in
3645     i*86)
3646         CPU=I
3647         CPUNAME=INTEL
3648         RTL_ARCH=x86
3649         PLATFORMID=kfreebsd_x86
3650         OUTPATH=unxkfgi6
3651         ;;
3652     x86_64)
3653         CPU=X
3654         CPUNAME=X86_64
3655         RTL_ARCH=X86_64
3656         LIB64="lib64"
3657         PLATFORMID=kfreebsd_x86_64
3658         OUTPATH=unxkfgx6
3659         ;;
3660     *)
3661         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3662         ;;
3663     esac
3664     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3665     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3666     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3667     ;;
3669 linux-gnu*)
3670     COM=GCC
3671     GUI=UNX
3672     GUIBASE=unx
3673     OS=LINUX
3674     RTL_OS=Linux
3675     P_SEP=:
3677     case "$host_cpu" in
3679     alpha)
3680         CPU=L
3681         CPUNAME=AXP
3682         RTL_ARCH=ALPHA
3683         PLATFORMID=linux_alpha
3684         OUTPATH=unxlngaxp
3685         ;;
3686     arm*)
3687         CPU=R
3688         CPUNAME=ARM
3689         EPM_FLAGS="-a arm"
3690         OUTPATH=unxlngr
3691         RTL_ARCH=ARM_EABI
3692         PLATFORMID=linux_arm_eabi
3693         case "$host_cpu" in
3694         arm*-linux)
3695             RTL_ARCH=ARM_OABI
3696             PLATFORMID=linux_arm_oabi
3697             ;;
3698         esac
3699         ;;
3700     hppa)
3701         CPU=H
3702         CPUNAME=HPPA
3703         RTL_ARCH=HPPA
3704         EPM_FLAGS="-a hppa"
3705         PLATFORMID=linux_hppa
3706         OUTPATH=unxlnghppa
3707         ;;
3708     i*86)
3709         CPU=I
3710         CPUNAME=INTEL
3711         RTL_ARCH=x86
3712         PLATFORMID=linux_x86
3713         OUTPATH=unxlngi6
3714         ;;
3715     ia64)
3716         CPU=A
3717         CPUNAME=IA64
3718         RTL_ARCH=IA64
3719         PLATFORMID=linux_ia64
3720         OUTPATH=unxlnga
3721         ;;
3722     mips)
3723         CPU=M
3724         CPUNAME=GODSON
3725         RTL_ARCH=MIPS_EB
3726         EPM_FLAGS="-a mips"
3727         PLATFORMID=linux_mips_eb
3728         OUTPATH=unxlngmips
3729         ;;
3730     mips64)
3731         CPU=M
3732         CPUNAME=GODSON
3733         RTL_ARCH=MIPS_EB
3734         EPM_FLAGS="-a mips64"
3735         PLATFORMID=linux_mips_eb
3736         OUTPATH=unxlngmips
3737         ;;
3738     mips64el)
3739         CPU=M
3740         CPUNAME=GODSON
3741         RTL_ARCH=MIPS_EL
3742         EPM_FLAGS="-a mips64el"
3743         PLATFORMID=linux_mips_el
3744         OUTPATH=unxlngmips
3745         ;;
3746     mipsel)
3747         CPU=M
3748         CPUNAME=GODSON
3749         RTL_ARCH=MIPS_EL
3750         EPM_FLAGS="-a mipsel"
3751         PLATFORMID=linux_mips_el
3752         OUTPATH=unxlngmips
3753         ;;
3754     m68k)
3755         CPU=6
3756         CPUNAME=M68K
3757         RTL_ARCH=M68K
3758         PLATFORMID=linux_m68k
3759         OUTPATH=unxlngm68k
3760         ;;
3761     powerpc)
3762         CPU=P
3763         CPUNAME=POWERPC
3764         RTL_ARCH=PowerPC
3765         PLATFORMID=linux_powerpc
3766         OUTPATH=unxlngppc
3767         ;;
3768     powerpc64)
3769         CPU=P
3770         CPUNAME=POWERPC64
3771         RTL_ARCH=PowerPC_64
3772         LIB64="lib64"
3773         PLATFORMID=linux_powerpc_64
3774         OUTPATH=unxlngppc64
3775         ;;
3776     sparc)
3777         CPU=S
3778         CPUNAME=SPARC
3779         RTL_ARCH=SPARC
3780         PLATFORMID=linux_sparc
3781         OUTPATH=unxlngs
3782         ;;
3783     s390)
3784         CPU=3
3785         CPUNAME=S390
3786         RTL_ARCH=S390
3787         PLATFORMID=linux_s390
3788         OUTPATH=unxlngs390
3789         ;;
3790     s390x)
3791         CPU=3
3792         CPUNAME=S390X
3793         RTL_ARCH=S390x
3794         LIB64="lib64"
3795         PLATFORMID=linux_s390x
3796         OUTPATH=unxlngs390x
3797         ;;
3798     x86_64)
3799         CPU=X
3800         CPUNAME=X86_64
3801         RTL_ARCH=X86_64
3802         LIB64="lib64"
3803         PLATFORMID=linux_x86_64
3804         OUTPATH=unxlngx6
3805         ;;
3806     *)
3807         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3808         ;;
3809     esac
3810     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3811     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3812     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3813     ;;
3815 linux-android*)
3816     COM=GCC
3817     GUI=UNX
3818     GUIBASE=android
3819     OS=ANDROID
3820     RTL_OS=Android
3821     P_SEP=:
3823     case "$host_cpu" in
3825     arm|armel)
3826         CPU=R
3827         CPUNAME=ARM
3828         RTL_ARCH=ARM_EABI
3829         PLATFORMID=android_arm_eabi
3830         OUTPATH=unxandr
3831         ;;
3832     mips|mipsel)
3833         CPU=M
3834         CPUNAME=GODSON # Weird, but maybe that's the LO convention?
3835         RTL_ARCH=MIPS_EL
3836         PLATFORMID=android_mips_el
3837         OUTPATH=unxandm
3838         ;;
3839     i*86)
3840         CPU=I
3841         CPUNAME=INTEL
3842         RTL_ARCH=x86
3843         PLATFORMID=android_x86
3844         OUTPATH=unxandi
3845         ;;
3846     *)
3847         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3848         ;;
3849     esac
3850     SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/$OUTPATH"
3851     SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3852     ;;
3854 mingw*)
3855     COM=GCC
3856     GUI=WNT
3857     GUIBASE=WIN
3858     OS=WNT
3859     RTL_OS=Windows
3860     P_SEP=:
3862     case "$host_cpu" in
3863     i*86|x86_64)
3864         if test "$BITNESS_OVERRIDE" = 64; then
3865             CPU=X
3866             CPUNAME=X86_64
3867             RTL_ARCH=X86_84
3868             PLATFORMID=windows_x86_64
3869             OUTPATH=wntgccx$COMEX
3870         else
3871             CPU=I
3872             CPUNAME=INTEL
3873             RTL_ARCH=x86
3874             PLATFORMID=windows_x86
3875             OUTPATH=wntgcci$COMEX
3876         fi
3877         ;;
3878     *)
3879         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3880         ;;
3881     esac
3882     SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/win32 -I$SRC_ROOT/solenv/inc/$OUTPATH"
3883     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3884     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3885     ;;
3887 *netbsd*)
3889     COM=GCC
3890     GUI=UNX
3891     GUIBASE=unx
3892     OS=NETBSD
3893     RTL_OS=NetBSD
3894     OUTPATH=unxnbsd
3895     P_SEP=:
3897     case "$host_cpu" in
3898     i*86)
3899         CPU=I
3900         CPUNAME=INTEL
3901         RTL_ARCH=x86
3902         PLATFORMID=netbsd_x86
3903         ;;
3904     powerpc)
3905         CPU=P
3906         CPUNAME=POWERPC
3907         RTL_ARCH=PowerPC
3908         PLATFORMID=netbsd_powerpc
3909         ;;
3910     sparc)
3911         CPU=S
3912         CPUNAME=SPARC
3913         RTL_ARCH=SPARC
3914         PLATFORMID=netbsd_sparc
3915         ;;
3916     x86_64)
3917         CPU=X
3918         CPUNAME=X86_64
3919         RTL_ARCH=X86_64
3920         PLATFORMID=netbsd_x86_64
3921         ;;
3922     *)
3923         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3924         ;;
3925     esac
3926     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3927     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3928     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3929     ;;
3931 openbsd*)
3932     COM=GCC
3933     GUI=UNX
3934     GUIBASE=unx
3935     OS=OPENBSD
3936     RTL_OS=OpenBSD
3937     OUTPATH=unxobsd
3938     P_SEP=:
3940     case "$host_cpu" in
3941     i*86)
3942         CPU=I
3943         CPUNAME=INTEL
3944         RTL_ARCH=x86
3945         PLATFORMID=openbsd_x86
3946         ;;
3947     x86_64)
3948         CPU=X
3949         CPUNAME=X86_64
3950         RTL_ARCH=X86_64
3951         PLATFORMID=openbsd_x86_64
3952         ;;
3953     *)
3954         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3955         ;;
3956     esac
3957     SOLARINC="$SOLARINC -I/usr/local/include"
3958     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3959     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3960     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3961     SOLARLIB="$SOLARLIB -L/usr/local/lib"
3963     ;;
3965 solaris*)
3967     COM=GCC
3968     GUI=UNX
3969     GUIBASE=unx
3970     OS=SOLARIS
3971     RTL_OS=Solaris
3972     P_SEP=:
3974     case "$host_cpu" in
3975     i*86)
3976         CPU=I
3977         CPUNAME=INTEL
3978         RTL_ARCH=x86
3979         PLATFORMID=solaris_x86
3980         OUTPATH=unxsogi
3981         ;;
3982     sparc)
3983         CPU=S
3984         CPUNAME=SPARC
3985         RTL_ARCH=SPARC
3986         PLATFORMID=solaris_sparc
3987         OUTPATH=unxsogs
3988         ;;
3989     *)
3990         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3991         ;;
3992     esac
3993     SOLARINC="$SOLARINC -I/usr/local/include"
3994     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3995     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3996     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3997     SOLARLIB="$SOLARLIB -L$COMPATH/lib"
3998     SOLARLIB="$SOLARLIB -L/usr/local/bin -L/usr/dt/lib -L/usr/openwin/lib"
3999     ;;
4002     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4003     ;;
4004 esac
4006 if test "$enable_headless" = "yes"; then
4007     if test "$GUIBASE" != "unx"; then
4008         AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --enable-headless])
4009     fi
4010     GUIBASE=headless
4013 INPATH="${OUTPATH}${PROEXT}"
4014 if test -n "${with_solver_and_workdir_root}"; then
4015     PathFormat "${with_solver_and_workdir_root}"
4016     # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
4017     if echo ${formatted_path} | $GREP -q '/$'; then
4018         WORKDIR=${formatted_path}workdir/${INPATH}
4019     else
4020         WORKDIR=${formatted_path}/workdir/${INPATH}
4021     fi
4022 else
4023     WORKDIR=${SRC_ROOT}/workdir/${INPATH}
4025 OUTDIR="${SOLARVER}/${INPATH}"
4026 SOLARINC="-I. -I${SOLARVER}/$INPATH/inc/external -I${SOLARVER}/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC"
4027 AC_SUBST(COM)
4028 AC_SUBST(CPU)
4029 AC_SUBST(CPUNAME)
4030 AC_SUBST(RTL_OS)
4031 AC_SUBST(RTL_ARCH)
4032 AC_SUBST(EPM_FLAGS)
4033 AC_SUBST(GUI)
4034 AC_SUBST(GUIBASE)
4035 AC_SUBST(INPATH)
4036 AC_SUBST(OS)
4037 AC_SUBST(OUTDIR)
4038 AC_SUBST(OUTPATH)
4039 AC_SUBST(P_SEP)
4040 AC_SUBST(SOLARVER)
4041 AC_SUBST(WORKDIR)
4042 AC_SUBST(PLATFORMID)
4044 dnl ===================================================================
4045 dnl Test which package format to use
4046 dnl ===================================================================
4047 AC_MSG_CHECKING([which package format to use])
4048 if test -n "$with_package_format"; then
4049     for i in $with_package_format; do
4050         case "$i" in
4051         aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
4052             ;;
4053         *)
4054             AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4055 aix - AIX software distribution
4056 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4057 deb - Debian software distribution
4058 inst or tardist - IRIX software distribution
4059 osx - MacOS X software distribution
4060 pkg - Solaris software distribution
4061 rpm - RedHat software distribution
4062 setld - Tru64 (setld) software distribution
4063 native - "Native" software distribution for the platform
4064 portable - Portable software distribution
4066 LibreOffice additionally supports:
4067 archive - .tar.gz or .zip
4068 dmg - Mac OS X .dmg
4069 installed - installation tree
4070 msi - Windows .msi
4071         ])
4072             ;;
4073         esac
4074     done
4075     PKGFORMAT="$with_package_format"
4076 elif test "$enable_epm" = "yes"; then
4077     # defaults
4078     case "$_os" in
4079     Darwin)
4080         PKGFORMAT=dmg
4081         ;;
4082     SunOS)
4083         PKGFORMAT=pkg
4084         ;;
4085     Linux)
4086         # if building on Debian, default should be deb...
4087         if test -e /etc/debian_version; then
4088             PKGFORMAT=deb
4089         else
4090             PKGFORMAT=rpm
4091         fi
4092         ;;
4093     AIX)
4094         PKGFORMAT=rpm
4095         ;;
4096     OpenBSD|DragonFly)
4097         PKGFORMAT=portable
4098         ;;
4099     *BSD)
4100         PKGFORMAT=bsd
4101         ;;
4102     WINNT)
4103         PKGFORMAT=msi
4104         ;;
4105     # we never should get here since we check the arciecture/os at the beginning,
4106     # but go sure...
4107     *)
4108         AC_MSG_ERROR([unknown system])
4109     esac
4110 else
4111     if test "$WITH_MINGW" = "yes"; then
4112         # when tested, we should default this to 'msi', instead of 'archive'
4113         PKGFORMAT=archive
4114     else
4115         PKGFORMAT=native
4116     fi
4118 AC_MSG_RESULT([$PKGFORMAT])
4119 AC_SUBST(PKGFORMAT)
4121 dnl ===================================================================
4122 dnl Set up a different compiler to produce tools to run on the build
4123 dnl machine when doing cross-compilation
4124 dnl ===================================================================
4126 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4127 if test "$cross_compiling" = "yes"; then
4128     AC_MSG_CHECKING([for BUILD platform configuration])
4129     echo
4130     rm -rf CONF-FOR-BUILD config_build.mk
4131     mkdir CONF-FOR-BUILD
4132     tar cf - \
4133         config.guess \
4134         config_host.mk.in \
4135         configure \
4136         oowintool \
4137         bin/get_config_variables \
4138         solenv/bin/getcompver.awk \
4139         solenv/inc/langlist.mk \
4140         solenv/inc/postset.mk \
4141     | (cd CONF-FOR-BUILD && tar xf -)
4142     (
4143     unset COM GUI GUIBASE OS CPU CPUNAME
4144     unset CC CXX SYSBASE CFLAGS
4145     unset PYTHON_CFLAGS PYTHON_LIBS
4146     unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
4147     unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4148     unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
4149     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4150     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4151     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4152     cd CONF-FOR-BUILD
4153     sub_conf_opts=""
4154     test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4155     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4156     test $with_java = no && sub_conf_opts="$sub_conf_opts --without-java"
4157     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4158     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4159     test -n "${with_solver_and_workdir_root}" && sub_conf_opts="$sub_conf_opts --with-solver-and-workdir-root=${with_solver_and_workdir_root}"
4160     test -n "$with_system_boost_for_build" && sub_conf_opts="$sub_conf_opts --with-system-boost"
4161     test -n "$with_system_cppunit_for_build" && sub_conf_opts="$sub_conf_opts --with-system-cppunit"
4162     test -n "$with_system_expat_for_build" && sub_conf_opts="$sub_conf_opts --with-system-expat"
4163     test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4164     test -n "$with_system_libxml_for_build" && sub_conf_opts="$sub_conf_opts --with-system-libxml"
4165     # we need the msi build tools on mingw if we are creating the
4166     # installation set
4167     if test "$WITH_MINGW" = "yes"; then
4168         enable_winegcc_for_build=
4169         for pkgformat in $PKGFORMAT; do
4170             case "$pkgformat" in
4171                 msi|native) enable_winegcc_for_build=yes ;;
4172             esac
4173         done
4174         test -n "$enable_winegcc_for_build" && sub_conf_opts="$sub_conf_opts --enable-winegcc"
4175     fi
4176     sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4177     # Don't bother having configure look for stuff not needed for the build platform anyway
4178     ./configure \
4179         --disable-graphite \
4180         --disable-build-mozilla \
4181         --disable-postgresql-sdbc \
4182         --disable-zenity \
4183         --with-parallelism="$with_parallelism" \
4184         --without-doxygen \
4185         ENABLE_PDFIMPORT=FALSE \
4186         $sub_conf_opts \
4187         2>&1 | sed -e 's/^/    /'
4188     test -f ./config_host.mk 2>/dev/null || exit
4189     cp config_host.mk ../config_build.mk
4190     cp config.log ../config.Build.log
4191     . ./bin/get_config_variables COM GUI GUIBASE OS PATH CPU CPUNAME CC CXX DISABLE_PYTHON MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH PYTHON SYSTEM_LIBXSLT OUTDIR SOLARINC SOLARLIB WORKDIR
4193     for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX DISABLE_PYTHON MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
4194              PYTHON SYSTEM_LIBXSLT; do
4195         VV='$'$V
4196         VV=`eval "echo $VV"`
4197         if test -n "$VV"; then
4198             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4199             echo "$line" >>build-config
4200         fi
4201     done
4203     for V in OUTDIR SOLARINC SOLARLIB WORKDIR; do
4204         VV='$'$V
4205         VV=`eval "echo $VV"`
4206         VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
4207         if test -n "$VV"; then
4208             line="${V}_FOR_BUILD='$VV'"
4209             echo "$line" >>build-config
4210         fi
4211     done
4213     line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4214     echo "$line" >>build-config
4216     )
4217     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4218     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])
4219     perl -pi -e 's,/CONF-FOR-BUILD,,g' config_build.mk
4220     eval `cat CONF-FOR-BUILD/build-config`
4221     AC_MSG_RESULT([checking for BUILD platform configuration... done])
4222     rm -rf CONF-FOR-BUILD
4223 else
4224     CC_FOR_BUILD="$CC"
4225     CXX_FOR_BUILD="$CXX"
4226     CC_FOR_BUILD="$CC"
4227     COM_FOR_BUILD="$COM"
4228     CPUNAME_FOR_BUILD="$CPUNAME"
4229     CPU_FOR_BUILD="$CPU"
4230     CXX_FOR_BUILD="$CXX"
4231     DISABLE_PYTHON_FOR_BUILD="$DISABLE_PYTHON"
4232     GUIBASE_FOR_BUILD="$GUIBASE"
4233     GUI_FOR_BUILD="$GUI"
4234     INPATH_FOR_BUILD="$INPATH"
4235     MACOSX_DEPLOYMENT_TARGET_FOR_BUILD="$MACOSX_DEPLOYMENT_TARGET"
4236     OS_FOR_BUILD="$OS"
4237     OUTDIR_FOR_BUILD="$OUTDIR"
4238     OUTPATH_FOR_BUILD="$OUTPATH"
4239     PYTHON_FOR_BUILD="$PYTHON"
4240     WORKDIR_FOR_BUILD="$WORKDIR"
4242 AC_SUBST(COM_FOR_BUILD)
4243 AC_SUBST(GUI_FOR_BUILD)
4244 AC_SUBST(GUIBASE_FOR_BUILD)
4245 AC_SUBST(OS_FOR_BUILD)
4246 AC_SUBST(CPU_FOR_BUILD)
4247 AC_SUBST(CPUNAME_FOR_BUILD)
4248 AC_SUBST(CC_FOR_BUILD)
4249 AC_SUBST(CXX_FOR_BUILD)
4250 AC_SUBST(INPATH_FOR_BUILD)
4251 AC_SUBST(OUTPATH_FOR_BUILD)
4252 AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
4253 AC_SUBST([PYTHON_FOR_BUILD])
4255 AC_SUBST(OUTDIR_FOR_BUILD)
4256 AC_SUBST(WORKDIR_FOR_BUILD)
4258 UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
4259 SOURCEVERSION="OOO$UPD"
4260 AC_SUBST(UPD)
4261 AC_SUBST(SOURCEVERSION)
4263 dnl ===================================================================
4264 dnl Grim-ness to export version number of LibreOffice to code
4265 dnl this needs to be turned around and to be driven by configure
4266 dnl ===================================================================
4267 LIBO_VERSION_MAJOR="`$GREP VERSIONMAJOR solenv/inc/minor.mk | sed "s/^.*=//"`"
4268 LIBO_VERSION_MINOR="`$GREP VERSIONMINOR solenv/inc/minor.mk | sed "s/^.*=//"`"
4269 LIBO_VERSION_MICRO="`$GREP VERSIONMICRO solenv/inc/minor.mk | sed "s/^.*=//"`"
4270 LIBO_VERSION_PATCH="`$GREP BUILD solenv/inc/minor.mk | sed "s/^.*=//"`"
4271 AC_SUBST(LIBO_VERSION_MAJOR)
4272 AC_SUBST(LIBO_VERSION_MINOR)
4273 AC_SUBST(LIBO_VERSION_MICRO)
4274 AC_SUBST(LIBO_VERSION_PATCH)
4275 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,"$LIBO_VERSION_MAJOR")
4276 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,"$LIBO_VERSION_MINOR")
4277 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,"$LIBO_VERSION_MICRO")
4278 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,"$LIBO_VERSION_PATCH")
4280 dnl ===================================================================
4281 dnl Set the ENABLE_CRASHDUMP variable.
4282 dnl ===================================================================
4283 AC_MSG_CHECKING([whether to enable crashdump feature])
4284 if test "$enable_crashdump" = "yes"; then
4285     ENABLE_CRASHDUMP="TRUE"
4286     BUILD_TYPE="$BUILD_TYPE CRASHREP"
4287     AC_MSG_RESULT([yes])
4288 else
4289     ENABLE_CRASHDUMP=""
4290     AC_MSG_RESULT([no])
4292 AC_SUBST(ENABLE_CRASHDUMP)
4295 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4296 dnl ===================================================================
4297 AC_MSG_CHECKING([whether to turn warnings to errors])
4298 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4299     EXTERNAL_WARNINGS_NOT_ERRORS="FALSE"
4300     AC_MSG_RESULT([yes])
4301 else
4302     EXTERNAL_WARNINGS_NOT_ERRORS="TRUE"
4303     AC_MSG_RESULT([no])
4305 AC_SUBST(EXTERNAL_WARNINGS_NOT_ERRORS)
4307 dnl Set the ASSERT_ALWAYS_ABORT variable. (Activate --enable-assert-always-abort)
4308 dnl ===================================================================
4309 AC_MSG_CHECKING([whether to have assert to abort in release code])
4310 if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
4311     ASSERT_ALWAYS_ABORT="TRUE"
4312     AC_MSG_RESULT([yes])
4313 else
4314     ASSERT_ALWAYS_ABORT="FALSE"
4315     AC_MSG_RESULT([no])
4317 AC_SUBST(ASSERT_ALWAYS_ABORT)
4319 dnl Determine whether to use linkoo for the smoketest installation
4320 dnl ===================================================================
4321 AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
4322 if test "$enable_linkoo" = "no"; then
4323     DISABLE_LINKOO="TRUE"
4324     AC_MSG_RESULT([no])
4325 else
4326     DISABLE_LINKOO=
4327     AC_MSG_RESULT([yes])
4329 AC_SUBST(DISABLE_LINKOO)
4331 # Set the ENABLE_LTO variable
4332 # ===================================================================
4333 AC_MSG_CHECKING([whether to use link-time optimization])
4334 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
4335     ENABLE_LTO="TRUE"
4336     AC_MSG_RESULT([yes])
4337 else
4338     ENABLE_LTO=""
4339     AC_MSG_RESULT([no])
4341 AC_SUBST(ENABLE_LTO)
4343 if test "$enable_headless" = "yes"; then
4344     # be sure to do not mess with uneeded stuff
4345     test_randr=no
4346     test_xrender=no
4347     test_cups=no
4348     test_dbus=no
4349     test_fontconfig=yes
4350     test_gtk=no
4351     build_gstreamer=no
4352     build_gstreamer_0_10=no
4353     test_tde=no
4354     test_kde=no
4355     test_kde4=no
4356     test_unix_quickstarter=no
4357     enable_cairo_canvas=no
4358     enable_gnome_vfs=no
4361 dnl ===================================================================
4362 dnl check for cups support
4363 dnl ===================================================================
4364 ENABLE_CUPS=""
4366 if test "$enable_cups" = "no"; then
4367     test_cups=no
4370 AC_MSG_CHECKING([whether to enable CUPS support])
4371 if test "$test_cups" = "yes"; then
4372     ENABLE_CUPS="TRUE"
4373     AC_MSG_RESULT([yes])
4375     AC_MSG_CHECKING([whether cups support is present])
4376     AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4377     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4378     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
4379         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups-devel.])
4380     fi
4382 else
4383     AC_MSG_RESULT([no])
4386 AC_SUBST(ENABLE_CUPS)
4388 # fontconfig checks
4389 if test "$test_fontconfig" = "yes"; then
4390     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
4391 else
4392     case "$BUILD_TYPE" in
4393     *FONTCONFIG*)
4394         FONTCONFIG_LIBS="-lfontconfig"
4395         ;;
4396     esac
4398 AC_SUBST(FONTCONFIG_CFLAGS)
4399 AC_SUBST(FONTCONFIG_LIBS)
4401 dnl whether to find & fetch external tarballs?
4402 dnl ===================================================================
4403 if test -z "$TARFILE_LOCATION"; then
4404     TARFILE_LOCATION="$SRC_ROOT/src"
4406 AC_SUBST(TARFILE_LOCATION)
4408 AC_MSG_CHECKING([whether we want to fetch tarballs])
4409 if test "$enable_fetch_external" != "no"; then
4410     if test "$with_all_tarballs" = "yes"; then
4411         AC_MSG_RESULT(["yes, all of them"])
4412         DO_FETCH_TARBALLS="ALL"
4413     else
4414         AC_MSG_RESULT(["yes, if we use them"])
4415         DO_FETCH_TARBALLS="YES"
4416     fi
4417 else
4418     AC_MSG_RESULT([no])
4419     DO_FETCH_TARBALLS="NO"
4421 AC_SUBST(DO_FETCH_TARBALLS)
4423 AC_MSG_CHECKING([whether to build help])
4424 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4425     AC_MSG_RESULT([yes])
4426     BUILD_TYPE="$BUILD_TYPE HELP"
4427     SCPDEFS="$SCPDEFS -DWITH_HELP"
4428     GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4429 else
4430     AC_MSG_RESULT([no])
4433 dnl Test whether to include MySpell dictionaries
4434 dnl ===================================================================
4435 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4436 if test -z "$with_myspell_dicts" -o "$with_myspell_dicts" = "yes"; then
4437     AC_MSG_RESULT([yes])
4438     WITH_MYSPELL_DICTS=YES
4439     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4440     GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4441 else
4442     AC_MSG_RESULT([no])
4443     WITH_MYSPELL_DICTS=NO
4445 AC_SUBST(WITH_MYSPELL_DICTS)
4447 AC_MSG_CHECKING([whether to use dicts from external paths])
4448 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4449     AC_MSG_RESULT([yes])
4450     SYSTEM_DICTS=YES
4451     AC_MSG_CHECKING([for spelling dictionary directory])
4452     if test -n "$with_external_dict_dir"; then
4453         DICT_SYSTEM_DIR=file://$with_external_dict_dir
4454     else
4455         DICT_SYSTEM_DIR=file:///usr/share/hunspell
4456         if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4457             DICT_SYSTEM_DIR=file:///usr/share/myspell
4458         fi
4459     fi
4460     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4461     AC_MSG_CHECKING([for hyphenation patterns directory])
4462     if test -n "$with_external_hyph_dir"; then
4463         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4464     else
4465         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4466     fi
4467     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4468     AC_MSG_CHECKING([for thesaurus directory])
4469     if test -n "$with_external_thes_dir"; then
4470         THES_SYSTEM_DIR=file://$with_external_thes_dir
4471     else
4472         THES_SYSTEM_DIR=file:///usr/share/mythes
4473     fi
4474     AC_MSG_RESULT([$THES_SYSTEM_DIR])
4475 else
4476     AC_MSG_RESULT([no])
4477     SYSTEM_DICTS=NO
4479 AC_SUBST(SYSTEM_DICTS)
4480 AC_SUBST(DICT_SYSTEM_DIR)
4481 AC_SUBST(HYPH_SYSTEM_DIR)
4482 AC_SUBST(THES_SYSTEM_DIR)
4484 dnl ===================================================================
4485 dnl ENABLE_PCH i now a no-op
4486 dnl ===================================================================
4487 AC_MSG_CHECKING([whether to enable pch feature])
4488 AC_MSG_RESULT([no, obsolete])
4490 dnl ===================================================================
4491 dnl Search all the common names for GNU make
4492 dnl ===================================================================
4493 AC_MSG_CHECKING([for GNU make])
4495 # try to use our own make if it is available and GNUMAKE was not already defined
4496 if test -z "$GNUMAKE"; then
4497     if test -x "/opt/lo/bin/make"; then
4498         GNUMAKE="/opt/lo/bin/make"
4499     fi
4502 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
4503     if test -n "$a"; then
4504         $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
4505         if test $? -eq 0;  then
4506             GNUMAKE=$a
4507             break
4508         fi
4509     fi
4510 done
4511 AC_MSG_RESULT($GNUMAKE)
4512 if test -z "$GNUMAKE"; then
4513     AC_MSG_ERROR([not found. install GNU make.])
4516 AC_MSG_CHECKING([the GNU make version])
4517 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4518 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4519 if test "$_make_longver" -ge "038200"; then
4520     AC_MSG_RESULT([$GNUMAKE $_make_version])
4522 elif test "$_make_longver" -ge "038100"; then
4523     if test "$build_os" = "cygwin"; then
4524         AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4525     fi
4526     AC_MSG_RESULT([$GNUMAKE $_make_version])
4528     dnl ===================================================================
4529     dnl Search all the common names for sha1sum
4530     dnl ===================================================================
4531     AC_PATH_PROGS(SHA1SUM, sha1sum sha1 shasum)
4532     if test -z "$SHA1SUM"; then
4533         AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
4534     fi
4535     AC_MSG_CHECKING([for GNU make bug 20033])
4536     TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4537     cat > $TESTGMAKEBUG20033/Makefile << EOF
4538 A := \$(wildcard *.a)
4540 .PHONY: all
4541 all: \$(A:.a=.b)
4542         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
4544 .PHONY: setup
4545 setup:
4546         @touch 1.a 2.a 3.a 4.a 5.a 6.a
4548 define d1
4549 @echo lala \$(1)
4550 @sleep 1
4551 endef
4553 define d2
4554 @echo tyty \$(1)
4555 @sleep 1
4556 endef
4558 %.b : %.a
4559         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
4560         \$(call d1,\$(CHECKSUM)),\
4561         \$(call d2,\$(CHECKSUM)))
4563     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
4564         no_parallelism_make="YES"
4565         AC_MSG_RESULT([yes, disable parallelism])
4566     else
4567         AC_MSG_RESULT([no, keep parallelism enabled])
4568     fi
4569     rm -rf $TESTGMAKEBUG20033
4570 else
4571     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
4574 # find if gnumake support file function
4575 AC_MSG_CHECKING([whether GNU make supports the 'file' function])
4576 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
4577 cat > $TESTGMAKEFILEFUNC/Makefile << EOF
4578 \$(file >test.txt,Success )
4580 .PHONY: all
4581 all:
4582         @cat test.txt
4585 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
4586 if test -f $TESTGMAKEFILEFUNC/test.txt; then
4587     HAVE_GNUMAKE_FILE_FUNC="YES"
4588     AC_MSG_RESULT([yes])
4589 else
4590     AC_MSG_RESULT([no])
4592 rm -rf $TESTGMAKEFILEFUNC
4593 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
4594 AC_SUBST(GNUMAKE)
4596 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`
4597 STALE_MAKE=
4598 make_warning=
4599 if test "$_make_ver_check" = ""; then
4600    STALE_MAKE=TRUE
4603 HAVE_LD_HASH_STYLE=FALSE
4604 WITH_LINKER_HASH_STYLE=
4605 AC_MSG_CHECKING( for --hash-style gcc linker support )
4606 if test "$GCC" = "yes"; then
4607     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
4608         hash_styles="gnu sysv"
4609     elif test "$with_linker_hash_style" = "no"; then
4610         hash_styles=
4611     else
4612         hash_styles="$with_linker_hash_style"
4613     fi
4615     for hash_style in $hash_styles; do
4616         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4617         hash_style_ldflags_save=$LDFLAGS
4618         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
4620         AC_LINK_IFELSE([AC_LANG_PROGRAM(
4621             [
4622 #include <stdio.h>
4623             ],[
4624 printf ("");
4625             ])],
4626             [ if ./conftest$EXEEXT; then
4627                   HAVE_LD_HASH_STYLE=TRUE
4628                   WITH_LINKER_HASH_STYLE=$hash_style
4629               fi],
4630             [HAVE_LD_HASH_STYLE=FALSE])
4631         LDFLAGS=$hash_style_ldflags_save
4632     done
4634     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
4635         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
4636     else
4637         AC_MSG_RESULT( no )
4638     fi
4639     LDFLAGS=$hash_style_ldflags_save
4640 else
4641     AC_MSG_RESULT( no )
4643 AC_SUBST(HAVE_LD_HASH_STYLE)
4644 AC_SUBST(WITH_LINKER_HASH_STYLE)
4646 dnl ===================================================================
4647 dnl Check whether there's a Perl version available.
4648 dnl ===================================================================
4649 if test -z "$with_perl_home"; then
4650     AC_PATH_PROG(PERL, perl)
4651 else
4652     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
4653     _perl_path="$with_perl_home/bin/perl"
4654     if test -x "$_perl_path"; then
4655         PERL=$_perl_path
4656     else
4657         AC_MSG_ERROR([$_perl_path not found])
4658     fi
4661 dnl ===================================================================
4662 dnl Testing for Perl version 5 or greater.
4663 dnl $] is the Perl version variable, it is returned as an integer
4664 dnl ===================================================================
4665 if test "$PERL"; then
4666     AC_MSG_CHECKING([the Perl version])
4667     ${PERL} -e "exit($]);"
4668     _perl_version=$?
4669     if test "$_perl_version" -lt 5; then
4670         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
4671     fi
4672     AC_MSG_RESULT([checked (perl $_perl_version)])
4673 else
4674     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
4677 dnl ===================================================================
4678 dnl Testing for required Perl modules
4679 dnl ===================================================================
4681 AC_MSG_CHECKING([for required Perl modules])
4682 if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'`; then
4683     AC_MSG_RESULT([all modules found])
4684 else
4685     AC_MSG_ERROR([Failed to find some modules])
4689 dnl ===================================================================
4690 dnl Check for pkg-config
4691 dnl ===================================================================
4692 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4693     PKG_PROG_PKG_CONFIG
4696 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4698     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
4699     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
4700     # explicitly. Or put /path/to/compiler in PATH yourself.
4702     AC_CHECK_TOOL(AR,ar)
4703     AC_CHECK_TOOL(NM,nm)
4704     AC_CHECK_TOOL(OBJDUMP,objdump)
4705     AC_CHECK_TOOL(RANLIB,ranlib)
4706     AC_CHECK_TOOL(STRIP,strip)
4707     if test "$_os" = "WINNT"; then
4708         AC_CHECK_TOOL(DLLTOOL,dlltool)
4709         AC_CHECK_TOOL(WINDRES,windres)
4710     fi
4712 AC_SUBST(AR)
4713 AC_SUBST(DLLTOOL)
4714 AC_SUBST(NM)
4715 AC_SUBST(OBJDUMP)
4716 AC_SUBST(PKG_CONFIG)
4717 AC_SUBST(RANLIB)
4718 AC_SUBST(STRIP)
4719 AC_SUBST(WINDRES)
4721 dnl ===================================================================
4722 dnl pkg-config checks on Mac OS X
4723 dnl ===================================================================
4725 if test $_os = Darwin; then
4726     AC_MSG_CHECKING([for bogus pkg-config])
4727     if test -n "$PKG_CONFIG"; then
4728         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
4729             AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
4730         else
4731             if test "$enable_bogus_pkg_config" = "yes"; then
4732                 AC_MSG_RESULT([yes, user-approved from unknown origin.])
4733             else
4734                 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please remove or hide $PKG_CONFIG])
4735             fi
4736         fi
4737     else
4738         AC_MSG_RESULT([no, good])
4739     fi
4742 dnl ===================================================================
4743 dnl  .NET needs special treatment
4744 dnl (does the above comment really mean .NET, or is it misusing
4745 dnl that to mean Visual Studio .NET 2003 ? And does this also
4746 dnl in fact apply equally to what we actually support, i.e.
4747 dnl Visual Studio 2008 and 2010?)
4748 dnl ===================================================================
4749 if test "$build_os" = "cygwin"; then
4750     dnl Check midl.exe
4751     AC_PATH_PROG(MIDL_PATH, midl.exe)
4752     if test -n "$MIDL_PATH"; then
4753         MIDL_PATH=`dirname "$MIDL_PATH"`
4754     else
4755         AC_MSG_CHECKING([for midl.exe more thoroughly])
4756     fi
4757     if test -n "$with_midl_path"; then
4758         with_midl_path=`cygpath -u "$with_midl_path"`
4759     fi
4760     if test -x "$with_midl_path/midl.exe"; then
4761         MIDL_PATH="$with_midl_path"
4762     fi
4763     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
4764         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
4765     fi
4766     if test -z "$MIDL_PATH"; then
4767         vstest=`./oowintool --msvs-productdir`
4768         if test -x "$vstest/Common7/Tools/Bin/midl.exe"; then
4769             MIDL_PATH="$vstest/Common7/Tools/Bin"
4770         fi
4771     fi
4772     if test -z "$MIDL_PATH"; then
4773         winsdktest=`./oowintool --windows-sdk-home`
4774         if test -x "$winsdktest/Bin/midl.exe"; then
4775             MIDL_PATH="$winsdktest/Bin"
4776         elif test -x "$winsdktest/Bin/$SDK_ARCH/midl.exe"; then
4777             MIDL_PATH="$winsdktest/Bin/$SDK_ARCH"
4778         fi
4779     fi
4780     if test ! -x "$MIDL_PATH/midl.exe"; then
4781         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
4782     else
4783         AC_MSG_RESULT([$MIDL_PATH/midl.exe])
4784     fi
4785     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4786     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
4787     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
4789     dnl Check csc.exe
4790     AC_PATH_PROG(CSC_PATH, csc.exe)
4791     if test -n "$CSC_PATH"; then
4792         CSC_PATH=`dirname "$CSC_PATH"`
4793     fi
4794     if test -n "$with_csc_path"; then
4795         with_csc_path=`cygpath -u "$with_csc_path"`
4796     else
4797         AC_MSG_CHECKING([for csc.exe more thoroughly])
4798     fi
4799     if test -x "$with_csc_path/csc.exe"; then
4800         CSC_PATH="$with_csc_path"
4801     else
4802        csctest=`./oowintool --csc-compilerdir`
4803        if test -x "$csctest/csc.exe"; then
4804            CSC_PATH="$csctest"
4805        fi
4806     fi
4807     if test ! -x "$CSC_PATH/csc.exe"; then
4808         AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
4809     else
4810         AC_MSG_RESULT([$CSC_PATH/csc.exe])
4811     fi
4812     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4813     CSC_PATH=`cygpath -d "$CSC_PATH"`
4814     CSC_PATH=`cygpath -u "$CSC_PATH"`
4816     dnl Check al.exe
4817     AC_PATH_PROG(AL_PATH, al.exe)
4818     if test -n "$AL_PATH"; then
4819         AL_PATH=`dirname "$AL_PATH"`
4820     else
4821         AC_MSG_CHECKING([for al.exe more thoroughly])
4822     fi
4823     if test -n "$with_al_path"; then
4824         with_al_path=`cygpath -u "$with_al_path"`
4825     fi
4826     if test -x "$with_al_path/al.exe"; then
4827         AL_PATH="$with_al_path"
4828     fi
4829     if test -z "$AL_PATH"; then
4830         winsdktest=`./oowintool --windows-sdk-home`
4831         if test -x "$winsdktest/Bin/al.exe"; then
4832             AL_PATH="$winsdktest/Bin"
4833         elif test -x "$winsdktest/Bin/$SDK_ARCH/al.exe"; then
4834             AL_PATH="$winsdktest/Bin/$SDK_ARCH"
4835         fi
4836     fi
4837     if test -z "$AL_PATH"; then
4838         altest=`./oowintool --al-home`
4839         if test -x "$altest/bin/al.exe"; then
4840             AL_PATH="$altest/bin"
4841         elif test -x "$altest/al.exe"; then
4842             AL_PATH="$altest"
4843         fi
4844     fi
4845     if test ! -x "$AL_PATH/al.exe"; then
4846         AC_MSG_ERROR([al.exe not found. Make sure it's in PATH or use --with-al-path])
4847     else
4848         AC_MSG_RESULT([$AL_PATH/al.exe])
4849     fi
4851     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4852     AL_PATH=`cygpath -d "$AL_PATH"`
4853     AL_PATH=`cygpath -u "$AL_PATH"`
4855     dnl Check mscoree.lib / .NET Framework dir
4856     AC_MSG_CHECKING(.NET Framework)
4857     if test -n "$with_dotnet_framework_home"; then
4858         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
4859     fi
4860         if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
4861         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
4862     fi
4863     if test -z "$DOTNET_FRAMEWORK_HOME"; then
4864         frametest=`./oowintool --dotnetsdk-dir`
4865         if test -f "$frametest/lib/mscoree.lib"; then
4866             DOTNET_FRAMEWORK_HOME="$frametest"
4867         else
4868             frametest=`./oowintool --windows-sdk-home`
4869             if test -f "$frametest/lib/mscoree.lib" -o -f "$frametest/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
4870                 DOTNET_FRAMEWORK_HOME="$frametest"
4871             fi
4872         fi
4873     fi
4874     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
4875         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
4876     fi
4877     AC_MSG_RESULT(found)
4879     PathFormat "$MIDL_PATH"
4880     MIDL_PATH="$formatted_path"
4882     PathFormat "$AL_PATH"
4883     AL_PATH="$formatted_path"
4885     PathFormat "$DOTNET_FRAMEWORK_HOME"
4886     DOTNET_FRAMEWORK_HOME="$formatted_path"
4888     PathFormat "$CSC_PATH"
4889     CSC_PATH="$formatted_path"
4893 dnl ===================================================================
4894 dnl Check if stdc headers are available excluding MSVC.
4895 dnl ===================================================================
4896 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4897     AC_HEADER_STDC
4900 dnl ===================================================================
4901 dnl Testing for C++ compiler and version...
4902 dnl ===================================================================
4904 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4905     # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
4906     save_CXXFLAGS=$CXXFLAGS
4907     AC_PROG_CXX
4908     CXXFLAGS=$save_CXXFLAGS
4909 else
4910     if test -n "$CC" -a -z "$CXX"; then
4911         CXX="$CC"
4912     fi
4915 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
4916 if test "$GXX" = "yes"; then
4917     AC_MSG_CHECKING([the GNU C++ compiler version])
4919     _gpp_version=`$CXX -dumpversion`
4920     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
4922     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401"; then
4923         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0"; then
4924             export CXX="$GCC_HOME/bin/g++-4.0"
4925             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
4926             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401"; then
4927                 _gpp_majmin=$_gpp_majmin_2
4928             fi
4929         fi
4930         if test "$_gpp_majmin" -ge "401"; then
4931             AC_MSG_ERROR([You need to use the g++-4.0 compiler (g++ $_gpp_version won't work with the MacOSX10.4u.sdk) - set CXX accordingly])
4932         else
4933             AC_MSG_RESULT([implicitly using CXX=$CXX])
4934         fi
4935     else
4936         AC_MSG_RESULT([checked (g++ $_gpp_version)])
4937     fi
4939     if test "$_gpp_majmin" = "304"; then
4940         AC_MSG_CHECKING([whether $CXX has the enum bug])
4941         AC_RUN_IFELSE([AC_LANG_SOURCE([[
4942             extern "C" void abort (void);
4943             extern "C" void exit (int status);
4945             enum E { E0, E1, E2, E3, E4, E5 };
4947             void test (enum E e)
4948             {
4949                 if (e == E2 || e == E3 || e == E1)
4950                     exit (1);
4951             }
4953             int main (void)
4954             {
4955                 test (E4);
4956                 test (E5);
4957                 test (E0);
4958                 return 0;
4959             }
4960             ]])],[AC_MSG_ERROR([your version of the GNU C++ compile has a bug which prevents LibreOffice from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details.])],[AC_MSG_RESULT([no])],[])
4961     fi
4965 # prefx CXX with ccache if needed
4967 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4968     if test "$CCACHE" != ""; then
4969         AC_MSG_CHECKING([whether $CXX is already ccached])
4970         AC_LANG_PUSH([C++])
4971         save_CXXFLAGS=$CXXFLAGS
4972         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
4973         dnl an empty program will do, we're checking the compiler flags
4974         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
4975                           [use_ccache=yes], [use_ccache=no])
4976         if test $use_ccache = yes; then
4977             AC_MSG_RESULT([yes])
4978         else
4979             CXX="$CCACHE $CXX"
4980             AC_MSG_RESULT([no])
4981         fi
4982         CXXFLAGS=$save_CXXFLAGS
4983         AC_LANG_POP([C++])
4984     fi
4987 dnl ===================================================================
4988 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
4989 dnl ===================================================================
4991 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4992     AC_PROG_CXXCPP
4994     dnl Check whether there's a C pre-processor.
4995     dnl ===================================================================
4996     dnl When using SunStudio compiler, there is a bug with the cc
4997     dnl preprocessor, so use CC preprocessor as the cc preprocessor
4998     dnl See Issuezilla #445.
4999     dnl ===================================================================
5000     if test "$_os" = "SunOS"; then
5001         CPP=$CXXCPP
5002     else
5003         AC_PROG_CPP
5004     fi
5008 dnl ===================================================================
5009 dnl Find integral type sizes and alignments
5010 dnl ===================================================================
5012 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5014     AC_CHECK_SIZEOF(long)
5015     AC_CHECK_SIZEOF(short)
5016     AC_CHECK_SIZEOF(int)
5017     AC_CHECK_SIZEOF(long long)
5018     AC_CHECK_SIZEOF(double)
5019     AC_CHECK_SIZEOF(void*)
5021     SIZEOF_SHORT=$ac_cv_sizeof_short
5022     SIZEOF_INT=$ac_cv_sizeof_int
5023     SIZEOF_LONG=$ac_cv_sizeof_long
5024     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
5025     SIZEOF_DOUBLE=$ac_cv_sizeof_double
5026     SIZEOF_POINTER=$ac_cv_sizeof_voidp
5028     dnl Allow build without AC_CHECK_ALIGNOF, grrr
5029     m4_pattern_allow([AC_CHECK_ALIGNOF])
5030     m4_ifdef([AC_CHECK_ALIGNOF],
5031         [
5032             AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5033             AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5034             AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5035             AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5036         ],
5037         [
5038             case "$_os-$host_cpu" in
5039             Darwin-powerpc)
5040                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=1
5041                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=1
5042                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=1
5043                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=1
5044                 ;;
5045             Linux-i686)
5046                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5047                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5048                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5049                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5050                 ;;
5051             Linux-x86_64)
5052                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5053                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5054                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5055                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5056                 ;;
5057             *)
5058                 if test -z "$ac_cv_alignof_short" -o \
5059                         -z "$ac_cv_alignof_int" -o \
5060                         -z "$ac_cv_alignof_long" -o \
5061                         -z "$ac_cv_alignof_double"; then
5062                    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.])
5063                 fi
5064                 ;;
5065             esac
5066         ])
5068     ALIGNOF_SHORT=$ac_cv_alignof_short
5069     ALIGNOF_INT=$ac_cv_alignof_int
5070     ALIGNOF_LONG=$ac_cv_alignof_long
5071     ALIGNOF_DOUBLE=$ac_cv_alignof_double
5073     AC_C_BIGENDIAN
5074     WORDS_BIGENDIAN=$ac_cv_c_bigendian
5076     dnl Check for large file support
5077     AC_SYS_LARGEFILE
5078     if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5079         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5080     fi
5081     if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5082         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5083     fi
5084 else
5085     # Hardcode for MSVC
5086     SIZEOF_SHORT=2
5087     SIZEOF_INT=4
5088     SIZEOF_LONG=4
5089     SIZEOF_LONGLONG=8
5090     if test "$BITNESS_OVERRIDE" = ""; then
5091         SIZEOF_POINTER=4
5092     else
5093         SIZEOF_POINTER=8
5094     fi
5095     ALIGNOF_SHORT=2
5096     ALIGNOF_INT=4
5097     ALIGNOF_LONG=4
5098     ALIGNOF_DOUBLE=8
5099     WORDS_BIGENDIAN=no
5100     LFS_CFLAGS=''
5102 AC_SUBST(WORDS_BIGENDIAN)
5103 AC_SUBST(LFS_CFLAGS)
5105 AC_SUBST(SIZEOF_SHORT)
5106 AC_SUBST(SIZEOF_INT)
5107 AC_SUBST(SIZEOF_LONG)
5108 AC_SUBST(SIZEOF_LONGLONG)
5109 AC_SUBST(SIZEOF_DOUBLE)
5110 AC_SUBST(SIZEOF_POINTER)
5111 AC_SUBST(ALIGNOF_SHORT)
5112 AC_SUBST(ALIGNOF_INT)
5113 AC_SUBST(ALIGNOF_LONG)
5114 AC_SUBST(ALIGNOF_DOUBLE)
5116 dnl ===================================================================
5117 dnl Check if valgrind headers are available
5118 dnl ===================================================================
5119 if test "$cross_compiling" = yes -o "$ENABLE_DBGUTIL" != TRUE; then
5120     ENABLE_VALGRIND=FALSE
5121 else
5122     prev_cppflags=$CPPFLAGS
5123     CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5124     AC_CHECK_HEADER([valgrind/valgrind.h],
5125         [ENABLE_VALGRIND=TRUE],[ENABLE_VALGRIND=FALSE])
5126     CPPFLAGS=$prev_cppflags
5128 AC_SUBST([ENABLE_VALGRIND])
5129 if test "$ENABLE_VALGRIND" = FALSE; then
5130     VALGRIND_CFLAGS=
5132 AC_SUBST([VALGRIND_CFLAGS])
5134 dnl ===================================================================
5135 dnl Compiler plugins
5136 dnl ===================================================================
5138 COMPILER_PLUGINS=
5139 # currently only Clang
5140 if test "$COM_GCC_IS_CLANG" = "TRUE"; then
5141     if test -n "$enable_compiler_plugins"; then
5142         compiler_plugins="$enable_compiler_plugins"
5143     elif test -n "$ENABLE_DBGUTIL"; then
5144         compiler_plugins=test
5145     else
5146         compiler_plugins=no
5147     fi
5148     if test "$compiler_plugins" != "no"; then
5149         AC_LANG_PUSH([C++])
5150         save_CPPFLAGS=$CPPFLAGS
5151         CPPFLAGS="$CPPFLAGS $CLANGPLUGIN_CPPFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
5152         AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
5153             [COMPILER_PLUGINS=TRUE],
5154             [
5155             if test "$compiler_plugins" = "yes"; then
5156                 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
5157             else
5158                 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
5159                 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
5160             fi
5161             ])
5162         CPPFLAGS=$save_CPPFLAGS
5163         AC_LANG_POP([C++])
5164     fi
5165 else
5166     if test "$enable_compiler_plugins" = "yes"; then
5167         AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
5168     fi
5170 AC_SUBST(COMPILER_PLUGINS)
5171 AC_SUBST(CLANGPLUGIN_CPPFLAGS)
5173 dnl ===================================================================
5174 dnl Set the MinGW sys-root
5175 dnl ===================================================================
5176 if test "$WITH_MINGW" = "yes"; then
5177     for sysroot in /usr/i686-w64-mingw32/sys-root/mingw; do
5178         if test -d "$sysroot"; then
5179             MINGW_SYSROOT="$sysroot"
5180             break
5181         fi
5182     done
5184 AC_SUBST([MINGW_SYSROOT])
5186 dnl ===================================================================
5187 dnl Set the MinGW include directories
5188 dnl ===================================================================
5189 if test "$WITH_MINGW" = "yes"; then
5190     AC_MSG_CHECKING([for MinGW include path])
5191     cat >conftest.$ac_ext <<_ACEOF
5192 #include <stddef.h>
5193 #include <bits/c++config.h>
5194 _ACEOF
5195     _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`
5196     rm conftest.$ac_ext
5197     if test -z "$_mingw_lib_include_path"; then
5198         _mingw_lib_include_path="NO_LIB_INCLUDE"
5199         AC_MSG_RESULT([no MinGW include path])
5200     else
5201         AC_MSG_RESULT([$_mingw_lib_include_path])
5202     fi
5203     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
5204     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
5206     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
5207     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
5209     AC_LANG_PUSH([C++])
5211     AC_MSG_CHECKING([for dynamic libgcc])
5212     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5213 #include <iostream>
5214 using namespace std;
5215 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
5216             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
5217             if test -n "$MINGW_GCCDLL"; then
5218                 MINGW_SHARED_GCCLIB=YES
5219                 AC_MSG_RESULT([ $MINGW_GCCDLL])
5220             else
5221                 MINGW_SHARED_GCCLIB=NO
5222                 AC_MSG_RESULT([no])
5223             fi
5224        ],[ AC_MSG_RESULT([no])
5226     ])
5228     AC_MSG_CHECKING([for dynamic libstdc++])
5229     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5230 #include <iostream>
5231 using namespace std;
5232 ]], [[ cout << "Hello there." << endl; ]])],[
5233             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
5234             if test -n "$MINGW_GXXDLL"; then
5235                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
5236                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
5237                 if test "$CROSS_COMPILING" = "YES"; then
5238                     dnl m4 escaping!
5239                     mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
5240                 fi
5241                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
5242                 MINGW_SHARED_GXXLIB=YES
5243                 AC_MSG_RESULT([$MINGW_GXXDLL])
5244             else
5245                 MINGW_SHARED_GXXLIB=NO
5246                 AC_MSG_RESULT([no])
5247             fi
5248        ],[ AC_MSG_RESULT([no])
5250     ])
5252     AC_LANG_POP([C++])
5254     AC_SUBST(MINGW_CLIB_DIR)
5255     AC_SUBST(MINGW_SHARED_GCCLIB)
5256     AC_SUBST(MINGW_SHARED_GXXLIB)
5257     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
5258     AC_SUBST(MINGW_GCCDLL)
5259     AC_SUBST(MINGW_GXXDLL)
5262 dnl ===================================================================
5263 dnl Extra checking for the SunOS compiler
5264 dnl ===================================================================
5265 if test "$_os" = "SunOS"; then
5266     dnl SunStudio C++ compiler packaged with SunStudio C compiler
5267     if test "$CC" = "cc"; then
5268     AC_MSG_CHECKING([SunStudio C++ Compiler])
5269         if test "$CXX" != "CC"; then
5270             AC_MSG_WARN([SunStudio C++ was not found])
5271             add_warning "SunStudio C++ was not found"
5272         else
5273             AC_MSG_RESULT([checked])
5274         fi
5275     fi
5278 dnl *************************************************************
5279 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
5280 dnl *************************************************************
5281 if test "$WITH_MINGW" = "yes"; then
5282     AC_MSG_CHECKING([exception type])
5283     AC_LANG_PUSH([C++])
5284     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
5286         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
5288         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
5289     ])
5290     AC_MSG_RESULT($exceptions_type)
5291     AC_LANG_POP([C++])
5294 EXCEPTIONS="$exceptions_type"
5295 AC_SUBST(EXCEPTIONS)
5297 dnl ===================================================================
5298 dnl thread-safe statics
5299 dnl ===================================================================
5300 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
5301 unset HAVE_THREADSAFE_STATICS
5302 if test "$GCC" = "yes"; then
5303     dnl -fthreadsafe-statics is available since GCC 4, so always available for
5304     dnl us.  However, some C++ runtimes use a single lock for all static
5305     dnl variables, which can cause deadlock in multi-threaded applications.
5306     dnl This is not easily tested here; for POSIX-based systems, if executing
5307     dnl the following C++ program does not terminate then the tool chain
5308     dnl apparently has this problem:
5309     dnl
5310     dnl   #include <pthread.h>
5311     dnl   int h() { return 0; }
5312     dnl   void * g(void * unused) {
5313     dnl     static int n = h();
5314     dnl     return &n;
5315     dnl   }
5316     dnl   int f() {
5317     dnl     pthread_t t;
5318     dnl     pthread_create(&t, 0, g, 0);
5319     dnl     pthread_join(t, 0);
5320     dnl     return 0;
5321     dnl   }
5322     dnl   int main() {
5323     dnl     static int n = f();
5324     dnl     return n;
5325     dnl   }
5326     dnl
5327     dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
5328     dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
5329     dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
5330     dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
5331     dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
5332     dnl difference there.  Conservative advice from Jakub Jelinek is to assume
5333     dnl it working in GCC >= 4.3:
5334     if test "$_os" = "Darwin" -o $_os = Android -o "${GCCVER?}" -lt 040300; then
5335         AC_MSG_RESULT([broken (i.e., no)])
5336     else
5337         HAVE_THREADSAFE_STATICS=TRUE
5338         AC_MSG_RESULT([yes])
5339     fi
5340 else
5341     AC_MSG_RESULT([unknown (assuming no)])
5343 AC_SUBST(HAVE_THREADSAFE_STATICS)
5345 dnl ===================================================================
5346 dnl visibility and c++0x features
5347 dnl ===================================================================
5348 if test "$GCC" = "yes"; then
5349     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
5350     save_CFLAGS=$CFLAGS
5351     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
5352     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
5353     CFLAGS=$save_CFLAGS
5355     if test "$COM_GCC_IS_CLANG" = TRUE -a $_os = Darwin; then
5356         # It seems that with Apple's Clang, visibility doesn't work as
5357         # we would want at least in the connectivity and dbaccess
5358         # modules. This might be because of something peculiar in
5359         # those modules? Whatever.
5360         HAVE_GCC_VISIBILITY_FEATURE=
5361     fi
5363     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5364         AC_MSG_RESULT([yes])
5365     else
5366         AC_MSG_RESULT([no])
5367     fi
5369     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
5370     save_CFLAGS=$CFLAGS
5371     CFLAGS="$CFLAGS -Werror -Wno-long-double"
5372     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
5373     CFLAGS=$save_CFLAGS
5374     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
5375         AC_MSG_RESULT([yes])
5376     else
5377         AC_MSG_RESULT([no])
5378     fi
5380     AC_MSG_CHECKING([whether $CC supports -mno-avx])
5381     save_CFLAGS=$CFLAGS
5382     CFLAGS="$CFLAGS -Werror -mno-avx"
5383     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5384     CFLAGS=$save_CFLAGS
5385     if test "$HAVE_GCC_AVX" = "TRUE"; then
5386         AC_MSG_RESULT([yes])
5387     else
5388         AC_MSG_RESULT([no])
5389     fi
5391     AC_MSG_CHECKING([whether $CC supports atomic functions])
5392     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5393     int v = 0;
5394     if (__sync_add_and_fetch(&v, 1) != 1 ||
5395         __sync_sub_and_fetch(&v, 1) != 0)
5396         return 1;
5397     __sync_synchronize();
5398     if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
5399         v != 1)
5400         return 1;
5401     return 0;
5402 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
5403     if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
5404         AC_MSG_RESULT([yes])
5405     else
5406         AC_MSG_RESULT([no])
5407     fi
5409     AC_MSG_CHECKING([whether $CXX supports -std=gnu++0x without Language Defect 757])
5410     if test "$GCCVER" -ge 040700 -a "$GCCVER" -lt 040702; then
5411         AC_MSG_NOTICE([Not using -std=gnu++0x on $CXX version 4.7.0/4.7.1 due to libstdc++ ABI breakage.])
5412     else
5413         save_CXXFLAGS=$CXXFLAGS
5414         CXXFLAGS="$CXXFLAGS -std=gnu++0x"
5415         AC_LANG_PUSH([C++])
5417         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5418 #include <stddef.h>
5420 #include <vector>
5421     // some Clang fail when compiling against GCC 4.7 headers with --std=gnu++0x
5423 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
5425 namespace
5427         struct b
5428         {
5429                 int i;
5430                 int j;
5431         };
5433 ]], [[
5434 struct a
5436         int i;
5437         int j;
5439 a thinga[]={{0,0}, {1,1}};
5440 b thingb[]={{0,0}, {1,1}};
5441 size_t i = sizeof(sal_n_array_size(thinga));
5442 size_t j = sizeof(sal_n_array_size(thingb));
5443 return !(i != 0 && j != 0);
5444 ]])],[HAVE_CXX0X=TRUE],[])
5446         AC_LANG_POP([C++])
5447         CXXFLAGS=$save_CXXFLAGS
5448     fi
5449     if test "$HAVE_CXX0X" = "TRUE"; then
5450         AC_MSG_RESULT([yes])
5451     else
5452         AC_MSG_RESULT([no])
5453     fi
5456 AC_SUBST(HAVE_CXX0X)
5457 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
5458 AC_SUBST(HAVE_GCC_AVX)
5459 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
5461 dnl ===================================================================
5462 dnl Check for C++11 perfect forwarding support
5463 dnl ===================================================================
5464 HAVE_CXX11_PERFECT_FORWARDING=
5465 AC_MSG_CHECKING([whether $CXX supports C++11 perfect forwarding])
5466 save_CXXFLAGS=$CXXFLAGS
5467 if test "$HAVE_CXX0X" = TRUE; then
5468     CXXFLAGS="$CXXFLAGS -std=gnu++0x"
5470 AC_LANG_PUSH([C++])
5471 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5472         #include <utility>
5473         template<typename T, typename... Args> T * f(Args &&... v) {
5474             return new T(std::forward<Args>(v)...);
5475         }
5476     ]], [[
5477         f<int>(0);
5478     ]])], [perfect_forwarding=yes], [perfect_forwarding=no])
5479 AC_LANG_POP([C++])
5480 CXXFLAGS=$save_CXXFLAGS
5481 AC_MSG_RESULT([$perfect_forwarding])
5482 if test "$perfect_forwarding" = yes; then
5483     HAVE_CXX11_PERFECT_FORWARDING=TRUE
5485 AC_SUBST([HAVE_CXX11_PERFECT_FORWARDING])
5487 dnl ===================================================================
5488 dnl system stl sanity tests
5489 dnl ===================================================================
5490 HAVE_GCC_VISIBILITY_BROKEN=
5491 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
5493     AC_LANG_PUSH([C++])
5495     save_CPPFLAGS="$CPPFLAGS"
5496     if test -n "$MACOSX_SDK_PATH"; then
5497         CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
5498     fi
5500     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5501         dnl gcc#19664, gcc#22482, rhbz#162935
5502         AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
5503         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
5504         AC_MSG_RESULT([$stlvisok])
5505         if test "$stlvisok" = "no"; then
5506             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
5507             add_warning "Your gcc STL headers are not visibility safe. Disabling visibility"
5508             unset HAVE_GCC_VISIBILITY_FEATURE
5509         fi
5510     fi
5512     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5513         sharedlink_ldflags_save=$LDFLAGS
5514         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
5516         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
5517         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5518 #include <sstream>
5519 using namespace std;
5520             ]], [[
5521 istringstream strm( "test" ); return 0;
5522             ]])],
5523             # Ugh, surely bad to assume an error message will contain
5524             # the word "unresolvable", a problem with
5525             # -fvisibility-inlines-hidden and STL headers might cause
5526             # some more obscure message on some platform, and anway,
5527             # the error message could be localised.
5528             [$EGREP -q unresolvable conftest.err;
5529             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
5530         ])
5531         AC_MSG_RESULT([$gccvisok])
5532         if test "$gccvisok" = "no"; then
5533             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
5534             add_warning "Your gcc is not -fvisibility-inlines-hidden safe, disabling that."
5535             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
5536         fi
5538         LDFLAGS=$sharedlink_ldflags_save
5539     fi
5541     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
5542         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
5543         cat > conftestlib1.cc <<_ACEOF
5544 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
5545 struct S2: S1<int> { virtual ~S2(); };
5546 S2::~S2() {}
5547 _ACEOF
5548         cat > conftestlib2.cc <<_ACEOF
5549 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
5550 struct S2: S1<int> { virtual ~S2(); };
5551 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
5552 _ACEOF
5553         gccvisinlineshiddenok=yes
5554         if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
5555             gccvisinlineshiddenok=no
5556         else
5557             if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $LINKFLAGSNOUNDEFS -o libconftest2$DLLPOST >/dev/null 2>&5; then
5558                 gccvisinlineshiddenok=no
5559             fi
5560         fi
5562         rm -fr libconftest*
5563         AC_MSG_RESULT([$gccvisinlineshiddenok])
5564         if test "$gccvisinlineshiddenok" = "no"; then
5565             AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
5566             add_warning "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that."
5567             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
5568         fi
5569     fi
5571     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5572         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
5573         cat >visibility.cxx <<_ACEOF
5574 #pragma GCC visibility push(hidden)
5575 struct __attribute__ ((visibility ("default"))) TestStruct {
5576   static void Init();
5578 __attribute__ ((visibility ("default"))) void TestFunc() {
5579   TestStruct::Init();
5581 _ACEOF
5582         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
5583             gccvisbroken=yes
5584         else
5585             case "$host_cpu" in
5586             i?86|x86_64)
5587                 if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
5588                     gccvisbroken=no
5589                 else
5590                     if $EGREP -q '@PLT|@GOT' visibility.s; then
5591                         gccvisbroken=no
5592                     else
5593                         gccvisbroken=yes
5594                     fi
5595                 fi
5596                 ;;
5597             *)
5598                 gccvisbroken=no
5599                 ;;
5600             esac
5601         fi
5602         rm -f visibility.s visibility.cxx
5604         AC_MSG_RESULT([$gccvisbroken])
5605         if test "$gccvisbroken" = "yes"; then
5606             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
5607             add_warning "Your gcc is not -fvisibility=hidden safe. Disabling visibility"
5608             unset HAVE_GCC_VISIBILITY_FEATURE
5609         fi
5610     fi
5612     CPPFLAGS="$save_CPPFLAGS"
5614     AC_LANG_POP([C++])
5617 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
5618 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
5620 dnl ===================================================================
5621 dnl SFINAE test
5622 dnl Pre-C++11 does not allow types without linkage as template arguments.
5623 dnl Substitution Failure Is Not An Error is an idiom that disables
5624 dnl template instances that would cause an error, without actually
5625 dnl causing an error. Old gcc (pre-4.0.2) however causes a real error.
5626 dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21514
5627 dnl ===================================================================
5628 HAVE_SFINAE_ANONYMOUS_BROKEN=
5629 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
5631     AC_LANG_PUSH([C++])
5632     AC_MSG_CHECKING([if SFINAE is broken with anonymous types])
5633     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5634 enum { AnonymousEnumValue };
5635 template< typename T > class TestPredicate {};
5636 template<> class TestPredicate< int > { public: typedef bool Type; };
5637 template< typename T >
5638 bool test( const T&, typename TestPredicate< T >::Type = false )
5639     { return true; };
5640 void test( ... );
5641             ]], [[
5642     test( 10 );
5643     test( AnonymousEnumValue );
5644             ]])],[sfinae_anonymous_broken=no],[sfinae_anonymous_broken=yes
5645         ])
5646         AC_MSG_RESULT([$sfinae_anonymous_broken])
5647         if test "$sfinae_anonymous_broken" = "yes"; then
5648             HAVE_SFINAE_ANONYMOUS_BROKEN="TRUE"
5649         fi
5650     AC_LANG_POP([C++])
5653 AC_SUBST(HAVE_SFINAE_ANONYMOUS_BROKEN)
5655 dnl ===================================================================
5656 dnl  Clang++ tests
5657 dnl ===================================================================
5659 HAVE_GCC_FNO_DEFAULT_INLINE=
5660 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
5661 if test "$GCC" = "yes"; then
5662     AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
5663     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5664         # Option just ignored and silly warning that isn't a real
5665         # warning printed
5666         :
5667     else
5668         AC_LANG_PUSH([C++])
5669         save_CXXFLAGS=$CXXFLAGS
5670         CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
5671         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
5672         CXXFLAGS=$save_CXXFLAGS
5673         AC_LANG_POP([C++])
5674     fi
5675     if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
5676         AC_MSG_RESULT([yes])
5677     else
5678         AC_MSG_RESULT([no])
5679     fi
5681     AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
5682     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5683         # As above
5684         :
5685     else
5686         AC_LANG_PUSH([C++])
5687         save_CXXFLAGS=$CXXFLAGS
5688         CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
5689         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
5690         CXXFLAGS=$save_CXXFLAGS
5691         AC_LANG_POP([C++])
5692     fi
5693     if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
5694         AC_MSG_RESULT([yes])
5695     else
5696         AC_MSG_RESULT([no])
5697     fi
5699 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
5700 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
5703 dnl ===================================================================
5704 dnl allocator
5705 dnl ===================================================================
5706 AC_MSG_CHECKING([which memory allocator to use])
5707 if test "$with_alloc" = "system"; then
5708     AC_MSG_RESULT([system])
5709     ALLOC="SYS_ALLOC"
5710     AC_CHECK_FUNCS([malloc realloc calloc free])
5712 if test "$with_alloc" = "tcmalloc"; then
5713     AC_MSG_RESULT(tcmalloc)
5714     if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
5715         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
5716     fi
5717     AC_CHECK_LIB([tcmalloc], [malloc], [:],
5718         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
5719     ALLOC="TCMALLOC"
5721 if test "$with_alloc" = "jemalloc"; then
5722     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
5723         AC_MSG_RESULT(jemalloc)
5724         save_CFLAGS=$CFLAGS
5725         CFLAGS="$CFLAGS -pthread"
5726         AC_CHECK_LIB([jemalloc], [malloc], [:],
5727             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
5728         ALLOC="JEMALLOC"
5729         CFLAGS=$save_CFLAGS
5730     else
5731         AC_MSG_RESULT([system])
5732         ALLOC="SYS_ALLOC"
5733         AC_CHECK_FUNCS([malloc realloc calloc free])
5734     fi
5736 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
5737     AC_MSG_RESULT([internal])
5739 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
5740 AC_SUBST(HAVE_POSIX_FALLOCATE)
5741 AC_SUBST(ALLOC)
5743 dnl ===================================================================
5744 dnl Custom build version
5745 dnl ===================================================================
5747 AC_MSG_CHECKING([whether to add custom build version])
5748 if test "$with_build_version" != ""; then
5749     BUILD_VER_STRING=$with_build_version
5750     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
5751 else
5752     BUILD_VER_STRING=
5753     AC_MSG_RESULT([no])
5755 AC_SUBST(BUILD_VER_STRING)
5757 dnl ===================================================================
5758 dnl Java support enable
5759 dnl ===================================================================
5760 AC_MSG_CHECKING([whether to build with Java support])
5761 if test "$with_java" != "no"; then
5762     if test "$DISABLE_SCRIPTING" = TRUE; then
5763         AC_MSG_RESULT([no, overridden by --disable-scripting])
5764         SOLAR_JAVA=""
5765         with_java=no
5766     else
5767         AC_MSG_RESULT([yes])
5768         SOLAR_JAVA="TRUE"
5769     fi
5770 else
5771     AC_MSG_RESULT([no])
5772     SOLAR_JAVA=""
5775 AC_SUBST(SOLAR_JAVA)
5777 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
5778 dnl want there to be *run-time* (and build-time) support for Java extensions in the
5779 dnl built LibreOffice.
5781 dnl SOLAR_JAVA="BUILD" is claimed to indicate build-time only support
5782 dnl (no runtime support). It doesn't seem to ever be set to this
5783 dnl value, though, and everywhere SOLAR_JAVA is only checked for being
5784 dnl empty or non-empty.
5786 dnl SOLAR_JAVA="" indicate no java support at all
5788 JITC_PROCESSOR_TYPE=""
5789 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
5790     # IBMs JDK needs this...
5791     JITC_PROCESSOR_TYPE=6
5792     export JITC_PROCESSOR_TYPE
5794 AC_SUBST([JITC_PROCESSOR_TYPE])
5796 if test $_os = "WINNT"; then
5797     AC_MSG_CHECKING([for Microsoft_VC${VCVER}_CRT_x86.msm])
5798     if ./oowintool --msvc-find-msms; then
5799         AC_MSG_RESULT([yes])
5800         SCPDEFS="$SCPDEFS -DWITH_VC"$VCVER"_REDIST"
5801     else
5802         AC_MSG_RESULT([no])
5803     fi
5806 dnl ===================================================================
5807 dnl Checks for Java
5808 dnl ===================================================================
5809 if test "$SOLAR_JAVA" != ""; then
5811     # Windows-specific tests
5812     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5813         if test "$BITNESS_OVERRIDE" = 64; then
5814             bitness="64-bit"
5815             otherbitness="32-bit"
5816         else
5817             bitness="32-bit"
5818             otherbitness="64-bit"
5819         fi
5821         if test -z "$with_jdk_home"; then
5823             # Unfortunately apparently no way to find, if needed, the 64-bit
5824             # JDK in the Registry from the 32-bit Perl oowintool
5826             _jdk_home=`./oowintool --jdk-home`
5827             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
5828                 with_jdk_home="$_jdk_home"
5829                 howfound="found by oowintool"
5830             else
5831                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
5832             fi
5833         else
5834             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
5835             howfound="you passed"
5836         fi
5837     fi
5839     JAVA_HOME=; export JAVA_HOME
5840     if test -z "$with_jdk_home"; then
5841         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
5842     else
5843         _java_path="$with_jdk_home/bin/$with_java"
5844         dnl Check if there is a Java interpreter at all.
5845         if test -x "$_java_path"; then
5846             JAVAINTERPRETER=$_java_path
5847         else
5848             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
5849         fi
5850     fi
5852     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5853         # Check that the JDK found is correct architecture
5854         # Why is this necessary, we don't link with any library from the JDK I think,
5856         shortjdkhome=`cygpath -d "$with_jdk_home"`
5857         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
5858             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
5859             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
5860         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
5861             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
5862             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
5863         fi
5865         if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
5866             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
5867         fi
5868         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
5869         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
5870     elif test "$_os" = "Darwin"; then
5871         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
5872         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
5873         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
5874         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
5875         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
5876             AC_MSG_RESULT([yes])
5877             JAVAIFLAGS=-d32
5878         else
5879             AC_MSG_RESULT([no])
5880         fi
5881     fi
5884 dnl ===================================================================
5885 dnl Checks for JDK.
5886 dnl ===================================================================
5888 # Note that JAVA_HOME as for now always means the *build* platform's
5889 # JAVA_HOME. Whether all the complexity here actually is needed any
5890 # more or not, no idea.
5892 if test "$SOLAR_JAVA" != ""; then
5893     _gij_longver=0
5894     AC_MSG_CHECKING([the installed JDK])
5895     if test -n "$JAVAINTERPRETER"; then
5896         dnl java -version sends output to stderr!
5897         if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
5898             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
5899         elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
5900             JDK=gcj
5901             AC_MSG_RESULT([checked (gcj)])
5902             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
5903             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
5905         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
5906             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
5907         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
5908             JDK=ibm
5910             dnl IBM JDK specific tests
5911             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
5912             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
5914             if test "$_jdk_ver" -lt 10500; then
5915                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
5916             fi
5918             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
5920             if test "$with_jdk_home" = ""; then
5921                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
5922 you must use the "--with-jdk-home" configure option explicitly])
5923             fi
5925            JAVA_HOME=$with_jdk_home
5927         else
5928             JDK=sun
5930             dnl Sun JDK specific tests
5931             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
5932             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
5934             if test "$_jdk_ver" -lt 10500; then
5935                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
5936             fi
5937             AC_MSG_RESULT([checked (JDK $_jdk)])
5938             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
5939             if test "$_os" = "WINNT"; then
5940                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
5941             fi
5942         fi
5943     else
5944         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
5945     fi
5946 else
5947     dnl Java disabled
5948     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
5951 dnl ===================================================================
5952 dnl Set target Java bytecode version
5953 dnl ===================================================================
5954 if test "$SOLAR_JAVA" != ""; then
5955     _java_target_ver="1.5"
5957     JAVA_SOURCE_VER="$_java_target_ver"
5958     JAVA_TARGET_VER="$_java_target_ver"
5961 dnl ===================================================================
5962 dnl Checks for javac
5963 dnl ===================================================================
5964 if test "$SOLAR_JAVA" != ""; then
5965     if test "$JDK" = "gcj"; then
5966         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
5967     else
5968         javacompiler="javac"
5969     fi
5970     if test -z "$with_jdk_home"; then
5971         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
5972     else
5973         _javac_path="$with_jdk_home/bin/$javacompiler"
5974         dnl Check if there is a Java compiler at all.
5975         if test -x "$_javac_path"; then
5976             JAVACOMPILER=$_javac_path
5977         fi
5978     fi
5979     if test -z "$JAVACOMPILER"; then
5980         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
5981     fi
5982     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5983         if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
5984             JAVACOMPILER="${JAVACOMPILER}.exe"
5985         fi
5986         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
5987         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
5988     fi
5990     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
5991         AC_MSG_CHECKING([re-checking JDK])
5992         JDK=gcj
5993         AC_MSG_RESULT([checked (ecj)])
5994         _gij_longver="40200"
5995     fi
5998 JAVACISGCJ=""
5999 dnl ===================================================================
6000 dnl Checks that javac is gcj
6001 dnl ===================================================================
6002 if test "$SOLAR_JAVA" != ""; then
6003     if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
6004         JAVACISGCJ="yes"
6005     fi
6007 AC_SUBST(JAVACISGCJ)
6009 JAVACISKAFFE=""
6010 dnl ===================================================================
6011 dnl Checks that javac is kaffe
6012 dnl ===================================================================
6013 if test "$SOLAR_JAVA" != ""; then
6014     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6015         JAVACISKAFFE="yes"
6016     fi
6018 AC_SUBST(JAVACISKAFFE)
6020 dnl ===================================================================
6021 dnl Checks for javadoc
6022 dnl ===================================================================
6023 if test "$SOLAR_JAVA" != ""; then
6024     if test -z "$with_jdk_home"; then
6025         AC_PATH_PROG(JAVADOC, javadoc)
6026     else
6027         _javadoc_path="$with_jdk_home/bin/javadoc"
6028         dnl Check if there is a javadoc at all.
6029         if test -x "$_javadoc_path"; then
6030             JAVADOC=$_javadoc_path
6031         else
6032             AC_PATH_PROG(JAVADOC, javadoc)
6033         fi
6034     fi
6035     if test -z "$JAVADOC"; then
6036         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
6037     fi
6038     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
6039         if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
6040             JAVADOC="${JAVADOC}.exe"
6041         fi
6042         JAVADOC=`cygpath -d "$JAVADOC"`
6043         JAVADOC=`cygpath -u "$JAVADOC"`
6044     fi
6046     if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
6047         JAVADOCISGJDOC="yes"
6048     fi
6050 AC_SUBST(JAVADOCISGJDOC)
6052 if test "$SOLAR_JAVA" != ""; then
6053     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
6054     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
6055         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
6056            # try to recover first by looking whether we have a alternatives
6057            # system as in Debian or newer SuSEs where following /usr/bin/javac
6058            # over /etc/alternatives/javac leads to the right bindir where we
6059            # just need to strip a bit away to get a valid JAVA_HOME
6060            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
6061         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
6062             # maybe only one level of symlink (e.g. on Mac)
6063             JAVA_HOME=$(readlink $JAVACOMPILER)
6064             if test "$(dirname $JAVA_HOME)" = "."; then
6065                 # we've got no path to trim back
6066                 JAVA_HOME=""
6067             fi
6068         else
6069             # else warn
6070             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
6071             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
6072             add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
6073             add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
6074         fi
6075         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
6076         if test "$JAVA_HOME" != "/usr"; then
6077             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6078                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
6079                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
6080                 dnl Tiger already returns a JDK path..
6081                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
6082             else
6083                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
6084             fi
6085         fi
6086     fi
6087     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
6089     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
6090     if test -z "$JAVA_HOME"; then
6091         if test "x$with_jdk_home" = "x"; then
6092             cat > findhome.java <<_ACEOF
6093 [import java.io.File;
6095 class findhome
6097     public static void main(String args[])
6098     {
6099         String jrelocation = System.getProperty("java.home");
6100         File jre = new File(jrelocation);
6101         System.out.println(jre.getParent());
6102     }
6104 _ACEOF
6105             AC_MSG_CHECKING([if javac works])
6106             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
6107             AC_TRY_EVAL(javac_cmd)
6108             if test $? = 0 -a -f ./findhome.class; then
6109                 AC_MSG_RESULT([javac works])
6110             else
6111                 echo "configure: javac test failed" >&5
6112                 cat findhome.java >&5
6113                 AC_MSG_ERROR([javac does not work - java projects will not build!])
6114             fi
6115             AC_MSG_CHECKING([if gij knows its java.home])
6116             JAVA_HOME=`$JAVAINTERPRETER findhome`
6117             if test $? = 0 -a "$JAVA_HOME" != ""; then
6118                 AC_MSG_RESULT([$JAVA_HOME])
6119             else
6120                 echo "configure: java test failed" >&5
6121                 cat findhome.java >&5
6122                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
6123             fi
6124             # clean-up after ourselves
6125             rm -f ./findhome.java ./findhome.class
6126         else
6127             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
6128         fi
6129     fi
6131     dnl second sanity check JAVA_HOME if possible
6132     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
6133         # now check if $JAVA_HOME is really valid
6134         if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6135             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
6136                 JAVA_HOME_OK="NO"
6137             fi
6138         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
6139             JAVA_HOME_OK="NO"
6140         fi
6141         if test "$JAVA_HOME_OK" = "NO"; then
6142             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
6143             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
6144             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
6145             add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
6146             add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
6147             add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
6148         fi
6149     fi
6150     PathFormat "$JAVA_HOME"
6151     JAVA_HOME="$formatted_path"
6154 AWTLIB=
6156 if test "$SOLAR_JAVA" != ""; then
6157     AC_MSG_CHECKING([for jawt lib name])
6158     if test "$JDK" = "gcj"; then
6159         save_CFLAGS=$CFLAGS
6160         save_LDFLAGS=$LDFLAGS
6161         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
6162         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
6163         exec 6>/dev/null # no output
6164         AC_CHECK_HEADER(jni.h, [],
6165                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
6166         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
6167         exec 6>&1 # output on again
6168         CFLAGS=$save_CFLAGS
6169         LDFLAGS=$save_LDFLAGS
6170     fi
6171     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
6172     # A workaround is to link also against libpmawt.so
6173     if test "$JDK" = "ibm"; then
6174         save_CFLAGS=$CFLAGS
6175         save_LDFLAGS=$LDFLAGS
6176         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
6177         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
6178         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
6179         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
6180         export LD_LIBRARY_PATH
6181         exec 6>/dev/null # no output
6182         AC_CHECK_HEADER(jni.h, [],
6183                     [AC_MSG_ERROR([jni.h could not be found.])], [])
6184         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
6185         if test -z "$AWTLIB"; then
6186             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
6187             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
6188         fi
6189         exec 6>&1 # output on again
6190         CFLAGS=$save_CFLAGS
6191         LDFLAGS=$save_LDFLAGS
6192         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
6193     fi
6194     if test -z "$AWTLIB"; then
6195         if test $_os = WINNT -a "$WITH_MINGW" != yes; then
6196             AWTLIB=jawt.lib
6197         else
6198             AWTLIB=-ljawt
6199         fi
6200     fi
6201     AC_MSG_RESULT([$AWTLIB])
6202     AC_SUBST(AWTLIB)
6206 if test "$SOLAR_JAVA" != ""; then
6208 # Determine JAVALIB
6209 # If your platform follow the common pattern
6210 # just define JAVA_ARCH and JAVA_TOOLKIT for it
6211 # if not, leave JAVA_ARCH empty and define JAVALIB manually
6212 # if you don't want JAVALIB to be exported at all
6213 # define x_JAVALIB=[\#]
6215     JAVA_ARCH=
6216     JAVA_TOOLKIT=
6217     x_JAVALIB=
6218     x_JDKLIB=[\#]
6220     case "$host_os" in
6222     aix*)
6223         JAVA_ARCH="ppc"
6224         JAVA_TOOLKIT="classic"
6225         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6226         SOLARINC="$SOLARINC -I$JAVA_HOME/include/aix"
6227         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6228         ;;
6230     cygwin*)
6231         x_JDKLIB=
6232         JDKLIB="$JAVA_HOME/lib"
6233         SOLARINC="$SOLARINC -I$JAVA_HOME/include/win32"
6234         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6235         ;;
6237     darwin*)
6238         x_JAVALIB=[\#]
6239         SOLARINC="$SOLARINC -I$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers -I$FRAMEWORKSHOME/JavaVM/Headers"
6240         ;;
6242     dragonfly*)
6243         case "$host_cpu" in
6244         i*86)
6245             JAVA_ARCH="i386"
6246             JAVA_TOOLKIT="client"
6247             ;;
6248         x86_64)
6249             JAVA_ARCH="amd64"
6250             JAVA_TOOLKIT="server"
6251             ;;
6252         esac
6253         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6254         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6255         ;;
6257     freebsd*)
6258         case "$host_cpu" in
6259         i*86)
6260             JAVA_ARCH="i386"
6261             JAVA_TOOLKIT="client"
6262             ;;
6263         x86_64)
6264             if test "`echo $JAVA_HOME | sed -e 's,.*/,,'`" = "linux"; then
6265                 JAVA_ARCH="i386"
6266                 JAVA_TOOLKIT="client"
6267             else
6268                 JAVA_ARCH="amd64"
6269                 JAVA_TOOLKIT="server"
6270             fi
6271             ;;
6272         esac
6273         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6274         SOLARINC="$SOLARINC -I$JAVA_HOME/include/freebsd"
6275         SOLARINC="$SOLARINC -I$JAVA_HOME/include/bsd"
6276         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
6277         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6278         ;;
6280     k*bsd*-gnu*)
6281         case "$host_cpu" in
6282         i*86)
6283             JAVA_ARCH="i386"
6284             JAVA_TOOLKIT="client"
6285             ;;
6286         x86_64)
6287             JAVA_ARCH="amd64"
6288             JAVA_TOOLKIT="server"
6289             ;;
6290         esac
6291         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6292         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6293         ;;
6295     linux-gnu*)
6297         case "$host_cpu" in
6299         alpha)
6300             JAVA_ARCH="alpha"
6301             JAVA_TOOLKIT="server"
6302             ;;
6303         arm*)
6304             JAVA_ARCH="arm"
6305             JAVA_TOOLKIT="server"
6306             ;;
6307         hppa)
6308             JAVA_ARCH="hppa"
6309             JAVA_TOOLKIT="server"
6310             ;;
6311         i*86)
6312             JAVA_ARCH="i386"
6313             case "$JDK" in
6314             [Ii][Bb][Mm]*)
6315                 JAVA_ARCH=
6316                 JRE_BASE_DIR="$JAVA_HOME/jre/bin"
6317                 JAVALIB="-L$JAVA_HOME/$LIB64 -L$JRE_BASE_DIR -L$JRE_BASE_DIR/classic -L$JRE_BASE_DIR/native_thread"
6318                 ;;
6319             [Bb][Ee][Aa]*)
6320                 JAVA_TOOLKIT="jrockit"
6321                 ;;
6322             *)
6323                 JAVA_TOOLKIT="client"
6324                 ;;
6325             esac
6326             ;;
6327         ia64)
6328             JAVA_ARCH="ia64"
6329             JAVA_TOOLKIT="server"
6330             ;;
6331         m68k)
6332             JAVA_ARCH="mk68"
6333             JAVA_TOOLKIT="server"
6334             ;;
6335         mips|mips64|mipsel|mips64el)
6336             JAVA_ARCH="$host_cpu"
6337             JAVA_TOOLKIT="server"
6338             ;;
6339         mips32)
6340             JAVA_ARCH="$host_cpu"
6341             JAVA_TOOLKIT="client"
6342             ;;
6343         powerpc)
6344             JAVA_ARCH="ppc"
6345             case "$JDK" in
6346             [Ii][Bb][Mm]*)
6347                 JAVA_TOOLKIT="classic"
6348                 ;;
6349             gcj)
6350                 JAVA_TOOLKIT="client"
6351                 ;;
6352             *)
6353                 JAVA_TOOLKIT="server"
6354                 ;;
6355             esac
6356             ;;
6357         powerpc64)
6358             JAVA_ARCH="ppc64"
6359             if test "$JDK" = "gcj"; then
6360                 JAVA_TOOLKIT="client"
6361             else
6362                 JAVA_TOOLKIT="server"
6363             fi
6364             ;;
6365         sparc)
6366             JAVA_ARCH="sparc"
6367             JAVA_TOOLKIT="server"
6368             ;;
6369         s390)
6370             JAVA_ARCH="s390"
6371             JAVA_TOOLKIT="server"
6372             ;;
6373         s390x)
6374             JAVA_ARCH="s390x"
6375             JAVA_TOOLKIT="server"
6376             ;;
6377         x86_64)
6378             JAVA_ARCH="amd64"
6379             JAVA_TOOLKIT="server"
6380             ;;
6381         *)
6382             AC_MSG_ERROR([No JAVALIB definition host_cpu $host_cpu for host_os $host_os])
6383             ;;
6384         esac
6385         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6386         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
6387         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6388         ;;
6390     linux-androideabi*)
6392         case "$host_cpu" in
6394     arm|armel)
6395             JAVA_ARCH="arm"
6396             JAVA_TOOLKIT="server"
6397             ;;
6398         esac
6399         ;;
6401     mingw*)
6402         x_JAVALIB=[\#]
6403         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6404         ;;
6406     *netbsd*)
6408         case "$host_cpu" in
6409         i*86)
6410             JAVA_ARCH="i386"
6411             JAVA_TOOLKIT="client"
6412             ;;
6413         powerpc)
6414             JAVA_ARCH="pcc"
6415             JAVA_TOOLKIT="classic"
6416             ;;
6417         sparc)
6418             JAVA_ARCH="sparc"
6419             JAVA_TOOLKIT="client"
6420             ;;
6421         x86_64)
6422             JAVA_ARCH="amd64"
6423             JAVA_TOOLKIT="client"
6424             ;;
6425         esac
6426         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6427         SOLARINC="$SOLARINC -I$JAVA_HOME/include/netbsd"
6428         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6429        ;;
6431     openbsd*)
6432         case "$host_cpu" in
6433         i*86)
6434             JAVA_ARCH="i386"
6435             JAVA_TOOLKIT="client"
6436             ;;
6437         x86_64)
6438             JAVA_ARCH="amd64"
6439             JAVA_TOOLKIT="server"
6440             ;;
6441         esac
6442         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6443         SOLARINC="$SOLARINC -I$JAVA_HOME/include/openbsd"
6444         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6445         ;;
6447     solaris*)
6449         JAVA_TOOLKIT="xawt"
6450         case "$host_cpu" in
6451         i*86)
6452             JAVA_ARCH="i386"
6453             ;;
6454         sparc)
6455             JAVA_ARCH="sparc"
6456             ;;
6457         esac
6458         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6459         SOLARINC="$SOLARINC -I$JAVA_HOME/include/solaris"
6460         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6461         ;;
6462     esac
6464     if test -n "$JAVA_ARCH"; then
6465         JRE_BASE_DIR="$JAVA_HOME/jre/lib/$JAVA_ARCH"
6466         JAVALIB="-L$JAVA_HOME/$LIB64"
6467         test -d "$JRE_BASE_DIR" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR"
6468         test -d "$JRE_BASE_DIR/$JAVA_TOOLKIT" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/$JAVA_TOOLKIT"
6469         test -d "$JRE_BASE_DIR/native_thread" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/native_thread"
6470     fi
6471 else
6472     x_JAVALIB=[\#]
6473     x_JDKLIB=[\#]
6476 AC_SUBST(JAVALIB)
6477 AC_SUBST(JAVACOMPILER)
6478 AC_SUBST(JAVADOC)
6479 AC_SUBST(JAVAINTERPRETER)
6480 AC_SUBST(JAVAIFLAGS)
6481 AC_SUBST(JAVA_HOME)
6482 AC_SUBST(JAVA_SOURCE_VER)
6483 AC_SUBST(JAVA_TARGET_VER)
6484 AC_SUBST(JDK)
6485 AC_SUBST(JDKLIB)
6486 AC_SUBST(x_JAVALIB)
6487 AC_SUBST(x_JDKLIB)
6489 dnl ===================================================================
6490 dnl Checks for specific files.
6491 dnl ===================================================================
6493 dnl ===================================================================
6494 dnl Checks for programs.
6495 dnl ===================================================================
6497 dnl ===================================================================
6498 dnl Check whether we already have dmake
6499 dnl ===================================================================
6500 AC_PATH_PROG(DMAKE, dmake, no)
6501 if test "$DMAKE" = "no"; then
6502     BUILD_DMAKE=YES
6503     echo "dmake will be built on ./bootstrap"
6504 else
6505     AC_MSG_CHECKING([whether the found dmake is the right dmake])
6506     # we need to find out whether that dmake we found is "our" dmake
6507     # or the dmake from Sun's SunStudio Compiler which is something
6508     # different
6509     # This test _should_ work because the one accepts -V (ours) and one
6510     # (the other) not...
6511     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
6512     if test $? -eq 0; then
6513         BUILD_DMAKE=NO
6514         AC_MSG_RESULT([yes])
6515         AC_MSG_CHECKING([the dmake version])
6516         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
6517         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
6518             AC_MSG_RESULT([OK, >= 4.11])
6519         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
6520             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
6521             AC_MSG_RESULT([OK, >= 4.11])
6522         else
6523             AC_MSG_RESULT([too old. >= 4.11 is needed])
6524             echo "A newer dmake will be built on ./bootstrap"
6525             BUILD_DMAKE=YES
6526         fi
6527     else
6528         AC_MSG_RESULT([no])
6529         echo "dmake will be built on ./bootstrap"
6530         BUILD_DMAKE=YES
6531     fi
6533 AC_SUBST(BUILD_DMAKE)
6535 AC_MSG_CHECKING([which C preprocessor to use in idlc])
6536 if test -n "$with_idlc_cpp"; then
6537     AC_MSG_RESULT([$with_idlc_cpp])
6538     AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
6539 else
6540     AC_MSG_RESULT([ucpp])
6541     AC_MSG_CHECKING([which ucpp tp use])
6542     if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
6543         AC_MSG_RESULT([external])
6544         AC_PATH_PROG(SYSTEM_UCPP, ucpp)
6545     else
6546         AC_MSG_RESULT([internal])
6547         BUILD_TYPE="$BUILD_TYPE UCPP"
6548     fi
6550 AC_SUBST(SYSTEM_UCPP)
6552 dnl ===================================================================
6553 dnl Check for epm (not needed for Windows)
6554 dnl ===================================================================
6555 AC_MSG_CHECKING([whether to enable EPM for packing])
6556 if test "$enable_epm" = "yes"; then
6557     AC_MSG_RESULT([yes])
6558     if test "$_os" != "WINNT"; then
6559         if test -n "$with_epm"; then
6560             EPM=$with_epm
6561         else
6562             AC_PATH_PROG(EPM, epm, no)
6563         fi
6564         if test "$EPM" = "no" -o "$EPM" = "internal"; then
6565             echo "EPM will be built."
6566             BUILD_TYPE="$BUILD_TYPE EPM"
6567         else
6568             # Gentoo has some epm which is something different...
6569             AC_MSG_CHECKING([whether the found epm is the right epm])
6570             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
6571                 AC_MSG_RESULT([yes])
6572             else
6573                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
6574             fi
6575             AC_MSG_CHECKING([epm version])
6576             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
6577             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
6578                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
6579                 AC_MSG_RESULT([OK, >= 3.7])
6580                 if test "$_os" = "Darwin"; then
6581                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
6582                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
6583                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6584                         AC_MSG_ERROR([$_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)])
6585                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6586                         AC_MSG_RESULT([$_pm, ok])
6587                     else # we never should get here, but go safe
6588                         AC_MSG_ERROR([$_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)])
6589                     fi
6590                 fi
6591             else
6592                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
6593                 echo "EPM will be built."
6594                 BUILD_TYPE="$BUILD_TYPE EPM"
6595             fi
6596         fi
6597     fi
6599     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
6600         AC_MSG_CHECKING([for rpm])
6601         for a in "$RPM" rpmbuild rpm; do
6602             $a --usage >/dev/null 2> /dev/null
6603             if test $? -eq 0; then
6604                 RPM=$a
6605                 break
6606             else
6607                 $a --version >/dev/null 2> /dev/null
6608                 if test $? -eq 0; then
6609                     RPM=$a
6610                     break
6611                 fi
6612             fi
6613         done
6614         if test -z "$RPM"; then
6615             AC_MSG_ERROR([not found])
6616         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
6617             RPM_PATH=`which $RPM`
6618             AC_MSG_RESULT([$RPM_PATH])
6619         else
6620             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
6621         fi
6622     fi
6623     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
6624         AC_PATH_PROG(DPKG, dpkg, no)
6625         if test "$DPKG" = "no"; then
6626             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
6627         fi
6628     fi
6629     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
6630         if test "$_os" = "Darwin"; then
6631             AC_MSG_CHECKING([for PackageMaker availability])
6632             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
6633                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
6634             else
6635                 AC_MSG_RESULT([ok])
6636             fi
6637         else
6638             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
6639         fi
6640     fi
6641     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
6642        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6643         if test "$EPM" != "no" -a "$EPM" != "internal"; then
6644             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
6645                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
6646                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
6647                     AC_MSG_RESULT([yes])
6648                 else
6649                     AC_MSG_RESULT([no])
6650                     if echo "$PKGFORMAT" | $GREP -q rpm; then
6651                         _pt="rpm"
6652                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
6653                         add_warning "the rpms will need to be installed with --nodeps"
6654                     else
6655                         _pt="pkg"
6656                     fi
6657                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
6658                     add_warning "the ${_pt}s will not be relocateable"
6659                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
6660                                  relocation will work, you need to patch your epm with the
6661                                  patch in epm/epm-3.7.patch or build with
6662                                  --with-epm=internal which will build a suitable epm])
6663                 fi
6664             fi
6665         fi
6666     fi
6667     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6668         AC_PATH_PROG(PKGMK, pkgmk, no)
6669         if test "$PKGMK" = "no"; then
6670             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
6671         fi
6672     fi
6673     AC_SUBST(RPM)
6674     AC_SUBST(DPKG)
6675     AC_SUBST(PKGMK)
6676 else
6677     AC_MSG_RESULT([no])
6678     EPM=NO
6680 AC_SUBST(EPM)
6682 dnl ===================================================================
6683 dnl We need winegcc when building MinGW build to be able to cross-build msi tools
6684 dnl ===================================================================
6685 WINEGCC=
6686 if test "$enable_winegcc" = "yes"; then
6687     AC_PATH_PROG(WINEGCC, winegcc)
6688     if test "$WINEGCC" = ""; then
6689         AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
6690     fi
6691     CC_save="$CC"
6692     ac_exeext_save="$ac_exeext"
6693     CC="$WINEGCC -m32"
6694     ac_exeext=".exe"
6695     AC_LINK_IFELSE([AC_LANG_PROGRAM([
6696 #include <stdio.h>
6697         ],[
6698 printf ("hello world\n");
6699         ])],,
6700         [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
6701     )
6702     CC="$CC_save"
6703     ac_exeext="$ac_exeext_save"
6705 AC_SUBST(WINEGCC)
6707 dnl ===================================================================
6708 dnl Check for gperf
6709 dnl ===================================================================
6710 AC_PATH_PROG(GPERF, gperf)
6711 if test -z "$GPERF"; then
6712     AC_MSG_ERROR([gperf not found but needed. Install it.])
6714 AC_MSG_CHECKING([gperf version])
6715 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
6716     AC_MSG_RESULT([OK])
6717 else
6718     AC_MSG_ERROR([too old, you need at least 3.0.0])
6720 AC_SUBST(GPERF)
6722 dnl ===================================================================
6723 dnl Check for building ODK
6724 dnl ===================================================================
6725 AC_MSG_CHECKING([whether to build the ODK])
6726 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
6727     AC_MSG_RESULT([yes])
6729     if test "$with_java" != "no"; then
6730         AC_MSG_CHECKING([whether to build unowinreg.dll])
6731         if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
6732             # build on Win by default
6733             enable_build_unowinreg=yes
6734         fi
6735         if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
6736             AC_MSG_RESULT([no])
6737             BUILD_UNOWINREG=NO
6738         else
6739             AC_MSG_RESULT([yes])
6740             BUILD_UNOWINREG=YES
6741         fi
6742         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
6743             if test -z "$with_mingw_cross_compiler"; then
6744                 dnl Guess...
6745                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
6746             elif test -x "$with_mingw_cross_compiler"; then
6747                  MINGWCXX="$with_mingw_cross_compiler"
6748             else
6749                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
6750             fi
6752             if test "$MINGWCXX" = "false"; then
6753                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
6754             fi
6756             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
6757             if test -x "$mingwstrip_test"; then
6758                 MINGWSTRIP="$mingwstrip_test"
6759             else
6760                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
6761             fi
6763             if test "$MINGWSTRIP" = "false"; then
6764                 AC_MSG_ERROR(MinGW32 binutils not found.)
6765             fi
6766         fi
6767     fi
6768     BUILD_TYPE="$BUILD_TYPE ODK"
6769 else
6770     AC_MSG_RESULT([no])
6771     BUILD_UNOWINREG=NO
6773 AC_SUBST(BUILD_UNOWINREG)
6774 AC_SUBST(MINGWCXX)
6775 AC_SUBST(MINGWSTRIP)
6777 dnl ===================================================================
6778 dnl Check for system zlib
6779 dnl ===================================================================
6780 if test "$with_system_zlib" = "auto"; then
6781     case "$_os" in
6782     WINNT)
6783         with_system_zlib="$with_system_libs"
6784         ;;
6785     *)
6786         with_system_zlib=yes
6787         ;;
6788     esac
6791 AC_MSG_CHECKING([which zlib to use])
6792 if test "$with_system_zlib" = "yes"; then
6793     AC_MSG_RESULT([external])
6794     SYSTEM_ZLIB=YES
6795     AC_CHECK_HEADER(zlib.h, [],
6796         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
6797     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
6798         [AC_MSG_ERROR(zlib not found or functional)], [])
6799 else
6800     AC_MSG_RESULT([internal])
6801     SYSTEM_ZLIB=NO
6802     BUILD_TYPE="$BUILD_TYPE ZLIB"
6803     ZLIB_CFLAGS="-I${OUTDIR}/inc/external/zlib"
6804     ZLIB_LIBS="-L${OUTDIR}/lib -lz"
6806 AC_SUBST(ZLIB_CFLAGS)
6807 AC_SUBST(ZLIB_LIBS)
6808 AC_SUBST(SYSTEM_ZLIB)
6810 dnl ===================================================================
6811 dnl Check for system jpeg
6812 dnl ===================================================================
6813 AC_MSG_CHECKING([which jpeg to use])
6814 if test "$with_system_jpeg" = "auto"; then
6815     case "$_os" in
6816     WINNT|Darwin|iOS|Android)
6817         with_system_jpeg="$with_system_libs"
6818         ;;
6819     *)
6820         with_system_jpeg=yes
6821         ;;
6822     esac
6825 if test "$with_system_jpeg" = "yes"; then
6826     AC_MSG_RESULT([external])
6827     SYSTEM_JPEG=YES
6828     AC_CHECK_HEADER(jpeglib.h, [],
6829         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
6830     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
6831     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
6832     libo_MINGW_CHECK_DLL([JPEG], [libjpeg])
6833 else
6834     AC_MSG_RESULT([internal])
6835     SYSTEM_JPEG=NO
6836     BUILD_TYPE="$BUILD_TYPE JPEG"
6838 AC_SUBST(SYSTEM_JPEG)
6839 AC_SUBST([MINGW_JPEG_DLL])
6841 dnl ===================================================================
6842 dnl Check for system clucene
6843 dnl ===================================================================
6844 AC_MSG_CHECKING([which clucene to use])
6845 if test "$with_system_clucene" = "yes"; then
6846     AC_MSG_RESULT([external])
6847     SYSTEM_CLUCENE=YES
6848     PKG_CHECK_MODULES(CLUCENE, libclucene-core)
6850     AC_LANG_PUSH([C++])
6851     save_CXXFLAGS=$CXXFLAGS
6852     save_CPPFLAGS=$CPPFLAGS
6853     CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
6854     CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
6855     dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
6856     dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
6857     AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
6858                  [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
6859     CXXFLAGS=$save_CXXFLAGS
6860     CPPFLAGS=$save_CPPFLAGS
6861     AC_LANG_POP([C++])
6863     CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
6864 else
6865     AC_MSG_RESULT([internal])
6866     SYSTEM_CLUCENE=NO
6867     BUILD_TYPE="$BUILD_TYPE CLUCENE"
6869 AC_SUBST(SYSTEM_CLUCENE)
6870 AC_SUBST(CLUCENE_CFLAGS)
6871 AC_SUBST(CLUCENE_LIBS)
6873 dnl ===================================================================
6874 dnl Check for system expat
6875 dnl ===================================================================
6876 AC_MSG_CHECKING([which expat to use])
6877 if test "$with_system_expat" = "yes"; then
6878     AC_MSG_RESULT([external])
6879     SYSTEM_EXPAT=YES
6880     AC_CHECK_HEADER(expat.h, [],
6881         [AC_MSG_ERROR(expat.h not found. install expat)], [])
6882     AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
6883     [AC_MSG_RESULT(expat library not found or functional.)], [])
6884     libo_MINGW_CHECK_DLL([EXPAT], [libexpat])
6885 else
6886     AC_MSG_RESULT([internal])
6887     SYSTEM_EXPAT=NO
6888     BUILD_TYPE="$BUILD_TYPE EXPAT"
6890 AC_SUBST(SYSTEM_EXPAT)
6891 AC_SUBST([MINGW_EXPAT_DLL])
6893 dnl ===================================================================
6894 dnl Check for system libcdr
6895 dnl ===================================================================
6896 AC_MSG_CHECKING([which libcdr to use])
6897 if test "$with_system_libcdr" = "yes"; then
6898     AC_MSG_RESULT([external])
6899     SYSTEM_LIBCDR=YES
6900     PKG_CHECK_MODULES( CDR, libcdr-0.0 >= 0.0.5 )
6901 elif test $_os = iOS; then
6902     # libcdr depends on libwpd and libwpg and those are LGPL
6903     AC_MSG_RESULT([none])
6904 else
6905     AC_MSG_RESULT([internal])
6906     SYSTEM_LIBCDR=NO
6907     BUILD_TYPE="$BUILD_TYPE CDR"
6909 AC_SUBST(SYSTEM_LIBCDR)
6910 AC_SUBST(CDR_CFLAGS)
6911 AC_SUBST(CDR_LIBS)
6913 dnl ===================================================================
6914 dnl Check for system libmspub
6915 dnl ===================================================================
6916 AC_MSG_CHECKING([which libmspub to use])
6917 if test "$with_system_libmspub" = "yes"; then
6918     AC_MSG_RESULT([external])
6919     SYSTEM_LIBMSPUB=YES
6920     PKG_CHECK_MODULES( MSPUB, libmspub-0.0 )
6921 elif test $_os = iOS; then
6922     # libmspub depends on libwpd and libwpg and those are LGPL
6923     AC_MSG_RESULT([none])
6924 else
6925     AC_MSG_RESULT([internal])
6926     SYSTEM_LIBMSPUB=NO
6927     BUILD_TYPE="$BUILD_TYPE MSPUB"
6929 AC_SUBST(SYSTEM_LIBMSPUB)
6930 AC_SUBST(MSPUB_CFLAGS)
6931 AC_SUBST(MSPUB_LIBS)
6933 dnl ===================================================================
6934 dnl Check for system libvisio
6935 dnl ===================================================================
6936 AC_MSG_CHECKING([which libvisio to use])
6937 if test "$with_system_libvisio" = "yes"; then
6938     AC_MSG_RESULT([external])
6939     SYSTEM_LIBVISIO=YES
6940     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
6941 elif test $_os = iOS; then
6942     # libvisio depends on libwpd and libwpg and those are LGPL
6943     AC_MSG_RESULT([none])
6944 else
6945     AC_MSG_RESULT([internal])
6946     SYSTEM_LIBVISIO=NO
6947     BUILD_TYPE="$BUILD_TYPE VISIO"
6949 AC_SUBST(SYSTEM_LIBVISIO)
6950 AC_SUBST(VISIO_CFLAGS)
6951 AC_SUBST(VISIO_LIBS)
6953 dnl ===================================================================
6954 dnl Check for system libcmis
6955 dnl ===================================================================
6956 AC_MSG_CHECKING([which libcmis to use])
6957 if test "$with_system_libcmis" = "yes"; then
6958     AC_MSG_RESULT([external])
6959     SYSTEM_LIBCMIS=YES
6960     PKG_CHECK_MODULES( CMIS, libcmis-0.3 >= 0.3.0 )
6961 else
6962     AC_MSG_RESULT([internal])
6963     SYSTEM_LIBCMIS=NO
6964     BUILD_TYPE="$BUILD_TYPE CMIS"
6966 AC_SUBST(SYSTEM_LIBCMIS)
6967 AC_SUBST(CMIS_CFLAGS)
6968 AC_SUBST(CMIS_LIBS)
6971 dnl ===================================================================
6972 dnl Check for system libwpd
6973 dnl ===================================================================
6974 AC_MSG_CHECKING([which libwpd to use])
6975 if test "$with_system_libwpd" = "yes"; then
6976     AC_MSG_RESULT([external])
6977     SYSTEM_LIBWPD=YES
6978     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
6979 elif test $_os = iOS; then
6980     AC_MSG_RESULT([none])
6981 else
6982     AC_MSG_RESULT([internal])
6983     SYSTEM_LIBWPD=NO
6984     WPD_CFLAGS="-I${OUTDIR}/inc/external"
6985     WPD_LIBS="-L${OUTDIR}/lib -lwpdlib"
6986     BUILD_TYPE="$BUILD_TYPE WPD"
6988 AC_SUBST(SYSTEM_LIBWPD)
6989 AC_SUBST(WPD_CFLAGS)
6990 AC_SUBST(WPD_LIBS)
6992 dnl ===================================================================
6993 dnl Check for system lcms2
6994 dnl ===================================================================
6995 AC_MSG_CHECKING([which littlecms v2 to use])
6996 if test "$with_system_lcms2" = "yes"; then
6997     AC_MSG_RESULT([external])
6998     SYSTEM_LCMS2=YES
6999     PKG_CHECK_MODULES( LCMS2, lcms2 )
7000     libo_MINGW_CHECK_DLL([LCMS2], [liblcms2])
7001 else
7002     AC_MSG_RESULT([internal])
7003     SYSTEM_LCMS2=NO
7004     LCMS2_LIBS="-L${OUTDIR}/lib -llcms2"
7005     LCMS2_CFLAGS="-I${WORKDIR}/UnpackedTarball/lcms2/include"
7006     if test "$GCC" = "yes"; then
7007         LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7008     fi
7009     BUILD_TYPE="$BUILD_TYPE LCMS2"
7011 AC_SUBST(SYSTEM_LCMS2)
7012 AC_SUBST(LCMS2_CFLAGS)
7013 AC_SUBST(LCMS2_LIBS)
7014 AC_SUBST([MINGW_LCMS2_DLL])
7016 dnl ===================================================================
7017 dnl Check for system cppunit
7018 dnl ===================================================================
7019 AC_MSG_CHECKING([which cppunit to use])
7020 if test "$with_system_cppunit" = "yes"; then
7021     AC_MSG_RESULT([external])
7022     SYSTEM_CPPUNIT=YES
7023     # might work for earlier, too but go sure:
7024     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
7025 else
7026     AC_MSG_RESULT([internal])
7027     SYSTEM_CPPUNIT=NO
7028     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
7030 AC_SUBST(SYSTEM_CPPUNIT)
7031 AC_SUBST(CPPUNIT_CFLAGS)
7032 AC_SUBST(CPPUNIT_LIBS)
7034 dnl ===================================================================
7035 dnl Check whether freetype is available
7036 dnl ===================================================================
7037 if test  "$test_freetype" = "yes"; then
7038     AC_MSG_CHECKING([whether freetype is available])
7039     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
7040 else
7041     case "$BUILD_TYPE" in
7042     *FREETYPE*)
7043         FREETYPE_LIBS="-lfreetype"
7044         ;;
7045     esac
7047 AC_SUBST(FREETYPE_CFLAGS)
7048 AC_SUBST(FREETYPE_LIBS)
7050 dnl ===================================================================
7051 dnl Check for system libwps
7052 dnl ===================================================================
7053 AC_MSG_CHECKING([which libwps to use])
7054 if test "$with_system_libwps" = "yes"; then
7055     AC_MSG_RESULT([external])
7056     SYSTEM_LIBWPS=YES
7057     PKG_CHECK_MODULES( WPS, libwps-0.2 )
7058 elif test $_os = iOS; then
7059     AC_MSG_RESULT([none])
7060 else
7061     AC_MSG_RESULT([internal])
7062     SYSTEM_LIBWPS=NO
7063     WPS_CFLAGS="-I${OUTDIR}/inc/external"
7064     WPS_LIBS="-L${OUTDIR}/lib -lwpslib"
7065     BUILD_TYPE="$BUILD_TYPE WPS"
7067 AC_SUBST(SYSTEM_LIBWPS)
7068 AC_SUBST(WPS_CFLAGS)
7069 AC_SUBST(WPS_LIBS)
7071 dnl ===================================================================
7072 dnl Check for system libwpg
7073 dnl ===================================================================
7074 AC_MSG_CHECKING([which libwpg to use])
7075 if test "$with_system_libwpg" = "yes"; then
7076     AC_MSG_RESULT([external])
7077     SYSTEM_LIBWPG=YES
7078     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
7079 elif test $_os = iOS; then
7080     AC_MSG_RESULT([none])
7081 else
7082     AC_MSG_RESULT([internal])
7083     SYSTEM_LIBWPG=NO
7084     WPG_CFLAGS="-I${OUTDIR}/inc/external"
7085     WPG_LIBS="-L${OUTDIR}/lib -lwpglib"
7086     BUILD_TYPE="$BUILD_TYPE WPG"
7088 AC_SUBST(SYSTEM_LIBWPG)
7089 AC_SUBST(WPG_CFLAGS)
7090 AC_SUBST(WPG_LIBS)
7092 dnl ===================================================================
7093 dnl Check whether freetype2 supports emboldening
7094 dnl ===================================================================
7095 if test  "$test_freetype" = "yes"; then
7096     save_CPPFLAGS="$CPPFLAGS"
7097     save_LDFLAGS="$LDFLAGS"
7098     save_LIBS="$LIBS"
7099     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
7100     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
7101     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
7102                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
7103     LDFLAGS="$save_LDFLAGS"
7104     CPPFLAGS="$save_CPPFLAGS"
7105     LIBS="$save_LIBS"
7107 AC_SUBST(USE_FT_EMBOLDEN)
7109 # ===================================================================
7110 # Check for system libxslt
7111 # to prevent incompatibilities between internal libxml2 and external libxslt,
7112 # or vice versa, use with_system_libxml here
7113 # ===================================================================
7114 if test "$with_system_libxml" = "auto"; then
7115     case "$_os" in
7116     WINNT|iOS|Android)
7117         with_system_libxml="$with_system_libs"
7118         ;;
7119     *)
7120         with_system_libxml=yes
7121         ;;
7122     esac
7125 AC_MSG_CHECKING([which libxslt to use])
7126 if test "$with_system_libxml" = "yes"; then
7127     AC_MSG_RESULT([external])
7128     SYSTEM_LIBXSLT=YES
7129     if test "$_os" = "Darwin"; then
7130         dnl make sure to use SDK path
7131         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7132         LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
7133         dnl omit -L/usr/lib
7134         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
7135         LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
7136     else
7137         PKG_CHECK_MODULES(LIBXSLT, libxslt)
7138         PKG_CHECK_MODULES(LIBEXSLT, libexslt)
7139     fi
7141     dnl Check for xsltproc
7142     AC_PATH_PROG(XSLTPROC, xsltproc, no)
7143     if test "$XSLTPROC" = "no"; then
7144         AC_MSG_ERROR([xsltproc is required])
7145     fi
7147     libo_MINGW_CHECK_DLL([LIBXSLT], [libxslt])
7148     libo_MINGW_CHECK_DLL([LIBEXSLT], [libexslt])
7149     libo_MINGW_TRY_DLL([ICONV], [iconv])
7150 else
7151     AC_MSG_RESULT([internal])
7152     SYSTEM_LIBXSLT=NO
7153     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
7155     if test "$cross_compiling" = "yes"; then
7156         AC_PATH_PROG(XSLTPROC, xsltproc, no)
7157         if test "$XSLTPROC" = "no"; then
7158             AC_MSG_ERROR([xsltproc is required])
7159         fi
7160     fi
7162 AC_SUBST(SYSTEM_LIBXSLT)
7163 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
7164     SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
7166 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
7168 AC_SUBST(LIBEXSLT_CFLAGS)
7169 AC_SUBST(LIBEXSLT_LIBS)
7170 AC_SUBST(LIBXSLT_CFLAGS)
7171 AC_SUBST(LIBXSLT_LIBS)
7172 AC_SUBST(XSLTPROC)
7173 AC_SUBST([MINGW_LIBEXSLT_DLL])
7174 AC_SUBST([MINGW_LIBXSLT_DLL])
7175 AC_SUBST([MINGW_ICONV_DLL])
7177 # ===================================================================
7178 # Check for system libxml
7179 # ===================================================================
7180 AC_MSG_CHECKING([which libxml to use])
7181 if test "$with_system_libxml" = "yes"; then
7182     AC_MSG_RESULT([external])
7183     SYSTEM_LIBXML=YES
7184     if test "$_os" = "Darwin"; then
7185         dnl make sure to use SDK path
7186         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7187         dnl omit -L/usr/lib
7188         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
7189     elif test $_os = iOS; then
7190         dnl make sure to use SDK path
7191         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
7192         LIBXML_CFLAGS="-I$usr/include/libxml2"
7193         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
7194     else
7195         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
7196     fi
7198     dnl Check for xmllint
7199     AC_PATH_PROG(XMLLINT, xmllint, no)
7200     if test "$XMLLINT" = "no"; then
7201         AC_MSG_ERROR([xmllint is required])
7202     fi
7204     libo_MINGW_CHECK_DLL([LIBXML],[libxml2])
7205     libo_MINGW_TRY_DLL([ZLIB],[zlib1])
7206 else
7207     AC_MSG_RESULT([internal])
7208     SYSTEM_LIBXML=NO
7209     BUILD_TYPE="$BUILD_TYPE LIBXML2"
7211 AC_SUBST(SYSTEM_LIBXML)
7212 AC_SUBST(LIBXML_CFLAGS)
7213 AC_SUBST(LIBXML_LIBS)
7214 AC_SUBST(XMLLINT)
7215 AC_SUBST([MINGW_LIBXML_DLL])
7216 AC_SUBST([MINGW_ZLIB_DLL])
7217 dnl ===================================================================
7218 dnl Checks for Python
7219 dnl ===================================================================
7221 AC_MSG_CHECKING([which Python to use])
7223 case "$enable_python" in
7224 no|disable)
7225     enable_python=no
7226     AC_MSG_RESULT([none])
7227     DISABLE_PYTHON=TRUE
7228     ;;
7229 ""|yes|auto)
7230     if test "$DISABLE_SCRIPTING" = TRUE; then
7231         AC_MSG_RESULT([no, overridden by --disable-scripting])
7232         enable_python=no
7233         DISABLE_PYTHON=TRUE
7234     elif test $build_os = cygwin; then
7235         dnl When building on Windows we don't attempt to use any installed
7236         dnl "system"  Python.
7237         dnl
7238         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
7239         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
7240         dnl MinGW cross-compilation setups.)
7241         AC_MSG_RESULT([internal])
7242         enable_python=internal
7243     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \) \
7244                             -a \( "$with_macosx_sdk" = 10.4 -o "$with_macosx_sdk" = 10.5 \); then
7245         # When building against a more recent SDK the ionternal Python can't be compiled, I can't be bothered to fix that for now,
7246         # building against a recent SDK is only for developer's own builds anyway.
7247         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
7248         enable_python=internal
7249     else
7250         AC_MSG_RESULT([checking below])
7251         enable_python=auto
7252     fi
7253     ;;
7254 internal)
7255     AC_MSG_RESULT([internal])
7256     ;;
7257 system)
7258     if test $_os = Darwin -a -z "$PYTHON" -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
7259         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
7260     fi
7261     AC_MSG_RESULT([system])
7262     ;;
7264     AC_MSG_ERROR([Incorrect --enable-python option])
7265     ;;
7266 esac
7268 AC_SUBST(DISABLE_PYTHON)
7270 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
7271     AC_MSG_ERROR([Must use internal Python when building with MSVC])
7274 if test $enable_python != no; then
7275     BUILD_TYPE="$BUILD_TYPE PYUNO"
7278 if test "$cross_compiling" = yes; then
7279     if test $enable_python = auto; then
7280         enable_python=system
7281     fi
7282 else
7283     if test $enable_python = system -a -z "$PYTHON"; then
7284         if test $_os = Darwin; then
7285             # We already have logic above to make sure the system Python
7286             # is used only when building against SDK 10.6 or newer.
7288             # Make sure we use the 2.6 Python when building against the
7289             # 10.6 SDK.
7290             case $with_macosx_sdk in
7291             10.6)
7292                 python_version=2.6;;
7293             10.7|10.8)
7294                 python_version=2.7;;
7295             *)
7296                 # ???
7297                 python_version=2.7;;
7298             esac
7299             PYTHON=python$python_version
7300             PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
7301             PYTHON_LIBS="-framework Python"
7302         else
7303             # This causes an error if no python command is found
7304             AM_PATH_PYTHON([3.3])
7305         fi
7306     elif test $enable_python = auto; then
7307         # We should not come here in a MSVC build, I think?
7308         if test $build_os = cygwin; then
7309             AC_MSG_ERROR([Assertion failed - should not be here in a MSVC build])
7310         fi
7312         # This allows a lack of system Python 3.3 with no error, we check below for a system Python of
7313         # earlier version.
7314         AM_PATH_PYTHON([3.3],, [:])
7316         if test "$PYTHON" = :; then
7317             enable_python=internal
7319             if test $_os = Darwin; then
7320                 # See the fixme in gbuild.mk
7322                 # There must be a system Python, 2.6 should be fine (?), to run build-time Python scripts
7323                 # like filter/source/svg/js2hxx.py. (Is that the only build-time Python script?) If we
7324                 # don't do this, PYTHON will stay with the value ":" which of course makes runing
7325                 # build-time Python scripts rather ineffective.
7327                 # Unset variables set by the above AM_PATH_PYTHON so that we acutally do check anew
7328                 # Finding an (old) system Python should not confuse our already decided intent to build an
7329                 # internal Python 3.3, that is directed by enable_python = internal.
7330                 unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON
7331                 AM_PATH_PYTHON([2.6])
7332             else
7333                 # For Linux it works to use the internally built Python, see gbuild.mk
7334                 :
7335             fi
7336         else
7337             enable_python=system
7338         fi
7339     fi
7342 if test $enable_python = system; then
7343     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
7344         # Fallback: Accept these in the environment, or as set above
7345         # for MacOSX.
7346         :
7347     elif test "$cross_compiling" != yes; then
7348         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
7349         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
7350         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
7351         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
7352         if test -z "$PKG_CONFIG"; then
7353             PYTHON_CFLAGS="-I$python_include"
7354             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
7355         elif $PKG_CONFIG --exists python-$python_version; then
7356             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
7357             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
7358         else
7359             PYTHON_CFLAGS="-I$python_include"
7360             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
7361         fi
7362     else
7363         dnl How to find out the cross-compilation Python installation path?
7364         dnl Let's hardocode what we know for different distributions for now...
7365         for python_version in 2.6; do
7366             if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
7367                 PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
7368                 PYTHON_LIBS="-L${MINGW_SYSROOT}lib -lpython$python_version $python_libs"
7369                 MINGW_PYTHON_EXE=python.exe
7370                 libo_MINGW_CHECK_DLL([PYTHON], [libpython$python_version])
7371                 libo_MINGW_CHECK_DLL([READLINE], [libreadline6])
7372                 libo_MINGW_CHECK_DLL([TERMCAP], [libtermcap])
7373                 # could we somehow extract the really mingw python version from
7374                 # actual distro package?
7375                 # 2.6.2 currently on OpenSUSE 12.1?
7376                 # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
7377                 PYTHON_VERSION=$python_version.2
7378                 PYTHON_VERSION_MAJOR=${python_version%.*}
7379                 PYTHON_VERSION_MINOR=${python_version#*.}
7380                 break
7381             fi
7382         done
7383         test -n "$PYTHON_CFLAGS" && break
7384     fi
7387 dnl By now enable_python should be "system", "internal" or "no"
7388 case $enable_python in
7389 system)
7390     SYSTEM_PYTHON=YES
7392     if test "$CROSS_COMPILING" != YES; then
7393         dnl Check if the headers really work
7394         save_CPPFLAGS="$CPPFLAGS"
7395         CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
7396         AC_CHECK_HEADER(Python.h, [],
7397            [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
7398            [])
7399         CPPFLAGS="$save_CPPFLAGS"
7401         AC_LANG_PUSH(C)
7402         CFLAGS="$CFLAGS $PYTHON_CFLAGS"
7403         AC_MSG_CHECKING([for correct python library version])
7404            AC_RUN_IFELSE([AC_LANG_SOURCE([[
7405 #include <Python.h>
7407 int main(int argc, char **argv) {
7408        if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
7409            (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
7410        else return 1;
7412            ]])],[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])],[])
7413         CFLAGS=$save_CFLAGS
7414         AC_LANG_POP(C)
7416         dnl FIXME Check if the Python library can be linked with, too?
7417     fi
7418     ;;
7420 internal)
7421     SYSTEM_PYTHON=NO
7422     PYTHON_VERSION_MAJOR=3
7423     PYTHON_VERSION_MINOR=3
7424     PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.0
7425     BUILD_TYPE="$BUILD_TYPE PYTHON"
7426     # Embedded Python dies without Home set
7427     if test "$HOME" = ""; then
7428         export HOME=""
7429     fi
7430     # bz2 tarball and bzip2 is not standard
7431     if test -z "$BZIP2"; then
7432         AC_PATH_PROG( BZIP2, bzip2)
7433         if test -z "$BZIP2"; then
7434             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
7435         fi
7436     fi
7437     ;;
7439     SYSTEM_PYTHON=NO
7440     ;;
7442     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
7443     ;;
7444 esac
7446 dnl Cross-build of python requires python that is runnable on the build
7447 dnl platform, because it is used in the build process
7448 if test "$cross_compiling" = yes; then
7449     if test "$DISABLE_PYTHON" = no -a "$SYSTEM_PYTHON" = no -a "$DISABLE_PYTHON_FOR_BUILD" = yes; then
7450         AC_MSG_ERROR([Cross-build of python requires python that is runnable on the build platform. You must not use --disable-python for the 'build' config.])
7451     fi
7454 AC_SUBST(SYSTEM_PYTHON)
7455 AC_SUBST(PYTHON_CFLAGS)
7456 AC_SUBST(PYTHON_LIBS)
7457 AC_SUBST(PYTHON_VERSION)
7458 AC_SUBST(PYTHON_VERSION_MAJOR)
7459 AC_SUBST(PYTHON_VERSION_MINOR)
7460 AC_SUBST([MINGW_PYTHON_EXE])
7461 AC_SUBST([MINGW_PYTHON_DLL])
7462 AC_SUBST([MINGW_READLINE_DLL])
7463 AC_SUBST([MINGW_TERMCAP_DLL])
7465 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
7466 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
7467     AC_MSG_RESULT([yes])
7468     ENABLE_MYSQLC=YES
7469     BUILD_TYPE="$BUILD_TYPE MYSQLC"
7470 else
7471     AC_MSG_RESULT([no])
7472     ENABLE_MYSQLC=NO
7474 AC_SUBST(ENABLE_MYSQLC)
7476 if test "$ENABLE_MYSQLC" = "YES"; then
7478     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
7480     dnl ===================================================================
7481     dnl Check for system MySQL
7482     dnl ===================================================================
7483     AC_MSG_CHECKING([for MySQL prerequisites])
7484     if test "$with_system_mysql" = "yes"; then
7485         AC_MSG_RESULT([external MySQL])
7486         SYSTEM_MYSQL=YES
7487         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
7488         AC_MSG_CHECKING([MySQL version])
7489         MYSQL_VERSION=`$MYSQLCONFIG --version`
7490         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
7491         if test "$MYSQL_MAJOR" -ge "5"; then
7492             AC_MSG_RESULT([OK])
7493         else
7494             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
7495         fi
7496         AC_MSG_CHECKING([for MySQL Client library])
7497         MYSQL_INC=`$MYSQLCONFIG --include`
7498         MYSQL_LIB=`$MYSQLCONFIG --libs`
7499         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
7500         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
7501     else
7502         SYSTEM_MYSQL=NO
7503         if test -n "$with_libmysql_path"; then
7504             AC_MSG_RESULT([external Connector/C (libmysql)])
7505             LIBMYSQL=libmysql.so
7506             if test "$_os" = "Darwin"; then
7507                 LIBMYSQL=libmysql.dylib
7508             elif test "$_os" = "WINNT"; then
7509                 LIBMYSQL=libmysql.dll
7510             fi
7511             AC_MSG_CHECKING([for $LIBMYSQL])
7512             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
7513                 AC_MSG_RESULT([found.])
7514                 LIBMYSQL_PATH=$with_libmysql_path
7515             else
7516                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
7517             fi
7518         else
7519             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
7520         fi
7521     fi
7522     AC_SUBST(SYSTEM_MYSQL)
7523     AC_SUBST(MYSQL_INC)
7524     AC_SUBST(MYSQL_LIB)
7525     AC_SUBST(MYSQL_DEFINES)
7526     AC_SUBST(LIBMYSQL_PATH)
7528     AC_LANG_PUSH([C++])
7529     dnl ===================================================================
7530     dnl Check for system MySQL C++ Connector
7531     dnl ===================================================================
7532     # FIXME!
7533     # who thought this too-generic cppconn dir was a good idea?
7534     AC_MSG_CHECKING([MySQL Connector/C++])
7535     if test "$with_system_mysql_cppconn" = "yes"; then
7536         AC_MSG_RESULT([external])
7537         SYSTEM_MYSQL_CPPCONN=YES
7538         AC_LANG_PUSH([C++])
7539         AC_CHECK_HEADER(mysql_driver.h, [],
7540                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
7541         AC_CHECK_LIB([mysqlcppconn], [main], [:],
7542                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
7543         save_LIBS=$LIBS
7544         LIBS="$LIBS -lmysqlcppconn"
7545         AC_MSG_CHECKING([version])
7546         AC_RUN_IFELSE([AC_LANG_SOURCE([[
7547 #include <mysql_driver.h>
7549 int main(int argc, char **argv) {
7550     sql::Driver *driver;
7551     driver = get_driver_instance();
7552     if (driver->getMajorVersion() > 1 || \
7553        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
7554        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
7555         return 0;
7556       else
7557         return 1;
7559       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
7561         AC_LANG_POP([C++])
7562         LIBS=$save_LIBS
7563     else
7564         AC_MSG_RESULT([internal])
7565         AC_MSG_CHECKING([for mysqlcppconn module])
7566         if test -d mysqlcppconn; then
7567             AC_MSG_RESULT([OK])
7568         else
7569             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
7570         fi
7571         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
7572         SYSTEM_MYSQL_CPPCONN=NO
7573     fi
7574     AC_LANG_POP([C++])
7576 AC_SUBST(SYSTEM_MYSQL_CPPCONN)
7578 dnl ===================================================================
7579 dnl Check for system hsqldb
7580 dnl ===================================================================
7581 if test "$with_java" != "no"; then
7582 HSQLDB_USE_JDBC_4_1=
7583 AC_MSG_CHECKING([which hsqldb to use])
7584 if test "$with_system_hsqldb" = "yes"; then
7585     AC_MSG_RESULT([external])
7586     SYSTEM_HSQLDB=YES
7587     if test -z $HSQLDB_JAR; then
7588         HSQLDB_JAR=/usr/share/java/hsqldb.jar
7589     fi
7590     AC_CHECK_FILE($HSQLDB_JAR, [],
7591                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
7592     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
7593     export HSQLDB_JAR
7594     if $PERL -e 'use Archive::Zip;
7595             my $file = "$ENV{'HSQLDB_JAR'}";
7596             my $zip = Archive::Zip->new( $file );
7597             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
7598             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
7599                push @l, split(/\n/, $mf);
7600                foreach my $line (@l) {
7601                   if ($line =~ m/Specification-Version:/) {
7602                       ($t, $version) = split (/:/,$line);
7603                       $version =~ s/^\s//;
7604                       ($a, $b, $c, $d) = split (/\./,$version);
7605                       if ($c == "0" && $d > "8")  {
7606                           exit 0;
7607                       } else {
7608                           exit 1;
7609                       }
7610                   }
7611                }
7612             } else {
7613                 exit 1;
7614             }'; then
7615         AC_MSG_RESULT([yes])
7616     else
7617         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
7618     fi
7619 else
7620     AC_MSG_RESULT([internal])
7621     SYSTEM_HSQLDB=NO
7622     BUILD_TYPE="$BUILD_TYPE HSQLDB"
7623     AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
7624     javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
7625     if expr "$javanumver" '>=' 000100060000 > /dev/null; then
7626         AC_MSG_RESULT([yes])
7627         HSQLDB_USE_JDBC_4_1=YES
7628     else
7629         AC_MSG_RESULT([no])
7630     fi
7632 AC_SUBST(SYSTEM_HSQLDB)
7633 AC_SUBST(HSQLDB_JAR)
7634 AC_SUBST([HSQLDB_USE_JDBC_4_1])
7637 dnl ===================================================================
7638 dnl Check for PostgreSQL stuff
7639 dnl ===================================================================
7640 if test "x$enable_postgresql_sdbc" != "xno"; then
7641     SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
7643     # if/when anything else than PostgreSQL uses Kerberos,
7644     # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
7645     WITH_KRB5=NO
7646     WITH_GSSAPI=no
7647     case "$_os" in
7648     Darwin)
7649         # MacOS X has system MIT Kerberos 5 since 10.4
7650         if test "$with_krb5" != "no"; then
7651             WITH_KRB5=YES
7652             save_LIBS=$LIBS
7653             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7654                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
7655             LIBS=$save_LIBS
7656             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7657                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
7658             LIBS=$save_LIBS
7659         fi
7660         if test "$with_gssapi" != "no"; then
7661           WITH_GSSAPI=YES
7662           save_LIBS=$LIBS
7663           AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7664                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7665           LIBS=$save_LIBS
7666         fi
7667         ;;
7668     WINNT)
7669         if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
7670             AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
7671         fi
7672         ;;
7673     Linux|GNU|*BSD|DragonFly)
7674         if test "$with_krb5" != "no"; then
7675             WITH_KRB5=YES
7676             save_LIBS=$LIBS
7677             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7678                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7679             LIBS=$save_LIBS
7680             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7681                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7682             LIBS=$save_LIBS
7683         fi
7684         if test "$with_gssapi" != "no"; then
7685             WITH_GSSAPI=YES
7686             save_LIBS=$LIBS
7687             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7688                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7689             LIBS=$save_LIBS
7690         fi
7691         ;;
7692     *)
7693         if test "$with_krb5" = "yes"; then
7694             WITH_KRB5=YES
7695             save_LIBS=$LIBS
7696             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7697                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7698             LIBS=$save_LIBS
7699             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7700                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7701             LIBS=$save_LIBS
7702         fi
7703         if test "$with_gssapi" = "yes"; then
7704             WITH_GSSAPI=YES
7705             save_LIBS=$LIBS
7706             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7707                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7708             LIBS=$save_LIBS
7709         fi
7710     esac
7712     AC_MSG_CHECKING([PostgreSQL C interface])
7713     if test "$with_system_postgresql" = "yes"; then
7714         AC_MSG_RESULT([external PostgreSQL])
7715         SYSTEM_POSTGRESQL=YES
7716         if test "$_os" = Darwin; then
7717             supp_path=''
7718             for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
7719                 pg_supp_path="$P_SEP$d$pg_supp_path"
7720             done
7721         fi
7722         AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
7723         if test -z "$PGCONFIG"; then
7724             AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
7725         fi
7726         POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
7727         POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
7728     else
7729         if test -n "$with_libpq_path"; then
7730             SYSTEM_POSTGRESQL=YES
7731             AC_MSG_RESULT([external libpq])
7732             POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
7733             POSTGRESQL_INC=-I"${with_libpq_path}/include/"
7734         else
7735             SYSTEM_POSTGRESQL=NO
7736             AC_MSG_RESULT([internal])
7737             POSTGRESQL_LIB=""
7738             POSTGRESQL_INC="%OVERRIDE_ME%"
7739             BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
7740         fi
7741     fi
7742     if test "${SYSTEM_POSTGRESQL}" = "YES"; then
7743         AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
7744         save_CFLAGS=$CFLAGS
7745         save_CPPFLAGS=$CPPFLAGS
7746         save_LIBS=$LIBS
7747         CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
7748         LIBS="${LIBS} ${POSTGRESQL_LIB}"
7749         AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
7750         AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
7751             [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
7752         CFLAGS=$save_CFLAGS
7753         CPPFLAGS=$save_CPPFLAGS
7754         LIBS=$save_LIBS
7755     fi
7756     BUILD_POSTGRESQL_SDBC=YES
7758 AC_SUBST(WITH_KRB5)
7759 AC_SUBST(WITH_GSSAPI)
7760 AC_SUBST(BUILD_POSTGRESQL_SDBC)
7761 AC_SUBST(SYSTEM_POSTGRESQL)
7762 AC_SUBST(POSTGRESQL_INC)
7763 AC_SUBST(POSTGRESQL_LIB)
7765 dnl ===================================================================
7766 dnl Check for system curl
7767 dnl ===================================================================
7768 AC_MSG_CHECKING([which libcurl to use])
7769 if test "$with_system_curl" = "auto"; then
7770     case "$_os" in
7771     Darwin)
7772         with_system_curl=yes
7773         ;;
7774     *)
7775         with_system_curl="$with_system_libs"
7776         ;;
7777     esac
7780 if test "$with_system_curl" = "yes"; then
7781     AC_MSG_RESULT([external])
7782     SYSTEM_CURL=YES
7784     curl_version=""
7785     if test "$cross_compiling" = "yes"; then
7786         dnl At least the OBS mingw32-libcurl-devel package
7787         dnl comes with a proper .pc file
7788         PKG_CHECK_MODULES(CURL, libcurl,, [:])
7789         if test -n "$CURL_PKG_ERRORS"; then
7790             AC_MSG_RESULT([no])
7791         else
7792             curl_version=`$PKG_CONFIG --modversion libcurl`
7793         fi
7794     fi
7795     if test -z "$curl_version"; then
7796         AC_PATH_PROG(CURLCONFIG, curl-config)
7797         if test -z "$CURLCONFIG"; then
7798             AC_MSG_ERROR([install the libcurl development package])
7799         fi
7800         CURL_LIBS=`$CURLCONFIG --libs`
7801         CURL_CFLAGS=`$CURLCONFIG --cflags`
7802         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
7803     fi
7805     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
7807     case $curl_version in
7808     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
7809     dnl so they need to be doubled to end up in the configure script
7810     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
7811         AC_MSG_RESULT([yes, you have $curl_version])
7812         ;;
7813     *)
7814         AC_MSG_ERROR([no, you have $curl_version])
7815         ;;
7816     esac
7818     libo_MINGW_CHECK_DLL([CURL], [libcurl])
7819     libo_MINGW_TRY_DLL([INTL], [libintl])
7820     libo_MINGW_TRY_DLL([IDN], [libidn])
7821     libo_MINGW_TRY_DLL([NSPR4], [libnspr4])
7822     libo_MINGW_TRY_DLL([NSSUTIL3], [nssutil3])
7823     libo_MINGW_TRY_DLL([PLC4], [libplc4])
7824     libo_MINGW_TRY_DLL([PLDS4], [libplds4])
7825     libo_MINGW_TRY_DLL([NSS3], [nss3])
7826     libo_MINGW_TRY_DLL([SSL3], [ssl3])
7827     libo_MINGW_TRY_DLL([GPG_ERROR], [libgpg-error])
7828     libo_MINGW_TRY_DLL([GCRYPT], [libgcrypt])
7829     libo_MINGW_TRY_DLL([SSH2], [libssh2])
7830 else
7831     AC_MSG_RESULT([internal])
7832     SYSTEM_CURL=NO
7833     BUILD_TYPE="$BUILD_TYPE CURL"
7835 AC_SUBST(SYSTEM_CURL)
7836 AC_SUBST(CURL_CFLAGS)
7837 AC_SUBST(CURL_LIBS)
7838 AC_SUBST([MINGW_CURL_DLL])
7839 AC_SUBST([MINGW_GCRYPT_DLL])
7840 AC_SUBST([MINGW_GPG_ERROR_DLL])
7841 AC_SUBST([MINGW_IDN_DLL])
7842 AC_SUBST([MINGW_INTL_DLL])
7843 AC_SUBST([MINGW_NSPR4_DLL])
7844 AC_SUBST([MINGW_NSS3_DLL])
7845 AC_SUBST([MINGW_NSSUTIL3_DLL])
7846 AC_SUBST([MINGW_PLC4_DLL])
7847 AC_SUBST([MINGW_PLDS4_DLL])
7848 AC_SUBST([MINGW_SSH2_DLL])
7849 AC_SUBST([MINGW_SSL3_DLL])
7851 dnl ===================================================================
7852 dnl Check for system boost
7853 dnl ===================================================================
7854 AC_MSG_CHECKING([which boost to use])
7855 if test "$with_system_boost" = "yes"; then
7856     AC_MSG_RESULT([external])
7857     SYSTEM_BOOST=YES
7858     AC_LANG_PUSH([C++])
7859     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
7860        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
7861     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
7862        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
7863     AC_CHECK_HEADER(boost/function.hpp, [],
7864        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
7866     save_CXXFLAGS=$CXXFLAGS
7867     CXXFLAGS="$CXXFLAGS -fno-exceptions"
7868     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
7869     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
7870 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
7872     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
7873         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
7874     else
7875         AC_MSG_RESULT([yes])
7876     fi
7877     CXXFLAGS=$save_CXXFLAGS
7878     AC_LANG_POP([C++])
7880     AX_BOOST_BASE
7881     AX_BOOST_DATE_TIME
7882     mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
7883     libo_MINGW_TRY_DLL([BOOST_DATE_TIME], [$mingw_boost_date_time_dll])
7884     if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
7885         # if not found, try again with 'lib' prefix
7886         libo_MINGW_CHECK_DLL([BOOST_DATE_TIME],
7887                              [lib$mingw_boost_date_time_dll])
7888     fi
7889 else
7890     AC_MSG_RESULT([internal])
7891     BUILD_TYPE="$BUILD_TYPE BOOST"
7892     SYSTEM_BOOST=NO
7894 AC_SUBST([MINGW_BOOST_DATE_TIME_DLL])
7895 AC_SUBST(SYSTEM_BOOST)
7897 dnl ===================================================================
7898 dnl Check for system mdds
7899 dnl ===================================================================
7900 AC_MSG_CHECKING([which mdds to use])
7901 if test "$with_system_mdds" = "yes"; then
7902     AC_MSG_RESULT([external])
7903     SYSTEM_MDDS=YES
7905     dnl ===================================================================
7906     dnl Determine which hash container mdds shall use
7907     dnl ===================================================================
7908     AC_MSG_CHECKING([which hash container mdds shall use])
7909     if test "x$HAVE_CXX0X" = "xTRUE"; then
7910         MDDS_CPPFLAGS="-std=gnu++0x"
7911         AC_MSG_RESULT([std::unordered_map])
7912     else
7913         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
7914         AC_MSG_RESULT([boost::unordered_map])
7915     fi
7917     AC_LANG_PUSH([C++])
7918     save_CPPFLAGS="$CPPFLAGS"
7919     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
7920     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
7921         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
7922     AC_CHECK_HEADER(mdds/multi_type_matrix.hpp, [],
7923         [AC_MSG_ERROR(mdds/multi_type_matrix.hpp not found. install mdds >= 0.6.0)], [])
7924     CPPFLAGS="$save_CPPFLAGS"
7925     AC_LANG_POP([C++])
7926 else
7927     AC_MSG_RESULT([internal])
7928     BUILD_TYPE="$BUILD_TYPE MDDS"
7929     SYSTEM_MDDS=NO
7931     dnl ===================================================================
7932     dnl Determine which hash container mdds shall use
7933     dnl ===================================================================
7934     AC_MSG_CHECKING([which hash container mdds shall use])
7935     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
7936     AC_MSG_RESULT([boost::unordered_map])
7938 AC_SUBST(SYSTEM_MDDS)
7939 AC_SUBST([MDDS_CPPFLAGS])
7941 dnl ===================================================================
7942 dnl Check for system vigra
7943 dnl ===================================================================
7944 AC_MSG_CHECKING([which vigra to use])
7945 if test "$with_system_vigra" = "yes"; then
7946     AC_MSG_RESULT([external])
7947     SYSTEM_VIGRA=YES
7948     AC_LANG_PUSH([C++])
7949     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
7950        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
7951     AC_LANG_POP([C++])
7952 else
7953     AC_MSG_RESULT([internal])
7954     BUILD_TYPE="$BUILD_TYPE VIGRA"
7955     SYSTEM_VIGRA=NO
7957 AC_SUBST(SYSTEM_VIGRA)
7959 dnl ===================================================================
7960 dnl Check for system odbc
7961 dnl ===================================================================
7962 AC_MSG_CHECKING([which odbc headers to use])
7963 if test "$with_system_odbc" = "yes"; then
7964     AC_MSG_RESULT([external])
7965     SYSTEM_ODBC_HEADERS=YES
7967     AC_CHECK_HEADER(sqlext.h, [],
7968       [AC_MSG_ERROR(odbc not found. install odbc)], [])
7969 elif test "$enable_database_connectivity" != yes; then
7970     AC_MSG_RESULT([none])
7971 else
7972     AC_MSG_RESULT([internal])
7973     SYSTEM_ODBC_HEADERS=NO
7975 AC_SUBST(SYSTEM_ODBC_HEADERS)
7978 dnl ===================================================================
7979 dnl Check for system openldap
7980 dnl ===================================================================
7982 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
7983 AC_MSG_CHECKING([which openldap library to use])
7984 if test "$with_system_openldap" = "yes"; then
7985     AC_MSG_RESULT([external])
7986     SYSTEM_OPENLDAP=YES
7987     AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
7988     AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
7989     AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
7990 else
7991     AC_MSG_RESULT([internal])
7992     SYSTEM_OPENLDAP=NO
7993     BUILD_TYPE="$BUILD_TYPE OPENLDAP"
7996 AC_SUBST(SYSTEM_OPENLDAP)
7998 dnl ===================================================================
7999 dnl Check for mozilla ab connectivity for windows
8000 dnl ===================================================================
8002 AC_MSG_CHECKING([whether to enable build of Mozilla addressbook connectivity driver for Windows])
8003 if test "$enable_win_mozab_driver" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
8004     AC_MSG_RESULT([yes])
8005     WITH_MOZAB4WIN=YES
8006     BUILD_MOZAB=YES
8007     if test "$enable_build_mozab" = "no" ; then
8008         BUILD_MOZAB=NO
8009     fi
8010 else
8011     AC_MSG_RESULT([no])
8012     WITH_MOZAB4WIN=NO
8014 AC_SUBST(WITH_MOZAB4WIN)
8015 AC_SUBST(BUILD_MOZAB)
8017 if test "$_os" != "WINNT"; then
8018 # on all other platforms Mozilla addressbook connectivity
8019 # is unconditionally built
8020 # new and shiny mork driver
8021    AC_MSG_RESULT([yes (new mork driver)])
8022 else
8023     if test "$WITH_MOZAB4WIN" = "NO"; then
8024         AC_MSG_RESULT([no])
8025     else
8026         AC_MSG_RESULT([yes, internal (old windows mozab driver)])
8027         BUILD_TYPE="$BUILD_TYPE MOZ"
8028         EXTMSV80=`cygpath  -u "$SRC_ROOT/external/msvcp80"`
8029         AC_MSG_CHECKING([for MSVC 2005 runtime needed for prebuilt Mozilla])
8030         if test -e "$EXTMSV80/Microsoft.VC80.CRT.manifest" -a \
8031                 -e "$EXTMSV80/msvcp80.dll" -a \
8032                 -e "$EXTMSV80/msvcr80.dll"; then
8033             AC_MSG_RESULT([Found])
8034             EXTMSV80=
8035         else
8036             #uwin-prefixed paths are with no quotes to allow for mask, and uwin to not have spaces, btw
8037             uwin=`cygpath -d "$WINDIR"`
8038             uwin=`cygpath -u "$uwin"`
8039             #if we have one we have all
8040             if test -e $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053* ; then
8041                 MSVC80_DLL_DIR=`ls -d $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053*`
8042                 MSVC80_MNFST=`ls $uwin/winsxs/Manifests/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_*.manifest`
8043                 AC_MSG_RESULT([Found])
8044             else
8045                 EXTMSV80=
8046                 AC_MSG_RESULT([Not Found])
8047                 AC_MSG_ERROR([For the pre-built Mozilla libraries, you need MSVC 2005 runtime files
8048     Microsoft.VC80.CRT.manifest, msvcp80.dll, and msvcr80.dll
8049     in external/msvcp80.
8051     You can get them by installing:
8052     <http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE>
8053     and relaunch ./autogen.sh])
8054             fi
8055         fi
8056     fi
8060 AC_SUBST(MSVC80_DLL_DIR)
8061 AC_SUBST(MSVC80_MNFST)
8062 AC_SUBST(EXTMSV80)
8063 AC_SUBST(EXTMSV80)
8065 dnl ===================================================================
8066 dnl Check for system NSS
8067 dnl ===================================================================
8068 AC_MSG_CHECKING([which NSS to use])
8069 if test "$with_system_nss" = "yes"; then
8070     AC_MSG_RESULT([external])
8071     SYSTEM_NSS="YES"
8072     PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
8073     libo_MINGW_CHECK_DLL([NSPR4], [libnspr4])
8074     libo_MINGW_CHECK_DLL([PLC4], [libplc4])
8075     libo_MINGW_CHECK_DLL([PLDS4], [libplds4])
8076     libo_MINGW_CHECK_DLL([NSS3], [nss3])
8077     libo_MINGW_CHECK_DLL([NSSUTIL3], [nssutil3])
8078     libo_MINGW_CHECK_DLL([SMIME3], [smime3])
8079     libo_MINGW_CHECK_DLL([SSL3], [ssl3])
8080 else
8081     SYSTEM_NSS="NO"
8082     BUILD_TYPE="$BUILD_TYPE NSS"
8083     AC_MSG_RESULT([internal])
8084     if test "$build_os" = "cygwin"; then
8085         AC_MSG_CHECKING([for nss build tooling]) # coming from mozilla
8086         if test -z "$NSSBUILDTOOLS"; then
8087             AC_MSG_ERROR([nss build tooling not provided
8088 Use the --with-nss-build-tools option after installing the tools obtained
8089 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
8090         else
8091             if test \( "$WITH_MINGW" = "yes" -a  ! -d "$NSSBUILDTOOLS" \) \
8092                     -o ! -d "$NSSBUILDTOOLS/moztools" \
8093                     -o ! -d "$NSSBUILDTOOLS/msys" ; then
8094                 AC_MSG_ERROR([nss build tooling incomplete!])
8095             else
8096                 AC_MSG_RESULT([ok])
8097             fi
8098         fi
8099     fi
8100 fi # system nss
8101 AC_SUBST(SYSTEM_NSS)
8102 AC_SUBST(NSS_CFLAGS)
8103 AC_SUBST(NSS_LIBS)
8104 AC_SUBST(NSSBUILDTOOLS)
8105 AC_SUBST(MINGW_SMIME3_DLL)
8107 dnl ===================================================================
8108 dnl Check for system mozilla headers
8109 dnl ===================================================================
8110 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
8111 AC_MSG_CHECKING([which NPAPI headers to use])
8113 if test "$with_system_npapi_headers" = "yes"; then
8114     AC_MSG_RESULT([external])
8115     SYSTEM_NPAPI_HEADERS=YES
8116     # First try npapi-sdk:
8117     PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
8118     # Then go with libxul:
8119     if test "x$LOCATED" != "xyes"; then
8120         PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
8121     fi
8122     if test "x$LOCATED" != "xyes"; then
8123         PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
8124     fi
8125     # if still not found bail out
8126     if test "x$LOCATED" != "xyes"; then
8127         AC_MSG_ERROR([npapi.h header file not found])
8128     fi
8130     AC_LANG_PUSH([C])
8131     save_CFLAGS=$CFLAGS
8132     CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS"
8133     AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
8134     AC_COMPILE_IFELSE(
8135         [AC_LANG_SOURCE([[
8136             #define XP_UNIX
8137             #include <npapi.h>
8138             const char* NPP_GetMIMEDescription(void) { return "foo"; }
8139             ]])],
8140         [AC_MSG_RESULT([const char*])],
8141         [
8142         AC_MSG_RESULT([char*])
8143         HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
8144         ])
8145     CFLAGS=$save_CFLAGS
8146     AC_LANG_POP([C])
8147 else
8148     AC_MSG_RESULT([internal])
8149         dnl ...but will not be built/used unless ENABLE_NPAPI_FROM_BROWSER or
8150         dnl ENABLE_NPAPI_INTO_BROWSER is YES
8151     SYSTEM_NPAPI_HEADERS=NO
8153 AC_SUBST(NPAPI_HEADERS_CFLAGS)
8154 AC_SUBST(SYSTEM_NPAPI_HEADERS)
8155 AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
8157 dnl ===================================================================
8158 dnl Check for system sane
8159 dnl ===================================================================
8160 AC_MSG_CHECKING([which sane header to use])
8161 if test "$with_system_sane" = "yes"; then
8162     AC_MSG_RESULT([external])
8163     AC_CHECK_HEADER(sane/sane.h, [],
8164       [AC_MSG_ERROR(sane not found. install sane)], [])
8165 else
8166     AC_MSG_RESULT([internal])
8167     BUILD_TYPE="$BUILD_TYPE SANE"
8170 dnl ===================================================================
8171 dnl Check for system icu
8172 dnl ===================================================================
8173 SYSTEM_GENBRK=
8174 SYSTEM_GENCCODE=
8175 SYSTEM_GENCMN=
8177 ICU_MAJOR=49
8178 ICU_MINOR=1
8179 ICU_MICRO=1
8180 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8181 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
8182 ICU_RECLASSIFIED_HEBREW_LETTER="YES"
8183 AC_MSG_CHECKING([which icu to use])
8184 if test "$with_system_icu" = "yes"; then
8185     AC_MSG_RESULT([external])
8186     SYSTEM_ICU=YES
8187     AC_LANG_PUSH([C++])
8188     AC_MSG_CHECKING([for unicode/rbbi.h])
8189     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
8190     AC_LANG_POP([C++])
8192     ICUPATH="$PATH"
8193     if test "$WITH_MINGW" = "yes"; then
8194         ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
8195     fi
8196     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
8198     AC_MSG_CHECKING([ICU version])
8199     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
8200     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
8201     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
8202     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
8204     if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "6" \); then
8205         AC_MSG_RESULT([OK, $ICU_VERSION])
8206     else
8207         AC_MSG_ERROR([not suitable, only >= 4.6 supported currently])
8208     fi
8210     if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
8211         AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
8212         ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
8213         ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
8214         ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
8215         AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
8216         if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
8217             AC_MSG_RESULT([yes])
8218         else
8219             AC_MSG_RESULT([no])
8220             if test "$with_system_icu_for_build" != "force"; then
8221                 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
8222 You can use --with-system-icu-for-build=force to use it anyway.])
8223             fi
8224         fi
8225     fi
8227     if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
8228         # using the system icu tools can lead to version confusion, use the
8229         # ones from the build environment when cross-compiling
8230         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
8231         if test -z "$SYSTEM_GENBRK"; then
8232             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
8233         fi
8234         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8235         if test -z "$SYSTEM_GENCCODE"; then
8236             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
8237         fi
8238         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8239         if test -z "$SYSTEM_GENCMN"; then
8240             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
8241         fi
8242         if test "$ICU_MAJOR" -ge "49"; then
8243             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8244         else
8245             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO"
8246         fi
8247         if test "$ICU_MAJOR" -le 4; then
8248             ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="NO"
8249             ICU_RECLASSIFIED_HEBREW_LETTER="NO"
8250         fi
8251     fi
8253     libo_MINGW_CHECK_DLL([ICUDATA], [icudata][$ICU_MAJOR][$ICU_MINOR])
8254     libo_MINGW_CHECK_DLL([ICUI18N], [icui18n][$ICU_MAJOR][$ICU_MINOR])
8255     libo_MINGW_CHECK_DLL([ICUUC], [icuuc][$ICU_MAJOR][$ICU_MINOR])
8256 else
8257     AC_MSG_RESULT([internal])
8258     SYSTEM_ICU="NO"
8259     BUILD_TYPE="$BUILD_TYPE ICU"
8261 AC_SUBST(SYSTEM_ICU)
8262 AC_SUBST(SYSTEM_GENBRK)
8263 AC_SUBST(SYSTEM_GENCCODE)
8264 AC_SUBST(SYSTEM_GENCMN)
8265 AC_SUBST(ICU_MAJOR)
8266 AC_SUBST(ICU_MINOR)
8267 AC_SUBST(ICU_MICRO)
8268 AC_SUBST([ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER])
8269 AC_SUBST([ICU_RECLASSIFIED_HEBREW_LETTER])
8270 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
8271 AC_SUBST([MINGW_ICUDATA_DLL])
8272 AC_SUBST([MINGW_ICUI18N_DLL])
8273 AC_SUBST([MINGW_ICUUC_DLL])
8275 dnl ===================================================================
8276 dnl Graphite
8277 dnl ===================================================================
8279 AC_MSG_CHECKING([whether to enable graphite support])
8280 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "$enable_graphite" = "" -o "$enable_graphite" != "no"; then
8281     AC_MSG_RESULT([yes])
8282     ENABLE_GRAPHITE="TRUE"
8283     AC_MSG_CHECKING([which graphite to use])
8284     if test "$with_system_graphite" = "yes"; then
8285         AC_MSG_RESULT([external])
8286         SYSTEM_GRAPHITE=YES
8287         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
8288         libo_MINGW_CHECK_DLL([GRAPHITE2], [libgraphite2])
8289     else
8290         AC_MSG_RESULT([internal])
8291         SYSTEM_GRAPHITE=NO
8292         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
8293     fi
8294 else
8295     AC_MSG_RESULT([no])
8297 AC_SUBST(ENABLE_GRAPHITE)
8298 AC_SUBST(SYSTEM_GRAPHITE)
8299 AC_SUBST(GRAPHITE_CFLAGS)
8300 AC_SUBST(GRAPHITE_LIBS)
8301 AC_SUBST([MINGW_GRAPHITE2_DLL])
8303 dnl ===================================================================
8304 dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
8305 dnl ===================================================================
8306 AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
8307 if test "$_os" != Android -a "$_os" != iOS
8308 then
8309     AC_MSG_RESULT([yes])
8310     ENABLE_NPAPI_FROM_BROWSER=YES
8311 else
8312     AC_MSG_RESULT([no])
8313     ENABLE_NPAPI_FROM_BROWSER=NO
8315 AC_SUBST(ENABLE_NPAPI_FROM_BROWSER)
8317 dnl ===================================================================
8318 dnl Check for NPAPI interface to plug LibreOffice into browser windows
8319 dnl ===================================================================
8320 AC_MSG_CHECKING([whether to plug LibreOffice into browser windows])
8321 if test "$_os" == WINNT -o "$_os" != Android -a "$_os" != Darwin -a "$_os" != iOS -a \
8322         "$enable_headless" != yes -a "$enable_gtk" != no
8323 then
8324     AC_MSG_RESULT([yes])
8325     ENABLE_NPAPI_INTO_BROWSER=YES
8326 else
8327     AC_MSG_RESULT([no])
8328     ENABLE_NPAPI_INTO_BROWSER=NO
8330 AC_SUBST(ENABLE_NPAPI_INTO_BROWSER)
8332 AC_MSG_CHECKING([whether to use X11])
8333 dnl ***************************************
8334 dnl testing for X libraries and includes...
8335 dnl ***************************************
8336 WANT_X11="no"
8337 if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
8338     WANT_X11="yes"
8340 AC_MSG_RESULT([$WANT_X11])
8342 if test "$WANT_X11" = "yes"; then
8343     AC_PATH_X
8344     AC_PATH_XTRA
8345     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8347     if test "x$x_includes" = "x"; then
8348         x_includes="default_x_includes"
8349     fi
8350     if test "x$x_libraries" = "x"; then
8351         x_libraries="default_x_libraries"
8352     fi
8353     dnl The variables $x_libraries and $x_includes are set.
8354     if test -z "$x_libraries"; then
8355         AC_MSG_ERROR([No X libraries found]) # Exit
8356     fi
8357     if test -z "$x_includes"; then
8358         AC_MSG_ERROR([No X includes found]) # Exit
8359     fi
8360     CFLAGS="$CFLAGS $X_CFLAGS"
8361     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
8362     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
8363 else
8364     x_includes="no_x_includes"
8365     x_libraries="no_x_libraries"
8367 if test -z "$x_includes"; then
8368     x_includes="no_x_includes"
8370 if test -z "$x_libraries"; then
8371     x_libraries="no_x_libraries"
8373 if test "$x_includes" = "default_x_includes"; then
8374     XINC="/usr/include"
8375 else
8376     XINC="$x_includes"
8378 AC_SUBST(XINC)
8379 if test "$x_libraries" = "default_x_libraries"; then
8380     XLIB=`$PKG_CONFIG --variable=libdir x11`
8381     if test "x$XLIB" = x; then
8382         XLIB="/usr/lib"
8383     fi
8384 else
8385     XLIB="$x_libraries"
8387 if test "$XLIB" != "no_x_libraries" -a "$XLIB" != "/usr/lib" -a "$XLIB" != "/usr/lib64"; then
8388     SOLARLIB="$SOLARLIB -L$XLIB"
8390 if test "$XINC" != "no_x_includes" -a "$XINC" != "/usr/include"; then
8391     SOLARINC="$SOLARINC -I$XINC"
8393 AC_SUBST(XLIB)
8395 if test "$WANT_X11" = "yes"; then
8396     dnl ===================================================================
8397     dnl Check for Composite.h for Mozilla plugin
8398     dnl ===================================================================
8399     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
8400      [#include <X11/Intrinsic.h>])
8402     dnl ===================================================================
8403     dnl Check for extension headers
8404     dnl ===================================================================
8405     AC_MSG_CHECKING([whether to use internal X11 extensions headers])
8406     if test "$with_system_xextensions_headers" != "no"; then
8407         AC_MSG_RESULT([no])
8408         AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
8409         [#include <X11/extensions/shape.h>])
8410     else
8411         AC_MSG_RESULT([yes])
8412         BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
8413     fi
8417 dnl ===================================================================
8418 dnl Check for system Xrender
8419 dnl ===================================================================
8420 AC_MSG_CHECKING([whether to use Xrender])
8421 if test "$WANT_X11" = "yes" -a  "$test_xrender" = "yes"; then
8422     AC_MSG_RESULT([yes])
8423     PKG_CHECK_MODULES(XRENDER, xrender)
8424     AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
8425       [AC_MSG_ERROR(libXrender not found or functional)], [])
8426     AC_MSG_CHECKING([which Xrender headers to use])
8427     if test "$with_system_xextensions_headers" != "no"; then
8428         AC_MSG_RESULT([external])
8429         AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
8430           [AC_MSG_ERROR(Xrender not found. install X)], [])
8431     else
8432         AC_MSG_RESULT([internal])
8433     fi
8434 else
8435     AC_MSG_RESULT([no])
8437 AC_SUBST(XRENDER_CFLAGS)
8438 AC_SUBST(XRENDER_LIBS)
8440 dnl ===================================================================
8441 dnl Check for XRandr
8442 dnl ===================================================================
8443 AC_MSG_CHECKING([whether to enable RandR support])
8444 if test "$WANT_X11" = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
8445     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
8446         XRANDR_DLOPEN="TRUE"
8447         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
8448     else
8449         AC_MSG_RESULT([yes])
8450         XRANDR_DLOPEN="FALSE"
8451         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
8452         if test "$ENABLE_RANDR" != "TRUE"; then
8453             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
8454                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
8455             XRANDR_CFLAGS=" "
8456             AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
8457               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
8458             XRANDR_LIBS="-lXrandr "
8459             ENABLE_RANDR="TRUE"
8460         fi
8461     fi
8462 else
8463     ENABLE_RANDR=""
8464     AC_MSG_RESULT([no])
8466 AC_SUBST(XRANDR_DLOPEN)
8467 AC_SUBST(XRANDR_CFLAGS)
8468 AC_SUBST(XRANDR_LIBS)
8469 AC_SUBST(ENABLE_RANDR)
8471 dnl ===================================================================
8472 dnl Check for building neon
8473 dnl ===================================================================
8474 AC_MSG_CHECKING([whether to use neon])
8475 if test "$enable_neon" = "no"; then
8476     AC_MSG_RESULT([no])
8477     DISABLE_NEON=TRUE
8478     AC_SUBST(DISABLE_NEON)
8479 else
8480     AC_MSG_RESULT([yes])
8481 dnl ===================================================================
8482 dnl Check for system neon
8483 dnl ===================================================================
8484 AC_MSG_CHECKING([which neon to use])
8485 if test "$with_system_neon" = "yes"; then
8486     AC_MSG_RESULT([external])
8487     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
8488     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
8489     SYSTEM_NEON=YES
8490     libo_MINGW_CHECK_DLL([NEON], [libneon])
8491     libo_MINGW_TRY_DLL([TASN1], [libtasn1])
8492     libo_MINGW_TRY_DLL([GNUTLS], [libgnutls])
8493 else
8494     AC_MSG_RESULT([internal])
8495     SYSTEM_NEON=NO
8496     BUILD_TYPE="$BUILD_TYPE NEON"
8497     NEON_VERSION=0295
8499 AC_SUBST(SYSTEM_NEON)
8500 AC_SUBST(NEON_LIBS)
8501 AC_SUBST(NEON_CFLAGS)
8502 AC_SUBST(NEON_VERSION)
8503 AC_SUBST([MINGW_GNUTLS_DLL])
8504 AC_SUBST([MINGW_NEON_DLL])
8505 AC_SUBST([MINGW_TASN1_DLL])
8508 dnl ===================================================================
8509 dnl Check for disabling cve_tests
8510 dnl ===================================================================
8511 AC_MSG_CHECKING([whether to execute CVE tests])
8512 if test "$enable_cve_tests" = "no"; then
8513     AC_MSG_RESULT([no])
8514     DISABLE_CVE_TESTS=TRUE
8515     AC_SUBST(DISABLE_CVE_TESTS)
8516 else
8517     AC_MSG_RESULT([yes])
8520 dnl ===================================================================
8521 dnl Check for system openssl
8522 dnl ===================================================================
8523 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8524         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
8525     with_system_openssl=yes
8527 AC_MSG_CHECKING([which libssl to use])
8528 if test "$with_system_openssl" = "yes"; then
8529     AC_MSG_RESULT([external])
8530     # Mac OS builds should get out without extra stuff is the Mac porters'
8531     # wish. And pkg-config is although Xcode ships a .pc for openssl
8532     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8533             "$_os" = "DragonFly"; then
8534         OPENSSL_CFLAGS=
8535         OPENSSL_LIBS="-lssl -lcrypto"
8536     else
8537         PKG_CHECK_MODULES( OPENSSL, openssl )
8538     fi
8539     SYSTEM_OPENSSL=YES
8540     libo_MINGW_CHECK_DLL([SSL], [libssl])
8541     libo_MINGW_CHECK_DLL([CRYPTO], [libcrypto])
8542 else
8543     AC_MSG_RESULT([internal])
8544     SYSTEM_OPENSSL=NO
8545     BUILD_TYPE="$BUILD_TYPE OPENSSL"
8547 AC_SUBST(SYSTEM_OPENSSL)
8548 AC_SUBST(OPENSSL_CFLAGS)
8549 AC_SUBST(OPENSSL_LIBS)
8550 AC_SUBST([MINGW_SSL_DLL])
8551 AC_SUBST([MINGW_CRYPTO_DLL])
8553 dnl ===================================================================
8554 dnl Check for system redland
8555 dnl ===================================================================
8556 AC_MSG_CHECKING([which redland library to use])
8557 if test "$with_system_redland" = "yes"; then
8558     AC_MSG_RESULT([external])
8559     SYSTEM_REDLAND=YES
8560     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
8561     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
8562     libo_MINGW_CHECK_DLL([REDLAND], [librdf])
8563     libo_MINGW_TRY_DLL([RAPTOR], [libraptor])
8564     libo_MINGW_TRY_DLL([RASQAL], [librasqal])
8565     libo_MINGW_TRY_DLL([SQLITE3], [libsqlite3])
8566 else
8567     AC_MSG_RESULT([internal])
8568     BUILD_TYPE="$BUILD_TYPE REDLAND"
8569     SYSTEM_REDLAND=NO
8571 AC_SUBST(SYSTEM_REDLAND)
8572 AC_SUBST(REDLAND_CFLAGS)
8573 AC_SUBST(REDLAND_LIBS)
8574 AC_SUBST([MINGW_RAPTOR_DLL])
8575 AC_SUBST([MINGW_RASQAL_DLL])
8576 AC_SUBST([MINGW_REDLAND_DLL])
8577 AC_SUBST([MINGW_SQLITE3_DLL])
8579 dnl ===================================================================
8580 dnl Check for system orcus
8581 dnl ===================================================================
8582 AC_MSG_CHECKING([which orcus library to use])
8583 if test "$with_system_orcus" = "yes"; then
8584     AC_MSG_RESULT([external])
8585     SYSTEM_LIBORCUS=YES
8586     PKG_CHECK_MODULES(ORCUS, liborcus-0.4 >= 0.3.0)
8587 else
8588     AC_MSG_RESULT([internal])
8589     BUILD_TYPE="$BUILD_TYPE ORCUS"
8590     SYSTEM_LIBORCUS=NO
8592     if test "$SYSTEM_BOOST" = "YES"; then
8593         # ===========================================================
8594         # Determine if we are going to need to link with Boost.System
8595         # ===========================================================
8596         dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
8597         dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
8598         dnl in documentation has no effect.
8599         AC_MSG_CHECKING([if we need to link with Boost.System])
8600         AC_LANG_PUSH([C++])
8601         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8602                 @%:@include <boost/version.hpp>
8603             ]],[[
8604                 #if BOOST_VERSION >= 105000
8605                 #   error yes, we need to link with Boost.System
8606                 #endif
8607             ]])],[
8608                 AC_MSG_RESULT([no])
8609             ],[
8610                 AC_MSG_RESULT([yes])
8611                 AX_BOOST_SYSTEM
8612         ])
8613         AC_LANG_POP([C++])
8614     fi
8616 AC_SUBST([BOOST_SYSTEM_LIB])
8617 AC_SUBST(SYSTEM_LIBORCUS)
8618 AC_SUBST(ORCUS_CFLAGS)
8619 AC_SUBST(ORCUS_LIBS)
8621 dnl ===================================================================
8622 dnl Check for system hunspell
8623 dnl ===================================================================
8624 AC_MSG_CHECKING([which libhunspell to use])
8625 if test "$with_system_hunspell" = "yes"; then
8626     AC_MSG_RESULT([external])
8627     SYSTEM_HUNSPELL=YES
8628     AC_LANG_PUSH([C++])
8629     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
8630     if test "$HUNSPELL_PC" != "TRUE"; then
8631         AC_CHECK_HEADER(hunspell.hxx, [],
8632             [
8633             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
8634             [AC_MSG_ERROR(hunspell headers not found.)], [])
8635             ], [])
8636         AC_CHECK_LIB([hunspell], [main], [:],
8637            [ AC_MSG_ERROR(hunspell library not found.) ], [])
8638         HUNSPELL_LIBS=-lhunspell
8639     fi
8640     AC_LANG_POP([C++])
8641     libo_MINGW_CHECK_DLL([HUNSPELL], [libhunspell-1.3])
8642 else
8643     AC_MSG_RESULT([internal])
8644     SYSTEM_HUNSPELL=NO
8645     HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
8646     HUNSPELL_LIBS="-L${OUTDIR}/lib -lhunspell"
8647     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
8649 AC_SUBST(SYSTEM_HUNSPELL)
8650 AC_SUBST(HUNSPELL_CFLAGS)
8651 AC_SUBST(HUNSPELL_LIBS)
8652 AC_SUBST([MINGW_HUNSPELL_DLL])
8654 dnl ===================================================================
8655 dnl Checking for altlinuxhyph
8656 dnl ===================================================================
8657 AC_MSG_CHECKING([which altlinuxhyph to use])
8658 if test "$with_system_altlinuxhyph" = "yes"; then
8659     AC_MSG_RESULT([external])
8660     SYSTEM_HYPH=YES
8661     AC_CHECK_HEADER(hyphen.h, [],
8662        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
8663     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
8664        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
8665        [#include <hyphen.h>])
8666     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
8667         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8668     if test -z "$HYPHEN_LIB"; then
8669         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
8670            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8671     fi
8672     if test -z "$HYPHEN_LIB"; then
8673         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
8674            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8675     fi
8676     libo_MINGW_CHECK_DLL([HYPHEN], [libhyphen])
8677 else
8678     AC_MSG_RESULT([internal])
8679     SYSTEM_HYPH=NO
8680     BUILD_TYPE="$BUILD_TYPE HYPHEN"
8682 AC_SUBST(SYSTEM_HYPH)
8683 AC_SUBST(HYPHEN_LIB)
8684 AC_SUBST([MINGW_HYPHEN_DLL])
8686 dnl ===================================================================
8687 dnl Checking for mythes
8688 dnl ===================================================================
8689 AC_MSG_CHECKING([which mythes to use])
8690 if test "$with_system_mythes" = "yes"; then
8691     AC_MSG_RESULT([external])
8692     SYSTEM_MYTHES=YES
8693     AC_LANG_PUSH([C++])
8694     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
8695     if test "$MYTHES_PKGCONFIG" = "no"; then
8696         AC_CHECK_HEADER(mythes.hxx, [],
8697             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
8698         AC_CHECK_LIB([mythes-1.2], [main], [:],
8699             [ MYTHES_FOUND=no], [])
8700     if test "$MYTHES_FOUND" = "no"; then
8701         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
8702                 [ MYTHES_FOUND=no], [])
8703     fi
8704     if test "$MYTHES_FOUND" = "no"; then
8705         AC_MSG_ERROR([mythes library not found!.])
8706     fi
8707     fi
8708     AC_LANG_POP([C++])
8709     libo_MINGW_CHECK_DLL([MYTHES], [libmythes-1.2])
8710 else
8711     AC_MSG_RESULT([internal])
8712     SYSTEM_MYTHES=NO
8713     BUILD_TYPE="$BUILD_TYPE MYTHES"
8715 AC_SUBST(SYSTEM_MYTHES)
8716 AC_SUBST(MYTHES_CFLAGS)
8717 AC_SUBST(MYTHES_LIBS)
8718 AC_SUBST([MINGW_MYTHES_DLL])
8720 dnl ===================================================================
8721 dnl Checking for lpsolve
8722 dnl ===================================================================
8723 AC_MSG_CHECKING([which lpsolve to use])
8724 if test "$with_system_lpsolve" = "yes"; then
8725     AC_MSG_RESULT([external])
8726     SYSTEM_LPSOLVE=YES
8727     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
8728        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
8729     save_LIBS=$LIBS
8730     # some systems need this. Like Ubuntu....
8731     AC_CHECK_LIB(m, floor)
8732     AC_CHECK_LIB(dl, dlopen)
8733     AC_CHECK_LIB([lpsolve55], [make_lp], [:],
8734         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
8735     LIBS=$save_LIBS
8736     libo_MINGW_CHECK_DLL([LPSOLVE], [lpsolve55])
8737 else
8738     AC_MSG_RESULT([internal])
8739     SYSTEM_LPSOLVE=NO
8740     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
8742 AC_SUBST(SYSTEM_LPSOLVE)
8743 AC_SUBST([MINGW_LPSOLVE_DLL])
8745 dnl ===================================================================
8746 dnl Checking for libexttextcat
8747 dnl ===================================================================
8748 AC_MSG_CHECKING([which libexttextcat to use])
8749 if test "$with_system_libexttextcat" = "yes"; then
8750     AC_MSG_RESULT([external])
8751     SYSTEM_LIBEXTTEXTCAT=YES
8752     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
8753     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
8754 else
8755     AC_MSG_RESULT([internal])
8756     SYSTEM_LIBEXTTEXTCAT=NO
8757     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
8759 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
8760 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
8761 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
8762 AC_SUBST(LIBEXTTEXTCAT_LIBS)
8764 dnl ***************************************
8765 dnl testing libc version for Linux...
8766 dnl ***************************************
8767 if test "$_os" = "Linux"; then
8768     AC_MSG_CHECKING([whether libc is >= 2.1.1])
8769     exec 6>/dev/null # no output
8770     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
8771     exec 6>&1 # output on again
8772     if test "$HAVE_LIBC"; then
8773         AC_MSG_RESULT([yes])
8774     else
8775         AC_MSG_ERROR([no, upgrade libc])
8776     fi
8779 if test "$_os" != "WINNT"; then
8780     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
8781     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
8782     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
8783         SYSTEM_LIBC=YES
8784     fi
8785 else
8786     HAVE_GETOPT=NO
8787     HAVE_READDIR_R=NO
8788     SYSTEM_LIBC=YES
8790 AC_SUBST(HAVE_GETOPT)
8791 AC_SUBST(HAVE_READDIR_R)
8792 AC_SUBST(SYSTEM_LIBC)
8794 dnl =========================================
8795 dnl Check for the Windows  SDK.
8796 dnl =========================================
8797 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
8798 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
8799 if test "$_os" = "WINNT"; then
8800     AC_MSG_CHECKING([for Windows SDK])
8801     if test "$build_os" = "cygwin"; then
8802         if test -z "$with_windows_sdk_home"; then
8803             # This first line will detect a February 2003 Microsoft Platform SDK
8804             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
8805             # But there might be also an April 2005 PSDK, unfortunately MS changed
8806             # the registry entry. (we prefer the old version!?)
8807             if test -z "$WINDOWS_SDK_HOME"; then
8808                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
8809             fi
8810             # normalize if found
8811             if test -n "$WINDOWS_SDK_HOME"; then
8812                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
8813                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8815                 # If this sdk is incomplete, lets see if the one
8816                 # recommended to be installed is available.
8818                 # This refers to the Windows SDK 8 (as distributed
8819                 # with Visual Studio 2012, or maybe also
8820                 # separately), I assume.
8822                 # I wouldn't say that it is "incomplete", it is
8823                 # just structured differtently. We do seem to try
8824                 # to adapt to that structure below (look for the
8825                 # Include/um etc stuff), so rejecting it here is a
8826                 # bit premature... *but* then one notices that
8827                 # compiling with MSVS2008 and trying to use SDK 8
8828                 # leads to horrible errors in ICU at least. Oh
8829                 # well.
8831                 if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe"; then
8832                     WINDOWS_SDK7_HOME=`cat "/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.1/InstallationFolder" 2> /dev/null | tr '\000' '\n' | head -n 1`
8833                     if test -n "$WINDOWS_SDK7_HOME"; then
8834                         WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK7_HOME"`
8835                         WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8836                     fi
8837                 fi
8838             fi
8839         else
8840             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
8841         fi
8842     fi
8843     if test -n "$WINDOWS_SDK_HOME"; then
8844         # Remove a possible trailing backslash
8845         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
8846         # Problem with current PSDK (iz 49865)
8847         # (What "current" does that mean?)
8848         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
8849             AC_MSG_ERROR([
8850 Some modules do not build correctly with MS Platform SDK - April 2005
8851 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
8852 Remove/rename/backup that file and restart configure. Details about this
8853 problem can be found in issue 49856.])
8854         fi
8856         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
8857              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
8858              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
8859             HAVE_PSDK_H="yes"
8860         elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
8861              -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
8862              -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
8863             HAVE_PSDK_H="yes"
8864         else
8865             HAVE_PSDK_H="no"
8866         fi
8867         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
8868             HAVE_PSDK_LIB="yes"
8869         elif test -f "$WINDOWS_SDK_HOME/lib/win8/um/$SDK_ARCH/user32.lib"; then
8870             HAVE_PSDK_LIB="yes"
8871         else
8872             HAVE_PSDK_LIB="no"
8873         fi
8875         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
8876             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
8877 the  Windows SDK are installed.])
8878         fi
8880         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
8881              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
8882              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
8883              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
8884         elif test ! -x "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
8885              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
8886              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
8887              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
8888         else
8889             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
8890         fi
8891     fi
8893     if test -z "$WINDOWS_SDK_HOME"; then
8894         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
8895     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
8896         WINDOWS_SDK_VERSION=61
8897         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
8898     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
8899         WINDOWS_SDK_VERSION=60
8900         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
8901     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
8902         WINDOWS_SDK_VERSION=70
8903         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
8904     elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
8905         WINDOWS_SDK_VERSION=80
8906         AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
8907     else
8908         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
8909     fi
8910     PathFormat "$WINDOWS_SDK_HOME"
8911     WINDOWS_SDK_HOME="$formatted_path"
8912     if test "$build_os" = "cygwin"; then
8913         SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
8914         if test -d "$WINDOWS_SDK_HOME/include/um"; then
8915             SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
8916         fi
8917     fi
8919 AC_SUBST(WINDOWS_SDK_HOME)
8920 AC_SUBST(WINDOWS_SDK_VERSION)
8922 dnl =========================================
8923 dnl Check for uuidgen
8924 dnl =========================================
8925 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
8926     if test "$WITH_MINGW" = "yes"; then
8927         AC_PATH_PROG([UUIDGEN], [uuid])
8928         if test -z "$UUIDGEN"; then
8929             AC_MSG_WARN([uuid is needed for dev-install])
8930         fi
8931     else
8932         # presence is already tested above in the WINDOWS_SDK_HOME check
8933         UUIDGEN=uuidgen.exe
8934         AC_SUBST(UUIDGEN)
8935     fi
8936 else
8937     AC_PATH_PROG([UUIDGEN], [uuidgen])
8938     if test -z "$UUIDGEN"; then
8939         AC_MSG_WARN([uuid is needed for dev-install])
8940     fi
8943 dnl =========================================
8944 dnl Check for the Microsoft DirectX SDK.
8945 dnl =========================================
8946 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
8947     AC_MSG_CHECKING([for DirectX SDK])
8948     if test "$build_os" = "cygwin"; then
8949         if test -z "$with_directx_home"; then
8950             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
8951             if test -n "$DXSDK_DIR"; then
8952                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
8953                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
8954             fi
8955             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
8956             # the "DirectX SDK not found" error later
8957         else
8958             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
8959         fi
8960         # Remove a possible trailing backslash
8961         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
8962     elif test -n "$with_directx_home"; then
8963         DIRECTXSDK_HOME="$with_directx_home"
8964     fi
8966     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h"; then
8967         HAVE_DIRECTXSDK_H="yes"
8968     else
8969         HAVE_DIRECTXSDK_H="no"
8970     fi
8972     if test "$BITNESS_OVERRIDE" = 64; then
8973         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x64"
8974     else
8975         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
8976     fi
8977     PathFormat "$DIRECTXSDK_LIB"
8978     DIRECTXSDK_LIB="$formatted_path"
8980     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib"; then
8981         HAVE_DIRECTXSDK_LIB="yes"
8982     else
8983         HAVE_DIRECTXSDK_LIB="no"
8984     fi
8986     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
8987         AC_MSG_RESULT([found])
8988     else
8989         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
8990     fi
8991     PathFormat "$DIRECTXSDK_HOME"
8992     DIRECTXSDK_HOME="$formatted_path"
8993     SOLARINC="$SOLARINC -I$DIRECTXSDK_HOME/include"
8995 AC_SUBST(DIRECTXSDK_HOME)
8996 AC_SUBST(DIRECTXSDK_LIB)
8998 dnl ***************************************
8999 dnl Checking for bison and flex
9000 dnl ***************************************
9001 AC_PATH_PROG(BISON, bison)
9002 ANCIENT_BISON="NO"
9003 if test -z "$BISON"; then
9004     AC_MSG_ERROR([no bison found in \$PATH, install it])
9005 else
9006     AC_MSG_CHECKING([the bison version])
9007     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9008     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9009     # Accept newer than 1.875 or older(equal) than 1.75
9010     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
9011         if test "$_bison_version" = "1.875"; then
9012             AC_MSG_WARN([suspect ($BISON $_bison_version)])
9013             add_warning "Suspect ($BISON $_bison_version) suggest upgrade"
9014         else
9015             AC_MSG_RESULT([checked ($BISON $_bison_version)])
9016         fi
9017     else
9018         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
9019     fi
9020     if test "$_bison_longver" -lt 2000; then
9021         ANCIENT_BISON="YES"
9022     fi
9024 AC_SUBST(ANCIENT_BISON)
9026 AC_PATH_PROG(FLEX, flex)
9027 if test -z "$FLEX"; then
9028     AC_MSG_ERROR([no flex found in \$PATH, install it])
9030 AC_SUBST([FLEX])
9031 dnl ***************************************
9032 dnl Checking for patch
9033 dnl ***************************************
9034 AC_PATH_PROG(PATCH, patch)
9035 if test -z "$PATCH"; then
9036     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
9039 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9040 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9041     if test -z "$with_gnu_patch"; then
9042         GNUPATCH=$PATCH
9043     else
9044         if test -x "$with_gnu_patch"; then
9045             GNUPATCH=$with_gnu_patch
9046         else
9047             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9048         fi
9049     fi
9051     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9052     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9053         AC_MSG_RESULT([yes])
9054     else
9055         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9056     fi
9057 else
9058     GNUPATCH=$PATCH
9061 dnl We also need to check for --with-gnu-cp
9063 if test -z "$with_gnu_cp"; then
9064     # check the place where the good stuff is hidden on Solaris...
9065     if test -x /usr/gnu/bin/cp; then
9066         GNUCP=/usr/gnu/bin/cp
9067     else
9068         AC_PATH_PROGS(GNUCP, gnucp cp)
9069     fi
9070     if test -z $GNUCP; then
9071         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9072     fi
9073 else
9074     if test -x "$with_gnu_cp"; then
9075         GNUCP=$with_gnu_cp
9076     else
9077         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9078     fi
9081 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9082 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9083     AC_MSG_RESULT([yes])
9084 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9085     AC_MSG_RESULT([yes])
9086 else
9087     case "$build_os" in
9088     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9089         x_GNUCP=[\#]
9090         GNUCP=''
9091         AC_MSG_RESULT([no gnucp found - using the system's cp command])
9092         ;;
9093     *)
9094         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9095         ;;
9096     esac
9099 AC_SUBST(GNUPATCH)
9100 AC_SUBST(GNUCP)
9101 AC_SUBST(x_GNUCP)
9103 dnl ***************************************
9104 dnl testing assembler path
9105 dnl ***************************************
9106 ML_EXE=""
9107 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
9108     if test "$BITNESS_OVERRIDE" = ""; then
9109         assembler=ml.exe
9110         assembler_bin=bin
9111     else
9112         assembler=ml64.exe
9113         assembler_bin=bin/amd64
9114     fi
9115     if test -n "$with_asm_home"; then
9116         with_asm_home=`cygpath -u "$with_asm_home"`
9117     fi
9118     if test -x "$with_asm_home/$assembler"; then
9119         AC_MSG_CHECKING([$assembler assembler path])
9120         AC_MSG_RESULT([$with_asm_home/$assembler])
9121         ML_EXE="$with_asm_home/$assembler"
9122     else
9123         AC_PATH_PROG(ML_EXE, $assembler)
9124         if test -z "$ML_EXE"; then
9125             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
9126             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
9127                 with_asm_home=$with_cl_home/$assembler_bin
9128                 AC_MSG_RESULT([found])
9129                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
9130             else
9131                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9132             fi
9133         else
9134             with_asm_home="ASM_IN_PATH"
9135             ML_EXE="$assembler"
9136         fi
9137     fi
9138     PathFormat "$with_asm_home"
9139     ASM_HOME="$formatted_path"
9140 else
9141     ASM_HOME=""
9144 AC_SUBST(ML_EXE)
9146 dnl ===================================================================
9147 dnl We need zip and unzip
9148 dnl ===================================================================
9149 AC_PATH_PROG(ZIP, zip)
9150 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9151 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9152     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],,)
9155 AC_PATH_PROG(UNZIP, unzip)
9156 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9158 dnl ===================================================================
9159 dnl Zip must be a specific type for different build types.
9160 dnl ===================================================================
9161 if test $build_os = cygwin; then
9162     if test -n "`$ZIP -h | $GREP -i WinNT`"; then
9163         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
9164     fi
9167 dnl ===================================================================
9168 dnl Test which vclplugs have to be built.
9169 dnl ===================================================================
9170 R=""
9171 GTK3_CFLAGS=""
9172 GTK3_LIBS=""
9173 ENABLE_GTK3=""
9174 if test "x$enable_gtk3" = "xyes"; then
9175     if test "$with_system_cairo" != yes; then
9176         AC_MSG_WARN([System cairo required for gtk3 support, please use --with-system-cairo])
9177         add_warning "System cairo required for gtk3 support, please use --with-system-cairo"
9178     fi
9179     PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 gtk+-unix-print-3.0 gmodule-no-export-2.0 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
9180     if test "x$ENABLE_GTK3" = "xTRUE"; then
9181         R="gtk3"
9182     else
9183         AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
9184     fi
9186 AC_SUBST(GTK3_LIBS)
9187 AC_SUBST(GTK3_CFLAGS)
9188 AC_SUBST(ENABLE_GTK3)
9190 AC_MSG_CHECKING([which VCLplugs shall be built])
9191 if test "$GUIBASE" != "unx" -o "$enable_headless" = "yes"; then
9192     enable_gtk=no
9194 ENABLE_GTK=""
9195 if test "x$enable_gtk" = "xyes"; then
9196     ENABLE_GTK="TRUE"
9197     R="gtk $R"
9199 AC_SUBST(ENABLE_GTK)
9201 ENABLE_TDE=""
9202 if test "x$enable_tde" = "xyes"; then
9203     # Libs kab and tdeab in connectivity and kdeab and tdeab in shell
9204     # are built from the same sources. So we only allow one of them.
9205     if test "x$enable_kde" = "xyes"; then
9206         AC_MSG_ERROR([enabling both KDE and TDE is not supported])
9207     fi
9208     ENABLE_TDE="TRUE"
9209     R="$R tde"
9211 AC_SUBST(ENABLE_TDE)
9213 ENABLE_KDE=""
9214 if test "x$enable_kde" = "xyes"; then
9215     ENABLE_KDE="TRUE"
9216     R="$R kde"
9218 AC_SUBST(ENABLE_KDE)
9220 ENABLE_KDE4=""
9221 if test "x$enable_kde4" = "xyes"; then
9222     ENABLE_KDE4="TRUE"
9223     R="$R kde4"
9225 AC_SUBST(ENABLE_KDE4)
9227 ENABLE_HEADLESS=""
9228 if test "x$enable_headless" = "xyes"; then
9229     ENABLE_HEADLESS="TRUE"
9230     SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
9231     R="headless"
9233 AC_SUBST(ENABLE_HEADLESS)
9235 if test -z "$R"; then
9236     AC_MSG_RESULT([none])
9237 else
9238     AC_MSG_RESULT([$R])
9241 dnl ===================================================================
9242 dnl GCONF check
9243 dnl ===================================================================
9245 ENABLE_GCONF=""
9246 AC_MSG_CHECKING([whether to enable GConf support])
9247 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
9248     ENABLE_GCONF="TRUE"
9249     AC_MSG_RESULT([yes])
9250     PKG_CHECK_MODULES( GCONF, gconf-2.0 gobject-2.0 )
9251 else
9252     AC_MSG_RESULT([no])
9254 AC_SUBST(GCONF_LIBS)
9255 AC_SUBST(GCONF_CFLAGS)
9256 AC_SUBST(ENABLE_GCONF)
9258 dnl ===================================================================
9259 dnl Gnome VFS check
9260 dnl ===================================================================
9262 ENABLE_GNOMEVFS=""
9263 AC_MSG_CHECKING([whether to enable GNOME VFS support])
9264 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
9265     ENABLE_GNOMEVFS="TRUE"
9266     AC_MSG_RESULT([yes])
9267     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
9268 else
9269     AC_MSG_RESULT([no])
9271 AC_SUBST(GNOMEVFS_LIBS)
9272 AC_SUBST(GNOMEVFS_CFLAGS)
9273 AC_SUBST(ENABLE_GNOMEVFS)
9275 dnl ===================================================================
9276 dnl check for dbus support
9277 dnl ===================================================================
9278 ENABLE_DBUS=""
9279 DBUS_CFLAGS=""
9280 DBUS_LIBS=""
9282 if test "$enable_dbus" = "no"; then
9283     test_dbus=no
9286 AC_MSG_CHECKING([whether to enable DBUS support])
9287 if test "$test_dbus" = "yes"; then
9288     ENABLE_DBUS="TRUE"
9289     AC_MSG_RESULT([yes])
9290     PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
9291 else
9292     AC_MSG_RESULT([no])
9295 AC_SUBST(ENABLE_DBUS)
9296 AC_SUBST(DBUS_CFLAGS)
9297 AC_SUBST(DBUS_LIBS)
9299 AC_MSG_CHECKING([whether to enable font install via packagekit])
9300 if test "$ENABLE_DBUS" = "TRUE"; then
9301     if test -n "$enable_packagekit" -a "$enable_packagekit" != "no"; then
9302         ENABLE_PACKAGEKIT=YES
9303         AC_MSG_RESULT([yes])
9304     else
9305         ENABLE_PACKAGEKIT=NO
9306         AC_MSG_RESULT([no])
9307     fi
9308 else
9309     AC_MSG_RESULT([no, dbus disabled.])
9311 AC_SUBST(ENABLE_PACKAGEKIT)
9313 AC_MSG_CHECKING([whether to enable Impress remote control])
9314 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
9315     AC_MSG_RESULT([yes])
9316     ENABLE_SDREMOTE=YES
9317     AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
9319     # If not explicitly enabled or disabled, default
9320     if test -z "$enable_sdremote_bluetooth"; then
9321         case "$OS" in
9322         LINUX|MACOSX|WNT)
9323             # Default to yes for these
9324             enable_sdremote_bluetooth=yes
9325             ;;
9326         *)
9327             # otherwise no
9328             enable_sdremote_bluetooth=no
9329             ;;
9330         esac
9331     fi
9332     # $enable_sdremote_bluetooth is guaranteed non-empty now
9334     if test "$enable_sdremote_bluetooth" != "no"; then
9335         if test "$OS" = "LINUX"; then
9336             if test "$ENABLE_DBUS" = "TRUE"; then
9337                 AC_MSG_RESULT([yes])
9338                 ENABLE_SDREMOTE_BLUETOOTH=YES
9339                 dnl ===================================================================
9340                 dnl Check for system bluez
9341                 dnl ===================================================================
9342                 AC_MSG_CHECKING([which Bluetooth header to use])
9343                 if test "$with_system_bluez" = "yes"; then
9344                     AC_MSG_RESULT([external])
9345                     AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
9346                         [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
9347                 else
9348                     AC_MSG_RESULT([internal])
9349                     BUILD_TYPE="$BUILD_TYPE BLUEZ"
9350                 fi
9351             else
9352                 AC_MSG_RESULT([no, dbus disabled])
9353                 ENABLE_SDREMOTE_BLUETOOTH=NO
9354             fi
9355         else
9356             AC_MSG_RESULT([yes])
9357             ENABLE_SDREMOTE_BLUETOOTH=YES
9358         fi
9359     else
9360         AC_MSG_RESULT([no])
9361         ENABLE_SDREMOTE_BLUETOOTH=NO
9362     fi
9363 else
9364     ENABLE_SDREMOTE=NO
9365     AC_MSG_RESULT([no])
9367 AC_SUBST(ENABLE_SDREMOTE)
9368 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
9370 dnl ===================================================================
9371 dnl Check whether the gtk 2.0 libraries are available.
9372 dnl ===================================================================
9374 GTK_CFLAGS=""
9375 GTK_LIBS=""
9376 ENABLE_SYSTRAY_GTK=""
9377 if test  "$test_gtk" = "yes"; then
9379     if test "$ENABLE_GTK" = "TRUE"; then
9380         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
9381         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]))
9382         BUILD_TYPE="$BUILD_TYPE GTK"
9384     AC_MSG_CHECKING([whether to enable the systray quickstarter])
9385         if test "x$enable_systray" = "xyes"; then
9386         AC_MSG_RESULT([yes])
9387             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
9388                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
9389                             [ ENABLE_SYSTRAY_GTK="" ])
9390         else
9391         AC_MSG_RESULT([no])
9392         fi
9394         AC_MSG_CHECKING([whether to enable Gtk print dialog support])
9395         PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
9396                           [ENABLE_GTK_PRINT="TRUE"],
9397                           [ENABLE_GTK_PRINT=""])
9399         AC_MSG_CHECKING([whether to enable GIO support])
9400         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
9401             if test "$ENABLE_GNOMEVFS" = "TRUE"; then
9402                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
9403             fi
9404             ENABLE_GIO="TRUE"
9405             AC_MSG_RESULT([yes])
9406             PKG_CHECK_MODULES( GIO, gio-2.0 )
9407         else
9408             AC_MSG_RESULT([no])
9409         fi
9410     fi
9412 AC_SUBST(ENABLE_GIO)
9413 AC_SUBST(GIO_CFLAGS)
9414 AC_SUBST(GIO_LIBS)
9415 AC_SUBST(ENABLE_SYSTRAY_GTK)
9416 AC_SUBST(GTK_CFLAGS)
9417 AC_SUBST(GTK_LIBS)
9418 AC_SUBST(GTHREAD_CFLAGS)
9419 AC_SUBST(GTHREAD_LIBS)
9420 AC_SUBST([ENABLE_GTK_PRINT])
9421 AC_SUBST([GTK_PRINT_CFLAGS])
9422 AC_SUBST([GTK_PRINT_LIBS])
9425 dnl ===================================================================
9426 dnl Check whether the Telepathy libraries are available.
9427 dnl ===================================================================
9429 ENABLE_TELEPATHY=""
9430 TELEPATHY_CFLAGS=""
9431 TELEPATHY_LIBS=""
9433 AC_MSG_CHECKING([whether to enable Telepathy support])
9434 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
9435     ENABLE_TELEPATHY="TRUE"
9436     AC_MSG_RESULT([yes])
9437     PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 )
9438 else
9439     AC_MSG_RESULT([no])
9442 AC_SUBST(ENABLE_TELEPATHY)
9443 AC_SUBST(TELEPATHY_CFLAGS)
9444 AC_SUBST(TELEPATHY_LIBS)
9447 dnl ===================================================================
9449 PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
9450 AC_SUBST(LIBPNG_LIBS)
9451 AC_SUBST(LIBPNG_CFLAGS)
9453 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
9454 if test "x$enable_unix_qstart_libpng" != "xno"; then
9455     AC_MSG_RESULT([yes])
9456 else
9457     AC_MSG_RESULT([no])
9458     ENABLE_QUICKSTART_LIBPNG=""
9460 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
9462 SPLIT_APP_MODULES=""
9463 if test "$enable_split_app_modules" = "yes"; then
9464     SPLIT_APP_MODULES="YES"
9466 AC_SUBST(SPLIT_APP_MODULES)
9468 SPLIT_OPT_FEATURES=""
9469 if test "$enable_split_opt_features" = "yes"; then
9470     SPLIT_OPT_FEATURES="YES"
9472 AC_SUBST(SPLIT_OPT_FEATURES)
9474 if test $_os = Darwin -o $_os = WINNT; then
9475     if test "$enable_cairo_canvas" = yes; then
9476         AC_MSG_ERROR([The cairo canvas should not be used for this platform])
9477     fi
9478     enable_cairo_canvas=no
9479 elif test -z "$enable_cairo_canvas"; then
9480     enable_cairo_canvas=yes
9483 ENABLE_CAIRO_CANVAS=""
9484 if test "$enable_cairo_canvas" = "yes"; then
9485     test_cairo=yes
9486     ENABLE_CAIRO_CANVAS="TRUE"
9488 AC_SUBST(ENABLE_CAIRO_CANVAS)
9490 dnl ===================================================================
9491 dnl Check whether the GStreamer libraries are available.
9492 dnl ===================================================================
9494 ENABLE_GSTREAMER=""
9496 if test "$build_gstreamer" = "yes"; then
9498     AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
9499     if test "x$enable_gstreamer" != "xno"; then
9500         ENABLE_GSTREAMER="TRUE"
9501         AC_MSG_RESULT([yes])
9502         PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
9503     else
9504         AC_MSG_RESULT([no])
9505     fi
9507 AC_SUBST(GSTREAMER_CFLAGS)
9508 AC_SUBST(GSTREAMER_LIBS)
9509 AC_SUBST(ENABLE_GSTREAMER)
9512 ENABLE_GSTREAMER_0_10=""
9513 if test "$build_gstreamer_0_10" = "yes"; then
9515     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
9516     if test "x$enable_gstreamer_0_10" != "xno"; then
9517         ENABLE_GSTREAMER_0_10="TRUE"
9518         AC_MSG_RESULT([yes])
9519         PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
9520             PKG_CHECK_MODULES(  [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10] )
9521         ])
9522     else
9523         AC_MSG_RESULT([no])
9524     fi
9527 AC_SUBST(GSTREAMER_0_10_CFLAGS)
9528 AC_SUBST(GSTREAMER_0_10_LIBS)
9529 AC_SUBST(ENABLE_GSTREAMER_0_10)
9531 dnl ===================================================================
9532 dnl Check whether the OpenGL libraries are available
9533 dnl ===================================================================
9535 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
9536 ENABLE_OPENGL=
9538 if test "$_os" = "Darwin"; then
9539     # We use frameworks on Mac OS X, no need for detail checks
9540     ENABLE_OPENGL=TRUE
9541     SYSTEM_MESA_HEADERS=YES
9542     AC_MSG_RESULT([yes])
9543 else
9544     if test "x$enable_opengl" != "xno"; then
9545         if test "$_os" != "WINNT"; then
9546             save_LDFLAGS=$LDFLAGS
9547             LDFLAGS="$LDFLAGS -lm"
9548             AC_MSG_RESULT([yes])
9549             AC_CHECK_LIB([GL], [main], [:],
9550                       [AC_MSG_ERROR(libGL not installed or functional)], [])
9551             AC_CHECK_LIB([GLU], [main], [:],
9552                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
9553             ENABLE_OPENGL=TRUE
9554             LDFLAGS=$save_LDFLAGS
9556             dnl ===================================================================
9557             dnl Check for system Mesa
9558             dnl ===================================================================
9559             AC_MSG_CHECKING([which Mesa headers to use])
9560             if test "$with_system_mesa_headers" = "yes"; then
9561                 AC_MSG_RESULT([external])
9562                 SYSTEM_MESA_HEADERS=YES
9563                 AC_LANG_PUSH(C)
9564                 AC_CHECK_HEADER(GL/glxext.h, [],
9565                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
9566                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
9567                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
9568                 AC_LANG_POP(C)
9569             else
9570                 AC_MSG_RESULT([internal])
9571                 SYSTEM_MESA_HEADERS=NO
9572                 BUILD_TYPE="$BUILD_TYPE MESA"
9573             fi
9574         else
9575             AC_MSG_RESULT([not on Windows])
9576         fi
9577     else
9578        AC_MSG_RESULT([no])
9579     fi
9582 AC_SUBST(SYSTEM_MESA_HEADERS)
9583 AC_SUBST(ENABLE_OPENGL)
9585 # presenter minimizer extension?
9586 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
9587 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
9588    AC_MSG_RESULT([yes])
9589    ENABLE_MINIMIZER=YES
9590 else
9591    AC_MSG_RESULT([no])
9592    ENABLE_MINIMIZER=NO
9593    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
9595 AC_SUBST(ENABLE_MINIMIZER)
9597 # pdf import?
9598 AC_MSG_CHECKING([whether to build the PDF import])
9599 if test "$_os" != Android -a "$_os" != iOS -a "$ENABLE_PDFIMPORT" != FALSE; then
9600   AC_MSG_RESULT([yes])
9601   ENABLE_PDFIMPORT=TRUE
9603   dnl ===================================================================
9604   dnl Check for system poppler
9605   dnl ===================================================================
9606   AC_MSG_CHECKING([which pdf backend to use])
9607   if test "$with_system_poppler" = "yes"; then
9608       AC_MSG_RESULT([external])
9609       SYSTEM_POPPLER=YES
9610       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
9611       AC_LANG_PUSH([C++])
9612       save_CXXFLAGS=$CXXFLAGS
9613       save_CPPFLAGS=$CPPFLAGS
9614       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
9615       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
9616       AC_CHECK_HEADER([cpp/poppler-version.h], [],
9617                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
9618       CXXFLAGS=$save_CXXFLAGS
9619       CPPFLAGS=$save_CPPFLAGS
9620       AC_LANG_POP([C++])
9621       libo_MINGW_CHECK_DLL([POPPLER], [libpoppler])
9622   else
9623       AC_MSG_RESULT([internal])
9624       SYSTEM_POPPLER=NO
9625       BUILD_TYPE="$BUILD_TYPE XPDF"
9626   fi
9627 else
9628   AC_MSG_RESULT([no])
9629   ENABLE_PDFIMPORT=FALSE
9631 AC_SUBST(ENABLE_PDFIMPORT)
9632 AC_SUBST(SYSTEM_POPPLER)
9633 AC_SUBST(POPPLER_CFLAGS)
9634 AC_SUBST(POPPLER_LIBS)
9635 AC_SUBST([MINGW_POPPLER_DLL])
9637 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
9638 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9639   AC_MSG_RESULT([yes])
9640   ENABLE_MEDIAWIKI=YES
9641   BUILD_TYPE="$BUILD_TYPE XSLTML"
9642   if test  "x$with_java" = "xno"; then
9643     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
9644   fi
9645 else
9646   AC_MSG_RESULT([no])
9647   ENABLE_MEDIAWIKI=NO
9648   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
9650 AC_SUBST(ENABLE_MEDIAWIKI)
9652 if test "$ENABLE_MEDIAWIKI" = "YES"; then
9653     AC_MSG_CHECKING([which Servlet API Jar to use])
9654     if test "$with_system_servlet_api" = "yes"; then
9655         AC_MSG_RESULT([external])
9656         SYSTEM_SERVLETAPI=YES
9657         if test -z "$SERVLETAPI_JAR"; then
9658             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
9659         fi
9660         AC_CHECK_FILE($SERVLETAPI_JAR, [],
9661               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
9662     else
9663         AC_MSG_RESULT([internal])
9664         SYSTEM_SERVLETAPI=NO
9665         BUILD_TYPE="$BUILD_TYPE TOMCAT"
9666     fi
9668 AC_SUBST(SYSTEM_SERVLETAPI)
9669 AC_SUBST(SERVLETAPI_JAR)
9671 AC_MSG_CHECKING([whether to build the Report Builder extension])
9672 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9673     AC_MSG_RESULT([yes])
9674     ENABLE_REPORTBUILDER=YES
9675     AC_MSG_CHECKING([which jfreereport libs to use])
9676     if test "$with_system_jfreereport" = "yes"; then
9677         SYSTEM_JFREEREPORT=YES
9678         AC_MSG_RESULT([external])
9679         if test -z $SAC_JAR; then
9680             SAC_JAR=/usr/share/java/sac.jar
9681         fi
9682         AC_CHECK_FILE($SAC_JAR, [],
9683              [AC_MSG_ERROR(sac.jar not found.)], [])
9685         if test -z $LIBXML_JAR; then
9686             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
9687                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
9688                 [
9689                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
9690                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
9691                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
9692                     )
9693                 ]
9694             )
9695         else
9696             AC_CHECK_FILE($LIBXML_JAR, [],
9697                  [AC_MSG_ERROR(libxml.jar not found.)], [])
9698         fi
9700         if test -z $FLUTE_JAR; then
9701             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
9702                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
9703                 [
9704                     AC_CHECK_FILE(/usr/share/java/flute.jar,
9705                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
9706                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
9707                     )
9708                 ]
9709             )
9710         else
9711             AC_CHECK_FILE($FLUTE_JAR, [],
9712                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
9713         fi
9715         if test -z $JFREEREPORT_JAR; then
9716             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
9717                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
9718                 [
9719                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
9720                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
9721                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
9722                     )
9723                 ]
9724             )
9725         else
9726             AC_CHECK_FILE($JFREEREPORT_JAR, [],
9727                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
9728         fi
9730         if test -z $LIBLAYOUT_JAR; then
9731             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
9732                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
9733                 [
9734                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
9735                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
9736                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
9737                     )
9738                 ]
9739             )
9740         else
9741             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
9742                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
9743         fi
9745         if test -z $LIBLOADER_JAR; then
9746             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
9747                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
9748                 [
9749                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
9750                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
9751                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
9752                     )
9753                 ]
9754             )
9755         else
9756             AC_CHECK_FILE($LIBLOADER_JAR, [],
9757                 [AC_MSG_ERROR(libloader.jar not found.)], [])
9758         fi
9760         if test -z $LIBFORMULA_JAR; then
9761             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
9762                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
9763                  [
9764                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
9765                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
9766                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
9767                      )
9768                  ]
9769             )
9770         else
9771             AC_CHECK_FILE($LIBFORMULA_JAR, [],
9772                 [AC_MSG_ERROR(libformula.jar not found.)], [])
9773         fi
9775         if test -z $LIBREPOSITORY_JAR; then
9776             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
9777                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
9778                 [
9779                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
9780                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
9781                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
9782                     )
9783                 ]
9784             )
9785         else
9786             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
9787                 [AC_MSG_ERROR(librepository.jar not found.)], [])
9788         fi
9790         if test -z $LIBFONTS_JAR; then
9791             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
9792                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
9793                 [
9794                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
9795                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
9796                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
9797                     )
9798                 ]
9799             )
9800         else
9801             AC_CHECK_FILE($LIBFONTS_JAR, [],
9802                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
9803         fi
9805         if test -z $LIBSERIALIZER_JAR; then
9806             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
9807                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
9808                 [
9809                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
9810                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
9811                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
9812                     )
9813                 ]
9814             )
9815         else
9816             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
9817                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
9818         fi
9820         if test -z $LIBBASE_JAR; then
9821             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
9822                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
9823                 [
9824                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
9825                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
9826                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
9827                     )
9828                 ]
9829             )
9830         else
9831             AC_CHECK_FILE($LIBBASE_JAR, [],
9832                 [AC_MSG_ERROR(libbase.jar not found.)], [])
9833         fi
9835     else
9836         AC_MSG_RESULT([internal])
9837         SYSTEM_JFREEREPORT=NO
9838         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
9839     fi
9840 else
9841     AC_MSG_RESULT([no])
9842     ENABLE_REPORTBUILDER=NO
9843     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
9844     SYSTEM_JFREEREPORT=NO
9846 AC_SUBST(ENABLE_REPORTBUILDER)
9847 AC_SUBST(SYSTEM_JFREEREPORT)
9848 AC_SUBST(SAC_JAR)
9849 AC_SUBST(LIBXML_JAR)
9850 AC_SUBST(FLUTE_JAR)
9851 AC_SUBST(JFREEREPORT_JAR)
9852 AC_SUBST(LIBBASE_JAR)
9853 AC_SUBST(LIBLAYOUT_JAR)
9854 AC_SUBST(LIBLOADER_JAR)
9855 AC_SUBST(LIBFORMULA_JAR)
9856 AC_SUBST(LIBREPOSITORY_JAR)
9857 AC_SUBST(LIBFONTS_JAR)
9858 AC_SUBST(LIBSERIALIZER_JAR)
9860 # this has to be here because both the Wiki Publisher and the SRB use
9861 # commons-logging
9862 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
9863     AC_MSG_CHECKING([which Apache commons-* libs to use])
9864     if test "$with_system_apache_commons" = "yes"; then
9865         SYSTEM_APACHE_COMMONS=YES
9866         AC_MSG_RESULT([external])
9867         if test "$ENABLE_MEDIAWIKI" = "YES"; then
9868             if test -z $COMMONS_CODEC_JAR; then
9869                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
9870                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
9871                     [
9872                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
9873                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
9874                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
9875                         )
9876                     ]
9877                 )
9878             else
9879                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
9880                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
9881             fi
9883             if test -z $COMMONS_LANG_JAR; then
9884                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
9885                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
9886                     [
9887                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
9888                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
9889                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
9890                             )
9891                     ]
9892                 )
9893             else
9894                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
9895                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
9896             fi
9898             if test -z $COMMONS_HTTPCLIENT_JAR; then
9899                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
9900                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
9901                     [
9902                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
9903                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
9904                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
9905                         )
9906                     ]
9907                 )
9908             else
9909                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
9910                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
9911             fi
9912         fi
9913         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
9914             if test -z $COMMONS_LOGGING_JAR; then
9915                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
9916                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
9917                    [
9918                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
9919                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
9920                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
9921                         )
9922                     ]
9923                 )
9924             else
9925                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
9926                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
9927             fi
9928         fi
9929     else
9930         AC_MSG_RESULT([internal])
9931         SYSTEM_APACHE_COMMONS=NO
9932         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
9933     fi
9935 AC_SUBST(SYSTEM_APACHE_COMMONS)
9936 AC_SUBST(COMMONS_CODEC_JAR)
9937 AC_SUBST(COMMONS_LANG_JAR)
9938 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
9939 AC_SUBST(COMMONS_LOGGING_JAR)
9941 # scripting provider for BeanShell?
9942 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
9943 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
9944    AC_MSG_RESULT([yes])
9945    ENABLE_SCRIPTING_BEANSHELL=YES
9947    dnl ===================================================================
9948    dnl Check for system beanshell
9949    dnl ===================================================================
9950    AC_MSG_CHECKING([which beanshell to use])
9951    if test "$with_system_beanshell" = "yes"; then
9952        AC_MSG_RESULT([external])
9953        SYSTEM_BSH=YES
9954        if test -z $BSH_JAR; then
9955            BSH_JAR=/usr/share/java/bsh.jar
9956        fi
9957        AC_CHECK_FILE($BSH_JAR, [],
9958                   [AC_MSG_ERROR(bsh.jar not found.)], [])
9959    else
9960        AC_MSG_RESULT([internal])
9961        SYSTEM_BSH=NO
9962        BUILD_TYPE="$BUILD_TYPE BSH"
9963    fi
9964 else
9965    AC_MSG_RESULT([no])
9966    ENABLE_SCRIPTING_BEANSHELL=NO
9967    SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
9969 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
9970 AC_SUBST(SYSTEM_BSH)
9971 AC_SUBST(BSH_JAR)
9973 # scripting provider for JavaScript?
9974 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
9975 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
9976    AC_MSG_RESULT([yes])
9977    ENABLE_SCRIPTING_JAVASCRIPT=YES
9979    dnl ===================================================================
9980    dnl Check for system rhino
9981    dnl ===================================================================
9982    AC_MSG_CHECKING([which rhino to use])
9983    if test "$with_system_rhino" = "yes"; then
9984        AC_MSG_RESULT([external])
9985        SYSTEM_RHINO=YES
9986        if test -z $RHINO_JAR; then
9987            RHINO_JAR=/usr/share/java/js.jar
9988        fi
9989        AC_CHECK_FILE($RHINO_JAR, [],
9990                   [AC_MSG_ERROR(js.jar not found.)], [])
9991    else
9992        AC_MSG_RESULT([internal])
9993        SYSTEM_RHINO=NO
9994        BUILD_TYPE="$BUILD_TYPE RHINO"
9995    fi
9996 else
9997    AC_MSG_RESULT([no])
9998    ENABLE_SCRIPTING_JAVASCRIPT=NO
9999    SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10001 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10002 AC_SUBST(SYSTEM_RHINO)
10003 AC_SUBST(RHINO_JAR)
10005 dnl Scripting provider for Python extension?
10006 dnl We always provide this unless we have disabled Python completely
10007 if test $enable_python = no; then
10008     ENABLE_SCRIPTING_PYTHON=NO
10009     SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_PYTHON"
10010 else
10011     ENABLE_SCRIPTING_PYTHON=YES
10013 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
10015 supports_multilib=
10016 case "$host_cpu" in
10017 x86_64 | powerpc64 | s390x)
10018     if test "$SIZEOF_LONG" = "8"; then
10019         supports_multilib="yes"
10020     fi
10021     ;;
10023     ;;
10024 esac
10026 dnl ===================================================================
10027 dnl Check whether the TQt and TDE libraries are available.
10028 dnl ===================================================================
10030 TDE_CFLAGS=""
10031 TDE_LIBS=""
10032 if test "$_os" != "OpenBSD"; then
10033     MOC="moc"
10035 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
10036     dnl Search paths for TQt and TDE
10037     if test -z "$supports_multilib"; then
10038         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"
10039         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"
10040     else
10041         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"
10042         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"
10043     fi
10044     if test -n "$TQTDIR"; then
10045         tqt_incdirs="$TQTDIR/include $tqt_incdirs"
10046         if test -z "$supports_multilib"; then
10047             tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
10048         else
10049             tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
10050         fi
10051     fi
10052     if test -z "$supports_multilib"; then
10053         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"
10054         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"
10055     else
10056         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"
10057         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"
10058     fi
10059     if test -n "$TDEDIR"; then
10060         tde_incdirs="$TDEDIR/include $tde_incdirs"
10061         if test -z "$supports_multilib"; then
10062             tde_libdirs="$TDEDIR/lib $tde_libdirs"
10063         else
10064             tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
10065         fi
10066     fi
10068     dnl What to test
10069     tqt_test_include="ntqstyle.h"
10070     tde_test_include="kapp.h"
10072     if test "$_os" != "OpenBSD"; then
10073         tqt_test_library="libtqt-mt.so"
10074         tde_test_library="libDCOP.so"
10075     else
10076         tqt_test_library="libtqt-mt.so*"
10077         tde_test_library="libDCOP.so*"
10078     fi
10080     dnl Check for TQt headers
10081     AC_MSG_CHECKING([for TQt headers])
10082     tqt_incdir="no"
10083     for tde_check in $tqt_incdirs; do
10084         if test -r "$tde_check/$tqt_test_include"; then
10085             tqt_incdir="$tde_check"
10086             break
10087         fi
10088     done
10089     AC_MSG_RESULT([$tqt_incdir])
10090     if test "x$tqt_incdir" = "xno"; then
10091         AC_MSG_ERROR([TQt headers not found.  Please specify the root of
10092 your TQt installation by exporting TQTDIR before running "configure".])
10093     fi
10095     dnl Check for TQt libraries
10096     AC_MSG_CHECKING([for TQt libraries])
10097     tqt_libdir="no"
10098     for tqt_check in $tqt_libdirs; do
10099         if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
10100             tqt_libdir="$tqt_check"
10101             break
10102         fi
10103     done
10104     AC_MSG_RESULT([$tqt_libdir])
10105     if test "x$tqt_libdir" = "xno"; then
10106         AC_MSG_ERROR([TQt libraries not found.  Please specify the root of
10107 your TQt installation by exporting TQTDIR before running "configure".])
10108     fi
10110     dnl Check for Meta Object Compiler
10111     AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
10112     if test "$MOC" = "no"; then
10113         AC_MSG_ERROR([TQt Meta Object Compiler not found.  Please specify
10114 the root of your TQt installation by exporting TQTDIR before running "configure".])
10115     fi
10117     dnl Check for TDE headers
10118     AC_MSG_CHECKING([for TDE headers])
10119     tde_incdir="no"
10120     for tde_check in $tde_incdirs; do
10121         if test -r "$tde_check/$tde_test_include"; then
10122             tde_incdir="$tde_check"
10123             break
10124         fi
10125     done
10126     AC_MSG_RESULT([$tde_incdir])
10127     if test "x$tde_incdir" = "xno"; then
10128         AC_MSG_ERROR([TDE headers not found.  Please specify the root of
10129 your TDE installation by exporting TDEDIR before running "configure".])
10130     fi
10132     dnl Check for TDE libraries
10133     AC_MSG_CHECKING([for TDE libraries])
10134     tde_libdir="no"
10135     for tde_check in $tde_libdirs; do
10136         if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
10137             tde_libdir="$tde_check"
10138             break
10139         fi
10140     done
10141     AC_MSG_RESULT([$tde_libdir])
10142     if test "x$tde_libdir" = "xno"; then
10143         AC_MSG_ERROR([TDE libraries not found.  Please specify the root of
10144 your TDE installation by exporting TDEDIR before running "configure".])
10145     fi
10147     dnl Set the variables
10148     TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10149     TDE_LIBS="-L$tde_libdir -L$tqt_libdir -lkio -ltdeui -ltdecore -ltqt -ltqt-mt"
10151 AC_SUBST(TDE_CFLAGS)
10152 AC_SUBST(TDE_LIBS)
10153 AC_SUBST(MOC)
10155 dnl ===================================================================
10156 dnl Check whether the Qt3 and KDE3 libraries are available.
10157 dnl ===================================================================
10159 KDE_CFLAGS=""
10160 KDE_LIBS=""
10161 if test "$_os" != "OpenBSD"; then
10162     MOC="moc"
10164 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE"; then
10165     dnl Search paths for Qt3 and KDE3
10166     if test -z "$supports_multilib"; then
10167         qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt3/include /usr/lib/qt/include /usr/share/qt3/include /usr/local/include/X11/qt3 $x_includes"
10168         qt_libdirs="$QTLIB /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib /usr/local/lib/qt3 $x_libraries"
10169     else
10170         qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib64/qt3/include /usr/lib64/qt/include /usr/share/qt3/include /usr/lib/qt3/include /usr/lib/qt/include /usr/local/include/X11/qt3 $x_includes"
10171         qt_libdirs="$QTLIB /usr/local/qt/lib64 /usr/lib64/qt /usr/lib64 /usr/X11R6/lib64/X11/qt /usr/X11R6/lib64/qt /usr/lib64/qt3/lib64 /usr/lib64/qt/lib64 /usr/share/qt3/lib64 /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib /usr/local/lib/qt3 $x_libraries"
10172     fi
10173     if test -n "$QTDIR"; then
10174         qt_incdirs="$QTDIR/include $qt_incdirs"
10175         if test -z "$supports_multilib"; then
10176             qt_libdirs="$QTDIR/lib $qt_libdirs"
10177         else
10178             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
10179         fi
10180     fi
10181     if test -z "$supports_multilib"; then
10182         kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
10183         kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib $x_libraries"
10184     else
10185         kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
10186         kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib64 $x_libraries"
10187     fi
10188     if test -n "$KDEDIR"; then
10189         kde_incdirs="$KDEDIR/include $kde_incdirs"
10190         if test -z "$supports_multilib"; then
10191             kde_libdirs="$KDEDIR/lib $kde_libdirs"
10192         else
10193             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
10194         fi
10195     fi
10197     dnl What to test
10198     qt_test_include="qstyle.h"
10199     kde_test_include="kapp.h"
10201     if test "$_os" != "OpenBSD"; then
10202         qt_test_library="libqt-mt.so"
10203         kde_test_library="libDCOP.so"
10204     else
10205         qt_test_library="libqt-mt.so*"
10206         kde_test_library="libDCOP.so*"
10207     fi
10209     dnl Check for Qt3 headers
10210     AC_MSG_CHECKING([for Qt3 headers])
10211     qt_incdir="no"
10212     for kde_check in $qt_incdirs; do
10213         if test -r "$kde_check/$qt_test_include"; then
10214             qt_incdir="$kde_check"
10215             break
10216         fi
10217     done
10218     AC_MSG_RESULT([$qt_incdir])
10219     if test "x$qt_incdir" = "xno"; then
10220         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
10221 your Qt3 installation by exporting QTDIR before running "configure".])
10222     fi
10224     dnl Check for Qt3 libraries
10225     AC_MSG_CHECKING([for Qt3 libraries])
10226     qt_libdir="no"
10227     for qt_check in $qt_libdirs; do
10228         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`"; then
10229             qt_libdir="$qt_check"
10230             break
10231         fi
10232     done
10233     AC_MSG_RESULT([$qt_libdir])
10234     if test "x$qt_libdir" = "xno"; then
10235         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
10236 your Qt3 installation by exporting QTDIR before running "configure".])
10237     fi
10239     dnl Check for Meta Object Compiler
10240     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
10241     if test "$MOC" = "no"; then
10242         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
10243 the root of your Qt3 installation by exporting QTDIR before running "configure".])
10244     fi
10246     dnl Check for KDE3 headers
10247     AC_MSG_CHECKING([for KDE3 headers])
10248     kde_incdir="no"
10249     for kde_check in $kde_incdirs; do
10250         if test -r "$kde_check/$kde_test_include"; then
10251             kde_incdir="$kde_check"
10252             break
10253         fi
10254     done
10255     AC_MSG_RESULT([$kde_incdir])
10256     if test "x$kde_incdir" = "xno"; then
10257         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
10258 your KDE3 installation by exporting KDEDIR before running "configure".])
10259     fi
10261     dnl Check for KDE3 libraries
10262     AC_MSG_CHECKING([for KDE3 libraries])
10263     kde_libdir="no"
10264     for kde_check in $kde_libdirs; do
10265         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`"; then
10266             kde_libdir="$kde_check"
10267             break
10268         fi
10269     done
10270     AC_MSG_RESULT([$kde_libdir])
10271     if test "x$kde_libdir" = "xno"; then
10272         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
10273 your KDE3 installation by exporting KDEDIR before running "configure".])
10274     fi
10276     dnl Set the variables
10277     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10278     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
10280 AC_SUBST(KDE_CFLAGS)
10281 AC_SUBST(KDE_LIBS)
10282 AC_SUBST(MOC)
10284 dnl ===================================================================
10285 dnl KDE4 Integration
10286 dnl ===================================================================
10288 KDE4_CFLAGS=""
10289 KDE4_LIBS=""
10290 QMAKE4="qmake"
10291 MOC4="moc"
10292 KDE_GLIB_CFLAGS=""
10293 KDE_GLIB_LIBS=""
10294 KDE_HAVE_GLIB=""
10295 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10296     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10297     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10299     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
10300     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10302     if test -n "$supports_multilib"; then
10303         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10304         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10305     fi
10307     if test -n "$QTDIR"; then
10308         qt_incdirs="$QTDIR/include $qt_incdirs"
10309         if test -z "$supports_multilib"; then
10310             qt_libdirs="$QTDIR/lib $qt_libdirs"
10311         else
10312             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
10313         fi
10314     fi
10315     if test -n "$QT4DIR"; then
10316         qt_incdirs="$QT4DIR/include $qt_incdirs"
10317         if test -z "$supports_multilib"; then
10318             qt_libdirs="$QT4DIR/lib $qt_libdirs"
10319         else
10320             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
10321         fi
10322     fi
10324     if test -n "$KDEDIR"; then
10325         kde_incdirs="$KDEDIR/include $kde_incdirs"
10326         if test -z "$supports_multilib"; then
10327             kde_libdirs="$KDEDIR/lib $kde_libdirs"
10328         else
10329             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
10330         fi
10331     fi
10332     if test -n "$KDE4DIR"; then
10333         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
10334         if test -z "$supports_multilib"; then
10335             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
10336         else
10337             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
10338         fi
10339     fi
10341     qt_test_include="Qt/qobject.h"
10342     qt_test_library="libQtCore.so"
10343     kde_test_include="kwindowsystem.h"
10344     kde_test_library="libsolid.so"
10346     AC_MSG_CHECKING([for Qt4 headers])
10347     qt_header_dir="no"
10348     for inc_dir in $qt_incdirs; do
10349         if test -r "$inc_dir/$qt_test_include"; then
10350             qt_header_dir="$inc_dir"
10351             break
10352         fi
10353     done
10355     AC_MSG_RESULT([$qt_header_dir])
10356     if test "x$qt_header_dir" = "xno"; then
10357         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10358     fi
10360     dnl Check for qmake
10361     AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
10362     QMAKE4="$QMAKEQT4"
10363     if test "$QMAKE4" = "no"; then
10364         AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
10365         if test "$QMAKE4" = "no"; then
10366             AC_MSG_ERROR([Qmake not found.  Please specify
10367 the root of your Qt installation by exporting QT4DIR before running "configure".])
10368         fi
10369     fi
10371     qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
10372     AC_MSG_CHECKING([for Qt4 libraries])
10373     qt_lib_dir="no"
10374     for lib_dir in $qt_libdirs; do
10375         if test -r "$lib_dir/$qt_test_library"; then
10376             qt_lib_dir="$lib_dir"
10377             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
10378             break
10379         fi
10380     done
10382     AC_MSG_RESULT([$qt_lib_dir])
10384     if test "x$qt_lib_dir" = "xno"; then
10385         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10386     fi
10388     dnl Check for Meta Object Compiler
10390     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10391     MOC4="$MOCQT4"
10392     if test "$MOC4" = "no"; then
10393         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10394         if test "$MOC4" = "no"; then
10395             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
10396 the root of your Qt installation by exporting QT4DIR before running "configure".])
10397         fi
10398     fi
10400     dnl Check for KDE4 headers
10401     AC_MSG_CHECKING([for KDE4 headers])
10402     kde_incdir="no"
10403     for kde_check in $kde_incdirs; do
10404         if test -r "$kde_check/$kde_test_include"; then
10405             kde_incdir="$kde_check"
10406             break
10407         fi
10408     done
10409     AC_MSG_RESULT([$kde_incdir])
10410     if test "x$kde_incdir" = "xno"; then
10411         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10412     fi
10414     dnl Check for KDE4 libraries
10415     AC_MSG_CHECKING([for KDE4 libraries])
10416     kde_libdir="no"
10417     for kde_check in $kde_libdirs; do
10418         if test -r "$kde_check/$kde_test_library"; then
10419             kde_libdir="$kde_check"
10420             break
10421         fi
10422     done
10424     AC_MSG_RESULT([$kde_libdir])
10425     if test "x$kde_libdir" = "xno"; then
10426         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10427     fi
10429     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10430     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkio -lkfile -lkdeui -lkdecore -lQtCore -lQtGui"
10432     AC_LANG_PUSH([C++])
10433     save_CXXFLAGS=$CXXFLAGS
10434     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
10435     AC_MSG_CHECKING([whether KDE is >= 4.2])
10436        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10437 #include <kdeversion.h>
10439 int main(int argc, char **argv) {
10440        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
10441        else return 1;
10443        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
10444     CXXFLAGS=$save_CXXFLAGS
10445     AC_LANG_POP([C++])
10447    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
10448     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
10449         [KDE_HAVE_GLIB=1],
10450         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
10452 AC_SUBST(KDE4_CFLAGS)
10453 AC_SUBST(KDE4_LIBS)
10454 AC_SUBST(MOC4)
10455 AC_SUBST(KDE_GLIB_CFLAGS)
10456 AC_SUBST(KDE_GLIB_LIBS)
10457 AC_SUBST(KDE_HAVE_GLIB)
10459 dnl ===================================================================
10460 dnl Test for the enabling the lockdown pieces
10461 dnl ===================================================================
10462 AC_MSG_CHECKING([whether to enable the lockdown pieces])
10463 ENABLE_LOCKDOWN=""
10464 if test -n "$enable_lockdown" -a "$enable_lockdown" != "no"; then
10465     ENABLE_LOCKDOWN=YES
10466     AC_MSG_RESULT([yes])
10467 else
10468     AC_MSG_RESULT([no])
10470 AC_SUBST(ENABLE_LOCKDOWN)
10472 dnl ===================================================================
10473 dnl Test whether to include Evolution 2 support
10474 dnl ===================================================================
10475 AC_MSG_CHECKING([whether to enable evolution 2 support])
10476 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
10477     AC_MSG_RESULT([yes])
10478     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
10479     ENABLE_EVOAB2="TRUE"
10480 else
10481     ENABLE_EVOAB2=""
10482     AC_MSG_RESULT([no])
10484 AC_SUBST(ENABLE_EVOAB2)
10485 AC_SUBST(GOBJECT_CFLAGS)
10486 AC_SUBST(GOBJECT_LIBS)
10488 dnl ===================================================================
10489 dnl Test whether to include TDE AB support
10490 dnl ===================================================================
10491 AC_MSG_CHECKING([whether to enable TDE address book support])
10492 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
10493     AC_MSG_RESULT([yes])
10494     AC_LANG_PUSH([C++])
10495     save_CXXFLAGS=$CXXFLAGS
10496     CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
10497     AC_MSG_CHECKING([whether TDE is at least R14.0])
10498        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10499 #include <tdeversion.h>
10501 int main(int argc, char **argv) {
10502        if (TDE_VERSION_MAJOR >= 14) return 0;
10503        else return 1;
10505        ]])],[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])],[])
10506     CXXFLAGS=$save_CXXFLAGS
10507     AC_LANG_POP([C++])
10508     ENABLE_TDEAB=TRUE
10509 else
10510     AC_MSG_RESULT([no])
10511     ENABLE_TDEAB=
10513 AC_SUBST(ENABLE_TDEAB)
10515 dnl ===================================================================
10516 dnl Test whether to include KDE AB support
10517 dnl ===================================================================
10518 AC_MSG_CHECKING([whether to enable KDE address book support])
10519 if test "$enable_kdeab" = "yes" -a "$enable_kde" = "yes"; then
10520     AC_MSG_RESULT([yes])
10521     AC_LANG_PUSH([C++])
10522     save_CXXFLAGS=$CXXFLAGS
10523     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
10524     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
10525        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10526 #include <kdeversion.h>
10528 int main(int argc, char **argv) {
10529        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
10530        else return 1;
10532        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old or too recent, please use another version of KDE or disable KDE address book support])],[])
10533     CXXFLAGS=$save_CXXFLAGS
10534     AC_LANG_POP([C++])
10535     ENABLE_KAB=TRUE
10536 else
10537     AC_MSG_RESULT([no])
10538     ENABLE_KAB=
10540 AC_SUBST(ENABLE_KAB)
10542 dnl ===================================================================
10543 dnl Test whether to include MathMLDTD
10544 dnl ===================================================================
10545 AC_MSG_CHECKING([whether to include MathMLDTD])
10546 if test -n "$enable_mathmldtd"; then
10547     if test "$enable_mathmldtd" = "no"; then
10548         AC_MSG_RESULT([no])
10549         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10550     else
10551         AC_MSG_RESULT([yes])
10552         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
10553     fi
10554 else
10555     AC_MSG_RESULT([no])
10556     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10559 dnl ===================================================================
10560 dnl Test which themes to include
10561 dnl ===================================================================
10562 AC_MSG_CHECKING([which themes to include])
10563 # if none given use default subset of available themes
10564 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
10565     with_theme="crystal default hicontrast oxygen tango"
10566     test "$ENABLE_RELEASE_BUILD" = "FALSE" && with_theme="$with_theme tango_testing"
10569 WITH_THEMES=""
10570 for theme in $with_theme; do
10571     case $theme in
10572         crystal|default|galaxy|hicontrast|human|industrial|oxygen|tango|tango_testing) : ;;
10573         *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
10574     esac
10575     WITH_THEMES="$WITH_THEMES $theme"
10576     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
10577 done
10578 AC_MSG_RESULT([$WITH_THEMES])
10579 AC_SUBST([WITH_THEMES])
10581 dnl ===================================================================
10582 dnl Test whether to integrate helppacks into the product's installer
10583 dnl ===================================================================
10584 AC_MSG_CHECKING([for helppack integration])
10585 if test "$with_helppack_integration" = "no"; then
10586     WITH_HELPPACK_INTEGRATION=NO
10587     AC_MSG_RESULT([no integration])
10588 else
10589     WITH_HELPPACK_INTEGRATION=YES
10590     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
10591     AC_MSG_RESULT([integration])
10593 AC_SUBST(WITH_HELPPACK_INTEGRATION)
10595 dnl ===================================================================
10596 dnl Test whether to use CoreText framework
10597 dnl ===================================================================
10598 ENABLE_CORETEXT=NO
10599 if test "$_os" = "Darwin"; then
10600     AC_MSG_CHECKING([whether to use CoreText framework])
10601     if test "$enable_coretext" = yes -o "$BITNESS_OVERRIDE" = 64; then
10602         AC_MSG_RESULT([yes])
10603         ENABLE_CORETEXT=YES
10604     else
10605         AC_MSG_RESULT([no])
10606     fi
10608 AC_SUBST(ENABLE_CORETEXT)
10610 ###############################################################################
10611 # Extensions checking
10612 ###############################################################################
10613 dnl ===================================================================
10614 dnl Test whether to integrate extensions into the product's installer
10615 dnl ===================================================================
10616 AC_MSG_CHECKING([for extensions integration])
10617 if test "x$enable_extension_integration" != "xno"; then
10618     WITH_EXTENSION_INTEGRATION=YES
10619     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
10620     AC_MSG_RESULT([yes, use integration])
10621 else
10622     WITH_EXTENSION_INTEGRATION=NO
10623     AC_MSG_RESULT([no, do not integrate])
10625 AC_SUBST(WITH_EXTENSION_INTEGRATION)
10627 dnl Should any extra extensions be included?
10628 dnl There are standalone tests for each of these below.
10629 WITH_EXTRA_EXTENSIONS=
10630 AC_SUBST([WITH_EXTRA_EXTENSIONS])
10632 dnl ===================================================================
10633 dnl Test whether to include Watch Window extension
10634 dnl ===================================================================
10635 AC_MSG_CHECKING([for Watch Window extension integration])
10636 WATCH_WINDOW_EXTENSION_PACK=
10637 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10638     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
10639     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
10640     WITH_EXTRA_EXTENSIONS=YES
10641     AC_MSG_RESULT([yes])
10642 else
10643     AC_MSG_RESULT([no])
10645 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
10647 dnl ===================================================================
10648 dnl Test whether to include SmART Gallery (Diagram) extension
10649 dnl ===================================================================
10650 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
10651 DIAGRAM_EXTENSION_PACK=
10652 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10653     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
10654     DIAGRAM_EXTENSION_PACK="8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt"
10655     WITH_EXTRA_EXTENSIONS=YES
10656     AC_MSG_RESULT([yes])
10657 else
10658     AC_MSG_RESULT([no])
10660 AC_SUBST(DIAGRAM_EXTENSION_PACK)
10662 dnl ===================================================================
10663 dnl Test whether to include Validator extension
10664 dnl ===================================================================
10665 AC_MSG_CHECKING([for Validator extension integration])
10666 VALIDATOR_EXTENSION_PACK=
10667 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10668     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
10669     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
10670     WITH_EXTRA_EXTENSIONS=YES
10671     AC_MSG_RESULT([yes])
10672 else
10673     AC_MSG_RESULT([no])
10675 AC_SUBST(VALIDATOR_EXTENSION_PACK)
10677 dnl ===================================================================
10678 dnl Test whether to include Barcode extension
10679 dnl ===================================================================
10680 AC_MSG_CHECKING([for Barcode extension integration])
10681 BARCODE_EXTENSION_PACK=
10682 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10683     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
10684     BARCODE_EXTENSION_PACK="3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt"
10685     WITH_EXTRA_EXTENSIONS=YES
10686     AC_MSG_RESULT([yes])
10687 else
10688     AC_MSG_RESULT([no])
10690 AC_SUBST([BARCODE_EXTENSION_PACK])
10692 dnl ===================================================================
10693 dnl Test whether to include ConvertTextToNumber extension
10694 dnl ===================================================================
10695 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
10696 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10697     BUILD_TYPE="$BUILD_TYPE CT2N"
10698     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
10699     AC_MSG_RESULT([yes])
10700 else
10701     AC_MSG_RESULT([no])
10704 dnl ===================================================================
10705 dnl Test whether to include Numbertext extension
10706 dnl ===================================================================
10707 AC_MSG_CHECKING([for Numbertext extension integration])
10708 NUMBERTEXT_EXTENSION_PACK=
10709 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10710     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
10711     NUMBERTEXT_EXTENSION_PACK="b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt"
10712     WITH_EXTRA_EXTENSIONS=YES
10713     AC_MSG_RESULT([yes])
10714 else
10715     AC_MSG_RESULT([no])
10717 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
10719 dnl ===================================================================
10720 dnl Test whether to include Hungarian Cross-reference Toolbar extension
10721 dnl ===================================================================
10722 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
10723 HUNART_EXTENSION_PACK=
10724 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10725     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
10726     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
10727     WITH_EXTRA_EXTENSIONS=YES
10728     AC_MSG_RESULT([yes])
10729 else
10730     AC_MSG_RESULT([no])
10732 AC_SUBST(HUNART_EXTENSION_PACK)
10734 dnl ===================================================================
10735 dnl Test whether to include Typography Toolbar extension
10736 dnl ===================================================================
10737 AC_MSG_CHECKING([for Typography Toolbar extension integration])
10738 TYPO_EXTENSION_PACK=
10739 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10740     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
10741     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
10742     WITH_EXTRA_EXTENSIONS=YES
10743     AC_MSG_RESULT([yes])
10744 else
10745     AC_MSG_RESULT([no])
10747 AC_SUBST(TYPO_EXTENSION_PACK)
10749 dnl ===================================================================
10750 dnl Test whether to include Google Docs extension
10751 dnl ===================================================================
10752 AC_MSG_CHECKING([for Google Docs extension integration])
10753 GOOGLE_DOCS_EXTENSION_PACK=
10754 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10755     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
10756     GOOGLE_DOCS_EXTENSION_PACK="27211596cf0ad97cab7321239406fde0-gdocs_3.0.1_modified.oxt"
10757     WITH_EXTRA_EXTENSIONS=YES
10758     AC_MSG_RESULT([yes])
10759 else
10760     AC_MSG_RESULT([no])
10762 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
10764 dnl ===================================================================
10765 dnl Test whether to include NLPSolver extension
10766 dnl ===================================================================
10767 AC_MSG_CHECKING([for NLPSolver extension integration])
10768 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10769     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
10770     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
10771     AC_MSG_RESULT([yes])
10772 else
10773     AC_MSG_RESULT([no])
10776 dnl ===================================================================
10777 dnl Test whether to include LanguageTool extension
10778 dnl ===================================================================
10779 AC_MSG_CHECKING([for LanguageTool extension integration])
10780 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10781     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
10782     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
10783     AC_MSG_RESULT([yes])
10784 else
10785     AC_MSG_RESULT([no])
10788 dnl ===================================================================
10789 dnl Test whether to include Sun Professional Template Pack
10790 dnl ===================================================================
10791 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
10792 if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
10793     AC_MSG_RESULT([no integration])
10794 else
10795     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
10796     sun_supported_langs="en-US de it fr es hu"
10797     if test "$with_sun_templates" = "yes"; then
10798         wanted_sun_templates="$sun_supported_langs"
10799     else
10800         # check whether the langs are supported by Sun
10801         wanted_sun_templates=
10802         for lang in $with_sun_templates; do
10803             if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
10804                 wanted_sun_templates="$wanted_sun_templates $lang"
10805             fi
10806         done
10807     fi
10808     SUNTEMPLATES_LANG=
10809     SUNTEMPLATES_DE_PACK=
10810     SUNTEMPLATES_EN_US_PACK=
10811     SUNTEMPLATES_ES_PACK=
10812     SUNTEMPLATES_FR_PACK=
10813     SUNTEMPLATES_HU_PACK=
10814     SUNTEMPLATES_IT_PACK=
10815     # check whether the langs are requested at all
10816     for lang in $wanted_sun_templates; do
10817     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
10818         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
10819         case $lang in
10820         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
10821         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
10822         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
10823         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
10824         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
10825         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
10826         esac
10827     fi
10828     done
10829     WITH_EXTRA_EXTENSIONS=YES
10830     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
10832 AC_SUBST(SUNTEMPLATES_DE_PACK)
10833 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
10834 AC_SUBST(SUNTEMPLATES_ES_PACK)
10835 AC_SUBST(SUNTEMPLATES_FR_PACK)
10836 AC_SUBST(SUNTEMPLATES_HU_PACK)
10837 AC_SUBST(SUNTEMPLATES_IT_PACK)
10839 dnl ===================================================================
10840 dnl Test whether to include fonts
10841 dnl ===================================================================
10842 AC_MSG_CHECKING([whether to include third-party fonts])
10843 if test "$with_fonts" != "no"; then
10844     AC_MSG_RESULT([yes])
10845     WITH_FONTS=YES
10846     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
10847 else
10848     AC_MSG_RESULT([no])
10849     WITH_FONTS=NO
10850     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
10852 AC_SUBST(WITH_FONTS)
10855 # The agfa monotype fonts options seems broken
10856 # there is no assocaited entry in Makefile.fetch
10857 # so we do not fetch the dependencies
10858 # there is no tie-up with MORE_FONTS, but in dmake mode
10859 # without more_fonts that option is meaningless
10860 # so I suspect it is not really used anymore, commenting out for now
10861 #AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
10862 #if test "$with_agfa_monotype_fonts" = "yes"; then
10863 #    AC_MSG_RESULT([yes])
10864 #    WITH_AGFA_MONOTYPE_FONTS=YES
10865 #    SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
10866 #    BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
10867 #else
10868 #    AC_MSG_RESULT([no])
10869 #    WITH_AGFA_MONOTYPE_FONTS=NO
10871 #AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
10873 dnl ===================================================================
10874 dnl Test whether to include ppds
10875 dnl ===================================================================
10876 AC_MSG_CHECKING([whether to include PPDs])
10877 if test "$with_ppds" != "no"; then
10878     AC_MSG_RESULT([yes])
10879 else
10880     AC_MSG_RESULT([no])
10881     WITHOUT_PPDS=YES
10882     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
10884 AC_SUBST(WITHOUT_PPDS)
10886 dnl ===================================================================
10887 dnl Test whether to include afms
10888 dnl ===================================================================
10889 AC_MSG_CHECKING([whether to include AFMs])
10890 if test "$with_afms" != "no"; then
10891     AC_MSG_RESULT([yes])
10892     BUILD_TYPE="$BUILD_TYPE AFMS"
10893 else
10894     AC_MSG_RESULT([no])
10895     WITHOUT_AFMS=YES
10896     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
10898 AC_SUBST(WITHOUT_AFMS)
10900 dnl ===================================================================
10901 dnl Test whether to include extra galleries
10902 dnl ===================================================================
10903 AC_MSG_CHECKING([whether to include extra galleries])
10904 if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
10905     AC_MSG_RESULT([no])
10906     WITH_EXTRA_GALLERY=NO
10907     OOOP_GALLERY_PACK=""
10908 else
10909     AC_MSG_RESULT([yes])
10910     WITH_EXTRA_GALLERY=YES
10911     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
10912     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
10913     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
10915 AC_SUBST(WITH_EXTRA_GALLERY)
10916 AC_SUBST(OOOP_GALLERY_PACK)
10918 dnl ===================================================================
10919 dnl Test whether to include extra templates
10920 dnl ===================================================================
10921 AC_MSG_CHECKING([whether to include extra templates])
10922 if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
10923     AC_MSG_RESULT([no])
10924     WITH_EXTRA_TEMPLATE=NO
10925     OOOP_TEMPLATES_PACK=""
10926 else
10927     AC_MSG_RESULT([yes])
10928     WITH_EXTRA_TEMPLATE=YES
10929     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
10930     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
10931     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
10933 AC_SUBST(WITH_EXTRA_TEMPLATE)
10934 AC_SUBST(OOOP_TEMPLATES_PACK)
10936 dnl ===================================================================
10937 dnl Test whether to include extra samples
10938 dnl ===================================================================
10939 AC_MSG_CHECKING([whether to include extra samples])
10940 if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
10941     AC_MSG_RESULT([no])
10942     WITH_EXTRA_SAMPLE=NO
10943     OOOP_SAMPLES_PACK=""
10944 else
10945     AC_MSG_RESULT([yes])
10946     WITH_EXTRA_SAMPLE=YES
10947     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
10948     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
10949     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
10951 AC_SUBST(WITH_EXTRA_SAMPLE)
10952 AC_SUBST(OOOP_SAMPLES_PACK)
10954 dnl ===================================================================
10955 dnl Test whether to include extra fonts
10956 dnl ===================================================================
10957 AC_MSG_CHECKING([whether to include extra fonts])
10958 if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
10959     AC_MSG_RESULT([no])
10960     WITH_EXTRA_FONT=NO
10961     OOOP_FONTS_PACK=""
10962 else
10963     AC_MSG_RESULT([yes])
10964     WITH_EXTRA_FONT=YES
10965     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
10966     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
10967     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
10969 AC_SUBST(WITH_EXTRA_FONT)
10970 AC_SUBST(OOOP_FONTS_PACK)
10972 dnl ===================================================================
10973 dnl Test whether to enable online update service
10974 dnl ===================================================================
10975 AC_MSG_CHECKING([whether to enable online update])
10976 ENABLE_ONLINE_UPDATE=
10977 if test "$enable_online_update" = ""; then
10978     if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
10979         AC_MSG_RESULT([yes])
10980         ENABLE_ONLINE_UPDATE="TRUE"
10981     else
10982         AC_MSG_RESULT([no])
10983     fi
10984 else
10985     if test "$enable_online_update" = "yes"; then
10986         AC_MSG_RESULT([yes])
10987         ENABLE_ONLINE_UPDATE="TRUE"
10988     else
10989         AC_MSG_RESULT([no])
10990     fi
10992 AC_SUBST(ENABLE_ONLINE_UPDATE)
10994 dnl ===================================================================
10995 dnl Test whether to create MSI with LIMITUI=1 (silent install)
10996 dnl ===================================================================
10997 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
10998 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
10999     AC_MSG_RESULT([no])
11000     ENABLE_SILENT_MSI="FALSE"
11001 else
11002     AC_MSG_RESULT([yes])
11003     ENABLE_SILENT_MSI="TRUE"
11004     SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11006 AC_SUBST(ENABLE_SILENT_MSI)
11008 AC_MSG_CHECKING([whether and how to use Xinerama])
11009 if test "$_os" = "Darwin"; then
11010     USE_XINERAMA=YES
11011     XINERAMA_LINK=dynamic
11012     AC_MSG_RESULT([yes])
11013 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11014     if test "$x_libraries" = "default_x_libraries"; then
11015         XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11016         if test "x$XINERAMALIB" = x; then
11017            XINERAMALIB="/usr/lib"
11018         fi
11019     else
11020         XINERAMALIB="$x_libraries"
11021     fi
11022     if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11023         # we have both versions, let the user decide but use the dynamic one
11024         # per default
11025         USE_XINERAMA=YES
11026         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11027             XINERAMA_LINK=dynamic
11028         else
11029             XINERAMA_LINK=static
11030         fi
11031     elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11032         # we have only the dynamic version
11033         USE_XINERAMA=YES
11034         XINERAMA_LINK=dynamic
11035     elif test -e "$XINERAMALIB/libXinerama.a"; then
11036         # static version
11037         if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11038             USE_XINERAMA=YES
11039             XINERAMA_LINK=static
11040         else
11041             USE_XINERAMA=NO
11042             XINERAMA_LINK=none
11043         fi
11044     else
11045         # no Xinerama
11046         USE_XINERAMA=NO
11047         XINERAMA_LINK=none
11048     fi
11049     if test "$USE_XINERAMA" = "YES"; then
11050         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11051         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11052             [AC_MSG_ERROR(Xinerama header not found.)], [])
11053         XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11054         if test "x$XEXTLIB" = x; then
11055            XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11056         fi
11057         XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11058         if test "$_os" = "FreeBSD"; then
11059             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11060         fi
11061         if test "$_os" = "Linux"; then
11062             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11063         fi
11064         AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11065             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11066     else
11067         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11068     fi
11069 else
11070     USE_XINERAMA=NO
11071     XINERAMA_LINK=none
11072     AC_MSG_RESULT([no])
11074 AC_SUBST(USE_XINERAMA)
11075 AC_SUBST(XINERAMA_LINK)
11077 dnl ===================================================================
11078 dnl Test whether to build cairo or rely on the system version
11079 dnl ===================================================================
11081 if test "$GUIBASE" = "unx"; then
11082     # Used in vcl/Library_vclplug_gen.mk
11083     test_cairo=yes
11086 if test "$test_cairo" = "yes"; then
11087     AC_MSG_CHECKING([whether to use the system cairo])
11089     if test "$with_system_cairo" = "yes"; then
11090         SYSTEM_CAIRO=YES
11091         AC_MSG_RESULT([yes])
11093         PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
11095         if test "$test_xrender" = "yes"; then
11096             if test "$with_system_xextensions_headers" != "no"; then
11097                 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11098                 AC_LANG_PUSH([C])
11099                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11100 #ifdef PictStandardA8
11101 #else
11102       return fail;
11103 #endif
11104 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11106                 AC_LANG_POP([C])
11107             fi
11108         fi
11109         libo_MINGW_CHECK_DLL([CAIRO], [libcairo])
11110         libo_MINGW_TRY_DLL([FONTCONFIG], [libfontconfig])
11111         libo_MINGW_TRY_DLL([FREETYPE], [libfreetype])
11112         libo_MINGW_TRY_DLL([PIXMAN], [libpixman])
11113         libo_MINGW_TRY_DLL([PNG15], [libpng15])
11114     else
11115         SYSTEM_CAIRO=NO
11116         AC_MSG_RESULT([no])
11118         BUILD_TYPE="$BUILD_TYPE CAIRO"
11119         SCPDEFS="$SCPDEFS -DNEED_CAIRO"
11120     fi
11123 AC_SUBST(SYSTEM_CAIRO)
11124 AC_SUBST(CAIRO_CFLAGS)
11125 AC_SUBST(CAIRO_LIBS)
11126 AC_SUBST([MINGW_CAIRO_DLL])
11127 AC_SUBST([MINGW_FONTCONFIG_DLL])
11128 AC_SUBST([MINGW_FREETYPE_DLL])
11129 AC_SUBST([MINGW_PIXMAN_DLL])
11130 AC_SUBST([MINGW_PNG15_DLL])
11132 dnl ===================================================================
11133 dnl Test whether to use liblangtag
11134 dnl ===================================================================
11135 ENABLE_LIBLANGTAG=
11136 SYSTEM_LIBLANGTAG=
11137 AC_MSG_CHECKING([whether to use liblangtag])
11138 if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a $_os != Android -a $_os != iOS \); then
11139     ENABLE_LIBLANGTAG=YES
11140     AC_MSG_RESULT([yes])
11141     AC_MSG_CHECKING([whether to use system liblangtag])
11142     if test "$with_system_liblangtag" = yes; then
11143         SYSTEM_LIBLANGTAG=YES
11144         AC_MSG_RESULT([yes])
11145         PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11146         libo_MINGW_CHECK_DLL([LIBLANGTAG], [liblangtag])
11147     else
11148         SYSTEM_LIBLANGTAG=NO
11149         AC_MSG_RESULT([no])
11150         BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11151     fi
11152 else
11153     ENABLE_LIBLANGTAG=NO
11154     AC_MSG_RESULT([no])
11156 AC_SUBST(ENABLE_LIBLANGTAG)
11157 AC_SUBST(SYSTEM_LIBLANGTAG)
11158 AC_SUBST(LIBLANGTAG_CFLAGS)
11159 AC_SUBST(LIBLANGTAG_LIBS)
11160 AC_SUBST([MINGW_LIBLANGTAG_DLL])
11162 dnl ===================================================================
11163 dnl Test whether to build libpng or rely on the system version
11164 dnl ===================================================================
11166 AC_MSG_CHECKING([whether to use the system libpng])
11168 dnl How should and does this interact with the checks for libpng
11169 dnl related to use of libpng in the quickstarter above? This needs to
11170 dnl be unified.
11172 if test "$with_system_libpng" = "auto"; then
11173     case "$_os" in
11174     WINNT|Darwin|iOS|Android)
11175         with_system_libpng="$with_system_libs"
11176         ;;
11177     *)
11178         with_system_libpng=yes
11179         ;;
11180     esac
11183 if test "$with_system_libpng" = yes; then
11184     SYSTEM_LIBPNG=YES
11185     AC_MSG_RESULT([yes])
11186 else
11187     SYSTEM_LIBPNG=NO
11188     BUILD_TYPE="$BUILD_TYPE LIBPNG"
11189     AC_MSG_RESULT([no])
11191 AC_SUBST(SYSTEM_LIBPNG)
11193 dnl ===================================================================
11194 dnl Check for runtime JVM search path
11195 dnl ===================================================================
11196 if test "$SOLAR_JAVA" != ""; then
11197     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11198     if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11199         AC_MSG_RESULT([yes])
11200         if ! test -d "$with_jvm_path"; then
11201             AC_MSG_ERROR(["$with_jvm_path" not a directory])
11202         fi
11203         if ! test -d "$with_jvm_path"jvm; then
11204             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11205         fi
11206         JVM_ONE_PATH_CHECK="$with_jvm_path"
11207         AC_SUBST(JVM_ONE_PATH_CHECK)
11208     else
11209         AC_MSG_RESULT([no])
11210     fi
11213 dnl ===================================================================
11214 dnl Test for the presence of Ant and that it works
11215 dnl ===================================================================
11217 if test "$SOLAR_JAVA" != ""; then
11218     ANT_HOME=; export ANT_HOME
11219     WITH_ANT_HOME=; export WITH_ANT_HOME
11220     if test -z "$with_ant_home"; then
11221         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11222     else
11223         if test "$_os" = "WINNT"; then
11224             with_ant_home=`cygpath -u "$with_ant_home"`
11225         fi
11226         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11227         WITH_ANT_HOME=$with_ant_home
11228         ANT_HOME=$with_ant_home
11229     fi
11231     if test -z "$ANT"; then
11232         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11233     else
11234         # resolve relative or absolute symlink
11235         while test -h "$ANT"; do
11236             a_cwd=`pwd`
11237             a_basename=`basename "$ANT"`
11238             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11239             cd "`dirname "$ANT"`"
11240             cd "`dirname "$a_script"`"
11241             ANT="`pwd`"/"`basename "$a_script"`"
11242             cd "$a_cwd"
11243         done
11245         AC_MSG_CHECKING([if $ANT works])
11246         cat > conftest.java << EOF
11247         public class conftest {
11248             int testmethod(int a, int b) {
11249                     return a + b;
11250             }
11251         }
11254         cat > conftest.xml << EOF
11255         <project name="conftest" default="conftest">
11256         <target name="conftest">
11257             <javac srcdir="." includes="conftest.java">
11258             </javac>
11259         </target>
11260         </project>
11263         oldJAVA_HOME=$JAVA_HOME
11264         if test "$JAVACISGCJ" = "yes"; then
11265             JAVA_HOME=; export JAVA_HOME
11266             ant_gcj="-Dbuild.compiler=gcj"
11267         fi
11268         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11269         if test $? = 0 -a -f ./conftest.class; then
11270             AC_MSG_RESULT([Ant works])
11271             if test -z "$WITH_ANT_HOME"; then
11272                 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11273                 if test -z "$ANT_HOME"; then
11274                     ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11275                 fi
11276             else
11277                 ANT_HOME="$WITH_ANT_HOME"
11278             fi
11279         else
11280             echo "configure: Ant test failed" >&5
11281             cat conftest.java >&5
11282             cat conftest.xml >&5
11283             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
11284             ANT_HOME=""
11285             add_warning "Ant does not work - Some Java projects will not build!"
11286         fi
11287         JAVA_HOME=$oldJAVA_HOME
11288         rm -f conftest* core core.* *.core
11289     fi
11290     if test -z "$ANT_HOME"; then
11291         ANT_HOME="NO_ANT_HOME"
11292     else
11293         PathFormat "$ANT_HOME"
11294         ANT_HOME="$formatted_path"
11295         PathFormat "$ANT"
11296         ANT="$ANT"
11297     fi
11298     AC_SUBST(ANT_HOME)
11299     AC_SUBST(ANT)
11301     dnl Checking for ant.jar
11302     if test "$ANT_HOME" != "NO_ANT_HOME"; then
11303         AC_MSG_CHECKING([Ant lib directory])
11304         if test -f $ANT_HOME/lib/ant.jar; then
11305             ANT_LIB="$ANT_HOME/lib"
11306         else
11307             if test -f $ANT_HOME/ant.jar; then
11308                 ANT_LIB="$ANT_HOME"
11309             else
11310                 if test -f /usr/share/java/ant.jar; then
11311                     ANT_LIB=/usr/share/java
11312                 else
11313                     if test -f /usr/share/ant-core/lib/ant.jar; then
11314                         ANT_LIB=/usr/share/ant-core/lib
11315                     else
11316                         if test -f $ANT_HOME/lib/ant/ant.jar; then
11317                             ANT_LIB="$ANT_HOME/lib/ant"
11318                         else
11319                             if test -f /usr/share/lib/ant/ant.jar; then
11320                                 ANT_LIB=/usr/share/lib/ant
11321                             else
11322                                 AC_MSG_ERROR([Ant libraries not found!])
11323                             fi
11324                         fi
11325                     fi
11326                 fi
11327             fi
11328         fi
11329         PathFormat "$ANT_LIB"
11330         ANT_LIB="$formatted_path"
11331         AC_MSG_RESULT([Ant lib directory found.])
11332     fi
11333     AC_SUBST(ANT_LIB)
11335     ant_minver=1.6.0
11336     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11338     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11339     ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11340     ant_version_major=`echo $ant_version | cut -d. -f1`
11341     ant_version_minor=`echo $ant_version | cut -d. -f2`
11342     echo "configure: ant_version $ant_version " >&5
11343     echo "configure: ant_version_major $ant_version_major " >&5
11344     echo "configure: ant_version_minor $ant_version_minor " >&5
11345     if test "$ant_version_major" -ge "2"; then
11346         AC_MSG_RESULT([yes, $ant_version])
11347     elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11348         AC_MSG_RESULT([yes, $ant_version])
11349     else
11350         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11351     fi
11353     if test "$ENABLE_MEDIAWIKI" = "YES"; then
11354         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
11355         rm -rf confdir
11356         mkdir confdir
11357         cat > conftest.java << EOF
11358             public class conftest {
11359                 int testmethod(int a, int b) {
11360                     return a + b;
11361                 }
11362             }
11365         cat > conftest.xml << EOF
11366             <project name="conftest" default="conftest">
11367             <target name="conftest" depends="copytest">
11368                 <javac srcdir="." includes="conftest.java">
11369                 </javac>
11370             </target>
11371             <target name="copytest">
11372                  <copy todir="confdir">
11373                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
11374                  <filterset/>
11375                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
11376                  </copy>
11377             </target>
11378             </project>
11381         if test "$JAVACISGCJ" = "yes"; then
11382             JAVA_HOME=; export JAVA_HOME
11383             ant_gcj="-Dbuild.compiler=gcj"
11384         fi
11385         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11386         if test $? = 0 -a -f ./conftest.class; then
11387             AC_MSG_RESULT([yes])
11388             rm -rf confdir
11389         else
11390             echo "configure: Ant test failed" >&5
11391             cat conftest.java >&5
11392             cat conftest.xml >&5
11393             rm -rf confdir
11394             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
11395         fi
11396     fi
11397     rm -f conftest* core core.* *.core
11400 OOO_JUNIT_JAR=
11401 if test "$SOLAR_JAVA" != "" -a "$with_junit" != "no"; then
11402     AC_MSG_CHECKING([for JUnit 4])
11403     if test "$with_junit" = "yes"; then
11404         if test -e /usr/share/java/junit4.jar; then
11405             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11406         else
11407            if test -e /usr/share/lib/java/junit.jar; then
11408               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11409            else
11410               OOO_JUNIT_JAR=/usr/share/java/junit.jar
11411            fi
11412         fi
11413     else
11414         OOO_JUNIT_JAR=$with_junit
11415     fi
11416     if test "$_os" = "WINNT"; then
11417         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11418     fi
11419     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
11420         grep org/junit/Before.class > /dev/null 2>&5
11421     if test $? -eq 0; then
11422         # check if either class-path entry is available for hamcrest or
11423         # it's bundled
11424         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
11425             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
11426             AC_MSG_RESULT([$OOO_JUNIT_JAR])
11427         else
11428             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
11429 provide a full junit jar or use --without-junit])
11430         fi
11431     else
11432         AC_MSG_RESULT([no])
11433         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
11434 location (/usr/share/java), specify its pathname via
11435 --with-junit=..., or disable it via --without-junit])
11436     fi
11437     if test $OOO_JUNIT_JAR != ""; then
11438     BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11439     fi
11441 AC_SUBST(OOO_JUNIT_JAR)
11443 if test "$enable_odk" = no; then
11444     unset DOXYGEN
11445 else
11446     if test "$with_doxygen" = no; then
11447         AC_MSG_CHECKING([for doxygen])
11448         unset DOXYGEN
11449         AC_MSG_RESULT([no])
11450     else
11451         if test "$with_doxygen" = yes; then
11452             AC_PATH_PROG([DOXYGEN], [doxygen])
11453             if test -z "$DOXYGEN"; then
11454                 AC_MSG_RESULT([no])
11455                 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
11456             fi
11457         else
11458             AC_MSG_CHECKING([for doxygen])
11459             DOXYGEN=$with_doxygen
11460             AC_MSG_RESULT([$DOXYGEN])
11461         fi
11462     fi
11464 AC_SUBST([DOXYGEN])
11466 AC_SUBST(SCPDEFS)
11469 # check for wget and md5sum
11471 WGET=
11472 MD5SUM=
11473 CURL=
11475 if test "$enable_fetch_external" != "no"; then
11477 CURL=`which curl 2>/dev/null`
11479 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
11480     eval "$i --version" > /dev/null 2>&1
11481     ret=$?
11482     if test $ret -eq 0; then
11483         WGET=$i
11484         break
11485     fi
11486 done
11488 if test -z "$WGET" -a -z "$CURL"; then
11489     AC_MSG_ERROR([neither wget nor curl found!])
11492 for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
11493     if test "$i" = "md5"; then
11494         eval "$i -x" > /dev/null 2>&1
11495     else
11496         eval "$i --version" > /dev/null 2>&1
11497     fi
11498     ret=$?
11499     if test $ret -eq 0; then
11500         MD5SUM=$i
11501         break
11502     fi
11503 done
11505 if test "$MD5SUM" = "md5"; then
11506     if md5 -r < /dev/null > /dev/null 2>/dev/null; then
11507         MD5SUM="$MD5SUM -r"
11508     elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
11509         MD5SUM="$MD5SUM -n"
11510     fi
11513 if test -z "$MD5SUM"; then
11514     AC_MSG_WARN([no md5sum: found!])
11515     add_warning "no md5sum: found!"
11520 AC_SUBST(WGET)
11521 AC_SUBST(CURL)
11522 AC_SUBST(MD5SUM)
11524 dnl ===================================================================
11525 dnl Product version
11526 dnl ===================================================================
11527 AC_MSG_CHECKING([for product version])
11528 PRODUCTVERSION=AC_PACKAGE_VERSION
11529 AC_MSG_RESULT([$PRODUCTVERSION])
11530 AC_SUBST(PRODUCTVERSION)
11532 dnl ===================================================================
11533 dnl Dealing with l10n options
11534 dnl ===================================================================
11535 AC_MSG_CHECKING([which languages to be built])
11536 # get list of all languages
11537 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
11538 # the sed command does the following:
11539 #   + if a line ends with a backslash, append the next line to it
11540 #   + adds " on the beginning of the value (after =)
11541 #   + adds " at the end of the value
11542 #   + removes en-US; we want to put it on the beginning
11543 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
11544 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
11545 ALL_LANGS="en-US $completelangiso"
11546 # check the configured localizations
11547 WITH_LANG="$with_lang"
11548 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
11549     AC_MSG_RESULT([en-US])
11550 else
11551     AC_MSG_RESULT([$WITH_LANG])
11552     GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
11554 # check that the list is valid
11555 for lang in $WITH_LANG; do
11556     test "$lang" = "ALL" && continue
11557     # need to check for the exact string, so add space before and after the list of all languages
11558     for vl in $ALL_LANGS; do
11559         if test "$vl" = "$lang"; then
11560            break
11561         fi
11562     done
11563     if test "$vl" != "$lang"; then
11564         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
11565     fi
11566 done
11567 # list with substituted ALL
11568 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
11569 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
11570 test "$WITH_LANG" = "en-US" && WITH_LANG=
11571 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
11572     test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
11573     ALL_LANGS=`echo $ALL_LANGS qtz`
11575 AC_SUBST(ALL_LANGS)
11576 AC_SUBST(WITH_LANG)
11577 AC_SUBST(WITH_LANG_LIST)
11578 AC_SUBST(GIT_NEEDED_SUBMODULES)
11581 PathFormat "$SRC_ROOT/translations"
11582 L10N_MODULE="$formatted_path"
11583 WITH_POOR_HELP_LOCALIZATIONS=
11584 if test -d "$SRC_ROOT/translations/source"; then
11585     for l in `ls -1 $SRC_ROOT/translations/source`; do
11586         if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
11587             WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
11588         fi
11589     done
11591 AC_SUBST(L10N_MODULE)
11592 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
11594 dnl git-new-workdir
11595 dnl ===================================================================
11596 if test -n "${GIT_LINK_SRC}"; then
11597     for repo in ${GIT_NEEDED_SUBMODULES}; do
11598         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
11599             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
11600         fi
11601     done
11603 AC_SUBST(GIT_LINK_SRC)
11605 AC_MSG_CHECKING([for custom 'intro' progress bar color])
11606 PROGRESSBARCOLOR=
11607 if test -z "$with_intro_progressbar_color"; then
11608    PROGRESSBARCOLOR="128,128,128"
11609    AC_MSG_RESULT([none])
11610 else
11611    PROGRESSBARCOLOR="$with_intro_progressbar_color"
11612    AC_MSG_RESULT([$PROGRESSBARCOLOR])
11614 AC_SUBST(PROGRESSBARCOLOR)
11616 AC_MSG_CHECKING([for custom 'intro' progress bar size])
11617 PROGRESSSIZE=
11618 if test -z "$with_intro_progressbar_size"; then
11619    PROGRESSSIZE="409,8"
11620    AC_MSG_RESULT([none])
11621 else
11622    PROGRESSSIZE="$with_intro_progressbar_size"
11623    AC_MSG_RESULT([$PROGRESSSIZE])
11625 AC_SUBST(PROGRESSSIZE)
11627 AC_MSG_CHECKING([for custom 'intro' progress bar position])
11628 PROGRESSPOSITION=
11629 if test -z "$with_intro_progressbar_position"; then
11630    PROGRESSPOSITION="72,189"
11631    AC_MSG_RESULT([none])
11632 else
11633    PROGRESSPOSITION="$with_intro_progressbar_position"
11634    AC_MSG_RESULT([$PROGRESSPOSITION])
11636 AC_SUBST(PROGRESSPOSITION)
11638 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
11639 PROGRESSFRAMECOLOR=
11640 if test -z "$with_intro_progressbar_frame_color"; then
11641    PROGRESSFRAMECOLOR="245,245,245"
11642    AC_MSG_RESULT([none])
11643 else
11644    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
11645    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
11647 AC_SUBST(PROGRESSFRAMECOLOR)
11649 AC_MSG_CHECKING([for custom 'intro' progress text color])
11650 PROGRESSTEXTCOLOR=
11651 if test -z "$with_intro_progressbar_text_color"; then
11652    PROGRESSTEXTCOLOR="255,255,255"
11653    AC_MSG_RESULT([none])
11654 else
11655    PROGRESSTEXTCOLOR="$with_intro_progressbar_text_color"
11656    AC_MSG_RESULT([$PROGRESSTEXTCOLOR])
11658 AC_SUBST(PROGRESSTEXTCOLOR)
11660 AC_MSG_CHECKING([for custom 'intro' progress text baseline])
11661 PROGRESSTEXTBASELINE=
11662 if test -z "$with_intro_progressbar_text_baseline"; then
11663    PROGRESSTEXTBASELINE="170"
11664    AC_MSG_RESULT([none])
11665 else
11666    PROGRESSTEXTBASELINE="$with_intro_progressbar_text_baseline"
11667    AC_MSG_RESULT([$PROGRESSTEXTBASELINE])
11669 AC_SUBST(PROGRESSTEXTBASELINE)
11671 AC_MSG_CHECKING([for alternative branding images directory])
11672 INTRO_BITMAP=
11673 ABOUT_BACKGROUND_SVG=
11674 FLAT_LOGO_SVG=
11675 STARTCENTER_LEFT_BITMAP=
11676 STARTCENTER_RIGHT_BITMAP=
11677 STARTCENTER_RTL_LEFT_BITMAP=
11678 STARTCENTER_RTL_RIGHT_BITMAP=
11679 STARTCENTER_SPACE_BITMAP=
11680 if test -z "$with_branding" -o "$with_branding" = "no"; then
11681     AC_MSG_RESULT([none])
11682 else
11683     INTRO_BITMAP="$with_branding/intro.png"
11684     FLAT_LOGO_SVG="$with_branding/flat_logo.svg"
11685     STARTCENTER_LEFT_BITMAP="$with_branding/backing_left.png"
11686     STARTCENTER_RIGHT_BITMAP="$with_branding/backing_right.png"
11687     STARTCENTER_RTL_LEFT_BITMAP="$with_branding/backing_rtl_left.png"
11688     STARTCENTER_RTL_RIGHT_BITMAP="$with_branding/backing_rtl_right.png"
11689     STARTCENTER_SPACE_BITMAP="$with_branding/backing_space.png"
11690     for i in $INTRO_BITMAP \
11691              $FLAT_LOGO_SVG \
11692              $STARTCENTER_LEFT_BITMAP \
11693              $STARTCENTER_RIGHT_BITMAP \
11694              $STARTCENTER_RTL_LEFT_BITMAP \
11695              $STARTCENTER_RTL_RIGHT_BITMAP \
11696              $STARTCENTER_SPACE_BITMAP; do
11697         if test ! -f $i; then
11698             AC_MSG_WARN([Required file $i does not exist!])
11699         fi
11700     done
11701     AC_MSG_RESULT([$with_branding])
11704 AC_MSG_CHECKING([for yet another 'intro' bitmap])
11705 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no"; then
11706     if test "$with_intro_bitmap" = "no"; then
11707         INTRO_BITMAP=
11708     fi
11709     AC_MSG_RESULT([none])
11710 else
11711     case "$with_intro_bitmap" in
11712     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
11713     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
11714     esac
11715     AC_MSG_RESULT([$INTRO_BITMAP])
11717 AC_SUBST(INTRO_BITMAP)
11719 AC_MSG_CHECKING([for yet another 'about' svg])
11720 if test -z "$with_about_background_svg" -o "$with_about_background_svg" = "no"; then
11721     if test "$with_about_background_svg" = "no"; then
11722         ABOUT_BACKGROUND_SVG=
11723     fi
11724     AC_MSG_RESULT([none])
11725 else
11726    case "$with_about_background_svg" in
11727    *.svg) ABOUT_BACKGROUND_SVG="$with_about_background_svg" ;;
11728    *)     AC_MSG_WARN([About background SVG should be a .svg file!]) ;;
11729    esac
11730    AC_MSG_RESULT([$ABOUT_BACKGROUND_SVG])
11732 AC_SUBST(ABOUT_BACKGROUND_SVG)
11734 AC_MSG_CHECKING([for yet another 'flat_logo' svg])
11735 if test -z "$with_flat_logo_svg" -o "$with_flat_logo_svg" = "no"; then
11736     if test "$with_flat_logo_svg" = "no"; then
11737         FLAT_LOGO_SVG=
11738     fi
11739     AC_MSG_RESULT([none])
11740 else
11741    case "$with_flat_logo_svg" in
11742    *.svg) FLAT_LOGO_SVG="$with_flat_logo_svg" ;;
11743    *)     AC_MSG_WARN([Flat logo SVG should be a .svg file!]) ;;
11744    esac
11745    AC_MSG_RESULT([$ABOUT_BITMAP])
11747 AC_SUBST(FLAT_LOGO_SVG)
11749 AC_MSG_CHECKING([for yet another 'start center left' bitmap])
11750 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no"; then
11751    if test "$with_startcenter_left_bitmap" = "no"; then
11752       STARTCENTER_LEFT_BITMAP=
11753    fi
11754    AC_MSG_RESULT([none])
11755 else
11756    case "$with_startcenter_left_bitmap" in
11757       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
11758       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11759    esac
11760    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
11762 AC_SUBST(STARTCENTER_LEFT_BITMAP)
11764 AC_MSG_CHECKING([for yet another 'start center right' bitmap])
11765 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no"; then
11766    if test "$with_startcenter_right_bitmap" = "no"; then
11767       STARTCENTER_RIGHT_BITMAP=
11768    fi
11769    AC_MSG_RESULT([none])
11770 else
11771    case "$with_startcenter_right_bitmap" in
11772       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
11773       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
11774    esac
11775    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
11777 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
11779 AC_MSG_CHECKING([for yet another 'start center rtl left' bitmap])
11780 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no"; then
11781    if test "$with_startcenter_rtl_left_bitmap" = "no"; then
11782       STARTCENTER_RTL_LEFT_BITMAP=
11783    fi
11784    AC_MSG_RESULT([none])
11785 else
11786    case "$with_startcenter_rtl_left_bitmap" in
11787       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
11788       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
11789    esac
11790    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
11792 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
11794 AC_MSG_CHECKING([for yet another 'start center rtl right' bitmap])
11795 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no"; then
11796    if test "$with_startcenter_rtl_right_bitmap" = "no"; then
11797       STARTCENTER_RTL_RIGHT_BITMAP=
11798    fi
11799    AC_MSG_RESULT([none])
11800 else
11801    case "$with_startcenter_rtl_right_bitmap" in
11802       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
11803       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
11804    esac
11805    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
11807 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
11809 AC_MSG_CHECKING([for yet another 'start center space' bitmap])
11810 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no"; then
11811    if test "$with_startcenter_space_bitmap" = "no"; then
11812       STARTCENTER_SPACE_BITMAP=
11813    fi
11814    AC_MSG_RESULT([none])
11815 else
11816    case "$with_startcenter_space_bitmap" in
11817       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
11818       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11819    esac
11820    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
11822 AC_SUBST(STARTCENTER_SPACE_BITMAP)
11824 EXTRA_BUILDID=
11825 AC_MSG_CHECKING([for extra build ID])
11826 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
11827     EXTRA_BUILDID="$with_extra_buildid"
11828     AC_MSG_RESULT([$EXTRA_BUILDID])
11829 else
11830     AC_MSG_RESULT([not set])
11832 AC_SUBST(EXTRA_BUILDID)
11834 OOO_VENDOR=
11835 AC_MSG_CHECKING([for vendor])
11836 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
11837     AC_MSG_RESULT([not set])
11838 else
11839     OOO_VENDOR="$with_vendor"
11840     AC_MSG_RESULT([$OOO_VENDOR])
11842 AC_SUBST(OOO_VENDOR)
11844 UNIXWRAPPERNAME=
11845 AC_MSG_CHECKING([for UNIX wrapper name])
11846 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes"; then
11847     AC_MSG_RESULT([not set])
11848 else
11849     UNIXWRAPPERNAME="$with_unix_wrapper"
11850     AC_MSG_RESULT([$UNIXWRAPPERNAME])
11852 AC_SUBST(UNIXWRAPPERNAME)
11854 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
11855 if test "$with_compat_oowrappers" = "yes"; then
11856     WITH_COMPAT_OOWRAPPERS=YES
11857     AC_MSG_RESULT(yes)
11858 else
11859     WITH_COMPAT_OOWRAPPERS=
11860     AC_MSG_RESULT(no)
11862 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
11864 AC_MSG_CHECKING([for product name])
11865 PRODUCTNAME=AC_PACKAGE_NAME
11866 AC_MSG_RESULT([$PRODUCTNAME])
11867 AC_SUBST(PRODUCTNAME)
11869 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
11870 AC_MSG_CHECKING([for install dirname])
11871 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
11872    INSTALLDIRNAME="$with_install_dirname"
11874 AC_MSG_RESULT([$INSTALLDIRNAME])
11875 AC_SUBST(INSTALLDIRNAME)
11877 AC_MSG_CHECKING([for prefix])
11878 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11879 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
11880 PREFIXDIR="$prefix"
11881 AC_MSG_RESULT([$PREFIXDIR])
11882 AC_SUBST(PREFIXDIR)
11884 AC_MSG_CHECKING([for libdir])
11885 LIBDIR=[$(eval echo $(eval echo $libdir))]
11886 AC_MSG_RESULT([$LIBDIR])
11887 AC_SUBST(LIBDIR)
11889 AC_MSG_CHECKING([for data dir])
11890 DATADIR=[$(eval echo $(eval echo $datadir))]
11891 AC_MSG_RESULT([$DATADIR])
11892 AC_SUBST(DATADIR)
11894 AC_MSG_CHECKING([for man dir])
11895 MANDIR=[$(eval echo $(eval echo $mandir))]
11896 AC_MSG_RESULT([$MANDIR])
11897 AC_SUBST(MANDIR)
11899 AC_MSG_CHECKING([for doc dir])
11900 DOCDIR=[$(eval echo $(eval echo $docdir))]
11901 AC_MSG_RESULT([$DOCDIR])
11902 AC_SUBST(DOCDIR)
11904 AC_MSG_CHECKING([for install dir])
11905 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
11906 AC_MSG_RESULT([$INSTALLDIR])
11907 AC_SUBST(INSTALLDIR)
11909 AC_MSG_CHECKING([for dev-install dir])
11910 DEVINSTALLDIR="$OUTDIR/installation"
11911 AC_MSG_RESULT([$DEVINSTALLDIR])
11912 AC_SUBST(DEVINSTALLDIR)
11914 # ===================================================================
11915 # De- or increase default verbosity of build process
11916 # ===================================================================
11917 AC_MSG_CHECKING([build verbosity])
11918 if test -n "$enable_verbose"; then
11919     if test "$enable_verbose" = "yes"; then
11920         VERBOSE="TRUE"
11921         AC_MSG_RESULT([high])
11922     fi
11923     if test "$enable_verbose" = "no"; then
11924         VERBOSE="FALSE"
11925         AC_MSG_RESULT([low])
11926     fi
11927 else
11928     AC_MSG_RESULT([not set])
11930 AC_SUBST(VERBOSE)
11932 dnl ===================================================================
11933 dnl Use zenity during build
11934 dnl ===================================================================
11935 AC_MSG_CHECKING([whether to use zenity during build])
11936 if test "$enable_zenity" = "yes"; then
11937     AC_MSG_RESULT([yes])
11938     AC_PATH_PROGS( ZNTY, zenity )
11939     if test -z "$ZNTY"; then
11940         ENABLE_ZENITY=FALSE
11941     else
11942         ENABLE_ZENITY=TRUE
11943     fi
11944 else
11945     ENABLE_ZENITY=FALSE
11946     AC_MSG_RESULT([no])
11948 AC_SUBST(ENABLE_ZENITY)
11951 dnl ===================================================================
11952 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
11953 dnl --enable-dependency-tracking configure option
11954 dnl ===================================================================
11955 AC_MSG_CHECKING([whether to enable dependency tracking])
11956 if test "$enable_dependency_tracking" = "no"; then
11957     nodep=TRUE
11958     AC_MSG_RESULT([no])
11959 else
11960     AC_MSG_RESULT([yes])
11962 AC_SUBST(nodep)
11964 dnl ===================================================================
11965 dnl Number of CPUs to use during the build
11966 dnl ===================================================================
11967 AC_MSG_CHECKING([for number of processors to use])
11968 # plain --with-parallelism is just the default
11969 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
11970     if test "$with_parallelism" = "no"; then
11971         PARALLELISM=1
11972     else
11973         PARALLELISM=$with_parallelism
11974     fi
11975 else
11976     if test "$enable_icecream" = "yes"; then
11977         PARALLELISM="10"
11978     else
11979         case `uname -s` in
11981         Darwin|FreeBSD|NetBSD|OpenBSD)
11982             PARALLELISM=`sysctl -n hw.ncpu`
11983             ;;
11985         Linux)
11986             PARALLELISM=`getconf _NPROCESSORS_ONLN`
11987         ;;
11988         # what else than above does profit here *and* has /proc?
11989         *)
11990             PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
11991             ;;
11992         esac
11994         # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
11995         # unexpected format, 'wc -l' will have returned 0.
11996         if test "$PARALLELISM" -eq 0; then
11997             PARALLELISM=1
11998         fi
11999     fi
12002 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12003     if test -z "$with_parallelism"; then
12004             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12005             add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12006             PARALLELISM="1"
12007     else
12008         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."
12009     fi
12012 AC_MSG_RESULT([$PARALLELISM])
12013 AC_SUBST(PARALLELISM)
12015 # ===================================================================
12016 # Number of parallel jobs to be executed during subsequenttest
12017 # ===================================================================
12018 AC_MSG_CHECKING([for maximum no. of jobs during subsequenttest])
12019 CHECK_PARALLELISM=$PARALLELISM
12020 if test "$with_check_jobs" != ""; then
12021     CHECK_PARALLELISM="$with_check_jobs"
12023 AC_MSG_RESULT([$CHECK_PARALLELISM])
12024 AC_SUBST(CHECK_PARALLELISM)
12027 # Set up ILIB for MSVC build
12029 if test "$build_os" = "cygwin"; then
12030     ILIB=".;${SOLARVER}/$INPATH/lib"
12031     if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
12032         ILIB="$ILIB;$JAVA_HOME/lib"
12033     fi
12034     if test "$BITNESS_OVERRIDE" = 64; then
12035         ILIB="$ILIB;$COMPATH/lib/amd64"
12036         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12037         if test "$WINDOWS_SDK_VERSION" = "80"; then
12038             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x64"
12039         fi
12040     else
12041         ILIB="$ILIB;$COMPATH/lib"
12042         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12043         if test "$WINDOWS_SDK_VERSION" = "80"; then
12044             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x86"
12045         fi
12046     fi
12047     ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12049     if test "$ENABLE_DIRECTX" = "TRUE"; then
12050         ILIB="$ILIB;$DIRECTXSDK_LIB"
12051     fi
12052     AC_SUBST(ILIB)
12056 # ===================================================================
12057 # Creating bigger shared library to link against
12058 # ===================================================================
12059 AC_MSG_CHECKING([whether to create huge library])
12060 MERGELIBS=
12061 if test "$enable_mergelibs" = "yes"; then
12062     if test $_os != Linux -a $_os != Android -a $_os != WINNT; then
12063         add_warning "--enable-mergelibs is not tested for this platform"
12064     fi
12065     MERGELIBS="TRUE"
12066     AC_MSG_RESULT([yes])
12067 else
12068     AC_MSG_RESULT([no])
12070 AC_SUBST(MERGELIBS)
12072 # ===================================================================
12073 # Create hardlinks on deliver instead of copying for smaller size and speed up
12074 # ===================================================================
12075 AC_MSG_CHECKING([whether to create hardlinks for delivering files])
12076 HARDLINKDELIVER=
12077 if test "$enable_hardlink_deliver" = "yes"; then
12078     HARDLINKDELIVER="TRUE"
12079     AC_MSG_RESULT([yes])
12080 else
12081     AC_MSG_RESULT([no])
12083 AC_SUBST(HARDLINKDELIVER)
12085 dnl ===================================================================
12086 dnl icerun is a wrapper that stops us spawning tens of processes
12087 dnl locally - for tools that can't be executed on the compile cluster
12088 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12089 dnl ===================================================================
12090 AC_MSG_CHECKING([whether to use icerun wrapper])
12091 ICECREAM_RUN=
12092 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12093     ICECREAM_RUN=icerun
12094     AC_MSG_RESULT([yes])
12095 else
12096     AC_MSG_RESULT([no])
12098 AC_SUBST(ICECREAM_RUN)
12100 dnl ===================================================================
12101 dnl Setting up the environment.
12102 dnl ===================================================================
12103 echo "setting up the build environment variables..."
12105 AC_SUBST(COMPATH)
12107 if test "$build_os" = "cygwin"; then
12108     if test "$DISABLE_ACTIVEX" = "YES"; then
12109         ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12110         ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12111         MFC_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12112         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
12113     else
12114         ATL_LIB="$COMPATH/atlmfc/lib"
12115         ATL_INCLUDE="$COMPATH/atlmfc/include"
12116         MFC_LIB="$COMPATH/atlmfc/lib"
12117         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
12118     fi
12119     if test "$BITNESS_OVERRIDE" = 64; then
12120         ATL_LIB="$ATL_LIB/amd64"
12121         MFC_LIB="$MFC_LIB/amd64"
12122     fi
12123     PathFormat "/usr/bin/grep.exe"
12124     WIN_GREP="$formatted_path"
12125     PathFormat "/usr/bin/find.exe"
12126     WIN_FIND="$formatted_path"
12127     PathFormat "/usr/bin/ls.exe"
12128     WIN_LS="$formatted_path"
12129     PathFormat "/usr/bin/touch.exe"
12130     WIN_TOUCH="$formatted_path"
12133 AC_SUBST(ATL_INCLUDE)
12134 AC_SUBST(ATL_LIB)
12135 AC_SUBST(MFC_INCLUDE)
12136 AC_SUBST(MFC_LIB)
12137 AC_SUBST(WIN_FIND)
12138 AC_SUBST(WIN_GREP)
12139 AC_SUBST(WIN_LS)
12140 AC_SUBST(WIN_TOUCH)
12142 AC_SUBST(BUILD_TYPE)
12144 AC_SUBST(SOLARINC)
12145 AC_SUBST(SOLARLIB)
12147 if test -z "$SOLARINC_FOR_BUILD"; then
12148     SOLARINC_FOR_BUILD="$SOLARINC"
12150 AC_SUBST(SOLARINC_FOR_BUILD)
12152 if test -z "$SOLARLIB_FOR_BUILD"; then
12153     SOLARLIB_FOR_BUILD="$SOLARLIB"
12155 AC_SUBST(SOLARLIB_FOR_BUILD)
12157 PathFormat "$PERL"
12158 PERL="$formatted_path"
12159 AC_SUBST(PERL)
12161 if test "$build_os" = "cygwin"; then
12162     TEMP_DIRECTORY=`cygpath -m "/tmp"`
12163     if test -n "$TMP"; then
12164         TMP_DIRECTORY="$TMP"
12165     else
12166         TMP_DIRECTORY="$TEMP_DIRECTORY"
12167     fi
12168 else
12169     if test -n "$TMPDIR"; then
12170         TEMP_DIRECTORY="$TMPDIR"
12171     else
12172         TEMP_DIRECTORY="/tmp"
12173     fi
12175 AC_SUBST(TEMP_DIRECTORY)
12176 AC_SUBST(TMP_DIRECTORY)
12178 # setup the PATH for the environment
12179 if test -n "$LO_PATH_FOR_BUILD"; then
12180     LO_PATH="$LO_PATH_FOR_BUILD"
12181 else
12182     LO_PATH="$PATH"
12184     case "$host_os" in
12186     aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12187         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12188             pathmunge "$JAVA_HOME/bin" "after"
12189         fi
12190         ;;
12192     cygwin*)
12193         pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12194         pathmunge "$ASM_HOME" "before"
12195         pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12196         pathmunge "$CSC_PATH" "before"
12197         pathmunge "$MIDL_PATH" "before"
12198         pathmunge "$AL_PATH" "before"
12199         pathmunge "$MSPDB_PATH" "before"
12200         if test "$BITNESS_OVERRIDE" = 64; then
12201             pathmunge "$COMPATH/bin/amd64" "before"
12202             pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12203         else
12204             pathmunge "$COMPATH/bin" "before"
12205             pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12206         fi
12207         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12208             if test -d "$JAVA_HOME/jre/bin/client"; then
12209                 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12210             fi
12211             if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12212                 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12213             fi
12214             pathmunge "$JAVA_HOME/bin" "before"
12215         fi
12216         ;;
12218     solaris*)
12219         pathmunge "/usr/css/bin" "before"
12220         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12221             pathmunge "$JAVA_HOME/bin" "after"
12222         fi
12223         ;;
12224     esac
12226     pathmunge "$SRC_ROOT/solenv/$OUTPATH/bin" "before"
12227     pathmunge "$SRC_ROOT/solenv/bin" "before"
12228     pathmunge "." "before"
12231 AC_SUBST(LO_PATH)
12233 # make sure config.guess is +x; we execute config.guess, so it has to be so
12234 chmod +x ./config.guess
12236 # Generate a configuration timestamp we can use for deps
12237 if test -f config_host.mk; then
12238     mv -f config_host.mk config_host.mk.last
12239 else
12240     echo > config_host.mk.last
12243 AC_CONFIG_FILES([config_host.mk])
12244 AC_CONFIG_HEADERS([config/config_version.h])
12245 AC_OUTPUT
12247 # touch the config timestamp file
12248 if test ! -f config_host.mk.stamp; then
12249     echo > config_host.mk.stamp
12250 elif diff config_host.mk config_host.mk.last >/dev/null 2>&1; then
12251     echo "Configuration unchanged - avoiding scp2 stamp update"
12252 else
12253     echo > config_host.mk.stamp
12257 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12258 cat << _EOS
12259 ****************************************************************************
12260 WARNING:
12261 Your make version is known to be horribly slow, and hard to debug
12262 problems with. To get a reasonably functional make please do:
12264 to install a pre-compiled binary make for cygwin
12266 mkdir -p /opt/lo/bin
12267 cd /opt/lo/bin
12268 wget http://dev-www.libreoffice.org/bin/cygwin/make
12269 chmod +x make
12271 to install from source:
12272 place yourself in a working directory of you choice.
12274 git clone git://anongit.freedesktop.org/libreoffice/contrib/dev-tools
12275 cd dev-tools/make-3.82-gbuild
12276 ./configure --prefix=/opt/lo
12277 make
12278 sudo make install
12280 Then re-run autogen.sh
12282 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12283 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12285 _EOS
12288 cat << _EOF
12289 ****************************************************************************
12290 To build, issue:
12291 $GNUMAKE
12293 run: $GNUMAKE help
12294 for details
12296 _EOF
12298 if test $_os != WINNT -a "$CROSS_COMPILING" != YES; then
12299     cat << _EOF
12301 To install when the build is finished, issue:
12302 $GNUMAKE install
12304 If you want to develop LibreOffice, you might prefer:
12305 $GNUMAKE dev-install
12307 If you want to run the smoketest, issue:
12308 $GNUMAKE check
12310 _EOF
12313 cat warn
12315 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: