Bump for 4.0-22
[LibreOffice.git] / configure.ac
bloba88cb6af01a06313b1a0cad42d7e441f7f24b9bc
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(mono,
1110     AS_HELP_STRING([--enable-mono],
1111         [Enables the compilation of the Mono bindings]),
1114 AC_ARG_ENABLE(liblangtag,
1115     AS_HELP_STRING([--disable-liblangtag],
1116         [Disable use of liblangtag, and insted use an own simple
1117          implementation.]),
1120 AC_ARG_ENABLE(bogus-pkg-config,
1121     AS_HELP_STRING([--enable-bogus-pkg-config],
1122         [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.]),
1125 dnl ===================================================================
1126 dnl Optional Packages (--with/without-)
1127 dnl ===================================================================
1129 AC_ARG_WITH(gnu-patch,
1130     AS_HELP_STRING([--with-gnu-patch],
1131         [Specify location of GNU patch on Solaris or FreeBSD.]),
1134 AC_ARG_WITH(build-platform-configure-options,
1135         [Specify options for the configure script run for the *build* platform in a cross-compilation])
1137 AC_ARG_WITH(gnu-cp,
1138     AS_HELP_STRING([--with-gnu-cp],
1139         [Specify location of GNU cp on Solaris or FreeBSD.]),
1142 AC_ARG_WITH(external-tar,
1143     AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
1144         [Specify path to tarfiles manually.]),
1145     TARFILE_LOCATION=$withval ,
1148 AC_ARG_WITH(solver-and-workdir-root,
1149     AS_HELP_STRING([--with-solver-and-workdir-root=<PATH>],
1150         [Specify path that contains SOLARVER and WORKDIR directories manually.])
1153 AC_ARG_WITH(linked-git,
1154     AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
1155         [Specify another checkout's clonedir to re-use. This makes use of
1156                  git-new-workdir, and saves a lot of diskspace when having multiple
1157                  trees side-by-side.]),
1158     GIT_LINK_SRC=$withval ,
1161 AC_ARG_WITH(referenced-git,
1162     AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
1163         [Specify another checkout directory to reference. This makes use of
1164                  git submodule update --reference, and saves a lot of diskspace
1165                  when having multiple trees side-by-side.]),
1166     GIT_REFERENCE_SRC=$withval ,
1169 AC_ARG_WITH(vba-package-format,
1170     AS_HELP_STRING([--with-vba-package-format],
1171         [Specify package format for vba compatibility api. Specifying  "builtin"
1172          means the api component and associated type library are  part of the
1173          installation set. Specifying "extn" creates an uno extension that is
1174          part of the installation set (located in the program directory) that
1175          MUST be optionally registered using either the unopkg executeable or the
1176          extension manager gui.])
1177     [
1178                           Note: "builtin" is the default, "extn" can cause
1179                           problems.
1181                           Usage:     --with-vba-package-format="builtin" or
1182                                      --with-vba-package-format="extn"
1183     ],
1186 AC_ARG_WITH(theme,
1187     AS_HELP_STRING([--with-theme="theme1 theme2..."],
1188         [Choose which themes to include. By default those themes with an '*' are included.
1189          Possible choices: *crystal, *default (galaxy), *hicontrast, human, industrial, *oxygen, *tango, *tango_testing.]),
1192 AC_ARG_WITH(helppack-integration,
1194   --without-helppack-integration      It will not integrate the helppacks to the installer
1195                           of the product.
1196                           Please use this switch to use the online help or separate help packages.],
1199 AC_ARG_WITH(fonts,
1200     AS_HELP_STRING([--without-fonts],
1201         [LibreOffice includes some third-party fonts to provide a reliable basis for
1202          help content, templates, samples, etc. When these fonts are already
1203          known to be available on the system then you should use this option.]),
1206 AC_ARG_WITH(ppds,
1207     AS_HELP_STRING([--without-ppds],
1208         [Removes Postscript Printer definition files from LibreOffice
1209          installation set, for people building for specific distributions where
1210          PPDs are known to be already available (every recent distro with CUPS backend).]),
1213 AC_ARG_WITH(afms,
1214     AS_HELP_STRING([--without-afms],
1215         [Removes bitmap font files from LibreOffice installation set, for people
1216          building for specific distributions where AFM files or TrueType Fonts
1217          are known to be available.]),
1220 AC_ARG_WITH(agfa-monotype-fonts,
1221      AS_HELP_STRING([--with-agfa-monotype-fonts],
1222           [This switch should only be enabled for those who have the right
1223            to use or distribute the proprietary Agfa Monotype
1224            fonts.]),
1227 AC_ARG_WITH(epm,
1228     AS_HELP_STRING([--with-epm],
1229         [Decides which epm to use. Default is to use the one from the system if
1230          one is built. When either this is not there or you say =internal epm
1231          will be built.]),
1234 AC_ARG_WITH(package-format,
1235     AS_HELP_STRING([--with-package-format],
1236         [Specify package format(s) for LibreOffice installsets. Default is the
1237          "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
1238          inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
1239           installed, msi. Example: --with-package-format="deb dmg"]),
1242 AC_ARG_WITH(system-libs,
1243     AS_HELP_STRING([--with-system-libs],
1244         [Use libraries already on system -- enables all --with-system-* flags except
1245          mozilla.]),
1248 AC_ARG_WITH(system-headers,
1249     AS_HELP_STRING([--with-system-headers],
1250         [Use headers already on system -- enables all --with-system-* flags for
1251          external packages whose headers are the only entities used i.e.
1252          boost/vigra/odbc/sane-header(s).]),,
1253     [with_system_headers="$with_system_libs"])
1255 AC_ARG_WITH(system-jars,
1256     AS_HELP_STRING([--without-system-jars],
1257         [When building with --with-system-libs, also the needed jars are expected
1258          on the system. Use this to disable that]),,
1259     [with_system_jars="$with_system_libs"])
1261 AC_ARG_WITH(system-cairo,
1262     AS_HELP_STRING([--with-system-cairo],
1263         [Use Cairo libraries already on system.]),,
1264     [with_system_cairo="$with_system_libs"])
1266 AC_ARG_WITH(system-graphite,
1267     AS_HELP_STRING([--with-system-graphite],
1268         [Use graphite library already installed on system.]),,
1269     [with_system_graphite="$with_system_libs"])
1271 AC_ARG_WITH(system-nss,
1272     AS_HELP_STRING([--with-system-nss],
1273         [Use NSS/nspr libraries already on system.]),,
1274     [with_system_nss="$with_system_libs"])
1276 AC_ARG_WITH(mozilla-toolkit,
1277     AS_HELP_STRING([--with-mozilla-toolkit],
1278         [DEPRECATED : is ignored]),
1281 AC_ARG_WITH(myspell-dicts,
1282     AS_HELP_STRING([--without-myspell-dicts],
1283         [Removes myspell dictionaries from LibreOffice installation set, for
1284          people building for specific distributions where the myspell dictionaries
1285          are installed from other sources.]),
1288 AC_ARG_WITH(system-dicts,
1289     AS_HELP_STRING([--without-system-dicts],
1290         [Do not use dictionaries from system paths.]),
1293 AC_ARG_WITH(external-dict-dir,
1294     AS_HELP_STRING([--with-external-dict-dir],
1295         [Specify external dictionary dir.]),
1298 AC_ARG_WITH(external-hyph-dir,
1299     AS_HELP_STRING([--with-external-hyph-dir],
1300         [Specify external hyphenation pattern dir.]),
1303 AC_ARG_WITH(external-thes-dir,
1304     AS_HELP_STRING([--with-external-thes-dir],
1305         [Specify external thesaurus dir.]),
1308 AC_ARG_WITH(system-zlib,
1309     AS_HELP_STRING([--with-system-zlib],
1310         [Use zlib already on system.]),,
1311     [with_system_zlib=auto])
1313 AC_ARG_WITH(system-openssl,
1314     AS_HELP_STRING([--with-system-openssl],
1315         [Use OpenSSL already on system.]),,
1316     [with_system_openssl="$with_system_libs"])
1318 AC_ARG_WITH(system-jpeg,
1319     AS_HELP_STRING([--with-system-jpeg],
1320         [Use jpeg already on system.]),,
1321     [with_system_jpeg=auto])
1323 AC_ARG_WITH(system-clucene,
1324     AS_HELP_STRING([--with-system-clucene],
1325         [Use clucene already on system.]),,
1326     [with_system_clucene="$with_system_libs"])
1328 AC_ARG_WITH(system-expat,
1329     AS_HELP_STRING([--with-system-expat],
1330         [Use expat already on system.]),,
1331     [with_system_expat="$with_system_libs"])
1333 AC_ARG_WITH(system-libcmis,
1334     AS_HELP_STRING([--with-system-libcmis],
1335         [Use libcmis already on system.]),,
1336     [with_system_libcmis="$with_system_libs"])
1338 AC_ARG_WITH(system-lcms2,
1339     AS_HELP_STRING([--with-system-lcms2],
1340         [Use littlecms v2 already on system.]),,
1341     [with_system_lcms2="$with_system_libs"])
1343 AC_ARG_WITH(system-libcdr,
1344     AS_HELP_STRING([--with-system-libcdr],
1345         [Use libcdr already on system.]),,
1346     [with_system_libcdr="$with_system_libs"])
1348 AC_ARG_WITH(system-libmspub,
1349     AS_HELP_STRING([--with-system-libmspub],
1350         [Use libmspub already on system.]),,
1351     [with_system_libmspub="$with_system_libs"])
1353 AC_ARG_WITH(system-libvisio,
1354     AS_HELP_STRING([--with-system-libvisio],
1355         [Use libvisio already on system.]),,
1356     [with_system_libvisio="$with_system_libs"])
1358 AC_ARG_WITH(system-libwpd,
1359     AS_HELP_STRING([--with-system-libwpd],
1360         [Use libwpd already on system.]),,
1361     [with_system_libwpd="$with_system_libs"])
1363 AC_ARG_WITH(system-libwps,
1364     AS_HELP_STRING([--with-system-libwps],
1365         [Use libwps already on system.]),,
1366     [with_system_libwps="$with_system_libs"])
1368 AC_ARG_WITH(system-libwpg,
1369     AS_HELP_STRING([--with-system-libwpg],
1370         [Use libwpg already on system.]),,
1371     [with_system_libwpg="$with_system_libs"])
1373 AC_ARG_WITH(system-libxml,
1374     AS_HELP_STRING([--with-system-libxml],
1375         [Use libxml/libxslt already on system.]),,
1376     [with_system_libxml=auto])
1378 AC_ARG_WITH(system-icu,
1379     AS_HELP_STRING([--with-system-icu],
1380         [Use icu already on system.]),,
1381     [with_system_icu="$with_system_libs"])
1383 AC_ARG_WITH(system-ucpp,
1384     AS_HELP_STRING([--with-system-ucpp],
1385         [Use ucpp already on system.]),,
1386     [])
1388 AC_ARG_WITH(system-openldap,
1389     AS_HELP_STRING([--with-system-openldap],
1390         [Use the OpenLDAP LDAP SDK already on system.]),,
1391     [with_system_openldap="$with_system_libs"])
1393 AC_ARG_WITH(system-poppler,
1394     AS_HELP_STRING([--with-system-poppler],
1395         [Use system poppler (only needed for PDF import).]),,
1396     [with_system_poppler="$with_system_libs"])
1398 AC_ARG_WITH(system-apache-commons,
1399     AS_HELP_STRING([--with-system-apache-commons],
1400         [Use Apache commons libraries already on system.]),,
1401     [with_system_apache_commons="$with_system_jars"])
1403 AC_ARG_WITH(system-mysql,
1404     AS_HELP_STRING([--with-system-mysql],
1405         [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
1406          extension. If the the mysql_config executable is not in PATH, use MYSQLCONFIG to
1407          point to it.]),,
1408     [with_system_mysql="$with_system_libs"])
1410 AC_ARG_WITH(libmysql-path,
1411     AS_HELP_STRING([--with-libmysql-path],
1412         [Use Connector/C (libmysql) installation for building the MySQL
1413          Connector/LibreOffice extension.])
1414     [
1415                           Usage:     --with-libmysql-path=<absolute path to
1416                                                   your Connector/C installation>
1417     ],
1420 AC_ARG_WITH(system-mysql-cppconn,
1421     AS_HELP_STRING([--with-system-mysql-cppconn],
1422         [Use MySQL C++ Connector libraries already on system.]),,
1423     [with_system_mysql_cppconn="$with_system_libs"])
1425 AC_ARG_WITH(system-postgresql,
1426     AS_HELP_STRING([--with-system-postgresql],
1427         [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
1428          driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
1429     [with_system_postgresql="$with_system_libs"])
1431 AC_ARG_WITH(libpq-path,
1432     AS_HELP_STRING([--with-libpq-path],
1433         [Use this PostgreSQL C interface (libpq) installation for building
1434          the PostgreSQL-SDBC extension.])
1435     [
1436                           Usage:     --with-libpq-path=<absolute path to
1437                                                   your libq installation>
1438     ],
1441 AC_ARG_WITH(system-hsqldb,
1442     AS_HELP_STRING([--with-system-hsqldb],
1443         [Use hsqldb already on system.]))
1445 AC_ARG_WITH(hsqldb-jar,
1446     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
1447         [Specify path to jarfile manually.]),
1448     HSQLDB_JAR=$withval)
1450 AC_ARG_ENABLE(scripting-beanshell,
1451     AS_HELP_STRING([--disable-scripting-beanshell],
1452         [Disable support for scripts in BeanShell.]),
1456 AC_ARG_WITH(system-beanshell,
1457     AS_HELP_STRING([--with-system-beanshell],
1458         [Use beanshell already on system.]),,
1459     [with_system_beanshell="$with_system_jars"])
1461 AC_ARG_WITH(beanshell-jar,
1462     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
1463         [Specify path to jarfile manually.]),
1464     BSH_JAR=$withval)
1466 AC_ARG_ENABLE(scripting-javascript,
1467     AS_HELP_STRING([--disable-scripting-javascript],
1468         [Disable support for scripts in JavaScript.]),
1472 AC_ARG_WITH(system-rhino,
1473     AS_HELP_STRING([--with-system-rhino],
1474         [Use rhino already on system.]),,)
1475 #    [with_system_rhino="$with_system_jars"])
1476 # Above is not used as we have different debug interface
1477 # patched into internal rhino. This code needs to be fixed
1478 # before we can enable it by default.
1480 AC_ARG_WITH(rhino-jar,
1481     AS_HELP_STRING([--with-rhino-jar=JARFILE],
1482         [Specify path to jarfile manually.]),
1483     RHINO_JAR=$withval)
1485 AC_ARG_WITH(commons-codec-jar,
1486     AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
1487         [Specify path to jarfile manually.]),
1488     COMMONS_CODEC_JAR=$withval)
1490 AC_ARG_WITH(commons-lang-jar,
1491     AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
1492         [Specify path to jarfile manually.]),
1493     COMMONS_LANG_JAR=$withval)
1495 AC_ARG_WITH(commons-httpclient-jar,
1496     AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
1497         [Specify path to jarfile manually.]),
1498     COMMONS_HTTPCLIENT_JAR=$withval)
1500 AC_ARG_WITH(commons-logging-jar,
1501     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
1502         [Specify path to jarfile manually.]),
1503     COMMONS_LOGGING_JAR=$withval)
1505 AC_ARG_WITH(system-servlet-api,
1506     AS_HELP_STRING([--with-system-servlet-api],
1507         [Use servlet-api already on system.]),,
1508     [with_system_servlet_api="$with_system_jars"])
1510 AC_ARG_WITH(servlet-api-jar,
1511     AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
1512         [Specify path to jarfile manually.]),
1513     SERVLETAPI_JAR=$withval)
1515 AC_ARG_WITH(system-jfreereport,
1516     AS_HELP_STRING([--with-system-jfreereport],
1517         [Use JFreeReport already on system.]),,
1518     [with_system_jfreereport="$with_system_jars"])
1520 AC_ARG_WITH(sac-jar,
1521     AS_HELP_STRING([--with-sac-jar=JARFILE],
1522         [Specify path to jarfile manually.]),
1523     SAC_JAR=$withval)
1525 AC_ARG_WITH(libxml-jar,
1526     AS_HELP_STRING([--with-libxml-jar=JARFILE],
1527         [Specify path to jarfile manually.]),
1528     LIBXML_JAR=$withval)
1530 AC_ARG_WITH(flute-jar,
1531     AS_HELP_STRING([--with-flute-jar=JARFILE],
1532         [Specify path to jarfile manually.]),
1533     FLUTE_JAR=$withval)
1535 AC_ARG_WITH(jfreereport-jar,
1536     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
1537         [Specify path to jarfile manually.]),
1538     JFREEREPORT_JAR=$withval)
1540 AC_ARG_WITH(liblayout-jar,
1541     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
1542         [Specify path to jarfile manually.]),
1543     LIBLAYOUT_JAR=$withval)
1545 AC_ARG_WITH(libloader-jar,
1546     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1547         [Specify path to jarfile manually.]),
1548     LIBLOADER_JAR=$withval)
1550 AC_ARG_WITH(libloader-jar,
1551     AS_HELP_STRING([--with-libloader-jar=JARFILE],
1552         [Specify path to jarfile manually.]),
1553     LIBLOADER_JAR=$withval)
1555 AC_ARG_WITH(libformula-jar,
1556     AS_HELP_STRING([--with-libformula-jar=JARFILE],
1557         [Specify path to jarfile manually.]),
1558     LIBFORMULA_JAR=$withval)
1560 AC_ARG_WITH(librepository-jar,
1561     AS_HELP_STRING([--with-librepository-jar=JARFILE],
1562         [Specify path to jarfile manually.]),
1563     LIBREPOSITORY_JAR=$withval)
1565 AC_ARG_WITH(libfonts-jar,
1566     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
1567         [Specify path to jarfile manually.]),
1568     LIBFONTS_JAR=$withval)
1570 AC_ARG_WITH(libserializer-jar,
1571     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
1572         [Specify path to jarfile manually.]),
1573     LIBSERIALIZER_JAR=$withval)
1575 AC_ARG_WITH(libbase-jar,
1576     AS_HELP_STRING([--with-libbase-jar=JARFILE],
1577         [Specify path to jarfile manually.]),
1578     LIBBASE_JAR=$withval)
1580 AC_ARG_WITH(system-odbc,
1581     AS_HELP_STRING([--with-system-odbc],
1582         [Use the odbc headers already on system.]),,
1583     [with_system_odbc="$with_system_headers"])
1585 AC_ARG_WITH(system-sane,
1586     AS_HELP_STRING([--with-system-sane],
1587         [Use sane.h already on system.]),,
1588     [with_system_sane="$with_system_headers"])
1590 AC_ARG_WITH(system-bluez,
1591     AS_HELP_STRING([--with-system-bluez],
1592         [Use bluetooth.h already on system.]),,
1593     [with_system_bluez="$with_system_headers"])
1595 AC_ARG_WITH(system-xextensions-headers,
1596     AS_HELP_STRING([--with-system-xextensions-headers],
1597         [To build without system X11 extensions headers, use
1598          --without-system-xextensions-headers. This is possibly
1599          useful on legacy unix systems which ship with the libs
1600          but without the headers.]))
1602 AC_ARG_WITH(system-mesa-headers,
1603     AS_HELP_STRING([--with-system-mesa-headers],
1604         [Use Mesa headers already on system.]),,
1605     [with_system_mesa_headers="$with_system_headers"])
1607 AC_ARG_WITH(system-curl,
1608     AS_HELP_STRING([--with-system-curl],
1609         [Use curl already on system.]),,
1610     [with_system_curl=auto])
1612 AC_ARG_WITH(system-boost,
1613     AS_HELP_STRING([--with-system-boost],
1614         [Use boost already on system.]),,
1615     [with_system_boost="$with_system_headers"])
1617 AC_ARG_WITH(system-mdds,
1618     AS_HELP_STRING([--with-system-mdds],
1619         [Use mdds already on system.]),,
1620     [with_system_mdds="$with_system_headers"])
1622 AC_ARG_WITH(system-vigra,
1623     AS_HELP_STRING([--with-system-vigra],
1624         [Use vigra already on system.]),,
1625     [with_system_vigra="$with_system_headers"])
1627 AC_ARG_WITH(system-neon,
1628     AS_HELP_STRING([--with-system-neon],
1629         [Use neon already on system.]),,
1630     [with_system_neon="$with_system_libs"])
1632 AC_ARG_WITH(system-hunspell,
1633     AS_HELP_STRING([--with-system-hunspell],
1634         [Use libhunspell already on system.]),,
1635     [with_system_hunspell="$with_system_libs"])
1637 AC_ARG_WITH(system-mythes,
1638     AS_HELP_STRING([--with-system-mythes],
1639         [Use mythes already on system.]),,
1640     [with_system_mythes="$with_system_libs"])
1642 AC_ARG_WITH(system-altlinuxhyph,
1643     AS_HELP_STRING([--with-system-altlinuxhyph],
1644         [Use ALTLinuxhyph already on system.]),,
1645     [with_system_altlinuxhyph="$with_system_libs"])
1647 AC_ARG_WITH(system-lpsolve,
1648     AS_HELP_STRING([--with-system-lpsolve],
1649         [Use lpsolve already on system.]),,
1650     [with_system_lpsolve="$with_system_libs"])
1652 AC_ARG_WITH(system-libexttextcat,
1653     AS_HELP_STRING([--with-system-libexttextcat],
1654         [Use libexttextcat already on system.]),,
1655     [with_system_libexttextcat="$with_system_libs"])
1657 AC_ARG_WITH(system-cppunit,
1658     AS_HELP_STRING([--with-system-cppunit],
1659         [Use cppunit already on system.]),,
1660     [with_system_cppunit="$with_system_libs"])
1662 AC_ARG_WITH(system-redland,
1663     AS_HELP_STRING([--with-system-redland],
1664         [Use redland library already on system.]),,
1665     [with_system_redland="$with_system_libs"])
1667 AC_ARG_WITH(system-orcus,
1668     AS_HELP_STRING([--with-system-orcus],
1669         [Use orcus library already on system.]),,
1670     [with_system_orcus="$with_system_libs"])
1672 AC_ARG_WITH(system-liblangtag,
1673     AS_HELP_STRING([--with-system-liblangtag],
1674         [Use liblangtag library already on system.]),,
1675     [with_system_liblangtag="$with_system_libs"])
1677 AC_ARG_WITH(system-mozilla,
1678     AS_HELP_STRING([--with-system-mozilla],
1679         [DEPRECATED : is ignored]),,
1682 AC_ARG_WITH(system-npapi-headers,
1683     AS_HELP_STRING([--with-system-npapi-headers],
1684         [Use NPAPI headers provided by system instead of bundled ones. Used in
1685          extensions/source/nsplugin (ENABLE_NPAPI_INTO_BROWSER=YES) and
1686          extensions/source/plugin (ENABLE_NPAPI_FROM_BROWSER=YES)]),,
1687     [with_system_npapi_headers="$with_system_headers"]
1690 AC_ARG_WITH(system-libpng,
1691     AS_HELP_STRING([--with-system-libpng],
1692         [Use libpng already on system.]),,
1693     [with_system_libpng=auto])
1695 AC_ARG_WITH(linker-hash-style,
1696     AS_HELP_STRING([--with-linker-hash-style],
1697         [Use linker with --hash-style=<style> when linking shared objects.
1698          Possible values: "sysv", "gnu", "both". The default value is "gnu"
1699          if supported on the build system, and "sysv" otherwise.]))
1701 AC_ARG_WITH(jdk-home,
1702     AS_HELP_STRING([--with-jdk-home],
1703         [If you have installed JDK 1.3 or later on your system please supply the
1704          path here. Note that this is not the location of the java command but the
1705          location of the entire distribution.])
1706     [
1707                           Usage:     --with-jdk-home=<absolute path to JDK home>
1708     ],
1711 AC_ARG_WITH(help,
1712     AS_HELP_STRING([--without-help],
1713         [Disable the build of help.]))
1715 AC_ARG_WITH(mono-gac-root,
1716     AS_HELP_STRING([--with-mono-gac-root],
1717         [Define the root of the mono GAC. It is especially
1718          needed if you are using $DESTDIR and want to
1719          preinstall the mono DLLs into the GAC.])
1720     [
1721                           Usage:     --with-mono-gac-root=/usr/lib
1722     ],
1725 AC_ARG_WITH(java,
1726     AS_HELP_STRING([--with-java],
1727         [Specify the name of the Java interpreter command. Typically "java"
1728          which is the default.
1730          To build without support for Java components, applets, accessibility
1731          or the XML filters written in Java, use --without-java or --with-java=no.])
1732     [
1733                           Usage:     --with-java==<java command>
1734                                      --without-java
1735     ],
1736     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
1737     [ with_java=java ]
1740 AC_ARG_WITH(jvm-path,
1741     AS_HELP_STRING([--with-jvm-path],
1742         [Use a specific JVM search path at runtime.])
1743     [
1744                           Usage:     --with-jvm-path=<absolute path to parent of jvm home>
1746                           e. g.: --with-jvm-path=/usr/lib/
1747                                  to find JRE/JDK in /usr/lib/jvm/
1748     ],
1751 AC_ARG_WITH(ant-home,
1752     AS_HELP_STRING([--with-ant-home],
1753         [If you have installed Jakarta Ant on your system, please supply the path here.
1754          Note that this is not the location of the Ant binary but the location
1755          of the entire distribution.])
1756     [
1757                           Usage:     --with-ant-home=<absolute path to Ant home>
1758     ],
1761 AC_ARG_WITH(junit,
1762     AS_HELP_STRING([--with-junit],
1763         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
1764          --without-junit disables those tests. Not relevant in the --without-java case.])
1765     [
1766                           Usage:     --with-junit=<absolute path to JUnit 4 jar>
1767     ],
1768 ,with_junit=yes)
1770 AC_ARG_WITH(perl-home,
1771     AS_HELP_STRING([--with-perl-home],
1772         [If you have installed Perl 5 Distribution, on your system, please
1773          supply the path here. Note that this is not the location of the Perl
1774          binary but the location of the entire distribution.])
1775     [
1776                           Usage:     --with-perl-home=<abs. path to Perl 5 home>
1777     ],
1780 AC_ARG_WITH(
1781     [doxygen],
1782     AS_HELP_STRING(
1783         [--with-doxygen],
1784         [Specifies the doxygen executable to use when generating ODK C/C++
1785          documentation. --without-doxygen disables generation of ODK C/C++
1786          documentation. Not relevant in the --disable-odk case.])
1787     [
1788                           Usage:     --with-doxygen=<absolute path to doxygen executable>
1789     ],,
1790     [with_doxygen=yes])
1792 AC_ARG_WITH(cl-home,
1793     AS_HELP_STRING([--with-cl-home],
1794         [For Windows NT users, please supply the path for the Microsoft C/C++
1795          compiler. Note that this is not the location of the compiler binary but
1796          the location of the entire distribution.])
1797     [
1798                           Usage:     --with-cl-home=<absolute path to Microsoft
1799                                                             C/C++ compiler home>
1800     ],
1803 AC_ARG_WITH(mspdb-path,
1804     AS_HELP_STRING([--with-mspdb-path],
1805         [For Microsoft C/C++ compiler users, please supply the path pointing to
1806          the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
1807          Visual Studio 2010).])
1808     [
1809                           Usage:     --with-mspdb-path=<path to
1810                                                        mspdb80.dll/mspdb100.dll>
1811     ],
1814 AC_ARG_WITH(midl-path,
1815     AS_HELP_STRING([--with-midl-path],
1816         [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
1817     [
1818                           Usage:     --with-midl-path=<abs. path to midl.exe>
1819     ],
1822 AC_ARG_WITH(csc-path,
1823     AS_HELP_STRING([--with-csc-path],
1824         [For Windows builds, please supply the path pointing to the csc.exe.
1825          Usually found automatically when building on Windows.])
1826     [
1827                           Usage:     --with-csc-path=<abs. path to csc.exe>
1828     ],
1831 AC_ARG_WITH(dotnet-framework-home,
1832     AS_HELP_STRING([--with-dotnet-framework-home],
1833         [For Microsoft compiler users, please supply the path pointing to
1834          lib/mscoree.lib, usually something like:
1835          "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
1836     [
1837                           Note that in most cases it will be automatically
1838                           found, though.
1840                           Usage:     --with-dotnet-framework-home=<absolute path to .NET
1841                                                           Framework>
1842     ],
1845 AC_ARG_WITH(windows-sdk-home,
1846     AS_HELP_STRING([--with-windows-sdk-home],
1847         [For Windows builds, please supply the path to the Windows SDK.
1848          Usually found automatically when building on Windows.])
1849     [
1850                           Usage:     --with-windows-sdk-home=<absolute path to Windows SDK>
1851     ],
1854 AC_ARG_WITH(directx-home,
1855     AS_HELP_STRING([--with-directx-home],
1856         [For Windows users, please supply the path to the Microsoft DirectX SDK.])
1857     [
1858                           Usage:     --with-directx-home=<absolute path to
1859                                                           Microsoft DirectX SDK>
1860     ],
1863 AC_ARG_WITH(nss-build-tools,
1864     AS_HELP_STRING([--with-nss-build-tools],
1865         [For Windows users, please supply the path to the nss build tools.])
1866     [
1867                           Usage:     --with-nss-build-tools=<absolute path to
1868                                                           nss build tools>
1870                           At the moment of this writing, an installer for the
1871                           mozilla build tools can be obtained from http://ftp.
1872                           mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
1873     ],
1874     NSSBUILDTOOLS=$withval ,
1875 ) # NSSBUILDTOOLS
1877 AC_ARG_WITH(lang,
1878     AS_HELP_STRING([--with-lang],
1879         [Use this option to build LibreOffice with additional language support.
1880          English (US) is always included by default.
1881          Separate multiple languages with space.
1882          For all languages, use --with-lang=ALL.])
1883     [
1884                           Usage:     --with-lang="es sw tu cs sk"
1885     ],
1888 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
1889 AC_ARG_WITH(krb5,
1890     AS_HELP_STRING([--with-krb5],
1891         [Enable MIT Kerberos 5 support in modules that support it.
1892          By default automatically enabled on platforms
1893          where a good system Kerberos 5 is available.]),
1896 AC_ARG_WITH(gssapi,
1897     AS_HELP_STRING([--with-gssapi],
1898         [Enable GSSAPI support in modules that support it.
1899          By default automatically enabled on platforms
1900          where a good system GSSAPI is available.]),
1903 dnl ===================================================================
1904 dnl Branding
1905 dnl ===================================================================
1907 AC_ARG_WITH(branding,
1908 [  --with-branding        Use given path to retrieve all branding images.
1909                           Expects /path/intro.png ...
1910                           /path/backing_rtl_right.png to be there. Individual
1911                           images can be overridden via --with-intro-bitmap ...
1912                           --with-startcenter-rtl-left-bitmap switches.
1914                           Usage:     --with-branding=/path/to/images
1915 ],,)
1917 AC_ARG_WITH(intro-bitmap,
1918 [  --with-intro-bitmap    Prefer the specified intro bitmap over the
1919                           the default one.
1921                           Usage:     --with-intro-bitmap=/path/my_ooo_intro.png
1922 ],,)
1924 AC_ARG_WITH(intro-progressbar-color,
1925 [  --with-intro-progressbar-color    Set color of progress bar on intro screen.
1926                                      Comma separated RGB values in decimal format.
1928                           Usage: --with-intro-progressbar-color=126,170,23
1929 ],,)
1931 AC_ARG_WITH(intro-progressbar-size,
1932 [  --with-intro-progressbar-size     Set size of progress bar on intro screen.
1933                                      Comma separated values in decimal format.
1935                           Usage: --with-intro-progressbar-size=319,10
1936 ],,)
1938 AC_ARG_WITH(intro-progressbar-position,
1939 [  --with-intro-progressbar-position Set position of progress bar on intro screen.
1940                                      Comma separated values in decimal format.
1942                           Usage: --with-intro-progressbar-position=164,225
1943 ],,)
1945 AC_ARG_WITH(intro-progressbar-frame-color,
1946 [  --with-intro-progressbar-frame-color    Set color of progress bar frame on intro screen.
1947                                            Comma separated RGB values in decimal format.
1949                           Usage: --with-intro-progressbar-frame-color=207,208,211
1950 ],,)
1952 AC_ARG_WITH(intro-progressbar-text-color,
1953     AS_HELP_STRING([--with-intro-progressbar-text-color],
1954         [Set color of progress bar text on intro screen. Comma separated RGB values in decimal format.])
1955     [
1956                           Usage: --with-intro-progressbar-text-color=207,208,211
1957 ],,)
1959 AC_ARG_WITH(intro-progressbar-text-baseline,
1960     AS_HELP_STRING([--with-intro-progressbar-text-baseline],
1961         [Set vertical position of progress bar text on intro screen. Value in decimal format.])
1962     [
1963                           Usage: --with-intro-progressbar-text-baseline=250
1964 ],,)
1966 AC_ARG_WITH(flat-logo-svg,
1967 [  --with-flat-logo-svg    Allows specification of the flat Logo SVG.
1969                           Usage:     --with-flat-logo-svg=/path/my_flat_logo.svg
1970 ],,)
1972 AC_ARG_WITH(about-background-svg,
1973 [  --with-about-background-svg    Allows specification of the background SVG for the About dialog.
1975                           Usage:     --with-about-background-svg=/path/my_libo_about.svg
1976 ],,)
1978 AC_ARG_WITH(startcenter-left-bitmap,
1979 [  --with-startcenter-left-bitmap    Similarly to --with-intro-bitmap, this allows
1980                                      specification of bitmap for the Start center.
1982                           Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
1983 ],,)
1985 AC_ARG_WITH(startcenter-right-bitmap,
1986 [  --with-startcenter-right-bitmap    Similarly to --with-intro-bitmap, this allows
1987                                       specification of bitmap for the Start center.
1989                           Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
1990 ],,)
1992 AC_ARG_WITH(startcenter-rtl-left-bitmap,
1993 [  --with-startcenter-rtl-left-bitmap    Similarly to --with-intro-bitmap, this allows
1994                                          specification of bitmap for the Start center.
1996                           Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
1997 ],,)
1999 AC_ARG_WITH(startcenter-rtl-right-bitmap,
2000 [  --with-startcenter-rtl-right-bitmap    Similarly to --with-intro-bitmap, this allows
2001                                           specification of bitmap for the Start center.
2003                           Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
2004 ],,)
2006 AC_ARG_WITH(startcenter-space-bitmap,
2007 [  --with-startcenter-space-bitmap    Similarly to --with-intro-bitmap, this allows
2008                                       specification of bitmap for the Start center.
2010                           Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
2011 ],,)
2013 AC_ARG_WITH(extra-buildid,
2014     AS_HELP_STRING([--with-extra-buildid],
2015         [Show addition build identification in about dialog.])
2016     [
2017                           Usage:     --with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"
2018     ],
2022 AC_ARG_WITH(vendor,
2023     AS_HELP_STRING([--with-vendor],
2024         [Set vendor of the build.])
2025     [
2026                           Usage:     --with-vendor="John the Builder"
2027     ],
2030 AC_ARG_WITH(unix-wrapper,
2031     AS_HELP_STRING([--with-unix-wrapper],
2032         [Redefines the name of the UNIX wrapper that will be used in the desktop
2033          files and in the desktop-integration RPMs.])
2034     [
2035                           Usage:     --with-unix-wrapper=ooffice
2036     ],
2039 AC_ARG_WITH(compat-oowrappers,
2040     AS_HELP_STRING([--with-compat-oowrappers],
2041         [Install oo* wrappers in parallel with
2042          lo* ones to keep backward compatibility.
2043          Has effect only with make distro-pack-install]),
2046 AC_ARG_WITH(asm-home,
2047     AS_HELP_STRING([--with-asm-home],
2048         [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
2049     [
2050                           Usage:     --with-asm-home=<path to assembler directory>
2051     ],
2054 AC_ARG_WITH(os-version,
2055     AS_HELP_STRING([--with-os-version],
2056         [For FreeBSD users, use this option option to override the detected OSVERSION.])
2057     [
2058                           Usage:     --with-os-version=<OSVERSION>
2059     ],
2062 AC_ARG_WITH(mingw-cross-compiler,
2063     AS_HELP_STRING([--with-mingw-cross-compiler],
2064         [Specify the MinGW cross-compiler to use.])
2065     [
2066                           Usage:     --with-mingw-cross-compiler=<mingw32-g++ command>
2068                           When building on the ODK on Unix and building unowinreg.dll,
2069                           specify the MinGW C++ cross-compiler.
2070     ],
2073 AC_ARG_WITH(idlc-cpp,
2074     AS_HELP_STRING([--with-idlc-cpp],
2075         [Specify the C Preprocessor to use for idlc.])
2076     [
2077                           Usage:     --with-idlc-cpp=cpp
2079                           Default is ucpp.
2080     ]
2083 AC_ARG_WITH(build-version,
2084     AS_HELP_STRING([--with-build-version],
2085         [Allows the builder to add a custom version tag that will appear in the
2086          Help/About box for QA purposes.])
2087     [
2088                           Usage:     --with-build-version="Built by Jim"
2089     ],
2090     with_build_version=$withval ,
2093 AC_ARG_WITH(alloc,
2094     AS_HELP_STRING([--with-alloc],
2095         [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
2096          Note that on FreeBSD/NetBSD system==jemalloc]),
2099 AC_ARG_WITH(sun-templates,
2100     AS_HELP_STRING([--with-sun-templates],
2101         [Integrate Sun template packages.]),
2104 AC_ARG_WITH(parallelism,
2105     AS_HELP_STRING([--with-parallelism],
2106         [Number of jobs to run simultaneously during build. Parallel builds can save a lot
2107          of time on multi-cpu machines. The real number of jobs can get up to parallelism*parallelism
2108          for a while in the first build phase. That will not happen when dmake is removed.
2109          Defaults to the number of CPUs on the machine, unless you configure --enable-icecream - then to 10.]),
2112 AC_ARG_WITH(check-jobs,
2113     AS_HELP_STRING([--with-check-jobs],
2114         [Maximum number of jobs that will be issued at the same time during 'make subsequenttest'.
2115          Default value is the same as 'parallelism'. Useful because the subsequent tests are very lightweight.]),
2118 AC_ARG_WITH(all-tarballs,
2119     AS_HELP_STRING([--with-all-tarballs],
2120         [Download all external tarballs unconditionally]))
2122 dnl ===================================================================
2123 dnl Test whether build target is Release Build
2124 dnl ===================================================================
2125 AC_MSG_CHECKING([whether build target is Release Build])
2126 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
2127     AC_MSG_RESULT([no])
2128     ENABLE_RELEASE_BUILD="FALSE"
2129 else
2130     AC_MSG_RESULT([yes])
2131     ENABLE_RELEASE_BUILD="TRUE"
2133 AC_SUBST(ENABLE_RELEASE_BUILD)
2135 dnl ===================================================================
2136 dnl Test whether to sign Windows Build
2137 dnl ===================================================================
2138 AC_MSG_CHECKING([whether to sign windows build])
2139 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
2140     AC_MSG_RESULT([yes])
2141     WINDOWS_BUILD_SIGNING="TRUE"
2142 else
2143     AC_MSG_RESULT([no])
2144     WINDOWS_BUILD_SIGNING="FALSE"
2146 AC_SUBST(WINDOWS_BUILD_SIGNING)
2148 dnl ===================================================================
2149 dnl MacOSX build and runtime environment options
2150 dnl ===================================================================
2152 AC_ARG_WITH(macosx-sdk,
2153     AS_HELP_STRING([--with-macosx-sdk],
2154         [Use a specific SDK for building.])
2155     [
2156                           Usage:     --with-macosx-sdk=<version>
2158                           e. g.: --with-macosx-sdk=10.4
2160                           there are 3 options to control the MacOSX build:
2161                           --with-macosx-sdk (refered as 'sdk' below)
2162                           --with-macosx-version-min-required (refered as 'min' below)
2163                           --with-macosx-version-max-allowed (refered as 'max' below)
2165                           the connection between these value and the default they take is as follow:
2166                           ( ? means not specified on the command line, s means the SDK version found,
2167                           constraint: x <= y <= z)
2169                           ==========================================
2170                            command line      || config result
2171                           ==========================================
2172                           min  | max  | sdk  || min  | max  | sdk  |
2173                           ?    | ?    | ?    || 10.4 | 10.s | 10.s |
2174                           ?    | ?    | 10.x || 10.4 | 10.x | 10.x |
2175                           ?    | 10.x | ?    || 10.4 | 10.s | 10.s |
2176                           ?    | 10.x | 10.y || 10.4 | 10.x | 10.y |
2177                           10.x | ?    | ?    || 10.x | 10.s | 10.s |
2178                           10.x | ?    | 10.y || 10.x | 10.y | 10.y |
2179                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
2180                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
2183                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
2184                           for a detailled technical explanation of these variables
2186                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
2188                           Note that even if in theory using a --with-macosx-version-max-allowed
2189                           (i.e. the MAC_OS_X_VERSION_MAX_ALLOWED macro) less than the SDK version
2190                           should work, in practice Apple doesn't seem to test that, and at least
2191                           compiling with -DMAC_OS_X_VERSION_MAX_ALLOWED=1060 against the 10.7 SDK
2192                           fails in a couple of places. Just because of oversights in ifdefs in the SDK
2193                           headers, but still.
2194     ],
2197 AC_ARG_WITH(macosx-version-min-required,
2198     AS_HELP_STRING([--with-macosx-version-min-required],
2199         [set the minimum OS version needed to run the built LibreOffice])
2200     [
2201                           Usage:     --with-macosx-version-min-required=<version>
2203                           e. g.: --with-macos-version-min-required=10.4
2204                           see --with-macosx-sdk for more info
2205     ],
2208 AC_ARG_WITH(macosx-version-max-allowed,
2209     AS_HELP_STRING([--with-macosx-version-max-allowed],
2210         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
2211     [
2212                           Usage:     --with-macosx-version-max-allowed=<version>
2214                           e. g.: --with-macos-version-max-allowed=10.6
2215                           see --with-macosx-sdk for more info
2216     ],
2220 dnl ===================================================================
2221 dnl options for stuff used during cross-compilation build
2222 dnl These are superseded by --with-build-platform-configure-options
2223 dnl ===================================================================
2225 AC_ARG_WITH(system-boost-for-build,
2226     AS_HELP_STRING([--with-system-boost-for-build],
2227         [Use boost already on system for build tools (cross-compilation only).]))
2229 AC_ARG_WITH(system-cppunit-for-build,
2230     AS_HELP_STRING([--with-system-cppunit-for-build],
2231         [Use cppunit already on system for build tools (cross-compilation only).]))
2233 AC_ARG_WITH(system-expat-for-build,
2234     AS_HELP_STRING([--with-system-expat-for-build],
2235         [Use expat already on system for build tools (cross-compilation only).]))
2237 AC_ARG_WITH(system-icu-for-build,
2238     AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
2239         [Use icu already on system for build tools (cross-compilation only).]))
2241 AC_ARG_WITH(system-libxml-for-build,
2242     AS_HELP_STRING([--with-system-libxml-for-build],
2243         [Use libxml/libxslt already on system for build tools (cross-compilation only).]))
2246 dnl ===================================================================
2247 dnl check for required programs (grep, awk, sed, bash)
2248 dnl ===================================================================
2250 pathmunge ()
2252     if test -n "$1"; then
2253         if test "$build_os" = "cygwin"; then
2254             PathFormat "$1"
2255             new_path=`cygpath -u "$formatted_path"`
2256         else
2257             new_path="$1"
2258         fi
2259         if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
2260             if test "$2" = "after"; then
2261                 LO_PATH="$LO_PATH:$new_path"
2262             else
2263                 LO_PATH="$new_path:$LO_PATH"
2264             fi
2265         fi
2266         unset new_path
2267     fi
2270 AC_PROG_AWK
2271 AC_PATH_PROG( AWK, $AWK)
2272 if test -z "$AWK"; then
2273     AC_MSG_ERROR([install awk to run this script])
2276 AC_PATH_PROG(BASH, bash)
2277 if test -z "$BASH"; then
2278     AC_MSG_ERROR([bash not found in \$PATH])
2280 AC_SUBST(BASH)
2282 AC_MSG_CHECKING([for GNU or BSD tar])
2283 for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
2284     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
2285     if test $? -eq 0;  then
2286         GNUTAR=$a
2287         break
2288     fi
2289 done
2290 AC_MSG_RESULT($GNUTAR)
2291 if test -z "$GNUTAR"; then
2292     AC_MSG_ERROR([not found. install GNU or BSD tar.])
2294 AC_SUBST(GNUTAR)
2296 AC_MSG_CHECKING([for tar's option to strip components])
2297 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
2298 if test $? -eq 0; then
2299     STRIP_COMPONENTS="--strip-components"
2300 else
2301     $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
2302     if test $? -eq 0; then
2303         STRIP_COMPONENTS="--strip-path"
2304     else
2305         STRIP_COMPONENTS="unsupported"
2306     fi
2308 AC_MSG_RESULT($STRIP_COMPONENTS)
2309 if test x$STRIP_COMPONENTS == xunsupported; then
2310     AC_MSG_ERROR([you need a tar that is able to strip components.])
2312 AC_SUBST(STRIP_COMPONENTS)
2314 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
2315 dnl desktop OSes from "mobile" ones.
2317 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
2318 dnl In other words, that when building for an OS that is not a
2319 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
2321 dnl Note the direction of the implication; there is no assumption that
2322 dnl cross-compiling would imply a non-desktop OS.
2324 if test $_os != iOS -a $_os != Android; then
2325     BUILD_TYPE="$BUILD_TYPE DESKTOP"
2328 # Currently we build only viewer apps for Android (and for iOS not even that yet), so to avoid getting
2329 # some pathological export-related code and data linked in, we will add some judicious #ifndef
2330 # DISABLE_EXPORT in the code in places where the linker map shows it has a big impact. Places that
2331 # generate large amounts of code or data related to export only but still gets linked in. At least
2332 # that is the theory, let's see...
2334 if test -z "$enable_export"; then
2335     if test $_os != Android -a $_os != iOS; then
2336         enable_export=yes
2337     fi
2340 DISABLE_EXPORT=''
2341 if test "$enable_export" = yes; then
2342     BUILD_TYPE="$BUILD_TYPE EXPORT"
2343 else
2344     DISABLE_EXPORT='TRUE'
2345     SCPDEFS="$SCPDES -DDISABLE_EXPORT"
2347 AC_SUBST(DISABLE_EXPORT)
2349 dnl Decide whether to build database connectivity stuff (including
2350 dnl Base) or not. We probably don't want to on non-desktop OSes.
2352 if test -z "$enable_database_connectivity"; then
2353     # Do enable database connectivity for Android for now as otherwise
2354     # we presumably will get linking errors... We are not as far in
2355     # the work for iOS, so we might as well disable it for iOS already.
2357     # And actually, do enable it for iOS, too. Let's get back to
2358     # figuring out what to do with this later, if ever.
2360     # (Note that with "enable", I mean "enable building the related
2361     # code". Very likely little of it will make any sense at run-time
2362     # on Android or iOS and won't even be shipped with/linked into any
2363     # app.)
2365     #if test $_os != iOS; then
2366         enable_database_connectivity=yes
2367     #fi
2370 DISABLE_DBCONNECTIVITY=''
2371 if test "$enable_database_connectivity" = yes; then
2372     BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
2373 else
2374     DISABLE_DBCONNECTIVITY='TRUE'
2375     SCPDEFS="$SCPDEFS -DDISABLE_DBCONNECTIVITY"
2377 AC_SUBST(DISABLE_DBCONNECTIVITY)
2379 if test -z "$enable_extensions"; then
2380     # For iOS disable extensions unless specifically overridden with
2381     # --enable-extensions.
2382     if test $_os != iOS; then
2383         enable_extensions=yes
2384     fi
2387 DISABLE_EXTENSIONS=''
2388 if test "$enable_extensions" = yes; then
2389     BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
2390 else
2391     DISABLE_EXTENSIONS='TRUE'
2393 AC_SUBST(DISABLE_EXTENSIONS)
2395 if test -z "$enable_scripting"; then
2396     # Disable scripting for iOS unless specifically overridden
2397     # with --enable-scripting.
2398     if test $_os != iOS; then
2399         enable_scripting=yes
2400     fi
2403 DISABLE_SCRIPTING=''
2404 if test "$enable_scripting" = yes; then
2405     BUILD_TYPE="$BUILD_TYPE SCRIPTING"
2406 else
2407     DISABLE_SCRIPTING='TRUE'
2408     SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
2410 AC_SUBST(DISABLE_SCRIPTING)
2412 if test $_os = iOS -o $_os = Android; then
2413     # Disable dynamic_loading always for iOS and Android
2414     enable_dynamic_loading=no
2415 elif test -z "$enable_dynamic_loading"; then
2416     # Otherwise enable it unless speficically disabled
2417     enable_dynamic_loading=yes
2420 DISABLE_DYNLOADING=''
2421 if test "$enable_dynamic_loading" = yes; then
2422     BUILD_TYPE="$BUILD_TYPE DYNLOADING"
2423 else
2424     DISABLE_DYNLOADING='TRUE'
2425     SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
2427 AC_SUBST(DISABLE_DYNLOADING)
2429 if test -n "${with_solver_and_workdir_root}"; then
2430     if ! test -d ${with_solver_and_workdir_root}; then
2431       AC_MSG_ERROR([directory does not exist: ${with_solver_and_workdir_root}])
2432     fi
2433     PathFormat "${with_solver_and_workdir_root}"
2434     # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
2435     if echo ${formatted_path} | $GREP -q '/$'; then
2436         SOLARVER=${formatted_path}solver
2437     else
2438         SOLARVER=${formatted_path}/solver
2439     fi
2440 else
2441     SOLARVER=${SRC_ROOT}/solver
2444 dnl ===================================================================
2445 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
2446 dnl although MSVC is used to build other build-time tools and
2447 dnl LibreOffice itself.
2448 dnl ===================================================================
2449 if test "$build_os" = "cygwin"; then
2450     AC_MSG_CHECKING([for Cygwin gcc/g++])
2451     if which gcc > /dev/null && which g++ > /dev/null; then
2452         AC_MSG_RESULT([found])
2453     else
2454         AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
2455     fi
2458 # remenber SYSBASE value
2459 AC_SUBST(SYSBASE)
2461 dnl ===================================================================
2462 dnl  Checks if ccache is available
2463 dnl ===================================================================
2464 if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
2465     case "%$CC%$CXX%" in
2466     # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some verison number etc),
2467     # assume that's good then
2468     *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
2469         AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
2470         ;;
2471     *)
2472         AC_PATH_PROG([CCACHE],[ccache],[not found])
2473         if test "$CCACHE" = "not found"; then
2474             CCACHE=""
2475         else
2476             # Need to check for ccache version: otherwise prevents
2477             # caching of the results (like "-x objective-c++" for Mac)
2478             if test $_os = Darwin -o $_os = iOS; then
2479                 # Check ccache version
2480                 AC_MSG_CHECKING([whether version of ccache is suitable])
2481                 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
2482                 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2483                 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
2484                     AC_MSG_RESULT([yes, $CCACHE_VERSION])
2485                 else
2486                     AC_MSG_RESULT([no, $CCACHE_VERSION])
2487                     CCACHE=""
2488                 fi
2489             fi
2490         fi
2491         ;;
2492     esac
2493 else
2494     CCACHE=""
2497 if test "$CCACHE" != ""; then
2498     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
2499     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
2500     if test "$ccache_size" = ""; then
2501         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
2502         if test "$ccache_size" = ""; then
2503             ccache_size=0
2504         fi
2505         # we could not determine the size or it was less than 1GB -> disable auto-ccache
2506         if test $ccache_size -lt 1024; then
2507             CCACHE=""
2508             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
2509             add_warning "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled"
2510         else
2511             # warn that ccache may be too small for debug build
2512             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2513             add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
2514         fi
2515     else
2516         if test $ccache_size -lt 5; then
2517             #warn that ccache may be too small for debug build
2518             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
2519             add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
2520         fi
2521     fi
2524 dnl ===================================================================
2525 dnl  Checks for C compiler,
2526 dnl  The check for the C++ compiler is later on.
2527 dnl ===================================================================
2528 GCC_HOME_SET="true"
2529 AC_MSG_CHECKING([gcc home])
2530 if test -z "$with_gcc_home"; then
2531     if test "$enable_icecream" = "yes"; then
2532         if test -d "/usr/lib/icecc/bin"; then
2533             GCC_HOME="/usr/lib/icecc/"
2534         else
2535             GCC_HOME="/opt/icecream/"
2536         fi
2537     else
2538         GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
2539         GCC_HOME_SET="false"
2540     fi
2541 else
2542     GCC_HOME="$with_gcc_home"
2544 AC_MSG_RESULT($GCC_HOME)
2545 AC_SUBST(GCC_HOME)
2547 if test "$GCC_HOME_SET" = "true"; then
2548     if test -z "$CC"; then
2549         CC="$GCC_HOME/bin/gcc"
2550     fi
2551     if test -z "$CXX"; then
2552         CXX="$GCC_HOME/bin/g++"
2553     fi
2556 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
2557 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
2558     # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
2559     save_CFLAGS=$CFLAGS
2560     AC_PROG_CC
2561     CFLAGS=$save_CFLAGS
2564 COMPATH=`dirname "$CC"`
2565 if test "$COMPATH" = "."; then
2566     AC_PATH_PROGS(COMPATH, $CC)
2567     dnl double square bracket to get single because of M4 quote...
2568     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
2570 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
2572 dnl ===================================================================
2573 dnl  Test the Solaris compiler version
2574 dnl ===================================================================
2575 if test "$_os" = "SunOS"; then
2576     if test "$CC" = "cc"; then
2577         AC_PATH_PROGS(_cc, cc)
2578         COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
2579         AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
2580         dnl cc -V outputs to standard error!!!!
2581         _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
2582         _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
2583         _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
2584         if test "$_sunstudio_major" != "5"; then
2585             AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2586         else
2587             _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" }'`
2588             if test "$_sunstudio_minor" = "false"; then
2589                 AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
2590             else
2591                 dnl compiler will do
2592                 AC_MSG_RESULT([checked])
2593             fi
2594         fi
2595     fi
2599 dnl ===================================================================
2600 dnl Check / find MacOSX SDK and compiler, version checks
2601 dnl ===================================================================
2602 if test "$_os" = "Darwin"; then
2604     if test "$build_cpu" = i386 -a "$host_cpu" = powerpc; then
2605         # Cross-compiling for PPC from Intel
2606         arch='-arch ppc'
2607     elif test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2608         bitness=-m32
2609     else
2610         bitness=-m64
2611         BITNESS_OVERRIDE=64
2612     fi
2614     # If no --with-macosx-sdk option is given, first look for the 10.4u
2615     # SDK (which is distributed with the obsolete Xcode 3), then the
2616     # 10.6, 10.7 and 10.8 SDKs, in that order. (Don't bother looking
2617     # for the 10.5 SDK, unlikely somebody would have that but not
2618     # 10.6, I think.) If not found in some (old) default locations,
2619     # try the xcode-select tool.
2621     # The intent is that for "most" Mac-based developers, a suitable
2622     # SDK will be found automatically without any configure options.
2624     # For developers still using Xcode 2 or 3, in /Developer, either
2625     # because it is the only Xcode they have, or they have that in
2626     # addition to Xcode 4 in /Applications/Xcode.app, the 10.4 SDK
2627     # should be found.
2629     # For developers with a current Xcode 4 installed from the Mac App
2630     # Store, the 10.6, 10.7 or 10.8 SDK should be found.
2632     AC_MSG_CHECKING([what Mac OS X SDK to use])
2634     if test -z "$with_macosx_sdk"; then
2635         if test -d /Developer/SDKs/MacOSX10.4u.sdk; then
2636             with_macosx_sdk=10.4
2637         elif test -d /Developer-old/SDKs/MacOSX10.4u.sdk; then
2638             with_macosx_sdk=10.4
2639         elif test -d /Xcode3/SDKs/MacOSX10.4u.sdk; then
2640             with_macosx_sdk=10.4
2641         elif test -d /Developer/SDKs/MacOSX10.6.sdk; then
2642             with_macosx_sdk=10.6
2643         elif test -d /Developer/SDKs/MacOSX10.7.sdk; then
2644             with_macosx_sdk=10.7
2645         elif test -x /usr/bin/xcode-select; then
2646             xcodepath="`xcode-select -print-path`"
2647             if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
2648                 with_macosx_sdk=10.6
2649             elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"; then
2650                 with_macosx_sdk=10.7
2651             elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"; then
2652                 with_macosx_sdk=10.8
2653             fi
2654         fi
2655         if test -z "$with_macosx_sdk"; then
2656             AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
2657         fi
2658     fi
2660     case $with_macosx_sdk in
2661     10.4)
2662         MACOSX_SDK_VERSION=1040
2663         ;;
2664     10.5)
2665         MACOSX_SDK_VERSION=1050
2666         ;;
2667     10.6)
2668         MACOSX_SDK_VERSION=1060
2669         ;;
2670     10.7)
2671         MACOSX_SDK_VERSION=1070
2672         ;;
2673     10.8)
2674         MACOSX_SDK_VERSION=1080
2675         ;;
2676     *)
2677         AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported value are 10.4--8])
2678         ;;
2679     esac
2681     # Next find it (again, if we deduced its version above by finding
2682     # it... but we need to look for it once more in case
2683     # --with-macosx-sdk was given so that the aboce search did not
2684     # happen).
2685     if test -z "$MACOSX_SDK_PATH"; then
2686         case $with_macosx_sdk in
2687         10.4)
2688             if test -d /Developer/SDKs/MacOSX10.4u.sdk; then
2689                 MACOSX_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk
2690             elif test -d /Developer-old/SDKs/MacOSX10.4u.sdk; then
2691                 MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX10.4u.sdk
2692             elif test -d /Xcode3/SDKs/MacOSX10.4u.sdk; then
2693                 MACOSX_SDK_PATH=/Xcode3/SDKs/MacOSX10.4u.sdk
2694             fi
2695             ;;
2696         10.6|10.7|10.8)
2697             if test -d /Developer/SDKs/MacOSX$with_macosx_sdk.sdk; then
2698                 MACOSX_SDK_PATH=/Developer/SDKs/MacOSX$with_macosx_sdk.sdk
2699             elif test -x /usr/bin/xcode-select; then
2700                 xcodepath="`xcode-select -print-path`"
2701                 if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
2702                     MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
2703                 fi
2704             fi
2705             ;;
2706         esac
2707         if test -z "$MACOSX_SDK_PATH"; then
2708             AC_MSG_ERROR([Could not figure out the location of Mac OS X $with_macosx_sdk SDK])
2709         fi
2710     fi
2711     AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
2713     if test "$with_macosx_version_min_required" = ""; then
2714         case $with_macosx_sdk in
2715         10.4|10.5)
2716             with_macosx_version_min_required="10.4";;
2717         *)
2718             with_macosx_version_min_required="10.6";;
2719         esac
2720     fi
2722     if test "$with_macosx_version_max_allowed" = ""; then
2723         with_macosx_version_max_allowed="$with_macosx_sdk"
2724     fi
2726     FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
2727     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
2729     case "$with_macosx_version_min_required" in
2730     10.4)
2731         MAC_OS_X_VERSION_MIN_REQUIRED="1040"
2732         ;;
2733     10.5)
2734         MAC_OS_X_VERSION_MIN_REQUIRED="1050"
2735         ;;
2736     10.6)
2737         MAC_OS_X_VERSION_MIN_REQUIRED="1060"
2738         ;;
2739     10.7)
2740         MAC_OS_X_VERSION_MIN_REQUIRED="1070"
2741         ;;
2742     10.8)
2743         MAC_OS_X_VERSION_MIN_REQUIRED="1080"
2744         ;;
2745     *)
2746         AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported value are 10.4--8])
2747         ;;
2748     esac
2750     if test "$BITNESS_OVERRIDE" = 64; then
2751         case $with_macosx_version_min_required in
2752         10.4|10.5)
2753             AC_MSG_ERROR([Can't build 64-bit code for with-macosx-version-min-required=$with_macosx_version_min_required])
2754             ;;
2755         esac
2756     fi
2758     if test "$BITNESS_OVERRIDE" = ""; then
2759         case "$with_macosx_version_min_required" in
2760         10.4)
2761             case "$with_macosx_sdk" in
2762             10.4)
2763                 ;;
2764             *)
2765                 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])
2766                 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"
2767                 ;;
2768             esac
2769             ;;
2770         *)
2771             AC_MSG_WARN([Building with a minimum version requirement > 10.4 breaks 10.4 compatibility. Do not use for deliverable build])
2772             add_warning "Building with a minimum version requirement > 10.4 breaks 10.4 compatibility. Do not use for deliverable build"
2773             ;;
2774         esac
2775     fi
2777     # If no CC and CXX environment vars, try to guess where the compiler is
2778     if test -z "$save_CC"; then
2779         AC_MSG_CHECKING([what compiler to use])
2780         case $with_macosx_sdk in
2781         10.4)
2782             case "$MACOSX_SDK_PATH" in
2783             /Developer/*)
2784                 gccprefix=""
2785                 ;;
2786             /Developer-old/*)
2787                 gccprefix=/Developer-old/usr/bin/
2788                 ;;
2789             /Xcode3/*)
2790                 gccprefix=/Xcode3/usr/bin/
2791                 ;;
2792             *)
2793                 AC_MSG_ERROR([Cannot guess gcc location for this SDK])
2794                 ;;
2795             esac
2796             CC="${gccprefix}gcc-4.0 $arch -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2797             CXX="${gccprefix}g++-4.0 $arch -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2798             ;;
2799         10.6)
2800             # Is similar logic as above needed? Is it likely somebody
2801             # has both an older Xcode with the 10.6 SDK and a current
2802             # Xcode?
2803             CC="gcc-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2804             CXX="g++-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2805             ;;
2806         10.7|10.8)
2807             CC="`xcrun -find clang` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2808             CXX="`xcrun -find clang++` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
2809             XCRUN=xcrun
2810             ;;
2811         esac
2812         AC_MSG_RESULT([$CC and $CXX])
2813     fi
2815     case "$with_macosx_version_max_allowed" in
2816     10.4)
2817         MAC_OS_X_VERSION_MAX_ALLOWED="1040"
2818         ;;
2819     10.5)
2820         MAC_OS_X_VERSION_MAX_ALLOWED="1050"
2821         ;;
2822     10.6)
2823         MAC_OS_X_VERSION_MAX_ALLOWED="1060"
2824         ;;
2825     10.7)
2826         MAC_OS_X_VERSION_MAX_ALLOWED="1070"
2827         ;;
2828     10.8)
2829         MAC_OS_X_VERSION_MAX_ALLOWED="1080"
2830         ;;
2831     *)
2832         AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported value are 10.4--8])
2833         ;;
2834     esac
2836     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
2837     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
2838         AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
2839     else
2840         AC_MSG_RESULT([ok])
2841     fi
2843     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
2844     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
2845         AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
2846     else
2847         AC_MSG_RESULT([ok])
2848     fi
2849     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
2850     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
2852     AC_MSG_CHECKING([whether to do code signing])
2854     if test "$enable_macosx_code_signing" = yes; then
2855         # By default use the first suitable certificate (?).
2857         # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
2858         # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
2859         # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
2860         # the App Store, the "3rd Party Mac Developer" one. I think it works best to the the
2861         # "Developer ID Application" one.
2863         identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | awk '{print $2}' |head -1`
2864         if test -n "$identity"; then
2865             MACOSX_CODESIGNING_IDENTITY=$identity
2866             pretty_name=`security find-identity -p codesigning -v | grep $MACOSX_CODESIGNING_IDENTITY | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2867             AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2868         fi
2869     elif test -n "$enable_macosx_code_signing"; then
2870         MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
2871         pretty_name=`security find-identity -p codesigning -v | grep $MACOSX_CODESIGNING_IDENTITY | sed -e 's/^[[^"]]*"//' -e 's/"//'`
2872         AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
2873     else
2874         AC_MSG_RESULT([no])
2875     fi
2877 AC_SUBST(FRAMEWORKSHOME)
2878 AC_SUBST(MACOSX_SDK_PATH)
2879 AC_SUBST(MACOSX_SDK_VERSION)
2880 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2881 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
2882 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
2883 AC_SUBST(XCRUN)
2884 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
2886 # Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers.
2887 ISYSTEM=
2888 if test "$GCC" = "yes"; then
2889     AC_MSG_CHECKING( for -isystem )
2890     save_CFLAGS=$CFLAGS
2891     CFLAGS="$CFLAGS -Werror"
2892     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM=-isystem ],[])
2893     CFLAGS=$save_CFLAGS
2894     if test -n "$ISYSTEM"; then
2895         AC_MSG_RESULT(yes)
2896     else
2897         AC_MSG_RESULT(no)
2898     fi
2900 if test -z "$ISYSTEM"; then
2901     # fall back to using -I
2902     ISYSTEM=-I
2904 AC_SUBST(ISYSTEM)
2906 dnl ===================================================================
2907 dnl Windows specific tests and stuff
2908 dnl ===================================================================
2909 if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
2910     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
2911     if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
2912         AC_MSG_RESULT([no])
2913         SDK_ARCH="x86"
2914     else
2915         AC_MSG_RESULT([yes])
2916         SDK_ARCH="x64"
2917         BITNESS_OVERRIDE=64
2918     fi
2920     AC_MSG_CHECKING([whether to use DirectX])
2921     if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
2922         ENABLE_DIRECTX="TRUE"
2923         AC_MSG_RESULT([yes])
2924     else
2925         ENABLE_DIRECTX=""
2926         AC_MSG_RESULT([no])
2927     fi
2929     AC_MSG_CHECKING([whether to use ActiveX])
2930     if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
2931         DISABLE_ACTIVEX=""
2932         SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
2933         AC_MSG_RESULT([yes])
2934     else
2935         DISABLE_ACTIVEX="TRUE"
2936         AC_MSG_RESULT([no])
2937     fi
2939     AC_MSG_CHECKING([whether to use ATL])
2940     if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then
2941         DISABLE_ATL=""
2942         AC_MSG_RESULT([yes])
2943     else
2944         DISABLE_ATL="TRUE"
2945         AC_MSG_RESULT([no])
2946     fi
2947 else
2948     ENABLE_DIRECTX=""
2949     DISABLE_ACTIVEX="TRUE"
2950     DISABLE_ATL="TRUE"
2953 AC_SUBST(ENABLE_DIRECTX)
2954 AC_SUBST(DISABLE_ACTIVEX)
2955 AC_SUBST(DISABLE_ATL)
2957 if test "$cross_compiling" = "yes"; then
2958     CROSS_COMPILING=YES
2959     SCPDEFS="$SCPDEFS -DCROSS_COMPILING"
2960 else
2961     CROSS_COMPILING=
2962     BUILD_TYPE="$BUILD_TYPE NATIVE"
2964 AC_SUBST(CROSS_COMPILING)
2966 dnl ===================================================================
2967 dnl  Test the gcc version
2968 dnl ===================================================================
2969 if test "$GCC" = "yes"; then
2970     AC_MSG_CHECKING([the GCC version])
2971     _gcc_version=`$CC -dumpversion`
2972     _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
2973     GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2975     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100"; then
2976         if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0"; then
2977             export CC="$GCC_HOME/bin/gcc-4.0"
2978             #  export CC to make it finally available to config.guess
2979             GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
2980             if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100"; then
2981                 GCCVER=$GCCVER2
2982             fi
2983         fi
2984         if test "$GCCVER" -ge "040100"; then
2985             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])
2986         else
2987             AC_MSG_RESULT([implicitly using CC=$CC])
2988         fi
2989     else
2990         AC_MSG_RESULT([gcc $_gcc_version])
2991     fi
2992     if test "$GCCVER" -lt 040000; then
2993         AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.0.0])
2994     fi
2997 dnl ===================================================================
2998 dnl  Is GCC actually Clang?
2999 dnl ===================================================================
3001 COM_GCC_IS_CLANG=
3002 if test "$GCC" = "yes"; then
3003     AC_MSG_CHECKING([whether GCC is actually Clang])
3004     AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
3005         #ifndef __clang__
3006         you lose
3007         #endif
3008         int foo=42;
3009         ]])],
3010         [AC_MSG_RESULT([yes])
3011          COM_GCC_IS_CLANG=TRUE],
3012         [AC_MSG_RESULT([no])])
3014     if test "$COM_GCC_IS_CLANG" = TRUE; then
3015         AC_MSG_CHECKING([the Clang version])
3016         clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
3017         CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
3018         CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
3019         AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
3020     fi
3022 AC_SUBST(COM_GCC_IS_CLANG)
3024 # ===================================================================
3025 # check various GCC options that Clang does not support now but maybe
3026 # will somewhen in the future, check them even for GCC, so that the
3027 # flags are set
3028 # ===================================================================
3030 HAVE_GCC_GGDB2=
3031 HAVE_GCC_FINLINE_LIMIT=
3032 HAVE_GCC_FNO_INLINE=
3033 if test "$GCC" = "yes"; then
3034     AC_MSG_CHECKING([whether $CC supports -ggdb2])
3035     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3036         # Option just ignored and silly warning that isn't a real
3037         # warning printed
3038         :
3039     else
3040         save_CFLAGS=$CFLAGS
3041         CFLAGS="$CFLAGS -Werror -ggdb2"
3042         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
3043         CFLAGS=$save_CFLAGS
3044     fi
3045     if test "$HAVE_GCC_GGDB2" = "TRUE"; then
3046         AC_MSG_RESULT([yes])
3047     else
3048         AC_MSG_RESULT([no])
3049     fi
3051     AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
3052     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3053         # As above
3054         :
3055     else
3056         save_CFLAGS=$CFLAGS
3057         CFLAGS="$CFLAGS -Werror -finline-limit=0"
3058         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
3059         CFLAGS=$save_CFLAGS
3060     fi
3061     if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
3062         AC_MSG_RESULT([yes])
3063     else
3064         AC_MSG_RESULT([no])
3065     fi
3067     AC_MSG_CHECKING([whether $CC supports -fno-inline])
3068     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
3069         # Ditto
3070         :
3071     else
3072         save_CFLAGS=$CFLAGS
3073         CFLAGS="$CFLAGS -Werror -fno-inline"
3074         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
3075         CFLAGS=$save_CFLAGS
3076     fi
3077     if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
3078         AC_MSG_RESULT([yes])
3079     else
3080         AC_MSG_RESULT([no])
3081     fi
3083 AC_SUBST(HAVE_GCC_GGDB2)
3084 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
3085 AC_SUBST(HAVE_GCC_FNO_INLINE)
3087 HAVE_LD_BSYMBOLIC_FUNCTIONS=
3088 if test "$GCC" = "yes"; then
3089     AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
3090     bsymbolic_functions_ldflags_save=$LDFLAGS
3091     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
3092     AC_LINK_IFELSE([AC_LANG_PROGRAM([
3093 #include <stdio.h>
3094         ],[
3095 printf ("hello world\n");
3096         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
3097     if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
3098         AC_MSG_RESULT( found )
3099     else
3100         AC_MSG_RESULT( not found )
3101     fi
3102     LDFLAGS=$bsymbolic_functions_ldflags_save
3104 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
3106 dnl ===================================================================
3107 dnl  Check which Microsoft C/C++ or MinGW compiler is used for WINNT
3108 dnl ===================================================================
3109 SHOWINCLUDES_PREFIX=
3110 if test "$_os" = "WINNT"; then
3111     if test "$WITH_MINGW" != "yes"; then
3112         AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
3113         if test -z "$with_cl_home"; then
3114             vctest=`./oowintool --msvc-productdir`
3115             if test "$BITNESS_OVERRIDE" = ""; then
3116                 if test -x "$vctest/bin/cl.exe"; then
3117                     with_cl_home=$vctest
3118                 fi
3119             else
3120                 if test -x "$vctest/bin/amd64/cl.exe"; then
3121                     with_cl_home=$vctest
3122                 fi
3123             fi
3124         else
3125             with_cl_home=`cygpath -u "$with_cl_home"`
3126         fi
3127         with_cl_home=`cygpath -d "$with_cl_home"`
3128         with_cl_home=`cygpath -u "$with_cl_home"`
3129         AC_MSG_RESULT([$with_cl_home])
3131         dnl ===========================================================
3132         dnl  Check for mspdb80.dll/mspdb100.dll/mspdb110.dll
3133         dnl ===========================================================
3134         dnl MSVS 2008/10/12 Compiler
3135         if test -n "$with_mspdb_path"; then
3136             with_mspdb_path=`cygpath -u "$with_mspdb_path"`
3137         fi
3138         if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll" -o -e "$with_mspdb_path/mspdb110.dll"; then
3139             MSPDB_PATH="$with_mspdb_path"
3140         fi
3141         dnl MSVS 2008 case
3142         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
3143             MSPDB_PATH="$with_cl_home/../Common7/IDE"
3144         fi
3145         dnl Windows SDK 6.0 case
3146         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
3147             MSPDB_PATH="$with_cl_home/bin"
3148         fi
3149         dnl MSVS 2010 case
3150         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
3151             MSPDB_PATH="$with_cl_home/../Common7/IDE"
3152         fi
3153         dnl MSVS 2012 case
3154         if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb110.dll"; then
3155             MSPDB_PATH="$with_cl_home/../Common7/IDE"
3156         fi
3158         if test -z "$MSPDB_PATH"; then
3159             dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
3160             AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
3161             AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
3162             AC_PATH_PROG(MSPDB_PATH, mspdb110.dll)
3163             MSPDB_PATH=`dirname "$MSPDB_PATH"`
3164         fi
3166         if test -z "$MSPDB_PATH"; then
3167             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])
3168         fi
3169         MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
3170         MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
3171         dnl The path needs to be added before cl is called
3172         PATH="$MSPDB_PATH:$PATH"
3174         AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
3175         if test -z "$CC"; then
3176             if test "$BITNESS_OVERRIDE" = ""; then
3177                 if test -x "$with_cl_home/bin/cl.exe"; then
3178                     CC="$with_cl_home/bin/cl.exe"
3179                 fi
3180             else
3181                 if test -x "$with_cl_home/bin/amd64/cl.exe"; then
3182                     CC="$with_cl_home/bin/amd64/cl.exe"
3183                 fi
3184             fi
3185             if test -z "$CC"; then
3186                 AC_PATH_PROG(CC, cl.exe)
3187             fi
3188             # This gives us a posix path with 8.3 filename restrictions
3189             CC=`cygpath -d "$CC"`
3190             CC=`cygpath -u "$CC"`
3191         fi
3193         if test -n "$CC"; then
3194             # Remove /cl.exe from CC case insensitive
3195             AC_MSG_RESULT([found ($CC)])
3196             if test "$BITNESS_OVERRIDE" = ""; then
3197                 COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
3198             else
3199                 if test -n "$with_cl_home"; then
3200                     COMPATH=`echo $with_cl_home`
3201                 fi
3202             fi
3203             export INCLUDE=`cygpath -d "$COMPATH/Include"`
3204             dnl  Check which Microsoft C/C++ compiler is found
3205             AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
3206             # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
3207             CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
3208                             x = match( \\\$0, /..\\...\\...../ )
3209                             CCversion = substr( \\\$0, RSTART, RLENGTH)
3210                             tokencount = split (CCversion,vertoken,\".\")
3211                             for ( i = 1 ; i <= tokencount ; i++ ) {
3212                                 printf (\"%04d\",vertoken[[i]] )
3213                             }
3214                             }"`
3215             if test "$CCNUMVER" -ge "001700000000"; then
3216                 COMEX=14
3217                 MSVSVER=2012
3218                 VCVER=110
3219             elif test "$CCNUMVER" -ge "001600000000"; then
3220                 COMEX=13
3221                 MSVSVER=2010
3222                 VCVER=100
3223             elif test "$CCNUMVER" -ge "001500000000"; then
3224                 COMEX=12
3225                 MSVSVER=2008
3226                 VCVER=90
3227             else
3228                 AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
3229             fi
3230             PathFormat "$COMPATH"
3231             COMPATH="$formatted_path"
3233             AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
3234         else
3235             AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
3236         fi
3238         dnl We need to guess the prefix of the -showIncludes output, it can be
3239         dnl localized
3240         AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
3241         echo "#include <stdlib.h>" > conftest.c
3242         SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
3243             grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
3244         rm -f conftest.c conftest.obj
3245         if test -z "$SHOWINCLUDES_PREFIX"; then
3246             AC_MSG_ERROR([cannot determine the -showIncludes prefix])
3247         else
3248             AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
3249         fi
3251         # Check for 64-bit (cross-)compiler to use to build the 64-bit
3252         # version of the Explorer extension (and maybe other small
3253         # bits, too) needed when installing a 32-bit LibreOffice on a
3254         # 64-bit OS. The 64-bit Explorer extension is a feature that
3255         # has been present since long in OOo. Don't confuse it with
3256         # building LibreOffice itself as 64-bit code, which is
3257         # unfished work and highly experimental.
3259         BUILD_X64=
3260         CXX_X64_BINARY=
3261         LINK_X64_BINARY=
3262         LIBMGR_X64_BINARY=
3264         if test "$BITNESS_OVERRIDE" = ""; then
3265             AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
3266             if test -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
3267                 # Prefer native x64 compiler to cross-compiler, in case we are running
3268                 # the build on a 64-bit OS.
3269                 if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3270                     BUILD_X64=TRUE
3271                     CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
3272                     LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
3273                     LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
3274                 elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
3275                     BUILD_X64=TRUE
3276                     CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
3277                     LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
3278                     LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
3279                 fi
3280             fi
3281             if test "$BUILD_X64" = TRUE; then
3282                 AC_MSG_RESULT([found])
3283             else
3284                 AC_MSG_RESULT([not found])
3285                 AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
3286             fi
3287         fi
3288         AC_SUBST(BUILD_X64)
3290         # These are passed to the environment and then used in set_wntx64.mk
3291         AC_SUBST(CXX_X64_BINARY)
3292         AC_SUBST(LINK_X64_BINARY)
3293         AC_SUBST(LIBMGR_X64_BINARY)
3295     else
3296         AC_MSG_CHECKING([the compiler is MinGW])
3297         MACHINE_PREFIX=`$CC -dumpmachine`
3298         if echo $MACHINE_PREFIX | $GREP -q mingw32; then
3299             COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
3300             AC_MSG_RESULT([yes])
3301         else
3302             AC_MSG_ERROR([Compiler is not MinGW.])
3303         fi
3304     fi
3306 AC_SUBST(COMEX)
3307 AC_SUBST(VCVER)
3308 PathFormat "$MSPDB_PATH"
3309 MSPDB_PATH="$formatted_path"
3310 AC_SUBST(SHOWINCLUDES_PREFIX)
3313 # dbghelp.dll
3315 if test "$_os" == "WINNT"; then
3316     DBGHELP_DLL="13fbc2e8b37ddf28181dd6d8081c2b8e-dbghelp.dll"
3318 AC_SUBST(DBGHELP_DLL)
3321 # unowinreg.dll
3323 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
3324 AC_SUBST(UNOWINREG_DLL)
3327 # prefix C with ccache if needed
3329 if test "$CCACHE" != ""; then
3330     AC_MSG_CHECKING([whether $CC is already ccached])
3332     AC_LANG_PUSH([C])
3333     save_CFLAGS=$CFLAGS
3334     CFLAGS="$CFLAGS --ccache-skip -O2"
3335     dnl an empty program will do, we're checking the compiler flags
3336     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
3337                       [use_ccache=yes], [use_ccache=no])
3338     if test $use_ccache = yes; then
3339         AC_MSG_RESULT([yes])
3340     else
3341         CC="$CCACHE $CC"
3342         AC_MSG_RESULT([no])
3343     fi
3344     CFLAGS=$save_CFLAGS
3345     AC_LANG_POP([C])
3348 dnl Set the ENABLE_DBGUTIL variable
3349 dnl ===================================================================
3350 AC_MSG_CHECKING([whether to build with additional debug utilities])
3351 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
3352     ENABLE_DBGUTIL="TRUE"
3353     PROEXT=""
3354     PRODUCT=""
3356     AC_MSG_RESULT([yes])
3357     # cppunit and graphite expose STL in public headers
3358     if test "$with_system_cppunit" = "yes"; then
3359         AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
3360     else
3361         with_system_cppunit=no
3362     fi
3363     if test "$with_system_graphite" = "yes"; then
3364         AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
3365     else
3366         with_system_graphite=no
3367     fi
3368     if test "$with_system_mysql_cppconn" = "yes"; then
3369         AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
3370     else
3371         with_system_mysql_cppconn=no
3372     fi
3373     if test "$with_system_orcus" = "yes"; then
3374         AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
3375     else
3376         with_system_orcus=no
3377     fi
3378 else
3379     ENABLE_DBGUTIL=""
3380     # PRODUCT is old concept, still used by build.pl .
3381     PRODUCT="full"
3382     PROEXT=".pro"
3383     AC_MSG_RESULT([no])
3385 AC_SUBST(ENABLE_DBGUTIL)
3386 AC_SUBST(PRODUCT)
3387 AC_SUBST(PROEXT)
3389 dnl Set the ENABLE_DEBUG variable.
3390 dnl ===================================================================
3391 AC_MSG_CHECKING([whether to do a debug build])
3392 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
3393     AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
3395 if test -n "$ENABLE_DBGUTIL"; then
3396     if test "$enable_debug" = "no"; then
3397         AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
3398     fi
3399     ENABLE_DEBUG="TRUE"
3400     AC_MSG_RESULT([yes (dbgutil)])
3401 elif test -n "$enable_debug" && test "$enable_debug" != "no"; then
3402     ENABLE_DEBUG="TRUE"
3403     AC_MSG_RESULT([yes])
3404 else
3405     ENABLE_DEBUG=""
3406     AC_MSG_RESULT([no])
3408 AC_SUBST(ENABLE_DEBUG)
3410 dnl Selective debuginfo
3411 ENABLE_DEBUGINFO_FOR=
3412 if test -n "$ENABLE_DEBUG"; then
3413     AC_MSG_CHECKING([whether to use selective debuginfo])
3414     if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
3415         ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
3416         AC_MSG_RESULT([for "$enable_selective_debuginfo"])
3417     else
3418         ENABLE_DEBUGINFO_FOR=all
3419         AC_MSG_RESULT([no, for all])
3420     fi
3422 AC_SUBST(ENABLE_DEBUGINFO_FOR)
3424 dnl Check for enable symbols option
3425 dnl ===================================================================
3426 AC_MSG_CHECKING([whether to include symbols while preserve optimization])
3427 if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
3428     ENABLE_SYMBOLS="TRUE"
3429     if test -n "$ENABLE_DBGUTIL"; then
3430         AC_MSG_ERROR([--enable-dbgutil cannot be used with --enable-symbols])
3431     elif test -n "$ENABLE_DEBUG"; then
3432         AC_MSG_ERROR([--enable-debug cannot be used with --enable-symbols])
3433     fi
3434     AC_MSG_RESULT([yes])
3435 else
3436     if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
3437         ENABLE_SYMBOLS="FALSE"
3438     else
3439         ENABLE_SYMBOLS=
3440     fi
3441     AC_MSG_RESULT([no])
3443 AC_SUBST(ENABLE_SYMBOLS)
3445 dnl Check for explicit C/CXX/OBJC/OBJCXX/LDFLAGS. We by default use the ones specified
3446 dnl by our build system, but explicit override is possible.
3447 AC_MSG_CHECKING(for explicit CFLAGS)
3448 if test -n "$CFLAGS"; then
3449     AC_MSG_RESULT([$CFLAGS])
3450     x_CFLAGS=
3451 else
3452     AC_MSG_RESULT(no)
3453     x_CFLAGS=[\#]
3455 AC_MSG_CHECKING(for explicit CXXFLAGS)
3456 if test -n "$CXXFLAGS"; then
3457     AC_MSG_RESULT([$CXXFLAGS])
3458     x_CXXFLAGS=
3459 else
3460     AC_MSG_RESULT(no)
3461     x_CXXFLAGS=[\#]
3463 AC_MSG_CHECKING(for explicit OBJCFLAGS)
3464 if test -n "$OBJCFLAGS"; then
3465     AC_MSG_RESULT([$OBJCFLAGS])
3466     x_OBJCFLAGS=
3467 else
3468     AC_MSG_RESULT(no)
3469     x_OBJCFLAGS=[\#]
3471 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
3472 if test -n "$OBJCXXFLAGS"; then
3473     AC_MSG_RESULT([$OBJCXXFLAGS])
3474     x_OBJCXXFLAGS=
3475 else
3476     AC_MSG_RESULT(no)
3477     x_OBJCXXFLAGS=[\#]
3479 AC_MSG_CHECKING(for explicit LDFLAGS)
3480 if test -n "$LDFLAGS"; then
3481     AC_MSG_RESULT([$LDFLAGS])
3482     x_LDFLAGS=
3483 else
3484     AC_MSG_RESULT(no)
3485     x_LDFLAGS=[\#]
3487 AC_SUBST(CFLAGS)
3488 AC_SUBST(CXXFLAGS)
3489 AC_SUBST(OBJCFLAGS)
3490 AC_SUBST(OBJCXXFLAGS)
3491 AC_SUBST(LDFLAGS)
3492 AC_SUBST(x_CFLAGS)
3493 AC_SUBST(x_CXXFLAGS)
3494 AC_SUBST(x_OBJCFLAGS)
3495 AC_SUBST(x_OBJCXXFLAGS)
3496 AC_SUBST(x_LDFLAGS)
3499 # determine CPU, CPUNAME, GUI, GUIBASE, ...
3501 LIB64="lib"
3502 SOLARINC=
3504 case "$host_os" in
3506 aix*)
3507     COM=GCC
3508     CPU=P
3509     CPUNAME=POWERPC
3510     GUI=UNX
3511     GUIBASE=unx
3512     OS=AIX
3513     RTL_OS=AIX
3514     RTL_ARCH=PowerPC
3515     PLATFORMID=aix_powerpc
3516     OUTPATH=unxaigppc
3517     P_SEP=:
3518     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3519     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3520     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3521     ;;
3523 cygwin*)
3524     COM=MSC
3525     GUI=WNT
3526     GUIBASE=WIN
3527     OS=WNT
3528     RTL_OS=Windows
3529     P_SEP=";"
3531     case "$host_cpu" in
3532     i*86|x86_64)
3533         if test "$BITNESS_OVERRIDE" = 64; then
3534             CPU=X
3535             CPUNAME=X86_64
3536             RTL_ARCH=X86_64
3537             LIB64="lib/x64"
3538             PLATFORMID=windows_x86_64
3539             OUTPATH=wntmscx$COMEX
3540         else
3541             CPU=I
3542             CPUNAME=INTEL
3543             RTL_ARCH=x86
3544             PLATFORMID=windows_x86
3545             OUTPATH=wntmsci$COMEX
3546         fi
3547         ;;
3548     *)
3549         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3550         ;;
3551     esac
3552     SCPDEFS="$SCPDEFS -D_MSC_VER"
3553     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3554     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3555     ;;
3557 darwin*)
3558     COM=GCC
3559     GUI=UNX
3560     # Not sure if "Aqua" is the right term to use?
3561     GUIBASE="aqua"
3562     OS=MACOSX
3563     RTL_OS=MacOSX
3564     P_SEP=:
3566     case "$host_cpu" in
3567     arm*)
3568         CPU=R
3569         CPUNAME=ARM
3570         RTL_ARCH=ARM_EABI
3571         GUIBASE=cocoatouch
3572         PLATFORMID=macosx_arm_eabi
3573         OUTPATH=unxiosr
3574         OS=IOS
3575         ;;
3576     powerpc*)
3577         CPU=P
3578         CPUNAME=POWERPC
3579         RTL_ARCH=PowerPC
3580         PLATFORMID=macosx_powerpc
3581         OUTPATH=unxmacxp
3582         ;;
3583     i*86)
3584         if test "$BITNESS_OVERRIDE" = 64; then
3585             AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
3586         fi
3587         CPU=I
3588         CPUNAME=INTEL
3589         RTL_ARCH=x86
3590         PLATFORMID=macosx_x86
3591         OUTPATH=unxmacxi
3592         ;;
3593     x86_64)
3594         if test "$BITNESS_OVERRIDE" = 64; then
3595             CPU=X
3596             CPUNAME=X86_64
3597             RTL_ARCH=X86_64
3598             PLATFORMID=macosx_x86_64
3599             OUTPATH=unxmacxx
3600         else
3601             CPU=I
3602             CPUNAME=INTEL
3603             RTL_ARCH=x86
3604             PLATFORMID=macosx_x86
3605             OUTPATH=unxmacxi
3606         fi
3607         ;;
3608     *)
3609         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3610         ;;
3611     esac
3612     SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3613     ;;
3615 dragonfly*)
3616     COM=GCC
3617     GUI=UNX
3618     GUIBASE=unx
3619     OS=DRAGONFLY
3620     RTL_OS=DragonFly
3621     OUTPATH=unxdfly
3622     P_SEP=:
3624     case "$host_cpu" in
3625     i*86)
3626         CPU=I
3627         CPUNAME=INTEL
3628         RTL_ARCH=x86
3629         PLATFORMID=dragonfly_x86
3630         ;;
3631     x86_64)
3632         CPU=X
3633         CPUNAME=X86_64
3634         RTL_ARCH=X86_64
3635         PLATFORMID=dragonfly_x86_64
3636         ;;
3637     *)
3638         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3639         ;;
3640     esac
3641     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3642     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3643     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3644     ;;
3646 freebsd*)
3647     COM=GCC
3648     GUI=UNX
3649     GUIBASE=unx
3650     RTL_OS=FreeBSD
3651     OS=FREEBSD
3652     OUTPATH=unxfbsd
3653     P_SEP=:
3655     case "$host_cpu" in
3656     i*86)
3657         CPU=I
3658         CPUNAME=INTEL
3659         RTL_ARCH=x86
3660         PLATFORMID=freebsd_x86
3661         OUTPATH=unxfbsdi
3662         ;;
3663     x86_64)
3664         CPU=X
3665         CPUNAME=X86_64
3666         RTL_ARCH=X86_64
3667         PLATFORMID=freebsd_x86_64
3668         ;;
3669     *)
3670         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3671         ;;
3672     esac
3673     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3674     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3675     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3676     ;;
3678 kfreebsd*)
3679     COM=GCC
3680     GUI=UNX
3681     GUIBASE=unx
3682     OS=LINUX
3683     RTL_OS=kFreeBSD
3684     P_SEP=:
3686     case "$host_cpu" in
3688     i*86)
3689         CPU=I
3690         CPUNAME=INTEL
3691         RTL_ARCH=x86
3692         PLATFORMID=kfreebsd_x86
3693         OUTPATH=unxkfgi6
3694         ;;
3695     x86_64)
3696         CPU=X
3697         CPUNAME=X86_64
3698         RTL_ARCH=X86_64
3699         LIB64="lib64"
3700         PLATFORMID=kfreebsd_x86_64
3701         OUTPATH=unxkfgx6
3702         ;;
3703     *)
3704         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3705         ;;
3706     esac
3707     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3708     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3709     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3710     ;;
3712 linux-gnu*)
3713     COM=GCC
3714     GUI=UNX
3715     GUIBASE=unx
3716     OS=LINUX
3717     RTL_OS=Linux
3718     P_SEP=:
3720     case "$host_cpu" in
3722     alpha)
3723         CPU=L
3724         CPUNAME=AXP
3725         RTL_ARCH=ALPHA
3726         PLATFORMID=linux_alpha
3727         OUTPATH=unxlngaxp
3728         ;;
3729     arm*)
3730         CPU=R
3731         CPUNAME=ARM
3732         EPM_FLAGS="-a arm"
3733         OUTPATH=unxlngr
3734         RTL_ARCH=ARM_EABI
3735         PLATFORMID=linux_arm_eabi
3736         case "$host_cpu" in
3737         arm*-linux)
3738             RTL_ARCH=ARM_OABI
3739             PLATFORMID=linux_arm_oabi
3740             ;;
3741         esac
3742         ;;
3743     hppa)
3744         CPU=H
3745         CPUNAME=HPPA
3746         RTL_ARCH=HPPA
3747         EPM_FLAGS="-a hppa"
3748         PLATFORMID=linux_hppa
3749         OUTPATH=unxlnghppa
3750         ;;
3751     i*86)
3752         CPU=I
3753         CPUNAME=INTEL
3754         RTL_ARCH=x86
3755         PLATFORMID=linux_x86
3756         OUTPATH=unxlngi6
3757         ;;
3758     ia64)
3759         CPU=A
3760         CPUNAME=IA64
3761         RTL_ARCH=IA64
3762         PLATFORMID=linux_ia64
3763         OUTPATH=unxlnga
3764         ;;
3765     mips)
3766         CPU=M
3767         CPUNAME=GODSON
3768         RTL_ARCH=MIPS_EB
3769         EPM_FLAGS="-a mips"
3770         PLATFORMID=linux_mips_eb
3771         OUTPATH=unxlngmips
3772         ;;
3773     mips64)
3774         CPU=M
3775         CPUNAME=GODSON
3776         RTL_ARCH=MIPS_EB
3777         EPM_FLAGS="-a mips64"
3778         PLATFORMID=linux_mips_eb
3779         OUTPATH=unxlngmips
3780         ;;
3781     mips64el)
3782         CPU=M
3783         CPUNAME=GODSON
3784         RTL_ARCH=MIPS_EL
3785         EPM_FLAGS="-a mips64el"
3786         PLATFORMID=linux_mips_el
3787         OUTPATH=unxlngmips
3788         ;;
3789     mipsel)
3790         CPU=M
3791         CPUNAME=GODSON
3792         RTL_ARCH=MIPS_EL
3793         EPM_FLAGS="-a mipsel"
3794         PLATFORMID=linux_mips_el
3795         OUTPATH=unxlngmips
3796         ;;
3797     m68k)
3798         CPU=6
3799         CPUNAME=M68K
3800         RTL_ARCH=M68K
3801         PLATFORMID=linux_m68k
3802         OUTPATH=unxlngm68k
3803         ;;
3804     powerpc)
3805         CPU=P
3806         CPUNAME=POWERPC
3807         RTL_ARCH=PowerPC
3808         PLATFORMID=linux_powerpc
3809         OUTPATH=unxlngppc
3810         ;;
3811     powerpc64)
3812         CPU=P
3813         CPUNAME=POWERPC64
3814         RTL_ARCH=PowerPC_64
3815         LIB64="lib64"
3816         PLATFORMID=linux_powerpc_64
3817         OUTPATH=unxlngppc64
3818         ;;
3819     sparc)
3820         CPU=S
3821         CPUNAME=SPARC
3822         RTL_ARCH=SPARC
3823         PLATFORMID=linux_sparc
3824         OUTPATH=unxlngs
3825         ;;
3826     s390)
3827         CPU=3
3828         CPUNAME=S390
3829         RTL_ARCH=S390
3830         PLATFORMID=linux_s390
3831         OUTPATH=unxlngs390
3832         ;;
3833     s390x)
3834         CPU=3
3835         CPUNAME=S390X
3836         RTL_ARCH=S390x
3837         LIB64="lib64"
3838         PLATFORMID=linux_s390x
3839         OUTPATH=unxlngs390x
3840         ;;
3841     x86_64)
3842         CPU=X
3843         CPUNAME=X86_64
3844         RTL_ARCH=X86_64
3845         LIB64="lib64"
3846         PLATFORMID=linux_x86_64
3847         OUTPATH=unxlngx6
3848         ;;
3849     *)
3850         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3851         ;;
3852     esac
3853     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3854     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3855     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3856     ;;
3858 linux-android*)
3859     COM=GCC
3860     GUI=UNX
3861     GUIBASE=android
3862     OS=ANDROID
3863     RTL_OS=Android
3864     P_SEP=:
3866     case "$host_cpu" in
3868     arm|armel)
3869         CPU=R
3870         CPUNAME=ARM
3871         RTL_ARCH=ARM_EABI
3872         PLATFORMID=android_arm_eabi
3873         OUTPATH=unxandr
3874         ;;
3875     mips|mipsel)
3876         CPU=M
3877         CPUNAME=GODSON # Weird, but maybe that's the LO convention?
3878         RTL_ARCH=MIPS_EL
3879         PLATFORMID=android_mips_el
3880         OUTPATH=unxandm
3881         ;;
3882     i*86)
3883         CPU=I
3884         CPUNAME=INTEL
3885         RTL_ARCH=x86
3886         PLATFORMID=android_x86
3887         OUTPATH=unxandi
3888         ;;
3889     *)
3890         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3891         ;;
3892     esac
3893     SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/$OUTPATH"
3894     SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3895     ;;
3897 mingw*)
3898     COM=GCC
3899     GUI=WNT
3900     GUIBASE=WIN
3901     OS=WNT
3902     RTL_OS=Windows
3903     P_SEP=:
3905     case "$host_cpu" in
3906     i*86|x86_64)
3907         if test "$BITNESS_OVERRIDE" = 64; then
3908             CPU=X
3909             CPUNAME=X86_64
3910             RTL_ARCH=X86_84
3911             PLATFORMID=windows_x86_64
3912             OUTPATH=wntgccx$COMEX
3913         else
3914             CPU=I
3915             CPUNAME=INTEL
3916             RTL_ARCH=x86
3917             PLATFORMID=windows_x86
3918             OUTPATH=wntgcci$COMEX
3919         fi
3920         ;;
3921     *)
3922         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3923         ;;
3924     esac
3925     SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/win32 -I$SRC_ROOT/solenv/inc/$OUTPATH"
3926     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3927     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3928     ;;
3930 *netbsd*)
3932     COM=GCC
3933     GUI=UNX
3934     GUIBASE=unx
3935     OS=NETBSD
3936     RTL_OS=NetBSD
3937     OUTPATH=unxnbsd
3938     P_SEP=:
3940     case "$host_cpu" in
3941     i*86)
3942         CPU=I
3943         CPUNAME=INTEL
3944         RTL_ARCH=x86
3945         PLATFORMID=netbsd_x86
3946         ;;
3947     powerpc)
3948         CPU=P
3949         CPUNAME=POWERPC
3950         RTL_ARCH=PowerPC
3951         PLATFORMID=netbsd_powerpc
3952         ;;
3953     sparc)
3954         CPU=S
3955         CPUNAME=SPARC
3956         RTL_ARCH=SPARC
3957         PLATFORMID=netbsd_sparc
3958         ;;
3959     x86_64)
3960         CPU=X
3961         CPUNAME=X86_64
3962         RTL_ARCH=X86_64
3963         PLATFORMID=netbsd_x86_64
3964         ;;
3965     *)
3966         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3967         ;;
3968     esac
3969     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
3970     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
3971     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
3972     ;;
3974 openbsd*)
3975     COM=GCC
3976     GUI=UNX
3977     GUIBASE=unx
3978     OS=OPENBSD
3979     RTL_OS=OpenBSD
3980     OUTPATH=unxobsd
3981     P_SEP=:
3983     case "$host_cpu" in
3984     i*86)
3985         CPU=I
3986         CPUNAME=INTEL
3987         RTL_ARCH=x86
3988         PLATFORMID=openbsd_x86
3989         ;;
3990     x86_64)
3991         CPU=X
3992         CPUNAME=X86_64
3993         RTL_ARCH=X86_64
3994         PLATFORMID=openbsd_x86_64
3995         ;;
3996     *)
3997         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
3998         ;;
3999     esac
4000     SOLARINC="$SOLARINC -I/usr/local/include"
4001     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
4002     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
4003     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
4004     SOLARLIB="$SOLARLIB -L/usr/local/lib"
4006     ;;
4008 solaris*)
4010     COM=GCC
4011     GUI=UNX
4012     GUIBASE=unx
4013     OS=SOLARIS
4014     RTL_OS=Solaris
4015     P_SEP=:
4017     case "$host_cpu" in
4018     i*86)
4019         CPU=I
4020         CPUNAME=INTEL
4021         RTL_ARCH=x86
4022         PLATFORMID=solaris_x86
4023         OUTPATH=unxsogi
4024         ;;
4025     sparc)
4026         CPU=S
4027         CPUNAME=SPARC
4028         RTL_ARCH=SPARC
4029         PLATFORMID=solaris_sparc
4030         OUTPATH=unxsogs
4031         ;;
4032     *)
4033         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
4034         ;;
4035     esac
4036     SOLARINC="$SOLARINC -I/usr/local/include"
4037     SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
4038     SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
4039     SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
4040     SOLARLIB="$SOLARLIB -L$COMPATH/lib"
4041     SOLARLIB="$SOLARLIB -L/usr/local/bin -L/usr/dt/lib -L/usr/openwin/lib"
4042     ;;
4045     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
4046     ;;
4047 esac
4049 if test "$enable_headless" = "yes"; then
4050     if test "$GUIBASE" != "unx"; then
4051         AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --enable-headless])
4052     fi
4053     GUIBASE=headless
4056 INPATH="${OUTPATH}${PROEXT}"
4057 if test -n "${with_solver_and_workdir_root}"; then
4058     PathFormat "${with_solver_and_workdir_root}"
4059     # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
4060     if echo ${formatted_path} | $GREP -q '/$'; then
4061         WORKDIR=${formatted_path}workdir/${INPATH}
4062     else
4063         WORKDIR=${formatted_path}/workdir/${INPATH}
4064     fi
4065 else
4066     WORKDIR=${SRC_ROOT}/workdir/${INPATH}
4068 OUTDIR="${SOLARVER}/${INPATH}"
4069 SOLARINC="-I. -I${SOLARVER}/$INPATH/inc/external -I${SOLARVER}/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC"
4070 AC_SUBST(COM)
4071 AC_SUBST(CPU)
4072 AC_SUBST(CPUNAME)
4073 AC_SUBST(RTL_OS)
4074 AC_SUBST(RTL_ARCH)
4075 AC_SUBST(EPM_FLAGS)
4076 AC_SUBST(GUI)
4077 AC_SUBST(GUIBASE)
4078 AC_SUBST(INPATH)
4079 AC_SUBST(OS)
4080 AC_SUBST(OUTDIR)
4081 AC_SUBST(OUTPATH)
4082 AC_SUBST(P_SEP)
4083 AC_SUBST(SOLARVER)
4084 AC_SUBST(WORKDIR)
4085 AC_SUBST(PLATFORMID)
4087 dnl ===================================================================
4088 dnl Test which package format to use
4089 dnl ===================================================================
4090 AC_MSG_CHECKING([which package format to use])
4091 if test -n "$with_package_format"; then
4092     for i in $with_package_format; do
4093         case "$i" in
4094         aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
4095             ;;
4096         *)
4097             AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
4098 aix - AIX software distribution
4099 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
4100 deb - Debian software distribution
4101 inst or tardist - IRIX software distribution
4102 osx - MacOS X software distribution
4103 pkg - Solaris software distribution
4104 rpm - RedHat software distribution
4105 setld - Tru64 (setld) software distribution
4106 native - "Native" software distribution for the platform
4107 portable - Portable software distribution
4109 LibreOffice additionally supports:
4110 archive - .tar.gz or .zip
4111 dmg - Mac OS X .dmg
4112 installed - installation tree
4113 msi - Windows .msi
4114         ])
4115             ;;
4116         esac
4117     done
4118     PKGFORMAT="$with_package_format"
4119 elif test "$enable_epm" = "yes"; then
4120     # defaults
4121     case "$_os" in
4122     Darwin)
4123         PKGFORMAT=dmg
4124         ;;
4125     SunOS)
4126         PKGFORMAT=pkg
4127         ;;
4128     Linux)
4129         # if building on Debian, default should be deb...
4130         if test -e /etc/debian_version; then
4131             PKGFORMAT=deb
4132         else
4133             PKGFORMAT=rpm
4134         fi
4135         ;;
4136     AIX)
4137         PKGFORMAT=rpm
4138         ;;
4139     OpenBSD|DragonFly)
4140         PKGFORMAT=portable
4141         ;;
4142     *BSD)
4143         PKGFORMAT=bsd
4144         ;;
4145     WINNT)
4146         PKGFORMAT=msi
4147         ;;
4148     # we never should get here since we check the arciecture/os at the beginning,
4149     # but go sure...
4150     *)
4151         AC_MSG_ERROR([unknown system])
4152     esac
4153 else
4154     if test "$WITH_MINGW" = "yes"; then
4155         # when tested, we should default this to 'msi', instead of 'archive'
4156         PKGFORMAT=archive
4157     else
4158         PKGFORMAT=native
4159     fi
4161 AC_MSG_RESULT([$PKGFORMAT])
4162 AC_SUBST(PKGFORMAT)
4164 dnl ===================================================================
4165 dnl Set up a different compiler to produce tools to run on the build
4166 dnl machine when doing cross-compilation
4167 dnl ===================================================================
4169 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
4170 if test "$cross_compiling" = "yes"; then
4171     AC_MSG_CHECKING([for BUILD platform configuration])
4172     echo
4173     rm -rf CONF-FOR-BUILD config_build.mk
4174     mkdir CONF-FOR-BUILD
4175     tar cf - \
4176         config.guess \
4177         config_host.mk.in \
4178         configure \
4179         oowintool \
4180         bin/get_config_variables \
4181         solenv/bin/getcompver.awk \
4182         solenv/inc/langlist.mk \
4183         solenv/inc/postset.mk \
4184     | (cd CONF-FOR-BUILD && tar xf -)
4185     (
4186     unset COM GUI GUIBASE OS CPU CPUNAME
4187     unset CC CXX SYSBASE CFLAGS
4188     unset PYTHON_CFLAGS PYTHON_LIBS
4189     unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
4190     unset CPPUNIT_CFLAGS CPPUNIT_LIBS
4191     unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
4192     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
4193     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
4194     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
4195     cd CONF-FOR-BUILD
4196     sub_conf_opts=""
4197     test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
4198     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
4199     test $with_java = no && sub_conf_opts="$sub_conf_opts --without-java"
4200     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
4201     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
4202     test -n "${with_solver_and_workdir_root}" && sub_conf_opts="$sub_conf_opts --with-solver-and-workdir-root=${with_solver_and_workdir_root}"
4203     test -n "$with_system_boost_for_build" && sub_conf_opts="$sub_conf_opts --with-system-boost"
4204     test -n "$with_system_cppunit_for_build" && sub_conf_opts="$sub_conf_opts --with-system-cppunit"
4205     test -n "$with_system_expat_for_build" && sub_conf_opts="$sub_conf_opts --with-system-expat"
4206     test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
4207     test -n "$with_system_libxml_for_build" && sub_conf_opts="$sub_conf_opts --with-system-libxml"
4208     # we need the msi build tools on mingw if we are creating the
4209     # installation set
4210     if test "$WITH_MINGW" = "yes"; then
4211         enable_winegcc_for_build=
4212         for pkgformat in $PKGFORMAT; do
4213             case "$pkgformat" in
4214                 msi|native) enable_winegcc_for_build=yes ;;
4215             esac
4216         done
4217         test -n "$enable_winegcc_for_build" && sub_conf_opts="$sub_conf_opts --enable-winegcc"
4218     fi
4219     sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
4220     # Don't bother having configure look for stuff not needed for the build platform anyway
4221     ./configure \
4222         --disable-graphite \
4223         --disable-build-mozilla \
4224         --disable-postgresql-sdbc \
4225         --disable-zenity \
4226         --with-parallelism="$with_parallelism" \
4227         --without-doxygen \
4228         ENABLE_PDFIMPORT=FALSE \
4229         $sub_conf_opts \
4230         2>&1 | sed -e 's/^/    /'
4231     test -f ./config_host.mk 2>/dev/null || exit
4232     cp config_host.mk ../config_build.mk
4233     cp config.log ../config.Build.log
4234     . ./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
4236     for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX DISABLE_PYTHON MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
4237              PYTHON SYSTEM_LIBXSLT; do
4238         VV='$'$V
4239         VV=`eval "echo $VV"`
4240         if test -n "$VV"; then
4241             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
4242             echo "$line" >>build-config
4243         fi
4244     done
4246     for V in OUTDIR SOLARINC SOLARLIB WORKDIR; do
4247         VV='$'$V
4248         VV=`eval "echo $VV"`
4249         VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
4250         if test -n "$VV"; then
4251             line="${V}_FOR_BUILD='$VV'"
4252             echo "$line" >>build-config
4253         fi
4254     done
4256     line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
4257     echo "$line" >>build-config
4259     )
4260     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
4261     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])
4262     perl -pi -e 's,/CONF-FOR-BUILD,,g' config_build.mk
4263     eval `cat CONF-FOR-BUILD/build-config`
4264     AC_MSG_RESULT([checking for BUILD platform configuration... done])
4265     rm -rf CONF-FOR-BUILD
4266 else
4267     CC_FOR_BUILD="$CC"
4268     CXX_FOR_BUILD="$CXX"
4269     CC_FOR_BUILD="$CC"
4270     COM_FOR_BUILD="$COM"
4271     CPUNAME_FOR_BUILD="$CPUNAME"
4272     CPU_FOR_BUILD="$CPU"
4273     CXX_FOR_BUILD="$CXX"
4274     DISABLE_PYTHON_FOR_BUILD="$DISABLE_PYTHON"
4275     GUIBASE_FOR_BUILD="$GUIBASE"
4276     GUI_FOR_BUILD="$GUI"
4277     INPATH_FOR_BUILD="$INPATH"
4278     MACOSX_DEPLOYMENT_TARGET_FOR_BUILD="$MACOSX_DEPLOYMENT_TARGET"
4279     OS_FOR_BUILD="$OS"
4280     OUTDIR_FOR_BUILD="$OUTDIR"
4281     OUTPATH_FOR_BUILD="$OUTPATH"
4282     PYTHON_FOR_BUILD="$PYTHON"
4283     WORKDIR_FOR_BUILD="$WORKDIR"
4285 AC_SUBST(COM_FOR_BUILD)
4286 AC_SUBST(GUI_FOR_BUILD)
4287 AC_SUBST(GUIBASE_FOR_BUILD)
4288 AC_SUBST(OS_FOR_BUILD)
4289 AC_SUBST(CPU_FOR_BUILD)
4290 AC_SUBST(CPUNAME_FOR_BUILD)
4291 AC_SUBST(CC_FOR_BUILD)
4292 AC_SUBST(CXX_FOR_BUILD)
4293 AC_SUBST(INPATH_FOR_BUILD)
4294 AC_SUBST(OUTPATH_FOR_BUILD)
4295 AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
4296 AC_SUBST([PYTHON_FOR_BUILD])
4298 AC_SUBST(OUTDIR_FOR_BUILD)
4299 AC_SUBST(WORKDIR_FOR_BUILD)
4301 UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
4302 SOURCEVERSION="OOO$UPD"
4303 AC_SUBST(UPD)
4304 AC_SUBST(SOURCEVERSION)
4306 dnl ===================================================================
4307 dnl Grim-ness to export version number of LibreOffice to code
4308 dnl this needs to be turned around and to be driven by configure
4309 dnl ===================================================================
4310 LIBO_VERSION_MAJOR="`$GREP VERSIONMAJOR solenv/inc/minor.mk | sed "s/^.*=//"`"
4311 LIBO_VERSION_MINOR="`$GREP VERSIONMINOR solenv/inc/minor.mk | sed "s/^.*=//"`"
4312 LIBO_VERSION_MICRO="`$GREP VERSIONMICRO solenv/inc/minor.mk | sed "s/^.*=//"`"
4313 LIBO_VERSION_PATCH="`$GREP BUILD solenv/inc/minor.mk | sed "s/^.*=//"`"
4314 AC_SUBST(LIBO_VERSION_MAJOR)
4315 AC_SUBST(LIBO_VERSION_MINOR)
4316 AC_SUBST(LIBO_VERSION_MICRO)
4317 AC_SUBST(LIBO_VERSION_PATCH)
4318 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,"$LIBO_VERSION_MAJOR")
4319 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,"$LIBO_VERSION_MINOR")
4320 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,"$LIBO_VERSION_MICRO")
4321 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,"$LIBO_VERSION_PATCH")
4323 dnl ===================================================================
4324 dnl Set the ENABLE_CRASHDUMP variable.
4325 dnl ===================================================================
4326 AC_MSG_CHECKING([whether to enable crashdump feature])
4327 if test "$enable_crashdump" = "yes"; then
4328     ENABLE_CRASHDUMP="TRUE"
4329     BUILD_TYPE="$BUILD_TYPE CRASHREP"
4330     AC_MSG_RESULT([yes])
4331 else
4332     ENABLE_CRASHDUMP=""
4333     AC_MSG_RESULT([no])
4335 AC_SUBST(ENABLE_CRASHDUMP)
4338 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
4339 dnl ===================================================================
4340 AC_MSG_CHECKING([whether to turn warnings to errors])
4341 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
4342     EXTERNAL_WARNINGS_NOT_ERRORS="FALSE"
4343     AC_MSG_RESULT([yes])
4344 else
4345     EXTERNAL_WARNINGS_NOT_ERRORS="TRUE"
4346     AC_MSG_RESULT([no])
4348 AC_SUBST(EXTERNAL_WARNINGS_NOT_ERRORS)
4350 dnl Set the ASSERT_ALWAYS_ABORT variable. (Activate --enable-assert-always-abort)
4351 dnl ===================================================================
4352 AC_MSG_CHECKING([whether to have assert to abort in release code])
4353 if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
4354     ASSERT_ALWAYS_ABORT="TRUE"
4355     AC_MSG_RESULT([yes])
4356 else
4357     ASSERT_ALWAYS_ABORT="FALSE"
4358     AC_MSG_RESULT([no])
4360 AC_SUBST(ASSERT_ALWAYS_ABORT)
4362 dnl Determine whether to use linkoo for the smoketest installation
4363 dnl ===================================================================
4364 AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
4365 if test "$enable_linkoo" = "no"; then
4366     DISABLE_LINKOO="TRUE"
4367     AC_MSG_RESULT([no])
4368 else
4369     DISABLE_LINKOO=
4370     AC_MSG_RESULT([yes])
4372 AC_SUBST(DISABLE_LINKOO)
4374 # Set the ENABLE_LTO variable
4375 # ===================================================================
4376 AC_MSG_CHECKING([whether to use link-time optimization])
4377 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
4378     ENABLE_LTO="TRUE"
4379     AC_MSG_RESULT([yes])
4380 else
4381     ENABLE_LTO=""
4382     AC_MSG_RESULT([no])
4384 AC_SUBST(ENABLE_LTO)
4386 if test "$enable_headless" = "yes"; then
4387     # be sure to do not mess with uneeded stuff
4388     test_randr=no
4389     test_xrender=no
4390     test_cups=no
4391     test_dbus=no
4392     test_fontconfig=yes
4393     test_gtk=no
4394     build_gstreamer=no
4395     build_gstreamer_0_10=no
4396     test_tde=no
4397     test_kde=no
4398     test_kde4=no
4399     enable_unix_qstart_libpng=no
4400     enable_cairo_canvas=no
4401     enable_gnome_vfs=no
4402     enable_opengl=no
4405 dnl ===================================================================
4406 dnl check for cups support
4407 dnl ===================================================================
4408 ENABLE_CUPS=""
4410 if test "$enable_cups" = "no"; then
4411     test_cups=no
4414 AC_MSG_CHECKING([whether to enable CUPS support])
4415 if test "$test_cups" = "yes"; then
4416     ENABLE_CUPS="TRUE"
4417     AC_MSG_RESULT([yes])
4419     AC_MSG_CHECKING([whether cups support is present])
4420     AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4421     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4422     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
4423         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups-devel.])
4424     fi
4426 else
4427     AC_MSG_RESULT([no])
4430 AC_SUBST(ENABLE_CUPS)
4432 # fontconfig checks
4433 if test "$test_fontconfig" = "yes"; then
4434     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
4435 else
4436     case "$BUILD_TYPE" in
4437     *FONTCONFIG*)
4438         FONTCONFIG_LIBS="-lfontconfig"
4439         ;;
4440     esac
4442 AC_SUBST(FONTCONFIG_CFLAGS)
4443 AC_SUBST(FONTCONFIG_LIBS)
4445 dnl whether to find & fetch external tarballs?
4446 dnl ===================================================================
4447 if test -z "$TARFILE_LOCATION"; then
4448     TARFILE_LOCATION="$SRC_ROOT/src"
4450 AC_SUBST(TARFILE_LOCATION)
4452 AC_MSG_CHECKING([whether we want to fetch tarballs])
4453 if test "$enable_fetch_external" != "no"; then
4454     if test "$with_all_tarballs" = "yes"; then
4455         AC_MSG_RESULT(["yes, all of them"])
4456         DO_FETCH_TARBALLS="ALL"
4457     else
4458         AC_MSG_RESULT(["yes, if we use them"])
4459         DO_FETCH_TARBALLS="YES"
4460     fi
4461 else
4462     AC_MSG_RESULT([no])
4463     DO_FETCH_TARBALLS="NO"
4465 AC_SUBST(DO_FETCH_TARBALLS)
4467 AC_MSG_CHECKING([whether to build help])
4468 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4469     AC_MSG_RESULT([yes])
4470     BUILD_TYPE="$BUILD_TYPE HELP"
4471     SCPDEFS="$SCPDEFS -DWITH_HELP"
4472     GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4473 else
4474     AC_MSG_RESULT([no])
4477 dnl Test whether to include MySpell dictionaries
4478 dnl ===================================================================
4479 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4480 if test -z "$with_myspell_dicts" -o "$with_myspell_dicts" = "yes"; then
4481     AC_MSG_RESULT([yes])
4482     WITH_MYSPELL_DICTS=YES
4483     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4484     GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4485 else
4486     AC_MSG_RESULT([no])
4487     WITH_MYSPELL_DICTS=NO
4489 AC_SUBST(WITH_MYSPELL_DICTS)
4491 AC_MSG_CHECKING([whether to use dicts from external paths])
4492 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4493     AC_MSG_RESULT([yes])
4494     SYSTEM_DICTS=YES
4495     AC_MSG_CHECKING([for spelling dictionary directory])
4496     if test -n "$with_external_dict_dir"; then
4497         DICT_SYSTEM_DIR=file://$with_external_dict_dir
4498     else
4499         DICT_SYSTEM_DIR=file:///usr/share/hunspell
4500         if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4501             DICT_SYSTEM_DIR=file:///usr/share/myspell
4502         fi
4503     fi
4504     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4505     AC_MSG_CHECKING([for hyphenation patterns directory])
4506     if test -n "$with_external_hyph_dir"; then
4507         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4508     else
4509         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4510     fi
4511     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4512     AC_MSG_CHECKING([for thesaurus directory])
4513     if test -n "$with_external_thes_dir"; then
4514         THES_SYSTEM_DIR=file://$with_external_thes_dir
4515     else
4516         THES_SYSTEM_DIR=file:///usr/share/mythes
4517     fi
4518     AC_MSG_RESULT([$THES_SYSTEM_DIR])
4519 else
4520     AC_MSG_RESULT([no])
4521     SYSTEM_DICTS=NO
4523 AC_SUBST(SYSTEM_DICTS)
4524 AC_SUBST(DICT_SYSTEM_DIR)
4525 AC_SUBST(HYPH_SYSTEM_DIR)
4526 AC_SUBST(THES_SYSTEM_DIR)
4528 dnl ===================================================================
4529 dnl ENABLE_PCH i now a no-op
4530 dnl ===================================================================
4531 AC_MSG_CHECKING([whether to enable pch feature])
4532 AC_MSG_RESULT([no, obsolete])
4534 dnl ===================================================================
4535 dnl Search all the common names for GNU make
4536 dnl ===================================================================
4537 AC_MSG_CHECKING([for GNU make])
4539 # try to use our own make if it is available and GNUMAKE was not already defined
4540 if test -z "$GNUMAKE"; then
4541     if test -x "/opt/lo/bin/make"; then
4542         GNUMAKE="/opt/lo/bin/make"
4543     fi
4546 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
4547     if test -n "$a"; then
4548         $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
4549         if test $? -eq 0;  then
4550             GNUMAKE=$a
4551             break
4552         fi
4553     fi
4554 done
4555 AC_MSG_RESULT($GNUMAKE)
4556 if test -z "$GNUMAKE"; then
4557     AC_MSG_ERROR([not found. install GNU make.])
4560 AC_MSG_CHECKING([the GNU make version])
4561 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4562 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4563 if test "$_make_longver" -ge "038200"; then
4564     AC_MSG_RESULT([$GNUMAKE $_make_version])
4566 elif test "$_make_longver" -ge "038100"; then
4567     if test "$build_os" = "cygwin"; then
4568         AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4569     fi
4570     AC_MSG_RESULT([$GNUMAKE $_make_version])
4572     dnl ===================================================================
4573     dnl Search all the common names for sha1sum
4574     dnl ===================================================================
4575     AC_PATH_PROGS(SHA1SUM, sha1sum sha1 shasum)
4576     if test -z "$SHA1SUM"; then
4577         AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
4578     fi
4579     AC_MSG_CHECKING([for GNU make bug 20033])
4580     TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4581     cat > $TESTGMAKEBUG20033/Makefile << EOF
4582 A := \$(wildcard *.a)
4584 .PHONY: all
4585 all: \$(A:.a=.b)
4586         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
4588 .PHONY: setup
4589 setup:
4590         @touch 1.a 2.a 3.a 4.a 5.a 6.a
4592 define d1
4593 @echo lala \$(1)
4594 @sleep 1
4595 endef
4597 define d2
4598 @echo tyty \$(1)
4599 @sleep 1
4600 endef
4602 %.b : %.a
4603         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
4604         \$(call d1,\$(CHECKSUM)),\
4605         \$(call d2,\$(CHECKSUM)))
4607     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
4608         no_parallelism_make="YES"
4609         AC_MSG_RESULT([yes, disable parallelism])
4610     else
4611         AC_MSG_RESULT([no, keep parallelism enabled])
4612     fi
4613     rm -rf $TESTGMAKEBUG20033
4614 else
4615     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
4618 # find if gnumake support file function
4619 AC_MSG_CHECKING([whether GNU make supports the 'file' function])
4620 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
4621 cat > $TESTGMAKEFILEFUNC/Makefile << EOF
4622 \$(file >test.txt,Success )
4624 .PHONY: all
4625 all:
4626         @cat test.txt
4629 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
4630 if test -f $TESTGMAKEFILEFUNC/test.txt; then
4631     HAVE_GNUMAKE_FILE_FUNC="YES"
4632     AC_MSG_RESULT([yes])
4633 else
4634     AC_MSG_RESULT([no])
4636 rm -rf $TESTGMAKEFILEFUNC
4637 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
4638 AC_SUBST(GNUMAKE)
4640 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`
4641 STALE_MAKE=
4642 make_warning=
4643 if test "$_make_ver_check" = ""; then
4644    STALE_MAKE=TRUE
4647 HAVE_LD_HASH_STYLE=FALSE
4648 WITH_LINKER_HASH_STYLE=
4649 AC_MSG_CHECKING( for --hash-style gcc linker support )
4650 if test "$GCC" = "yes"; then
4651     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
4652         hash_styles="gnu sysv"
4653     elif test "$with_linker_hash_style" = "no"; then
4654         hash_styles=
4655     else
4656         hash_styles="$with_linker_hash_style"
4657     fi
4659     for hash_style in $hash_styles; do
4660         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4661         hash_style_ldflags_save=$LDFLAGS
4662         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
4664         AC_LINK_IFELSE([AC_LANG_PROGRAM(
4665             [
4666 #include <stdio.h>
4667             ],[
4668 printf ("");
4669             ])],
4670             [ if ./conftest$EXEEXT; then
4671                   HAVE_LD_HASH_STYLE=TRUE
4672                   WITH_LINKER_HASH_STYLE=$hash_style
4673               fi],
4674             [HAVE_LD_HASH_STYLE=FALSE])
4675         LDFLAGS=$hash_style_ldflags_save
4676     done
4678     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
4679         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
4680     else
4681         AC_MSG_RESULT( no )
4682     fi
4683     LDFLAGS=$hash_style_ldflags_save
4684 else
4685     AC_MSG_RESULT( no )
4687 AC_SUBST(HAVE_LD_HASH_STYLE)
4688 AC_SUBST(WITH_LINKER_HASH_STYLE)
4690 dnl ===================================================================
4691 dnl Check whether there's a Perl version available.
4692 dnl ===================================================================
4693 if test -z "$with_perl_home"; then
4694     AC_PATH_PROG(PERL, perl)
4695 else
4696     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
4697     _perl_path="$with_perl_home/bin/perl"
4698     if test -x "$_perl_path"; then
4699         PERL=$_perl_path
4700     else
4701         AC_MSG_ERROR([$_perl_path not found])
4702     fi
4705 dnl ===================================================================
4706 dnl Testing for Perl version 5 or greater.
4707 dnl $] is the Perl version variable, it is returned as an integer
4708 dnl ===================================================================
4709 if test "$PERL"; then
4710     AC_MSG_CHECKING([the Perl version])
4711     ${PERL} -e "exit($]);"
4712     _perl_version=$?
4713     if test "$_perl_version" -lt 5; then
4714         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
4715     fi
4716     AC_MSG_RESULT([checked (perl $_perl_version)])
4717 else
4718     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
4721 dnl ===================================================================
4722 dnl Testing for required Perl modules
4723 dnl ===================================================================
4725 AC_MSG_CHECKING([for required Perl modules])
4726 if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'`; then
4727     AC_MSG_RESULT([all modules found])
4728 else
4729     AC_MSG_ERROR([Failed to find some modules])
4733 dnl ===================================================================
4734 dnl Check for pkg-config
4735 dnl ===================================================================
4736 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4737     PKG_PROG_PKG_CONFIG
4740 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4742     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
4743     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
4744     # explicitly. Or put /path/to/compiler in PATH yourself.
4746     AC_CHECK_TOOL(AR,ar)
4747     AC_CHECK_TOOL(NM,nm)
4748     AC_CHECK_TOOL(OBJDUMP,objdump)
4749     AC_CHECK_TOOL(RANLIB,ranlib)
4750     AC_CHECK_TOOL(STRIP,strip)
4751     if test "$_os" = "WINNT"; then
4752         AC_CHECK_TOOL(DLLTOOL,dlltool)
4753         AC_CHECK_TOOL(WINDRES,windres)
4754     fi
4756 AC_SUBST(AR)
4757 AC_SUBST(DLLTOOL)
4758 AC_SUBST(NM)
4759 AC_SUBST(OBJDUMP)
4760 AC_SUBST(PKG_CONFIG)
4761 AC_SUBST(RANLIB)
4762 AC_SUBST(STRIP)
4763 AC_SUBST(WINDRES)
4765 dnl ===================================================================
4766 dnl pkg-config checks on Mac OS X
4767 dnl ===================================================================
4769 if test $_os = Darwin; then
4770     AC_MSG_CHECKING([for bogus pkg-config])
4771     if test -n "$PKG_CONFIG"; then
4772         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
4773             AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
4774         else
4775             if test "$enable_bogus_pkg_config" = "yes"; then
4776                 AC_MSG_RESULT([yes, user-approved from unknown origin.])
4777             else
4778                 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please remove or hide $PKG_CONFIG])
4779             fi
4780         fi
4781     else
4782         AC_MSG_RESULT([no, good])
4783     fi
4786 dnl ===================================================================
4787 dnl  .NET needs special treatment
4788 dnl (does the above comment really mean .NET, or is it misusing
4789 dnl that to mean Visual Studio .NET 2003 ? And does this also
4790 dnl in fact apply equally to what we actually support, i.e.
4791 dnl Visual Studio 2008 and 2010?)
4792 dnl ===================================================================
4793 if test "$build_os" = "cygwin"; then
4794     dnl Check midl.exe
4795     AC_PATH_PROG(MIDL_PATH, midl.exe)
4796     if test -n "$MIDL_PATH"; then
4797         MIDL_PATH=`dirname "$MIDL_PATH"`
4798     else
4799         AC_MSG_CHECKING([for midl.exe more thoroughly])
4800     fi
4801     if test -n "$with_midl_path"; then
4802         with_midl_path=`cygpath -u "$with_midl_path"`
4803     fi
4804     if test -x "$with_midl_path/midl.exe"; then
4805         MIDL_PATH="$with_midl_path"
4806     fi
4807     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
4808         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
4809     fi
4810     if test -z "$MIDL_PATH"; then
4811         vstest=`./oowintool --msvs-productdir`
4812         if test -x "$vstest/Common7/Tools/Bin/midl.exe"; then
4813             MIDL_PATH="$vstest/Common7/Tools/Bin"
4814         fi
4815     fi
4816     if test -z "$MIDL_PATH"; then
4817         winsdktest=`./oowintool --windows-sdk-home`
4818         if test -x "$winsdktest/Bin/midl.exe"; then
4819             MIDL_PATH="$winsdktest/Bin"
4820         elif test -x "$winsdktest/Bin/$SDK_ARCH/midl.exe"; then
4821             MIDL_PATH="$winsdktest/Bin/$SDK_ARCH"
4822         fi
4823     fi
4824     if test ! -x "$MIDL_PATH/midl.exe"; then
4825         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
4826     else
4827         AC_MSG_RESULT([$MIDL_PATH/midl.exe])
4828     fi
4829     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4830     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
4831     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
4832     AL=al.exe
4834     dnl Check csc.exe
4835     CSC=csc.exe
4836     AC_PATH_PROG(CSC_PATH, $CSC)
4837     if test -n "$CSC_PATH"; then
4838         CSC_PATH=`dirname "$CSC_PATH"`
4839     fi
4840     if test -n "$with_csc_path"; then
4841         with_csc_path=`cygpath -u "$with_csc_path"`
4842     else
4843         AC_MSG_CHECKING([for $CSC more thoroughly])
4844     fi
4845     if test -x "$with_csc_path/$CSC"; then
4846         CSC_PATH="$with_csc_path"
4847     else
4848        csctest=`./oowintool --csc-compilerdir`
4849        if test -x "$csctest/$CSC"; then
4850            CSC_PATH="$csctest"
4851        fi
4852     fi
4853     if test ! -x "$CSC_PATH/$CSC"; then
4854         AC_MSG_ERROR([$CSC not found. Make sure it's in the path or use --with-csc-path])
4855     else
4856         AC_MSG_RESULT([$CSC_PATH/$CSC])
4857     fi
4858     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4859     CSC_PATH=`cygpath -d "$CSC_PATH"`
4860     CSC_PATH=`cygpath -u "$CSC_PATH"`
4862     dnl Check al.exe
4863     AC_PATH_PROG(AL_PATH, al.exe)
4864     if test -n "$AL_PATH"; then
4865         AL_PATH=`dirname "$AL_PATH"`
4866     else
4867         AC_MSG_CHECKING([for al.exe more thoroughly])
4868     fi
4869     if test -n "$with_al_path"; then
4870         with_al_path=`cygpath -u "$with_al_path"`
4871     fi
4872     if test -x "$with_al_path/al.exe"; then
4873         AL_PATH="$with_al_path"
4874     fi
4875     if test -z "$AL_PATH"; then
4876         winsdktest=`./oowintool --windows-sdk-home`
4877         if test -x "$winsdktest/Bin/al.exe"; then
4878             AL_PATH="$winsdktest/Bin"
4879         elif test -x "$winsdktest/Bin/$SDK_ARCH/al.exe"; then
4880             AL_PATH="$winsdktest/Bin/$SDK_ARCH"
4881         fi
4882     fi
4883     if test -z "$AL_PATH"; then
4884         altest=`./oowintool --al-home`
4885         if test -x "$altest/bin/al.exe"; then
4886             AL_PATH="$altest/bin"
4887         elif test -x "$altest/al.exe"; then
4888             AL_PATH="$altest"
4889         fi
4890     fi
4891     if test ! -x "$AL_PATH/al.exe"; then
4892         AC_MSG_ERROR([al.exe not found. Make sure it's in PATH or use --with-al-path])
4893     else
4894         AC_MSG_RESULT([$AL_PATH/al.exe])
4895     fi
4897     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4898     AL_PATH=`cygpath -d "$AL_PATH"`
4899     AL_PATH=`cygpath -u "$AL_PATH"`
4901     dnl Check mscoree.lib / .NET Framework dir
4902     AC_MSG_CHECKING(.NET Framework)
4903     if test -n "$with_dotnet_framework_home"; then
4904         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
4905     fi
4906         if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
4907         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
4908     fi
4909     if test -z "$DOTNET_FRAMEWORK_HOME"; then
4910         frametest=`./oowintool --dotnetsdk-dir`
4911         if test -f "$frametest/lib/mscoree.lib"; then
4912             DOTNET_FRAMEWORK_HOME="$frametest"
4913         else
4914             frametest=`./oowintool --windows-sdk-home`
4915             if test -f "$frametest/lib/mscoree.lib" -o -f "$frametest/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
4916                 DOTNET_FRAMEWORK_HOME="$frametest"
4917             fi
4918         fi
4919     fi
4920     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
4921         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
4922     fi
4923     AC_MSG_RESULT(found)
4925     PathFormat "$MIDL_PATH"
4926     MIDL_PATH="$formatted_path"
4928     PathFormat "$AL_PATH"
4929     AL_PATH="$formatted_path"
4931     PathFormat "$DOTNET_FRAMEWORK_HOME"
4932     DOTNET_FRAMEWORK_HOME="$formatted_path"
4934     PathFormat "$CSC_PATH"
4935     CSC_PATH="$formatted_path"
4939 dnl ===================================================================
4940 dnl Check whether to enable Mono bindings
4941 dnl ===================================================================
4942 if test "$_os" = "Linux"; then
4943     AC_MSG_CHECKING([whether to enable Mono bindings])
4944     CSC_PATH=
4945     CSC=
4946     ENABLE_MONO=NO
4947     if test "$enable_mono" = "yes" ; then
4948         AC_MSG_RESULT([yes])
4949         if test "z$with_csc_path" != "z"; then
4950                 if test -x "$with_csc_path/mcs"; then
4951                         CSC_PATH="$with_csc_path"
4952                 fi
4953                 if test -x "$with_csc_path/bin/mcs"; then
4954                         CSC_PATH="$with_csc_path/bin"
4955                 fi
4956         fi
4957             if test "z$CSC_PATH" = "z"; then
4958             AC_PATH_PROG(MCS, mcs)
4959             test -z "$MCS" || CSC_PATH=`dirname $MCS`
4960             fi
4961                 AL="$CSC_PATH/al"
4962         if test -x "$MCS" -a -x "$AL"; then
4963             MCS_VERSION=`$MCS --version | cut -d" " -f5`
4964             if test "`echo $MCS_VERSION | cut -d"." -f1`" -gt "1" || \
4965                test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
4966                     "`echo $MCS_VERSION | cut -d"." -f2`" -ge "2" || \
4967                test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
4968                     "`echo $MCS_VERSION | cut -d"." -f2`" = "1" -a \
4969                         "`echo $MCS_VERSION | cut -d"." -f3`" -ge "8"; then
4970                 ENABLE_MONO=YES
4971                 CSC=$MCS
4972                 AC_PATH_PROG(GMCS, gmcs, no)
4973                 AC_PATH_PROG(MKBUNDLE2, mkbundle2, no)
4974                 AC_PATH_PROG(MKBUNDLE, mkbundle, no)
4975                 if test "x$MKBUNDLE2" != "xno"; then
4976                     MKBUNDLE=$MKBUNDLE2
4977                 fi
4978                 GMCS_VERSION=`$GMCS --version | cut -d" " -f5`
4979                 if test "`echo $GMCS_VERSION | cut -d"." -f1`" -gt "1" || \
4980                    test "`echo $GMCS_VERSION | cut -d"." -f1`" = "1" -a \
4981                         "`echo $GMCS_VERSION | cut -d"." -f2`" -ge "3" || \
4982                    test "`echo $GMCS_VERSION | cut -d"." -f1`" = "1" -a \
4983                     "`echo $GMCS_VERSION | cut -d"." -f2`" = "2" -a \
4984                     "`echo $GMCS_VERSION | cut -d"." -f3`" -ge "3"; then
4985                     # mkbundle2 does not work on ppc, http://bugzilla.ximian.com/show_bug.cgi?id=81525
4986                     if test "`uname -m`" != "ppc" -a "`uname -m`" != "ppc64" ; then
4987                     ENABLE_MONO_CLIMAKER=YES
4988                     AC_MSG_NOTICE([mono is up-to-date enough - building mono climaker])
4989                     fi
4990                 fi
4991             else
4992                 if test -n "$enable_mono" ; then
4993                     AC_MSG_ERROR([no, mcs >= 1.1.8 is needed.])
4994                 fi
4995             fi
4996         else
4997             if test -n "$enable_mono"; then
4998                 AC_MSG_ERROR([mcs or al not found. Make sure they're in the path or use --with-csc-path])
4999             fi
5000         fi
5001         PKG_CHECK_MODULES([MONO], [mono-2 glib-2.0],,[PKG_CHECK_MODULES([MONO], [mono >= 1.1.8 glib-2.0])])
5002     else
5003         AC_MSG_RESULT([no])
5004     fi
5006     MONO_GAC_ROOT=
5007     if test -n "$with_mono_gac_root" -a "$with_mono_gac_root" != "no" ; then
5008         MONO_GAC_ROOT=$with_mono_gac_root
5009     fi
5012 if test "$ENABLE_MONO" = "YES" -o "$COM" = "MSC" ; then
5013     BUILD_CLI=YES
5014 else
5015     BUILD_CLI=NO
5017 AC_SUBST(BUILD_CLI)
5018 AC_SUBST(CSC_PATH)
5019 AC_SUBST(CSC)
5020 AC_SUBST(AL)
5021 AC_SUBST(ENABLE_MONO)
5022 AC_SUBST(MONO_CFLAGS)
5023 AC_SUBST(MONO_LIBS)
5024 AC_SUBST(MONO_GAC_ROOT)
5025 AC_SUBST(ENABLE_MONO_CLIMAKER)
5026 AC_SUBST(MKBUNDLE)
5028 dnl ===================================================================
5029 dnl Check if stdc headers are available excluding MSVC.
5030 dnl ===================================================================
5031 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5032     AC_HEADER_STDC
5035 dnl ===================================================================
5036 dnl Testing for C++ compiler and version...
5037 dnl ===================================================================
5039 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5040     # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5041     save_CXXFLAGS=$CXXFLAGS
5042     AC_PROG_CXX
5043     CXXFLAGS=$save_CXXFLAGS
5044 else
5045     if test -n "$CC" -a -z "$CXX"; then
5046         CXX="$CC"
5047     fi
5050 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
5051 if test "$GXX" = "yes"; then
5052     AC_MSG_CHECKING([the GNU C++ compiler version])
5054     _gpp_version=`$CXX -dumpversion`
5055     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5057     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401"; then
5058         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0"; then
5059             export CXX="$GCC_HOME/bin/g++-4.0"
5060             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
5061             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401"; then
5062                 _gpp_majmin=$_gpp_majmin_2
5063             fi
5064         fi
5065         if test "$_gpp_majmin" -ge "401"; then
5066             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])
5067         else
5068             AC_MSG_RESULT([implicitly using CXX=$CXX])
5069         fi
5070     else
5071         AC_MSG_RESULT([checked (g++ $_gpp_version)])
5072     fi
5074     if test "$_gpp_majmin" = "304"; then
5075         AC_MSG_CHECKING([whether $CXX has the enum bug])
5076         AC_RUN_IFELSE([AC_LANG_SOURCE([[
5077             extern "C" void abort (void);
5078             extern "C" void exit (int status);
5080             enum E { E0, E1, E2, E3, E4, E5 };
5082             void test (enum E e)
5083             {
5084                 if (e == E2 || e == E3 || e == E1)
5085                     exit (1);
5086             }
5088             int main (void)
5089             {
5090                 test (E4);
5091                 test (E5);
5092                 test (E0);
5093                 return 0;
5094             }
5095             ]])],[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])],[])
5096     fi
5100 # prefx CXX with ccache if needed
5102 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5103     if test "$CCACHE" != ""; then
5104         AC_MSG_CHECKING([whether $CXX is already ccached])
5105         AC_LANG_PUSH([C++])
5106         save_CXXFLAGS=$CXXFLAGS
5107         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5108         dnl an empty program will do, we're checking the compiler flags
5109         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5110                           [use_ccache=yes], [use_ccache=no])
5111         if test $use_ccache = yes; then
5112             AC_MSG_RESULT([yes])
5113         else
5114             CXX="$CCACHE $CXX"
5115             AC_MSG_RESULT([no])
5116         fi
5117         CXXFLAGS=$save_CXXFLAGS
5118         AC_LANG_POP([C++])
5119     fi
5122 dnl ===================================================================
5123 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5124 dnl ===================================================================
5126 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5127     AC_PROG_CXXCPP
5129     dnl Check whether there's a C pre-processor.
5130     dnl ===================================================================
5131     dnl When using SunStudio compiler, there is a bug with the cc
5132     dnl preprocessor, so use CC preprocessor as the cc preprocessor
5133     dnl See Issuezilla #445.
5134     dnl ===================================================================
5135     if test "$_os" = "SunOS"; then
5136         CPP=$CXXCPP
5137     else
5138         AC_PROG_CPP
5139     fi
5143 dnl ===================================================================
5144 dnl Find integral type sizes and alignments
5145 dnl ===================================================================
5147 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5149     AC_CHECK_SIZEOF(long)
5150     AC_CHECK_SIZEOF(short)
5151     AC_CHECK_SIZEOF(int)
5152     AC_CHECK_SIZEOF(long long)
5153     AC_CHECK_SIZEOF(double)
5154     AC_CHECK_SIZEOF(void*)
5156     SIZEOF_SHORT=$ac_cv_sizeof_short
5157     SIZEOF_INT=$ac_cv_sizeof_int
5158     SIZEOF_LONG=$ac_cv_sizeof_long
5159     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
5160     SIZEOF_DOUBLE=$ac_cv_sizeof_double
5161     SIZEOF_POINTER=$ac_cv_sizeof_voidp
5163     dnl Allow build without AC_CHECK_ALIGNOF, grrr
5164     m4_pattern_allow([AC_CHECK_ALIGNOF])
5165     m4_ifdef([AC_CHECK_ALIGNOF],
5166         [
5167             AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5168             AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5169             AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5170             AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5171         ],
5172         [
5173             case "$_os-$host_cpu" in
5174             Darwin-powerpc)
5175                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=1
5176                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=1
5177                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=1
5178                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=1
5179                 ;;
5180             Linux-i686)
5181                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5182                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5183                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5184                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5185                 ;;
5186             Linux-x86_64)
5187                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5188                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5189                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5190                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5191                 ;;
5192             *)
5193                 if test -z "$ac_cv_alignof_short" -o \
5194                         -z "$ac_cv_alignof_int" -o \
5195                         -z "$ac_cv_alignof_long" -o \
5196                         -z "$ac_cv_alignof_double"; then
5197                    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.])
5198                 fi
5199                 ;;
5200             esac
5201         ])
5203     ALIGNOF_SHORT=$ac_cv_alignof_short
5204     ALIGNOF_INT=$ac_cv_alignof_int
5205     ALIGNOF_LONG=$ac_cv_alignof_long
5206     ALIGNOF_DOUBLE=$ac_cv_alignof_double
5208     AC_C_BIGENDIAN
5209     WORDS_BIGENDIAN=$ac_cv_c_bigendian
5211     dnl Check for large file support
5212     AC_SYS_LARGEFILE
5213     if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5214         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5215     fi
5216     if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5217         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5218     fi
5219 else
5220     # Hardcode for MSVC
5221     SIZEOF_SHORT=2
5222     SIZEOF_INT=4
5223     SIZEOF_LONG=4
5224     SIZEOF_LONGLONG=8
5225     if test "$BITNESS_OVERRIDE" = ""; then
5226         SIZEOF_POINTER=4
5227     else
5228         SIZEOF_POINTER=8
5229     fi
5230     ALIGNOF_SHORT=2
5231     ALIGNOF_INT=4
5232     ALIGNOF_LONG=4
5233     ALIGNOF_DOUBLE=8
5234     WORDS_BIGENDIAN=no
5235     LFS_CFLAGS=''
5237 AC_SUBST(WORDS_BIGENDIAN)
5238 AC_SUBST(LFS_CFLAGS)
5240 AC_SUBST(SIZEOF_SHORT)
5241 AC_SUBST(SIZEOF_INT)
5242 AC_SUBST(SIZEOF_LONG)
5243 AC_SUBST(SIZEOF_LONGLONG)
5244 AC_SUBST(SIZEOF_DOUBLE)
5245 AC_SUBST(SIZEOF_POINTER)
5246 AC_SUBST(ALIGNOF_SHORT)
5247 AC_SUBST(ALIGNOF_INT)
5248 AC_SUBST(ALIGNOF_LONG)
5249 AC_SUBST(ALIGNOF_DOUBLE)
5251 dnl ===================================================================
5252 dnl Check if valgrind headers are available
5253 dnl ===================================================================
5254 if test "$cross_compiling" = yes -o "$ENABLE_DBGUTIL" != TRUE; then
5255     ENABLE_VALGRIND=FALSE
5256 else
5257     prev_cppflags=$CPPFLAGS
5258     CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5259     AC_CHECK_HEADER([valgrind/valgrind.h],
5260         [ENABLE_VALGRIND=TRUE],[ENABLE_VALGRIND=FALSE])
5261     CPPFLAGS=$prev_cppflags
5263 AC_SUBST([ENABLE_VALGRIND])
5264 if test "$ENABLE_VALGRIND" = FALSE; then
5265     VALGRIND_CFLAGS=
5267 AC_SUBST([VALGRIND_CFLAGS])
5269 dnl ===================================================================
5270 dnl Compiler plugins
5271 dnl ===================================================================
5273 COMPILER_PLUGINS=
5274 # currently only Clang
5275 if test "$COM_GCC_IS_CLANG" = "TRUE"; then
5276     if test -n "$enable_compiler_plugins"; then
5277         compiler_plugins="$enable_compiler_plugins"
5278     elif test -n "$ENABLE_DBGUTIL"; then
5279         compiler_plugins=test
5280     else
5281         compiler_plugins=no
5282     fi
5283     if test "$compiler_plugins" != "no"; then
5284         AC_LANG_PUSH([C++])
5285         save_CPPFLAGS=$CPPFLAGS
5286         CPPFLAGS="$CPPFLAGS $CLANGPLUGIN_CPPFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
5287         AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
5288             [COMPILER_PLUGINS=TRUE],
5289             [
5290             if test "$compiler_plugins" = "yes"; then
5291                 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
5292             else
5293                 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
5294                 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
5295             fi
5296             ])
5297         CPPFLAGS=$save_CPPFLAGS
5298         AC_LANG_POP([C++])
5299     fi
5300 else
5301     if test "$enable_compiler_plugins" = "yes"; then
5302         AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
5303     fi
5305 AC_SUBST(COMPILER_PLUGINS)
5306 AC_SUBST(CLANGPLUGIN_CPPFLAGS)
5308 dnl ===================================================================
5309 dnl Set the MinGW sys-root
5310 dnl ===================================================================
5311 if test "$WITH_MINGW" = "yes"; then
5312     for sysroot in /usr/i686-w64-mingw32/sys-root/mingw; do
5313         if test -d "$sysroot"; then
5314             MINGW_SYSROOT="$sysroot"
5315             break
5316         fi
5317     done
5319 AC_SUBST([MINGW_SYSROOT])
5321 dnl ===================================================================
5322 dnl Set the MinGW include directories
5323 dnl ===================================================================
5324 if test "$WITH_MINGW" = "yes"; then
5325     AC_MSG_CHECKING([for MinGW include path])
5326     cat >conftest.$ac_ext <<_ACEOF
5327 #include <stddef.h>
5328 #include <bits/c++config.h>
5329 _ACEOF
5330     _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`
5331     rm conftest.$ac_ext
5332     if test -z "$_mingw_lib_include_path"; then
5333         _mingw_lib_include_path="NO_LIB_INCLUDE"
5334         AC_MSG_RESULT([no MinGW include path])
5335     else
5336         AC_MSG_RESULT([$_mingw_lib_include_path])
5337     fi
5338     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
5339     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
5341     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
5342     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
5344     AC_LANG_PUSH([C++])
5346     AC_MSG_CHECKING([for dynamic libgcc])
5347     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5348 #include <iostream>
5349 using namespace std;
5350 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
5351             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
5352             if test -n "$MINGW_GCCDLL"; then
5353                 MINGW_SHARED_GCCLIB=YES
5354                 AC_MSG_RESULT([ $MINGW_GCCDLL])
5355             else
5356                 MINGW_SHARED_GCCLIB=NO
5357                 AC_MSG_RESULT([no])
5358             fi
5359        ],[ AC_MSG_RESULT([no])
5361     ])
5363     AC_MSG_CHECKING([for dynamic libstdc++])
5364     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5365 #include <iostream>
5366 using namespace std;
5367 ]], [[ cout << "Hello there." << endl; ]])],[
5368             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
5369             if test -n "$MINGW_GXXDLL"; then
5370                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
5371                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
5372                 if test "$CROSS_COMPILING" = "YES"; then
5373                     dnl m4 escaping!
5374                     mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
5375                 fi
5376                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
5377                 MINGW_SHARED_GXXLIB=YES
5378                 AC_MSG_RESULT([$MINGW_GXXDLL])
5379             else
5380                 MINGW_SHARED_GXXLIB=NO
5381                 AC_MSG_RESULT([no])
5382             fi
5383        ],[ AC_MSG_RESULT([no])
5385     ])
5387     AC_LANG_POP([C++])
5389     AC_SUBST(MINGW_CLIB_DIR)
5390     AC_SUBST(MINGW_SHARED_GCCLIB)
5391     AC_SUBST(MINGW_SHARED_GXXLIB)
5392     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
5393     AC_SUBST(MINGW_GCCDLL)
5394     AC_SUBST(MINGW_GXXDLL)
5397 dnl ===================================================================
5398 dnl Extra checking for the SunOS compiler
5399 dnl ===================================================================
5400 if test "$_os" = "SunOS"; then
5401     dnl SunStudio C++ compiler packaged with SunStudio C compiler
5402     if test "$CC" = "cc"; then
5403     AC_MSG_CHECKING([SunStudio C++ Compiler])
5404         if test "$CXX" != "CC"; then
5405             AC_MSG_WARN([SunStudio C++ was not found])
5406             add_warning "SunStudio C++ was not found"
5407         else
5408             AC_MSG_RESULT([checked])
5409         fi
5410     fi
5413 dnl *************************************************************
5414 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
5415 dnl *************************************************************
5416 if test "$WITH_MINGW" = "yes"; then
5417     AC_MSG_CHECKING([exception type])
5418     AC_LANG_PUSH([C++])
5419     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
5421         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
5423         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
5424     ])
5425     AC_MSG_RESULT($exceptions_type)
5426     AC_LANG_POP([C++])
5429 EXCEPTIONS="$exceptions_type"
5430 AC_SUBST(EXCEPTIONS)
5432 dnl ===================================================================
5433 dnl thread-safe statics
5434 dnl ===================================================================
5435 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
5436 unset HAVE_THREADSAFE_STATICS
5437 if test "$GCC" = "yes"; then
5438     dnl -fthreadsafe-statics is available since GCC 4, so always available for
5439     dnl us.  However, some C++ runtimes use a single lock for all static
5440     dnl variables, which can cause deadlock in multi-threaded applications.
5441     dnl This is not easily tested here; for POSIX-based systems, if executing
5442     dnl the following C++ program does not terminate then the tool chain
5443     dnl apparently has this problem:
5444     dnl
5445     dnl   #include <pthread.h>
5446     dnl   int h() { return 0; }
5447     dnl   void * g(void * unused) {
5448     dnl     static int n = h();
5449     dnl     return &n;
5450     dnl   }
5451     dnl   int f() {
5452     dnl     pthread_t t;
5453     dnl     pthread_create(&t, 0, g, 0);
5454     dnl     pthread_join(t, 0);
5455     dnl     return 0;
5456     dnl   }
5457     dnl   int main() {
5458     dnl     static int n = f();
5459     dnl     return n;
5460     dnl   }
5461     dnl
5462     dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
5463     dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
5464     dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
5465     dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
5466     dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
5467     dnl difference there.  Conservative advice from Jakub Jelinek is to assume
5468     dnl it working in GCC >= 4.3:
5469     if test "$_os" = "Darwin" -o $_os = Android -o "${GCCVER?}" -lt 040300; then
5470         AC_MSG_RESULT([broken (i.e., no)])
5471     else
5472         HAVE_THREADSAFE_STATICS=TRUE
5473         AC_MSG_RESULT([yes])
5474     fi
5475 else
5476     AC_MSG_RESULT([unknown (assuming no)])
5478 AC_SUBST(HAVE_THREADSAFE_STATICS)
5480 dnl ===================================================================
5481 dnl visibility and c++0x features
5482 dnl ===================================================================
5483 if test "$GCC" = "yes"; then
5484     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
5485     save_CFLAGS=$CFLAGS
5486     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
5487     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
5488     CFLAGS=$save_CFLAGS
5490     if test "$COM_GCC_IS_CLANG" = TRUE -a $_os = Darwin; then
5491         # It seems that with Apple's Clang, visibility doesn't work as
5492         # we would want at least in the connectivity and dbaccess
5493         # modules. This might be because of something peculiar in
5494         # those modules? Whatever.
5495         HAVE_GCC_VISIBILITY_FEATURE=
5496     fi
5498     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5499         AC_MSG_RESULT([yes])
5500     else
5501         AC_MSG_RESULT([no])
5502     fi
5504     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
5505     save_CFLAGS=$CFLAGS
5506     CFLAGS="$CFLAGS -Werror -Wno-long-double"
5507     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
5508     CFLAGS=$save_CFLAGS
5509     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
5510         AC_MSG_RESULT([yes])
5511     else
5512         AC_MSG_RESULT([no])
5513     fi
5515     AC_MSG_CHECKING([whether $CC supports -mno-avx])
5516     save_CFLAGS=$CFLAGS
5517     CFLAGS="$CFLAGS -Werror -mno-avx"
5518     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5519     CFLAGS=$save_CFLAGS
5520     if test "$HAVE_GCC_AVX" = "TRUE"; then
5521         AC_MSG_RESULT([yes])
5522     else
5523         AC_MSG_RESULT([no])
5524     fi
5526     AC_MSG_CHECKING([whether $CC supports atomic functions])
5527     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5528     int v = 0;
5529     if (__sync_add_and_fetch(&v, 1) != 1 ||
5530         __sync_sub_and_fetch(&v, 1) != 0)
5531         return 1;
5532     __sync_synchronize();
5533     if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
5534         v != 1)
5535         return 1;
5536     return 0;
5537 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
5538     if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
5539         AC_MSG_RESULT([yes])
5540     else
5541         AC_MSG_RESULT([no])
5542     fi
5544     AC_MSG_CHECKING([whether $CXX supports -std=gnu++0x without Language Defect 757])
5545     if test "$GCCVER" -ge 040700 -a "$GCCVER" -lt 040702; then
5546         AC_MSG_NOTICE([Not using -std=gnu++0x on $CXX version 4.7.0/4.7.1 due to libstdc++ ABI breakage.])
5547     else
5548         save_CXXFLAGS=$CXXFLAGS
5549         CXXFLAGS="$CXXFLAGS -std=gnu++0x"
5550         AC_LANG_PUSH([C++])
5552         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5553 #include <stddef.h>
5555 #include <vector>
5556     // some Clang fail when compiling against GCC 4.7 headers with --std=gnu++0x
5558 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
5560 namespace
5562         struct b
5563         {
5564                 int i;
5565                 int j;
5566         };
5568 ]], [[
5569 struct a
5571         int i;
5572         int j;
5574 a thinga[]={{0,0}, {1,1}};
5575 b thingb[]={{0,0}, {1,1}};
5576 size_t i = sizeof(sal_n_array_size(thinga));
5577 size_t j = sizeof(sal_n_array_size(thingb));
5578 return !(i != 0 && j != 0);
5579 ]])],[HAVE_CXX0X=TRUE],[])
5581         AC_LANG_POP([C++])
5582         CXXFLAGS=$save_CXXFLAGS
5583     fi
5584     if test "$HAVE_CXX0X" = "TRUE"; then
5585         AC_MSG_RESULT([yes])
5586     else
5587         AC_MSG_RESULT([no])
5588     fi
5591 AC_SUBST(HAVE_CXX0X)
5592 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
5593 AC_SUBST(HAVE_GCC_AVX)
5594 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
5596 dnl ===================================================================
5597 dnl Check for C++11 perfect forwarding support
5598 dnl ===================================================================
5599 HAVE_CXX11_PERFECT_FORWARDING=
5600 AC_MSG_CHECKING([whether $CXX supports C++11 perfect forwarding])
5601 save_CXXFLAGS=$CXXFLAGS
5602 if test "$HAVE_CXX0X" = TRUE; then
5603     CXXFLAGS="$CXXFLAGS -std=gnu++0x"
5605 AC_LANG_PUSH([C++])
5606 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5607         #include <utility>
5608         template<typename T, typename... Args> T * f(Args &&... v) {
5609             return new T(std::forward<Args>(v)...);
5610         }
5611     ]], [[
5612         f<int>(0);
5613     ]])], [perfect_forwarding=yes], [perfect_forwarding=no])
5614 AC_LANG_POP([C++])
5615 CXXFLAGS=$save_CXXFLAGS
5616 AC_MSG_RESULT([$perfect_forwarding])
5617 if test "$perfect_forwarding" = yes; then
5618     HAVE_CXX11_PERFECT_FORWARDING=TRUE
5620 AC_SUBST([HAVE_CXX11_PERFECT_FORWARDING])
5622 dnl ===================================================================
5623 dnl system stl sanity tests
5624 dnl ===================================================================
5625 HAVE_GCC_VISIBILITY_BROKEN=
5626 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
5628     AC_LANG_PUSH([C++])
5630     save_CPPFLAGS="$CPPFLAGS"
5631     if test -n "$MACOSX_SDK_PATH"; then
5632         CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
5633     fi
5635     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5636         dnl gcc#19664, gcc#22482, rhbz#162935
5637         AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
5638         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
5639         AC_MSG_RESULT([$stlvisok])
5640         if test "$stlvisok" = "no"; then
5641             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
5642             add_warning "Your gcc STL headers are not visibility safe. Disabling visibility"
5643             unset HAVE_GCC_VISIBILITY_FEATURE
5644         fi
5645     fi
5647     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5648         sharedlink_ldflags_save=$LDFLAGS
5649         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
5651         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
5652         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5653 #include <sstream>
5654 using namespace std;
5655             ]], [[
5656 istringstream strm( "test" ); return 0;
5657             ]])],
5658             # Ugh, surely bad to assume an error message will contain
5659             # the word "unresolvable", a problem with
5660             # -fvisibility-inlines-hidden and STL headers might cause
5661             # some more obscure message on some platform, and anway,
5662             # the error message could be localised.
5663             [$EGREP -q unresolvable conftest.err;
5664             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
5665         ])
5666         AC_MSG_RESULT([$gccvisok])
5667         if test "$gccvisok" = "no"; then
5668             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
5669             add_warning "Your gcc is not -fvisibility-inlines-hidden safe, disabling that."
5670             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
5671         fi
5673         LDFLAGS=$sharedlink_ldflags_save
5674     fi
5676     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
5677         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
5678         cat > conftestlib1.cc <<_ACEOF
5679 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
5680 struct S2: S1<int> { virtual ~S2(); };
5681 S2::~S2() {}
5682 _ACEOF
5683         cat > conftestlib2.cc <<_ACEOF
5684 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
5685 struct S2: S1<int> { virtual ~S2(); };
5686 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
5687 _ACEOF
5688         gccvisinlineshiddenok=yes
5689         if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
5690             gccvisinlineshiddenok=no
5691         else
5692             if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $LINKFLAGSNOUNDEFS -o libconftest2$DLLPOST >/dev/null 2>&5; then
5693                 gccvisinlineshiddenok=no
5694             fi
5695         fi
5697         rm -fr libconftest*
5698         AC_MSG_RESULT([$gccvisinlineshiddenok])
5699         if test "$gccvisinlineshiddenok" = "no"; then
5700             AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
5701             add_warning "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that."
5702             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
5703         fi
5704     fi
5706     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5707         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
5708         cat >visibility.cxx <<_ACEOF
5709 #pragma GCC visibility push(hidden)
5710 struct __attribute__ ((visibility ("default"))) TestStruct {
5711   static void Init();
5713 __attribute__ ((visibility ("default"))) void TestFunc() {
5714   TestStruct::Init();
5716 _ACEOF
5717         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
5718             gccvisbroken=yes
5719         else
5720             case "$host_cpu" in
5721             i?86|x86_64)
5722                 if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
5723                     gccvisbroken=no
5724                 else
5725                     if $EGREP -q '@PLT|@GOT' visibility.s; then
5726                         gccvisbroken=no
5727                     else
5728                         gccvisbroken=yes
5729                     fi
5730                 fi
5731                 ;;
5732             *)
5733                 gccvisbroken=no
5734                 ;;
5735             esac
5736         fi
5737         rm -f visibility.s visibility.cxx
5739         AC_MSG_RESULT([$gccvisbroken])
5740         if test "$gccvisbroken" = "yes"; then
5741             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
5742             add_warning "Your gcc is not -fvisibility=hidden safe. Disabling visibility"
5743             unset HAVE_GCC_VISIBILITY_FEATURE
5744         fi
5745     fi
5747     CPPFLAGS="$save_CPPFLAGS"
5749     AC_LANG_POP([C++])
5752 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
5753 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
5755 dnl ===================================================================
5756 dnl SFINAE test
5757 dnl Pre-C++11 does not allow types without linkage as template arguments.
5758 dnl Substitution Failure Is Not An Error is an idiom that disables
5759 dnl template instances that would cause an error, without actually
5760 dnl causing an error. Old gcc (pre-4.0.2) however causes a real error.
5761 dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21514
5762 dnl ===================================================================
5763 HAVE_SFINAE_ANONYMOUS_BROKEN=
5764 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
5766     AC_LANG_PUSH([C++])
5767     AC_MSG_CHECKING([if SFINAE is broken with anonymous types])
5768     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5769 enum { AnonymousEnumValue };
5770 template< typename T > class TestPredicate {};
5771 template<> class TestPredicate< int > { public: typedef bool Type; };
5772 template< typename T >
5773 bool test( const T&, typename TestPredicate< T >::Type = false )
5774     { return true; };
5775 void test( ... );
5776             ]], [[
5777     test( 10 );
5778     test( AnonymousEnumValue );
5779             ]])],[sfinae_anonymous_broken=no],[sfinae_anonymous_broken=yes
5780         ])
5781         AC_MSG_RESULT([$sfinae_anonymous_broken])
5782         if test "$sfinae_anonymous_broken" = "yes"; then
5783             HAVE_SFINAE_ANONYMOUS_BROKEN="TRUE"
5784         fi
5785     AC_LANG_POP([C++])
5788 AC_SUBST(HAVE_SFINAE_ANONYMOUS_BROKEN)
5790 dnl ===================================================================
5791 dnl  Clang++ tests
5792 dnl ===================================================================
5794 HAVE_GCC_FNO_DEFAULT_INLINE=
5795 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
5796 if test "$GCC" = "yes"; then
5797     AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
5798     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5799         # Option just ignored and silly warning that isn't a real
5800         # warning printed
5801         :
5802     else
5803         AC_LANG_PUSH([C++])
5804         save_CXXFLAGS=$CXXFLAGS
5805         CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
5806         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
5807         CXXFLAGS=$save_CXXFLAGS
5808         AC_LANG_POP([C++])
5809     fi
5810     if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
5811         AC_MSG_RESULT([yes])
5812     else
5813         AC_MSG_RESULT([no])
5814     fi
5816     AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
5817     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5818         # As above
5819         :
5820     else
5821         AC_LANG_PUSH([C++])
5822         save_CXXFLAGS=$CXXFLAGS
5823         CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
5824         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
5825         CXXFLAGS=$save_CXXFLAGS
5826         AC_LANG_POP([C++])
5827     fi
5828     if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
5829         AC_MSG_RESULT([yes])
5830     else
5831         AC_MSG_RESULT([no])
5832     fi
5834 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
5835 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
5838 dnl ===================================================================
5839 dnl allocator
5840 dnl ===================================================================
5841 AC_MSG_CHECKING([which memory allocator to use])
5842 if test "$with_alloc" = "system"; then
5843     AC_MSG_RESULT([system])
5844     ALLOC="SYS_ALLOC"
5845     AC_CHECK_FUNCS([malloc realloc calloc free])
5847 if test "$with_alloc" = "tcmalloc"; then
5848     AC_MSG_RESULT(tcmalloc)
5849     if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
5850         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
5851     fi
5852     AC_CHECK_LIB([tcmalloc], [malloc], [:],
5853         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
5854     ALLOC="TCMALLOC"
5856 if test "$with_alloc" = "jemalloc"; then
5857     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
5858         AC_MSG_RESULT(jemalloc)
5859         save_CFLAGS=$CFLAGS
5860         CFLAGS="$CFLAGS -pthread"
5861         AC_CHECK_LIB([jemalloc], [malloc], [:],
5862             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
5863         ALLOC="JEMALLOC"
5864         CFLAGS=$save_CFLAGS
5865     else
5866         AC_MSG_RESULT([system])
5867         ALLOC="SYS_ALLOC"
5868         AC_CHECK_FUNCS([malloc realloc calloc free])
5869     fi
5871 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
5872     AC_MSG_RESULT([internal])
5874 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
5875 AC_SUBST(HAVE_POSIX_FALLOCATE)
5876 AC_SUBST(ALLOC)
5878 dnl ===================================================================
5879 dnl Custom build version
5880 dnl ===================================================================
5882 AC_MSG_CHECKING([whether to add custom build version])
5883 if test "$with_build_version" != ""; then
5884     BUILD_VER_STRING=$with_build_version
5885     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
5886 else
5887     BUILD_VER_STRING=
5888     AC_MSG_RESULT([no])
5890 AC_SUBST(BUILD_VER_STRING)
5892 dnl ===================================================================
5893 dnl Java support enable
5894 dnl ===================================================================
5895 AC_MSG_CHECKING([whether to build with Java support])
5896 if test "$with_java" != "no"; then
5897     if test "$DISABLE_SCRIPTING" = TRUE; then
5898         AC_MSG_RESULT([no, overridden by --disable-scripting])
5899         SOLAR_JAVA=""
5900         with_java=no
5901     else
5902         AC_MSG_RESULT([yes])
5903         SOLAR_JAVA="TRUE"
5904     fi
5905 else
5906     AC_MSG_RESULT([no])
5907     SOLAR_JAVA=""
5910 AC_SUBST(SOLAR_JAVA)
5912 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
5913 dnl want there to be *run-time* (and build-time) support for Java extensions in the
5914 dnl built LibreOffice.
5916 dnl SOLAR_JAVA="BUILD" is claimed to indicate build-time only support
5917 dnl (no runtime support). It doesn't seem to ever be set to this
5918 dnl value, though, and everywhere SOLAR_JAVA is only checked for being
5919 dnl empty or non-empty.
5921 dnl SOLAR_JAVA="" indicate no java support at all
5923 JITC_PROCESSOR_TYPE=""
5924 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
5925     # IBMs JDK needs this...
5926     JITC_PROCESSOR_TYPE=6
5927     export JITC_PROCESSOR_TYPE
5929 AC_SUBST([JITC_PROCESSOR_TYPE])
5931 if test $_os = "WINNT"; then
5932     AC_MSG_CHECKING([for Microsoft_VC${VCVER}_CRT_x86.msm])
5933     if ./oowintool --msvc-find-msms; then
5934         AC_MSG_RESULT([yes])
5935         SCPDEFS="$SCPDEFS -DWITH_VC"$VCVER"_REDIST"
5936     else
5937         AC_MSG_RESULT([no])
5938     fi
5941 dnl ===================================================================
5942 dnl Checks for Java
5943 dnl ===================================================================
5944 if test "$SOLAR_JAVA" != ""; then
5946     # Windows-specific tests
5947     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5948         if test "$BITNESS_OVERRIDE" = 64; then
5949             bitness="64-bit"
5950             otherbitness="32-bit"
5951         else
5952             bitness="32-bit"
5953             otherbitness="64-bit"
5954         fi
5956         if test -z "$with_jdk_home"; then
5958             # Unfortunately apparently no way to find, if needed, the 64-bit
5959             # JDK in the Registry from the 32-bit Perl oowintool
5961             _jdk_home=`./oowintool --jdk-home`
5962             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
5963                 with_jdk_home="$_jdk_home"
5964                 howfound="found by oowintool"
5965             else
5966                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
5967             fi
5968         else
5969             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
5970             howfound="you passed"
5971         fi
5972     fi
5974     JAVA_HOME=; export JAVA_HOME
5975     if test -z "$with_jdk_home"; then
5976         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
5977     else
5978         _java_path="$with_jdk_home/bin/$with_java"
5979         dnl Check if there is a Java interpreter at all.
5980         if test -x "$_java_path"; then
5981             JAVAINTERPRETER=$_java_path
5982         else
5983             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
5984         fi
5985     fi
5987     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5988         # Check that the JDK found is correct architecture
5989         # Why is this necessary, we don't link with any library from the JDK I think,
5991         shortjdkhome=`cygpath -d "$with_jdk_home"`
5992         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
5993             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
5994             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
5995         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
5996             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
5997             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
5998         fi
6000         if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6001             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6002         fi
6003         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
6004         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
6005     elif test "$_os" = "Darwin"; then
6006         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
6007         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
6008         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
6009         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
6010         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
6011             AC_MSG_RESULT([yes])
6012             JAVAIFLAGS=-d32
6013         else
6014             AC_MSG_RESULT([no])
6015         fi
6016     fi
6019 dnl ===================================================================
6020 dnl Checks for JDK.
6021 dnl ===================================================================
6023 # Note that JAVA_HOME as for now always means the *build* platform's
6024 # JAVA_HOME. Whether all the complexity here actually is needed any
6025 # more or not, no idea.
6027 if test "$SOLAR_JAVA" != ""; then
6028     _gij_longver=0
6029     AC_MSG_CHECKING([the installed JDK])
6030     if test -n "$JAVAINTERPRETER"; then
6031         dnl java -version sends output to stderr!
6032         if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6033             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6034         elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6035             JDK=gcj
6036             AC_MSG_RESULT([checked (gcj)])
6037             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
6038             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6040         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6041             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6042         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6043             JDK=ibm
6045             dnl IBM JDK specific tests
6046             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6047             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6049             if test "$_jdk_ver" -lt 10500; then
6050                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
6051             fi
6053             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6055             if test "$with_jdk_home" = ""; then
6056                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6057 you must use the "--with-jdk-home" configure option explicitly])
6058             fi
6060            JAVA_HOME=$with_jdk_home
6062         else
6063             JDK=sun
6065             dnl Sun JDK specific tests
6066             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6067             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6069             if test "$_jdk_ver" -lt 10500; then
6070                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
6071             fi
6072             AC_MSG_RESULT([checked (JDK $_jdk)])
6073             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6074             if test "$_os" = "WINNT"; then
6075                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6076             fi
6077         fi
6078     else
6079         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
6080     fi
6081 else
6082     dnl Java disabled
6083     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
6086 dnl ===================================================================
6087 dnl Set target Java bytecode version
6088 dnl ===================================================================
6089 if test "$SOLAR_JAVA" != ""; then
6090     _java_target_ver="1.5"
6092     JAVA_SOURCE_VER="$_java_target_ver"
6093     JAVA_TARGET_VER="$_java_target_ver"
6096 dnl ===================================================================
6097 dnl Checks for javac
6098 dnl ===================================================================
6099 if test "$SOLAR_JAVA" != ""; then
6100     if test "$JDK" = "gcj"; then
6101         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
6102     else
6103         javacompiler="javac"
6104     fi
6105     if test -z "$with_jdk_home"; then
6106         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
6107     else
6108         _javac_path="$with_jdk_home/bin/$javacompiler"
6109         dnl Check if there is a Java compiler at all.
6110         if test -x "$_javac_path"; then
6111             JAVACOMPILER=$_javac_path
6112         fi
6113     fi
6114     if test -z "$JAVACOMPILER"; then
6115         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
6116     fi
6117     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
6118         if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
6119             JAVACOMPILER="${JAVACOMPILER}.exe"
6120         fi
6121         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
6122         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
6123     fi
6125     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
6126         AC_MSG_CHECKING([re-checking JDK])
6127         JDK=gcj
6128         AC_MSG_RESULT([checked (ecj)])
6129         _gij_longver="40200"
6130     fi
6133 JAVACISGCJ=""
6134 dnl ===================================================================
6135 dnl Checks that javac is gcj
6136 dnl ===================================================================
6137 if test "$SOLAR_JAVA" != ""; then
6138     if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
6139         JAVACISGCJ="yes"
6140     fi
6142 AC_SUBST(JAVACISGCJ)
6144 JAVACISKAFFE=""
6145 dnl ===================================================================
6146 dnl Checks that javac is kaffe
6147 dnl ===================================================================
6148 if test "$SOLAR_JAVA" != ""; then
6149     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6150         JAVACISKAFFE="yes"
6151     fi
6153 AC_SUBST(JAVACISKAFFE)
6155 dnl ===================================================================
6156 dnl Checks for javadoc
6157 dnl ===================================================================
6158 if test "$SOLAR_JAVA" != ""; then
6159     if test -z "$with_jdk_home"; then
6160         AC_PATH_PROG(JAVADOC, javadoc)
6161     else
6162         _javadoc_path="$with_jdk_home/bin/javadoc"
6163         dnl Check if there is a javadoc at all.
6164         if test -x "$_javadoc_path"; then
6165             JAVADOC=$_javadoc_path
6166         else
6167             AC_PATH_PROG(JAVADOC, javadoc)
6168         fi
6169     fi
6170     if test -z "$JAVADOC"; then
6171         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
6172     fi
6173     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
6174         if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
6175             JAVADOC="${JAVADOC}.exe"
6176         fi
6177         JAVADOC=`cygpath -d "$JAVADOC"`
6178         JAVADOC=`cygpath -u "$JAVADOC"`
6179     fi
6181     if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
6182         JAVADOCISGJDOC="yes"
6183     fi
6185 AC_SUBST(JAVADOCISGJDOC)
6187 if test "$SOLAR_JAVA" != ""; then
6188     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
6189     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
6190         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
6191            # try to recover first by looking whether we have a alternatives
6192            # system as in Debian or newer SuSEs where following /usr/bin/javac
6193            # over /etc/alternatives/javac leads to the right bindir where we
6194            # just need to strip a bit away to get a valid JAVA_HOME
6195            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
6196         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
6197             # maybe only one level of symlink (e.g. on Mac)
6198             JAVA_HOME=$(readlink $JAVACOMPILER)
6199             if test "$(dirname $JAVA_HOME)" = "."; then
6200                 # we've got no path to trim back
6201                 JAVA_HOME=""
6202             fi
6203         else
6204             # else warn
6205             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
6206             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
6207             add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
6208             add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
6209         fi
6210         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
6211         if test "$JAVA_HOME" != "/usr"; then
6212             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6213                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
6214                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
6215                 dnl Tiger already returns a JDK path..
6216                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
6217             else
6218                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
6219             fi
6220         fi
6221     fi
6222     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
6224     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
6225     if test -z "$JAVA_HOME"; then
6226         if test "x$with_jdk_home" = "x"; then
6227             cat > findhome.java <<_ACEOF
6228 [import java.io.File;
6230 class findhome
6232     public static void main(String args[])
6233     {
6234         String jrelocation = System.getProperty("java.home");
6235         File jre = new File(jrelocation);
6236         System.out.println(jre.getParent());
6237     }
6239 _ACEOF
6240             AC_MSG_CHECKING([if javac works])
6241             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
6242             AC_TRY_EVAL(javac_cmd)
6243             if test $? = 0 -a -f ./findhome.class; then
6244                 AC_MSG_RESULT([javac works])
6245             else
6246                 echo "configure: javac test failed" >&5
6247                 cat findhome.java >&5
6248                 AC_MSG_ERROR([javac does not work - java projects will not build!])
6249             fi
6250             AC_MSG_CHECKING([if gij knows its java.home])
6251             JAVA_HOME=`$JAVAINTERPRETER findhome`
6252             if test $? = 0 -a "$JAVA_HOME" != ""; then
6253                 AC_MSG_RESULT([$JAVA_HOME])
6254             else
6255                 echo "configure: java test failed" >&5
6256                 cat findhome.java >&5
6257                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
6258             fi
6259             # clean-up after ourselves
6260             rm -f ./findhome.java ./findhome.class
6261         else
6262             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
6263         fi
6264     fi
6266     dnl second sanity check JAVA_HOME if possible
6267     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
6268         # now check if $JAVA_HOME is really valid
6269         if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6270             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
6271                 JAVA_HOME_OK="NO"
6272             fi
6273         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
6274             JAVA_HOME_OK="NO"
6275         fi
6276         if test "$JAVA_HOME_OK" = "NO"; then
6277             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
6278             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
6279             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
6280             add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
6281             add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
6282             add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
6283         fi
6284     fi
6285     PathFormat "$JAVA_HOME"
6286     JAVA_HOME="$formatted_path"
6289 AWTLIB=
6291 if test "$SOLAR_JAVA" != ""; then
6292     AC_MSG_CHECKING([for jawt lib name])
6293     if test "$JDK" = "gcj"; then
6294         save_CFLAGS=$CFLAGS
6295         save_LDFLAGS=$LDFLAGS
6296         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
6297         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
6298         exec 6>/dev/null # no output
6299         AC_CHECK_HEADER(jni.h, [],
6300                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
6301         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
6302         exec 6>&1 # output on again
6303         CFLAGS=$save_CFLAGS
6304         LDFLAGS=$save_LDFLAGS
6305     fi
6306     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
6307     # A workaround is to link also against libpmawt.so
6308     if test "$JDK" = "ibm"; then
6309         save_CFLAGS=$CFLAGS
6310         save_LDFLAGS=$LDFLAGS
6311         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
6312         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
6313         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
6314         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
6315         export LD_LIBRARY_PATH
6316         exec 6>/dev/null # no output
6317         AC_CHECK_HEADER(jni.h, [],
6318                     [AC_MSG_ERROR([jni.h could not be found.])], [])
6319         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
6320         if test -z "$AWTLIB"; then
6321             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
6322             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
6323         fi
6324         exec 6>&1 # output on again
6325         CFLAGS=$save_CFLAGS
6326         LDFLAGS=$save_LDFLAGS
6327         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
6328     fi
6329     if test -z "$AWTLIB"; then
6330         if test $_os = WINNT -a "$WITH_MINGW" != yes; then
6331             AWTLIB=jawt.lib
6332         else
6333             AWTLIB=-ljawt
6334         fi
6335     fi
6336     AC_MSG_RESULT([$AWTLIB])
6337     AC_SUBST(AWTLIB)
6341 if test "$SOLAR_JAVA" != ""; then
6343 # Determine JAVALIB
6344 # If your platform follow the common pattern
6345 # just define JAVA_ARCH and JAVA_TOOLKIT for it
6346 # if not, leave JAVA_ARCH empty and define JAVALIB manually
6347 # if you don't want JAVALIB to be exported at all
6348 # define x_JAVALIB=[\#]
6350     JAVA_ARCH=
6351     JAVA_TOOLKIT=
6352     x_JAVALIB=
6353     x_JDKLIB=[\#]
6355     case "$host_os" in
6357     aix*)
6358         JAVA_ARCH="ppc"
6359         JAVA_TOOLKIT="classic"
6360         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6361         SOLARINC="$SOLARINC -I$JAVA_HOME/include/aix"
6362         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6363         ;;
6365     cygwin*)
6366         x_JDKLIB=
6367         JDKLIB="$JAVA_HOME/lib"
6368         SOLARINC="$SOLARINC -I$JAVA_HOME/include/win32"
6369         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6370         ;;
6372     darwin*)
6373         x_JAVALIB=[\#]
6374         SOLARINC="$SOLARINC -I$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers -I$FRAMEWORKSHOME/JavaVM/Headers"
6375         ;;
6377     dragonfly*)
6378         case "$host_cpu" in
6379         i*86)
6380             JAVA_ARCH="i386"
6381             JAVA_TOOLKIT="client"
6382             ;;
6383         x86_64)
6384             JAVA_ARCH="amd64"
6385             JAVA_TOOLKIT="server"
6386             ;;
6387         esac
6388         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6389         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6390         ;;
6392     freebsd*)
6393         case "$host_cpu" in
6394         i*86)
6395             JAVA_ARCH="i386"
6396             JAVA_TOOLKIT="client"
6397             ;;
6398         x86_64)
6399             if test "`echo $JAVA_HOME | sed -e 's,.*/,,'`" = "linux"; then
6400                 JAVA_ARCH="i386"
6401                 JAVA_TOOLKIT="client"
6402             else
6403                 JAVA_ARCH="amd64"
6404                 JAVA_TOOLKIT="server"
6405             fi
6406             ;;
6407         esac
6408         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6409         SOLARINC="$SOLARINC -I$JAVA_HOME/include/freebsd"
6410         SOLARINC="$SOLARINC -I$JAVA_HOME/include/bsd"
6411         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
6412         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6413         ;;
6415     k*bsd*-gnu*)
6416         case "$host_cpu" in
6417         i*86)
6418             JAVA_ARCH="i386"
6419             JAVA_TOOLKIT="client"
6420             ;;
6421         x86_64)
6422             JAVA_ARCH="amd64"
6423             JAVA_TOOLKIT="server"
6424             ;;
6425         esac
6426         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6427         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6428         ;;
6430     linux-gnu*)
6432         case "$host_cpu" in
6434         alpha)
6435             JAVA_ARCH="alpha"
6436             JAVA_TOOLKIT="server"
6437             ;;
6438         arm*)
6439             JAVA_ARCH="arm"
6440             JAVA_TOOLKIT="server"
6441             ;;
6442         hppa)
6443             JAVA_ARCH="hppa"
6444             JAVA_TOOLKIT="server"
6445             ;;
6446         i*86)
6447             JAVA_ARCH="i386"
6448             case "$JDK" in
6449             [Ii][Bb][Mm]*)
6450                 JAVA_ARCH=
6451                 JRE_BASE_DIR="$JAVA_HOME/jre/bin"
6452                 JAVALIB="-L$JAVA_HOME/$LIB64 -L$JRE_BASE_DIR -L$JRE_BASE_DIR/classic -L$JRE_BASE_DIR/native_thread"
6453                 ;;
6454             [Bb][Ee][Aa]*)
6455                 JAVA_TOOLKIT="jrockit"
6456                 ;;
6457             *)
6458                 JAVA_TOOLKIT="client"
6459                 ;;
6460             esac
6461             ;;
6462         ia64)
6463             JAVA_ARCH="ia64"
6464             JAVA_TOOLKIT="server"
6465             ;;
6466         m68k)
6467             JAVA_ARCH="mk68"
6468             JAVA_TOOLKIT="server"
6469             ;;
6470         mips|mips64|mipsel|mips64el)
6471             JAVA_ARCH="$host_cpu"
6472             JAVA_TOOLKIT="server"
6473             ;;
6474         mips32)
6475             JAVA_ARCH="$host_cpu"
6476             JAVA_TOOLKIT="client"
6477             ;;
6478         powerpc)
6479             JAVA_ARCH="ppc"
6480             case "$JDK" in
6481             [Ii][Bb][Mm]*)
6482                 JAVA_TOOLKIT="classic"
6483                 ;;
6484             gcj)
6485                 JAVA_TOOLKIT="client"
6486                 ;;
6487             *)
6488                 JAVA_TOOLKIT="server"
6489                 ;;
6490             esac
6491             ;;
6492         powerpc64)
6493             JAVA_ARCH="ppc64"
6494             if test "$JDK" = "gcj"; then
6495                 JAVA_TOOLKIT="client"
6496             else
6497                 JAVA_TOOLKIT="server"
6498             fi
6499             ;;
6500         sparc)
6501             JAVA_ARCH="sparc"
6502             JAVA_TOOLKIT="server"
6503             ;;
6504         s390)
6505             JAVA_ARCH="s390"
6506             JAVA_TOOLKIT="server"
6507             ;;
6508         s390x)
6509             JAVA_ARCH="s390x"
6510             JAVA_TOOLKIT="server"
6511             ;;
6512         x86_64)
6513             JAVA_ARCH="amd64"
6514             JAVA_TOOLKIT="server"
6515             ;;
6516         *)
6517             AC_MSG_ERROR([No JAVALIB definition host_cpu $host_cpu for host_os $host_os])
6518             ;;
6519         esac
6520         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6521         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
6522         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6523         ;;
6525     linux-androideabi*)
6527         case "$host_cpu" in
6529     arm|armel)
6530             JAVA_ARCH="arm"
6531             JAVA_TOOLKIT="server"
6532             ;;
6533         esac
6534         ;;
6536     mingw*)
6537         x_JAVALIB=[\#]
6538         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6539         ;;
6541     *netbsd*)
6543         case "$host_cpu" in
6544         i*86)
6545             JAVA_ARCH="i386"
6546             JAVA_TOOLKIT="client"
6547             ;;
6548         powerpc)
6549             JAVA_ARCH="pcc"
6550             JAVA_TOOLKIT="classic"
6551             ;;
6552         sparc)
6553             JAVA_ARCH="sparc"
6554             JAVA_TOOLKIT="client"
6555             ;;
6556         x86_64)
6557             JAVA_ARCH="amd64"
6558             JAVA_TOOLKIT="client"
6559             ;;
6560         esac
6561         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6562         SOLARINC="$SOLARINC -I$JAVA_HOME/include/netbsd"
6563         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6564        ;;
6566     openbsd*)
6567         case "$host_cpu" in
6568         i*86)
6569             JAVA_ARCH="i386"
6570             JAVA_TOOLKIT="client"
6571             ;;
6572         x86_64)
6573             JAVA_ARCH="amd64"
6574             JAVA_TOOLKIT="server"
6575             ;;
6576         esac
6577         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6578         SOLARINC="$SOLARINC -I$JAVA_HOME/include/openbsd"
6579         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6580         ;;
6582     solaris*)
6584         JAVA_TOOLKIT="xawt"
6585         case "$host_cpu" in
6586         i*86)
6587             JAVA_ARCH="i386"
6588             ;;
6589         sparc)
6590             JAVA_ARCH="sparc"
6591             ;;
6592         esac
6593         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6594         SOLARINC="$SOLARINC -I$JAVA_HOME/include/solaris"
6595         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6596         ;;
6597     esac
6599     if test -n "$JAVA_ARCH"; then
6600         JRE_BASE_DIR="$JAVA_HOME/jre/lib/$JAVA_ARCH"
6601         JAVALIB="-L$JAVA_HOME/$LIB64"
6602         test -d "$JRE_BASE_DIR" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR"
6603         test -d "$JRE_BASE_DIR/$JAVA_TOOLKIT" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/$JAVA_TOOLKIT"
6604         test -d "$JRE_BASE_DIR/native_thread" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/native_thread"
6605     fi
6606 else
6607     x_JAVALIB=[\#]
6608     x_JDKLIB=[\#]
6611 AC_SUBST(JAVALIB)
6612 AC_SUBST(JAVACOMPILER)
6613 AC_SUBST(JAVADOC)
6614 AC_SUBST(JAVAINTERPRETER)
6615 AC_SUBST(JAVAIFLAGS)
6616 AC_SUBST(JAVA_HOME)
6617 AC_SUBST(JAVA_SOURCE_VER)
6618 AC_SUBST(JAVA_TARGET_VER)
6619 AC_SUBST(JDK)
6620 AC_SUBST(JDKLIB)
6621 AC_SUBST(x_JAVALIB)
6622 AC_SUBST(x_JDKLIB)
6624 dnl ===================================================================
6625 dnl Checks for specific files.
6626 dnl ===================================================================
6628 dnl ===================================================================
6629 dnl Checks for programs.
6630 dnl ===================================================================
6632 dnl ===================================================================
6633 dnl Check whether we already have dmake
6634 dnl ===================================================================
6635 AC_PATH_PROG(DMAKE, dmake, no)
6636 if test "$DMAKE" = "no"; then
6637     BUILD_DMAKE=YES
6638     echo "dmake will be built on ./bootstrap"
6639 else
6640     AC_MSG_CHECKING([whether the found dmake is the right dmake])
6641     # we need to find out whether that dmake we found is "our" dmake
6642     # or the dmake from Sun's SunStudio Compiler which is something
6643     # different
6644     # This test _should_ work because the one accepts -V (ours) and one
6645     # (the other) not...
6646     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
6647     if test $? -eq 0; then
6648         BUILD_DMAKE=NO
6649         AC_MSG_RESULT([yes])
6650         AC_MSG_CHECKING([the dmake version])
6651         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
6652         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
6653             AC_MSG_RESULT([OK, >= 4.11])
6654         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
6655             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
6656             AC_MSG_RESULT([OK, >= 4.11])
6657         else
6658             AC_MSG_RESULT([too old. >= 4.11 is needed])
6659             echo "A newer dmake will be built on ./bootstrap"
6660             BUILD_DMAKE=YES
6661         fi
6662     else
6663         AC_MSG_RESULT([no])
6664         echo "dmake will be built on ./bootstrap"
6665         BUILD_DMAKE=YES
6666     fi
6668 AC_SUBST(BUILD_DMAKE)
6670 AC_MSG_CHECKING([which C preprocessor to use in idlc])
6671 if test -n "$with_idlc_cpp"; then
6672     AC_MSG_RESULT([$with_idlc_cpp])
6673     AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
6674 else
6675     AC_MSG_RESULT([ucpp])
6676     AC_MSG_CHECKING([which ucpp tp use])
6677     if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
6678         AC_MSG_RESULT([external])
6679         AC_PATH_PROG(SYSTEM_UCPP, ucpp)
6680     else
6681         AC_MSG_RESULT([internal])
6682         BUILD_TYPE="$BUILD_TYPE UCPP"
6683     fi
6685 AC_SUBST(SYSTEM_UCPP)
6687 dnl ===================================================================
6688 dnl Check for epm (not needed for Windows)
6689 dnl ===================================================================
6690 AC_MSG_CHECKING([whether to enable EPM for packing])
6691 if test "$enable_epm" = "yes"; then
6692     AC_MSG_RESULT([yes])
6693     if test "$_os" != "WINNT"; then
6694         if test -n "$with_epm"; then
6695             EPM=$with_epm
6696         else
6697             AC_PATH_PROG(EPM, epm, no)
6698         fi
6699         if test "$EPM" = "no" -o "$EPM" = "internal"; then
6700             echo "EPM will be built."
6701             BUILD_TYPE="$BUILD_TYPE EPM"
6702         else
6703             # Gentoo has some epm which is something different...
6704             AC_MSG_CHECKING([whether the found epm is the right epm])
6705             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
6706                 AC_MSG_RESULT([yes])
6707             else
6708                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
6709             fi
6710             AC_MSG_CHECKING([epm version])
6711             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
6712             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
6713                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
6714                 AC_MSG_RESULT([OK, >= 3.7])
6715                 if test "$_os" = "Darwin"; then
6716                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
6717                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
6718                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6719                         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)])
6720                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6721                         AC_MSG_RESULT([$_pm, ok])
6722                     else # we never should get here, but go safe
6723                         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)])
6724                     fi
6725                 fi
6726             else
6727                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
6728                 echo "EPM will be built."
6729                 BUILD_TYPE="$BUILD_TYPE EPM"
6730             fi
6731         fi
6732     fi
6734     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
6735         AC_MSG_CHECKING([for rpm])
6736         for a in "$RPM" rpmbuild rpm; do
6737             $a --usage >/dev/null 2> /dev/null
6738             if test $? -eq 0; then
6739                 RPM=$a
6740                 break
6741             else
6742                 $a --version >/dev/null 2> /dev/null
6743                 if test $? -eq 0; then
6744                     RPM=$a
6745                     break
6746                 fi
6747             fi
6748         done
6749         if test -z "$RPM"; then
6750             AC_MSG_ERROR([not found])
6751         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
6752             RPM_PATH=`which $RPM`
6753             AC_MSG_RESULT([$RPM_PATH])
6754         else
6755             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
6756         fi
6757     fi
6758     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
6759         AC_PATH_PROG(DPKG, dpkg, no)
6760         if test "$DPKG" = "no"; then
6761             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
6762         fi
6763     fi
6764     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
6765         if test "$_os" = "Darwin"; then
6766             AC_MSG_CHECKING([for PackageMaker availability])
6767             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
6768                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
6769             else
6770                 AC_MSG_RESULT([ok])
6771             fi
6772         else
6773             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
6774         fi
6775     fi
6776     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
6777        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6778         if test "$EPM" != "no" -a "$EPM" != "internal"; then
6779             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
6780                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
6781                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
6782                     AC_MSG_RESULT([yes])
6783                 else
6784                     AC_MSG_RESULT([no])
6785                     if echo "$PKGFORMAT" | $GREP -q rpm; then
6786                         _pt="rpm"
6787                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
6788                         add_warning "the rpms will need to be installed with --nodeps"
6789                     else
6790                         _pt="pkg"
6791                     fi
6792                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
6793                     add_warning "the ${_pt}s will not be relocateable"
6794                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
6795                                  relocation will work, you need to patch your epm with the
6796                                  patch in epm/epm-3.7.patch or build with
6797                                  --with-epm=internal which will build a suitable epm])
6798                 fi
6799             fi
6800         fi
6801     fi
6802     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6803         AC_PATH_PROG(PKGMK, pkgmk, no)
6804         if test "$PKGMK" = "no"; then
6805             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
6806         fi
6807     fi
6808     AC_SUBST(RPM)
6809     AC_SUBST(DPKG)
6810     AC_SUBST(PKGMK)
6811 else
6812     AC_MSG_RESULT([no])
6813     EPM=NO
6815 AC_SUBST(EPM)
6817 dnl ===================================================================
6818 dnl We need winegcc when building MinGW build to be able to cross-build msi tools
6819 dnl ===================================================================
6820 WINEGCC=
6821 if test "$enable_winegcc" = "yes"; then
6822     AC_PATH_PROG(WINEGCC, winegcc)
6823     if test "$WINEGCC" = ""; then
6824         AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
6825     fi
6826     CC_save="$CC"
6827     ac_exeext_save="$ac_exeext"
6828     CC="$WINEGCC -m32"
6829     ac_exeext=".exe"
6830     AC_LINK_IFELSE([AC_LANG_PROGRAM([
6831 #include <stdio.h>
6832         ],[
6833 printf ("hello world\n");
6834         ])],,
6835         [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
6836     )
6837     CC="$CC_save"
6838     ac_exeext="$ac_exeext_save"
6840 AC_SUBST(WINEGCC)
6842 dnl ===================================================================
6843 dnl Check for gperf
6844 dnl ===================================================================
6845 AC_PATH_PROG(GPERF, gperf)
6846 if test -z "$GPERF"; then
6847     AC_MSG_ERROR([gperf not found but needed. Install it.])
6849 AC_MSG_CHECKING([gperf version])
6850 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
6851     AC_MSG_RESULT([OK])
6852 else
6853     AC_MSG_ERROR([too old, you need at least 3.0.0])
6855 AC_SUBST(GPERF)
6857 dnl ===================================================================
6858 dnl Check for building ODK
6859 dnl ===================================================================
6860 AC_MSG_CHECKING([whether to build the ODK])
6861 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
6862     AC_MSG_RESULT([yes])
6864     if test "$with_java" != "no"; then
6865         AC_MSG_CHECKING([whether to build unowinreg.dll])
6866         if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
6867             # build on Win by default
6868             enable_build_unowinreg=yes
6869         fi
6870         if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
6871             AC_MSG_RESULT([no])
6872             BUILD_UNOWINREG=NO
6873         else
6874             AC_MSG_RESULT([yes])
6875             BUILD_UNOWINREG=YES
6876         fi
6877         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
6878             if test -z "$with_mingw_cross_compiler"; then
6879                 dnl Guess...
6880                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
6881             elif test -x "$with_mingw_cross_compiler"; then
6882                  MINGWCXX="$with_mingw_cross_compiler"
6883             else
6884                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
6885             fi
6887             if test "$MINGWCXX" = "false"; then
6888                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
6889             fi
6891             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
6892             if test -x "$mingwstrip_test"; then
6893                 MINGWSTRIP="$mingwstrip_test"
6894             else
6895                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
6896             fi
6898             if test "$MINGWSTRIP" = "false"; then
6899                 AC_MSG_ERROR(MinGW32 binutils not found.)
6900             fi
6901         fi
6902     fi
6903     BUILD_TYPE="$BUILD_TYPE ODK"
6904 else
6905     AC_MSG_RESULT([no])
6906     BUILD_UNOWINREG=NO
6908 AC_SUBST(BUILD_UNOWINREG)
6909 AC_SUBST(MINGWCXX)
6910 AC_SUBST(MINGWSTRIP)
6912 dnl ===================================================================
6913 dnl Check for system zlib
6914 dnl ===================================================================
6915 if test "$with_system_zlib" = "auto"; then
6916     case "$_os" in
6917     WINNT)
6918         with_system_zlib="$with_system_libs"
6919         ;;
6920     *)
6921         with_system_zlib=yes
6922         ;;
6923     esac
6926 AC_MSG_CHECKING([which zlib to use])
6927 if test "$with_system_zlib" = "yes"; then
6928     AC_MSG_RESULT([external])
6929     SYSTEM_ZLIB=YES
6930     AC_CHECK_HEADER(zlib.h, [],
6931         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
6932     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
6933         [AC_MSG_ERROR(zlib not found or functional)], [])
6934 else
6935     AC_MSG_RESULT([internal])
6936     SYSTEM_ZLIB=NO
6937     BUILD_TYPE="$BUILD_TYPE ZLIB"
6938     ZLIB_CFLAGS="-I${OUTDIR}/inc/external/zlib"
6939     ZLIB_LIBS="-L${OUTDIR}/lib -lz"
6941 AC_SUBST(ZLIB_CFLAGS)
6942 AC_SUBST(ZLIB_LIBS)
6943 AC_SUBST(SYSTEM_ZLIB)
6945 dnl ===================================================================
6946 dnl Check for system jpeg
6947 dnl ===================================================================
6948 AC_MSG_CHECKING([which jpeg to use])
6949 if test "$with_system_jpeg" = "auto"; then
6950     case "$_os" in
6951     WINNT|Darwin|iOS|Android)
6952         with_system_jpeg="$with_system_libs"
6953         ;;
6954     *)
6955         with_system_jpeg=yes
6956         ;;
6957     esac
6960 if test "$with_system_jpeg" = "yes"; then
6961     AC_MSG_RESULT([external])
6962     SYSTEM_JPEG=YES
6963     AC_CHECK_HEADER(jpeglib.h, [],
6964         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
6965     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
6966     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
6967     libo_MINGW_CHECK_DLL([JPEG], [libjpeg])
6968 else
6969     AC_MSG_RESULT([internal])
6970     SYSTEM_JPEG=NO
6971     BUILD_TYPE="$BUILD_TYPE JPEG"
6973 AC_SUBST(SYSTEM_JPEG)
6974 AC_SUBST([MINGW_JPEG_DLL])
6976 dnl ===================================================================
6977 dnl Check for system clucene
6978 dnl ===================================================================
6979 AC_MSG_CHECKING([which clucene to use])
6980 if test "$with_system_clucene" = "yes"; then
6981     AC_MSG_RESULT([external])
6982     SYSTEM_CLUCENE=YES
6983     PKG_CHECK_MODULES(CLUCENE, libclucene-core)
6985     AC_LANG_PUSH([C++])
6986     save_CXXFLAGS=$CXXFLAGS
6987     save_CPPFLAGS=$CPPFLAGS
6988     CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
6989     CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
6990     dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
6991     dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
6992     AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
6993                  [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
6994     CXXFLAGS=$save_CXXFLAGS
6995     CPPFLAGS=$save_CPPFLAGS
6996     AC_LANG_POP([C++])
6998     CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
6999 else
7000     AC_MSG_RESULT([internal])
7001     SYSTEM_CLUCENE=NO
7002     BUILD_TYPE="$BUILD_TYPE CLUCENE"
7004 AC_SUBST(SYSTEM_CLUCENE)
7005 AC_SUBST(CLUCENE_CFLAGS)
7006 AC_SUBST(CLUCENE_LIBS)
7008 dnl ===================================================================
7009 dnl Check for system expat
7010 dnl ===================================================================
7011 AC_MSG_CHECKING([which expat to use])
7012 if test "$with_system_expat" = "yes"; then
7013     AC_MSG_RESULT([external])
7014     SYSTEM_EXPAT=YES
7015     AC_CHECK_HEADER(expat.h, [],
7016         [AC_MSG_ERROR(expat.h not found. install expat)], [])
7017     AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
7018     [AC_MSG_RESULT(expat library not found or functional.)], [])
7019     libo_MINGW_CHECK_DLL([EXPAT], [libexpat])
7020 else
7021     AC_MSG_RESULT([internal])
7022     SYSTEM_EXPAT=NO
7023     BUILD_TYPE="$BUILD_TYPE EXPAT"
7025 AC_SUBST(SYSTEM_EXPAT)
7026 AC_SUBST([MINGW_EXPAT_DLL])
7028 dnl ===================================================================
7029 dnl Check for system libcdr
7030 dnl ===================================================================
7031 AC_MSG_CHECKING([which libcdr to use])
7032 if test "$with_system_libcdr" = "yes"; then
7033     AC_MSG_RESULT([external])
7034     SYSTEM_LIBCDR=YES
7035     PKG_CHECK_MODULES( CDR, libcdr-0.0 >= 0.0.5 )
7036 elif test $_os = iOS; then
7037     # libcdr depends on libwpd and libwpg and those are LGPL
7038     AC_MSG_RESULT([none])
7039 else
7040     AC_MSG_RESULT([internal])
7041     SYSTEM_LIBCDR=NO
7042     BUILD_TYPE="$BUILD_TYPE CDR"
7044 AC_SUBST(SYSTEM_LIBCDR)
7045 AC_SUBST(CDR_CFLAGS)
7046 AC_SUBST(CDR_LIBS)
7048 dnl ===================================================================
7049 dnl Check for system libmspub
7050 dnl ===================================================================
7051 AC_MSG_CHECKING([which libmspub to use])
7052 if test "$with_system_libmspub" = "yes"; then
7053     AC_MSG_RESULT([external])
7054     SYSTEM_LIBMSPUB=YES
7055     PKG_CHECK_MODULES( MSPUB, libmspub-0.0 )
7056 elif test $_os = iOS; then
7057     # libmspub depends on libwpd and libwpg and those are LGPL
7058     AC_MSG_RESULT([none])
7059 else
7060     AC_MSG_RESULT([internal])
7061     SYSTEM_LIBMSPUB=NO
7062     BUILD_TYPE="$BUILD_TYPE MSPUB"
7064 AC_SUBST(SYSTEM_LIBMSPUB)
7065 AC_SUBST(MSPUB_CFLAGS)
7066 AC_SUBST(MSPUB_LIBS)
7068 dnl ===================================================================
7069 dnl Check for system libvisio
7070 dnl ===================================================================
7071 AC_MSG_CHECKING([which libvisio to use])
7072 if test "$with_system_libvisio" = "yes"; then
7073     AC_MSG_RESULT([external])
7074     SYSTEM_LIBVISIO=YES
7075     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
7076 elif test $_os = iOS; then
7077     # libvisio depends on libwpd and libwpg and those are LGPL
7078     AC_MSG_RESULT([none])
7079 else
7080     AC_MSG_RESULT([internal])
7081     SYSTEM_LIBVISIO=NO
7082     BUILD_TYPE="$BUILD_TYPE VISIO"
7084 AC_SUBST(SYSTEM_LIBVISIO)
7085 AC_SUBST(VISIO_CFLAGS)
7086 AC_SUBST(VISIO_LIBS)
7088 dnl ===================================================================
7089 dnl Check for system libcmis
7090 dnl ===================================================================
7091 AC_MSG_CHECKING([which libcmis to use])
7092 if test "$with_system_libcmis" = "yes"; then
7093     AC_MSG_RESULT([external])
7094     SYSTEM_LIBCMIS=YES
7095     PKG_CHECK_MODULES( CMIS, libcmis-0.3 >= 0.3.1 )
7096 else
7097     AC_MSG_RESULT([internal])
7098     SYSTEM_LIBCMIS=NO
7099     BUILD_TYPE="$BUILD_TYPE CMIS"
7101 AC_SUBST(SYSTEM_LIBCMIS)
7102 AC_SUBST(CMIS_CFLAGS)
7103 AC_SUBST(CMIS_LIBS)
7106 dnl ===================================================================
7107 dnl Check for system libwpd
7108 dnl ===================================================================
7109 AC_MSG_CHECKING([which libwpd to use])
7110 if test "$with_system_libwpd" = "yes"; then
7111     AC_MSG_RESULT([external])
7112     SYSTEM_LIBWPD=YES
7113     PKG_CHECK_MODULES( WPD, libwpd-0.9 >= 0.9.5 libwpd-stream-0.9 >= 0.9.5 )
7114 elif test $_os = iOS; then
7115     AC_MSG_RESULT([none])
7116 else
7117     AC_MSG_RESULT([internal])
7118     SYSTEM_LIBWPD=NO
7119     WPD_CFLAGS="-I${OUTDIR}/inc/external"
7120     WPD_LIBS="-L${OUTDIR}/lib -lwpdlib"
7121     BUILD_TYPE="$BUILD_TYPE WPD"
7123 AC_SUBST(SYSTEM_LIBWPD)
7124 AC_SUBST(WPD_CFLAGS)
7125 AC_SUBST(WPD_LIBS)
7127 dnl ===================================================================
7128 dnl Check for system lcms2
7129 dnl ===================================================================
7130 AC_MSG_CHECKING([which littlecms v2 to use])
7131 if test "$with_system_lcms2" = "yes"; then
7132     AC_MSG_RESULT([external])
7133     SYSTEM_LCMS2=YES
7134     PKG_CHECK_MODULES( LCMS2, lcms2 )
7135     libo_MINGW_CHECK_DLL([LCMS2], [liblcms2])
7136 else
7137     AC_MSG_RESULT([internal])
7138     SYSTEM_LCMS2=NO
7139     LCMS2_LIBS="-L${OUTDIR}/lib -llcms2"
7140     LCMS2_CFLAGS="-I${WORKDIR}/UnpackedTarball/lcms2/include"
7141     if test "$GCC" = "yes"; then
7142         LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7143     fi
7144     BUILD_TYPE="$BUILD_TYPE LCMS2"
7146 AC_SUBST(SYSTEM_LCMS2)
7147 AC_SUBST(LCMS2_CFLAGS)
7148 AC_SUBST(LCMS2_LIBS)
7149 AC_SUBST([MINGW_LCMS2_DLL])
7151 dnl ===================================================================
7152 dnl Check for system cppunit
7153 dnl ===================================================================
7154 AC_MSG_CHECKING([which cppunit to use])
7155 if test "$with_system_cppunit" = "yes"; then
7156     AC_MSG_RESULT([external])
7157     SYSTEM_CPPUNIT=YES
7158     # might work for earlier, too but go sure:
7159     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
7160 else
7161     AC_MSG_RESULT([internal])
7162     SYSTEM_CPPUNIT=NO
7163     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
7165 AC_SUBST(SYSTEM_CPPUNIT)
7166 AC_SUBST(CPPUNIT_CFLAGS)
7167 AC_SUBST(CPPUNIT_LIBS)
7169 dnl ===================================================================
7170 dnl Check whether freetype is available
7171 dnl ===================================================================
7172 if test  "$test_freetype" = "yes"; then
7173     AC_MSG_CHECKING([whether freetype is available])
7174     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
7175 else
7176     case "$BUILD_TYPE" in
7177     *FREETYPE*)
7178         FREETYPE_LIBS="-lfreetype"
7179         ;;
7180     esac
7182 AC_SUBST(FREETYPE_CFLAGS)
7183 AC_SUBST(FREETYPE_LIBS)
7185 dnl ===================================================================
7186 dnl Check for system libwps
7187 dnl ===================================================================
7188 AC_MSG_CHECKING([which libwps to use])
7189 if test "$with_system_libwps" = "yes"; then
7190     AC_MSG_RESULT([external])
7191     SYSTEM_LIBWPS=YES
7192     PKG_CHECK_MODULES( WPS, libwps-0.2 )
7193 elif test $_os = iOS; then
7194     AC_MSG_RESULT([none])
7195 else
7196     AC_MSG_RESULT([internal])
7197     SYSTEM_LIBWPS=NO
7198     WPS_CFLAGS="-I${OUTDIR}/inc/external"
7199     WPS_LIBS="-L${OUTDIR}/lib -lwpslib"
7200     BUILD_TYPE="$BUILD_TYPE WPS"
7202 AC_SUBST(SYSTEM_LIBWPS)
7203 AC_SUBST(WPS_CFLAGS)
7204 AC_SUBST(WPS_LIBS)
7206 dnl ===================================================================
7207 dnl Check for system libwpg
7208 dnl ===================================================================
7209 AC_MSG_CHECKING([which libwpg to use])
7210 if test "$with_system_libwpg" = "yes"; then
7211     AC_MSG_RESULT([external])
7212     SYSTEM_LIBWPG=YES
7213     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
7214 elif test $_os = iOS; then
7215     AC_MSG_RESULT([none])
7216 else
7217     AC_MSG_RESULT([internal])
7218     SYSTEM_LIBWPG=NO
7219     WPG_CFLAGS="-I${OUTDIR}/inc/external"
7220     WPG_LIBS="-L${OUTDIR}/lib -lwpglib"
7221     BUILD_TYPE="$BUILD_TYPE WPG"
7223 AC_SUBST(SYSTEM_LIBWPG)
7224 AC_SUBST(WPG_CFLAGS)
7225 AC_SUBST(WPG_LIBS)
7227 dnl ===================================================================
7228 dnl Check whether freetype2 supports emboldening
7229 dnl ===================================================================
7230 if test  "$test_freetype" = "yes"; then
7231     save_CPPFLAGS="$CPPFLAGS"
7232     save_LDFLAGS="$LDFLAGS"
7233     save_LIBS="$LIBS"
7234     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
7235     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
7236     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
7237                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
7238     LDFLAGS="$save_LDFLAGS"
7239     CPPFLAGS="$save_CPPFLAGS"
7240     LIBS="$save_LIBS"
7242 AC_SUBST(USE_FT_EMBOLDEN)
7244 # ===================================================================
7245 # Check for system libxslt
7246 # to prevent incompatibilities between internal libxml2 and external libxslt,
7247 # or vice versa, use with_system_libxml here
7248 # ===================================================================
7249 if test "$with_system_libxml" = "auto"; then
7250     case "$_os" in
7251     WINNT|iOS|Android)
7252         with_system_libxml="$with_system_libs"
7253         ;;
7254     *)
7255         with_system_libxml=yes
7256         ;;
7257     esac
7260 AC_MSG_CHECKING([which libxslt to use])
7261 if test "$with_system_libxml" = "yes"; then
7262     AC_MSG_RESULT([external])
7263     SYSTEM_LIBXSLT=YES
7264     if test "$_os" = "Darwin"; then
7265         dnl make sure to use SDK path
7266         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7267         LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
7268         dnl omit -L/usr/lib
7269         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
7270         LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
7271     else
7272         PKG_CHECK_MODULES(LIBXSLT, libxslt)
7273         PKG_CHECK_MODULES(LIBEXSLT, libexslt)
7274     fi
7276     dnl Check for xsltproc
7277     AC_PATH_PROG(XSLTPROC, xsltproc, no)
7278     if test "$XSLTPROC" = "no"; then
7279         AC_MSG_ERROR([xsltproc is required])
7280     fi
7282     libo_MINGW_CHECK_DLL([LIBXSLT], [libxslt])
7283     libo_MINGW_CHECK_DLL([LIBEXSLT], [libexslt])
7284     libo_MINGW_TRY_DLL([ICONV], [iconv])
7285 else
7286     AC_MSG_RESULT([internal])
7287     SYSTEM_LIBXSLT=NO
7288     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
7290     if test "$cross_compiling" = "yes"; then
7291         AC_PATH_PROG(XSLTPROC, xsltproc, no)
7292         if test "$XSLTPROC" = "no"; then
7293             AC_MSG_ERROR([xsltproc is required])
7294         fi
7295     fi
7297 AC_SUBST(SYSTEM_LIBXSLT)
7298 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
7299     SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
7301 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
7303 AC_SUBST(LIBEXSLT_CFLAGS)
7304 AC_SUBST(LIBEXSLT_LIBS)
7305 AC_SUBST(LIBXSLT_CFLAGS)
7306 AC_SUBST(LIBXSLT_LIBS)
7307 AC_SUBST(XSLTPROC)
7308 AC_SUBST([MINGW_LIBEXSLT_DLL])
7309 AC_SUBST([MINGW_LIBXSLT_DLL])
7310 AC_SUBST([MINGW_ICONV_DLL])
7312 # ===================================================================
7313 # Check for system libxml
7314 # ===================================================================
7315 AC_MSG_CHECKING([which libxml to use])
7316 if test "$with_system_libxml" = "yes"; then
7317     AC_MSG_RESULT([external])
7318     SYSTEM_LIBXML=YES
7319     if test "$_os" = "Darwin"; then
7320         dnl make sure to use SDK path
7321         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7322         dnl omit -L/usr/lib
7323         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
7324     elif test $_os = iOS; then
7325         dnl make sure to use SDK path
7326         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
7327         LIBXML_CFLAGS="-I$usr/include/libxml2"
7328         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
7329     else
7330         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
7331     fi
7333     dnl Check for xmllint
7334     AC_PATH_PROG(XMLLINT, xmllint, no)
7335     if test "$XMLLINT" = "no"; then
7336         AC_MSG_ERROR([xmllint is required])
7337     fi
7339     libo_MINGW_CHECK_DLL([LIBXML],[libxml2])
7340     libo_MINGW_TRY_DLL([ZLIB],[zlib1])
7341 else
7342     AC_MSG_RESULT([internal])
7343     SYSTEM_LIBXML=NO
7344     BUILD_TYPE="$BUILD_TYPE LIBXML2"
7346 AC_SUBST(SYSTEM_LIBXML)
7347 AC_SUBST(LIBXML_CFLAGS)
7348 AC_SUBST(LIBXML_LIBS)
7349 AC_SUBST(XMLLINT)
7350 AC_SUBST([MINGW_LIBXML_DLL])
7351 AC_SUBST([MINGW_ZLIB_DLL])
7352 dnl ===================================================================
7353 dnl Checks for Python
7354 dnl ===================================================================
7356 AC_MSG_CHECKING([which Python to use])
7358 case "$enable_python" in
7359 no|disable)
7360     enable_python=no
7361     AC_MSG_RESULT([none])
7362     DISABLE_PYTHON=TRUE
7363     ;;
7364 ""|yes|auto)
7365     if test "$DISABLE_SCRIPTING" = TRUE; then
7366         AC_MSG_RESULT([no, overridden by --disable-scripting])
7367         enable_python=no
7368         DISABLE_PYTHON=TRUE
7369     elif test $build_os = cygwin; then
7370         dnl When building on Windows we don't attempt to use any installed
7371         dnl "system"  Python.
7372         dnl
7373         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
7374         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
7375         dnl MinGW cross-compilation setups.)
7376         AC_MSG_RESULT([internal])
7377         enable_python=internal
7378     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \) \
7379                             -a \( "$with_macosx_sdk" = 10.4 -o "$with_macosx_sdk" = 10.5 \); then
7380         # When building against a more recent SDK the ionternal Python can't be compiled, I can't be bothered to fix that for now,
7381         # building against a recent SDK is only for developer's own builds anyway.
7382         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
7383         enable_python=internal
7384     else
7385         AC_MSG_RESULT([checking below])
7386         enable_python=auto
7387     fi
7388     ;;
7389 internal)
7390     AC_MSG_RESULT([internal])
7391     ;;
7392 system)
7393     if test $_os = Darwin -a -z "$PYTHON" -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
7394         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
7395     fi
7396     AC_MSG_RESULT([system])
7397     ;;
7399     AC_MSG_ERROR([Incorrect --enable-python option])
7400     ;;
7401 esac
7403 AC_SUBST(DISABLE_PYTHON)
7405 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
7406     AC_MSG_ERROR([Must use internal Python when building with MSVC])
7409 if test $enable_python != no; then
7410     BUILD_TYPE="$BUILD_TYPE PYUNO"
7413 if test "$cross_compiling" = yes; then
7414     if test $enable_python = auto; then
7415         enable_python=system
7416     fi
7417 else
7418     if test $enable_python = system -a -z "$PYTHON"; then
7419         if test $_os = Darwin; then
7420             # We already have logic above to make sure the system Python
7421             # is used only when building against SDK 10.6 or newer.
7423             # Make sure we use the 2.6 Python when building against the
7424             # 10.6 SDK.
7425             case $with_macosx_sdk in
7426             10.6)
7427                 python_version=2.6;;
7428             10.7|10.8)
7429                 python_version=2.7;;
7430             *)
7431                 # ???
7432                 python_version=2.7;;
7433             esac
7434             PYTHON=python$python_version
7435             PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
7436             PYTHON_LIBS="-framework Python"
7437         else
7438             # This causes an error if no python command is found
7439             AM_PATH_PYTHON([3.3])
7440         fi
7441     elif test $enable_python = auto; then
7442         # We should not come here in a MSVC build, I think?
7443         if test $build_os = cygwin; then
7444             AC_MSG_ERROR([Assertion failed - should not be here in a MSVC build])
7445         fi
7447         # This allows a lack of system Python 3.3 with no error, we check below for a system Python of
7448         # earlier version.
7449         AM_PATH_PYTHON([3.3],, [:])
7451         if test "$PYTHON" = :; then
7452             enable_python=internal
7454             if test $_os = Darwin; then
7455                 # See the fixme in gbuild.mk
7457                 # There must be a system Python, 2.6 should be fine (?), to run build-time Python scripts
7458                 # like filter/source/svg/js2hxx.py. (Is that the only build-time Python script?) If we
7459                 # don't do this, PYTHON will stay with the value ":" which of course makes runing
7460                 # build-time Python scripts rather ineffective.
7462                 # Unset variables set by the above AM_PATH_PYTHON so that we acutally do check anew
7463                 # Finding an (old) system Python should not confuse our already decided intent to build an
7464                 # internal Python 3.3, that is directed by enable_python = internal.
7465                 unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON
7466                 AM_PATH_PYTHON([2.6])
7467             else
7468                 # For Linux it works to use the internally built Python, see gbuild.mk
7469                 :
7470             fi
7471         else
7472             enable_python=system
7473         fi
7474     fi
7477 if test $enable_python = system; then
7478     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
7479         # Fallback: Accept these in the environment, or as set above
7480         # for MacOSX.
7481         :
7482     elif test "$cross_compiling" != yes; then
7483         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
7484         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
7485         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
7486         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
7487         if test -z "$PKG_CONFIG"; then
7488             PYTHON_CFLAGS="-I$python_include"
7489             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
7490         elif $PKG_CONFIG --exists python-$python_version; then
7491             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
7492             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
7493         else
7494             PYTHON_CFLAGS="-I$python_include"
7495             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
7496         fi
7497     else
7498         dnl How to find out the cross-compilation Python installation path?
7499         dnl Let's hardocode what we know for different distributions for now...
7500         for python_version in 2.6; do
7501             if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
7502                 PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
7503                 PYTHON_LIBS="-L${MINGW_SYSROOT}lib -lpython$python_version $python_libs"
7504                 MINGW_PYTHON_EXE=python.exe
7505                 libo_MINGW_CHECK_DLL([PYTHON], [libpython$python_version])
7506                 libo_MINGW_CHECK_DLL([READLINE], [libreadline6])
7507                 libo_MINGW_CHECK_DLL([TERMCAP], [libtermcap])
7508                 # could we somehow extract the really mingw python version from
7509                 # actual distro package?
7510                 # 2.6.2 currently on OpenSUSE 12.1?
7511                 # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
7512                 PYTHON_VERSION=$python_version.2
7513                 PYTHON_VERSION_MAJOR=${python_version%.*}
7514                 PYTHON_VERSION_MINOR=${python_version#*.}
7515                 break
7516             fi
7517         done
7518         test -n "$PYTHON_CFLAGS" && break
7519     fi
7522 dnl By now enable_python should be "system", "internal" or "no"
7523 case $enable_python in
7524 system)
7525     SYSTEM_PYTHON=YES
7527     if test "$CROSS_COMPILING" != YES; then
7528         dnl Check if the headers really work
7529         save_CPPFLAGS="$CPPFLAGS"
7530         CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
7531         AC_CHECK_HEADER(Python.h, [],
7532            [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
7533            [])
7534         CPPFLAGS="$save_CPPFLAGS"
7536         AC_LANG_PUSH(C)
7537         CFLAGS="$CFLAGS $PYTHON_CFLAGS"
7538         AC_MSG_CHECKING([for correct python library version])
7539            AC_RUN_IFELSE([AC_LANG_SOURCE([[
7540 #include <Python.h>
7542 int main(int argc, char **argv) {
7543        if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
7544            (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
7545        else return 1;
7547            ]])],[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])],[])
7548         CFLAGS=$save_CFLAGS
7549         AC_LANG_POP(C)
7551         dnl FIXME Check if the Python library can be linked with, too?
7552     fi
7553     ;;
7555 internal)
7556     SYSTEM_PYTHON=NO
7557     PYTHON_VERSION_MAJOR=3
7558     PYTHON_VERSION_MINOR=3
7559     PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.0
7560     BUILD_TYPE="$BUILD_TYPE PYTHON"
7561     # Embedded Python dies without Home set
7562     if test "$HOME" = ""; then
7563         export HOME=""
7564     fi
7565     # bz2 tarball and bzip2 is not standard
7566     if test -z "$BZIP2"; then
7567         AC_PATH_PROG( BZIP2, bzip2)
7568         if test -z "$BZIP2"; then
7569             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
7570         fi
7571     fi
7572     ;;
7574     SYSTEM_PYTHON=NO
7575     ;;
7577     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
7578     ;;
7579 esac
7581 dnl Cross-build of python requires python that is runnable on the build
7582 dnl platform, because it is used in the build process
7583 if test "$cross_compiling" = yes; then
7584     if test "$DISABLE_PYTHON" = no -a "$SYSTEM_PYTHON" = no -a "$DISABLE_PYTHON_FOR_BUILD" = yes; then
7585         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.])
7586     fi
7589 AC_SUBST(SYSTEM_PYTHON)
7590 AC_SUBST(PYTHON_CFLAGS)
7591 AC_SUBST(PYTHON_LIBS)
7592 AC_SUBST(PYTHON_VERSION)
7593 AC_SUBST(PYTHON_VERSION_MAJOR)
7594 AC_SUBST(PYTHON_VERSION_MINOR)
7595 AC_SUBST([MINGW_PYTHON_EXE])
7596 AC_SUBST([MINGW_PYTHON_DLL])
7597 AC_SUBST([MINGW_READLINE_DLL])
7598 AC_SUBST([MINGW_TERMCAP_DLL])
7600 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
7601 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
7602     AC_MSG_RESULT([yes])
7603     ENABLE_MYSQLC=YES
7604     BUILD_TYPE="$BUILD_TYPE MYSQLC"
7605 else
7606     AC_MSG_RESULT([no])
7607     ENABLE_MYSQLC=NO
7609 AC_SUBST(ENABLE_MYSQLC)
7611 if test "$ENABLE_MYSQLC" = "YES"; then
7613     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
7615     dnl ===================================================================
7616     dnl Check for system MySQL
7617     dnl ===================================================================
7618     AC_MSG_CHECKING([for MySQL prerequisites])
7619     if test "$with_system_mysql" = "yes"; then
7620         AC_MSG_RESULT([external MySQL])
7621         SYSTEM_MYSQL=YES
7622         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
7623         AC_MSG_CHECKING([MySQL version])
7624         MYSQL_VERSION=`$MYSQLCONFIG --version`
7625         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
7626         if test "$MYSQL_MAJOR" -ge "5"; then
7627             AC_MSG_RESULT([OK])
7628         else
7629             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
7630         fi
7631         AC_MSG_CHECKING([for MySQL Client library])
7632         MYSQL_INC=`$MYSQLCONFIG --include`
7633         MYSQL_LIB=`$MYSQLCONFIG --libs`
7634         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
7635         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
7636     else
7637         SYSTEM_MYSQL=NO
7638         if test -n "$with_libmysql_path"; then
7639             AC_MSG_RESULT([external Connector/C (libmysql)])
7640             LIBMYSQL=libmysql.so
7641             if test "$_os" = "Darwin"; then
7642                 LIBMYSQL=libmysql.dylib
7643             elif test "$_os" = "WINNT"; then
7644                 LIBMYSQL=libmysql.dll
7645             fi
7646             AC_MSG_CHECKING([for $LIBMYSQL])
7647             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
7648                 AC_MSG_RESULT([found.])
7649                 LIBMYSQL_PATH=$with_libmysql_path
7650             else
7651                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
7652             fi
7653         else
7654             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
7655         fi
7656     fi
7657     AC_SUBST(SYSTEM_MYSQL)
7658     AC_SUBST(MYSQL_INC)
7659     AC_SUBST(MYSQL_LIB)
7660     AC_SUBST(MYSQL_DEFINES)
7661     AC_SUBST(LIBMYSQL_PATH)
7663     AC_LANG_PUSH([C++])
7664     dnl ===================================================================
7665     dnl Check for system MySQL C++ Connector
7666     dnl ===================================================================
7667     # FIXME!
7668     # who thought this too-generic cppconn dir was a good idea?
7669     AC_MSG_CHECKING([MySQL Connector/C++])
7670     if test "$with_system_mysql_cppconn" = "yes"; then
7671         AC_MSG_RESULT([external])
7672         SYSTEM_MYSQL_CPPCONN=YES
7673         AC_LANG_PUSH([C++])
7674         AC_CHECK_HEADER(mysql_driver.h, [],
7675                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
7676         AC_CHECK_LIB([mysqlcppconn], [main], [:],
7677                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
7678         save_LIBS=$LIBS
7679         LIBS="$LIBS -lmysqlcppconn"
7680         AC_MSG_CHECKING([version])
7681         AC_RUN_IFELSE([AC_LANG_SOURCE([[
7682 #include <mysql_driver.h>
7684 int main(int argc, char **argv) {
7685     sql::Driver *driver;
7686     driver = get_driver_instance();
7687     if (driver->getMajorVersion() > 1 || \
7688        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
7689        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
7690         return 0;
7691       else
7692         return 1;
7694       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
7696         AC_LANG_POP([C++])
7697         LIBS=$save_LIBS
7698     else
7699         AC_MSG_RESULT([internal])
7700         AC_MSG_CHECKING([for mysqlcppconn module])
7701         if test -d mysqlcppconn; then
7702             AC_MSG_RESULT([OK])
7703         else
7704             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
7705         fi
7706         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
7707         SYSTEM_MYSQL_CPPCONN=NO
7708     fi
7709     AC_LANG_POP([C++])
7711 AC_SUBST(SYSTEM_MYSQL_CPPCONN)
7713 dnl ===================================================================
7714 dnl Check for system hsqldb
7715 dnl ===================================================================
7716 if test "$with_java" != "no"; then
7717 HSQLDB_USE_JDBC_4_1=
7718 AC_MSG_CHECKING([which hsqldb to use])
7719 if test "$with_system_hsqldb" = "yes"; then
7720     AC_MSG_RESULT([external])
7721     SYSTEM_HSQLDB=YES
7722     if test -z $HSQLDB_JAR; then
7723         HSQLDB_JAR=/usr/share/java/hsqldb.jar
7724     fi
7725     AC_CHECK_FILE($HSQLDB_JAR, [],
7726                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
7727     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
7728     export HSQLDB_JAR
7729     if $PERL -e 'use Archive::Zip;
7730             my $file = "$ENV{'HSQLDB_JAR'}";
7731             my $zip = Archive::Zip->new( $file );
7732             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
7733             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
7734                push @l, split(/\n/, $mf);
7735                foreach my $line (@l) {
7736                   if ($line =~ m/Specification-Version:/) {
7737                       ($t, $version) = split (/:/,$line);
7738                       $version =~ s/^\s//;
7739                       ($a, $b, $c, $d) = split (/\./,$version);
7740                       if ($c == "0" && $d > "8")  {
7741                           exit 0;
7742                       } else {
7743                           exit 1;
7744                       }
7745                   }
7746                }
7747             } else {
7748                 exit 1;
7749             }'; then
7750         AC_MSG_RESULT([yes])
7751     else
7752         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
7753     fi
7754 else
7755     AC_MSG_RESULT([internal])
7756     SYSTEM_HSQLDB=NO
7757     BUILD_TYPE="$BUILD_TYPE HSQLDB"
7758     AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
7759     javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
7760     if expr "$javanumver" '>=' 000100060000 > /dev/null; then
7761         AC_MSG_RESULT([yes])
7762         HSQLDB_USE_JDBC_4_1=YES
7763     else
7764         AC_MSG_RESULT([no])
7765     fi
7767 AC_SUBST(SYSTEM_HSQLDB)
7768 AC_SUBST(HSQLDB_JAR)
7769 AC_SUBST([HSQLDB_USE_JDBC_4_1])
7772 dnl ===================================================================
7773 dnl Check for PostgreSQL stuff
7774 dnl ===================================================================
7775 if test "x$enable_postgresql_sdbc" != "xno"; then
7776     SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
7778     # if/when anything else than PostgreSQL uses Kerberos,
7779     # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
7780     WITH_KRB5=NO
7781     WITH_GSSAPI=no
7782     case "$_os" in
7783     Darwin)
7784         # MacOS X has system MIT Kerberos 5 since 10.4
7785         if test "$with_krb5" != "no"; then
7786             WITH_KRB5=YES
7787             save_LIBS=$LIBS
7788             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7789                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
7790             LIBS=$save_LIBS
7791             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7792                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
7793             LIBS=$save_LIBS
7794         fi
7795         if test "$with_gssapi" != "no"; then
7796           WITH_GSSAPI=YES
7797           save_LIBS=$LIBS
7798           AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7799                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7800           LIBS=$save_LIBS
7801         fi
7802         ;;
7803     WINNT)
7804         if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
7805             AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
7806         fi
7807         ;;
7808     Linux|GNU|*BSD|DragonFly)
7809         if test "$with_krb5" != "no"; then
7810             WITH_KRB5=YES
7811             save_LIBS=$LIBS
7812             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7813                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7814             LIBS=$save_LIBS
7815             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7816                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7817             LIBS=$save_LIBS
7818         fi
7819         if test "$with_gssapi" != "no"; then
7820             WITH_GSSAPI=YES
7821             save_LIBS=$LIBS
7822             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7823                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7824             LIBS=$save_LIBS
7825         fi
7826         ;;
7827     *)
7828         if test "$with_krb5" = "yes"; then
7829             WITH_KRB5=YES
7830             save_LIBS=$LIBS
7831             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7832                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7833             LIBS=$save_LIBS
7834             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7835                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7836             LIBS=$save_LIBS
7837         fi
7838         if test "$with_gssapi" = "yes"; then
7839             WITH_GSSAPI=YES
7840             save_LIBS=$LIBS
7841             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7842                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7843             LIBS=$save_LIBS
7844         fi
7845     esac
7847     AC_MSG_CHECKING([PostgreSQL C interface])
7848     if test "$with_system_postgresql" = "yes"; then
7849         AC_MSG_RESULT([external PostgreSQL])
7850         SYSTEM_POSTGRESQL=YES
7851         if test "$_os" = Darwin; then
7852             supp_path=''
7853             for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
7854                 pg_supp_path="$P_SEP$d$pg_supp_path"
7855             done
7856         fi
7857         AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
7858         if test -z "$PGCONFIG"; then
7859             AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
7860         fi
7861         POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
7862         POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
7863     else
7864         if test -n "$with_libpq_path"; then
7865             SYSTEM_POSTGRESQL=YES
7866             AC_MSG_RESULT([external libpq])
7867             POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
7868             POSTGRESQL_INC=-I"${with_libpq_path}/include/"
7869         else
7870             SYSTEM_POSTGRESQL=NO
7871             AC_MSG_RESULT([internal])
7872             POSTGRESQL_LIB=""
7873             POSTGRESQL_INC="%OVERRIDE_ME%"
7874             BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
7875         fi
7876     fi
7877     if test "${SYSTEM_POSTGRESQL}" = "YES"; then
7878         AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
7879         save_CFLAGS=$CFLAGS
7880         save_CPPFLAGS=$CPPFLAGS
7881         save_LIBS=$LIBS
7882         CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
7883         LIBS="${LIBS} ${POSTGRESQL_LIB}"
7884         AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
7885         AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
7886             [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
7887         CFLAGS=$save_CFLAGS
7888         CPPFLAGS=$save_CPPFLAGS
7889         LIBS=$save_LIBS
7890     fi
7891     BUILD_POSTGRESQL_SDBC=YES
7893 AC_SUBST(WITH_KRB5)
7894 AC_SUBST(WITH_GSSAPI)
7895 AC_SUBST(BUILD_POSTGRESQL_SDBC)
7896 AC_SUBST(SYSTEM_POSTGRESQL)
7897 AC_SUBST(POSTGRESQL_INC)
7898 AC_SUBST(POSTGRESQL_LIB)
7900 dnl ===================================================================
7901 dnl Check for system curl
7902 dnl ===================================================================
7903 AC_MSG_CHECKING([which libcurl to use])
7904 if test "$with_system_curl" = "auto"; then
7905     case "$_os" in
7906     Darwin)
7907         with_system_curl=yes
7908         ;;
7909     *)
7910         with_system_curl="$with_system_libs"
7911         ;;
7912     esac
7915 if test "$with_system_curl" = "yes"; then
7916     AC_MSG_RESULT([external])
7917     SYSTEM_CURL=YES
7919     curl_version=""
7920     if test "$cross_compiling" = "yes"; then
7921         dnl At least the OBS mingw32-libcurl-devel package
7922         dnl comes with a proper .pc file
7923         PKG_CHECK_MODULES(CURL, libcurl,, [:])
7924         if test -n "$CURL_PKG_ERRORS"; then
7925             AC_MSG_RESULT([no])
7926         else
7927             curl_version=`$PKG_CONFIG --modversion libcurl`
7928         fi
7929     fi
7930     if test -z "$curl_version"; then
7931         AC_PATH_PROG(CURLCONFIG, curl-config)
7932         if test -z "$CURLCONFIG"; then
7933             AC_MSG_ERROR([install the libcurl development package])
7934         fi
7935         CURL_LIBS=`$CURLCONFIG --libs`
7936         CURL_CFLAGS=`$CURLCONFIG --cflags`
7937         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
7938     fi
7940     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
7942     case $curl_version in
7943     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
7944     dnl so they need to be doubled to end up in the configure script
7945     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
7946         AC_MSG_RESULT([yes, you have $curl_version])
7947         ;;
7948     *)
7949         AC_MSG_ERROR([no, you have $curl_version])
7950         ;;
7951     esac
7953     libo_MINGW_CHECK_DLL([CURL], [libcurl])
7954     libo_MINGW_TRY_DLL([INTL], [libintl])
7955     libo_MINGW_TRY_DLL([IDN], [libidn])
7956     libo_MINGW_TRY_DLL([NSPR4], [libnspr4])
7957     libo_MINGW_TRY_DLL([NSSUTIL3], [nssutil3])
7958     libo_MINGW_TRY_DLL([PLC4], [libplc4])
7959     libo_MINGW_TRY_DLL([PLDS4], [libplds4])
7960     libo_MINGW_TRY_DLL([NSS3], [nss3])
7961     libo_MINGW_TRY_DLL([SSL3], [ssl3])
7962     libo_MINGW_TRY_DLL([GPG_ERROR], [libgpg-error])
7963     libo_MINGW_TRY_DLL([GCRYPT], [libgcrypt])
7964     libo_MINGW_TRY_DLL([SSH2], [libssh2])
7965 else
7966     AC_MSG_RESULT([internal])
7967     SYSTEM_CURL=NO
7968     BUILD_TYPE="$BUILD_TYPE CURL"
7970 AC_SUBST(SYSTEM_CURL)
7971 AC_SUBST(CURL_CFLAGS)
7972 AC_SUBST(CURL_LIBS)
7973 AC_SUBST([MINGW_CURL_DLL])
7974 AC_SUBST([MINGW_GCRYPT_DLL])
7975 AC_SUBST([MINGW_GPG_ERROR_DLL])
7976 AC_SUBST([MINGW_IDN_DLL])
7977 AC_SUBST([MINGW_INTL_DLL])
7978 AC_SUBST([MINGW_NSPR4_DLL])
7979 AC_SUBST([MINGW_NSS3_DLL])
7980 AC_SUBST([MINGW_NSSUTIL3_DLL])
7981 AC_SUBST([MINGW_PLC4_DLL])
7982 AC_SUBST([MINGW_PLDS4_DLL])
7983 AC_SUBST([MINGW_SSH2_DLL])
7984 AC_SUBST([MINGW_SSL3_DLL])
7986 dnl ===================================================================
7987 dnl Check for system boost
7988 dnl ===================================================================
7989 AC_MSG_CHECKING([which boost to use])
7990 if test "$with_system_boost" = "yes"; then
7991     AC_MSG_RESULT([external])
7992     SYSTEM_BOOST=YES
7993     AC_LANG_PUSH([C++])
7994     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
7995        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
7996     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
7997        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
7998     AC_CHECK_HEADER(boost/function.hpp, [],
7999        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
8001     save_CXXFLAGS=$CXXFLAGS
8002     CXXFLAGS="$CXXFLAGS -fno-exceptions"
8003     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
8004     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
8005 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
8007     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
8008         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
8009     else
8010         AC_MSG_RESULT([yes])
8011     fi
8012     CXXFLAGS=$save_CXXFLAGS
8013     AC_LANG_POP([C++])
8015     AX_BOOST_BASE
8016     AX_BOOST_DATE_TIME
8017     mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
8018     libo_MINGW_TRY_DLL([BOOST_DATE_TIME], [$mingw_boost_date_time_dll])
8019     if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
8020         # if not found, try again with 'lib' prefix
8021         libo_MINGW_CHECK_DLL([BOOST_DATE_TIME],
8022                              [lib$mingw_boost_date_time_dll])
8023     fi
8024 else
8025     AC_MSG_RESULT([internal])
8026     BUILD_TYPE="$BUILD_TYPE BOOST"
8027     SYSTEM_BOOST=NO
8029 AC_SUBST([MINGW_BOOST_DATE_TIME_DLL])
8030 AC_SUBST(SYSTEM_BOOST)
8032 dnl ===================================================================
8033 dnl Check for system mdds
8034 dnl ===================================================================
8035 AC_MSG_CHECKING([which mdds to use])
8036 if test "$with_system_mdds" = "yes"; then
8037     AC_MSG_RESULT([external])
8038     SYSTEM_MDDS=YES
8040     dnl ===================================================================
8041     dnl Determine which hash container mdds shall use
8042     dnl ===================================================================
8043     AC_MSG_CHECKING([which hash container mdds shall use])
8044     if test "x$HAVE_CXX0X" = "xTRUE"; then
8045         MDDS_CPPFLAGS="-std=gnu++0x"
8046         AC_MSG_RESULT([std::unordered_map])
8047     else
8048         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
8049         AC_MSG_RESULT([boost::unordered_map])
8050     fi
8052     AC_LANG_PUSH([C++])
8053     save_CPPFLAGS="$CPPFLAGS"
8054     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
8055     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
8056         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
8057     AC_CHECK_HEADER(mdds/multi_type_matrix.hpp, [],
8058         [AC_MSG_ERROR(mdds/multi_type_matrix.hpp not found. install mdds >= 0.6.0)], [])
8059     CPPFLAGS="$save_CPPFLAGS"
8060     AC_LANG_POP([C++])
8061 else
8062     AC_MSG_RESULT([internal])
8063     BUILD_TYPE="$BUILD_TYPE MDDS"
8064     SYSTEM_MDDS=NO
8066     dnl ===================================================================
8067     dnl Determine which hash container mdds shall use
8068     dnl ===================================================================
8069     AC_MSG_CHECKING([which hash container mdds shall use])
8070     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
8071     AC_MSG_RESULT([boost::unordered_map])
8073 AC_SUBST(SYSTEM_MDDS)
8074 AC_SUBST([MDDS_CPPFLAGS])
8076 dnl ===================================================================
8077 dnl Check for system vigra
8078 dnl ===================================================================
8079 AC_MSG_CHECKING([which vigra to use])
8080 if test "$with_system_vigra" = "yes"; then
8081     AC_MSG_RESULT([external])
8082     SYSTEM_VIGRA=YES
8083     AC_LANG_PUSH([C++])
8084     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
8085        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
8086     AC_LANG_POP([C++])
8087 else
8088     AC_MSG_RESULT([internal])
8089     BUILD_TYPE="$BUILD_TYPE VIGRA"
8090     SYSTEM_VIGRA=NO
8092 AC_SUBST(SYSTEM_VIGRA)
8094 dnl ===================================================================
8095 dnl Check for system odbc
8096 dnl ===================================================================
8097 AC_MSG_CHECKING([which odbc headers to use])
8098 if test "$with_system_odbc" = "yes"; then
8099     AC_MSG_RESULT([external])
8100     SYSTEM_ODBC_HEADERS=YES
8102     AC_CHECK_HEADER(sqlext.h, [],
8103       [AC_MSG_ERROR(odbc not found. install odbc)], [])
8104 elif test "$enable_database_connectivity" != yes; then
8105     AC_MSG_RESULT([none])
8106 else
8107     AC_MSG_RESULT([internal])
8108     SYSTEM_ODBC_HEADERS=NO
8110 AC_SUBST(SYSTEM_ODBC_HEADERS)
8113 dnl ===================================================================
8114 dnl Check for system openldap
8115 dnl ===================================================================
8117 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
8118 AC_MSG_CHECKING([which openldap library to use])
8119 if test "$with_system_openldap" = "yes"; then
8120     AC_MSG_RESULT([external])
8121     SYSTEM_OPENLDAP=YES
8122     AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
8123     AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8124     AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8125 else
8126     AC_MSG_RESULT([internal])
8127     SYSTEM_OPENLDAP=NO
8128     BUILD_TYPE="$BUILD_TYPE OPENLDAP"
8131 AC_SUBST(SYSTEM_OPENLDAP)
8133 dnl ===================================================================
8134 dnl Check for mozilla ab connectivity for windows
8135 dnl ===================================================================
8137 AC_MSG_CHECKING([whether to enable build of Mozilla addressbook connectivity driver for Windows])
8138 if test "$enable_win_mozab_driver" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
8139     AC_MSG_RESULT([yes])
8140     WITH_MOZAB4WIN=YES
8141     BUILD_MOZAB=YES
8142     if test "$enable_build_mozab" = "no" ; then
8143         BUILD_MOZAB=NO
8144     fi
8145 else
8146     AC_MSG_RESULT([no])
8147     WITH_MOZAB4WIN=NO
8149 AC_SUBST(WITH_MOZAB4WIN)
8150 AC_SUBST(BUILD_MOZAB)
8152 if test "$_os" != "WINNT"; then
8153 # on all other platforms Mozilla addressbook connectivity
8154 # is unconditionally built
8155 # new and shiny mork driver
8156    AC_MSG_RESULT([yes (new mork driver)])
8157 else
8158     if test "$WITH_MOZAB4WIN" = "NO"; then
8159         AC_MSG_RESULT([no])
8160     else
8161         AC_MSG_RESULT([yes, internal (old windows mozab driver)])
8162         BUILD_TYPE="$BUILD_TYPE MOZ"
8163         EXTMSV80=`cygpath  -u "$SRC_ROOT/external/msvcp80"`
8164         AC_MSG_CHECKING([for MSVC 2005 runtime needed for prebuilt Mozilla])
8165         if test -e "$EXTMSV80/Microsoft.VC80.CRT.manifest" -a \
8166                 -e "$EXTMSV80/msvcp80.dll" -a \
8167                 -e "$EXTMSV80/msvcr80.dll"; then
8168             AC_MSG_RESULT([Found])
8169             EXTMSV80=
8170         else
8171             #uwin-prefixed paths are with no quotes to allow for mask, and uwin to not have spaces, btw
8172             uwin=`cygpath -d "$WINDIR"`
8173             uwin=`cygpath -u "$uwin"`
8174             #if we have one we have all
8175             if test -e $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053* ; then
8176                 MSVC80_DLL_DIR=`ls -d $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053*`
8177                 MSVC80_MNFST=`ls $uwin/winsxs/Manifests/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_*.manifest`
8178                 AC_MSG_RESULT([Found])
8179             else
8180                 EXTMSV80=
8181                 AC_MSG_RESULT([Not Found])
8182                 AC_MSG_ERROR([For the pre-built Mozilla libraries, you need MSVC 2005 runtime files
8183     Microsoft.VC80.CRT.manifest, msvcp80.dll, and msvcr80.dll
8184     in external/msvcp80.
8186     You can get them by installing:
8187     <http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE>
8188     and relaunch ./autogen.sh])
8189             fi
8190         fi
8191     fi
8195 AC_SUBST(MSVC80_DLL_DIR)
8196 AC_SUBST(MSVC80_MNFST)
8197 AC_SUBST(EXTMSV80)
8198 AC_SUBST(EXTMSV80)
8200 dnl ===================================================================
8201 dnl Check for system NSS
8202 dnl ===================================================================
8203 AC_MSG_CHECKING([which NSS to use])
8204 if test "$with_system_nss" = "yes"; then
8205     AC_MSG_RESULT([external])
8206     SYSTEM_NSS="YES"
8207     PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
8208     libo_MINGW_CHECK_DLL([NSPR4], [libnspr4])
8209     libo_MINGW_CHECK_DLL([PLC4], [libplc4])
8210     libo_MINGW_CHECK_DLL([PLDS4], [libplds4])
8211     libo_MINGW_CHECK_DLL([NSS3], [nss3])
8212     libo_MINGW_CHECK_DLL([NSSUTIL3], [nssutil3])
8213     libo_MINGW_CHECK_DLL([SMIME3], [smime3])
8214     libo_MINGW_CHECK_DLL([SSL3], [ssl3])
8215 else
8216     SYSTEM_NSS="NO"
8217     BUILD_TYPE="$BUILD_TYPE NSS"
8218     AC_MSG_RESULT([internal])
8219     if test "$build_os" = "cygwin"; then
8220         AC_MSG_CHECKING([for nss build tooling]) # coming from mozilla
8221         if test -z "$NSSBUILDTOOLS"; then
8222             AC_MSG_ERROR([nss build tooling not provided
8223 Use the --with-nss-build-tools option after installing the tools obtained
8224 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
8225         else
8226             if test \( "$WITH_MINGW" = "yes" -a  ! -d "$NSSBUILDTOOLS" \) \
8227                     -o ! -d "$NSSBUILDTOOLS/moztools" \
8228                     -o ! -d "$NSSBUILDTOOLS/msys" ; then
8229                 AC_MSG_ERROR([nss build tooling incomplete!])
8230             else
8231                 AC_MSG_RESULT([ok])
8232             fi
8233         fi
8234     fi
8235 fi # system nss
8236 AC_SUBST(SYSTEM_NSS)
8237 AC_SUBST(NSS_CFLAGS)
8238 AC_SUBST(NSS_LIBS)
8239 AC_SUBST(NSSBUILDTOOLS)
8240 AC_SUBST(MINGW_SMIME3_DLL)
8242 dnl ===================================================================
8243 dnl Check for system mozilla headers
8244 dnl ===================================================================
8245 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
8246 AC_MSG_CHECKING([which NPAPI headers to use])
8248 if test "$with_system_npapi_headers" = "yes"; then
8249     AC_MSG_RESULT([external])
8250     SYSTEM_NPAPI_HEADERS=YES
8251     # First try npapi-sdk:
8252     PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
8253     # Then go with libxul:
8254     if test "x$LOCATED" != "xyes"; then
8255         PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
8256     fi
8257     if test "x$LOCATED" != "xyes"; then
8258         PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
8259     fi
8260     # if still not found bail out
8261     if test "x$LOCATED" != "xyes"; then
8262         AC_MSG_ERROR([npapi.h header file not found])
8263     fi
8265     AC_LANG_PUSH([C])
8266     save_CFLAGS=$CFLAGS
8267     CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS"
8268     AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
8269     AC_COMPILE_IFELSE(
8270         [AC_LANG_SOURCE([[
8271             #define XP_UNIX
8272             #include <npapi.h>
8273             const char* NPP_GetMIMEDescription(void) { return "foo"; }
8274             ]])],
8275         [AC_MSG_RESULT([const char*])],
8276         [
8277         AC_MSG_RESULT([char*])
8278         HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
8279         ])
8280     CFLAGS=$save_CFLAGS
8281     AC_LANG_POP([C])
8282 else
8283     AC_MSG_RESULT([internal])
8284         dnl ...but will not be built/used unless ENABLE_NPAPI_FROM_BROWSER or
8285         dnl ENABLE_NPAPI_INTO_BROWSER is YES
8286     SYSTEM_NPAPI_HEADERS=NO
8288 AC_SUBST(NPAPI_HEADERS_CFLAGS)
8289 AC_SUBST(SYSTEM_NPAPI_HEADERS)
8290 AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
8292 dnl ===================================================================
8293 dnl Check for system sane
8294 dnl ===================================================================
8295 AC_MSG_CHECKING([which sane header to use])
8296 if test "$with_system_sane" = "yes"; then
8297     AC_MSG_RESULT([external])
8298     AC_CHECK_HEADER(sane/sane.h, [],
8299       [AC_MSG_ERROR(sane not found. install sane)], [])
8300 else
8301     AC_MSG_RESULT([internal])
8302     BUILD_TYPE="$BUILD_TYPE SANE"
8305 dnl ===================================================================
8306 dnl Check for system icu
8307 dnl ===================================================================
8308 SYSTEM_GENBRK=
8309 SYSTEM_GENCCODE=
8310 SYSTEM_GENCMN=
8312 ICU_MAJOR=49
8313 ICU_MINOR=1
8314 ICU_MICRO=1
8315 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8316 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
8317 ICU_RECLASSIFIED_HEBREW_LETTER="YES"
8318 AC_MSG_CHECKING([which icu to use])
8319 if test "$with_system_icu" = "yes"; then
8320     AC_MSG_RESULT([external])
8321     SYSTEM_ICU=YES
8322     AC_LANG_PUSH([C++])
8323     AC_MSG_CHECKING([for unicode/rbbi.h])
8324     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
8325     AC_LANG_POP([C++])
8327     ICUPATH="$PATH"
8328     if test "$WITH_MINGW" = "yes"; then
8329         ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
8330     fi
8331     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
8333     AC_MSG_CHECKING([ICU version])
8334     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
8335     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
8336     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
8337     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
8339     if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "6" \); then
8340         AC_MSG_RESULT([OK, $ICU_VERSION])
8341     else
8342         AC_MSG_ERROR([not suitable, only >= 4.6 supported currently])
8343     fi
8345     if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
8346         AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
8347         ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
8348         ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
8349         ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
8350         AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
8351         if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
8352             AC_MSG_RESULT([yes])
8353         else
8354             AC_MSG_RESULT([no])
8355             if test "$with_system_icu_for_build" != "force"; then
8356                 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
8357 You can use --with-system-icu-for-build=force to use it anyway.])
8358             fi
8359         fi
8360     fi
8362     if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
8363         # using the system icu tools can lead to version confusion, use the
8364         # ones from the build environment when cross-compiling
8365         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
8366         if test -z "$SYSTEM_GENBRK"; then
8367             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
8368         fi
8369         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8370         if test -z "$SYSTEM_GENCCODE"; then
8371             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
8372         fi
8373         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8374         if test -z "$SYSTEM_GENCMN"; then
8375             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
8376         fi
8377         if test "$ICU_MAJOR" -ge "49"; then
8378             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8379         else
8380             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO"
8381         fi
8382         if test "$ICU_MAJOR" -le 4; then
8383             ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="NO"
8384             ICU_RECLASSIFIED_HEBREW_LETTER="NO"
8385         fi
8386     fi
8388     libo_MINGW_CHECK_DLL([ICUDATA], [icudata][$ICU_MAJOR][$ICU_MINOR])
8389     libo_MINGW_CHECK_DLL([ICUI18N], [icui18n][$ICU_MAJOR][$ICU_MINOR])
8390     libo_MINGW_CHECK_DLL([ICUUC], [icuuc][$ICU_MAJOR][$ICU_MINOR])
8391 else
8392     AC_MSG_RESULT([internal])
8393     SYSTEM_ICU="NO"
8394     BUILD_TYPE="$BUILD_TYPE ICU"
8396 AC_SUBST(SYSTEM_ICU)
8397 AC_SUBST(SYSTEM_GENBRK)
8398 AC_SUBST(SYSTEM_GENCCODE)
8399 AC_SUBST(SYSTEM_GENCMN)
8400 AC_SUBST(ICU_MAJOR)
8401 AC_SUBST(ICU_MINOR)
8402 AC_SUBST(ICU_MICRO)
8403 AC_SUBST([ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER])
8404 AC_SUBST([ICU_RECLASSIFIED_HEBREW_LETTER])
8405 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
8406 AC_SUBST([MINGW_ICUDATA_DLL])
8407 AC_SUBST([MINGW_ICUI18N_DLL])
8408 AC_SUBST([MINGW_ICUUC_DLL])
8410 dnl ===================================================================
8411 dnl Graphite
8412 dnl ===================================================================
8414 AC_MSG_CHECKING([whether to enable graphite support])
8415 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "$enable_graphite" = "" -o "$enable_graphite" != "no"; then
8416     AC_MSG_RESULT([yes])
8417     ENABLE_GRAPHITE="TRUE"
8418     AC_MSG_CHECKING([which graphite to use])
8419     if test "$with_system_graphite" = "yes"; then
8420         AC_MSG_RESULT([external])
8421         SYSTEM_GRAPHITE=YES
8422         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
8423         libo_MINGW_CHECK_DLL([GRAPHITE2], [libgraphite2])
8424     else
8425         AC_MSG_RESULT([internal])
8426         SYSTEM_GRAPHITE=NO
8427         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
8428     fi
8429 else
8430     AC_MSG_RESULT([no])
8432 AC_SUBST(ENABLE_GRAPHITE)
8433 AC_SUBST(SYSTEM_GRAPHITE)
8434 AC_SUBST(GRAPHITE_CFLAGS)
8435 AC_SUBST(GRAPHITE_LIBS)
8436 AC_SUBST([MINGW_GRAPHITE2_DLL])
8438 dnl ===================================================================
8439 dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
8440 dnl ===================================================================
8441 AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
8442 if test "$_os" != Android -a "$_os" != iOS -a "$enable_headless" != yes
8443 then
8444     AC_MSG_RESULT([yes])
8445     ENABLE_NPAPI_FROM_BROWSER=YES
8446 else
8447     AC_MSG_RESULT([no])
8448     ENABLE_NPAPI_FROM_BROWSER=NO
8450 AC_SUBST(ENABLE_NPAPI_FROM_BROWSER)
8452 dnl ===================================================================
8453 dnl Check for NPAPI interface to plug LibreOffice into browser windows
8454 dnl ===================================================================
8455 AC_MSG_CHECKING([whether to plug LibreOffice into browser windows])
8456 if test "$_os" == WINNT -o "$_os" != Android -a "$_os" != Darwin -a "$_os" != iOS -a \
8457         "$enable_headless" != yes -a "$enable_gtk" != no
8458 then
8459     AC_MSG_RESULT([yes])
8460     ENABLE_NPAPI_INTO_BROWSER=YES
8461 else
8462     AC_MSG_RESULT([no])
8463     ENABLE_NPAPI_INTO_BROWSER=NO
8465 AC_SUBST(ENABLE_NPAPI_INTO_BROWSER)
8467 AC_MSG_CHECKING([whether to use X11])
8468 dnl ***************************************
8469 dnl testing for X libraries and includes...
8470 dnl ***************************************
8471 WANT_X11="no"
8472 if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
8473     WANT_X11="yes"
8475 AC_MSG_RESULT([$WANT_X11])
8477 if test "$WANT_X11" = "yes"; then
8478     AC_PATH_X
8479     AC_PATH_XTRA
8480     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8482     if test "x$x_includes" = "x"; then
8483         x_includes="default_x_includes"
8484     fi
8485     if test "x$x_libraries" = "x"; then
8486         x_libraries="default_x_libraries"
8487     fi
8488     dnl The variables $x_libraries and $x_includes are set.
8489     if test -z "$x_libraries"; then
8490         AC_MSG_ERROR([No X libraries found]) # Exit
8491     fi
8492     if test -z "$x_includes"; then
8493         AC_MSG_ERROR([No X includes found]) # Exit
8494     fi
8495     CFLAGS="$CFLAGS $X_CFLAGS"
8496     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
8497     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
8498 else
8499     x_includes="no_x_includes"
8500     x_libraries="no_x_libraries"
8502 if test -z "$x_includes"; then
8503     x_includes="no_x_includes"
8505 if test -z "$x_libraries"; then
8506     x_libraries="no_x_libraries"
8508 if test "$x_includes" = "default_x_includes"; then
8509     XINC="/usr/include"
8510 else
8511     XINC="$x_includes"
8513 AC_SUBST(XINC)
8514 if test "$x_libraries" = "default_x_libraries"; then
8515     XLIB=`$PKG_CONFIG --variable=libdir x11`
8516     if test "x$XLIB" = x; then
8517         XLIB="/usr/lib"
8518     fi
8519 else
8520     XLIB="$x_libraries"
8522 if test "$XLIB" != "no_x_libraries" -a "$XLIB" != "/usr/lib" -a "$XLIB" != "/usr/lib64"; then
8523     SOLARLIB="$SOLARLIB -L$XLIB"
8525 if test "$XINC" != "no_x_includes" -a "$XINC" != "/usr/include"; then
8526     SOLARINC="$SOLARINC -I$XINC"
8528 AC_SUBST(XLIB)
8530 if test "$WANT_X11" = "yes"; then
8531     dnl ===================================================================
8532     dnl Check for Composite.h for Mozilla plugin
8533     dnl ===================================================================
8534     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
8535      [#include <X11/Intrinsic.h>])
8537     dnl ===================================================================
8538     dnl Check for extension headers
8539     dnl ===================================================================
8540     AC_MSG_CHECKING([whether to use internal X11 extensions headers])
8541     if test "$with_system_xextensions_headers" != "no"; then
8542         AC_MSG_RESULT([no])
8543         AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
8544         [#include <X11/extensions/shape.h>])
8545     else
8546         AC_MSG_RESULT([yes])
8547         BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
8548     fi
8552 dnl ===================================================================
8553 dnl Check for system Xrender
8554 dnl ===================================================================
8555 AC_MSG_CHECKING([whether to use Xrender])
8556 if test "$WANT_X11" = "yes" -a  "$test_xrender" = "yes"; then
8557     AC_MSG_RESULT([yes])
8558     PKG_CHECK_MODULES(XRENDER, xrender)
8559     AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
8560       [AC_MSG_ERROR(libXrender not found or functional)], [])
8561     AC_MSG_CHECKING([which Xrender headers to use])
8562     if test "$with_system_xextensions_headers" != "no"; then
8563         AC_MSG_RESULT([external])
8564         AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
8565           [AC_MSG_ERROR(Xrender not found. install X)], [])
8566     else
8567         AC_MSG_RESULT([internal])
8568     fi
8569 else
8570     AC_MSG_RESULT([no])
8572 AC_SUBST(XRENDER_CFLAGS)
8573 AC_SUBST(XRENDER_LIBS)
8575 dnl ===================================================================
8576 dnl Check for XRandr
8577 dnl ===================================================================
8578 AC_MSG_CHECKING([whether to enable RandR support])
8579 if test "$WANT_X11" = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
8580     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
8581         XRANDR_DLOPEN="TRUE"
8582         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
8583     else
8584         AC_MSG_RESULT([yes])
8585         XRANDR_DLOPEN="FALSE"
8586         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
8587         if test "$ENABLE_RANDR" != "TRUE"; then
8588             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
8589                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
8590             XRANDR_CFLAGS=" "
8591             AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
8592               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
8593             XRANDR_LIBS="-lXrandr "
8594             ENABLE_RANDR="TRUE"
8595         fi
8596     fi
8597 else
8598     ENABLE_RANDR=""
8599     AC_MSG_RESULT([no])
8601 AC_SUBST(XRANDR_DLOPEN)
8602 AC_SUBST(XRANDR_CFLAGS)
8603 AC_SUBST(XRANDR_LIBS)
8604 AC_SUBST(ENABLE_RANDR)
8606 dnl ===================================================================
8607 dnl Check for building neon
8608 dnl ===================================================================
8609 AC_MSG_CHECKING([whether to use neon])
8610 if test "$enable_neon" = "no"; then
8611     AC_MSG_RESULT([no])
8612     DISABLE_NEON=TRUE
8613     AC_SUBST(DISABLE_NEON)
8614 else
8615     AC_MSG_RESULT([yes])
8616 dnl ===================================================================
8617 dnl Check for system neon
8618 dnl ===================================================================
8619 AC_MSG_CHECKING([which neon to use])
8620 if test "$with_system_neon" = "yes"; then
8621     AC_MSG_RESULT([external])
8622     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
8623     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
8624     SYSTEM_NEON=YES
8625     libo_MINGW_CHECK_DLL([NEON], [libneon])
8626     libo_MINGW_TRY_DLL([TASN1], [libtasn1])
8627     libo_MINGW_TRY_DLL([GNUTLS], [libgnutls])
8628 else
8629     AC_MSG_RESULT([internal])
8630     SYSTEM_NEON=NO
8631     BUILD_TYPE="$BUILD_TYPE NEON"
8632     NEON_VERSION=0295
8634 AC_SUBST(SYSTEM_NEON)
8635 AC_SUBST(NEON_LIBS)
8636 AC_SUBST(NEON_CFLAGS)
8637 AC_SUBST(NEON_VERSION)
8638 AC_SUBST([MINGW_GNUTLS_DLL])
8639 AC_SUBST([MINGW_NEON_DLL])
8640 AC_SUBST([MINGW_TASN1_DLL])
8643 dnl ===================================================================
8644 dnl Check for disabling cve_tests
8645 dnl ===================================================================
8646 AC_MSG_CHECKING([whether to execute CVE tests])
8647 if test "$enable_cve_tests" = "no"; then
8648     AC_MSG_RESULT([no])
8649     DISABLE_CVE_TESTS=TRUE
8650     AC_SUBST(DISABLE_CVE_TESTS)
8651 else
8652     AC_MSG_RESULT([yes])
8655 dnl ===================================================================
8656 dnl Check for system openssl
8657 dnl ===================================================================
8658 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8659         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
8660     with_system_openssl=yes
8662 AC_MSG_CHECKING([which libssl to use])
8663 if test "$with_system_openssl" = "yes"; then
8664     AC_MSG_RESULT([external])
8665     # Mac OS builds should get out without extra stuff is the Mac porters'
8666     # wish. And pkg-config is although Xcode ships a .pc for openssl
8667     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8668             "$_os" = "DragonFly"; then
8669         OPENSSL_CFLAGS=
8670         OPENSSL_LIBS="-lssl -lcrypto"
8671     else
8672         PKG_CHECK_MODULES( OPENSSL, openssl )
8673     fi
8674     SYSTEM_OPENSSL=YES
8675     libo_MINGW_CHECK_DLL([SSL], [libssl])
8676     libo_MINGW_CHECK_DLL([CRYPTO], [libcrypto])
8677 else
8678     AC_MSG_RESULT([internal])
8679     SYSTEM_OPENSSL=NO
8680     BUILD_TYPE="$BUILD_TYPE OPENSSL"
8682 AC_SUBST(SYSTEM_OPENSSL)
8683 AC_SUBST(OPENSSL_CFLAGS)
8684 AC_SUBST(OPENSSL_LIBS)
8685 AC_SUBST([MINGW_SSL_DLL])
8686 AC_SUBST([MINGW_CRYPTO_DLL])
8688 dnl ===================================================================
8689 dnl Check for system redland
8690 dnl ===================================================================
8691 AC_MSG_CHECKING([which redland library to use])
8692 if test "$with_system_redland" = "yes"; then
8693     AC_MSG_RESULT([external])
8694     SYSTEM_REDLAND=YES
8695     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
8696     dnl raptor2: need at least 2.0.7 for CVE-2012-0037
8697     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.16 raptor2 >= 2.0.7)
8698     libo_MINGW_CHECK_DLL([REDLAND], [librdf])
8699     libo_MINGW_TRY_DLL([RAPTOR], [libraptor])
8700     libo_MINGW_TRY_DLL([RASQAL], [librasqal])
8701     libo_MINGW_TRY_DLL([SQLITE3], [libsqlite3])
8702 else
8703     AC_MSG_RESULT([internal])
8704     BUILD_TYPE="$BUILD_TYPE REDLAND"
8705     SYSTEM_REDLAND=NO
8707 AC_SUBST(SYSTEM_REDLAND)
8708 AC_SUBST(REDLAND_CFLAGS)
8709 AC_SUBST(REDLAND_LIBS)
8710 AC_SUBST([MINGW_RAPTOR_DLL])
8711 AC_SUBST([MINGW_RASQAL_DLL])
8712 AC_SUBST([MINGW_REDLAND_DLL])
8713 AC_SUBST([MINGW_SQLITE3_DLL])
8715 dnl ===================================================================
8716 dnl Check for system orcus
8717 dnl ===================================================================
8718 AC_MSG_CHECKING([which orcus library to use])
8719 if test "$with_system_orcus" = "yes"; then
8720     AC_MSG_RESULT([external])
8721     SYSTEM_LIBORCUS=YES
8722     PKG_CHECK_MODULES(ORCUS, liborcus-0.4 >= 0.3.0)
8723 else
8724     AC_MSG_RESULT([internal])
8725     BUILD_TYPE="$BUILD_TYPE ORCUS"
8726     SYSTEM_LIBORCUS=NO
8728     if test "$SYSTEM_BOOST" = "YES"; then
8729         # ===========================================================
8730         # Determine if we are going to need to link with Boost.System
8731         # ===========================================================
8732         dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
8733         dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
8734         dnl in documentation has no effect.
8735         AC_MSG_CHECKING([if we need to link with Boost.System])
8736         AC_LANG_PUSH([C++])
8737         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8738                 @%:@include <boost/version.hpp>
8739             ]],[[
8740                 #if BOOST_VERSION >= 105000
8741                 #   error yes, we need to link with Boost.System
8742                 #endif
8743             ]])],[
8744                 AC_MSG_RESULT([no])
8745             ],[
8746                 AC_MSG_RESULT([yes])
8747                 AX_BOOST_SYSTEM
8748         ])
8749         AC_LANG_POP([C++])
8750     fi
8752 AC_SUBST([BOOST_SYSTEM_LIB])
8753 AC_SUBST(SYSTEM_LIBORCUS)
8754 AC_SUBST(ORCUS_CFLAGS)
8755 AC_SUBST(ORCUS_LIBS)
8757 dnl ===================================================================
8758 dnl Check for system hunspell
8759 dnl ===================================================================
8760 AC_MSG_CHECKING([which libhunspell to use])
8761 if test "$with_system_hunspell" = "yes"; then
8762     AC_MSG_RESULT([external])
8763     SYSTEM_HUNSPELL=YES
8764     AC_LANG_PUSH([C++])
8765     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
8766     if test "$HUNSPELL_PC" != "TRUE"; then
8767         AC_CHECK_HEADER(hunspell.hxx, [],
8768             [
8769             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
8770             [AC_MSG_ERROR(hunspell headers not found.)], [])
8771             ], [])
8772         AC_CHECK_LIB([hunspell], [main], [:],
8773            [ AC_MSG_ERROR(hunspell library not found.) ], [])
8774         HUNSPELL_LIBS=-lhunspell
8775     fi
8776     AC_LANG_POP([C++])
8777     libo_MINGW_CHECK_DLL([HUNSPELL], [libhunspell-1.3])
8778 else
8779     AC_MSG_RESULT([internal])
8780     SYSTEM_HUNSPELL=NO
8781     HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
8782     HUNSPELL_LIBS="-L${OUTDIR}/lib -lhunspell"
8783     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
8785 AC_SUBST(SYSTEM_HUNSPELL)
8786 AC_SUBST(HUNSPELL_CFLAGS)
8787 AC_SUBST(HUNSPELL_LIBS)
8788 AC_SUBST([MINGW_HUNSPELL_DLL])
8790 dnl ===================================================================
8791 dnl Checking for altlinuxhyph
8792 dnl ===================================================================
8793 AC_MSG_CHECKING([which altlinuxhyph to use])
8794 if test "$with_system_altlinuxhyph" = "yes"; then
8795     AC_MSG_RESULT([external])
8796     SYSTEM_HYPH=YES
8797     AC_CHECK_HEADER(hyphen.h, [],
8798        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
8799     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
8800        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
8801        [#include <hyphen.h>])
8802     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
8803         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8804     if test -z "$HYPHEN_LIB"; then
8805         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
8806            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8807     fi
8808     if test -z "$HYPHEN_LIB"; then
8809         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
8810            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8811     fi
8812     libo_MINGW_CHECK_DLL([HYPHEN], [libhyphen])
8813 else
8814     AC_MSG_RESULT([internal])
8815     SYSTEM_HYPH=NO
8816     BUILD_TYPE="$BUILD_TYPE HYPHEN"
8818 AC_SUBST(SYSTEM_HYPH)
8819 AC_SUBST(HYPHEN_LIB)
8820 AC_SUBST([MINGW_HYPHEN_DLL])
8822 dnl ===================================================================
8823 dnl Checking for mythes
8824 dnl ===================================================================
8825 AC_MSG_CHECKING([which mythes to use])
8826 if test "$with_system_mythes" = "yes"; then
8827     AC_MSG_RESULT([external])
8828     SYSTEM_MYTHES=YES
8829     AC_LANG_PUSH([C++])
8830     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
8831     if test "$MYTHES_PKGCONFIG" = "no"; then
8832         AC_CHECK_HEADER(mythes.hxx, [],
8833             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
8834         AC_CHECK_LIB([mythes-1.2], [main], [:],
8835             [ MYTHES_FOUND=no], [])
8836     if test "$MYTHES_FOUND" = "no"; then
8837         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
8838                 [ MYTHES_FOUND=no], [])
8839     fi
8840     if test "$MYTHES_FOUND" = "no"; then
8841         AC_MSG_ERROR([mythes library not found!.])
8842     fi
8843     fi
8844     AC_LANG_POP([C++])
8845     libo_MINGW_CHECK_DLL([MYTHES], [libmythes-1.2])
8846 else
8847     AC_MSG_RESULT([internal])
8848     SYSTEM_MYTHES=NO
8849     BUILD_TYPE="$BUILD_TYPE MYTHES"
8851 AC_SUBST(SYSTEM_MYTHES)
8852 AC_SUBST(MYTHES_CFLAGS)
8853 AC_SUBST(MYTHES_LIBS)
8854 AC_SUBST([MINGW_MYTHES_DLL])
8856 dnl ===================================================================
8857 dnl Checking for lpsolve
8858 dnl ===================================================================
8859 AC_MSG_CHECKING([which lpsolve to use])
8860 if test "$with_system_lpsolve" = "yes"; then
8861     AC_MSG_RESULT([external])
8862     SYSTEM_LPSOLVE=YES
8863     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
8864        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
8865     save_LIBS=$LIBS
8866     # some systems need this. Like Ubuntu....
8867     AC_CHECK_LIB(m, floor)
8868     AC_CHECK_LIB(dl, dlopen)
8869     AC_CHECK_LIB([lpsolve55], [make_lp], [:],
8870         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
8871     LIBS=$save_LIBS
8872     libo_MINGW_CHECK_DLL([LPSOLVE], [lpsolve55])
8873 else
8874     AC_MSG_RESULT([internal])
8875     SYSTEM_LPSOLVE=NO
8876     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
8878 AC_SUBST(SYSTEM_LPSOLVE)
8879 AC_SUBST([MINGW_LPSOLVE_DLL])
8881 dnl ===================================================================
8882 dnl Checking for libexttextcat
8883 dnl ===================================================================
8884 AC_MSG_CHECKING([which libexttextcat to use])
8885 if test "$with_system_libexttextcat" = "yes"; then
8886     AC_MSG_RESULT([external])
8887     SYSTEM_LIBEXTTEXTCAT=YES
8888     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
8889     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
8890 else
8891     AC_MSG_RESULT([internal])
8892     SYSTEM_LIBEXTTEXTCAT=NO
8893     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
8895 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
8896 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
8897 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
8898 AC_SUBST(LIBEXTTEXTCAT_LIBS)
8900 dnl ***************************************
8901 dnl testing libc version for Linux...
8902 dnl ***************************************
8903 if test "$_os" = "Linux"; then
8904     AC_MSG_CHECKING([whether libc is >= 2.1.1])
8905     exec 6>/dev/null # no output
8906     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
8907     exec 6>&1 # output on again
8908     if test "$HAVE_LIBC"; then
8909         AC_MSG_RESULT([yes])
8910     else
8911         AC_MSG_ERROR([no, upgrade libc])
8912     fi
8915 if test "$_os" != "WINNT"; then
8916     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
8917     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
8918     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
8919         SYSTEM_LIBC=YES
8920     fi
8921 else
8922     HAVE_GETOPT=NO
8923     HAVE_READDIR_R=NO
8924     SYSTEM_LIBC=YES
8926 AC_SUBST(HAVE_GETOPT)
8927 AC_SUBST(HAVE_READDIR_R)
8928 AC_SUBST(SYSTEM_LIBC)
8930 dnl =========================================
8931 dnl Check for the Windows  SDK.
8932 dnl =========================================
8933 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
8934 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
8935 if test "$_os" = "WINNT"; then
8936     AC_MSG_CHECKING([for Windows SDK])
8937     if test "$build_os" = "cygwin"; then
8938         if test -z "$with_windows_sdk_home"; then
8939             # This first line will detect a February 2003 Microsoft Platform SDK
8940             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
8941             # But there might be also an April 2005 PSDK, unfortunately MS changed
8942             # the registry entry. (we prefer the old version!?)
8943             if test -z "$WINDOWS_SDK_HOME"; then
8944                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
8945             fi
8946             # normalize if found
8947             if test -n "$WINDOWS_SDK_HOME"; then
8948                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
8949                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8951                 # If this sdk is incomplete, lets see if the one
8952                 # recommended to be installed is available.
8954                 # This refers to the Windows SDK 8 (as distributed
8955                 # with Visual Studio 2012, or maybe also
8956                 # separately), I assume.
8958                 # I wouldn't say that it is "incomplete", it is
8959                 # just structured differtently. We do seem to try
8960                 # to adapt to that structure below (look for the
8961                 # Include/um etc stuff), so rejecting it here is a
8962                 # bit premature... *but* then one notices that
8963                 # compiling with MSVS2008 and trying to use SDK 8
8964                 # leads to horrible errors in ICU at least. Oh
8965                 # well.
8967                 if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe"; then
8968                     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`
8969                     if test -n "$WINDOWS_SDK7_HOME"; then
8970                         WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK7_HOME"`
8971                         WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8972                     fi
8973                 fi
8974             fi
8975         else
8976             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
8977         fi
8978     fi
8979     if test -n "$WINDOWS_SDK_HOME"; then
8980         # Remove a possible trailing backslash
8981         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
8982         # Problem with current PSDK (iz 49865)
8983         # (What "current" does that mean?)
8984         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
8985             AC_MSG_ERROR([
8986 Some modules do not build correctly with MS Platform SDK - April 2005
8987 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
8988 Remove/rename/backup that file and restart configure. Details about this
8989 problem can be found in issue 49856.])
8990         fi
8992         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
8993              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
8994              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
8995             HAVE_PSDK_H="yes"
8996         elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
8997              -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
8998              -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
8999             HAVE_PSDK_H="yes"
9000         else
9001             HAVE_PSDK_H="no"
9002         fi
9003         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
9004             HAVE_PSDK_LIB="yes"
9005         elif test -f "$WINDOWS_SDK_HOME/lib/win8/um/$SDK_ARCH/user32.lib"; then
9006             HAVE_PSDK_LIB="yes"
9007         else
9008             HAVE_PSDK_LIB="no"
9009         fi
9011         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
9012             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
9013 the  Windows SDK are installed.])
9014         fi
9016         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
9017              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
9018              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
9019              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
9020         elif test ! -x "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
9021              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
9022              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
9023              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
9024         else
9025             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
9026         fi
9027     fi
9029     if test -z "$WINDOWS_SDK_HOME"; then
9030         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
9031     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
9032         WINDOWS_SDK_VERSION=61
9033         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
9034     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
9035         WINDOWS_SDK_VERSION=60
9036         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
9037     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
9038         WINDOWS_SDK_VERSION=70
9039         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
9040     elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
9041         WINDOWS_SDK_VERSION=80
9042         AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
9043     else
9044         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
9045     fi
9046     PathFormat "$WINDOWS_SDK_HOME"
9047     WINDOWS_SDK_HOME="$formatted_path"
9048     if test "$build_os" = "cygwin"; then
9049         SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
9050         if test -d "$WINDOWS_SDK_HOME/include/um"; then
9051             SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
9052         fi
9053     fi
9055 AC_SUBST(WINDOWS_SDK_HOME)
9056 AC_SUBST(WINDOWS_SDK_VERSION)
9058 dnl =========================================
9059 dnl Check for uuidgen
9060 dnl =========================================
9061 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9062     if test "$WITH_MINGW" = "yes"; then
9063         AC_PATH_PROG([UUIDGEN], [uuid])
9064         if test -z "$UUIDGEN"; then
9065             AC_MSG_WARN([uuid is needed for dev-install])
9066         fi
9067     else
9068         # presence is already tested above in the WINDOWS_SDK_HOME check
9069         UUIDGEN=uuidgen.exe
9070         AC_SUBST(UUIDGEN)
9071     fi
9072 else
9073     AC_PATH_PROG([UUIDGEN], [uuidgen])
9074     if test -z "$UUIDGEN"; then
9075         AC_MSG_WARN([uuid is needed for dev-install])
9076     fi
9079 dnl =========================================
9080 dnl Check for the Microsoft DirectX SDK.
9081 dnl =========================================
9082 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
9083     AC_MSG_CHECKING([for DirectX SDK])
9084     if test "$build_os" = "cygwin"; then
9085         if test -z "$with_directx_home"; then
9086             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
9087             if test -n "$DXSDK_DIR"; then
9088                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
9089                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
9090             fi
9091             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
9092             # the "DirectX SDK not found" error later
9093         else
9094             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
9095         fi
9096         # Remove a possible trailing backslash
9097         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
9098     elif test -n "$with_directx_home"; then
9099         DIRECTXSDK_HOME="$with_directx_home"
9100     fi
9102     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h"; then
9103         HAVE_DIRECTXSDK_H="yes"
9104     else
9105         HAVE_DIRECTXSDK_H="no"
9106     fi
9108     if test "$BITNESS_OVERRIDE" = 64; then
9109         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x64"
9110     else
9111         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
9112     fi
9113     PathFormat "$DIRECTXSDK_LIB"
9114     DIRECTXSDK_LIB="$formatted_path"
9116     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib"; then
9117         HAVE_DIRECTXSDK_LIB="yes"
9118     else
9119         HAVE_DIRECTXSDK_LIB="no"
9120     fi
9122     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
9123         AC_MSG_RESULT([found])
9124     else
9125         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
9126     fi
9127     PathFormat "$DIRECTXSDK_HOME"
9128     DIRECTXSDK_HOME="$formatted_path"
9129     SOLARINC="$SOLARINC -I$DIRECTXSDK_HOME/include"
9131 AC_SUBST(DIRECTXSDK_HOME)
9132 AC_SUBST(DIRECTXSDK_LIB)
9134 dnl ***************************************
9135 dnl Checking for bison and flex
9136 dnl ***************************************
9137 AC_PATH_PROG(BISON, bison)
9138 ANCIENT_BISON="NO"
9139 if test -z "$BISON"; then
9140     AC_MSG_ERROR([no bison found in \$PATH, install it])
9141 else
9142     AC_MSG_CHECKING([the bison version])
9143     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9144     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9145     # Accept newer than 1.875 or older(equal) than 1.75
9146     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
9147         if test "$_bison_version" = "1.875"; then
9148             AC_MSG_WARN([suspect ($BISON $_bison_version)])
9149             add_warning "Suspect ($BISON $_bison_version) suggest upgrade"
9150         else
9151             AC_MSG_RESULT([checked ($BISON $_bison_version)])
9152         fi
9153     else
9154         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
9155     fi
9156     if test "$_bison_longver" -lt 2000; then
9157         ANCIENT_BISON="YES"
9158     fi
9160 AC_SUBST(ANCIENT_BISON)
9162 AC_PATH_PROG(FLEX, flex)
9163 if test -z "$FLEX"; then
9164     AC_MSG_ERROR([no flex found in \$PATH, install it])
9166 AC_SUBST([FLEX])
9167 dnl ***************************************
9168 dnl Checking for patch
9169 dnl ***************************************
9170 AC_PATH_PROG(PATCH, patch)
9171 if test -z "$PATCH"; then
9172     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
9175 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9176 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9177     if test -z "$with_gnu_patch"; then
9178         GNUPATCH=$PATCH
9179     else
9180         if test -x "$with_gnu_patch"; then
9181             GNUPATCH=$with_gnu_patch
9182         else
9183             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9184         fi
9185     fi
9187     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9188     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9189         AC_MSG_RESULT([yes])
9190     else
9191         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9192     fi
9193 else
9194     GNUPATCH=$PATCH
9197 dnl We also need to check for --with-gnu-cp
9199 if test -z "$with_gnu_cp"; then
9200     # check the place where the good stuff is hidden on Solaris...
9201     if test -x /usr/gnu/bin/cp; then
9202         GNUCP=/usr/gnu/bin/cp
9203     else
9204         AC_PATH_PROGS(GNUCP, gnucp cp)
9205     fi
9206     if test -z $GNUCP; then
9207         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9208     fi
9209 else
9210     if test -x "$with_gnu_cp"; then
9211         GNUCP=$with_gnu_cp
9212     else
9213         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9214     fi
9217 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9218 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9219     AC_MSG_RESULT([yes])
9220 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9221     AC_MSG_RESULT([yes])
9222 else
9223     case "$build_os" in
9224     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9225         x_GNUCP=[\#]
9226         GNUCP=''
9227         AC_MSG_RESULT([no gnucp found - using the system's cp command])
9228         ;;
9229     *)
9230         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9231         ;;
9232     esac
9235 AC_SUBST(GNUPATCH)
9236 AC_SUBST(GNUCP)
9237 AC_SUBST(x_GNUCP)
9239 dnl ***************************************
9240 dnl testing assembler path
9241 dnl ***************************************
9242 ML_EXE=""
9243 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
9244     if test "$BITNESS_OVERRIDE" = ""; then
9245         assembler=ml.exe
9246         assembler_bin=bin
9247     else
9248         assembler=ml64.exe
9249         assembler_bin=bin/amd64
9250     fi
9251     if test -n "$with_asm_home"; then
9252         with_asm_home=`cygpath -u "$with_asm_home"`
9253     fi
9254     if test -x "$with_asm_home/$assembler"; then
9255         AC_MSG_CHECKING([$assembler assembler path])
9256         AC_MSG_RESULT([$with_asm_home/$assembler])
9257         ML_EXE="$with_asm_home/$assembler"
9258     else
9259         AC_PATH_PROG(ML_EXE, $assembler)
9260         if test -z "$ML_EXE"; then
9261             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
9262             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
9263                 with_asm_home=$with_cl_home/$assembler_bin
9264                 AC_MSG_RESULT([found])
9265                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
9266             else
9267                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9268             fi
9269         else
9270             with_asm_home="ASM_IN_PATH"
9271             ML_EXE="$assembler"
9272         fi
9273     fi
9274     PathFormat "$with_asm_home"
9275     ASM_HOME="$formatted_path"
9276 else
9277     ASM_HOME=""
9280 AC_SUBST(ML_EXE)
9282 dnl ===================================================================
9283 dnl We need zip and unzip
9284 dnl ===================================================================
9285 AC_PATH_PROG(ZIP, zip)
9286 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9287 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9288     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],,)
9291 AC_PATH_PROG(UNZIP, unzip)
9292 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9294 dnl ===================================================================
9295 dnl Zip must be a specific type for different build types.
9296 dnl ===================================================================
9297 if test $build_os = cygwin; then
9298     if test -n "`$ZIP -h | $GREP -i WinNT`"; then
9299         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
9300     fi
9303 dnl ===================================================================
9304 dnl Test which vclplugs have to be built.
9305 dnl ===================================================================
9306 R=""
9307 GTK3_CFLAGS=""
9308 GTK3_LIBS=""
9309 ENABLE_GTK3=""
9310 if test "x$enable_gtk3" = "xyes"; then
9311     if test "$with_system_cairo" != yes; then
9312         AC_MSG_WARN([System cairo required for gtk3 support, please use --with-system-cairo])
9313         add_warning "System cairo required for gtk3 support, please use --with-system-cairo"
9314     fi
9315     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="")
9316     if test "x$ENABLE_GTK3" = "xTRUE"; then
9317         R="gtk3"
9318     else
9319         AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
9320     fi
9322 AC_SUBST(GTK3_LIBS)
9323 AC_SUBST(GTK3_CFLAGS)
9324 AC_SUBST(ENABLE_GTK3)
9326 AC_MSG_CHECKING([which VCLplugs shall be built])
9327 if test "$GUIBASE" != "unx" -o "$enable_headless" = "yes"; then
9328     enable_gtk=no
9330 ENABLE_GTK=""
9331 if test "x$enable_gtk" = "xyes"; then
9332     ENABLE_GTK="TRUE"
9333     R="gtk $R"
9335 AC_SUBST(ENABLE_GTK)
9337 ENABLE_TDE=""
9338 if test "x$enable_tde" = "xyes"; then
9339     # Libs kab and tdeab in connectivity and kdeab and tdeab in shell
9340     # are built from the same sources. So we only allow one of them.
9341     if test "x$enable_kde" = "xyes"; then
9342         AC_MSG_ERROR([enabling both KDE and TDE is not supported])
9343     fi
9344     ENABLE_TDE="TRUE"
9345     R="$R tde"
9347 AC_SUBST(ENABLE_TDE)
9349 ENABLE_KDE=""
9350 if test "x$enable_kde" = "xyes"; then
9351     ENABLE_KDE="TRUE"
9352     R="$R kde"
9354 AC_SUBST(ENABLE_KDE)
9356 ENABLE_KDE4=""
9357 if test "x$enable_kde4" = "xyes"; then
9358     ENABLE_KDE4="TRUE"
9359     R="$R kde4"
9361 AC_SUBST(ENABLE_KDE4)
9363 ENABLE_HEADLESS=""
9364 if test "x$enable_headless" = "xyes"; then
9365     ENABLE_HEADLESS="TRUE"
9366     SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
9367     R="headless"
9369 AC_SUBST(ENABLE_HEADLESS)
9371 if test -z "$R"; then
9372     AC_MSG_RESULT([none])
9373 else
9374     AC_MSG_RESULT([$R])
9377 dnl ===================================================================
9378 dnl GCONF check
9379 dnl ===================================================================
9381 ENABLE_GCONF=""
9382 AC_MSG_CHECKING([whether to enable GConf support])
9383 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
9384     ENABLE_GCONF="TRUE"
9385     AC_MSG_RESULT([yes])
9386     PKG_CHECK_MODULES( GCONF, gconf-2.0 gobject-2.0 )
9387 else
9388     AC_MSG_RESULT([no])
9390 AC_SUBST(GCONF_LIBS)
9391 AC_SUBST(GCONF_CFLAGS)
9392 AC_SUBST(ENABLE_GCONF)
9394 dnl ===================================================================
9395 dnl Gnome VFS check
9396 dnl ===================================================================
9398 ENABLE_GNOMEVFS=""
9399 AC_MSG_CHECKING([whether to enable GNOME VFS support])
9400 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
9401     ENABLE_GNOMEVFS="TRUE"
9402     AC_MSG_RESULT([yes])
9403     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
9404     AC_DEFINE(ENABLE_GNOME_VFS)
9405 else
9406     AC_MSG_RESULT([no])
9408 AC_SUBST(GNOMEVFS_LIBS)
9409 AC_SUBST(GNOMEVFS_CFLAGS)
9410 AC_SUBST(ENABLE_GNOMEVFS)
9412 dnl ===================================================================
9413 dnl check for dbus support
9414 dnl ===================================================================
9415 ENABLE_DBUS=""
9416 DBUS_CFLAGS=""
9417 DBUS_LIBS=""
9419 if test "$enable_dbus" = "no"; then
9420     test_dbus=no
9423 AC_MSG_CHECKING([whether to enable DBUS support])
9424 if test "$test_dbus" = "yes"; then
9425     ENABLE_DBUS="TRUE"
9426     AC_MSG_RESULT([yes])
9427     PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
9428 else
9429     AC_MSG_RESULT([no])
9432 AC_SUBST(ENABLE_DBUS)
9433 AC_SUBST(DBUS_CFLAGS)
9434 AC_SUBST(DBUS_LIBS)
9436 AC_MSG_CHECKING([whether to enable font install via packagekit])
9437 if test "$ENABLE_DBUS" = "TRUE"; then
9438     if test -n "$enable_packagekit" -a "$enable_packagekit" != "no"; then
9439         ENABLE_PACKAGEKIT=YES
9440         AC_MSG_RESULT([yes])
9441     else
9442         ENABLE_PACKAGEKIT=NO
9443         AC_MSG_RESULT([no])
9444     fi
9445 else
9446     AC_MSG_RESULT([no, dbus disabled.])
9448 AC_SUBST(ENABLE_PACKAGEKIT)
9450 AC_MSG_CHECKING([whether to enable Impress remote control])
9451 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
9452     AC_MSG_RESULT([yes])
9453     ENABLE_SDREMOTE=YES
9454     AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
9456     # If not explicitly enabled or disabled, default
9457     if test -z "$enable_sdremote_bluetooth"; then
9458         case "$OS" in
9459         LINUX|MACOSX|WNT)
9460             # Default to yes for these
9461             enable_sdremote_bluetooth=yes
9462             ;;
9463         *)
9464             # otherwise no
9465             enable_sdremote_bluetooth=no
9466             ;;
9467         esac
9468     fi
9469     # $enable_sdremote_bluetooth is guaranteed non-empty now
9471     if test "$enable_sdremote_bluetooth" != "no"; then
9472         if test "$OS" = "LINUX"; then
9473             if test "$ENABLE_DBUS" = "TRUE"; then
9474                 AC_MSG_RESULT([yes])
9475                 ENABLE_SDREMOTE_BLUETOOTH=YES
9476                 dnl ===================================================================
9477                 dnl Check for system bluez
9478                 dnl ===================================================================
9479                 AC_MSG_CHECKING([which Bluetooth header to use])
9480                 if test "$with_system_bluez" = "yes"; then
9481                     AC_MSG_RESULT([external])
9482                     AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
9483                         [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
9484                 else
9485                     AC_MSG_RESULT([internal])
9486                     BUILD_TYPE="$BUILD_TYPE BLUEZ"
9487                 fi
9488             else
9489                 AC_MSG_RESULT([no, dbus disabled])
9490                 ENABLE_SDREMOTE_BLUETOOTH=NO
9491             fi
9492         else
9493             AC_MSG_RESULT([yes])
9494             ENABLE_SDREMOTE_BLUETOOTH=YES
9495         fi
9496     else
9497         AC_MSG_RESULT([no])
9498         ENABLE_SDREMOTE_BLUETOOTH=NO
9499     fi
9500 else
9501     ENABLE_SDREMOTE=NO
9502     AC_MSG_RESULT([no])
9504 AC_SUBST(ENABLE_SDREMOTE)
9505 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
9507 dnl ===================================================================
9508 dnl Check whether the gtk 2.0 libraries are available.
9509 dnl ===================================================================
9511 GTK_CFLAGS=""
9512 GTK_LIBS=""
9513 ENABLE_SYSTRAY_GTK=""
9514 if test  "$test_gtk" = "yes"; then
9516     if test "$ENABLE_GTK" = "TRUE"; then
9517         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]))
9518         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]))
9519         BUILD_TYPE="$BUILD_TYPE GTK"
9521     AC_MSG_CHECKING([whether to enable the systray quickstarter])
9522         if test "x$enable_systray" = "xyes"; then
9523         AC_MSG_RESULT([yes])
9524             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
9525                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
9526                             [ ENABLE_SYSTRAY_GTK="" ])
9527         else
9528         AC_MSG_RESULT([no])
9529         fi
9531         AC_MSG_CHECKING([whether to enable Gtk print dialog support])
9532         PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
9533                           [ENABLE_GTK_PRINT="TRUE"],
9534                           [ENABLE_GTK_PRINT=""])
9536         AC_MSG_CHECKING([whether to enable GIO support])
9537         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
9538             if test "$ENABLE_GNOMEVFS" = "TRUE"; then
9539                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
9540             fi
9541             ENABLE_GIO="TRUE"
9542             AC_MSG_RESULT([yes])
9543             PKG_CHECK_MODULES( GIO, gio-2.0 )
9544             AC_DEFINE(ENABLE_GIO)
9545         else
9546             AC_MSG_RESULT([no])
9547         fi
9548     fi
9550 AC_SUBST(ENABLE_GIO)
9551 AC_SUBST(GIO_CFLAGS)
9552 AC_SUBST(GIO_LIBS)
9553 AC_SUBST(ENABLE_SYSTRAY_GTK)
9554 AC_SUBST(GTK_CFLAGS)
9555 AC_SUBST(GTK_LIBS)
9556 AC_SUBST(GTHREAD_CFLAGS)
9557 AC_SUBST(GTHREAD_LIBS)
9558 AC_SUBST([ENABLE_GTK_PRINT])
9559 AC_SUBST([GTK_PRINT_CFLAGS])
9560 AC_SUBST([GTK_PRINT_LIBS])
9563 dnl ===================================================================
9564 dnl Check whether the Telepathy libraries are available.
9565 dnl ===================================================================
9567 ENABLE_TELEPATHY=""
9568 TELEPATHY_CFLAGS=""
9569 TELEPATHY_LIBS=""
9571 AC_MSG_CHECKING([whether to enable Telepathy support])
9572 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
9573     ENABLE_TELEPATHY="TRUE"
9574     AC_MSG_RESULT([yes])
9575     PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 )
9576 else
9577     AC_MSG_RESULT([no])
9580 AC_SUBST(ENABLE_TELEPATHY)
9581 AC_SUBST(TELEPATHY_CFLAGS)
9582 AC_SUBST(TELEPATHY_LIBS)
9585 dnl ===================================================================
9587 if test "$enable_headless" != "yes"; then
9588     PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
9589 else
9590     LIBPNG_LIBS=''
9591     LIBPNG_CFLAGS=''
9593 AC_SUBST(LIBPNG_LIBS)
9594 AC_SUBST(LIBPNG_CFLAGS)
9596 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
9597 if test "x$enable_unix_qstart_libpng" != "xno"; then
9598     AC_MSG_RESULT([yes])
9599 else
9600     AC_MSG_RESULT([no])
9601     ENABLE_QUICKSTART_LIBPNG=""
9603 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
9605 SPLIT_APP_MODULES=""
9606 if test "$enable_split_app_modules" = "yes"; then
9607     SPLIT_APP_MODULES="YES"
9609 AC_SUBST(SPLIT_APP_MODULES)
9611 SPLIT_OPT_FEATURES=""
9612 if test "$enable_split_opt_features" = "yes"; then
9613     SPLIT_OPT_FEATURES="YES"
9615 AC_SUBST(SPLIT_OPT_FEATURES)
9617 if test $_os = Darwin -o $_os = WINNT; then
9618     if test "$enable_cairo_canvas" = yes; then
9619         AC_MSG_ERROR([The cairo canvas should not be used for this platform])
9620     fi
9621     enable_cairo_canvas=no
9622 elif test -z "$enable_cairo_canvas"; then
9623     enable_cairo_canvas=yes
9626 ENABLE_CAIRO_CANVAS=""
9627 if test "$enable_cairo_canvas" = "yes"; then
9628     test_cairo=yes
9629     ENABLE_CAIRO_CANVAS="TRUE"
9631 AC_SUBST(ENABLE_CAIRO_CANVAS)
9633 dnl ===================================================================
9634 dnl Check whether the GStreamer libraries are available.
9635 dnl ===================================================================
9637 ENABLE_GSTREAMER=""
9639 if test "$build_gstreamer" = "yes"; then
9641     AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
9642     if test "x$enable_gstreamer" != "xno"; then
9643         ENABLE_GSTREAMER="TRUE"
9644         AC_MSG_RESULT([yes])
9645         PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
9646         GSTREAMER_CFLAGS="`echo $GSTREAMER_CFLAGS | sed -e \"s/-I/${ISYSTEM}/g\"`"
9647     else
9648         AC_MSG_RESULT([no])
9649     fi
9651 AC_SUBST(GSTREAMER_CFLAGS)
9652 AC_SUBST(GSTREAMER_LIBS)
9653 AC_SUBST(ENABLE_GSTREAMER)
9656 ENABLE_GSTREAMER_0_10=""
9657 if test "$build_gstreamer_0_10" = "yes"; then
9659     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
9660     if test "x$enable_gstreamer_0_10" != "xno"; then
9661         ENABLE_GSTREAMER_0_10="TRUE"
9662         AC_MSG_RESULT([yes])
9663         PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
9664             PKG_CHECK_MODULES(  [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10] )
9665         ])
9666         GSTREAMER_0_10_CFLAGS="`echo $GSTREAMER_0_10_CFLAGS | sed -e \"s/-I/${ISYSTEM}/g\"`"
9667     else
9668         AC_MSG_RESULT([no])
9669     fi
9672 AC_SUBST(GSTREAMER_0_10_CFLAGS)
9673 AC_SUBST(GSTREAMER_0_10_LIBS)
9674 AC_SUBST(ENABLE_GSTREAMER_0_10)
9676 dnl ===================================================================
9677 dnl Check whether the OpenGL libraries are available
9678 dnl ===================================================================
9680 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
9681 ENABLE_OPENGL=
9683 if test "$_os" = "Darwin"; then
9684     # We use frameworks on Mac OS X, no need for detail checks
9685     ENABLE_OPENGL=TRUE
9686     SYSTEM_MESA_HEADERS=YES
9687     AC_MSG_RESULT([yes])
9688 else
9689     if test "x$enable_opengl" != "xno"; then
9690         if test "$_os" != "WINNT"; then
9691             save_LDFLAGS=$LDFLAGS
9692             LDFLAGS="$LDFLAGS -lm"
9693             AC_MSG_RESULT([yes])
9694             AC_CHECK_LIB([GL], [main], [:],
9695                       [AC_MSG_ERROR(libGL not installed or functional)], [])
9696             LDFLAGS="$LDFLAGS -lGL"
9697             AC_CHECK_LIB([GLU], [main], [:],
9698                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
9699             ENABLE_OPENGL=TRUE
9700             LDFLAGS=$save_LDFLAGS
9702             dnl ===================================================================
9703             dnl Check for system Mesa
9704             dnl ===================================================================
9705             AC_MSG_CHECKING([which Mesa headers to use])
9706             if test "$with_system_mesa_headers" = "yes"; then
9707                 AC_MSG_RESULT([external])
9708                 SYSTEM_MESA_HEADERS=YES
9709                 AC_LANG_PUSH(C)
9710                 AC_CHECK_HEADER(GL/glxext.h, [],
9711                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
9712                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
9713                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
9714                 AC_LANG_POP(C)
9715             else
9716                 AC_MSG_RESULT([internal])
9717                 SYSTEM_MESA_HEADERS=NO
9718                 BUILD_TYPE="$BUILD_TYPE MESA"
9719             fi
9720         else
9721             AC_MSG_RESULT([not on Windows])
9722         fi
9723     else
9724        AC_MSG_RESULT([no])
9725     fi
9728 AC_SUBST(SYSTEM_MESA_HEADERS)
9729 AC_SUBST(ENABLE_OPENGL)
9731 # presenter minimizer extension?
9732 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
9733 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
9734    AC_MSG_RESULT([yes])
9735    ENABLE_MINIMIZER=YES
9736 else
9737    AC_MSG_RESULT([no])
9738    ENABLE_MINIMIZER=NO
9739    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
9741 AC_SUBST(ENABLE_MINIMIZER)
9743 # pdf import?
9744 AC_MSG_CHECKING([whether to build the PDF import])
9745 if test "$_os" != Android -a "$_os" != iOS -a "$ENABLE_PDFIMPORT" != FALSE; then
9746   AC_MSG_RESULT([yes])
9747   ENABLE_PDFIMPORT=TRUE
9749   dnl ===================================================================
9750   dnl Check for system poppler
9751   dnl ===================================================================
9752   AC_MSG_CHECKING([which pdf backend to use])
9753   if test "$with_system_poppler" = "yes"; then
9754       AC_MSG_RESULT([external])
9755       SYSTEM_POPPLER=YES
9756       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
9757       AC_LANG_PUSH([C++])
9758       save_CXXFLAGS=$CXXFLAGS
9759       save_CPPFLAGS=$CPPFLAGS
9760       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
9761       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
9762       AC_CHECK_HEADER([cpp/poppler-version.h], [],
9763                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
9764       CXXFLAGS=$save_CXXFLAGS
9765       CPPFLAGS=$save_CPPFLAGS
9766       AC_LANG_POP([C++])
9767       libo_MINGW_CHECK_DLL([POPPLER], [libpoppler])
9768   else
9769       AC_MSG_RESULT([internal])
9770       SYSTEM_POPPLER=NO
9771       BUILD_TYPE="$BUILD_TYPE XPDF"
9772   fi
9773 else
9774   AC_MSG_RESULT([no])
9775   ENABLE_PDFIMPORT=FALSE
9777 AC_SUBST(ENABLE_PDFIMPORT)
9778 AC_SUBST(SYSTEM_POPPLER)
9779 AC_SUBST(POPPLER_CFLAGS)
9780 AC_SUBST(POPPLER_LIBS)
9781 AC_SUBST([MINGW_POPPLER_DLL])
9783 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
9784 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9785   AC_MSG_RESULT([yes])
9786   ENABLE_MEDIAWIKI=YES
9787   BUILD_TYPE="$BUILD_TYPE XSLTML"
9788   if test  "x$with_java" = "xno"; then
9789     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
9790   fi
9791 else
9792   AC_MSG_RESULT([no])
9793   ENABLE_MEDIAWIKI=NO
9794   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
9796 AC_SUBST(ENABLE_MEDIAWIKI)
9798 if test "$ENABLE_MEDIAWIKI" = "YES"; then
9799     AC_MSG_CHECKING([which Servlet API Jar to use])
9800     if test "$with_system_servlet_api" = "yes"; then
9801         AC_MSG_RESULT([external])
9802         SYSTEM_SERVLETAPI=YES
9803         if test -z "$SERVLETAPI_JAR"; then
9804             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
9805         fi
9806         AC_CHECK_FILE($SERVLETAPI_JAR, [],
9807               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
9808     else
9809         AC_MSG_RESULT([internal])
9810         SYSTEM_SERVLETAPI=NO
9811         BUILD_TYPE="$BUILD_TYPE TOMCAT"
9812     fi
9814 AC_SUBST(SYSTEM_SERVLETAPI)
9815 AC_SUBST(SERVLETAPI_JAR)
9817 AC_MSG_CHECKING([whether to build the Report Builder extension])
9818 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9819     AC_MSG_RESULT([yes])
9820     ENABLE_REPORTBUILDER=YES
9821     AC_MSG_CHECKING([which jfreereport libs to use])
9822     if test "$with_system_jfreereport" = "yes"; then
9823         SYSTEM_JFREEREPORT=YES
9824         AC_MSG_RESULT([external])
9825         if test -z $SAC_JAR; then
9826             SAC_JAR=/usr/share/java/sac.jar
9827         fi
9828         AC_CHECK_FILE($SAC_JAR, [],
9829              [AC_MSG_ERROR(sac.jar not found.)], [])
9831         if test -z $LIBXML_JAR; then
9832             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
9833                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
9834                 [
9835                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
9836                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
9837                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
9838                     )
9839                 ]
9840             )
9841         else
9842             AC_CHECK_FILE($LIBXML_JAR, [],
9843                  [AC_MSG_ERROR(libxml.jar not found.)], [])
9844         fi
9846         if test -z $FLUTE_JAR; then
9847             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
9848                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
9849                 [
9850                     AC_CHECK_FILE(/usr/share/java/flute.jar,
9851                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
9852                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
9853                     )
9854                 ]
9855             )
9856         else
9857             AC_CHECK_FILE($FLUTE_JAR, [],
9858                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
9859         fi
9861         if test -z $JFREEREPORT_JAR; then
9862             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
9863                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
9864                 [
9865                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
9866                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
9867                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
9868                     )
9869                 ]
9870             )
9871         else
9872             AC_CHECK_FILE($JFREEREPORT_JAR, [],
9873                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
9874         fi
9876         if test -z $LIBLAYOUT_JAR; then
9877             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
9878                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
9879                 [
9880                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
9881                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
9882                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
9883                     )
9884                 ]
9885             )
9886         else
9887             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
9888                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
9889         fi
9891         if test -z $LIBLOADER_JAR; then
9892             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
9893                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
9894                 [
9895                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
9896                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
9897                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
9898                     )
9899                 ]
9900             )
9901         else
9902             AC_CHECK_FILE($LIBLOADER_JAR, [],
9903                 [AC_MSG_ERROR(libloader.jar not found.)], [])
9904         fi
9906         if test -z $LIBFORMULA_JAR; then
9907             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
9908                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
9909                  [
9910                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
9911                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
9912                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
9913                      )
9914                  ]
9915             )
9916         else
9917             AC_CHECK_FILE($LIBFORMULA_JAR, [],
9918                 [AC_MSG_ERROR(libformula.jar not found.)], [])
9919         fi
9921         if test -z $LIBREPOSITORY_JAR; then
9922             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
9923                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
9924                 [
9925                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
9926                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
9927                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
9928                     )
9929                 ]
9930             )
9931         else
9932             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
9933                 [AC_MSG_ERROR(librepository.jar not found.)], [])
9934         fi
9936         if test -z $LIBFONTS_JAR; then
9937             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
9938                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
9939                 [
9940                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
9941                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
9942                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
9943                     )
9944                 ]
9945             )
9946         else
9947             AC_CHECK_FILE($LIBFONTS_JAR, [],
9948                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
9949         fi
9951         if test -z $LIBSERIALIZER_JAR; then
9952             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
9953                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
9954                 [
9955                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
9956                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
9957                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
9958                     )
9959                 ]
9960             )
9961         else
9962             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
9963                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
9964         fi
9966         if test -z $LIBBASE_JAR; then
9967             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
9968                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
9969                 [
9970                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
9971                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
9972                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
9973                     )
9974                 ]
9975             )
9976         else
9977             AC_CHECK_FILE($LIBBASE_JAR, [],
9978                 [AC_MSG_ERROR(libbase.jar not found.)], [])
9979         fi
9981     else
9982         AC_MSG_RESULT([internal])
9983         SYSTEM_JFREEREPORT=NO
9984         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
9985     fi
9986 else
9987     AC_MSG_RESULT([no])
9988     ENABLE_REPORTBUILDER=NO
9989     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
9990     SYSTEM_JFREEREPORT=NO
9992 AC_SUBST(ENABLE_REPORTBUILDER)
9993 AC_SUBST(SYSTEM_JFREEREPORT)
9994 AC_SUBST(SAC_JAR)
9995 AC_SUBST(LIBXML_JAR)
9996 AC_SUBST(FLUTE_JAR)
9997 AC_SUBST(JFREEREPORT_JAR)
9998 AC_SUBST(LIBBASE_JAR)
9999 AC_SUBST(LIBLAYOUT_JAR)
10000 AC_SUBST(LIBLOADER_JAR)
10001 AC_SUBST(LIBFORMULA_JAR)
10002 AC_SUBST(LIBREPOSITORY_JAR)
10003 AC_SUBST(LIBFONTS_JAR)
10004 AC_SUBST(LIBSERIALIZER_JAR)
10006 # this has to be here because both the Wiki Publisher and the SRB use
10007 # commons-logging
10008 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
10009     AC_MSG_CHECKING([which Apache commons-* libs to use])
10010     if test "$with_system_apache_commons" = "yes"; then
10011         SYSTEM_APACHE_COMMONS=YES
10012         AC_MSG_RESULT([external])
10013         if test "$ENABLE_MEDIAWIKI" = "YES"; then
10014             if test -z $COMMONS_CODEC_JAR; then
10015                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
10016                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
10017                     [
10018                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
10019                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
10020                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
10021                         )
10022                     ]
10023                 )
10024             else
10025                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
10026                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
10027             fi
10029             if test -z $COMMONS_LANG_JAR; then
10030                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
10031                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
10032                     [
10033                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
10034                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
10035                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
10036                             )
10037                     ]
10038                 )
10039             else
10040                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
10041                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
10042             fi
10044             if test -z $COMMONS_HTTPCLIENT_JAR; then
10045                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
10046                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
10047                     [
10048                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
10049                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
10050                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
10051                         )
10052                     ]
10053                 )
10054             else
10055                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
10056                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
10057             fi
10058         fi
10059         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
10060             if test -z $COMMONS_LOGGING_JAR; then
10061                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
10062                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
10063                    [
10064                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
10065                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
10066                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
10067                         )
10068                     ]
10069                 )
10070             else
10071                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
10072                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
10073             fi
10074         fi
10075     else
10076         AC_MSG_RESULT([internal])
10077         SYSTEM_APACHE_COMMONS=NO
10078         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
10079     fi
10081 AC_SUBST(SYSTEM_APACHE_COMMONS)
10082 AC_SUBST(COMMONS_CODEC_JAR)
10083 AC_SUBST(COMMONS_LANG_JAR)
10084 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
10085 AC_SUBST(COMMONS_LOGGING_JAR)
10087 # scripting provider for BeanShell?
10088 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10089 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10090    AC_MSG_RESULT([yes])
10091    ENABLE_SCRIPTING_BEANSHELL=YES
10093    dnl ===================================================================
10094    dnl Check for system beanshell
10095    dnl ===================================================================
10096    AC_MSG_CHECKING([which beanshell to use])
10097    if test "$with_system_beanshell" = "yes"; then
10098        AC_MSG_RESULT([external])
10099        SYSTEM_BSH=YES
10100        if test -z $BSH_JAR; then
10101            BSH_JAR=/usr/share/java/bsh.jar
10102        fi
10103        AC_CHECK_FILE($BSH_JAR, [],
10104                   [AC_MSG_ERROR(bsh.jar not found.)], [])
10105    else
10106        AC_MSG_RESULT([internal])
10107        SYSTEM_BSH=NO
10108        BUILD_TYPE="$BUILD_TYPE BSH"
10109    fi
10110 else
10111    AC_MSG_RESULT([no])
10112    ENABLE_SCRIPTING_BEANSHELL=NO
10113    SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10115 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10116 AC_SUBST(SYSTEM_BSH)
10117 AC_SUBST(BSH_JAR)
10119 # scripting provider for JavaScript?
10120 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10121 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10122    AC_MSG_RESULT([yes])
10123    ENABLE_SCRIPTING_JAVASCRIPT=YES
10125    dnl ===================================================================
10126    dnl Check for system rhino
10127    dnl ===================================================================
10128    AC_MSG_CHECKING([which rhino to use])
10129    if test "$with_system_rhino" = "yes"; then
10130        AC_MSG_RESULT([external])
10131        SYSTEM_RHINO=YES
10132        if test -z $RHINO_JAR; then
10133            RHINO_JAR=/usr/share/java/js.jar
10134        fi
10135        AC_CHECK_FILE($RHINO_JAR, [],
10136                   [AC_MSG_ERROR(js.jar not found.)], [])
10137    else
10138        AC_MSG_RESULT([internal])
10139        SYSTEM_RHINO=NO
10140        BUILD_TYPE="$BUILD_TYPE RHINO"
10141    fi
10142 else
10143    AC_MSG_RESULT([no])
10144    ENABLE_SCRIPTING_JAVASCRIPT=NO
10145    SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10147 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10148 AC_SUBST(SYSTEM_RHINO)
10149 AC_SUBST(RHINO_JAR)
10151 dnl Scripting provider for Python extension?
10152 dnl We always provide this unless we have disabled Python completely
10153 if test $enable_python = no; then
10154     ENABLE_SCRIPTING_PYTHON=NO
10155     SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_PYTHON"
10156 else
10157     ENABLE_SCRIPTING_PYTHON=YES
10159 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
10161 supports_multilib=
10162 case "$host_cpu" in
10163 x86_64 | powerpc64 | s390x)
10164     if test "$SIZEOF_LONG" = "8"; then
10165         supports_multilib="yes"
10166     fi
10167     ;;
10169     ;;
10170 esac
10172 dnl ===================================================================
10173 dnl Check whether the TQt and TDE libraries are available.
10174 dnl ===================================================================
10176 TDE_CFLAGS=""
10177 TDE_LIBS=""
10178 if test "$_os" != "OpenBSD"; then
10179     MOC="moc"
10181 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
10182     dnl Search paths for TQt and TDE
10183     if test -z "$supports_multilib"; then
10184         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"
10185         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"
10186     else
10187         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"
10188         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"
10189     fi
10190     if test -n "$TQTDIR"; then
10191         tqt_incdirs="$TQTDIR/include $tqt_incdirs"
10192         if test -z "$supports_multilib"; then
10193             tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
10194         else
10195             tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
10196         fi
10197     fi
10198     if test -z "$supports_multilib"; then
10199         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"
10200         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"
10201     else
10202         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"
10203         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"
10204     fi
10205     if test -n "$TDEDIR"; then
10206         tde_incdirs="$TDEDIR/include $tde_incdirs"
10207         if test -z "$supports_multilib"; then
10208             tde_libdirs="$TDEDIR/lib $tde_libdirs"
10209         else
10210             tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
10211         fi
10212     fi
10214     dnl What to test
10215     tqt_test_include="ntqstyle.h"
10216     tde_test_include="kapp.h"
10218     if test "$_os" != "OpenBSD"; then
10219         tqt_test_library="libtqt-mt.so"
10220         tde_test_library="libDCOP.so"
10221     else
10222         tqt_test_library="libtqt-mt.so*"
10223         tde_test_library="libDCOP.so*"
10224     fi
10226     dnl Check for TQt headers
10227     AC_MSG_CHECKING([for TQt headers])
10228     tqt_incdir="no"
10229     for tde_check in $tqt_incdirs; do
10230         if test -r "$tde_check/$tqt_test_include"; then
10231             tqt_incdir="$tde_check"
10232             break
10233         fi
10234     done
10235     AC_MSG_RESULT([$tqt_incdir])
10236     if test "x$tqt_incdir" = "xno"; then
10237         AC_MSG_ERROR([TQt headers not found.  Please specify the root of
10238 your TQt installation by exporting TQTDIR before running "configure".])
10239     fi
10241     dnl Check for TQt libraries
10242     AC_MSG_CHECKING([for TQt libraries])
10243     tqt_libdir="no"
10244     for tqt_check in $tqt_libdirs; do
10245         if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
10246             tqt_libdir="$tqt_check"
10247             break
10248         fi
10249     done
10250     AC_MSG_RESULT([$tqt_libdir])
10251     if test "x$tqt_libdir" = "xno"; then
10252         AC_MSG_ERROR([TQt libraries not found.  Please specify the root of
10253 your TQt installation by exporting TQTDIR before running "configure".])
10254     fi
10256     dnl Check for Meta Object Compiler
10257     AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
10258     if test "$MOC" = "no"; then
10259         AC_MSG_ERROR([TQt Meta Object Compiler not found.  Please specify
10260 the root of your TQt installation by exporting TQTDIR before running "configure".])
10261     fi
10263     dnl Check for TDE headers
10264     AC_MSG_CHECKING([for TDE headers])
10265     tde_incdir="no"
10266     for tde_check in $tde_incdirs; do
10267         if test -r "$tde_check/$tde_test_include"; then
10268             tde_incdir="$tde_check"
10269             break
10270         fi
10271     done
10272     AC_MSG_RESULT([$tde_incdir])
10273     if test "x$tde_incdir" = "xno"; then
10274         AC_MSG_ERROR([TDE headers not found.  Please specify the root of
10275 your TDE installation by exporting TDEDIR before running "configure".])
10276     fi
10278     dnl Check for TDE libraries
10279     AC_MSG_CHECKING([for TDE libraries])
10280     tde_libdir="no"
10281     for tde_check in $tde_libdirs; do
10282         if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
10283             tde_libdir="$tde_check"
10284             break
10285         fi
10286     done
10287     AC_MSG_RESULT([$tde_libdir])
10288     if test "x$tde_libdir" = "xno"; then
10289         AC_MSG_ERROR([TDE libraries not found.  Please specify the root of
10290 your TDE installation by exporting TDEDIR before running "configure".])
10291     fi
10293     dnl Set the variables
10294     TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10295     TDE_LIBS="-L$tde_libdir -L$tqt_libdir -lkio -ltdeui -ltdecore -ltqt -ltqt-mt"
10297 AC_SUBST(TDE_CFLAGS)
10298 AC_SUBST(TDE_LIBS)
10299 AC_SUBST(MOC)
10301 dnl ===================================================================
10302 dnl Check whether the Qt3 and KDE3 libraries are available.
10303 dnl ===================================================================
10305 KDE_CFLAGS=""
10306 KDE_LIBS=""
10307 if test "$_os" != "OpenBSD"; then
10308     MOC="moc"
10310 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE"; then
10311     dnl Search paths for Qt3 and KDE3
10312     if test -z "$supports_multilib"; then
10313         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"
10314         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"
10315     else
10316         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"
10317         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"
10318     fi
10319     if test -n "$QTDIR"; then
10320         qt_incdirs="$QTDIR/include $qt_incdirs"
10321         if test -z "$supports_multilib"; then
10322             qt_libdirs="$QTDIR/lib $qt_libdirs"
10323         else
10324             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
10325         fi
10326     fi
10327     if test -z "$supports_multilib"; then
10328         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"
10329         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"
10330     else
10331         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"
10332         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"
10333     fi
10334     if test -n "$KDEDIR"; then
10335         kde_incdirs="$KDEDIR/include $kde_incdirs"
10336         if test -z "$supports_multilib"; then
10337             kde_libdirs="$KDEDIR/lib $kde_libdirs"
10338         else
10339             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
10340         fi
10341     fi
10343     dnl What to test
10344     qt_test_include="qstyle.h"
10345     kde_test_include="kapp.h"
10347     if test "$_os" != "OpenBSD"; then
10348         qt_test_library="libqt-mt.so"
10349         kde_test_library="libDCOP.so"
10350     else
10351         qt_test_library="libqt-mt.so*"
10352         kde_test_library="libDCOP.so*"
10353     fi
10355     dnl Check for Qt3 headers
10356     AC_MSG_CHECKING([for Qt3 headers])
10357     qt_incdir="no"
10358     for kde_check in $qt_incdirs; do
10359         if test -r "$kde_check/$qt_test_include"; then
10360             qt_incdir="$kde_check"
10361             break
10362         fi
10363     done
10364     AC_MSG_RESULT([$qt_incdir])
10365     if test "x$qt_incdir" = "xno"; then
10366         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
10367 your Qt3 installation by exporting QTDIR before running "configure".])
10368     fi
10370     dnl Check for Qt3 libraries
10371     AC_MSG_CHECKING([for Qt3 libraries])
10372     qt_libdir="no"
10373     for qt_check in $qt_libdirs; do
10374         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`"; then
10375             qt_libdir="$qt_check"
10376             break
10377         fi
10378     done
10379     AC_MSG_RESULT([$qt_libdir])
10380     if test "x$qt_libdir" = "xno"; then
10381         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
10382 your Qt3 installation by exporting QTDIR before running "configure".])
10383     fi
10385     dnl Check for Meta Object Compiler
10386     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
10387     if test "$MOC" = "no"; then
10388         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
10389 the root of your Qt3 installation by exporting QTDIR before running "configure".])
10390     fi
10392     dnl Check for KDE3 headers
10393     AC_MSG_CHECKING([for KDE3 headers])
10394     kde_incdir="no"
10395     for kde_check in $kde_incdirs; do
10396         if test -r "$kde_check/$kde_test_include"; then
10397             kde_incdir="$kde_check"
10398             break
10399         fi
10400     done
10401     AC_MSG_RESULT([$kde_incdir])
10402     if test "x$kde_incdir" = "xno"; then
10403         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
10404 your KDE3 installation by exporting KDEDIR before running "configure".])
10405     fi
10407     dnl Check for KDE3 libraries
10408     AC_MSG_CHECKING([for KDE3 libraries])
10409     kde_libdir="no"
10410     for kde_check in $kde_libdirs; do
10411         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`"; then
10412             kde_libdir="$kde_check"
10413             break
10414         fi
10415     done
10416     AC_MSG_RESULT([$kde_libdir])
10417     if test "x$kde_libdir" = "xno"; then
10418         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
10419 your KDE3 installation by exporting KDEDIR before running "configure".])
10420     fi
10422     dnl Set the variables
10423     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10424     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
10426 AC_SUBST(KDE_CFLAGS)
10427 AC_SUBST(KDE_LIBS)
10428 AC_SUBST(MOC)
10430 dnl ===================================================================
10431 dnl KDE4 Integration
10432 dnl ===================================================================
10434 KDE4_CFLAGS=""
10435 KDE4_LIBS=""
10436 QMAKE4="qmake"
10437 MOC4="moc"
10438 KDE_GLIB_CFLAGS=""
10439 KDE_GLIB_LIBS=""
10440 KDE_HAVE_GLIB=""
10441 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10442     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10443     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10445     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
10446     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10448     if test -n "$supports_multilib"; then
10449         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10450         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10451     fi
10453     if test -n "$QTDIR"; then
10454         qt_incdirs="$QTDIR/include $qt_incdirs"
10455         if test -z "$supports_multilib"; then
10456             qt_libdirs="$QTDIR/lib $qt_libdirs"
10457         else
10458             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
10459         fi
10460     fi
10461     if test -n "$QT4DIR"; then
10462         qt_incdirs="$QT4DIR/include $qt_incdirs"
10463         if test -z "$supports_multilib"; then
10464             qt_libdirs="$QT4DIR/lib $qt_libdirs"
10465         else
10466             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
10467         fi
10468     fi
10470     if test -n "$KDEDIR"; then
10471         kde_incdirs="$KDEDIR/include $kde_incdirs"
10472         if test -z "$supports_multilib"; then
10473             kde_libdirs="$KDEDIR/lib $kde_libdirs"
10474         else
10475             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
10476         fi
10477     fi
10478     if test -n "$KDE4DIR"; then
10479         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
10480         if test -z "$supports_multilib"; then
10481             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
10482         else
10483             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
10484         fi
10485     fi
10487     qt_test_include="Qt/qobject.h"
10488     qt_test_library="libQtCore.so"
10489     kde_test_include="kwindowsystem.h"
10490     kde_test_library="libsolid.so"
10492     AC_MSG_CHECKING([for Qt4 headers])
10493     qt_header_dir="no"
10494     for inc_dir in $qt_incdirs; do
10495         if test -r "$inc_dir/$qt_test_include"; then
10496             qt_header_dir="$inc_dir"
10497             break
10498         fi
10499     done
10501     AC_MSG_RESULT([$qt_header_dir])
10502     if test "x$qt_header_dir" = "xno"; then
10503         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10504     fi
10506     dnl Check for qmake
10507     AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
10508     QMAKE4="$QMAKEQT4"
10509     if test "$QMAKE4" = "no"; then
10510         AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
10511         if test "$QMAKE4" = "no"; then
10512             AC_MSG_ERROR([Qmake not found.  Please specify
10513 the root of your Qt installation by exporting QT4DIR before running "configure".])
10514         fi
10515     fi
10517     qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
10518     AC_MSG_CHECKING([for Qt4 libraries])
10519     qt_lib_dir="no"
10520     for lib_dir in $qt_libdirs; do
10521         if test -r "$lib_dir/$qt_test_library"; then
10522             qt_lib_dir="$lib_dir"
10523             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
10524             break
10525         fi
10526     done
10528     AC_MSG_RESULT([$qt_lib_dir])
10530     if test "x$qt_lib_dir" = "xno"; then
10531         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10532     fi
10534     dnl Check for Meta Object Compiler
10536     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10537     MOC4="$MOCQT4"
10538     if test "$MOC4" = "no"; then
10539         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10540         if test "$MOC4" = "no"; then
10541             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
10542 the root of your Qt installation by exporting QT4DIR before running "configure".])
10543         fi
10544     fi
10546     dnl Check for KDE4 headers
10547     AC_MSG_CHECKING([for KDE4 headers])
10548     kde_incdir="no"
10549     for kde_check in $kde_incdirs; do
10550         if test -r "$kde_check/$kde_test_include"; then
10551             kde_incdir="$kde_check"
10552             break
10553         fi
10554     done
10555     AC_MSG_RESULT([$kde_incdir])
10556     if test "x$kde_incdir" = "xno"; then
10557         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10558     fi
10560     dnl Check for KDE4 libraries
10561     AC_MSG_CHECKING([for KDE4 libraries])
10562     kde_libdir="no"
10563     for kde_check in $kde_libdirs; do
10564         if test -r "$kde_check/$kde_test_library"; then
10565             kde_libdir="$kde_check"
10566             break
10567         fi
10568     done
10570     AC_MSG_RESULT([$kde_libdir])
10571     if test "x$kde_libdir" = "xno"; then
10572         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10573     fi
10575     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10576     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkio -lkfile -lkdeui -lkdecore -lQtCore -lQtGui"
10578     AC_LANG_PUSH([C++])
10579     save_CXXFLAGS=$CXXFLAGS
10580     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
10581     AC_MSG_CHECKING([whether KDE is >= 4.2])
10582        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10583 #include <kdeversion.h>
10585 int main(int argc, char **argv) {
10586        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
10587        else return 1;
10589        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
10590     CXXFLAGS=$save_CXXFLAGS
10591     AC_LANG_POP([C++])
10593    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
10594     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
10595         [KDE_HAVE_GLIB=1],
10596         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
10598 AC_SUBST(KDE4_CFLAGS)
10599 AC_SUBST(KDE4_LIBS)
10600 AC_SUBST(MOC4)
10601 AC_SUBST(KDE_GLIB_CFLAGS)
10602 AC_SUBST(KDE_GLIB_LIBS)
10603 AC_SUBST(KDE_HAVE_GLIB)
10605 dnl ===================================================================
10606 dnl Test for the enabling the lockdown pieces
10607 dnl ===================================================================
10608 AC_MSG_CHECKING([whether to enable the lockdown pieces])
10609 ENABLE_LOCKDOWN=""
10610 if test -n "$enable_lockdown" -a "$enable_lockdown" != "no"; then
10611     ENABLE_LOCKDOWN=YES
10612     AC_MSG_RESULT([yes])
10613 else
10614     AC_MSG_RESULT([no])
10616 AC_SUBST(ENABLE_LOCKDOWN)
10618 dnl ===================================================================
10619 dnl Test whether to include Evolution 2 support
10620 dnl ===================================================================
10621 AC_MSG_CHECKING([whether to enable evolution 2 support])
10622 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
10623     AC_MSG_RESULT([yes])
10624     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
10625     ENABLE_EVOAB2="TRUE"
10626 else
10627     ENABLE_EVOAB2=""
10628     AC_MSG_RESULT([no])
10630 AC_SUBST(ENABLE_EVOAB2)
10631 AC_SUBST(GOBJECT_CFLAGS)
10632 AC_SUBST(GOBJECT_LIBS)
10634 dnl ===================================================================
10635 dnl Test whether to include TDE AB support
10636 dnl ===================================================================
10637 AC_MSG_CHECKING([whether to enable TDE address book support])
10638 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
10639     AC_MSG_RESULT([yes])
10640     AC_LANG_PUSH([C++])
10641     save_CXXFLAGS=$CXXFLAGS
10642     CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
10643     AC_MSG_CHECKING([whether TDE is at least R14.0])
10644        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10645 #include <tdeversion.h>
10647 int main(int argc, char **argv) {
10648        if (TDE_VERSION_MAJOR >= 14) return 0;
10649        else return 1;
10651        ]])],[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])],[])
10652     CXXFLAGS=$save_CXXFLAGS
10653     AC_LANG_POP([C++])
10654     ENABLE_TDEAB=TRUE
10655 else
10656     AC_MSG_RESULT([no])
10657     ENABLE_TDEAB=
10659 AC_SUBST(ENABLE_TDEAB)
10661 dnl ===================================================================
10662 dnl Test whether to include KDE AB support
10663 dnl ===================================================================
10664 AC_MSG_CHECKING([whether to enable KDE address book support])
10665 if test "$enable_kdeab" = "yes" -a "$enable_kde" = "yes"; then
10666     AC_MSG_RESULT([yes])
10667     AC_LANG_PUSH([C++])
10668     save_CXXFLAGS=$CXXFLAGS
10669     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
10670     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
10671        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10672 #include <kdeversion.h>
10674 int main(int argc, char **argv) {
10675        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
10676        else return 1;
10678        ]])],[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])],[])
10679     CXXFLAGS=$save_CXXFLAGS
10680     AC_LANG_POP([C++])
10681     ENABLE_KAB=TRUE
10682 else
10683     AC_MSG_RESULT([no])
10684     ENABLE_KAB=
10686 AC_SUBST(ENABLE_KAB)
10688 dnl ===================================================================
10689 dnl Test whether to include MathMLDTD
10690 dnl ===================================================================
10691 AC_MSG_CHECKING([whether to include MathMLDTD])
10692 if test -n "$enable_mathmldtd"; then
10693     if test "$enable_mathmldtd" = "no"; then
10694         AC_MSG_RESULT([no])
10695         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10696     else
10697         AC_MSG_RESULT([yes])
10698         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
10699     fi
10700 else
10701     AC_MSG_RESULT([no])
10702     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10705 dnl ===================================================================
10706 dnl Test which themes to include
10707 dnl ===================================================================
10708 AC_MSG_CHECKING([which themes to include])
10709 # if none given use default subset of available themes
10710 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
10711     with_theme="crystal default hicontrast oxygen tango"
10712     test "$ENABLE_RELEASE_BUILD" = "FALSE" && with_theme="$with_theme tango_testing"
10715 WITH_THEMES=""
10716 for theme in $with_theme; do
10717     case $theme in
10718         crystal|default|galaxy|hicontrast|human|industrial|oxygen|tango|tango_testing) : ;;
10719         *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
10720     esac
10721     WITH_THEMES="$WITH_THEMES $theme"
10722     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
10723 done
10724 AC_MSG_RESULT([$WITH_THEMES])
10725 AC_SUBST([WITH_THEMES])
10727 dnl ===================================================================
10728 dnl Test whether to integrate helppacks into the product's installer
10729 dnl ===================================================================
10730 AC_MSG_CHECKING([for helppack integration])
10731 if test "$with_helppack_integration" = "no"; then
10732     WITH_HELPPACK_INTEGRATION=NO
10733     AC_MSG_RESULT([no integration])
10734 else
10735     WITH_HELPPACK_INTEGRATION=YES
10736     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
10737     AC_MSG_RESULT([integration])
10739 AC_SUBST(WITH_HELPPACK_INTEGRATION)
10741 dnl ===================================================================
10742 dnl Test whether to use CoreText framework
10743 dnl ===================================================================
10744 ENABLE_CORETEXT=NO
10745 if test "$_os" = "Darwin"; then
10746     AC_MSG_CHECKING([whether to use CoreText framework])
10747     if test "$enable_coretext" = yes -o "$BITNESS_OVERRIDE" = 64; then
10748         AC_MSG_RESULT([yes])
10749         ENABLE_CORETEXT=YES
10750     else
10751         AC_MSG_RESULT([no])
10752     fi
10754 AC_SUBST(ENABLE_CORETEXT)
10756 ###############################################################################
10757 # Extensions checking
10758 ###############################################################################
10759 dnl ===================================================================
10760 dnl Test whether to integrate extensions into the product's installer
10761 dnl ===================================================================
10762 AC_MSG_CHECKING([for extensions integration])
10763 if test "x$enable_extension_integration" != "xno"; then
10764     WITH_EXTENSION_INTEGRATION=YES
10765     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
10766     AC_MSG_RESULT([yes, use integration])
10767 else
10768     WITH_EXTENSION_INTEGRATION=NO
10769     AC_MSG_RESULT([no, do not integrate])
10771 AC_SUBST(WITH_EXTENSION_INTEGRATION)
10773 dnl Should any extra extensions be included?
10774 dnl There are standalone tests for each of these below.
10775 WITH_EXTRA_EXTENSIONS=
10776 AC_SUBST([WITH_EXTRA_EXTENSIONS])
10778 dnl ===================================================================
10779 dnl Test whether to include Watch Window extension
10780 dnl ===================================================================
10781 AC_MSG_CHECKING([for Watch Window extension integration])
10782 WATCH_WINDOW_EXTENSION_PACK=
10783 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10784     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
10785     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
10786     WITH_EXTRA_EXTENSIONS=YES
10787     AC_MSG_RESULT([yes])
10788 else
10789     AC_MSG_RESULT([no])
10791 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
10793 dnl ===================================================================
10794 dnl Test whether to include SmART Gallery (Diagram) extension
10795 dnl ===================================================================
10796 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
10797 DIAGRAM_EXTENSION_PACK=
10798 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10799     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
10800     DIAGRAM_EXTENSION_PACK="8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt"
10801     WITH_EXTRA_EXTENSIONS=YES
10802     AC_MSG_RESULT([yes])
10803 else
10804     AC_MSG_RESULT([no])
10806 AC_SUBST(DIAGRAM_EXTENSION_PACK)
10808 dnl ===================================================================
10809 dnl Test whether to include Validator extension
10810 dnl ===================================================================
10811 AC_MSG_CHECKING([for Validator extension integration])
10812 VALIDATOR_EXTENSION_PACK=
10813 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10814     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
10815     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
10816     WITH_EXTRA_EXTENSIONS=YES
10817     AC_MSG_RESULT([yes])
10818 else
10819     AC_MSG_RESULT([no])
10821 AC_SUBST(VALIDATOR_EXTENSION_PACK)
10823 dnl ===================================================================
10824 dnl Test whether to include Barcode extension
10825 dnl ===================================================================
10826 AC_MSG_CHECKING([for Barcode extension integration])
10827 BARCODE_EXTENSION_PACK=
10828 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10829     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
10830     BARCODE_EXTENSION_PACK="3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt"
10831     WITH_EXTRA_EXTENSIONS=YES
10832     AC_MSG_RESULT([yes])
10833 else
10834     AC_MSG_RESULT([no])
10836 AC_SUBST([BARCODE_EXTENSION_PACK])
10838 dnl ===================================================================
10839 dnl Test whether to include ConvertTextToNumber extension
10840 dnl ===================================================================
10841 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
10842 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10843     BUILD_TYPE="$BUILD_TYPE CT2N"
10844     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
10845     AC_MSG_RESULT([yes])
10846 else
10847     AC_MSG_RESULT([no])
10850 dnl ===================================================================
10851 dnl Test whether to include Numbertext extension
10852 dnl ===================================================================
10853 AC_MSG_CHECKING([for Numbertext extension integration])
10854 NUMBERTEXT_EXTENSION_PACK=
10855 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10856     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
10857     NUMBERTEXT_EXTENSION_PACK="b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt"
10858     WITH_EXTRA_EXTENSIONS=YES
10859     AC_MSG_RESULT([yes])
10860 else
10861     AC_MSG_RESULT([no])
10863 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
10865 dnl ===================================================================
10866 dnl Test whether to include Hungarian Cross-reference Toolbar extension
10867 dnl ===================================================================
10868 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
10869 HUNART_EXTENSION_PACK=
10870 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10871     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
10872     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
10873     WITH_EXTRA_EXTENSIONS=YES
10874     AC_MSG_RESULT([yes])
10875 else
10876     AC_MSG_RESULT([no])
10878 AC_SUBST(HUNART_EXTENSION_PACK)
10880 dnl ===================================================================
10881 dnl Test whether to include Typography Toolbar extension
10882 dnl ===================================================================
10883 AC_MSG_CHECKING([for Typography Toolbar extension integration])
10884 TYPO_EXTENSION_PACK=
10885 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10886     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
10887     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
10888     WITH_EXTRA_EXTENSIONS=YES
10889     AC_MSG_RESULT([yes])
10890 else
10891     AC_MSG_RESULT([no])
10893 AC_SUBST(TYPO_EXTENSION_PACK)
10895 dnl ===================================================================
10896 dnl Test whether to include Google Docs extension
10897 dnl ===================================================================
10898 AC_MSG_CHECKING([for Google Docs extension integration])
10899 GOOGLE_DOCS_EXTENSION_PACK=
10900 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10901     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
10902     GOOGLE_DOCS_EXTENSION_PACK="27211596cf0ad97cab7321239406fde0-gdocs_3.0.1_modified.oxt"
10903     WITH_EXTRA_EXTENSIONS=YES
10904     AC_MSG_RESULT([yes])
10905 else
10906     AC_MSG_RESULT([no])
10908 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
10910 dnl ===================================================================
10911 dnl Test whether to include NLPSolver extension
10912 dnl ===================================================================
10913 AC_MSG_CHECKING([for NLPSolver extension integration])
10914 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10915     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
10916     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
10917     AC_MSG_RESULT([yes])
10918 else
10919     AC_MSG_RESULT([no])
10922 dnl ===================================================================
10923 dnl Test whether to include LanguageTool extension
10924 dnl ===================================================================
10925 AC_MSG_CHECKING([for LanguageTool extension integration])
10926 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10927     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
10928     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
10929     AC_MSG_RESULT([yes])
10930 else
10931     AC_MSG_RESULT([no])
10934 dnl ===================================================================
10935 dnl Test whether to include Sun Professional Template Pack
10936 dnl ===================================================================
10937 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
10938 if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
10939     AC_MSG_RESULT([no integration])
10940 else
10941     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
10942     sun_supported_langs="en-US de it fr es hu"
10943     if test "$with_sun_templates" = "yes"; then
10944         wanted_sun_templates="$sun_supported_langs"
10945     else
10946         # check whether the langs are supported by Sun
10947         wanted_sun_templates=
10948         for lang in $with_sun_templates; do
10949             if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
10950                 wanted_sun_templates="$wanted_sun_templates $lang"
10951             fi
10952         done
10953     fi
10954     SUNTEMPLATES_LANG=
10955     SUNTEMPLATES_DE_PACK=
10956     SUNTEMPLATES_EN_US_PACK=
10957     SUNTEMPLATES_ES_PACK=
10958     SUNTEMPLATES_FR_PACK=
10959     SUNTEMPLATES_HU_PACK=
10960     SUNTEMPLATES_IT_PACK=
10961     # check whether the langs are requested at all
10962     for lang in $wanted_sun_templates; do
10963     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
10964         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
10965         case $lang in
10966         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
10967         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
10968         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
10969         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
10970         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
10971         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
10972         esac
10973     fi
10974     done
10975     WITH_EXTRA_EXTENSIONS=YES
10976     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
10978 AC_SUBST(SUNTEMPLATES_DE_PACK)
10979 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
10980 AC_SUBST(SUNTEMPLATES_ES_PACK)
10981 AC_SUBST(SUNTEMPLATES_FR_PACK)
10982 AC_SUBST(SUNTEMPLATES_HU_PACK)
10983 AC_SUBST(SUNTEMPLATES_IT_PACK)
10985 dnl ===================================================================
10986 dnl Test whether to include fonts
10987 dnl ===================================================================
10988 AC_MSG_CHECKING([whether to include third-party fonts])
10989 if test "$with_fonts" != "no"; then
10990     AC_MSG_RESULT([yes])
10991     WITH_FONTS=YES
10992     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
10993 else
10994     AC_MSG_RESULT([no])
10995     WITH_FONTS=NO
10996     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
10998 AC_SUBST(WITH_FONTS)
11001 # The agfa monotype fonts options seems broken
11002 # there is no assocaited entry in Makefile.fetch
11003 # so we do not fetch the dependencies
11004 # there is no tie-up with MORE_FONTS, but in dmake mode
11005 # without more_fonts that option is meaningless
11006 # so I suspect it is not really used anymore, commenting out for now
11007 #AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
11008 #if test "$with_agfa_monotype_fonts" = "yes"; then
11009 #    AC_MSG_RESULT([yes])
11010 #    WITH_AGFA_MONOTYPE_FONTS=YES
11011 #    SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
11012 #    BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
11013 #else
11014 #    AC_MSG_RESULT([no])
11015 #    WITH_AGFA_MONOTYPE_FONTS=NO
11017 #AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
11019 dnl ===================================================================
11020 dnl Test whether to include ppds
11021 dnl ===================================================================
11022 AC_MSG_CHECKING([whether to include PPDs])
11023 if test "$with_ppds" != "no"; then
11024     AC_MSG_RESULT([yes])
11025 else
11026     AC_MSG_RESULT([no])
11027     WITHOUT_PPDS=YES
11028     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
11030 AC_SUBST(WITHOUT_PPDS)
11032 dnl ===================================================================
11033 dnl Test whether to include afms
11034 dnl ===================================================================
11035 AC_MSG_CHECKING([whether to include AFMs])
11036 if test "$with_afms" != "no"; then
11037     AC_MSG_RESULT([yes])
11038     BUILD_TYPE="$BUILD_TYPE AFMS"
11039 else
11040     AC_MSG_RESULT([no])
11041     WITHOUT_AFMS=YES
11042     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
11044 AC_SUBST(WITHOUT_AFMS)
11046 dnl ===================================================================
11047 dnl Test whether to include extra galleries
11048 dnl ===================================================================
11049 AC_MSG_CHECKING([whether to include extra galleries])
11050 if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
11051     AC_MSG_RESULT([no])
11052     WITH_EXTRA_GALLERY=NO
11053     OOOP_GALLERY_PACK=""
11054 else
11055     AC_MSG_RESULT([yes])
11056     WITH_EXTRA_GALLERY=YES
11057     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
11058     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
11059     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
11061 AC_SUBST(WITH_EXTRA_GALLERY)
11062 AC_SUBST(OOOP_GALLERY_PACK)
11064 dnl ===================================================================
11065 dnl Test whether to include extra templates
11066 dnl ===================================================================
11067 AC_MSG_CHECKING([whether to include extra templates])
11068 if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
11069     AC_MSG_RESULT([no])
11070     WITH_EXTRA_TEMPLATE=NO
11071     OOOP_TEMPLATES_PACK=""
11072 else
11073     AC_MSG_RESULT([yes])
11074     WITH_EXTRA_TEMPLATE=YES
11075     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
11076     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
11077     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
11079 AC_SUBST(WITH_EXTRA_TEMPLATE)
11080 AC_SUBST(OOOP_TEMPLATES_PACK)
11082 dnl ===================================================================
11083 dnl Test whether to include extra samples
11084 dnl ===================================================================
11085 AC_MSG_CHECKING([whether to include extra samples])
11086 if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
11087     AC_MSG_RESULT([no])
11088     WITH_EXTRA_SAMPLE=NO
11089     OOOP_SAMPLES_PACK=""
11090 else
11091     AC_MSG_RESULT([yes])
11092     WITH_EXTRA_SAMPLE=YES
11093     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
11094     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
11095     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
11097 AC_SUBST(WITH_EXTRA_SAMPLE)
11098 AC_SUBST(OOOP_SAMPLES_PACK)
11100 dnl ===================================================================
11101 dnl Test whether to include extra fonts
11102 dnl ===================================================================
11103 AC_MSG_CHECKING([whether to include extra fonts])
11104 if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
11105     AC_MSG_RESULT([no])
11106     WITH_EXTRA_FONT=NO
11107     OOOP_FONTS_PACK=""
11108 else
11109     AC_MSG_RESULT([yes])
11110     WITH_EXTRA_FONT=YES
11111     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
11112     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
11113     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
11115 AC_SUBST(WITH_EXTRA_FONT)
11116 AC_SUBST(OOOP_FONTS_PACK)
11118 dnl ===================================================================
11119 dnl Test whether to enable online update service
11120 dnl ===================================================================
11121 AC_MSG_CHECKING([whether to enable online update])
11122 ENABLE_ONLINE_UPDATE=
11123 if test "$enable_online_update" = ""; then
11124     if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11125         AC_MSG_RESULT([yes])
11126         ENABLE_ONLINE_UPDATE="TRUE"
11127     else
11128         AC_MSG_RESULT([no])
11129     fi
11130 else
11131     if test "$enable_online_update" = "yes"; then
11132         AC_MSG_RESULT([yes])
11133         ENABLE_ONLINE_UPDATE="TRUE"
11134     else
11135         AC_MSG_RESULT([no])
11136     fi
11138 AC_SUBST(ENABLE_ONLINE_UPDATE)
11140 dnl ===================================================================
11141 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11142 dnl ===================================================================
11143 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11144 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11145     AC_MSG_RESULT([no])
11146     ENABLE_SILENT_MSI="FALSE"
11147 else
11148     AC_MSG_RESULT([yes])
11149     ENABLE_SILENT_MSI="TRUE"
11150     SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11152 AC_SUBST(ENABLE_SILENT_MSI)
11154 AC_MSG_CHECKING([whether and how to use Xinerama])
11155 if test "$_os" = "Darwin"; then
11156     USE_XINERAMA=YES
11157     XINERAMA_LINK=dynamic
11158     AC_MSG_RESULT([yes])
11159 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11160     if test "$x_libraries" = "default_x_libraries"; then
11161         XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11162         if test "x$XINERAMALIB" = x; then
11163            XINERAMALIB="/usr/lib"
11164         fi
11165     else
11166         XINERAMALIB="$x_libraries"
11167     fi
11168     if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11169         # we have both versions, let the user decide but use the dynamic one
11170         # per default
11171         USE_XINERAMA=YES
11172         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11173             XINERAMA_LINK=dynamic
11174         else
11175             XINERAMA_LINK=static
11176         fi
11177     elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11178         # we have only the dynamic version
11179         USE_XINERAMA=YES
11180         XINERAMA_LINK=dynamic
11181     elif test -e "$XINERAMALIB/libXinerama.a"; then
11182         # static version
11183         if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11184             USE_XINERAMA=YES
11185             XINERAMA_LINK=static
11186         else
11187             USE_XINERAMA=NO
11188             XINERAMA_LINK=none
11189         fi
11190     else
11191         # no Xinerama
11192         USE_XINERAMA=NO
11193         XINERAMA_LINK=none
11194     fi
11195     if test "$USE_XINERAMA" = "YES"; then
11196         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11197         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11198             [AC_MSG_ERROR(Xinerama header not found.)], [])
11199         XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11200         if test "x$XEXTLIB" = x; then
11201            XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11202         fi
11203         XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11204         if test "$_os" = "FreeBSD"; then
11205             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11206         fi
11207         if test "$_os" = "Linux"; then
11208             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11209         fi
11210         AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11211             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11212     else
11213         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11214     fi
11215 else
11216     USE_XINERAMA=NO
11217     XINERAMA_LINK=none
11218     AC_MSG_RESULT([no])
11220 AC_SUBST(USE_XINERAMA)
11221 AC_SUBST(XINERAMA_LINK)
11223 dnl ===================================================================
11224 dnl Test whether to build cairo or rely on the system version
11225 dnl ===================================================================
11227 if test "$GUIBASE" = "unx"; then
11228     # Used in vcl/Library_vclplug_gen.mk
11229     test_cairo=yes
11232 if test "$test_cairo" = "yes"; then
11233     AC_MSG_CHECKING([whether to use the system cairo])
11235     if test "$with_system_cairo" = "yes"; then
11236         SYSTEM_CAIRO=YES
11237         AC_MSG_RESULT([yes])
11239         PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
11241         if test "$test_xrender" = "yes"; then
11242             if test "$with_system_xextensions_headers" != "no"; then
11243                 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11244                 AC_LANG_PUSH([C])
11245                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11246 #ifdef PictStandardA8
11247 #else
11248       return fail;
11249 #endif
11250 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11252                 AC_LANG_POP([C])
11253             fi
11254         fi
11255         libo_MINGW_CHECK_DLL([CAIRO], [libcairo])
11256         libo_MINGW_TRY_DLL([FONTCONFIG], [libfontconfig])
11257         libo_MINGW_TRY_DLL([FREETYPE], [libfreetype])
11258         libo_MINGW_TRY_DLL([PIXMAN], [libpixman])
11259         libo_MINGW_TRY_DLL([PNG15], [libpng15])
11260     else
11261         SYSTEM_CAIRO=NO
11262         AC_MSG_RESULT([no])
11264         BUILD_TYPE="$BUILD_TYPE CAIRO"
11265         SCPDEFS="$SCPDEFS -DNEED_CAIRO"
11266     fi
11269 AC_SUBST(SYSTEM_CAIRO)
11270 AC_SUBST(CAIRO_CFLAGS)
11271 AC_SUBST(CAIRO_LIBS)
11272 AC_SUBST([MINGW_CAIRO_DLL])
11273 AC_SUBST([MINGW_FONTCONFIG_DLL])
11274 AC_SUBST([MINGW_FREETYPE_DLL])
11275 AC_SUBST([MINGW_PIXMAN_DLL])
11276 AC_SUBST([MINGW_PNG15_DLL])
11278 dnl ===================================================================
11279 dnl Test whether to use liblangtag
11280 dnl ===================================================================
11281 ENABLE_LIBLANGTAG=
11282 SYSTEM_LIBLANGTAG=
11283 AC_MSG_CHECKING([whether to use liblangtag])
11284 if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a $_os != Android -a $_os != iOS \); then
11285     ENABLE_LIBLANGTAG=YES
11286     AC_MSG_RESULT([yes])
11287     AC_MSG_CHECKING([whether to use system liblangtag])
11288     if test "$with_system_liblangtag" = yes; then
11289         SYSTEM_LIBLANGTAG=YES
11290         AC_MSG_RESULT([yes])
11291         PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11292         libo_MINGW_CHECK_DLL([LIBLANGTAG], [liblangtag])
11293     else
11294         SYSTEM_LIBLANGTAG=NO
11295         AC_MSG_RESULT([no])
11296         BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11297     fi
11298 else
11299     ENABLE_LIBLANGTAG=NO
11300     AC_MSG_RESULT([no])
11302 AC_SUBST(ENABLE_LIBLANGTAG)
11303 AC_SUBST(SYSTEM_LIBLANGTAG)
11304 AC_SUBST(LIBLANGTAG_CFLAGS)
11305 AC_SUBST(LIBLANGTAG_LIBS)
11306 AC_SUBST([MINGW_LIBLANGTAG_DLL])
11308 dnl ===================================================================
11309 dnl Test whether to build libpng or rely on the system version
11310 dnl ===================================================================
11312 AC_MSG_CHECKING([whether to use the system libpng])
11314 dnl How should and does this interact with the checks for libpng
11315 dnl related to use of libpng in the quickstarter above? This needs to
11316 dnl be unified.
11318 if test "$with_system_libpng" = "auto"; then
11319     case "$_os" in
11320     WINNT|Darwin|iOS|Android)
11321         with_system_libpng="$with_system_libs"
11322         ;;
11323     *)
11324         with_system_libpng=yes
11325         ;;
11326     esac
11329 if test "$with_system_libpng" = yes; then
11330     SYSTEM_LIBPNG=YES
11331     AC_MSG_RESULT([yes])
11332 else
11333     SYSTEM_LIBPNG=NO
11334     BUILD_TYPE="$BUILD_TYPE LIBPNG"
11335     AC_MSG_RESULT([no])
11337 AC_SUBST(SYSTEM_LIBPNG)
11339 dnl ===================================================================
11340 dnl Check for runtime JVM search path
11341 dnl ===================================================================
11342 if test "$SOLAR_JAVA" != ""; then
11343     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11344     if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11345         AC_MSG_RESULT([yes])
11346         if ! test -d "$with_jvm_path"; then
11347             AC_MSG_ERROR(["$with_jvm_path" not a directory])
11348         fi
11349         if ! test -d "$with_jvm_path"jvm; then
11350             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11351         fi
11352         JVM_ONE_PATH_CHECK="$with_jvm_path"
11353         AC_SUBST(JVM_ONE_PATH_CHECK)
11354     else
11355         AC_MSG_RESULT([no])
11356     fi
11359 dnl ===================================================================
11360 dnl Test for the presence of Ant and that it works
11361 dnl ===================================================================
11363 if test "$SOLAR_JAVA" != ""; then
11364     ANT_HOME=; export ANT_HOME
11365     WITH_ANT_HOME=; export WITH_ANT_HOME
11366     if test -z "$with_ant_home"; then
11367         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11368     else
11369         if test "$_os" = "WINNT"; then
11370             with_ant_home=`cygpath -u "$with_ant_home"`
11371         fi
11372         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11373         WITH_ANT_HOME=$with_ant_home
11374         ANT_HOME=$with_ant_home
11375     fi
11377     if test -z "$ANT"; then
11378         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11379     else
11380         # resolve relative or absolute symlink
11381         while test -h "$ANT"; do
11382             a_cwd=`pwd`
11383             a_basename=`basename "$ANT"`
11384             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11385             cd "`dirname "$ANT"`"
11386             cd "`dirname "$a_script"`"
11387             ANT="`pwd`"/"`basename "$a_script"`"
11388             cd "$a_cwd"
11389         done
11391         AC_MSG_CHECKING([if $ANT works])
11392         cat > conftest.java << EOF
11393         public class conftest {
11394             int testmethod(int a, int b) {
11395                     return a + b;
11396             }
11397         }
11400         cat > conftest.xml << EOF
11401         <project name="conftest" default="conftest">
11402         <target name="conftest">
11403             <javac srcdir="." includes="conftest.java">
11404             </javac>
11405         </target>
11406         </project>
11409         oldJAVA_HOME=$JAVA_HOME
11410         if test "$JAVACISGCJ" = "yes"; then
11411             JAVA_HOME=; export JAVA_HOME
11412             ant_gcj="-Dbuild.compiler=gcj"
11413         fi
11414         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11415         if test $? = 0 -a -f ./conftest.class; then
11416             AC_MSG_RESULT([Ant works])
11417             if test -z "$WITH_ANT_HOME"; then
11418                 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11419                 if test -z "$ANT_HOME"; then
11420                     ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11421                 fi
11422             else
11423                 ANT_HOME="$WITH_ANT_HOME"
11424             fi
11425         else
11426             echo "configure: Ant test failed" >&5
11427             cat conftest.java >&5
11428             cat conftest.xml >&5
11429             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
11430             ANT_HOME=""
11431             add_warning "Ant does not work - Some Java projects will not build!"
11432         fi
11433         JAVA_HOME=$oldJAVA_HOME
11434         rm -f conftest* core core.* *.core
11435     fi
11436     if test -z "$ANT_HOME"; then
11437         ANT_HOME="NO_ANT_HOME"
11438     else
11439         PathFormat "$ANT_HOME"
11440         ANT_HOME="$formatted_path"
11441         PathFormat "$ANT"
11442         ANT="$ANT"
11443     fi
11444     AC_SUBST(ANT_HOME)
11445     AC_SUBST(ANT)
11447     dnl Checking for ant.jar
11448     if test "$ANT_HOME" != "NO_ANT_HOME"; then
11449         AC_MSG_CHECKING([Ant lib directory])
11450         if test -f $ANT_HOME/lib/ant.jar; then
11451             ANT_LIB="$ANT_HOME/lib"
11452         else
11453             if test -f $ANT_HOME/ant.jar; then
11454                 ANT_LIB="$ANT_HOME"
11455             else
11456                 if test -f /usr/share/java/ant.jar; then
11457                     ANT_LIB=/usr/share/java
11458                 else
11459                     if test -f /usr/share/ant-core/lib/ant.jar; then
11460                         ANT_LIB=/usr/share/ant-core/lib
11461                     else
11462                         if test -f $ANT_HOME/lib/ant/ant.jar; then
11463                             ANT_LIB="$ANT_HOME/lib/ant"
11464                         else
11465                             if test -f /usr/share/lib/ant/ant.jar; then
11466                                 ANT_LIB=/usr/share/lib/ant
11467                             else
11468                                 AC_MSG_ERROR([Ant libraries not found!])
11469                             fi
11470                         fi
11471                     fi
11472                 fi
11473             fi
11474         fi
11475         PathFormat "$ANT_LIB"
11476         ANT_LIB="$formatted_path"
11477         AC_MSG_RESULT([Ant lib directory found.])
11478     fi
11479     AC_SUBST(ANT_LIB)
11481     ant_minver=1.6.0
11482     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11484     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11485     ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11486     ant_version_major=`echo $ant_version | cut -d. -f1`
11487     ant_version_minor=`echo $ant_version | cut -d. -f2`
11488     echo "configure: ant_version $ant_version " >&5
11489     echo "configure: ant_version_major $ant_version_major " >&5
11490     echo "configure: ant_version_minor $ant_version_minor " >&5
11491     if test "$ant_version_major" -ge "2"; then
11492         AC_MSG_RESULT([yes, $ant_version])
11493     elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11494         AC_MSG_RESULT([yes, $ant_version])
11495     else
11496         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11497     fi
11499     if test "$ENABLE_MEDIAWIKI" = "YES"; then
11500         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
11501         rm -rf confdir
11502         mkdir confdir
11503         cat > conftest.java << EOF
11504             public class conftest {
11505                 int testmethod(int a, int b) {
11506                     return a + b;
11507                 }
11508             }
11511         cat > conftest.xml << EOF
11512             <project name="conftest" default="conftest">
11513             <target name="conftest" depends="copytest">
11514                 <javac srcdir="." includes="conftest.java">
11515                 </javac>
11516             </target>
11517             <target name="copytest">
11518                  <copy todir="confdir">
11519                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
11520                  <filterset/>
11521                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
11522                  </copy>
11523             </target>
11524             </project>
11527         if test "$JAVACISGCJ" = "yes"; then
11528             JAVA_HOME=; export JAVA_HOME
11529             ant_gcj="-Dbuild.compiler=gcj"
11530         fi
11531         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11532         if test $? = 0 -a -f ./conftest.class; then
11533             AC_MSG_RESULT([yes])
11534             rm -rf confdir
11535         else
11536             echo "configure: Ant test failed" >&5
11537             cat conftest.java >&5
11538             cat conftest.xml >&5
11539             rm -rf confdir
11540             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
11541         fi
11542     fi
11543     rm -f conftest* core core.* *.core
11546 OOO_JUNIT_JAR=
11547 if test "$SOLAR_JAVA" != "" -a "$with_junit" != "no"; then
11548     AC_MSG_CHECKING([for JUnit 4])
11549     if test "$with_junit" = "yes"; then
11550         if test -e /usr/share/java/junit4.jar; then
11551             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11552         else
11553            if test -e /usr/share/lib/java/junit.jar; then
11554               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11555            else
11556               OOO_JUNIT_JAR=/usr/share/java/junit.jar
11557            fi
11558         fi
11559     else
11560         OOO_JUNIT_JAR=$with_junit
11561     fi
11562     if test "$_os" = "WINNT"; then
11563         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11564     fi
11565     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
11566         grep org/junit/Before.class > /dev/null 2>&5
11567     if test $? -eq 0; then
11568         # check if either class-path entry is available for hamcrest or
11569         # it's bundled
11570         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
11571             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
11572             AC_MSG_RESULT([$OOO_JUNIT_JAR])
11573         else
11574             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
11575 provide a full junit jar or use --without-junit])
11576         fi
11577     else
11578         AC_MSG_RESULT([no])
11579         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
11580 location (/usr/share/java), specify its pathname via
11581 --with-junit=..., or disable it via --without-junit])
11582     fi
11583     if test $OOO_JUNIT_JAR != ""; then
11584     BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11585     fi
11587 AC_SUBST(OOO_JUNIT_JAR)
11589 if test "$enable_odk" = no; then
11590     unset DOXYGEN
11591 else
11592     if test "$with_doxygen" = no; then
11593         AC_MSG_CHECKING([for doxygen])
11594         unset DOXYGEN
11595         AC_MSG_RESULT([no])
11596     else
11597         if test "$with_doxygen" = yes; then
11598             AC_PATH_PROG([DOXYGEN], [doxygen])
11599             if test -z "$DOXYGEN"; then
11600                 AC_MSG_RESULT([no])
11601                 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
11602             fi
11603         else
11604             AC_MSG_CHECKING([for doxygen])
11605             DOXYGEN=$with_doxygen
11606             AC_MSG_RESULT([$DOXYGEN])
11607         fi
11608     fi
11610 AC_SUBST([DOXYGEN])
11612 AC_SUBST(SCPDEFS)
11615 # check for wget and md5sum
11617 WGET=
11618 MD5SUM=
11619 CURL=
11621 if test "$enable_fetch_external" != "no"; then
11623 CURL=`which curl 2>/dev/null`
11625 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
11626     eval "$i --version" > /dev/null 2>&1
11627     ret=$?
11628     if test $ret -eq 0; then
11629         WGET=$i
11630         break
11631     fi
11632 done
11634 if test -z "$WGET" -a -z "$CURL"; then
11635     AC_MSG_ERROR([neither wget nor curl found!])
11638 for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
11639     if test "$i" = "md5"; then
11640         eval "$i -x" > /dev/null 2>&1
11641     else
11642         eval "$i --version" > /dev/null 2>&1
11643     fi
11644     ret=$?
11645     if test $ret -eq 0; then
11646         MD5SUM=$i
11647         break
11648     fi
11649 done
11651 if test "$MD5SUM" = "md5"; then
11652     if md5 -r < /dev/null > /dev/null 2>/dev/null; then
11653         MD5SUM="$MD5SUM -r"
11654     elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
11655         MD5SUM="$MD5SUM -n"
11656     fi
11659 if test -z "$MD5SUM"; then
11660     AC_MSG_WARN([no md5sum: found!])
11661     add_warning "no md5sum: found!"
11666 AC_SUBST(WGET)
11667 AC_SUBST(CURL)
11668 AC_SUBST(MD5SUM)
11670 dnl ===================================================================
11671 dnl Product version
11672 dnl ===================================================================
11673 AC_MSG_CHECKING([for product version])
11674 PRODUCTVERSION=AC_PACKAGE_VERSION
11675 AC_MSG_RESULT([$PRODUCTVERSION])
11676 AC_SUBST(PRODUCTVERSION)
11678 dnl ===================================================================
11679 dnl Dealing with l10n options
11680 dnl ===================================================================
11681 AC_MSG_CHECKING([which languages to be built])
11682 # get list of all languages
11683 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
11684 # the sed command does the following:
11685 #   + if a line ends with a backslash, append the next line to it
11686 #   + adds " on the beginning of the value (after =)
11687 #   + adds " at the end of the value
11688 #   + removes en-US; we want to put it on the beginning
11689 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
11690 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
11691 ALL_LANGS="en-US $completelangiso"
11692 # check the configured localizations
11693 WITH_LANG="$with_lang"
11694 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
11695     AC_MSG_RESULT([en-US])
11696 else
11697     AC_MSG_RESULT([$WITH_LANG])
11698     GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
11700 # check that the list is valid
11701 for lang in $WITH_LANG; do
11702     test "$lang" = "ALL" && continue
11703     # need to check for the exact string, so add space before and after the list of all languages
11704     for vl in $ALL_LANGS; do
11705         if test "$vl" = "$lang"; then
11706            break
11707         fi
11708     done
11709     if test "$vl" != "$lang"; then
11710         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
11711     fi
11712 done
11713 # list with substituted ALL
11714 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
11715 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
11716 test "$WITH_LANG" = "en-US" && WITH_LANG=
11717 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
11718     test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
11719     ALL_LANGS=`echo $ALL_LANGS qtz`
11721 AC_SUBST(ALL_LANGS)
11722 AC_SUBST(WITH_LANG)
11723 AC_SUBST(WITH_LANG_LIST)
11724 AC_SUBST(GIT_NEEDED_SUBMODULES)
11727 PathFormat "$SRC_ROOT/translations"
11728 L10N_MODULE="$formatted_path"
11729 WITH_POOR_HELP_LOCALIZATIONS=
11730 if test -d "$SRC_ROOT/translations/source"; then
11731     for l in `ls -1 $SRC_ROOT/translations/source`; do
11732         if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
11733             WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
11734         fi
11735     done
11737 AC_SUBST(L10N_MODULE)
11738 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
11740 dnl git-new-workdir
11741 dnl ===================================================================
11742 if test -n "${GIT_LINK_SRC}"; then
11743     for repo in ${GIT_NEEDED_SUBMODULES}; do
11744         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
11745             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
11746         fi
11747     done
11749 AC_SUBST(GIT_LINK_SRC)
11751 AC_MSG_CHECKING([for custom 'intro' progress bar color])
11752 PROGRESSBARCOLOR=
11753 if test -z "$with_intro_progressbar_color"; then
11754    PROGRESSBARCOLOR="128,128,128"
11755    AC_MSG_RESULT([none])
11756 else
11757    PROGRESSBARCOLOR="$with_intro_progressbar_color"
11758    AC_MSG_RESULT([$PROGRESSBARCOLOR])
11760 AC_SUBST(PROGRESSBARCOLOR)
11762 AC_MSG_CHECKING([for custom 'intro' progress bar size])
11763 PROGRESSSIZE=
11764 if test -z "$with_intro_progressbar_size"; then
11765    PROGRESSSIZE="409,8"
11766    AC_MSG_RESULT([none])
11767 else
11768    PROGRESSSIZE="$with_intro_progressbar_size"
11769    AC_MSG_RESULT([$PROGRESSSIZE])
11771 AC_SUBST(PROGRESSSIZE)
11773 AC_MSG_CHECKING([for custom 'intro' progress bar position])
11774 PROGRESSPOSITION=
11775 if test -z "$with_intro_progressbar_position"; then
11776    PROGRESSPOSITION="72,189"
11777    AC_MSG_RESULT([none])
11778 else
11779    PROGRESSPOSITION="$with_intro_progressbar_position"
11780    AC_MSG_RESULT([$PROGRESSPOSITION])
11782 AC_SUBST(PROGRESSPOSITION)
11784 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
11785 PROGRESSFRAMECOLOR=
11786 if test -z "$with_intro_progressbar_frame_color"; then
11787    PROGRESSFRAMECOLOR="245,245,245"
11788    AC_MSG_RESULT([none])
11789 else
11790    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
11791    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
11793 AC_SUBST(PROGRESSFRAMECOLOR)
11795 AC_MSG_CHECKING([for custom 'intro' progress text color])
11796 PROGRESSTEXTCOLOR=
11797 if test -z "$with_intro_progressbar_text_color"; then
11798    PROGRESSTEXTCOLOR="255,255,255"
11799    AC_MSG_RESULT([none])
11800 else
11801    PROGRESSTEXTCOLOR="$with_intro_progressbar_text_color"
11802    AC_MSG_RESULT([$PROGRESSTEXTCOLOR])
11804 AC_SUBST(PROGRESSTEXTCOLOR)
11806 AC_MSG_CHECKING([for custom 'intro' progress text baseline])
11807 PROGRESSTEXTBASELINE=
11808 if test -z "$with_intro_progressbar_text_baseline"; then
11809    PROGRESSTEXTBASELINE="170"
11810    AC_MSG_RESULT([none])
11811 else
11812    PROGRESSTEXTBASELINE="$with_intro_progressbar_text_baseline"
11813    AC_MSG_RESULT([$PROGRESSTEXTBASELINE])
11815 AC_SUBST(PROGRESSTEXTBASELINE)
11817 dnl git submodule update --reference
11818 dnl ===================================================================
11819 if test -n "${GIT_REFERENCE_SRC}"; then
11820     for repo in ${GIT_NEEDED_SUBMODULES}; do
11821         if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
11822             AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
11823         fi
11824     done
11826 AC_SUBST(GIT_REFERENCE_SRC)
11829 AC_MSG_CHECKING([for alternative branding images directory])
11830 INTRO_BITMAP=
11831 ABOUT_BACKGROUND_SVG=
11832 FLAT_LOGO_SVG=
11833 STARTCENTER_LEFT_BITMAP=
11834 STARTCENTER_RIGHT_BITMAP=
11835 STARTCENTER_RTL_LEFT_BITMAP=
11836 STARTCENTER_RTL_RIGHT_BITMAP=
11837 STARTCENTER_SPACE_BITMAP=
11838 if test -z "$with_branding" -o "$with_branding" = "no"; then
11839     AC_MSG_RESULT([none])
11840 else
11841     INTRO_BITMAP="$with_branding/intro.png"
11842     FLAT_LOGO_SVG="$with_branding/flat_logo.svg"
11843     STARTCENTER_LEFT_BITMAP="$with_branding/backing_left.png"
11844     STARTCENTER_RIGHT_BITMAP="$with_branding/backing_right.png"
11845     STARTCENTER_RTL_LEFT_BITMAP="$with_branding/backing_rtl_left.png"
11846     STARTCENTER_RTL_RIGHT_BITMAP="$with_branding/backing_rtl_right.png"
11847     STARTCENTER_SPACE_BITMAP="$with_branding/backing_space.png"
11848     for i in $INTRO_BITMAP \
11849              $FLAT_LOGO_SVG \
11850              $STARTCENTER_LEFT_BITMAP \
11851              $STARTCENTER_RIGHT_BITMAP \
11852              $STARTCENTER_RTL_LEFT_BITMAP \
11853              $STARTCENTER_RTL_RIGHT_BITMAP \
11854              $STARTCENTER_SPACE_BITMAP; do
11855         if test ! -f $i; then
11856             AC_MSG_WARN([Required file $i does not exist!])
11857         fi
11858     done
11859     AC_MSG_RESULT([$with_branding])
11862 AC_MSG_CHECKING([for yet another 'intro' bitmap])
11863 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no"; then
11864     if test "$with_intro_bitmap" = "no"; then
11865         INTRO_BITMAP=
11866     fi
11867     AC_MSG_RESULT([none])
11868 else
11869     case "$with_intro_bitmap" in
11870     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
11871     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
11872     esac
11873     AC_MSG_RESULT([$INTRO_BITMAP])
11875 AC_SUBST(INTRO_BITMAP)
11877 AC_MSG_CHECKING([for yet another 'about' svg])
11878 if test -z "$with_about_background_svg" -o "$with_about_background_svg" = "no"; then
11879     if test "$with_about_background_svg" = "no"; then
11880         ABOUT_BACKGROUND_SVG=
11881     fi
11882     AC_MSG_RESULT([none])
11883 else
11884    case "$with_about_background_svg" in
11885    *.svg) ABOUT_BACKGROUND_SVG="$with_about_background_svg" ;;
11886    *)     AC_MSG_WARN([About background SVG should be a .svg file!]) ;;
11887    esac
11888    AC_MSG_RESULT([$ABOUT_BACKGROUND_SVG])
11890 AC_SUBST(ABOUT_BACKGROUND_SVG)
11892 AC_MSG_CHECKING([for yet another 'flat_logo' svg])
11893 if test -z "$with_flat_logo_svg" -o "$with_flat_logo_svg" = "no"; then
11894     if test "$with_flat_logo_svg" = "no"; then
11895         FLAT_LOGO_SVG=
11896     fi
11897     AC_MSG_RESULT([none])
11898 else
11899    case "$with_flat_logo_svg" in
11900    *.svg) FLAT_LOGO_SVG="$with_flat_logo_svg" ;;
11901    *)     AC_MSG_WARN([Flat logo SVG should be a .svg file!]) ;;
11902    esac
11903    AC_MSG_RESULT([$ABOUT_BITMAP])
11905 AC_SUBST(FLAT_LOGO_SVG)
11907 AC_MSG_CHECKING([for yet another 'start center left' bitmap])
11908 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no"; then
11909    if test "$with_startcenter_left_bitmap" = "no"; then
11910       STARTCENTER_LEFT_BITMAP=
11911    fi
11912    AC_MSG_RESULT([none])
11913 else
11914    case "$with_startcenter_left_bitmap" in
11915       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
11916       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11917    esac
11918    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
11920 AC_SUBST(STARTCENTER_LEFT_BITMAP)
11922 AC_MSG_CHECKING([for yet another 'start center right' bitmap])
11923 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no"; then
11924    if test "$with_startcenter_right_bitmap" = "no"; then
11925       STARTCENTER_RIGHT_BITMAP=
11926    fi
11927    AC_MSG_RESULT([none])
11928 else
11929    case "$with_startcenter_right_bitmap" in
11930       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
11931       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
11932    esac
11933    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
11935 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
11937 AC_MSG_CHECKING([for yet another 'start center rtl left' bitmap])
11938 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no"; then
11939    if test "$with_startcenter_rtl_left_bitmap" = "no"; then
11940       STARTCENTER_RTL_LEFT_BITMAP=
11941    fi
11942    AC_MSG_RESULT([none])
11943 else
11944    case "$with_startcenter_rtl_left_bitmap" in
11945       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
11946       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
11947    esac
11948    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
11950 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
11952 AC_MSG_CHECKING([for yet another 'start center rtl right' bitmap])
11953 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no"; then
11954    if test "$with_startcenter_rtl_right_bitmap" = "no"; then
11955       STARTCENTER_RTL_RIGHT_BITMAP=
11956    fi
11957    AC_MSG_RESULT([none])
11958 else
11959    case "$with_startcenter_rtl_right_bitmap" in
11960       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
11961       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
11962    esac
11963    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
11965 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
11967 AC_MSG_CHECKING([for yet another 'start center space' bitmap])
11968 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no"; then
11969    if test "$with_startcenter_space_bitmap" = "no"; then
11970       STARTCENTER_SPACE_BITMAP=
11971    fi
11972    AC_MSG_RESULT([none])
11973 else
11974    case "$with_startcenter_space_bitmap" in
11975       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
11976       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11977    esac
11978    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
11980 AC_SUBST(STARTCENTER_SPACE_BITMAP)
11982 AC_MSG_CHECKING([for extra build ID])
11983 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
11984     EXTRA_BUILDID="$with_extra_buildid"
11986 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
11987 if test -n "$EXTRA_BUILDID" ; then
11988     AC_MSG_RESULT([$EXTRA_BUILDID])
11989 else
11990     AC_MSG_RESULT([not set])
11992 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
11994 OOO_VENDOR=
11995 AC_MSG_CHECKING([for vendor])
11996 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
11997     AC_MSG_RESULT([not set])
11998 else
11999     OOO_VENDOR="$with_vendor"
12000     AC_MSG_RESULT([$OOO_VENDOR])
12002 AC_SUBST(OOO_VENDOR)
12004 UNIXWRAPPERNAME=
12005 AC_MSG_CHECKING([for UNIX wrapper name])
12006 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes"; then
12007     AC_MSG_RESULT([not set])
12008 else
12009     UNIXWRAPPERNAME="$with_unix_wrapper"
12010     AC_MSG_RESULT([$UNIXWRAPPERNAME])
12012 AC_SUBST(UNIXWRAPPERNAME)
12014 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12015 if test "$with_compat_oowrappers" = "yes"; then
12016     WITH_COMPAT_OOWRAPPERS=YES
12017     AC_MSG_RESULT(yes)
12018 else
12019     WITH_COMPAT_OOWRAPPERS=
12020     AC_MSG_RESULT(no)
12022 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12024 AC_MSG_CHECKING([for product name])
12025 PRODUCTNAME=AC_PACKAGE_NAME
12026 AC_MSG_RESULT([$PRODUCTNAME])
12027 AC_SUBST(PRODUCTNAME)
12029 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
12030 AC_MSG_CHECKING([for install dirname])
12031 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12032    INSTALLDIRNAME="$with_install_dirname"
12034 AC_MSG_RESULT([$INSTALLDIRNAME])
12035 AC_SUBST(INSTALLDIRNAME)
12037 AC_MSG_CHECKING([for prefix])
12038 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12039 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12040 PREFIXDIR="$prefix"
12041 AC_MSG_RESULT([$PREFIXDIR])
12042 AC_SUBST(PREFIXDIR)
12044 AC_MSG_CHECKING([for libdir])
12045 LIBDIR=[$(eval echo $(eval echo $libdir))]
12046 AC_MSG_RESULT([$LIBDIR])
12047 AC_SUBST(LIBDIR)
12049 AC_MSG_CHECKING([for data dir])
12050 DATADIR=[$(eval echo $(eval echo $datadir))]
12051 AC_MSG_RESULT([$DATADIR])
12052 AC_SUBST(DATADIR)
12054 AC_MSG_CHECKING([for man dir])
12055 MANDIR=[$(eval echo $(eval echo $mandir))]
12056 AC_MSG_RESULT([$MANDIR])
12057 AC_SUBST(MANDIR)
12059 AC_MSG_CHECKING([for doc dir])
12060 DOCDIR=[$(eval echo $(eval echo $docdir))]
12061 AC_MSG_RESULT([$DOCDIR])
12062 AC_SUBST(DOCDIR)
12064 AC_MSG_CHECKING([for install dir])
12065 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12066 AC_MSG_RESULT([$INSTALLDIR])
12067 AC_SUBST(INSTALLDIR)
12069 AC_MSG_CHECKING([for dev-install dir])
12070 DEVINSTALLDIR="$OUTDIR/installation"
12071 AC_MSG_RESULT([$DEVINSTALLDIR])
12072 AC_SUBST(DEVINSTALLDIR)
12074 # ===================================================================
12075 # De- or increase default verbosity of build process
12076 # ===================================================================
12077 AC_MSG_CHECKING([build verbosity])
12078 if test -n "$enable_verbose"; then
12079     if test "$enable_verbose" = "yes"; then
12080         VERBOSE="TRUE"
12081         AC_MSG_RESULT([high])
12082     fi
12083     if test "$enable_verbose" = "no"; then
12084         VERBOSE="FALSE"
12085         AC_MSG_RESULT([low])
12086     fi
12087 else
12088     AC_MSG_RESULT([not set])
12090 AC_SUBST(VERBOSE)
12092 dnl ===================================================================
12093 dnl Use zenity during build
12094 dnl ===================================================================
12095 AC_MSG_CHECKING([whether to use zenity during build])
12096 if test "$enable_zenity" = "yes"; then
12097     AC_MSG_RESULT([yes])
12098     AC_PATH_PROGS( ZNTY, zenity )
12099     if test -z "$ZNTY"; then
12100         ENABLE_ZENITY=FALSE
12101     else
12102         ENABLE_ZENITY=TRUE
12103     fi
12104 else
12105     ENABLE_ZENITY=FALSE
12106     AC_MSG_RESULT([no])
12108 AC_SUBST(ENABLE_ZENITY)
12111 dnl ===================================================================
12112 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12113 dnl --enable-dependency-tracking configure option
12114 dnl ===================================================================
12115 AC_MSG_CHECKING([whether to enable dependency tracking])
12116 if test "$enable_dependency_tracking" = "no"; then
12117     nodep=TRUE
12118     AC_MSG_RESULT([no])
12119 else
12120     AC_MSG_RESULT([yes])
12122 AC_SUBST(nodep)
12124 dnl ===================================================================
12125 dnl Number of CPUs to use during the build
12126 dnl ===================================================================
12127 AC_MSG_CHECKING([for number of processors to use])
12128 # plain --with-parallelism is just the default
12129 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12130     if test "$with_parallelism" = "no"; then
12131         PARALLELISM=1
12132     else
12133         PARALLELISM=$with_parallelism
12134     fi
12135 else
12136     if test "$enable_icecream" = "yes"; then
12137         PARALLELISM="10"
12138     else
12139         case `uname -s` in
12141         Darwin|FreeBSD|NetBSD|OpenBSD)
12142             PARALLELISM=`sysctl -n hw.ncpu`
12143             ;;
12145         Linux)
12146             PARALLELISM=`getconf _NPROCESSORS_ONLN`
12147         ;;
12148         # what else than above does profit here *and* has /proc?
12149         *)
12150             PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12151             ;;
12152         esac
12154         # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12155         # unexpected format, 'wc -l' will have returned 0.
12156         if test "$PARALLELISM" -eq 0; then
12157             PARALLELISM=1
12158         fi
12159     fi
12162 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12163     if test -z "$with_parallelism"; then
12164             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12165             add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12166             PARALLELISM="1"
12167     else
12168         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."
12169     fi
12172 AC_MSG_RESULT([$PARALLELISM])
12173 AC_SUBST(PARALLELISM)
12175 # ===================================================================
12176 # Number of parallel jobs to be executed during subsequenttest
12177 # ===================================================================
12178 AC_MSG_CHECKING([for maximum no. of jobs during subsequenttest])
12179 CHECK_PARALLELISM=$PARALLELISM
12180 if test "$with_check_jobs" != ""; then
12181     CHECK_PARALLELISM="$with_check_jobs"
12183 AC_MSG_RESULT([$CHECK_PARALLELISM])
12184 AC_SUBST(CHECK_PARALLELISM)
12187 # Set up ILIB for MSVC build
12189 if test "$build_os" = "cygwin"; then
12190     ILIB=".;${SOLARVER}/$INPATH/lib"
12191     if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
12192         ILIB="$ILIB;$JAVA_HOME/lib"
12193     fi
12194     if test "$BITNESS_OVERRIDE" = 64; then
12195         ILIB="$ILIB;$COMPATH/lib/amd64"
12196         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12197         if test "$WINDOWS_SDK_VERSION" = "80"; then
12198             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x64"
12199         fi
12200     else
12201         ILIB="$ILIB;$COMPATH/lib"
12202         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12203         if test "$WINDOWS_SDK_VERSION" = "80"; then
12204             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x86"
12205         fi
12206     fi
12207     ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12209     if test "$ENABLE_DIRECTX" = "TRUE"; then
12210         ILIB="$ILIB;$DIRECTXSDK_LIB"
12211     fi
12212     AC_SUBST(ILIB)
12216 # ===================================================================
12217 # Creating bigger shared library to link against
12218 # ===================================================================
12219 AC_MSG_CHECKING([whether to create huge library])
12220 MERGELIBS=
12221 if test "$enable_mergelibs" = "yes"; then
12222     if test $_os != Linux -a $_os != Android -a $_os != WINNT; then
12223         add_warning "--enable-mergelibs is not tested for this platform"
12224     fi
12225     MERGELIBS="TRUE"
12226     AC_MSG_RESULT([yes])
12227 else
12228     AC_MSG_RESULT([no])
12230 AC_SUBST(MERGELIBS)
12232 # ===================================================================
12233 # Create hardlinks on deliver instead of copying for smaller size and speed up
12234 # ===================================================================
12235 AC_MSG_CHECKING([whether to create hardlinks for delivering files])
12236 HARDLINKDELIVER=
12237 if test "$enable_hardlink_deliver" = "yes"; then
12238     HARDLINKDELIVER="TRUE"
12239     AC_MSG_RESULT([yes])
12240 else
12241     AC_MSG_RESULT([no])
12243 AC_SUBST(HARDLINKDELIVER)
12245 dnl ===================================================================
12246 dnl icerun is a wrapper that stops us spawning tens of processes
12247 dnl locally - for tools that can't be executed on the compile cluster
12248 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12249 dnl ===================================================================
12250 AC_MSG_CHECKING([whether to use icerun wrapper])
12251 ICECREAM_RUN=
12252 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12253     ICECREAM_RUN=icerun
12254     AC_MSG_RESULT([yes])
12255 else
12256     AC_MSG_RESULT([no])
12258 AC_SUBST(ICECREAM_RUN)
12260 dnl ===================================================================
12261 dnl Setting up the environment.
12262 dnl ===================================================================
12263 echo "setting up the build environment variables..."
12265 AC_SUBST(COMPATH)
12267 if test "$build_os" = "cygwin"; then
12268     if test "$DISABLE_ACTIVEX" = "YES"; then
12269         ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12270         ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12271         MFC_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12272         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
12273     else
12274         ATL_LIB="$COMPATH/atlmfc/lib"
12275         ATL_INCLUDE="$COMPATH/atlmfc/include"
12276         MFC_LIB="$COMPATH/atlmfc/lib"
12277         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
12278     fi
12279     if test "$BITNESS_OVERRIDE" = 64; then
12280         ATL_LIB="$ATL_LIB/amd64"
12281         MFC_LIB="$MFC_LIB/amd64"
12282     fi
12283     PathFormat "/usr/bin/grep.exe"
12284     WIN_GREP="$formatted_path"
12285     PathFormat "/usr/bin/find.exe"
12286     WIN_FIND="$formatted_path"
12287     PathFormat "/usr/bin/ls.exe"
12288     WIN_LS="$formatted_path"
12289     PathFormat "/usr/bin/touch.exe"
12290     WIN_TOUCH="$formatted_path"
12293 AC_SUBST(ATL_INCLUDE)
12294 AC_SUBST(ATL_LIB)
12295 AC_SUBST(MFC_INCLUDE)
12296 AC_SUBST(MFC_LIB)
12297 AC_SUBST(WIN_FIND)
12298 AC_SUBST(WIN_GREP)
12299 AC_SUBST(WIN_LS)
12300 AC_SUBST(WIN_TOUCH)
12302 AC_SUBST(BUILD_TYPE)
12304 AC_SUBST(SOLARINC)
12305 AC_SUBST(SOLARLIB)
12307 if test -z "$SOLARINC_FOR_BUILD"; then
12308     SOLARINC_FOR_BUILD="$SOLARINC"
12310 AC_SUBST(SOLARINC_FOR_BUILD)
12312 if test -z "$SOLARLIB_FOR_BUILD"; then
12313     SOLARLIB_FOR_BUILD="$SOLARLIB"
12315 AC_SUBST(SOLARLIB_FOR_BUILD)
12317 PathFormat "$PERL"
12318 PERL="$formatted_path"
12319 AC_SUBST(PERL)
12321 if test "$build_os" = "cygwin"; then
12322     TEMP_DIRECTORY=`cygpath -m "/tmp"`
12323     if test -n "$TMP"; then
12324         TMP_DIRECTORY="$TMP"
12325     else
12326         TMP_DIRECTORY="$TEMP_DIRECTORY"
12327     fi
12328 else
12329     if test -n "$TMPDIR"; then
12330         TEMP_DIRECTORY="$TMPDIR"
12331     else
12332         TEMP_DIRECTORY="/tmp"
12333     fi
12335 AC_SUBST(TEMP_DIRECTORY)
12336 AC_SUBST(TMP_DIRECTORY)
12338 # setup the PATH for the environment
12339 if test -n "$LO_PATH_FOR_BUILD"; then
12340     LO_PATH="$LO_PATH_FOR_BUILD"
12341 else
12342     LO_PATH="$PATH"
12344     case "$host_os" in
12346     aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12347         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12348             pathmunge "$JAVA_HOME/bin" "after"
12349         fi
12350         ;;
12352     cygwin*)
12353         pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12354         pathmunge "$ASM_HOME" "before"
12355         pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12356         pathmunge "$CSC_PATH" "before"
12357         pathmunge "$MIDL_PATH" "before"
12358         pathmunge "$AL_PATH" "before"
12359         pathmunge "$MSPDB_PATH" "before"
12360         if test "$BITNESS_OVERRIDE" = 64; then
12361             pathmunge "$COMPATH/bin/amd64" "before"
12362             pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12363         else
12364             pathmunge "$COMPATH/bin" "before"
12365             pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12366         fi
12367         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12368             if test -d "$JAVA_HOME/jre/bin/client"; then
12369                 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12370             fi
12371             if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12372                 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12373             fi
12374             pathmunge "$JAVA_HOME/bin" "before"
12375         fi
12376         ;;
12378     solaris*)
12379         pathmunge "/usr/css/bin" "before"
12380         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12381             pathmunge "$JAVA_HOME/bin" "after"
12382         fi
12383         ;;
12384     esac
12386     pathmunge "$SRC_ROOT/solenv/$OUTPATH/bin" "before"
12387     pathmunge "$SRC_ROOT/solenv/bin" "before"
12388     pathmunge "." "before"
12391 AC_SUBST(LO_PATH)
12393 # make sure config.guess is +x; we execute config.guess, so it has to be so
12394 chmod +x ./config.guess
12396 # Generate a configuration timestamp we can use for deps
12397 if test -f config_host.mk; then
12398     mv -f config_host.mk config_host.mk.last
12399 else
12400     echo > config_host.mk.last
12403 AC_CONFIG_FILES([config_host.mk])
12404 AC_CONFIG_HEADERS([config/config_buildid.h])
12405 AC_CONFIG_HEADERS([config/config_version.h])
12406 AC_OUTPUT
12408 # touch the config timestamp file
12409 if test ! -f config_host.mk.stamp; then
12410     echo > config_host.mk.stamp
12411 elif diff config_host.mk config_host.mk.last >/dev/null 2>&1; then
12412     echo "Configuration unchanged - avoiding scp2 stamp update"
12413 else
12414     echo > config_host.mk.stamp
12418 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12419 cat << _EOS
12420 ****************************************************************************
12421 WARNING:
12422 Your make version is known to be horribly slow, and hard to debug
12423 problems with. To get a reasonably functional make please do:
12425 to install a pre-compiled binary make for cygwin
12427 mkdir -p /opt/lo/bin
12428 cd /opt/lo/bin
12429 wget http://dev-www.libreoffice.org/bin/cygwin/make
12430 chmod +x make
12432 to install from source:
12433 place yourself in a working directory of you choice.
12435 git clone git://anongit.freedesktop.org/libreoffice/contrib/dev-tools
12436 cd dev-tools/make-3.82-gbuild
12437 ./configure --prefix=/opt/lo
12438 make
12439 sudo make install
12441 Then re-run autogen.sh
12443 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12444 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12446 _EOS
12449 cat << _EOF
12450 ****************************************************************************
12451 To build, issue:
12452 $GNUMAKE
12454 run: $GNUMAKE help
12455 for details
12457 _EOF
12459 if test $_os != WINNT -a "$CROSS_COMPILING" != YES; then
12460     cat << _EOF
12462 To install when the build is finished, issue:
12463 $GNUMAKE install
12465 If you want to develop LibreOffice, you might prefer:
12466 $GNUMAKE dev-install
12468 If you want to run the smoketest, issue:
12469 $GNUMAKE check
12471 _EOF
12474 cat warn
12476 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: