Bump for 4.0-15
[LibreOffice.git] / configure.ac
blob11316792f959a0b82b3b7adf3cb8baf09bdcd8fb
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     test_unix_quickstarter=no
4400     enable_cairo_canvas=no
4401     enable_gnome_vfs=no
4404 dnl ===================================================================
4405 dnl check for cups support
4406 dnl ===================================================================
4407 ENABLE_CUPS=""
4409 if test "$enable_cups" = "no"; then
4410     test_cups=no
4413 AC_MSG_CHECKING([whether to enable CUPS support])
4414 if test "$test_cups" = "yes"; then
4415     ENABLE_CUPS="TRUE"
4416     AC_MSG_RESULT([yes])
4418     AC_MSG_CHECKING([whether cups support is present])
4419     AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
4420     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
4421     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
4422         AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups-devel.])
4423     fi
4425 else
4426     AC_MSG_RESULT([no])
4429 AC_SUBST(ENABLE_CUPS)
4431 # fontconfig checks
4432 if test "$test_fontconfig" = "yes"; then
4433     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
4434 else
4435     case "$BUILD_TYPE" in
4436     *FONTCONFIG*)
4437         FONTCONFIG_LIBS="-lfontconfig"
4438         ;;
4439     esac
4441 AC_SUBST(FONTCONFIG_CFLAGS)
4442 AC_SUBST(FONTCONFIG_LIBS)
4444 dnl whether to find & fetch external tarballs?
4445 dnl ===================================================================
4446 if test -z "$TARFILE_LOCATION"; then
4447     TARFILE_LOCATION="$SRC_ROOT/src"
4449 AC_SUBST(TARFILE_LOCATION)
4451 AC_MSG_CHECKING([whether we want to fetch tarballs])
4452 if test "$enable_fetch_external" != "no"; then
4453     if test "$with_all_tarballs" = "yes"; then
4454         AC_MSG_RESULT(["yes, all of them"])
4455         DO_FETCH_TARBALLS="ALL"
4456     else
4457         AC_MSG_RESULT(["yes, if we use them"])
4458         DO_FETCH_TARBALLS="YES"
4459     fi
4460 else
4461     AC_MSG_RESULT([no])
4462     DO_FETCH_TARBALLS="NO"
4464 AC_SUBST(DO_FETCH_TARBALLS)
4466 AC_MSG_CHECKING([whether to build help])
4467 if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
4468     AC_MSG_RESULT([yes])
4469     BUILD_TYPE="$BUILD_TYPE HELP"
4470     SCPDEFS="$SCPDEFS -DWITH_HELP"
4471     GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
4472 else
4473     AC_MSG_RESULT([no])
4476 dnl Test whether to include MySpell dictionaries
4477 dnl ===================================================================
4478 AC_MSG_CHECKING([whether to include MySpell dictionaries])
4479 if test -z "$with_myspell_dicts" -o "$with_myspell_dicts" = "yes"; then
4480     AC_MSG_RESULT([yes])
4481     WITH_MYSPELL_DICTS=YES
4482     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
4483     GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
4484 else
4485     AC_MSG_RESULT([no])
4486     WITH_MYSPELL_DICTS=NO
4488 AC_SUBST(WITH_MYSPELL_DICTS)
4490 AC_MSG_CHECKING([whether to use dicts from external paths])
4491 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
4492     AC_MSG_RESULT([yes])
4493     SYSTEM_DICTS=YES
4494     AC_MSG_CHECKING([for spelling dictionary directory])
4495     if test -n "$with_external_dict_dir"; then
4496         DICT_SYSTEM_DIR=file://$with_external_dict_dir
4497     else
4498         DICT_SYSTEM_DIR=file:///usr/share/hunspell
4499         if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
4500             DICT_SYSTEM_DIR=file:///usr/share/myspell
4501         fi
4502     fi
4503     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
4504     AC_MSG_CHECKING([for hyphenation patterns directory])
4505     if test -n "$with_external_hyph_dir"; then
4506         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
4507     else
4508         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
4509     fi
4510     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
4511     AC_MSG_CHECKING([for thesaurus directory])
4512     if test -n "$with_external_thes_dir"; then
4513         THES_SYSTEM_DIR=file://$with_external_thes_dir
4514     else
4515         THES_SYSTEM_DIR=file:///usr/share/mythes
4516     fi
4517     AC_MSG_RESULT([$THES_SYSTEM_DIR])
4518 else
4519     AC_MSG_RESULT([no])
4520     SYSTEM_DICTS=NO
4522 AC_SUBST(SYSTEM_DICTS)
4523 AC_SUBST(DICT_SYSTEM_DIR)
4524 AC_SUBST(HYPH_SYSTEM_DIR)
4525 AC_SUBST(THES_SYSTEM_DIR)
4527 dnl ===================================================================
4528 dnl ENABLE_PCH i now a no-op
4529 dnl ===================================================================
4530 AC_MSG_CHECKING([whether to enable pch feature])
4531 AC_MSG_RESULT([no, obsolete])
4533 dnl ===================================================================
4534 dnl Search all the common names for GNU make
4535 dnl ===================================================================
4536 AC_MSG_CHECKING([for GNU make])
4538 # try to use our own make if it is available and GNUMAKE was not already defined
4539 if test -z "$GNUMAKE"; then
4540     if test -x "/opt/lo/bin/make"; then
4541         GNUMAKE="/opt/lo/bin/make"
4542     fi
4545 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
4546     if test -n "$a"; then
4547         $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
4548         if test $? -eq 0;  then
4549             GNUMAKE=$a
4550             break
4551         fi
4552     fi
4553 done
4554 AC_MSG_RESULT($GNUMAKE)
4555 if test -z "$GNUMAKE"; then
4556     AC_MSG_ERROR([not found. install GNU make.])
4559 AC_MSG_CHECKING([the GNU make version])
4560 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
4561 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
4562 if test "$_make_longver" -ge "038200"; then
4563     AC_MSG_RESULT([$GNUMAKE $_make_version])
4565 elif test "$_make_longver" -ge "038100"; then
4566     if test "$build_os" = "cygwin"; then
4567         AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
4568     fi
4569     AC_MSG_RESULT([$GNUMAKE $_make_version])
4571     dnl ===================================================================
4572     dnl Search all the common names for sha1sum
4573     dnl ===================================================================
4574     AC_PATH_PROGS(SHA1SUM, sha1sum sha1 shasum)
4575     if test -z "$SHA1SUM"; then
4576         AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
4577     fi
4578     AC_MSG_CHECKING([for GNU make bug 20033])
4579     TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
4580     cat > $TESTGMAKEBUG20033/Makefile << EOF
4581 A := \$(wildcard *.a)
4583 .PHONY: all
4584 all: \$(A:.a=.b)
4585         @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
4587 .PHONY: setup
4588 setup:
4589         @touch 1.a 2.a 3.a 4.a 5.a 6.a
4591 define d1
4592 @echo lala \$(1)
4593 @sleep 1
4594 endef
4596 define d2
4597 @echo tyty \$(1)
4598 @sleep 1
4599 endef
4601 %.b : %.a
4602         \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
4603         \$(call d1,\$(CHECKSUM)),\
4604         \$(call d2,\$(CHECKSUM)))
4606     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
4607         no_parallelism_make="YES"
4608         AC_MSG_RESULT([yes, disable parallelism])
4609     else
4610         AC_MSG_RESULT([no, keep parallelism enabled])
4611     fi
4612     rm -rf $TESTGMAKEBUG20033
4613 else
4614     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
4617 # find if gnumake support file function
4618 AC_MSG_CHECKING([whether GNU make supports the 'file' function])
4619 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
4620 cat > $TESTGMAKEFILEFUNC/Makefile << EOF
4621 \$(file >test.txt,Success )
4623 .PHONY: all
4624 all:
4625         @cat test.txt
4628 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
4629 if test -f $TESTGMAKEFILEFUNC/test.txt; then
4630     HAVE_GNUMAKE_FILE_FUNC="YES"
4631     AC_MSG_RESULT([yes])
4632 else
4633     AC_MSG_RESULT([no])
4635 rm -rf $TESTGMAKEFILEFUNC
4636 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
4637 AC_SUBST(GNUMAKE)
4639 _make_ver_check=`$GNUMAKE --version | grep LibreOffice`
4640 STALE_MAKE=
4641 make_warning=
4642 if test "$_make_ver_check" = ""; then
4643    STALE_MAKE=TRUE
4646 HAVE_LD_HASH_STYLE=FALSE
4647 WITH_LINKER_HASH_STYLE=
4648 AC_MSG_CHECKING( for --hash-style gcc linker support )
4649 if test "$GCC" = "yes"; then
4650     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
4651         hash_styles="gnu sysv"
4652     elif test "$with_linker_hash_style" = "no"; then
4653         hash_styles=
4654     else
4655         hash_styles="$with_linker_hash_style"
4656     fi
4658     for hash_style in $hash_styles; do
4659         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
4660         hash_style_ldflags_save=$LDFLAGS
4661         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
4663         AC_LINK_IFELSE([AC_LANG_PROGRAM(
4664             [
4665 #include <stdio.h>
4666             ],[
4667 printf ("");
4668             ])],
4669             [ if ./conftest$EXEEXT; then
4670                   HAVE_LD_HASH_STYLE=TRUE
4671                   WITH_LINKER_HASH_STYLE=$hash_style
4672               fi],
4673             [HAVE_LD_HASH_STYLE=FALSE])
4674         LDFLAGS=$hash_style_ldflags_save
4675     done
4677     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
4678         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
4679     else
4680         AC_MSG_RESULT( no )
4681     fi
4682     LDFLAGS=$hash_style_ldflags_save
4683 else
4684     AC_MSG_RESULT( no )
4686 AC_SUBST(HAVE_LD_HASH_STYLE)
4687 AC_SUBST(WITH_LINKER_HASH_STYLE)
4689 dnl ===================================================================
4690 dnl Check whether there's a Perl version available.
4691 dnl ===================================================================
4692 if test -z "$with_perl_home"; then
4693     AC_PATH_PROG(PERL, perl)
4694 else
4695     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
4696     _perl_path="$with_perl_home/bin/perl"
4697     if test -x "$_perl_path"; then
4698         PERL=$_perl_path
4699     else
4700         AC_MSG_ERROR([$_perl_path not found])
4701     fi
4704 dnl ===================================================================
4705 dnl Testing for Perl version 5 or greater.
4706 dnl $] is the Perl version variable, it is returned as an integer
4707 dnl ===================================================================
4708 if test "$PERL"; then
4709     AC_MSG_CHECKING([the Perl version])
4710     ${PERL} -e "exit($]);"
4711     _perl_version=$?
4712     if test "$_perl_version" -lt 5; then
4713         AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
4714     fi
4715     AC_MSG_RESULT([checked (perl $_perl_version)])
4716 else
4717     AC_MSG_ERROR([Perl not found, install version 5 of Perl])
4720 dnl ===================================================================
4721 dnl Testing for required Perl modules
4722 dnl ===================================================================
4724 AC_MSG_CHECKING([for required Perl modules])
4725 if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'`; then
4726     AC_MSG_RESULT([all modules found])
4727 else
4728     AC_MSG_ERROR([Failed to find some modules])
4732 dnl ===================================================================
4733 dnl Check for pkg-config
4734 dnl ===================================================================
4735 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4736     PKG_PROG_PKG_CONFIG
4739 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
4741     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
4742     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
4743     # explicitly. Or put /path/to/compiler in PATH yourself.
4745     AC_CHECK_TOOL(AR,ar)
4746     AC_CHECK_TOOL(NM,nm)
4747     AC_CHECK_TOOL(OBJDUMP,objdump)
4748     AC_CHECK_TOOL(RANLIB,ranlib)
4749     AC_CHECK_TOOL(STRIP,strip)
4750     if test "$_os" = "WINNT"; then
4751         AC_CHECK_TOOL(DLLTOOL,dlltool)
4752         AC_CHECK_TOOL(WINDRES,windres)
4753     fi
4755 AC_SUBST(AR)
4756 AC_SUBST(DLLTOOL)
4757 AC_SUBST(NM)
4758 AC_SUBST(OBJDUMP)
4759 AC_SUBST(PKG_CONFIG)
4760 AC_SUBST(RANLIB)
4761 AC_SUBST(STRIP)
4762 AC_SUBST(WINDRES)
4764 dnl ===================================================================
4765 dnl pkg-config checks on Mac OS X
4766 dnl ===================================================================
4768 if test $_os = Darwin; then
4769     AC_MSG_CHECKING([for bogus pkg-config])
4770     if test -n "$PKG_CONFIG"; then
4771         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
4772             AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
4773         else
4774             if test "$enable_bogus_pkg_config" = "yes"; then
4775                 AC_MSG_RESULT([yes, user-approved from unknown origin.])
4776             else
4777                 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please remove or hide $PKG_CONFIG])
4778             fi
4779         fi
4780     else
4781         AC_MSG_RESULT([no, good])
4782     fi
4785 dnl ===================================================================
4786 dnl  .NET needs special treatment
4787 dnl (does the above comment really mean .NET, or is it misusing
4788 dnl that to mean Visual Studio .NET 2003 ? And does this also
4789 dnl in fact apply equally to what we actually support, i.e.
4790 dnl Visual Studio 2008 and 2010?)
4791 dnl ===================================================================
4792 if test "$build_os" = "cygwin"; then
4793     dnl Check midl.exe
4794     AC_PATH_PROG(MIDL_PATH, midl.exe)
4795     if test -n "$MIDL_PATH"; then
4796         MIDL_PATH=`dirname "$MIDL_PATH"`
4797     else
4798         AC_MSG_CHECKING([for midl.exe more thoroughly])
4799     fi
4800     if test -n "$with_midl_path"; then
4801         with_midl_path=`cygpath -u "$with_midl_path"`
4802     fi
4803     if test -x "$with_midl_path/midl.exe"; then
4804         MIDL_PATH="$with_midl_path"
4805     fi
4806     if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
4807         MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
4808     fi
4809     if test -z "$MIDL_PATH"; then
4810         vstest=`./oowintool --msvs-productdir`
4811         if test -x "$vstest/Common7/Tools/Bin/midl.exe"; then
4812             MIDL_PATH="$vstest/Common7/Tools/Bin"
4813         fi
4814     fi
4815     if test -z "$MIDL_PATH"; then
4816         winsdktest=`./oowintool --windows-sdk-home`
4817         if test -x "$winsdktest/Bin/midl.exe"; then
4818             MIDL_PATH="$winsdktest/Bin"
4819         elif test -x "$winsdktest/Bin/$SDK_ARCH/midl.exe"; then
4820             MIDL_PATH="$winsdktest/Bin/$SDK_ARCH"
4821         fi
4822     fi
4823     if test ! -x "$MIDL_PATH/midl.exe"; then
4824         AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
4825     else
4826         AC_MSG_RESULT([$MIDL_PATH/midl.exe])
4827     fi
4828     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4829     MIDL_PATH=`cygpath -d "$MIDL_PATH"`
4830     MIDL_PATH=`cygpath -u "$MIDL_PATH"`
4831     AL=al.exe
4833     dnl Check csc.exe
4834     CSC=csc.exe
4835     AC_PATH_PROG(CSC_PATH, $CSC)
4836     if test -n "$CSC_PATH"; then
4837         CSC_PATH=`dirname "$CSC_PATH"`
4838     fi
4839     if test -n "$with_csc_path"; then
4840         with_csc_path=`cygpath -u "$with_csc_path"`
4841     else
4842         AC_MSG_CHECKING([for $CSC more thoroughly])
4843     fi
4844     if test -x "$with_csc_path/$CSC"; then
4845         CSC_PATH="$with_csc_path"
4846     else
4847        csctest=`./oowintool --csc-compilerdir`
4848        if test -x "$csctest/$CSC"; then
4849            CSC_PATH="$csctest"
4850        fi
4851     fi
4852     if test ! -x "$CSC_PATH/$CSC"; then
4853         AC_MSG_ERROR([$CSC not found. Make sure it's in the path or use --with-csc-path])
4854     else
4855         AC_MSG_RESULT([$CSC_PATH/$CSC])
4856     fi
4857     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4858     CSC_PATH=`cygpath -d "$CSC_PATH"`
4859     CSC_PATH=`cygpath -u "$CSC_PATH"`
4861     dnl Check al.exe
4862     AC_PATH_PROG(AL_PATH, al.exe)
4863     if test -n "$AL_PATH"; then
4864         AL_PATH=`dirname "$AL_PATH"`
4865     else
4866         AC_MSG_CHECKING([for al.exe more thoroughly])
4867     fi
4868     if test -n "$with_al_path"; then
4869         with_al_path=`cygpath -u "$with_al_path"`
4870     fi
4871     if test -x "$with_al_path/al.exe"; then
4872         AL_PATH="$with_al_path"
4873     fi
4874     if test -z "$AL_PATH"; then
4875         winsdktest=`./oowintool --windows-sdk-home`
4876         if test -x "$winsdktest/Bin/al.exe"; then
4877             AL_PATH="$winsdktest/Bin"
4878         elif test -x "$winsdktest/Bin/$SDK_ARCH/al.exe"; then
4879             AL_PATH="$winsdktest/Bin/$SDK_ARCH"
4880         fi
4881     fi
4882     if test -z "$AL_PATH"; then
4883         altest=`./oowintool --al-home`
4884         if test -x "$altest/bin/al.exe"; then
4885             AL_PATH="$altest/bin"
4886         elif test -x "$altest/al.exe"; then
4887             AL_PATH="$altest"
4888         fi
4889     fi
4890     if test ! -x "$AL_PATH/al.exe"; then
4891         AC_MSG_ERROR([al.exe not found. Make sure it's in PATH or use --with-al-path])
4892     else
4893         AC_MSG_RESULT([$AL_PATH/al.exe])
4894     fi
4896     # Convert to posix path with 8.3 filename restrictions ( No spaces )
4897     AL_PATH=`cygpath -d "$AL_PATH"`
4898     AL_PATH=`cygpath -u "$AL_PATH"`
4900     dnl Check mscoree.lib / .NET Framework dir
4901     AC_MSG_CHECKING(.NET Framework)
4902     if test -n "$with_dotnet_framework_home"; then
4903         with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
4904     fi
4905         if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
4906         DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
4907     fi
4908     if test -z "$DOTNET_FRAMEWORK_HOME"; then
4909         frametest=`./oowintool --dotnetsdk-dir`
4910         if test -f "$frametest/lib/mscoree.lib"; then
4911             DOTNET_FRAMEWORK_HOME="$frametest"
4912         else
4913             frametest=`./oowintool --windows-sdk-home`
4914             if test -f "$frametest/lib/mscoree.lib" -o -f "$frametest/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
4915                 DOTNET_FRAMEWORK_HOME="$frametest"
4916             fi
4917         fi
4918     fi
4919     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
4920         AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
4921     fi
4922     AC_MSG_RESULT(found)
4924     PathFormat "$MIDL_PATH"
4925     MIDL_PATH="$formatted_path"
4927     PathFormat "$AL_PATH"
4928     AL_PATH="$formatted_path"
4930     PathFormat "$DOTNET_FRAMEWORK_HOME"
4931     DOTNET_FRAMEWORK_HOME="$formatted_path"
4933     PathFormat "$CSC_PATH"
4934     CSC_PATH="$formatted_path"
4938 dnl ===================================================================
4939 dnl Check whether to enable Mono bindings
4940 dnl ===================================================================
4941 if test "$_os" = "Linux"; then
4942     AC_MSG_CHECKING([whether to enable Mono bindings])
4943     CSC_PATH=
4944     CSC=
4945     ENABLE_MONO=NO
4946     if test "$enable_mono" = "yes" ; then
4947         AC_MSG_RESULT([yes])
4948         if test "z$with_csc_path" != "z"; then
4949                 if test -x "$with_csc_path/mcs"; then
4950                         CSC_PATH="$with_csc_path"
4951                 fi
4952                 if test -x "$with_csc_path/bin/mcs"; then
4953                         CSC_PATH="$with_csc_path/bin"
4954                 fi
4955         fi
4956             if test "z$CSC_PATH" = "z"; then
4957             AC_PATH_PROG(MCS, mcs)
4958             test -z "$MCS" || CSC_PATH=`dirname $MCS`
4959             fi
4960                 AL="$CSC_PATH/al"
4961         if test -x "$MCS" -a -x "$AL"; then
4962             MCS_VERSION=`$MCS --version | cut -d" " -f5`
4963             if test "`echo $MCS_VERSION | cut -d"." -f1`" -gt "1" || \
4964                test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
4965                     "`echo $MCS_VERSION | cut -d"." -f2`" -ge "2" || \
4966                test "`echo $MCS_VERSION | cut -d"." -f1`" = "1" -a \
4967                     "`echo $MCS_VERSION | cut -d"." -f2`" = "1" -a \
4968                         "`echo $MCS_VERSION | cut -d"." -f3`" -ge "8"; then
4969                 ENABLE_MONO=YES
4970                 CSC=$MCS
4971                 AC_PATH_PROG(GMCS, gmcs, no)
4972                 AC_PATH_PROG(MKBUNDLE2, mkbundle2, no)
4973                 AC_PATH_PROG(MKBUNDLE, mkbundle, no)
4974                 if test "x$MKBUNDLE2" != "xno"; then
4975                     MKBUNDLE=$MKBUNDLE2
4976                 fi
4977                 GMCS_VERSION=`$GMCS --version | cut -d" " -f5`
4978                 if test "`echo $GMCS_VERSION | cut -d"." -f1`" -gt "1" || \
4979                    test "`echo $GMCS_VERSION | cut -d"." -f1`" = "1" -a \
4980                         "`echo $GMCS_VERSION | cut -d"." -f2`" -ge "3" || \
4981                    test "`echo $GMCS_VERSION | cut -d"." -f1`" = "1" -a \
4982                     "`echo $GMCS_VERSION | cut -d"." -f2`" = "2" -a \
4983                     "`echo $GMCS_VERSION | cut -d"." -f3`" -ge "3"; then
4984                     # mkbundle2 does not work on ppc, http://bugzilla.ximian.com/show_bug.cgi?id=81525
4985                     if test "`uname -m`" != "ppc" -a "`uname -m`" != "ppc64" ; then
4986                     ENABLE_MONO_CLIMAKER=YES
4987                     AC_MSG_NOTICE([mono is up-to-date enough - building mono climaker])
4988                     fi
4989                 fi
4990             else
4991                 if test -n "$enable_mono" ; then
4992                     AC_MSG_ERROR([no, mcs >= 1.1.8 is needed.])
4993                 fi
4994             fi
4995         else
4996             if test -n "$enable_mono"; then
4997                 AC_MSG_ERROR([mcs or al not found. Make sure they're in the path or use --with-csc-path])
4998             fi
4999         fi
5000         PKG_CHECK_MODULES([MONO], [mono-2 glib-2.0],,[PKG_CHECK_MODULES([MONO], [mono >= 1.1.8 glib-2.0])])
5001     else
5002         AC_MSG_RESULT([no])
5003     fi
5005     MONO_GAC_ROOT=
5006     if test -n "$with_mono_gac_root" -a "$with_mono_gac_root" != "no" ; then
5007         MONO_GAC_ROOT=$with_mono_gac_root
5008     fi
5011 if test "$ENABLE_MONO" = "YES" -o "$COM" = "MSC" ; then
5012     BUILD_CLI=YES
5013 else
5014     BUILD_CLI=NO
5016 AC_SUBST(BUILD_CLI)
5017 AC_SUBST(CSC_PATH)
5018 AC_SUBST(CSC)
5019 AC_SUBST(AL)
5020 AC_SUBST(ENABLE_MONO)
5021 AC_SUBST(MONO_CFLAGS)
5022 AC_SUBST(MONO_LIBS)
5023 AC_SUBST(MONO_GAC_ROOT)
5024 AC_SUBST(ENABLE_MONO_CLIMAKER)
5025 AC_SUBST(MKBUNDLE)
5027 dnl ===================================================================
5028 dnl Check if stdc headers are available excluding MSVC.
5029 dnl ===================================================================
5030 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5031     AC_HEADER_STDC
5034 dnl ===================================================================
5035 dnl Testing for C++ compiler and version...
5036 dnl ===================================================================
5038 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5039     # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
5040     save_CXXFLAGS=$CXXFLAGS
5041     AC_PROG_CXX
5042     CXXFLAGS=$save_CXXFLAGS
5043 else
5044     if test -n "$CC" -a -z "$CXX"; then
5045         CXX="$CC"
5046     fi
5049 dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
5050 if test "$GXX" = "yes"; then
5051     AC_MSG_CHECKING([the GNU C++ compiler version])
5053     _gpp_version=`$CXX -dumpversion`
5054     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
5056     if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401"; then
5057         if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0"; then
5058             export CXX="$GCC_HOME/bin/g++-4.0"
5059             _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
5060             if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401"; then
5061                 _gpp_majmin=$_gpp_majmin_2
5062             fi
5063         fi
5064         if test "$_gpp_majmin" -ge "401"; then
5065             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])
5066         else
5067             AC_MSG_RESULT([implicitly using CXX=$CXX])
5068         fi
5069     else
5070         AC_MSG_RESULT([checked (g++ $_gpp_version)])
5071     fi
5073     if test "$_gpp_majmin" = "304"; then
5074         AC_MSG_CHECKING([whether $CXX has the enum bug])
5075         AC_RUN_IFELSE([AC_LANG_SOURCE([[
5076             extern "C" void abort (void);
5077             extern "C" void exit (int status);
5079             enum E { E0, E1, E2, E3, E4, E5 };
5081             void test (enum E e)
5082             {
5083                 if (e == E2 || e == E3 || e == E1)
5084                     exit (1);
5085             }
5087             int main (void)
5088             {
5089                 test (E4);
5090                 test (E5);
5091                 test (E0);
5092                 return 0;
5093             }
5094             ]])],[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])],[])
5095     fi
5099 # prefx CXX with ccache if needed
5101 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5102     if test "$CCACHE" != ""; then
5103         AC_MSG_CHECKING([whether $CXX is already ccached])
5104         AC_LANG_PUSH([C++])
5105         save_CXXFLAGS=$CXXFLAGS
5106         CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
5107         dnl an empty program will do, we're checking the compiler flags
5108         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
5109                           [use_ccache=yes], [use_ccache=no])
5110         if test $use_ccache = yes; then
5111             AC_MSG_RESULT([yes])
5112         else
5113             CXX="$CCACHE $CXX"
5114             AC_MSG_RESULT([no])
5115         fi
5116         CXXFLAGS=$save_CXXFLAGS
5117         AC_LANG_POP([C++])
5118     fi
5121 dnl ===================================================================
5122 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
5123 dnl ===================================================================
5125 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5126     AC_PROG_CXXCPP
5128     dnl Check whether there's a C pre-processor.
5129     dnl ===================================================================
5130     dnl When using SunStudio compiler, there is a bug with the cc
5131     dnl preprocessor, so use CC preprocessor as the cc preprocessor
5132     dnl See Issuezilla #445.
5133     dnl ===================================================================
5134     if test "$_os" = "SunOS"; then
5135         CPP=$CXXCPP
5136     else
5137         AC_PROG_CPP
5138     fi
5142 dnl ===================================================================
5143 dnl Find integral type sizes and alignments
5144 dnl ===================================================================
5146 if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
5148     AC_CHECK_SIZEOF(long)
5149     AC_CHECK_SIZEOF(short)
5150     AC_CHECK_SIZEOF(int)
5151     AC_CHECK_SIZEOF(long long)
5152     AC_CHECK_SIZEOF(double)
5153     AC_CHECK_SIZEOF(void*)
5155     SIZEOF_SHORT=$ac_cv_sizeof_short
5156     SIZEOF_INT=$ac_cv_sizeof_int
5157     SIZEOF_LONG=$ac_cv_sizeof_long
5158     SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
5159     SIZEOF_DOUBLE=$ac_cv_sizeof_double
5160     SIZEOF_POINTER=$ac_cv_sizeof_voidp
5162     dnl Allow build without AC_CHECK_ALIGNOF, grrr
5163     m4_pattern_allow([AC_CHECK_ALIGNOF])
5164     m4_ifdef([AC_CHECK_ALIGNOF],
5165         [
5166             AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
5167             AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
5168             AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
5169             AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
5170         ],
5171         [
5172             case "$_os-$host_cpu" in
5173             Darwin-powerpc)
5174                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=1
5175                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=1
5176                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=1
5177                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=1
5178                 ;;
5179             Linux-i686)
5180                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5181                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5182                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
5183                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
5184                 ;;
5185             Linux-x86_64)
5186                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
5187                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
5188                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
5189                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
5190                 ;;
5191             *)
5192                 if test -z "$ac_cv_alignof_short" -o \
5193                         -z "$ac_cv_alignof_int" -o \
5194                         -z "$ac_cv_alignof_long" -o \
5195                         -z "$ac_cv_alignof_double"; then
5196                    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.])
5197                 fi
5198                 ;;
5199             esac
5200         ])
5202     ALIGNOF_SHORT=$ac_cv_alignof_short
5203     ALIGNOF_INT=$ac_cv_alignof_int
5204     ALIGNOF_LONG=$ac_cv_alignof_long
5205     ALIGNOF_DOUBLE=$ac_cv_alignof_double
5207     AC_C_BIGENDIAN
5208     WORDS_BIGENDIAN=$ac_cv_c_bigendian
5210     dnl Check for large file support
5211     AC_SYS_LARGEFILE
5212     if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
5213         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
5214     fi
5215     if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
5216         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
5217     fi
5218 else
5219     # Hardcode for MSVC
5220     SIZEOF_SHORT=2
5221     SIZEOF_INT=4
5222     SIZEOF_LONG=4
5223     SIZEOF_LONGLONG=8
5224     if test "$BITNESS_OVERRIDE" = ""; then
5225         SIZEOF_POINTER=4
5226     else
5227         SIZEOF_POINTER=8
5228     fi
5229     ALIGNOF_SHORT=2
5230     ALIGNOF_INT=4
5231     ALIGNOF_LONG=4
5232     ALIGNOF_DOUBLE=8
5233     WORDS_BIGENDIAN=no
5234     LFS_CFLAGS=''
5236 AC_SUBST(WORDS_BIGENDIAN)
5237 AC_SUBST(LFS_CFLAGS)
5239 AC_SUBST(SIZEOF_SHORT)
5240 AC_SUBST(SIZEOF_INT)
5241 AC_SUBST(SIZEOF_LONG)
5242 AC_SUBST(SIZEOF_LONGLONG)
5243 AC_SUBST(SIZEOF_DOUBLE)
5244 AC_SUBST(SIZEOF_POINTER)
5245 AC_SUBST(ALIGNOF_SHORT)
5246 AC_SUBST(ALIGNOF_INT)
5247 AC_SUBST(ALIGNOF_LONG)
5248 AC_SUBST(ALIGNOF_DOUBLE)
5250 dnl ===================================================================
5251 dnl Check if valgrind headers are available
5252 dnl ===================================================================
5253 if test "$cross_compiling" = yes -o "$ENABLE_DBGUTIL" != TRUE; then
5254     ENABLE_VALGRIND=FALSE
5255 else
5256     prev_cppflags=$CPPFLAGS
5257     CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
5258     AC_CHECK_HEADER([valgrind/valgrind.h],
5259         [ENABLE_VALGRIND=TRUE],[ENABLE_VALGRIND=FALSE])
5260     CPPFLAGS=$prev_cppflags
5262 AC_SUBST([ENABLE_VALGRIND])
5263 if test "$ENABLE_VALGRIND" = FALSE; then
5264     VALGRIND_CFLAGS=
5266 AC_SUBST([VALGRIND_CFLAGS])
5268 dnl ===================================================================
5269 dnl Compiler plugins
5270 dnl ===================================================================
5272 COMPILER_PLUGINS=
5273 # currently only Clang
5274 if test "$COM_GCC_IS_CLANG" = "TRUE"; then
5275     if test -n "$enable_compiler_plugins"; then
5276         compiler_plugins="$enable_compiler_plugins"
5277     elif test -n "$ENABLE_DBGUTIL"; then
5278         compiler_plugins=test
5279     else
5280         compiler_plugins=no
5281     fi
5282     if test "$compiler_plugins" != "no"; then
5283         AC_LANG_PUSH([C++])
5284         save_CPPFLAGS=$CPPFLAGS
5285         CPPFLAGS="$CPPFLAGS $CLANGPLUGIN_CPPFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
5286         AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
5287             [COMPILER_PLUGINS=TRUE],
5288             [
5289             if test "$compiler_plugins" = "yes"; then
5290                 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
5291             else
5292                 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
5293                 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
5294             fi
5295             ])
5296         CPPFLAGS=$save_CPPFLAGS
5297         AC_LANG_POP([C++])
5298     fi
5299 else
5300     if test "$enable_compiler_plugins" = "yes"; then
5301         AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
5302     fi
5304 AC_SUBST(COMPILER_PLUGINS)
5305 AC_SUBST(CLANGPLUGIN_CPPFLAGS)
5307 dnl ===================================================================
5308 dnl Set the MinGW sys-root
5309 dnl ===================================================================
5310 if test "$WITH_MINGW" = "yes"; then
5311     for sysroot in /usr/i686-w64-mingw32/sys-root/mingw; do
5312         if test -d "$sysroot"; then
5313             MINGW_SYSROOT="$sysroot"
5314             break
5315         fi
5316     done
5318 AC_SUBST([MINGW_SYSROOT])
5320 dnl ===================================================================
5321 dnl Set the MinGW include directories
5322 dnl ===================================================================
5323 if test "$WITH_MINGW" = "yes"; then
5324     AC_MSG_CHECKING([for MinGW include path])
5325     cat >conftest.$ac_ext <<_ACEOF
5326 #include <stddef.h>
5327 #include <bits/c++config.h>
5328 _ACEOF
5329     _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`
5330     rm conftest.$ac_ext
5331     if test -z "$_mingw_lib_include_path"; then
5332         _mingw_lib_include_path="NO_LIB_INCLUDE"
5333         AC_MSG_RESULT([no MinGW include path])
5334     else
5335         AC_MSG_RESULT([$_mingw_lib_include_path])
5336     fi
5337     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
5338     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
5340     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
5341     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
5343     AC_LANG_PUSH([C++])
5345     AC_MSG_CHECKING([for dynamic libgcc])
5346     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5347 #include <iostream>
5348 using namespace std;
5349 ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
5350             MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
5351             if test -n "$MINGW_GCCDLL"; then
5352                 MINGW_SHARED_GCCLIB=YES
5353                 AC_MSG_RESULT([ $MINGW_GCCDLL])
5354             else
5355                 MINGW_SHARED_GCCLIB=NO
5356                 AC_MSG_RESULT([no])
5357             fi
5358        ],[ AC_MSG_RESULT([no])
5360     ])
5362     AC_MSG_CHECKING([for dynamic libstdc++])
5363     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5364 #include <iostream>
5365 using namespace std;
5366 ]], [[ cout << "Hello there." << endl; ]])],[
5367             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
5368             if test -n "$MINGW_GXXDLL"; then
5369                 mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
5370                 mingw_gxxdll_root=${mingw_gxxdll_root#lib}
5371                 if test "$CROSS_COMPILING" = "YES"; then
5372                     dnl m4 escaping!
5373                     mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
5374                 fi
5375                 MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
5376                 MINGW_SHARED_GXXLIB=YES
5377                 AC_MSG_RESULT([$MINGW_GXXDLL])
5378             else
5379                 MINGW_SHARED_GXXLIB=NO
5380                 AC_MSG_RESULT([no])
5381             fi
5382        ],[ AC_MSG_RESULT([no])
5384     ])
5386     AC_LANG_POP([C++])
5388     AC_SUBST(MINGW_CLIB_DIR)
5389     AC_SUBST(MINGW_SHARED_GCCLIB)
5390     AC_SUBST(MINGW_SHARED_GXXLIB)
5391     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
5392     AC_SUBST(MINGW_GCCDLL)
5393     AC_SUBST(MINGW_GXXDLL)
5396 dnl ===================================================================
5397 dnl Extra checking for the SunOS compiler
5398 dnl ===================================================================
5399 if test "$_os" = "SunOS"; then
5400     dnl SunStudio C++ compiler packaged with SunStudio C compiler
5401     if test "$CC" = "cc"; then
5402     AC_MSG_CHECKING([SunStudio C++ Compiler])
5403         if test "$CXX" != "CC"; then
5404             AC_MSG_WARN([SunStudio C++ was not found])
5405             add_warning "SunStudio C++ was not found"
5406         else
5407             AC_MSG_RESULT([checked])
5408         fi
5409     fi
5412 dnl *************************************************************
5413 dnl Testing for exception handling - dwarf2 or sjlj exceptions...
5414 dnl *************************************************************
5415 if test "$WITH_MINGW" = "yes"; then
5416     AC_MSG_CHECKING([exception type])
5417     AC_LANG_PUSH([C++])
5418     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
5420         extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
5422         ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
5423     ])
5424     AC_MSG_RESULT($exceptions_type)
5425     AC_LANG_POP([C++])
5428 EXCEPTIONS="$exceptions_type"
5429 AC_SUBST(EXCEPTIONS)
5431 dnl ===================================================================
5432 dnl thread-safe statics
5433 dnl ===================================================================
5434 AC_MSG_CHECKING([whether $CXX supports thread safe statics])
5435 unset HAVE_THREADSAFE_STATICS
5436 if test "$GCC" = "yes"; then
5437     dnl -fthreadsafe-statics is available since GCC 4, so always available for
5438     dnl us.  However, some C++ runtimes use a single lock for all static
5439     dnl variables, which can cause deadlock in multi-threaded applications.
5440     dnl This is not easily tested here; for POSIX-based systems, if executing
5441     dnl the following C++ program does not terminate then the tool chain
5442     dnl apparently has this problem:
5443     dnl
5444     dnl   #include <pthread.h>
5445     dnl   int h() { return 0; }
5446     dnl   void * g(void * unused) {
5447     dnl     static int n = h();
5448     dnl     return &n;
5449     dnl   }
5450     dnl   int f() {
5451     dnl     pthread_t t;
5452     dnl     pthread_create(&t, 0, g, 0);
5453     dnl     pthread_join(t, 0);
5454     dnl     return 0;
5455     dnl   }
5456     dnl   int main() {
5457     dnl     static int n = f();
5458     dnl     return n;
5459     dnl   }
5460     dnl
5461     dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
5462     dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
5463     dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
5464     dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
5465     dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
5466     dnl difference there.  Conservative advice from Jakub Jelinek is to assume
5467     dnl it working in GCC >= 4.3:
5468     if test "$_os" = "Darwin" -o $_os = Android -o "${GCCVER?}" -lt 040300; then
5469         AC_MSG_RESULT([broken (i.e., no)])
5470     else
5471         HAVE_THREADSAFE_STATICS=TRUE
5472         AC_MSG_RESULT([yes])
5473     fi
5474 else
5475     AC_MSG_RESULT([unknown (assuming no)])
5477 AC_SUBST(HAVE_THREADSAFE_STATICS)
5479 dnl ===================================================================
5480 dnl visibility and c++0x features
5481 dnl ===================================================================
5482 if test "$GCC" = "yes"; then
5483     AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
5484     save_CFLAGS=$CFLAGS
5485     CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
5486     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
5487     CFLAGS=$save_CFLAGS
5489     if test "$COM_GCC_IS_CLANG" = TRUE -a $_os = Darwin; then
5490         # It seems that with Apple's Clang, visibility doesn't work as
5491         # we would want at least in the connectivity and dbaccess
5492         # modules. This might be because of something peculiar in
5493         # those modules? Whatever.
5494         HAVE_GCC_VISIBILITY_FEATURE=
5495     fi
5497     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5498         AC_MSG_RESULT([yes])
5499     else
5500         AC_MSG_RESULT([no])
5501     fi
5503     AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
5504     save_CFLAGS=$CFLAGS
5505     CFLAGS="$CFLAGS -Werror -Wno-long-double"
5506     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
5507     CFLAGS=$save_CFLAGS
5508     if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
5509         AC_MSG_RESULT([yes])
5510     else
5511         AC_MSG_RESULT([no])
5512     fi
5514     AC_MSG_CHECKING([whether $CC supports -mno-avx])
5515     save_CFLAGS=$CFLAGS
5516     CFLAGS="$CFLAGS -Werror -mno-avx"
5517     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
5518     CFLAGS=$save_CFLAGS
5519     if test "$HAVE_GCC_AVX" = "TRUE"; then
5520         AC_MSG_RESULT([yes])
5521     else
5522         AC_MSG_RESULT([no])
5523     fi
5525     AC_MSG_CHECKING([whether $CC supports atomic functions])
5526     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
5527     int v = 0;
5528     if (__sync_add_and_fetch(&v, 1) != 1 ||
5529         __sync_sub_and_fetch(&v, 1) != 0)
5530         return 1;
5531     __sync_synchronize();
5532     if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
5533         v != 1)
5534         return 1;
5535     return 0;
5536 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
5537     if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
5538         AC_MSG_RESULT([yes])
5539     else
5540         AC_MSG_RESULT([no])
5541     fi
5543     AC_MSG_CHECKING([whether $CXX supports -std=gnu++0x without Language Defect 757])
5544     if test "$GCCVER" -ge 040700 -a "$GCCVER" -lt 040702; then
5545         AC_MSG_NOTICE([Not using -std=gnu++0x on $CXX version 4.7.0/4.7.1 due to libstdc++ ABI breakage.])
5546     else
5547         save_CXXFLAGS=$CXXFLAGS
5548         CXXFLAGS="$CXXFLAGS -std=gnu++0x"
5549         AC_LANG_PUSH([C++])
5551         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5552 #include <stddef.h>
5554 #include <vector>
5555     // some Clang fail when compiling against GCC 4.7 headers with --std=gnu++0x
5557 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
5559 namespace
5561         struct b
5562         {
5563                 int i;
5564                 int j;
5565         };
5567 ]], [[
5568 struct a
5570         int i;
5571         int j;
5573 a thinga[]={{0,0}, {1,1}};
5574 b thingb[]={{0,0}, {1,1}};
5575 size_t i = sizeof(sal_n_array_size(thinga));
5576 size_t j = sizeof(sal_n_array_size(thingb));
5577 return !(i != 0 && j != 0);
5578 ]])],[HAVE_CXX0X=TRUE],[])
5580         AC_LANG_POP([C++])
5581         CXXFLAGS=$save_CXXFLAGS
5582     fi
5583     if test "$HAVE_CXX0X" = "TRUE"; then
5584         AC_MSG_RESULT([yes])
5585     else
5586         AC_MSG_RESULT([no])
5587     fi
5590 AC_SUBST(HAVE_CXX0X)
5591 AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
5592 AC_SUBST(HAVE_GCC_AVX)
5593 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
5595 dnl ===================================================================
5596 dnl Check for C++11 perfect forwarding support
5597 dnl ===================================================================
5598 HAVE_CXX11_PERFECT_FORWARDING=
5599 AC_MSG_CHECKING([whether $CXX supports C++11 perfect forwarding])
5600 save_CXXFLAGS=$CXXFLAGS
5601 if test "$HAVE_CXX0X" = TRUE; then
5602     CXXFLAGS="$CXXFLAGS -std=gnu++0x"
5604 AC_LANG_PUSH([C++])
5605 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5606         #include <utility>
5607         template<typename T, typename... Args> T * f(Args &&... v) {
5608             return new T(std::forward<Args>(v)...);
5609         }
5610     ]], [[
5611         f<int>(0);
5612     ]])], [perfect_forwarding=yes], [perfect_forwarding=no])
5613 AC_LANG_POP([C++])
5614 CXXFLAGS=$save_CXXFLAGS
5615 AC_MSG_RESULT([$perfect_forwarding])
5616 if test "$perfect_forwarding" = yes; then
5617     HAVE_CXX11_PERFECT_FORWARDING=TRUE
5619 AC_SUBST([HAVE_CXX11_PERFECT_FORWARDING])
5621 dnl ===================================================================
5622 dnl system stl sanity tests
5623 dnl ===================================================================
5624 HAVE_GCC_VISIBILITY_BROKEN=
5625 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
5627     AC_LANG_PUSH([C++])
5629     save_CPPFLAGS="$CPPFLAGS"
5630     if test -n "$MACOSX_SDK_PATH"; then
5631         CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
5632     fi
5634     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5635         dnl gcc#19664, gcc#22482, rhbz#162935
5636         AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
5637         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
5638         AC_MSG_RESULT([$stlvisok])
5639         if test "$stlvisok" = "no"; then
5640             AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
5641             add_warning "Your gcc STL headers are not visibility safe. Disabling visibility"
5642             unset HAVE_GCC_VISIBILITY_FEATURE
5643         fi
5644     fi
5646     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5647         sharedlink_ldflags_save=$LDFLAGS
5648         LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
5650         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
5651         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
5652 #include <sstream>
5653 using namespace std;
5654             ]], [[
5655 istringstream strm( "test" ); return 0;
5656             ]])],
5657             # Ugh, surely bad to assume an error message will contain
5658             # the word "unresolvable", a problem with
5659             # -fvisibility-inlines-hidden and STL headers might cause
5660             # some more obscure message on some platform, and anway,
5661             # the error message could be localised.
5662             [$EGREP -q unresolvable conftest.err;
5663             if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
5664         ])
5665         AC_MSG_RESULT([$gccvisok])
5666         if test "$gccvisok" = "no"; then
5667             AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
5668             add_warning "Your gcc is not -fvisibility-inlines-hidden safe, disabling that."
5669             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
5670         fi
5672         LDFLAGS=$sharedlink_ldflags_save
5673     fi
5675     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
5676         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
5677         cat > conftestlib1.cc <<_ACEOF
5678 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
5679 struct S2: S1<int> { virtual ~S2(); };
5680 S2::~S2() {}
5681 _ACEOF
5682         cat > conftestlib2.cc <<_ACEOF
5683 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
5684 struct S2: S1<int> { virtual ~S2(); };
5685 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
5686 _ACEOF
5687         gccvisinlineshiddenok=yes
5688         if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
5689             gccvisinlineshiddenok=no
5690         else
5691             if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $LINKFLAGSNOUNDEFS -o libconftest2$DLLPOST >/dev/null 2>&5; then
5692                 gccvisinlineshiddenok=no
5693             fi
5694         fi
5696         rm -fr libconftest*
5697         AC_MSG_RESULT([$gccvisinlineshiddenok])
5698         if test "$gccvisinlineshiddenok" = "no"; then
5699             AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
5700             add_warning "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that."
5701             HAVE_GCC_VISIBILITY_BROKEN="TRUE"
5702         fi
5703     fi
5705     if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
5706         AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
5707         cat >visibility.cxx <<_ACEOF
5708 #pragma GCC visibility push(hidden)
5709 struct __attribute__ ((visibility ("default"))) TestStruct {
5710   static void Init();
5712 __attribute__ ((visibility ("default"))) void TestFunc() {
5713   TestStruct::Init();
5715 _ACEOF
5716         if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
5717             gccvisbroken=yes
5718         else
5719             case "$host_cpu" in
5720             i?86|x86_64)
5721                 if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
5722                     gccvisbroken=no
5723                 else
5724                     if $EGREP -q '@PLT|@GOT' visibility.s; then
5725                         gccvisbroken=no
5726                     else
5727                         gccvisbroken=yes
5728                     fi
5729                 fi
5730                 ;;
5731             *)
5732                 gccvisbroken=no
5733                 ;;
5734             esac
5735         fi
5736         rm -f visibility.s visibility.cxx
5738         AC_MSG_RESULT([$gccvisbroken])
5739         if test "$gccvisbroken" = "yes"; then
5740             AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
5741             add_warning "Your gcc is not -fvisibility=hidden safe. Disabling visibility"
5742             unset HAVE_GCC_VISIBILITY_FEATURE
5743         fi
5744     fi
5746     CPPFLAGS="$save_CPPFLAGS"
5748     AC_LANG_POP([C++])
5751 AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
5752 AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
5754 dnl ===================================================================
5755 dnl SFINAE test
5756 dnl Pre-C++11 does not allow types without linkage as template arguments.
5757 dnl Substitution Failure Is Not An Error is an idiom that disables
5758 dnl template instances that would cause an error, without actually
5759 dnl causing an error. Old gcc (pre-4.0.2) however causes a real error.
5760 dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21514
5761 dnl ===================================================================
5762 HAVE_SFINAE_ANONYMOUS_BROKEN=
5763 if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
5765     AC_LANG_PUSH([C++])
5766     AC_MSG_CHECKING([if SFINAE is broken with anonymous types])
5767     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
5768 enum { AnonymousEnumValue };
5769 template< typename T > class TestPredicate {};
5770 template<> class TestPredicate< int > { public: typedef bool Type; };
5771 template< typename T >
5772 bool test( const T&, typename TestPredicate< T >::Type = false )
5773     { return true; };
5774 void test( ... );
5775             ]], [[
5776     test( 10 );
5777     test( AnonymousEnumValue );
5778             ]])],[sfinae_anonymous_broken=no],[sfinae_anonymous_broken=yes
5779         ])
5780         AC_MSG_RESULT([$sfinae_anonymous_broken])
5781         if test "$sfinae_anonymous_broken" = "yes"; then
5782             HAVE_SFINAE_ANONYMOUS_BROKEN="TRUE"
5783         fi
5784     AC_LANG_POP([C++])
5787 AC_SUBST(HAVE_SFINAE_ANONYMOUS_BROKEN)
5789 dnl ===================================================================
5790 dnl  Clang++ tests
5791 dnl ===================================================================
5793 HAVE_GCC_FNO_DEFAULT_INLINE=
5794 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
5795 if test "$GCC" = "yes"; then
5796     AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
5797     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5798         # Option just ignored and silly warning that isn't a real
5799         # warning printed
5800         :
5801     else
5802         AC_LANG_PUSH([C++])
5803         save_CXXFLAGS=$CXXFLAGS
5804         CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
5805         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
5806         CXXFLAGS=$save_CXXFLAGS
5807         AC_LANG_POP([C++])
5808     fi
5809     if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
5810         AC_MSG_RESULT([yes])
5811     else
5812         AC_MSG_RESULT([no])
5813     fi
5815     AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
5816     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
5817         # As above
5818         :
5819     else
5820         AC_LANG_PUSH([C++])
5821         save_CXXFLAGS=$CXXFLAGS
5822         CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
5823         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
5824         CXXFLAGS=$save_CXXFLAGS
5825         AC_LANG_POP([C++])
5826     fi
5827     if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
5828         AC_MSG_RESULT([yes])
5829     else
5830         AC_MSG_RESULT([no])
5831     fi
5833 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
5834 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
5837 dnl ===================================================================
5838 dnl allocator
5839 dnl ===================================================================
5840 AC_MSG_CHECKING([which memory allocator to use])
5841 if test "$with_alloc" = "system"; then
5842     AC_MSG_RESULT([system])
5843     ALLOC="SYS_ALLOC"
5844     AC_CHECK_FUNCS([malloc realloc calloc free])
5846 if test "$with_alloc" = "tcmalloc"; then
5847     AC_MSG_RESULT(tcmalloc)
5848     if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
5849         AC_MSG_ERROR([tcmalloc only available/usable on ix86])
5850     fi
5851     AC_CHECK_LIB([tcmalloc], [malloc], [:],
5852         [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
5853     ALLOC="TCMALLOC"
5855 if test "$with_alloc" = "jemalloc"; then
5856     if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
5857         AC_MSG_RESULT(jemalloc)
5858         save_CFLAGS=$CFLAGS
5859         CFLAGS="$CFLAGS -pthread"
5860         AC_CHECK_LIB([jemalloc], [malloc], [:],
5861             [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
5862         ALLOC="JEMALLOC"
5863         CFLAGS=$save_CFLAGS
5864     else
5865         AC_MSG_RESULT([system])
5866         ALLOC="SYS_ALLOC"
5867         AC_CHECK_FUNCS([malloc realloc calloc free])
5868     fi
5870 if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
5871     AC_MSG_RESULT([internal])
5873 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
5874 AC_SUBST(HAVE_POSIX_FALLOCATE)
5875 AC_SUBST(ALLOC)
5877 dnl ===================================================================
5878 dnl Custom build version
5879 dnl ===================================================================
5881 AC_MSG_CHECKING([whether to add custom build version])
5882 if test "$with_build_version" != ""; then
5883     BUILD_VER_STRING=$with_build_version
5884     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
5885 else
5886     BUILD_VER_STRING=
5887     AC_MSG_RESULT([no])
5889 AC_SUBST(BUILD_VER_STRING)
5891 dnl ===================================================================
5892 dnl Java support enable
5893 dnl ===================================================================
5894 AC_MSG_CHECKING([whether to build with Java support])
5895 if test "$with_java" != "no"; then
5896     if test "$DISABLE_SCRIPTING" = TRUE; then
5897         AC_MSG_RESULT([no, overridden by --disable-scripting])
5898         SOLAR_JAVA=""
5899         with_java=no
5900     else
5901         AC_MSG_RESULT([yes])
5902         SOLAR_JAVA="TRUE"
5903     fi
5904 else
5905     AC_MSG_RESULT([no])
5906     SOLAR_JAVA=""
5909 AC_SUBST(SOLAR_JAVA)
5911 dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
5912 dnl want there to be *run-time* (and build-time) support for Java extensions in the
5913 dnl built LibreOffice.
5915 dnl SOLAR_JAVA="BUILD" is claimed to indicate build-time only support
5916 dnl (no runtime support). It doesn't seem to ever be set to this
5917 dnl value, though, and everywhere SOLAR_JAVA is only checked for being
5918 dnl empty or non-empty.
5920 dnl SOLAR_JAVA="" indicate no java support at all
5922 JITC_PROCESSOR_TYPE=""
5923 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
5924     # IBMs JDK needs this...
5925     JITC_PROCESSOR_TYPE=6
5926     export JITC_PROCESSOR_TYPE
5928 AC_SUBST([JITC_PROCESSOR_TYPE])
5930 if test $_os = "WINNT"; then
5931     AC_MSG_CHECKING([for Microsoft_VC${VCVER}_CRT_x86.msm])
5932     if ./oowintool --msvc-find-msms; then
5933         AC_MSG_RESULT([yes])
5934         SCPDEFS="$SCPDEFS -DWITH_VC"$VCVER"_REDIST"
5935     else
5936         AC_MSG_RESULT([no])
5937     fi
5940 dnl ===================================================================
5941 dnl Checks for Java
5942 dnl ===================================================================
5943 if test "$SOLAR_JAVA" != ""; then
5945     # Windows-specific tests
5946     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5947         if test "$BITNESS_OVERRIDE" = 64; then
5948             bitness="64-bit"
5949             otherbitness="32-bit"
5950         else
5951             bitness="32-bit"
5952             otherbitness="64-bit"
5953         fi
5955         if test -z "$with_jdk_home"; then
5957             # Unfortunately apparently no way to find, if needed, the 64-bit
5958             # JDK in the Registry from the 32-bit Perl oowintool
5960             _jdk_home=`./oowintool --jdk-home`
5961             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
5962                 with_jdk_home="$_jdk_home"
5963                 howfound="found by oowintool"
5964             else
5965                 AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
5966             fi
5967         else
5968             test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
5969             howfound="you passed"
5970         fi
5971     fi
5973     JAVA_HOME=; export JAVA_HOME
5974     if test -z "$with_jdk_home"; then
5975         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
5976     else
5977         _java_path="$with_jdk_home/bin/$with_java"
5978         dnl Check if there is a Java interpreter at all.
5979         if test -x "$_java_path"; then
5980             JAVAINTERPRETER=$_java_path
5981         else
5982             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
5983         fi
5984     fi
5986     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
5987         # Check that the JDK found is correct architecture
5988         # Why is this necessary, we don't link with any library from the JDK I think,
5990         shortjdkhome=`cygpath -d "$with_jdk_home"`
5991         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
5992             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
5993             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
5994         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
5995             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
5996             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
5997         fi
5999         if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
6000             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
6001         fi
6002         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
6003         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
6004     elif test "$_os" = "Darwin"; then
6005         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
6006         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
6007         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
6008         AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
6009         if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
6010             AC_MSG_RESULT([yes])
6011             JAVAIFLAGS=-d32
6012         else
6013             AC_MSG_RESULT([no])
6014         fi
6015     fi
6018 dnl ===================================================================
6019 dnl Checks for JDK.
6020 dnl ===================================================================
6022 # Note that JAVA_HOME as for now always means the *build* platform's
6023 # JAVA_HOME. Whether all the complexity here actually is needed any
6024 # more or not, no idea.
6026 if test "$SOLAR_JAVA" != ""; then
6027     _gij_longver=0
6028     AC_MSG_CHECKING([the installed JDK])
6029     if test -n "$JAVAINTERPRETER"; then
6030         dnl java -version sends output to stderr!
6031         if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6032             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6033         elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
6034             JDK=gcj
6035             AC_MSG_RESULT([checked (gcj)])
6036             _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
6037             _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
6039         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
6040             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
6041         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
6042             JDK=ibm
6044             dnl IBM JDK specific tests
6045             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6046             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6048             if test "$_jdk_ver" -lt 10500; then
6049                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
6050             fi
6052             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
6054             if test "$with_jdk_home" = ""; then
6055                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
6056 you must use the "--with-jdk-home" configure option explicitly])
6057             fi
6059            JAVA_HOME=$with_jdk_home
6061         else
6062             JDK=sun
6064             dnl Sun JDK specific tests
6065             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
6066             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
6068             if test "$_jdk_ver" -lt 10500; then
6069                 AC_MSG_ERROR([JDK is too old, you need at least 1.5])
6070             fi
6071             AC_MSG_RESULT([checked (JDK $_jdk)])
6072             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
6073             if test "$_os" = "WINNT"; then
6074                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
6075             fi
6076         fi
6077     else
6078         AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
6079     fi
6080 else
6081     dnl Java disabled
6082     JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
6085 dnl ===================================================================
6086 dnl Set target Java bytecode version
6087 dnl ===================================================================
6088 if test "$SOLAR_JAVA" != ""; then
6089     _java_target_ver="1.5"
6091     JAVA_SOURCE_VER="$_java_target_ver"
6092     JAVA_TARGET_VER="$_java_target_ver"
6095 dnl ===================================================================
6096 dnl Checks for javac
6097 dnl ===================================================================
6098 if test "$SOLAR_JAVA" != ""; then
6099     if test "$JDK" = "gcj"; then
6100         javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
6101     else
6102         javacompiler="javac"
6103     fi
6104     if test -z "$with_jdk_home"; then
6105         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
6106     else
6107         _javac_path="$with_jdk_home/bin/$javacompiler"
6108         dnl Check if there is a Java compiler at all.
6109         if test -x "$_javac_path"; then
6110             JAVACOMPILER=$_javac_path
6111         fi
6112     fi
6113     if test -z "$JAVACOMPILER"; then
6114         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
6115     fi
6116     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
6117         if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
6118             JAVACOMPILER="${JAVACOMPILER}.exe"
6119         fi
6120         JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
6121         JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
6122     fi
6124     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
6125         AC_MSG_CHECKING([re-checking JDK])
6126         JDK=gcj
6127         AC_MSG_RESULT([checked (ecj)])
6128         _gij_longver="40200"
6129     fi
6132 JAVACISGCJ=""
6133 dnl ===================================================================
6134 dnl Checks that javac is gcj
6135 dnl ===================================================================
6136 if test "$SOLAR_JAVA" != ""; then
6137     if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
6138         JAVACISGCJ="yes"
6139     fi
6141 AC_SUBST(JAVACISGCJ)
6143 JAVACISKAFFE=""
6144 dnl ===================================================================
6145 dnl Checks that javac is kaffe
6146 dnl ===================================================================
6147 if test "$SOLAR_JAVA" != ""; then
6148     if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
6149         JAVACISKAFFE="yes"
6150     fi
6152 AC_SUBST(JAVACISKAFFE)
6154 dnl ===================================================================
6155 dnl Checks for javadoc
6156 dnl ===================================================================
6157 if test "$SOLAR_JAVA" != ""; then
6158     if test -z "$with_jdk_home"; then
6159         AC_PATH_PROG(JAVADOC, javadoc)
6160     else
6161         _javadoc_path="$with_jdk_home/bin/javadoc"
6162         dnl Check if there is a javadoc at all.
6163         if test -x "$_javadoc_path"; then
6164             JAVADOC=$_javadoc_path
6165         else
6166             AC_PATH_PROG(JAVADOC, javadoc)
6167         fi
6168     fi
6169     if test -z "$JAVADOC"; then
6170         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
6171     fi
6172     if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
6173         if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
6174             JAVADOC="${JAVADOC}.exe"
6175         fi
6176         JAVADOC=`cygpath -d "$JAVADOC"`
6177         JAVADOC=`cygpath -u "$JAVADOC"`
6178     fi
6180     if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
6181         JAVADOCISGJDOC="yes"
6182     fi
6184 AC_SUBST(JAVADOCISGJDOC)
6186 if test "$SOLAR_JAVA" != ""; then
6187     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
6188     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
6189         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
6190            # try to recover first by looking whether we have a alternatives
6191            # system as in Debian or newer SuSEs where following /usr/bin/javac
6192            # over /etc/alternatives/javac leads to the right bindir where we
6193            # just need to strip a bit away to get a valid JAVA_HOME
6194            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
6195         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
6196             # maybe only one level of symlink (e.g. on Mac)
6197             JAVA_HOME=$(readlink $JAVACOMPILER)
6198             if test "$(dirname $JAVA_HOME)" = "."; then
6199                 # we've got no path to trim back
6200                 JAVA_HOME=""
6201             fi
6202         else
6203             # else warn
6204             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
6205             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
6206             add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
6207             add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
6208         fi
6209         dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
6210         if test "$JAVA_HOME" != "/usr"; then
6211             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6212                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
6213                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
6214                 dnl Tiger already returns a JDK path..
6215                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
6216             else
6217                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
6218             fi
6219         fi
6220     fi
6221     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
6223     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
6224     if test -z "$JAVA_HOME"; then
6225         if test "x$with_jdk_home" = "x"; then
6226             cat > findhome.java <<_ACEOF
6227 [import java.io.File;
6229 class findhome
6231     public static void main(String args[])
6232     {
6233         String jrelocation = System.getProperty("java.home");
6234         File jre = new File(jrelocation);
6235         System.out.println(jre.getParent());
6236     }
6238 _ACEOF
6239             AC_MSG_CHECKING([if javac works])
6240             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
6241             AC_TRY_EVAL(javac_cmd)
6242             if test $? = 0 -a -f ./findhome.class; then
6243                 AC_MSG_RESULT([javac works])
6244             else
6245                 echo "configure: javac test failed" >&5
6246                 cat findhome.java >&5
6247                 AC_MSG_ERROR([javac does not work - java projects will not build!])
6248             fi
6249             AC_MSG_CHECKING([if gij knows its java.home])
6250             JAVA_HOME=`$JAVAINTERPRETER findhome`
6251             if test $? = 0 -a "$JAVA_HOME" != ""; then
6252                 AC_MSG_RESULT([$JAVA_HOME])
6253             else
6254                 echo "configure: java test failed" >&5
6255                 cat findhome.java >&5
6256                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
6257             fi
6258             # clean-up after ourselves
6259             rm -f ./findhome.java ./findhome.class
6260         else
6261             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
6262         fi
6263     fi
6265     dnl second sanity check JAVA_HOME if possible
6266     if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
6267         # now check if $JAVA_HOME is really valid
6268         if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
6269             if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
6270                 JAVA_HOME_OK="NO"
6271             fi
6272         elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
6273             JAVA_HOME_OK="NO"
6274         fi
6275         if test "$JAVA_HOME_OK" = "NO"; then
6276             AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
6277             AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
6278             AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
6279             add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
6280             add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
6281             add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
6282         fi
6283     fi
6284     PathFormat "$JAVA_HOME"
6285     JAVA_HOME="$formatted_path"
6288 AWTLIB=
6290 if test "$SOLAR_JAVA" != ""; then
6291     AC_MSG_CHECKING([for jawt lib name])
6292     if test "$JDK" = "gcj"; then
6293         save_CFLAGS=$CFLAGS
6294         save_LDFLAGS=$LDFLAGS
6295         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
6296         LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
6297         exec 6>/dev/null # no output
6298         AC_CHECK_HEADER(jni.h, [],
6299                     [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
6300         AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
6301         exec 6>&1 # output on again
6302         CFLAGS=$save_CFLAGS
6303         LDFLAGS=$save_LDFLAGS
6304     fi
6305     # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
6306     # A workaround is to link also against libpmawt.so
6307     if test "$JDK" = "ibm"; then
6308         save_CFLAGS=$CFLAGS
6309         save_LDFLAGS=$LDFLAGS
6310         save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
6311         CFLAGS="$CFLAGS -I$JAVA_HOME/include"
6312         LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
6313         LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
6314         export LD_LIBRARY_PATH
6315         exec 6>/dev/null # no output
6316         AC_CHECK_HEADER(jni.h, [],
6317                     [AC_MSG_ERROR([jni.h could not be found.])], [])
6318         AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
6319         if test -z "$AWTLIB"; then
6320             LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
6321             AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
6322         fi
6323         exec 6>&1 # output on again
6324         CFLAGS=$save_CFLAGS
6325         LDFLAGS=$save_LDFLAGS
6326         LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
6327     fi
6328     if test -z "$AWTLIB"; then
6329         if test $_os = WINNT -a "$WITH_MINGW" != yes; then
6330             AWTLIB=jawt.lib
6331         else
6332             AWTLIB=-ljawt
6333         fi
6334     fi
6335     AC_MSG_RESULT([$AWTLIB])
6336     AC_SUBST(AWTLIB)
6340 if test "$SOLAR_JAVA" != ""; then
6342 # Determine JAVALIB
6343 # If your platform follow the common pattern
6344 # just define JAVA_ARCH and JAVA_TOOLKIT for it
6345 # if not, leave JAVA_ARCH empty and define JAVALIB manually
6346 # if you don't want JAVALIB to be exported at all
6347 # define x_JAVALIB=[\#]
6349     JAVA_ARCH=
6350     JAVA_TOOLKIT=
6351     x_JAVALIB=
6352     x_JDKLIB=[\#]
6354     case "$host_os" in
6356     aix*)
6357         JAVA_ARCH="ppc"
6358         JAVA_TOOLKIT="classic"
6359         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6360         SOLARINC="$SOLARINC -I$JAVA_HOME/include/aix"
6361         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6362         ;;
6364     cygwin*)
6365         x_JDKLIB=
6366         JDKLIB="$JAVA_HOME/lib"
6367         SOLARINC="$SOLARINC -I$JAVA_HOME/include/win32"
6368         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6369         ;;
6371     darwin*)
6372         x_JAVALIB=[\#]
6373         SOLARINC="$SOLARINC -I$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers -I$FRAMEWORKSHOME/JavaVM/Headers"
6374         ;;
6376     dragonfly*)
6377         case "$host_cpu" in
6378         i*86)
6379             JAVA_ARCH="i386"
6380             JAVA_TOOLKIT="client"
6381             ;;
6382         x86_64)
6383             JAVA_ARCH="amd64"
6384             JAVA_TOOLKIT="server"
6385             ;;
6386         esac
6387         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6388         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6389         ;;
6391     freebsd*)
6392         case "$host_cpu" in
6393         i*86)
6394             JAVA_ARCH="i386"
6395             JAVA_TOOLKIT="client"
6396             ;;
6397         x86_64)
6398             if test "`echo $JAVA_HOME | sed -e 's,.*/,,'`" = "linux"; then
6399                 JAVA_ARCH="i386"
6400                 JAVA_TOOLKIT="client"
6401             else
6402                 JAVA_ARCH="amd64"
6403                 JAVA_TOOLKIT="server"
6404             fi
6405             ;;
6406         esac
6407         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6408         SOLARINC="$SOLARINC -I$JAVA_HOME/include/freebsd"
6409         SOLARINC="$SOLARINC -I$JAVA_HOME/include/bsd"
6410         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
6411         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6412         ;;
6414     k*bsd*-gnu*)
6415         case "$host_cpu" in
6416         i*86)
6417             JAVA_ARCH="i386"
6418             JAVA_TOOLKIT="client"
6419             ;;
6420         x86_64)
6421             JAVA_ARCH="amd64"
6422             JAVA_TOOLKIT="server"
6423             ;;
6424         esac
6425         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6426         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6427         ;;
6429     linux-gnu*)
6431         case "$host_cpu" in
6433         alpha)
6434             JAVA_ARCH="alpha"
6435             JAVA_TOOLKIT="server"
6436             ;;
6437         arm*)
6438             JAVA_ARCH="arm"
6439             JAVA_TOOLKIT="server"
6440             ;;
6441         hppa)
6442             JAVA_ARCH="hppa"
6443             JAVA_TOOLKIT="server"
6444             ;;
6445         i*86)
6446             JAVA_ARCH="i386"
6447             case "$JDK" in
6448             [Ii][Bb][Mm]*)
6449                 JAVA_ARCH=
6450                 JRE_BASE_DIR="$JAVA_HOME/jre/bin"
6451                 JAVALIB="-L$JAVA_HOME/$LIB64 -L$JRE_BASE_DIR -L$JRE_BASE_DIR/classic -L$JRE_BASE_DIR/native_thread"
6452                 ;;
6453             [Bb][Ee][Aa]*)
6454                 JAVA_TOOLKIT="jrockit"
6455                 ;;
6456             *)
6457                 JAVA_TOOLKIT="client"
6458                 ;;
6459             esac
6460             ;;
6461         ia64)
6462             JAVA_ARCH="ia64"
6463             JAVA_TOOLKIT="server"
6464             ;;
6465         m68k)
6466             JAVA_ARCH="mk68"
6467             JAVA_TOOLKIT="server"
6468             ;;
6469         mips|mips64|mipsel|mips64el)
6470             JAVA_ARCH="$host_cpu"
6471             JAVA_TOOLKIT="server"
6472             ;;
6473         mips32)
6474             JAVA_ARCH="$host_cpu"
6475             JAVA_TOOLKIT="client"
6476             ;;
6477         powerpc)
6478             JAVA_ARCH="ppc"
6479             case "$JDK" in
6480             [Ii][Bb][Mm]*)
6481                 JAVA_TOOLKIT="classic"
6482                 ;;
6483             gcj)
6484                 JAVA_TOOLKIT="client"
6485                 ;;
6486             *)
6487                 JAVA_TOOLKIT="server"
6488                 ;;
6489             esac
6490             ;;
6491         powerpc64)
6492             JAVA_ARCH="ppc64"
6493             if test "$JDK" = "gcj"; then
6494                 JAVA_TOOLKIT="client"
6495             else
6496                 JAVA_TOOLKIT="server"
6497             fi
6498             ;;
6499         sparc)
6500             JAVA_ARCH="sparc"
6501             JAVA_TOOLKIT="server"
6502             ;;
6503         s390)
6504             JAVA_ARCH="s390"
6505             JAVA_TOOLKIT="server"
6506             ;;
6507         s390x)
6508             JAVA_ARCH="s390x"
6509             JAVA_TOOLKIT="server"
6510             ;;
6511         x86_64)
6512             JAVA_ARCH="amd64"
6513             JAVA_TOOLKIT="server"
6514             ;;
6515         *)
6516             AC_MSG_ERROR([No JAVALIB definition host_cpu $host_cpu for host_os $host_os])
6517             ;;
6518         esac
6519         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6520         SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
6521         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6522         ;;
6524     linux-androideabi*)
6526         case "$host_cpu" in
6528     arm|armel)
6529             JAVA_ARCH="arm"
6530             JAVA_TOOLKIT="server"
6531             ;;
6532         esac
6533         ;;
6535     mingw*)
6536         x_JAVALIB=[\#]
6537         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6538         ;;
6540     *netbsd*)
6542         case "$host_cpu" in
6543         i*86)
6544             JAVA_ARCH="i386"
6545             JAVA_TOOLKIT="client"
6546             ;;
6547         powerpc)
6548             JAVA_ARCH="pcc"
6549             JAVA_TOOLKIT="classic"
6550             ;;
6551         sparc)
6552             JAVA_ARCH="sparc"
6553             JAVA_TOOLKIT="client"
6554             ;;
6555         x86_64)
6556             JAVA_ARCH="amd64"
6557             JAVA_TOOLKIT="client"
6558             ;;
6559         esac
6560         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6561         SOLARINC="$SOLARINC -I$JAVA_HOME/include/netbsd"
6562         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6563        ;;
6565     openbsd*)
6566         case "$host_cpu" in
6567         i*86)
6568             JAVA_ARCH="i386"
6569             JAVA_TOOLKIT="client"
6570             ;;
6571         x86_64)
6572             JAVA_ARCH="amd64"
6573             JAVA_TOOLKIT="server"
6574             ;;
6575         esac
6576         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6577         SOLARINC="$SOLARINC -I$JAVA_HOME/include/openbsd"
6578         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6579         ;;
6581     solaris*)
6583         JAVA_TOOLKIT="xawt"
6584         case "$host_cpu" in
6585         i*86)
6586             JAVA_ARCH="i386"
6587             ;;
6588         sparc)
6589             JAVA_ARCH="sparc"
6590             ;;
6591         esac
6592         SOLARINC="$SOLARINC -I$JAVA_HOME/include"
6593         SOLARINC="$SOLARINC -I$JAVA_HOME/include/solaris"
6594         SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
6595         ;;
6596     esac
6598     if test -n "$JAVA_ARCH"; then
6599         JRE_BASE_DIR="$JAVA_HOME/jre/lib/$JAVA_ARCH"
6600         JAVALIB="-L$JAVA_HOME/$LIB64"
6601         test -d "$JRE_BASE_DIR" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR"
6602         test -d "$JRE_BASE_DIR/$JAVA_TOOLKIT" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/$JAVA_TOOLKIT"
6603         test -d "$JRE_BASE_DIR/native_thread" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/native_thread"
6604     fi
6605 else
6606     x_JAVALIB=[\#]
6607     x_JDKLIB=[\#]
6610 AC_SUBST(JAVALIB)
6611 AC_SUBST(JAVACOMPILER)
6612 AC_SUBST(JAVADOC)
6613 AC_SUBST(JAVAINTERPRETER)
6614 AC_SUBST(JAVAIFLAGS)
6615 AC_SUBST(JAVA_HOME)
6616 AC_SUBST(JAVA_SOURCE_VER)
6617 AC_SUBST(JAVA_TARGET_VER)
6618 AC_SUBST(JDK)
6619 AC_SUBST(JDKLIB)
6620 AC_SUBST(x_JAVALIB)
6621 AC_SUBST(x_JDKLIB)
6623 dnl ===================================================================
6624 dnl Checks for specific files.
6625 dnl ===================================================================
6627 dnl ===================================================================
6628 dnl Checks for programs.
6629 dnl ===================================================================
6631 dnl ===================================================================
6632 dnl Check whether we already have dmake
6633 dnl ===================================================================
6634 AC_PATH_PROG(DMAKE, dmake, no)
6635 if test "$DMAKE" = "no"; then
6636     BUILD_DMAKE=YES
6637     echo "dmake will be built on ./bootstrap"
6638 else
6639     AC_MSG_CHECKING([whether the found dmake is the right dmake])
6640     # we need to find out whether that dmake we found is "our" dmake
6641     # or the dmake from Sun's SunStudio Compiler which is something
6642     # different
6643     # This test _should_ work because the one accepts -V (ours) and one
6644     # (the other) not...
6645     $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
6646     if test $? -eq 0; then
6647         BUILD_DMAKE=NO
6648         AC_MSG_RESULT([yes])
6649         AC_MSG_CHECKING([the dmake version])
6650         DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
6651         if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
6652             AC_MSG_RESULT([OK, >= 4.11])
6653         elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
6654             test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
6655             AC_MSG_RESULT([OK, >= 4.11])
6656         else
6657             AC_MSG_RESULT([too old. >= 4.11 is needed])
6658             echo "A newer dmake will be built on ./bootstrap"
6659             BUILD_DMAKE=YES
6660         fi
6661     else
6662         AC_MSG_RESULT([no])
6663         echo "dmake will be built on ./bootstrap"
6664         BUILD_DMAKE=YES
6665     fi
6667 AC_SUBST(BUILD_DMAKE)
6669 AC_MSG_CHECKING([which C preprocessor to use in idlc])
6670 if test -n "$with_idlc_cpp"; then
6671     AC_MSG_RESULT([$with_idlc_cpp])
6672     AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
6673 else
6674     AC_MSG_RESULT([ucpp])
6675     AC_MSG_CHECKING([which ucpp tp use])
6676     if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
6677         AC_MSG_RESULT([external])
6678         AC_PATH_PROG(SYSTEM_UCPP, ucpp)
6679     else
6680         AC_MSG_RESULT([internal])
6681         BUILD_TYPE="$BUILD_TYPE UCPP"
6682     fi
6684 AC_SUBST(SYSTEM_UCPP)
6686 dnl ===================================================================
6687 dnl Check for epm (not needed for Windows)
6688 dnl ===================================================================
6689 AC_MSG_CHECKING([whether to enable EPM for packing])
6690 if test "$enable_epm" = "yes"; then
6691     AC_MSG_RESULT([yes])
6692     if test "$_os" != "WINNT"; then
6693         if test -n "$with_epm"; then
6694             EPM=$with_epm
6695         else
6696             AC_PATH_PROG(EPM, epm, no)
6697         fi
6698         if test "$EPM" = "no" -o "$EPM" = "internal"; then
6699             echo "EPM will be built."
6700             BUILD_TYPE="$BUILD_TYPE EPM"
6701         else
6702             # Gentoo has some epm which is something different...
6703             AC_MSG_CHECKING([whether the found epm is the right epm])
6704             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
6705                 AC_MSG_RESULT([yes])
6706             else
6707                 AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
6708             fi
6709             AC_MSG_CHECKING([epm version])
6710             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
6711             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
6712                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
6713                 AC_MSG_RESULT([OK, >= 3.7])
6714                 if test "$_os" = "Darwin"; then
6715                     AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
6716                     _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
6717                     if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6718                         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)])
6719                     elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
6720                         AC_MSG_RESULT([$_pm, ok])
6721                     else # we never should get here, but go safe
6722                         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)])
6723                     fi
6724                 fi
6725             else
6726                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
6727                 echo "EPM will be built."
6728                 BUILD_TYPE="$BUILD_TYPE EPM"
6729             fi
6730         fi
6731     fi
6733     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
6734         AC_MSG_CHECKING([for rpm])
6735         for a in "$RPM" rpmbuild rpm; do
6736             $a --usage >/dev/null 2> /dev/null
6737             if test $? -eq 0; then
6738                 RPM=$a
6739                 break
6740             else
6741                 $a --version >/dev/null 2> /dev/null
6742                 if test $? -eq 0; then
6743                     RPM=$a
6744                     break
6745                 fi
6746             fi
6747         done
6748         if test -z "$RPM"; then
6749             AC_MSG_ERROR([not found])
6750         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
6751             RPM_PATH=`which $RPM`
6752             AC_MSG_RESULT([$RPM_PATH])
6753         else
6754             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
6755         fi
6756     fi
6757     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
6758         AC_PATH_PROG(DPKG, dpkg, no)
6759         if test "$DPKG" = "no"; then
6760             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
6761         fi
6762     fi
6763     if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
6764         if test "$_os" = "Darwin"; then
6765             AC_MSG_CHECKING([for PackageMaker availability])
6766             if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
6767                 AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
6768             else
6769                 AC_MSG_RESULT([ok])
6770             fi
6771         else
6772             AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
6773         fi
6774     fi
6775     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
6776        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6777         if test "$EPM" != "no" -a "$EPM" != "internal"; then
6778             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
6779                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
6780                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
6781                     AC_MSG_RESULT([yes])
6782                 else
6783                     AC_MSG_RESULT([no])
6784                     if echo "$PKGFORMAT" | $GREP -q rpm; then
6785                         _pt="rpm"
6786                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
6787                         add_warning "the rpms will need to be installed with --nodeps"
6788                     else
6789                         _pt="pkg"
6790                     fi
6791                     AC_MSG_WARN([the ${_pt}s will not be relocateable])
6792                     add_warning "the ${_pt}s will not be relocateable"
6793                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
6794                                  relocation will work, you need to patch your epm with the
6795                                  patch in epm/epm-3.7.patch or build with
6796                                  --with-epm=internal which will build a suitable epm])
6797                 fi
6798             fi
6799         fi
6800     fi
6801     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
6802         AC_PATH_PROG(PKGMK, pkgmk, no)
6803         if test "$PKGMK" = "no"; then
6804             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
6805         fi
6806     fi
6807     AC_SUBST(RPM)
6808     AC_SUBST(DPKG)
6809     AC_SUBST(PKGMK)
6810 else
6811     AC_MSG_RESULT([no])
6812     EPM=NO
6814 AC_SUBST(EPM)
6816 dnl ===================================================================
6817 dnl We need winegcc when building MinGW build to be able to cross-build msi tools
6818 dnl ===================================================================
6819 WINEGCC=
6820 if test "$enable_winegcc" = "yes"; then
6821     AC_PATH_PROG(WINEGCC, winegcc)
6822     if test "$WINEGCC" = ""; then
6823         AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
6824     fi
6825     CC_save="$CC"
6826     ac_exeext_save="$ac_exeext"
6827     CC="$WINEGCC -m32"
6828     ac_exeext=".exe"
6829     AC_LINK_IFELSE([AC_LANG_PROGRAM([
6830 #include <stdio.h>
6831         ],[
6832 printf ("hello world\n");
6833         ])],,
6834         [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
6835     )
6836     CC="$CC_save"
6837     ac_exeext="$ac_exeext_save"
6839 AC_SUBST(WINEGCC)
6841 dnl ===================================================================
6842 dnl Check for gperf
6843 dnl ===================================================================
6844 AC_PATH_PROG(GPERF, gperf)
6845 if test -z "$GPERF"; then
6846     AC_MSG_ERROR([gperf not found but needed. Install it.])
6848 AC_MSG_CHECKING([gperf version])
6849 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
6850     AC_MSG_RESULT([OK])
6851 else
6852     AC_MSG_ERROR([too old, you need at least 3.0.0])
6854 AC_SUBST(GPERF)
6856 dnl ===================================================================
6857 dnl Check for building ODK
6858 dnl ===================================================================
6859 AC_MSG_CHECKING([whether to build the ODK])
6860 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
6861     AC_MSG_RESULT([yes])
6863     if test "$with_java" != "no"; then
6864         AC_MSG_CHECKING([whether to build unowinreg.dll])
6865         if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
6866             # build on Win by default
6867             enable_build_unowinreg=yes
6868         fi
6869         if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
6870             AC_MSG_RESULT([no])
6871             BUILD_UNOWINREG=NO
6872         else
6873             AC_MSG_RESULT([yes])
6874             BUILD_UNOWINREG=YES
6875         fi
6876         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
6877             if test -z "$with_mingw_cross_compiler"; then
6878                 dnl Guess...
6879                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
6880             elif test -x "$with_mingw_cross_compiler"; then
6881                  MINGWCXX="$with_mingw_cross_compiler"
6882             else
6883                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
6884             fi
6886             if test "$MINGWCXX" = "false"; then
6887                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
6888             fi
6890             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
6891             if test -x "$mingwstrip_test"; then
6892                 MINGWSTRIP="$mingwstrip_test"
6893             else
6894                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
6895             fi
6897             if test "$MINGWSTRIP" = "false"; then
6898                 AC_MSG_ERROR(MinGW32 binutils not found.)
6899             fi
6900         fi
6901     fi
6902     BUILD_TYPE="$BUILD_TYPE ODK"
6903 else
6904     AC_MSG_RESULT([no])
6905     BUILD_UNOWINREG=NO
6907 AC_SUBST(BUILD_UNOWINREG)
6908 AC_SUBST(MINGWCXX)
6909 AC_SUBST(MINGWSTRIP)
6911 dnl ===================================================================
6912 dnl Check for system zlib
6913 dnl ===================================================================
6914 if test "$with_system_zlib" = "auto"; then
6915     case "$_os" in
6916     WINNT)
6917         with_system_zlib="$with_system_libs"
6918         ;;
6919     *)
6920         with_system_zlib=yes
6921         ;;
6922     esac
6925 AC_MSG_CHECKING([which zlib to use])
6926 if test "$with_system_zlib" = "yes"; then
6927     AC_MSG_RESULT([external])
6928     SYSTEM_ZLIB=YES
6929     AC_CHECK_HEADER(zlib.h, [],
6930         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
6931     AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
6932         [AC_MSG_ERROR(zlib not found or functional)], [])
6933 else
6934     AC_MSG_RESULT([internal])
6935     SYSTEM_ZLIB=NO
6936     BUILD_TYPE="$BUILD_TYPE ZLIB"
6937     ZLIB_CFLAGS="-I${OUTDIR}/inc/external/zlib"
6938     ZLIB_LIBS="-L${OUTDIR}/lib -lz"
6940 AC_SUBST(ZLIB_CFLAGS)
6941 AC_SUBST(ZLIB_LIBS)
6942 AC_SUBST(SYSTEM_ZLIB)
6944 dnl ===================================================================
6945 dnl Check for system jpeg
6946 dnl ===================================================================
6947 AC_MSG_CHECKING([which jpeg to use])
6948 if test "$with_system_jpeg" = "auto"; then
6949     case "$_os" in
6950     WINNT|Darwin|iOS|Android)
6951         with_system_jpeg="$with_system_libs"
6952         ;;
6953     *)
6954         with_system_jpeg=yes
6955         ;;
6956     esac
6959 if test "$with_system_jpeg" = "yes"; then
6960     AC_MSG_RESULT([external])
6961     SYSTEM_JPEG=YES
6962     AC_CHECK_HEADER(jpeglib.h, [],
6963         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
6964     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
6965     [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
6966     libo_MINGW_CHECK_DLL([JPEG], [libjpeg])
6967 else
6968     AC_MSG_RESULT([internal])
6969     SYSTEM_JPEG=NO
6970     BUILD_TYPE="$BUILD_TYPE JPEG"
6972 AC_SUBST(SYSTEM_JPEG)
6973 AC_SUBST([MINGW_JPEG_DLL])
6975 dnl ===================================================================
6976 dnl Check for system clucene
6977 dnl ===================================================================
6978 AC_MSG_CHECKING([which clucene to use])
6979 if test "$with_system_clucene" = "yes"; then
6980     AC_MSG_RESULT([external])
6981     SYSTEM_CLUCENE=YES
6982     PKG_CHECK_MODULES(CLUCENE, libclucene-core)
6984     AC_LANG_PUSH([C++])
6985     save_CXXFLAGS=$CXXFLAGS
6986     save_CPPFLAGS=$CPPFLAGS
6987     CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
6988     CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
6989     dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
6990     dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
6991     AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
6992                  [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
6993     CXXFLAGS=$save_CXXFLAGS
6994     CPPFLAGS=$save_CPPFLAGS
6995     AC_LANG_POP([C++])
6997     CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
6998 else
6999     AC_MSG_RESULT([internal])
7000     SYSTEM_CLUCENE=NO
7001     BUILD_TYPE="$BUILD_TYPE CLUCENE"
7003 AC_SUBST(SYSTEM_CLUCENE)
7004 AC_SUBST(CLUCENE_CFLAGS)
7005 AC_SUBST(CLUCENE_LIBS)
7007 dnl ===================================================================
7008 dnl Check for system expat
7009 dnl ===================================================================
7010 AC_MSG_CHECKING([which expat to use])
7011 if test "$with_system_expat" = "yes"; then
7012     AC_MSG_RESULT([external])
7013     SYSTEM_EXPAT=YES
7014     AC_CHECK_HEADER(expat.h, [],
7015         [AC_MSG_ERROR(expat.h not found. install expat)], [])
7016     AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
7017     [AC_MSG_RESULT(expat library not found or functional.)], [])
7018     libo_MINGW_CHECK_DLL([EXPAT], [libexpat])
7019 else
7020     AC_MSG_RESULT([internal])
7021     SYSTEM_EXPAT=NO
7022     BUILD_TYPE="$BUILD_TYPE EXPAT"
7024 AC_SUBST(SYSTEM_EXPAT)
7025 AC_SUBST([MINGW_EXPAT_DLL])
7027 dnl ===================================================================
7028 dnl Check for system libcdr
7029 dnl ===================================================================
7030 AC_MSG_CHECKING([which libcdr to use])
7031 if test "$with_system_libcdr" = "yes"; then
7032     AC_MSG_RESULT([external])
7033     SYSTEM_LIBCDR=YES
7034     PKG_CHECK_MODULES( CDR, libcdr-0.0 >= 0.0.5 )
7035 elif test $_os = iOS; then
7036     # libcdr depends on libwpd and libwpg and those are LGPL
7037     AC_MSG_RESULT([none])
7038 else
7039     AC_MSG_RESULT([internal])
7040     SYSTEM_LIBCDR=NO
7041     BUILD_TYPE="$BUILD_TYPE CDR"
7043 AC_SUBST(SYSTEM_LIBCDR)
7044 AC_SUBST(CDR_CFLAGS)
7045 AC_SUBST(CDR_LIBS)
7047 dnl ===================================================================
7048 dnl Check for system libmspub
7049 dnl ===================================================================
7050 AC_MSG_CHECKING([which libmspub to use])
7051 if test "$with_system_libmspub" = "yes"; then
7052     AC_MSG_RESULT([external])
7053     SYSTEM_LIBMSPUB=YES
7054     PKG_CHECK_MODULES( MSPUB, libmspub-0.0 )
7055 elif test $_os = iOS; then
7056     # libmspub depends on libwpd and libwpg and those are LGPL
7057     AC_MSG_RESULT([none])
7058 else
7059     AC_MSG_RESULT([internal])
7060     SYSTEM_LIBMSPUB=NO
7061     BUILD_TYPE="$BUILD_TYPE MSPUB"
7063 AC_SUBST(SYSTEM_LIBMSPUB)
7064 AC_SUBST(MSPUB_CFLAGS)
7065 AC_SUBST(MSPUB_LIBS)
7067 dnl ===================================================================
7068 dnl Check for system libvisio
7069 dnl ===================================================================
7070 AC_MSG_CHECKING([which libvisio to use])
7071 if test "$with_system_libvisio" = "yes"; then
7072     AC_MSG_RESULT([external])
7073     SYSTEM_LIBVISIO=YES
7074     PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
7075 elif test $_os = iOS; then
7076     # libvisio depends on libwpd and libwpg and those are LGPL
7077     AC_MSG_RESULT([none])
7078 else
7079     AC_MSG_RESULT([internal])
7080     SYSTEM_LIBVISIO=NO
7081     BUILD_TYPE="$BUILD_TYPE VISIO"
7083 AC_SUBST(SYSTEM_LIBVISIO)
7084 AC_SUBST(VISIO_CFLAGS)
7085 AC_SUBST(VISIO_LIBS)
7087 dnl ===================================================================
7088 dnl Check for system libcmis
7089 dnl ===================================================================
7090 AC_MSG_CHECKING([which libcmis to use])
7091 if test "$with_system_libcmis" = "yes"; then
7092     AC_MSG_RESULT([external])
7093     SYSTEM_LIBCMIS=YES
7094     PKG_CHECK_MODULES( CMIS, libcmis-0.3 >= 0.3.1 )
7095 else
7096     AC_MSG_RESULT([internal])
7097     SYSTEM_LIBCMIS=NO
7098     BUILD_TYPE="$BUILD_TYPE CMIS"
7100 AC_SUBST(SYSTEM_LIBCMIS)
7101 AC_SUBST(CMIS_CFLAGS)
7102 AC_SUBST(CMIS_LIBS)
7105 dnl ===================================================================
7106 dnl Check for system libwpd
7107 dnl ===================================================================
7108 AC_MSG_CHECKING([which libwpd to use])
7109 if test "$with_system_libwpd" = "yes"; then
7110     AC_MSG_RESULT([external])
7111     SYSTEM_LIBWPD=YES
7112     PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
7113 elif test $_os = iOS; then
7114     AC_MSG_RESULT([none])
7115 else
7116     AC_MSG_RESULT([internal])
7117     SYSTEM_LIBWPD=NO
7118     WPD_CFLAGS="-I${OUTDIR}/inc/external"
7119     WPD_LIBS="-L${OUTDIR}/lib -lwpdlib"
7120     BUILD_TYPE="$BUILD_TYPE WPD"
7122 AC_SUBST(SYSTEM_LIBWPD)
7123 AC_SUBST(WPD_CFLAGS)
7124 AC_SUBST(WPD_LIBS)
7126 dnl ===================================================================
7127 dnl Check for system lcms2
7128 dnl ===================================================================
7129 AC_MSG_CHECKING([which littlecms v2 to use])
7130 if test "$with_system_lcms2" = "yes"; then
7131     AC_MSG_RESULT([external])
7132     SYSTEM_LCMS2=YES
7133     PKG_CHECK_MODULES( LCMS2, lcms2 )
7134     libo_MINGW_CHECK_DLL([LCMS2], [liblcms2])
7135 else
7136     AC_MSG_RESULT([internal])
7137     SYSTEM_LCMS2=NO
7138     LCMS2_LIBS="-L${OUTDIR}/lib -llcms2"
7139     LCMS2_CFLAGS="-I${WORKDIR}/UnpackedTarball/lcms2/include"
7140     if test "$GCC" = "yes"; then
7141         LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
7142     fi
7143     BUILD_TYPE="$BUILD_TYPE LCMS2"
7145 AC_SUBST(SYSTEM_LCMS2)
7146 AC_SUBST(LCMS2_CFLAGS)
7147 AC_SUBST(LCMS2_LIBS)
7148 AC_SUBST([MINGW_LCMS2_DLL])
7150 dnl ===================================================================
7151 dnl Check for system cppunit
7152 dnl ===================================================================
7153 AC_MSG_CHECKING([which cppunit to use])
7154 if test "$with_system_cppunit" = "yes"; then
7155     AC_MSG_RESULT([external])
7156     SYSTEM_CPPUNIT=YES
7157     # might work for earlier, too but go sure:
7158     PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
7159 else
7160     AC_MSG_RESULT([internal])
7161     SYSTEM_CPPUNIT=NO
7162     BUILD_TYPE="$BUILD_TYPE CPPUNIT"
7164 AC_SUBST(SYSTEM_CPPUNIT)
7165 AC_SUBST(CPPUNIT_CFLAGS)
7166 AC_SUBST(CPPUNIT_LIBS)
7168 dnl ===================================================================
7169 dnl Check whether freetype is available
7170 dnl ===================================================================
7171 if test  "$test_freetype" = "yes"; then
7172     AC_MSG_CHECKING([whether freetype is available])
7173     PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
7174 else
7175     case "$BUILD_TYPE" in
7176     *FREETYPE*)
7177         FREETYPE_LIBS="-lfreetype"
7178         ;;
7179     esac
7181 AC_SUBST(FREETYPE_CFLAGS)
7182 AC_SUBST(FREETYPE_LIBS)
7184 dnl ===================================================================
7185 dnl Check for system libwps
7186 dnl ===================================================================
7187 AC_MSG_CHECKING([which libwps to use])
7188 if test "$with_system_libwps" = "yes"; then
7189     AC_MSG_RESULT([external])
7190     SYSTEM_LIBWPS=YES
7191     PKG_CHECK_MODULES( WPS, libwps-0.2 )
7192 elif test $_os = iOS; then
7193     AC_MSG_RESULT([none])
7194 else
7195     AC_MSG_RESULT([internal])
7196     SYSTEM_LIBWPS=NO
7197     WPS_CFLAGS="-I${OUTDIR}/inc/external"
7198     WPS_LIBS="-L${OUTDIR}/lib -lwpslib"
7199     BUILD_TYPE="$BUILD_TYPE WPS"
7201 AC_SUBST(SYSTEM_LIBWPS)
7202 AC_SUBST(WPS_CFLAGS)
7203 AC_SUBST(WPS_LIBS)
7205 dnl ===================================================================
7206 dnl Check for system libwpg
7207 dnl ===================================================================
7208 AC_MSG_CHECKING([which libwpg to use])
7209 if test "$with_system_libwpg" = "yes"; then
7210     AC_MSG_RESULT([external])
7211     SYSTEM_LIBWPG=YES
7212     PKG_CHECK_MODULES( WPG, libwpg-0.2 )
7213 elif test $_os = iOS; then
7214     AC_MSG_RESULT([none])
7215 else
7216     AC_MSG_RESULT([internal])
7217     SYSTEM_LIBWPG=NO
7218     WPG_CFLAGS="-I${OUTDIR}/inc/external"
7219     WPG_LIBS="-L${OUTDIR}/lib -lwpglib"
7220     BUILD_TYPE="$BUILD_TYPE WPG"
7222 AC_SUBST(SYSTEM_LIBWPG)
7223 AC_SUBST(WPG_CFLAGS)
7224 AC_SUBST(WPG_LIBS)
7226 dnl ===================================================================
7227 dnl Check whether freetype2 supports emboldening
7228 dnl ===================================================================
7229 if test  "$test_freetype" = "yes"; then
7230     save_CPPFLAGS="$CPPFLAGS"
7231     save_LDFLAGS="$LDFLAGS"
7232     save_LIBS="$LIBS"
7233     CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
7234     LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
7235     AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
7236                  [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
7237     LDFLAGS="$save_LDFLAGS"
7238     CPPFLAGS="$save_CPPFLAGS"
7239     LIBS="$save_LIBS"
7241 AC_SUBST(USE_FT_EMBOLDEN)
7243 # ===================================================================
7244 # Check for system libxslt
7245 # to prevent incompatibilities between internal libxml2 and external libxslt,
7246 # or vice versa, use with_system_libxml here
7247 # ===================================================================
7248 if test "$with_system_libxml" = "auto"; then
7249     case "$_os" in
7250     WINNT|iOS|Android)
7251         with_system_libxml="$with_system_libs"
7252         ;;
7253     *)
7254         with_system_libxml=yes
7255         ;;
7256     esac
7259 AC_MSG_CHECKING([which libxslt to use])
7260 if test "$with_system_libxml" = "yes"; then
7261     AC_MSG_RESULT([external])
7262     SYSTEM_LIBXSLT=YES
7263     if test "$_os" = "Darwin"; then
7264         dnl make sure to use SDK path
7265         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7266         LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
7267         dnl omit -L/usr/lib
7268         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
7269         LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
7270     else
7271         PKG_CHECK_MODULES(LIBXSLT, libxslt)
7272         PKG_CHECK_MODULES(LIBEXSLT, libexslt)
7273     fi
7275     dnl Check for xsltproc
7276     AC_PATH_PROG(XSLTPROC, xsltproc, no)
7277     if test "$XSLTPROC" = "no"; then
7278         AC_MSG_ERROR([xsltproc is required])
7279     fi
7281     libo_MINGW_CHECK_DLL([LIBXSLT], [libxslt])
7282     libo_MINGW_CHECK_DLL([LIBEXSLT], [libexslt])
7283     libo_MINGW_TRY_DLL([ICONV], [iconv])
7284 else
7285     AC_MSG_RESULT([internal])
7286     SYSTEM_LIBXSLT=NO
7287     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
7289     if test "$cross_compiling" = "yes"; then
7290         AC_PATH_PROG(XSLTPROC, xsltproc, no)
7291         if test "$XSLTPROC" = "no"; then
7292             AC_MSG_ERROR([xsltproc is required])
7293         fi
7294     fi
7296 AC_SUBST(SYSTEM_LIBXSLT)
7297 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
7298     SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
7300 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
7302 AC_SUBST(LIBEXSLT_CFLAGS)
7303 AC_SUBST(LIBEXSLT_LIBS)
7304 AC_SUBST(LIBXSLT_CFLAGS)
7305 AC_SUBST(LIBXSLT_LIBS)
7306 AC_SUBST(XSLTPROC)
7307 AC_SUBST([MINGW_LIBEXSLT_DLL])
7308 AC_SUBST([MINGW_LIBXSLT_DLL])
7309 AC_SUBST([MINGW_ICONV_DLL])
7311 # ===================================================================
7312 # Check for system libxml
7313 # ===================================================================
7314 AC_MSG_CHECKING([which libxml to use])
7315 if test "$with_system_libxml" = "yes"; then
7316     AC_MSG_RESULT([external])
7317     SYSTEM_LIBXML=YES
7318     if test "$_os" = "Darwin"; then
7319         dnl make sure to use SDK path
7320         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
7321         dnl omit -L/usr/lib
7322         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
7323     elif test $_os = iOS; then
7324         dnl make sure to use SDK path
7325         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
7326         LIBXML_CFLAGS="-I$usr/include/libxml2"
7327         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
7328     else
7329         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
7330     fi
7332     dnl Check for xmllint
7333     AC_PATH_PROG(XMLLINT, xmllint, no)
7334     if test "$XMLLINT" = "no"; then
7335         AC_MSG_ERROR([xmllint is required])
7336     fi
7338     libo_MINGW_CHECK_DLL([LIBXML],[libxml2])
7339     libo_MINGW_TRY_DLL([ZLIB],[zlib1])
7340 else
7341     AC_MSG_RESULT([internal])
7342     SYSTEM_LIBXML=NO
7343     BUILD_TYPE="$BUILD_TYPE LIBXML2"
7345 AC_SUBST(SYSTEM_LIBXML)
7346 AC_SUBST(LIBXML_CFLAGS)
7347 AC_SUBST(LIBXML_LIBS)
7348 AC_SUBST(XMLLINT)
7349 AC_SUBST([MINGW_LIBXML_DLL])
7350 AC_SUBST([MINGW_ZLIB_DLL])
7351 dnl ===================================================================
7352 dnl Checks for Python
7353 dnl ===================================================================
7355 AC_MSG_CHECKING([which Python to use])
7357 case "$enable_python" in
7358 no|disable)
7359     enable_python=no
7360     AC_MSG_RESULT([none])
7361     DISABLE_PYTHON=TRUE
7362     ;;
7363 ""|yes|auto)
7364     if test "$DISABLE_SCRIPTING" = TRUE; then
7365         AC_MSG_RESULT([no, overridden by --disable-scripting])
7366         enable_python=no
7367         DISABLE_PYTHON=TRUE
7368     elif test $build_os = cygwin; then
7369         dnl When building on Windows we don't attempt to use any installed
7370         dnl "system"  Python.
7371         dnl
7372         dnl (When cross-compiling to Windows from Linux using the mingw32-cross
7373         dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
7374         dnl MinGW cross-compilation setups.)
7375         AC_MSG_RESULT([internal])
7376         enable_python=internal
7377     elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \) \
7378                             -a \( "$with_macosx_sdk" = 10.4 -o "$with_macosx_sdk" = 10.5 \); then
7379         # When building against a more recent SDK the ionternal Python can't be compiled, I can't be bothered to fix that for now,
7380         # building against a recent SDK is only for developer's own builds anyway.
7381         AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
7382         enable_python=internal
7383     else
7384         AC_MSG_RESULT([checking below])
7385         enable_python=auto
7386     fi
7387     ;;
7388 internal)
7389     AC_MSG_RESULT([internal])
7390     ;;
7391 system)
7392     if test $_os = Darwin -a -z "$PYTHON" -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
7393         AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
7394     fi
7395     AC_MSG_RESULT([system])
7396     ;;
7398     AC_MSG_ERROR([Incorrect --enable-python option])
7399     ;;
7400 esac
7402 AC_SUBST(DISABLE_PYTHON)
7404 if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
7405     AC_MSG_ERROR([Must use internal Python when building with MSVC])
7408 if test $enable_python != no; then
7409     BUILD_TYPE="$BUILD_TYPE PYUNO"
7412 if test "$cross_compiling" = yes; then
7413     if test $enable_python = auto; then
7414         enable_python=system
7415     fi
7416 else
7417     if test $enable_python = system -a -z "$PYTHON"; then
7418         if test $_os = Darwin; then
7419             # We already have logic above to make sure the system Python
7420             # is used only when building against SDK 10.6 or newer.
7422             # Make sure we use the 2.6 Python when building against the
7423             # 10.6 SDK.
7424             case $with_macosx_sdk in
7425             10.6)
7426                 python_version=2.6;;
7427             10.7|10.8)
7428                 python_version=2.7;;
7429             *)
7430                 # ???
7431                 python_version=2.7;;
7432             esac
7433             PYTHON=python$python_version
7434             PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
7435             PYTHON_LIBS="-framework Python"
7436         else
7437             # This causes an error if no python command is found
7438             AM_PATH_PYTHON([3.3])
7439         fi
7440     elif test $enable_python = auto; then
7441         # We should not come here in a MSVC build, I think?
7442         if test $build_os = cygwin; then
7443             AC_MSG_ERROR([Assertion failed - should not be here in a MSVC build])
7444         fi
7446         # This allows a lack of system Python 3.3 with no error, we check below for a system Python of
7447         # earlier version.
7448         AM_PATH_PYTHON([3.3],, [:])
7450         if test "$PYTHON" = :; then
7451             enable_python=internal
7453             if test $_os = Darwin; then
7454                 # See the fixme in gbuild.mk
7456                 # There must be a system Python, 2.6 should be fine (?), to run build-time Python scripts
7457                 # like filter/source/svg/js2hxx.py. (Is that the only build-time Python script?) If we
7458                 # don't do this, PYTHON will stay with the value ":" which of course makes runing
7459                 # build-time Python scripts rather ineffective.
7461                 # Unset variables set by the above AM_PATH_PYTHON so that we acutally do check anew
7462                 # Finding an (old) system Python should not confuse our already decided intent to build an
7463                 # internal Python 3.3, that is directed by enable_python = internal.
7464                 unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON
7465                 AM_PATH_PYTHON([2.6])
7466             else
7467                 # For Linux it works to use the internally built Python, see gbuild.mk
7468                 :
7469             fi
7470         else
7471             enable_python=system
7472         fi
7473     fi
7476 if test $enable_python = system; then
7477     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
7478         # Fallback: Accept these in the environment, or as set above
7479         # for MacOSX.
7480         :
7481     elif test "$cross_compiling" != yes; then
7482         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
7483         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
7484         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
7485         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
7486         if test -z "$PKG_CONFIG"; then
7487             PYTHON_CFLAGS="-I$python_include"
7488             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
7489         elif $PKG_CONFIG --exists python-$python_version; then
7490             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
7491             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
7492         else
7493             PYTHON_CFLAGS="-I$python_include"
7494             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
7495         fi
7496     else
7497         dnl How to find out the cross-compilation Python installation path?
7498         dnl Let's hardocode what we know for different distributions for now...
7499         for python_version in 2.6; do
7500             if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
7501                 PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
7502                 PYTHON_LIBS="-L${MINGW_SYSROOT}lib -lpython$python_version $python_libs"
7503                 MINGW_PYTHON_EXE=python.exe
7504                 libo_MINGW_CHECK_DLL([PYTHON], [libpython$python_version])
7505                 libo_MINGW_CHECK_DLL([READLINE], [libreadline6])
7506                 libo_MINGW_CHECK_DLL([TERMCAP], [libtermcap])
7507                 # could we somehow extract the really mingw python version from
7508                 # actual distro package?
7509                 # 2.6.2 currently on OpenSUSE 12.1?
7510                 # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
7511                 PYTHON_VERSION=$python_version.2
7512                 PYTHON_VERSION_MAJOR=${python_version%.*}
7513                 PYTHON_VERSION_MINOR=${python_version#*.}
7514                 break
7515             fi
7516         done
7517         test -n "$PYTHON_CFLAGS" && break
7518     fi
7521 dnl By now enable_python should be "system", "internal" or "no"
7522 case $enable_python in
7523 system)
7524     SYSTEM_PYTHON=YES
7526     if test "$CROSS_COMPILING" != YES; then
7527         dnl Check if the headers really work
7528         save_CPPFLAGS="$CPPFLAGS"
7529         CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
7530         AC_CHECK_HEADER(Python.h, [],
7531            [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
7532            [])
7533         CPPFLAGS="$save_CPPFLAGS"
7535         AC_LANG_PUSH(C)
7536         CFLAGS="$CFLAGS $PYTHON_CFLAGS"
7537         AC_MSG_CHECKING([for correct python library version])
7538            AC_RUN_IFELSE([AC_LANG_SOURCE([[
7539 #include <Python.h>
7541 int main(int argc, char **argv) {
7542        if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
7543            (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
7544        else return 1;
7546            ]])],[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])],[])
7547         CFLAGS=$save_CFLAGS
7548         AC_LANG_POP(C)
7550         dnl FIXME Check if the Python library can be linked with, too?
7551     fi
7552     ;;
7554 internal)
7555     SYSTEM_PYTHON=NO
7556     PYTHON_VERSION_MAJOR=3
7557     PYTHON_VERSION_MINOR=3
7558     PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.0
7559     BUILD_TYPE="$BUILD_TYPE PYTHON"
7560     # Embedded Python dies without Home set
7561     if test "$HOME" = ""; then
7562         export HOME=""
7563     fi
7564     # bz2 tarball and bzip2 is not standard
7565     if test -z "$BZIP2"; then
7566         AC_PATH_PROG( BZIP2, bzip2)
7567         if test -z "$BZIP2"; then
7568             AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
7569         fi
7570     fi
7571     ;;
7573     SYSTEM_PYTHON=NO
7574     ;;
7576     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
7577     ;;
7578 esac
7580 dnl Cross-build of python requires python that is runnable on the build
7581 dnl platform, because it is used in the build process
7582 if test "$cross_compiling" = yes; then
7583     if test "$DISABLE_PYTHON" = no -a "$SYSTEM_PYTHON" = no -a "$DISABLE_PYTHON_FOR_BUILD" = yes; then
7584         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.])
7585     fi
7588 AC_SUBST(SYSTEM_PYTHON)
7589 AC_SUBST(PYTHON_CFLAGS)
7590 AC_SUBST(PYTHON_LIBS)
7591 AC_SUBST(PYTHON_VERSION)
7592 AC_SUBST(PYTHON_VERSION_MAJOR)
7593 AC_SUBST(PYTHON_VERSION_MINOR)
7594 AC_SUBST([MINGW_PYTHON_EXE])
7595 AC_SUBST([MINGW_PYTHON_DLL])
7596 AC_SUBST([MINGW_READLINE_DLL])
7597 AC_SUBST([MINGW_TERMCAP_DLL])
7599 AC_MSG_CHECKING([whether to build the MySQL Connector extension])
7600 if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
7601     AC_MSG_RESULT([yes])
7602     ENABLE_MYSQLC=YES
7603     BUILD_TYPE="$BUILD_TYPE MYSQLC"
7604 else
7605     AC_MSG_RESULT([no])
7606     ENABLE_MYSQLC=NO
7608 AC_SUBST(ENABLE_MYSQLC)
7610 if test "$ENABLE_MYSQLC" = "YES"; then
7612     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
7614     dnl ===================================================================
7615     dnl Check for system MySQL
7616     dnl ===================================================================
7617     AC_MSG_CHECKING([for MySQL prerequisites])
7618     if test "$with_system_mysql" = "yes"; then
7619         AC_MSG_RESULT([external MySQL])
7620         SYSTEM_MYSQL=YES
7621         AC_PATH_PROG( MYSQLCONFIG, mysql_config)
7622         AC_MSG_CHECKING([MySQL version])
7623         MYSQL_VERSION=`$MYSQLCONFIG --version`
7624         MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
7625         if test "$MYSQL_MAJOR" -ge "5"; then
7626             AC_MSG_RESULT([OK])
7627         else
7628             AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
7629         fi
7630         AC_MSG_CHECKING([for MySQL Client library])
7631         MYSQL_INC=`$MYSQLCONFIG --include`
7632         MYSQL_LIB=`$MYSQLCONFIG --libs`
7633         MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
7634         AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
7635     else
7636         SYSTEM_MYSQL=NO
7637         if test -n "$with_libmysql_path"; then
7638             AC_MSG_RESULT([external Connector/C (libmysql)])
7639             LIBMYSQL=libmysql.so
7640             if test "$_os" = "Darwin"; then
7641                 LIBMYSQL=libmysql.dylib
7642             elif test "$_os" = "WINNT"; then
7643                 LIBMYSQL=libmysql.dll
7644             fi
7645             AC_MSG_CHECKING([for $LIBMYSQL])
7646             if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
7647                 AC_MSG_RESULT([found.])
7648                 LIBMYSQL_PATH=$with_libmysql_path
7649             else
7650                 AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
7651             fi
7652         else
7653             AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
7654         fi
7655     fi
7656     AC_SUBST(SYSTEM_MYSQL)
7657     AC_SUBST(MYSQL_INC)
7658     AC_SUBST(MYSQL_LIB)
7659     AC_SUBST(MYSQL_DEFINES)
7660     AC_SUBST(LIBMYSQL_PATH)
7662     AC_LANG_PUSH([C++])
7663     dnl ===================================================================
7664     dnl Check for system MySQL C++ Connector
7665     dnl ===================================================================
7666     # FIXME!
7667     # who thought this too-generic cppconn dir was a good idea?
7668     AC_MSG_CHECKING([MySQL Connector/C++])
7669     if test "$with_system_mysql_cppconn" = "yes"; then
7670         AC_MSG_RESULT([external])
7671         SYSTEM_MYSQL_CPPCONN=YES
7672         AC_LANG_PUSH([C++])
7673         AC_CHECK_HEADER(mysql_driver.h, [],
7674                     [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
7675         AC_CHECK_LIB([mysqlcppconn], [main], [:],
7676                     [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
7677         save_LIBS=$LIBS
7678         LIBS="$LIBS -lmysqlcppconn"
7679         AC_MSG_CHECKING([version])
7680         AC_RUN_IFELSE([AC_LANG_SOURCE([[
7681 #include <mysql_driver.h>
7683 int main(int argc, char **argv) {
7684     sql::Driver *driver;
7685     driver = get_driver_instance();
7686     if (driver->getMajorVersion() > 1 || \
7687        (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
7688        (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
7689         return 0;
7690       else
7691         return 1;
7693       ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
7695         AC_LANG_POP([C++])
7696         LIBS=$save_LIBS
7697     else
7698         AC_MSG_RESULT([internal])
7699         AC_MSG_CHECKING([for mysqlcppconn module])
7700         if test -d mysqlcppconn; then
7701             AC_MSG_RESULT([OK])
7702         else
7703             AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
7704         fi
7705         BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
7706         SYSTEM_MYSQL_CPPCONN=NO
7707     fi
7708     AC_LANG_POP([C++])
7710 AC_SUBST(SYSTEM_MYSQL_CPPCONN)
7712 dnl ===================================================================
7713 dnl Check for system hsqldb
7714 dnl ===================================================================
7715 if test "$with_java" != "no"; then
7716 HSQLDB_USE_JDBC_4_1=
7717 AC_MSG_CHECKING([which hsqldb to use])
7718 if test "$with_system_hsqldb" = "yes"; then
7719     AC_MSG_RESULT([external])
7720     SYSTEM_HSQLDB=YES
7721     if test -z $HSQLDB_JAR; then
7722         HSQLDB_JAR=/usr/share/java/hsqldb.jar
7723     fi
7724     AC_CHECK_FILE($HSQLDB_JAR, [],
7725                [AC_MSG_ERROR(hsqldb.jar not found.)], [])
7726     AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
7727     export HSQLDB_JAR
7728     if $PERL -e 'use Archive::Zip;
7729             my $file = "$ENV{'HSQLDB_JAR'}";
7730             my $zip = Archive::Zip->new( $file );
7731             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
7732             if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
7733                push @l, split(/\n/, $mf);
7734                foreach my $line (@l) {
7735                   if ($line =~ m/Specification-Version:/) {
7736                       ($t, $version) = split (/:/,$line);
7737                       $version =~ s/^\s//;
7738                       ($a, $b, $c, $d) = split (/\./,$version);
7739                       if ($c == "0" && $d > "8")  {
7740                           exit 0;
7741                       } else {
7742                           exit 1;
7743                       }
7744                   }
7745                }
7746             } else {
7747                 exit 1;
7748             }'; then
7749         AC_MSG_RESULT([yes])
7750     else
7751         AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
7752     fi
7753 else
7754     AC_MSG_RESULT([internal])
7755     SYSTEM_HSQLDB=NO
7756     BUILD_TYPE="$BUILD_TYPE HSQLDB"
7757     AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
7758     javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
7759     if expr "$javanumver" '>=' 000100060000 > /dev/null; then
7760         AC_MSG_RESULT([yes])
7761         HSQLDB_USE_JDBC_4_1=YES
7762     else
7763         AC_MSG_RESULT([no])
7764     fi
7766 AC_SUBST(SYSTEM_HSQLDB)
7767 AC_SUBST(HSQLDB_JAR)
7768 AC_SUBST([HSQLDB_USE_JDBC_4_1])
7771 dnl ===================================================================
7772 dnl Check for PostgreSQL stuff
7773 dnl ===================================================================
7774 if test "x$enable_postgresql_sdbc" != "xno"; then
7775     SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
7777     # if/when anything else than PostgreSQL uses Kerberos,
7778     # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
7779     WITH_KRB5=NO
7780     WITH_GSSAPI=no
7781     case "$_os" in
7782     Darwin)
7783         # MacOS X has system MIT Kerberos 5 since 10.4
7784         if test "$with_krb5" != "no"; then
7785             WITH_KRB5=YES
7786             save_LIBS=$LIBS
7787             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7788                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
7789             LIBS=$save_LIBS
7790             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7791                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
7792             LIBS=$save_LIBS
7793         fi
7794         if test "$with_gssapi" != "no"; then
7795           WITH_GSSAPI=YES
7796           save_LIBS=$LIBS
7797           AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7798                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7799           LIBS=$save_LIBS
7800         fi
7801         ;;
7802     WINNT)
7803         if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
7804             AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
7805         fi
7806         ;;
7807     Linux|GNU|*BSD|DragonFly)
7808         if test "$with_krb5" != "no"; then
7809             WITH_KRB5=YES
7810             save_LIBS=$LIBS
7811             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7812                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7813             LIBS=$save_LIBS
7814             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7815                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7816             LIBS=$save_LIBS
7817         fi
7818         if test "$with_gssapi" != "no"; then
7819             WITH_GSSAPI=YES
7820             save_LIBS=$LIBS
7821             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7822                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7823             LIBS=$save_LIBS
7824         fi
7825         ;;
7826     *)
7827         if test "$with_krb5" = "yes"; then
7828             WITH_KRB5=YES
7829             save_LIBS=$LIBS
7830             AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7831                 [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
7832             LIBS=$save_LIBS
7833             AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
7834                 [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
7835             LIBS=$save_LIBS
7836         fi
7837         if test "$with_gssapi" = "yes"; then
7838             WITH_GSSAPI=YES
7839             save_LIBS=$LIBS
7840             AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
7841                 [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
7842             LIBS=$save_LIBS
7843         fi
7844     esac
7846     AC_MSG_CHECKING([PostgreSQL C interface])
7847     if test "$with_system_postgresql" = "yes"; then
7848         AC_MSG_RESULT([external PostgreSQL])
7849         SYSTEM_POSTGRESQL=YES
7850         if test "$_os" = Darwin; then
7851             supp_path=''
7852             for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
7853                 pg_supp_path="$P_SEP$d$pg_supp_path"
7854             done
7855         fi
7856         AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
7857         if test -z "$PGCONFIG"; then
7858             AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
7859         fi
7860         POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
7861         POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
7862     else
7863         if test -n "$with_libpq_path"; then
7864             SYSTEM_POSTGRESQL=YES
7865             AC_MSG_RESULT([external libpq])
7866             POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
7867             POSTGRESQL_INC=-I"${with_libpq_path}/include/"
7868         else
7869             SYSTEM_POSTGRESQL=NO
7870             AC_MSG_RESULT([internal])
7871             POSTGRESQL_LIB=""
7872             POSTGRESQL_INC="%OVERRIDE_ME%"
7873             BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
7874         fi
7875     fi
7876     if test "${SYSTEM_POSTGRESQL}" = "YES"; then
7877         AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
7878         save_CFLAGS=$CFLAGS
7879         save_CPPFLAGS=$CPPFLAGS
7880         save_LIBS=$LIBS
7881         CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
7882         LIBS="${LIBS} ${POSTGRESQL_LIB}"
7883         AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
7884         AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
7885             [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
7886         CFLAGS=$save_CFLAGS
7887         CPPFLAGS=$save_CPPFLAGS
7888         LIBS=$save_LIBS
7889     fi
7890     BUILD_POSTGRESQL_SDBC=YES
7892 AC_SUBST(WITH_KRB5)
7893 AC_SUBST(WITH_GSSAPI)
7894 AC_SUBST(BUILD_POSTGRESQL_SDBC)
7895 AC_SUBST(SYSTEM_POSTGRESQL)
7896 AC_SUBST(POSTGRESQL_INC)
7897 AC_SUBST(POSTGRESQL_LIB)
7899 dnl ===================================================================
7900 dnl Check for system curl
7901 dnl ===================================================================
7902 AC_MSG_CHECKING([which libcurl to use])
7903 if test "$with_system_curl" = "auto"; then
7904     case "$_os" in
7905     Darwin)
7906         with_system_curl=yes
7907         ;;
7908     *)
7909         with_system_curl="$with_system_libs"
7910         ;;
7911     esac
7914 if test "$with_system_curl" = "yes"; then
7915     AC_MSG_RESULT([external])
7916     SYSTEM_CURL=YES
7918     curl_version=""
7919     if test "$cross_compiling" = "yes"; then
7920         dnl At least the OBS mingw32-libcurl-devel package
7921         dnl comes with a proper .pc file
7922         PKG_CHECK_MODULES(CURL, libcurl,, [:])
7923         if test -n "$CURL_PKG_ERRORS"; then
7924             AC_MSG_RESULT([no])
7925         else
7926             curl_version=`$PKG_CONFIG --modversion libcurl`
7927         fi
7928     fi
7929     if test -z "$curl_version"; then
7930         AC_PATH_PROG(CURLCONFIG, curl-config)
7931         if test -z "$CURLCONFIG"; then
7932             AC_MSG_ERROR([install the libcurl development package])
7933         fi
7934         CURL_LIBS=`$CURLCONFIG --libs`
7935         CURL_CFLAGS=`$CURLCONFIG --cflags`
7936         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
7937     fi
7939     AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
7941     case $curl_version in
7942     dnl brackets doubled below because Autoconf uses them as m4 quote characters,
7943     dnl so they need to be doubled to end up in the configure script
7944     7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
7945         AC_MSG_RESULT([yes, you have $curl_version])
7946         ;;
7947     *)
7948         AC_MSG_ERROR([no, you have $curl_version])
7949         ;;
7950     esac
7952     libo_MINGW_CHECK_DLL([CURL], [libcurl])
7953     libo_MINGW_TRY_DLL([INTL], [libintl])
7954     libo_MINGW_TRY_DLL([IDN], [libidn])
7955     libo_MINGW_TRY_DLL([NSPR4], [libnspr4])
7956     libo_MINGW_TRY_DLL([NSSUTIL3], [nssutil3])
7957     libo_MINGW_TRY_DLL([PLC4], [libplc4])
7958     libo_MINGW_TRY_DLL([PLDS4], [libplds4])
7959     libo_MINGW_TRY_DLL([NSS3], [nss3])
7960     libo_MINGW_TRY_DLL([SSL3], [ssl3])
7961     libo_MINGW_TRY_DLL([GPG_ERROR], [libgpg-error])
7962     libo_MINGW_TRY_DLL([GCRYPT], [libgcrypt])
7963     libo_MINGW_TRY_DLL([SSH2], [libssh2])
7964 else
7965     AC_MSG_RESULT([internal])
7966     SYSTEM_CURL=NO
7967     BUILD_TYPE="$BUILD_TYPE CURL"
7969 AC_SUBST(SYSTEM_CURL)
7970 AC_SUBST(CURL_CFLAGS)
7971 AC_SUBST(CURL_LIBS)
7972 AC_SUBST([MINGW_CURL_DLL])
7973 AC_SUBST([MINGW_GCRYPT_DLL])
7974 AC_SUBST([MINGW_GPG_ERROR_DLL])
7975 AC_SUBST([MINGW_IDN_DLL])
7976 AC_SUBST([MINGW_INTL_DLL])
7977 AC_SUBST([MINGW_NSPR4_DLL])
7978 AC_SUBST([MINGW_NSS3_DLL])
7979 AC_SUBST([MINGW_NSSUTIL3_DLL])
7980 AC_SUBST([MINGW_PLC4_DLL])
7981 AC_SUBST([MINGW_PLDS4_DLL])
7982 AC_SUBST([MINGW_SSH2_DLL])
7983 AC_SUBST([MINGW_SSL3_DLL])
7985 dnl ===================================================================
7986 dnl Check for system boost
7987 dnl ===================================================================
7988 AC_MSG_CHECKING([which boost to use])
7989 if test "$with_system_boost" = "yes"; then
7990     AC_MSG_RESULT([external])
7991     SYSTEM_BOOST=YES
7992     AC_LANG_PUSH([C++])
7993     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
7994        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
7995     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
7996        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
7997     AC_CHECK_HEADER(boost/function.hpp, [],
7998        [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
8000     save_CXXFLAGS=$CXXFLAGS
8001     CXXFLAGS="$CXXFLAGS -fno-exceptions"
8002     AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
8003     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
8004 ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
8006     if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
8007         AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
8008     else
8009         AC_MSG_RESULT([yes])
8010     fi
8011     CXXFLAGS=$save_CXXFLAGS
8012     AC_LANG_POP([C++])
8014     AX_BOOST_BASE
8015     AX_BOOST_DATE_TIME
8016     mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
8017     libo_MINGW_TRY_DLL([BOOST_DATE_TIME], [$mingw_boost_date_time_dll])
8018     if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
8019         # if not found, try again with 'lib' prefix
8020         libo_MINGW_CHECK_DLL([BOOST_DATE_TIME],
8021                              [lib$mingw_boost_date_time_dll])
8022     fi
8023 else
8024     AC_MSG_RESULT([internal])
8025     BUILD_TYPE="$BUILD_TYPE BOOST"
8026     SYSTEM_BOOST=NO
8028 AC_SUBST([MINGW_BOOST_DATE_TIME_DLL])
8029 AC_SUBST(SYSTEM_BOOST)
8031 dnl ===================================================================
8032 dnl Check for system mdds
8033 dnl ===================================================================
8034 AC_MSG_CHECKING([which mdds to use])
8035 if test "$with_system_mdds" = "yes"; then
8036     AC_MSG_RESULT([external])
8037     SYSTEM_MDDS=YES
8039     dnl ===================================================================
8040     dnl Determine which hash container mdds shall use
8041     dnl ===================================================================
8042     AC_MSG_CHECKING([which hash container mdds shall use])
8043     if test "x$HAVE_CXX0X" = "xTRUE"; then
8044         MDDS_CPPFLAGS="-std=gnu++0x"
8045         AC_MSG_RESULT([std::unordered_map])
8046     else
8047         MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
8048         AC_MSG_RESULT([boost::unordered_map])
8049     fi
8051     AC_LANG_PUSH([C++])
8052     save_CPPFLAGS="$CPPFLAGS"
8053     CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
8054     AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
8055         [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
8056     AC_CHECK_HEADER(mdds/multi_type_matrix.hpp, [],
8057         [AC_MSG_ERROR(mdds/multi_type_matrix.hpp not found. install mdds >= 0.6.0)], [])
8058     CPPFLAGS="$save_CPPFLAGS"
8059     AC_LANG_POP([C++])
8060 else
8061     AC_MSG_RESULT([internal])
8062     BUILD_TYPE="$BUILD_TYPE MDDS"
8063     SYSTEM_MDDS=NO
8065     dnl ===================================================================
8066     dnl Determine which hash container mdds shall use
8067     dnl ===================================================================
8068     AC_MSG_CHECKING([which hash container mdds shall use])
8069     MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
8070     AC_MSG_RESULT([boost::unordered_map])
8072 AC_SUBST(SYSTEM_MDDS)
8073 AC_SUBST([MDDS_CPPFLAGS])
8075 dnl ===================================================================
8076 dnl Check for system vigra
8077 dnl ===================================================================
8078 AC_MSG_CHECKING([which vigra to use])
8079 if test "$with_system_vigra" = "yes"; then
8080     AC_MSG_RESULT([external])
8081     SYSTEM_VIGRA=YES
8082     AC_LANG_PUSH([C++])
8083     AC_CHECK_HEADER(vigra/copyimage.hxx, [],
8084        [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
8085     AC_LANG_POP([C++])
8086 else
8087     AC_MSG_RESULT([internal])
8088     BUILD_TYPE="$BUILD_TYPE VIGRA"
8089     SYSTEM_VIGRA=NO
8091 AC_SUBST(SYSTEM_VIGRA)
8093 dnl ===================================================================
8094 dnl Check for system odbc
8095 dnl ===================================================================
8096 AC_MSG_CHECKING([which odbc headers to use])
8097 if test "$with_system_odbc" = "yes"; then
8098     AC_MSG_RESULT([external])
8099     SYSTEM_ODBC_HEADERS=YES
8101     AC_CHECK_HEADER(sqlext.h, [],
8102       [AC_MSG_ERROR(odbc not found. install odbc)], [])
8103 elif test "$enable_database_connectivity" != yes; then
8104     AC_MSG_RESULT([none])
8105 else
8106     AC_MSG_RESULT([internal])
8107     SYSTEM_ODBC_HEADERS=NO
8109 AC_SUBST(SYSTEM_ODBC_HEADERS)
8112 dnl ===================================================================
8113 dnl Check for system openldap
8114 dnl ===================================================================
8116 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
8117 AC_MSG_CHECKING([which openldap library to use])
8118 if test "$with_system_openldap" = "yes"; then
8119     AC_MSG_RESULT([external])
8120     SYSTEM_OPENLDAP=YES
8121     AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
8122     AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8123     AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
8124 else
8125     AC_MSG_RESULT([internal])
8126     SYSTEM_OPENLDAP=NO
8127     BUILD_TYPE="$BUILD_TYPE OPENLDAP"
8130 AC_SUBST(SYSTEM_OPENLDAP)
8132 dnl ===================================================================
8133 dnl Check for mozilla ab connectivity for windows
8134 dnl ===================================================================
8136 AC_MSG_CHECKING([whether to enable build of Mozilla addressbook connectivity driver for Windows])
8137 if test "$enable_win_mozab_driver" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
8138     AC_MSG_RESULT([yes])
8139     WITH_MOZAB4WIN=YES
8140     BUILD_MOZAB=YES
8141     if test "$enable_build_mozab" = "no" ; then
8142         BUILD_MOZAB=NO
8143     fi
8144 else
8145     AC_MSG_RESULT([no])
8146     WITH_MOZAB4WIN=NO
8148 AC_SUBST(WITH_MOZAB4WIN)
8149 AC_SUBST(BUILD_MOZAB)
8151 if test "$_os" != "WINNT"; then
8152 # on all other platforms Mozilla addressbook connectivity
8153 # is unconditionally built
8154 # new and shiny mork driver
8155    AC_MSG_RESULT([yes (new mork driver)])
8156 else
8157     if test "$WITH_MOZAB4WIN" = "NO"; then
8158         AC_MSG_RESULT([no])
8159     else
8160         AC_MSG_RESULT([yes, internal (old windows mozab driver)])
8161         BUILD_TYPE="$BUILD_TYPE MOZ"
8162         EXTMSV80=`cygpath  -u "$SRC_ROOT/external/msvcp80"`
8163         AC_MSG_CHECKING([for MSVC 2005 runtime needed for prebuilt Mozilla])
8164         if test -e "$EXTMSV80/Microsoft.VC80.CRT.manifest" -a \
8165                 -e "$EXTMSV80/msvcp80.dll" -a \
8166                 -e "$EXTMSV80/msvcr80.dll"; then
8167             AC_MSG_RESULT([Found])
8168             EXTMSV80=
8169         else
8170             #uwin-prefixed paths are with no quotes to allow for mask, and uwin to not have spaces, btw
8171             uwin=`cygpath -d "$WINDIR"`
8172             uwin=`cygpath -u "$uwin"`
8173             #if we have one we have all
8174             if test -e $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053* ; then
8175                 MSVC80_DLL_DIR=`ls -d $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053*`
8176                 MSVC80_MNFST=`ls $uwin/winsxs/Manifests/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_*.manifest`
8177                 AC_MSG_RESULT([Found])
8178             else
8179                 EXTMSV80=
8180                 AC_MSG_RESULT([Not Found])
8181                 AC_MSG_ERROR([For the pre-built Mozilla libraries, you need MSVC 2005 runtime files
8182     Microsoft.VC80.CRT.manifest, msvcp80.dll, and msvcr80.dll
8183     in external/msvcp80.
8185     You can get them by installing:
8186     <http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE>
8187     and relaunch ./autogen.sh])
8188             fi
8189         fi
8190     fi
8194 AC_SUBST(MSVC80_DLL_DIR)
8195 AC_SUBST(MSVC80_MNFST)
8196 AC_SUBST(EXTMSV80)
8197 AC_SUBST(EXTMSV80)
8199 dnl ===================================================================
8200 dnl Check for system NSS
8201 dnl ===================================================================
8202 AC_MSG_CHECKING([which NSS to use])
8203 if test "$with_system_nss" = "yes"; then
8204     AC_MSG_RESULT([external])
8205     SYSTEM_NSS="YES"
8206     PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
8207     libo_MINGW_CHECK_DLL([NSPR4], [libnspr4])
8208     libo_MINGW_CHECK_DLL([PLC4], [libplc4])
8209     libo_MINGW_CHECK_DLL([PLDS4], [libplds4])
8210     libo_MINGW_CHECK_DLL([NSS3], [nss3])
8211     libo_MINGW_CHECK_DLL([NSSUTIL3], [nssutil3])
8212     libo_MINGW_CHECK_DLL([SMIME3], [smime3])
8213     libo_MINGW_CHECK_DLL([SSL3], [ssl3])
8214 else
8215     SYSTEM_NSS="NO"
8216     BUILD_TYPE="$BUILD_TYPE NSS"
8217     AC_MSG_RESULT([internal])
8218     if test "$build_os" = "cygwin"; then
8219         AC_MSG_CHECKING([for nss build tooling]) # coming from mozilla
8220         if test -z "$NSSBUILDTOOLS"; then
8221             AC_MSG_ERROR([nss build tooling not provided
8222 Use the --with-nss-build-tools option after installing the tools obtained
8223 from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
8224         else
8225             if test \( "$WITH_MINGW" = "yes" -a  ! -d "$NSSBUILDTOOLS" \) \
8226                     -o ! -d "$NSSBUILDTOOLS/moztools" \
8227                     -o ! -d "$NSSBUILDTOOLS/msys" ; then
8228                 AC_MSG_ERROR([nss build tooling incomplete!])
8229             else
8230                 AC_MSG_RESULT([ok])
8231             fi
8232         fi
8233     fi
8234 fi # system nss
8235 AC_SUBST(SYSTEM_NSS)
8236 AC_SUBST(NSS_CFLAGS)
8237 AC_SUBST(NSS_LIBS)
8238 AC_SUBST(NSSBUILDTOOLS)
8239 AC_SUBST(MINGW_SMIME3_DLL)
8241 dnl ===================================================================
8242 dnl Check for system mozilla headers
8243 dnl ===================================================================
8244 HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
8245 AC_MSG_CHECKING([which NPAPI headers to use])
8247 if test "$with_system_npapi_headers" = "yes"; then
8248     AC_MSG_RESULT([external])
8249     SYSTEM_NPAPI_HEADERS=YES
8250     # First try npapi-sdk:
8251     PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
8252     # Then go with libxul:
8253     if test "x$LOCATED" != "xyes"; then
8254         PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
8255     fi
8256     if test "x$LOCATED" != "xyes"; then
8257         PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
8258     fi
8259     # if still not found bail out
8260     if test "x$LOCATED" != "xyes"; then
8261         AC_MSG_ERROR([npapi.h header file not found])
8262     fi
8264     AC_LANG_PUSH([C])
8265     save_CFLAGS=$CFLAGS
8266     CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS"
8267     AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
8268     AC_COMPILE_IFELSE(
8269         [AC_LANG_SOURCE([[
8270             #define XP_UNIX
8271             #include <npapi.h>
8272             const char* NPP_GetMIMEDescription(void) { return "foo"; }
8273             ]])],
8274         [AC_MSG_RESULT([const char*])],
8275         [
8276         AC_MSG_RESULT([char*])
8277         HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
8278         ])
8279     CFLAGS=$save_CFLAGS
8280     AC_LANG_POP([C])
8281 else
8282     AC_MSG_RESULT([internal])
8283         dnl ...but will not be built/used unless ENABLE_NPAPI_FROM_BROWSER or
8284         dnl ENABLE_NPAPI_INTO_BROWSER is YES
8285     SYSTEM_NPAPI_HEADERS=NO
8287 AC_SUBST(NPAPI_HEADERS_CFLAGS)
8288 AC_SUBST(SYSTEM_NPAPI_HEADERS)
8289 AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
8291 dnl ===================================================================
8292 dnl Check for system sane
8293 dnl ===================================================================
8294 AC_MSG_CHECKING([which sane header to use])
8295 if test "$with_system_sane" = "yes"; then
8296     AC_MSG_RESULT([external])
8297     AC_CHECK_HEADER(sane/sane.h, [],
8298       [AC_MSG_ERROR(sane not found. install sane)], [])
8299 else
8300     AC_MSG_RESULT([internal])
8301     BUILD_TYPE="$BUILD_TYPE SANE"
8304 dnl ===================================================================
8305 dnl Check for system icu
8306 dnl ===================================================================
8307 SYSTEM_GENBRK=
8308 SYSTEM_GENCCODE=
8309 SYSTEM_GENCMN=
8311 ICU_MAJOR=49
8312 ICU_MINOR=1
8313 ICU_MICRO=1
8314 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8315 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
8316 ICU_RECLASSIFIED_HEBREW_LETTER="YES"
8317 AC_MSG_CHECKING([which icu to use])
8318 if test "$with_system_icu" = "yes"; then
8319     AC_MSG_RESULT([external])
8320     SYSTEM_ICU=YES
8321     AC_LANG_PUSH([C++])
8322     AC_MSG_CHECKING([for unicode/rbbi.h])
8323     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
8324     AC_LANG_POP([C++])
8326     ICUPATH="$PATH"
8327     if test "$WITH_MINGW" = "yes"; then
8328         ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
8329     fi
8330     AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
8332     AC_MSG_CHECKING([ICU version])
8333     ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
8334     ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
8335     ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
8336     ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
8338     if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "6" \); then
8339         AC_MSG_RESULT([OK, $ICU_VERSION])
8340     else
8341         AC_MSG_ERROR([not suitable, only >= 4.6 supported currently])
8342     fi
8344     if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
8345         AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
8346         ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
8347         ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
8348         ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
8349         AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
8350         if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
8351             AC_MSG_RESULT([yes])
8352         else
8353             AC_MSG_RESULT([no])
8354             if test "$with_system_icu_for_build" != "force"; then
8355                 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
8356 You can use --with-system-icu-for-build=force to use it anyway.])
8357             fi
8358         fi
8359     fi
8361     if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
8362         # using the system icu tools can lead to version confusion, use the
8363         # ones from the build environment when cross-compiling
8364         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
8365         if test -z "$SYSTEM_GENBRK"; then
8366             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
8367         fi
8368         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8369         if test -z "$SYSTEM_GENCCODE"; then
8370             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
8371         fi
8372         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
8373         if test -z "$SYSTEM_GENCMN"; then
8374             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
8375         fi
8376         if test "$ICU_MAJOR" -ge "49"; then
8377             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
8378         else
8379             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO"
8380         fi
8381         if test "$ICU_MAJOR" -le 4; then
8382             ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="NO"
8383             ICU_RECLASSIFIED_HEBREW_LETTER="NO"
8384         fi
8385     fi
8387     libo_MINGW_CHECK_DLL([ICUDATA], [icudata][$ICU_MAJOR][$ICU_MINOR])
8388     libo_MINGW_CHECK_DLL([ICUI18N], [icui18n][$ICU_MAJOR][$ICU_MINOR])
8389     libo_MINGW_CHECK_DLL([ICUUC], [icuuc][$ICU_MAJOR][$ICU_MINOR])
8390 else
8391     AC_MSG_RESULT([internal])
8392     SYSTEM_ICU="NO"
8393     BUILD_TYPE="$BUILD_TYPE ICU"
8395 AC_SUBST(SYSTEM_ICU)
8396 AC_SUBST(SYSTEM_GENBRK)
8397 AC_SUBST(SYSTEM_GENCCODE)
8398 AC_SUBST(SYSTEM_GENCMN)
8399 AC_SUBST(ICU_MAJOR)
8400 AC_SUBST(ICU_MINOR)
8401 AC_SUBST(ICU_MICRO)
8402 AC_SUBST([ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER])
8403 AC_SUBST([ICU_RECLASSIFIED_HEBREW_LETTER])
8404 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
8405 AC_SUBST([MINGW_ICUDATA_DLL])
8406 AC_SUBST([MINGW_ICUI18N_DLL])
8407 AC_SUBST([MINGW_ICUUC_DLL])
8409 dnl ===================================================================
8410 dnl Graphite
8411 dnl ===================================================================
8413 AC_MSG_CHECKING([whether to enable graphite support])
8414 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "$enable_graphite" = "" -o "$enable_graphite" != "no"; then
8415     AC_MSG_RESULT([yes])
8416     ENABLE_GRAPHITE="TRUE"
8417     AC_MSG_CHECKING([which graphite to use])
8418     if test "$with_system_graphite" = "yes"; then
8419         AC_MSG_RESULT([external])
8420         SYSTEM_GRAPHITE=YES
8421         PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
8422         libo_MINGW_CHECK_DLL([GRAPHITE2], [libgraphite2])
8423     else
8424         AC_MSG_RESULT([internal])
8425         SYSTEM_GRAPHITE=NO
8426         BUILD_TYPE="$BUILD_TYPE GRAPHITE"
8427     fi
8428 else
8429     AC_MSG_RESULT([no])
8431 AC_SUBST(ENABLE_GRAPHITE)
8432 AC_SUBST(SYSTEM_GRAPHITE)
8433 AC_SUBST(GRAPHITE_CFLAGS)
8434 AC_SUBST(GRAPHITE_LIBS)
8435 AC_SUBST([MINGW_GRAPHITE2_DLL])
8437 dnl ===================================================================
8438 dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
8439 dnl ===================================================================
8440 AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
8441 if test "$_os" != Android -a "$_os" != iOS -a "$enable_headless" != yes
8442 then
8443     AC_MSG_RESULT([yes])
8444     ENABLE_NPAPI_FROM_BROWSER=YES
8445 else
8446     AC_MSG_RESULT([no])
8447     ENABLE_NPAPI_FROM_BROWSER=NO
8449 AC_SUBST(ENABLE_NPAPI_FROM_BROWSER)
8451 dnl ===================================================================
8452 dnl Check for NPAPI interface to plug LibreOffice into browser windows
8453 dnl ===================================================================
8454 AC_MSG_CHECKING([whether to plug LibreOffice into browser windows])
8455 if test "$_os" == WINNT -o "$_os" != Android -a "$_os" != Darwin -a "$_os" != iOS -a \
8456         "$enable_headless" != yes -a "$enable_gtk" != no
8457 then
8458     AC_MSG_RESULT([yes])
8459     ENABLE_NPAPI_INTO_BROWSER=YES
8460 else
8461     AC_MSG_RESULT([no])
8462     ENABLE_NPAPI_INTO_BROWSER=NO
8464 AC_SUBST(ENABLE_NPAPI_INTO_BROWSER)
8466 AC_MSG_CHECKING([whether to use X11])
8467 dnl ***************************************
8468 dnl testing for X libraries and includes...
8469 dnl ***************************************
8470 WANT_X11="no"
8471 if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
8472     WANT_X11="yes"
8474 AC_MSG_RESULT([$WANT_X11])
8476 if test "$WANT_X11" = "yes"; then
8477     AC_PATH_X
8478     AC_PATH_XTRA
8479     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
8481     if test "x$x_includes" = "x"; then
8482         x_includes="default_x_includes"
8483     fi
8484     if test "x$x_libraries" = "x"; then
8485         x_libraries="default_x_libraries"
8486     fi
8487     dnl The variables $x_libraries and $x_includes are set.
8488     if test -z "$x_libraries"; then
8489         AC_MSG_ERROR([No X libraries found]) # Exit
8490     fi
8491     if test -z "$x_includes"; then
8492         AC_MSG_ERROR([No X includes found]) # Exit
8493     fi
8494     CFLAGS="$CFLAGS $X_CFLAGS"
8495     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
8496     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
8497 else
8498     x_includes="no_x_includes"
8499     x_libraries="no_x_libraries"
8501 if test -z "$x_includes"; then
8502     x_includes="no_x_includes"
8504 if test -z "$x_libraries"; then
8505     x_libraries="no_x_libraries"
8507 if test "$x_includes" = "default_x_includes"; then
8508     XINC="/usr/include"
8509 else
8510     XINC="$x_includes"
8512 AC_SUBST(XINC)
8513 if test "$x_libraries" = "default_x_libraries"; then
8514     XLIB=`$PKG_CONFIG --variable=libdir x11`
8515     if test "x$XLIB" = x; then
8516         XLIB="/usr/lib"
8517     fi
8518 else
8519     XLIB="$x_libraries"
8521 if test "$XLIB" != "no_x_libraries" -a "$XLIB" != "/usr/lib" -a "$XLIB" != "/usr/lib64"; then
8522     SOLARLIB="$SOLARLIB -L$XLIB"
8524 if test "$XINC" != "no_x_includes" -a "$XINC" != "/usr/include"; then
8525     SOLARINC="$SOLARINC -I$XINC"
8527 AC_SUBST(XLIB)
8529 if test "$WANT_X11" = "yes"; then
8530     dnl ===================================================================
8531     dnl Check for Composite.h for Mozilla plugin
8532     dnl ===================================================================
8533     AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
8534      [#include <X11/Intrinsic.h>])
8536     dnl ===================================================================
8537     dnl Check for extension headers
8538     dnl ===================================================================
8539     AC_MSG_CHECKING([whether to use internal X11 extensions headers])
8540     if test "$with_system_xextensions_headers" != "no"; then
8541         AC_MSG_RESULT([no])
8542         AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
8543         [#include <X11/extensions/shape.h>])
8544     else
8545         AC_MSG_RESULT([yes])
8546         BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
8547     fi
8551 dnl ===================================================================
8552 dnl Check for system Xrender
8553 dnl ===================================================================
8554 AC_MSG_CHECKING([whether to use Xrender])
8555 if test "$WANT_X11" = "yes" -a  "$test_xrender" = "yes"; then
8556     AC_MSG_RESULT([yes])
8557     PKG_CHECK_MODULES(XRENDER, xrender)
8558     AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
8559       [AC_MSG_ERROR(libXrender not found or functional)], [])
8560     AC_MSG_CHECKING([which Xrender headers to use])
8561     if test "$with_system_xextensions_headers" != "no"; then
8562         AC_MSG_RESULT([external])
8563         AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
8564           [AC_MSG_ERROR(Xrender not found. install X)], [])
8565     else
8566         AC_MSG_RESULT([internal])
8567     fi
8568 else
8569     AC_MSG_RESULT([no])
8571 AC_SUBST(XRENDER_CFLAGS)
8572 AC_SUBST(XRENDER_LIBS)
8574 dnl ===================================================================
8575 dnl Check for XRandr
8576 dnl ===================================================================
8577 AC_MSG_CHECKING([whether to enable RandR support])
8578 if test "$WANT_X11" = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
8579     if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
8580         XRANDR_DLOPEN="TRUE"
8581         AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
8582     else
8583         AC_MSG_RESULT([yes])
8584         XRANDR_DLOPEN="FALSE"
8585         PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
8586         if test "$ENABLE_RANDR" != "TRUE"; then
8587             AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
8588                         [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
8589             XRANDR_CFLAGS=" "
8590             AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
8591               [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
8592             XRANDR_LIBS="-lXrandr "
8593             ENABLE_RANDR="TRUE"
8594         fi
8595     fi
8596 else
8597     ENABLE_RANDR=""
8598     AC_MSG_RESULT([no])
8600 AC_SUBST(XRANDR_DLOPEN)
8601 AC_SUBST(XRANDR_CFLAGS)
8602 AC_SUBST(XRANDR_LIBS)
8603 AC_SUBST(ENABLE_RANDR)
8605 dnl ===================================================================
8606 dnl Check for building neon
8607 dnl ===================================================================
8608 AC_MSG_CHECKING([whether to use neon])
8609 if test "$enable_neon" = "no"; then
8610     AC_MSG_RESULT([no])
8611     DISABLE_NEON=TRUE
8612     AC_SUBST(DISABLE_NEON)
8613 else
8614     AC_MSG_RESULT([yes])
8615 dnl ===================================================================
8616 dnl Check for system neon
8617 dnl ===================================================================
8618 AC_MSG_CHECKING([which neon to use])
8619 if test "$with_system_neon" = "yes"; then
8620     AC_MSG_RESULT([external])
8621     PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
8622     NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
8623     SYSTEM_NEON=YES
8624     libo_MINGW_CHECK_DLL([NEON], [libneon])
8625     libo_MINGW_TRY_DLL([TASN1], [libtasn1])
8626     libo_MINGW_TRY_DLL([GNUTLS], [libgnutls])
8627 else
8628     AC_MSG_RESULT([internal])
8629     SYSTEM_NEON=NO
8630     BUILD_TYPE="$BUILD_TYPE NEON"
8631     NEON_VERSION=0295
8633 AC_SUBST(SYSTEM_NEON)
8634 AC_SUBST(NEON_LIBS)
8635 AC_SUBST(NEON_CFLAGS)
8636 AC_SUBST(NEON_VERSION)
8637 AC_SUBST([MINGW_GNUTLS_DLL])
8638 AC_SUBST([MINGW_NEON_DLL])
8639 AC_SUBST([MINGW_TASN1_DLL])
8642 dnl ===================================================================
8643 dnl Check for disabling cve_tests
8644 dnl ===================================================================
8645 AC_MSG_CHECKING([whether to execute CVE tests])
8646 if test "$enable_cve_tests" = "no"; then
8647     AC_MSG_RESULT([no])
8648     DISABLE_CVE_TESTS=TRUE
8649     AC_SUBST(DISABLE_CVE_TESTS)
8650 else
8651     AC_MSG_RESULT([yes])
8654 dnl ===================================================================
8655 dnl Check for system openssl
8656 dnl ===================================================================
8657 if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8658         "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
8659     with_system_openssl=yes
8661 AC_MSG_CHECKING([which libssl to use])
8662 if test "$with_system_openssl" = "yes"; then
8663     AC_MSG_RESULT([external])
8664     # Mac OS builds should get out without extra stuff is the Mac porters'
8665     # wish. And pkg-config is although Xcode ships a .pc for openssl
8666     if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
8667             "$_os" = "DragonFly"; then
8668         OPENSSL_CFLAGS=
8669         OPENSSL_LIBS="-lssl -lcrypto"
8670     else
8671         PKG_CHECK_MODULES( OPENSSL, openssl )
8672     fi
8673     SYSTEM_OPENSSL=YES
8674     libo_MINGW_CHECK_DLL([SSL], [libssl])
8675     libo_MINGW_CHECK_DLL([CRYPTO], [libcrypto])
8676 else
8677     AC_MSG_RESULT([internal])
8678     SYSTEM_OPENSSL=NO
8679     BUILD_TYPE="$BUILD_TYPE OPENSSL"
8681 AC_SUBST(SYSTEM_OPENSSL)
8682 AC_SUBST(OPENSSL_CFLAGS)
8683 AC_SUBST(OPENSSL_LIBS)
8684 AC_SUBST([MINGW_SSL_DLL])
8685 AC_SUBST([MINGW_CRYPTO_DLL])
8687 dnl ===================================================================
8688 dnl Check for system redland
8689 dnl ===================================================================
8690 AC_MSG_CHECKING([which redland library to use])
8691 if test "$with_system_redland" = "yes"; then
8692     AC_MSG_RESULT([external])
8693     SYSTEM_REDLAND=YES
8694     dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
8695     PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
8696     libo_MINGW_CHECK_DLL([REDLAND], [librdf])
8697     libo_MINGW_TRY_DLL([RAPTOR], [libraptor])
8698     libo_MINGW_TRY_DLL([RASQAL], [librasqal])
8699     libo_MINGW_TRY_DLL([SQLITE3], [libsqlite3])
8700 else
8701     AC_MSG_RESULT([internal])
8702     BUILD_TYPE="$BUILD_TYPE REDLAND"
8703     SYSTEM_REDLAND=NO
8705 AC_SUBST(SYSTEM_REDLAND)
8706 AC_SUBST(REDLAND_CFLAGS)
8707 AC_SUBST(REDLAND_LIBS)
8708 AC_SUBST([MINGW_RAPTOR_DLL])
8709 AC_SUBST([MINGW_RASQAL_DLL])
8710 AC_SUBST([MINGW_REDLAND_DLL])
8711 AC_SUBST([MINGW_SQLITE3_DLL])
8713 dnl ===================================================================
8714 dnl Check for system orcus
8715 dnl ===================================================================
8716 AC_MSG_CHECKING([which orcus library to use])
8717 if test "$with_system_orcus" = "yes"; then
8718     AC_MSG_RESULT([external])
8719     SYSTEM_LIBORCUS=YES
8720     PKG_CHECK_MODULES(ORCUS, liborcus-0.4 >= 0.3.0)
8721 else
8722     AC_MSG_RESULT([internal])
8723     BUILD_TYPE="$BUILD_TYPE ORCUS"
8724     SYSTEM_LIBORCUS=NO
8726     if test "$SYSTEM_BOOST" = "YES"; then
8727         # ===========================================================
8728         # Determine if we are going to need to link with Boost.System
8729         # ===========================================================
8730         dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
8731         dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
8732         dnl in documentation has no effect.
8733         AC_MSG_CHECKING([if we need to link with Boost.System])
8734         AC_LANG_PUSH([C++])
8735         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8736                 @%:@include <boost/version.hpp>
8737             ]],[[
8738                 #if BOOST_VERSION >= 105000
8739                 #   error yes, we need to link with Boost.System
8740                 #endif
8741             ]])],[
8742                 AC_MSG_RESULT([no])
8743             ],[
8744                 AC_MSG_RESULT([yes])
8745                 AX_BOOST_SYSTEM
8746         ])
8747         AC_LANG_POP([C++])
8748     fi
8750 AC_SUBST([BOOST_SYSTEM_LIB])
8751 AC_SUBST(SYSTEM_LIBORCUS)
8752 AC_SUBST(ORCUS_CFLAGS)
8753 AC_SUBST(ORCUS_LIBS)
8755 dnl ===================================================================
8756 dnl Check for system hunspell
8757 dnl ===================================================================
8758 AC_MSG_CHECKING([which libhunspell to use])
8759 if test "$with_system_hunspell" = "yes"; then
8760     AC_MSG_RESULT([external])
8761     SYSTEM_HUNSPELL=YES
8762     AC_LANG_PUSH([C++])
8763     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
8764     if test "$HUNSPELL_PC" != "TRUE"; then
8765         AC_CHECK_HEADER(hunspell.hxx, [],
8766             [
8767             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
8768             [AC_MSG_ERROR(hunspell headers not found.)], [])
8769             ], [])
8770         AC_CHECK_LIB([hunspell], [main], [:],
8771            [ AC_MSG_ERROR(hunspell library not found.) ], [])
8772         HUNSPELL_LIBS=-lhunspell
8773     fi
8774     AC_LANG_POP([C++])
8775     libo_MINGW_CHECK_DLL([HUNSPELL], [libhunspell-1.3])
8776 else
8777     AC_MSG_RESULT([internal])
8778     SYSTEM_HUNSPELL=NO
8779     HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
8780     HUNSPELL_LIBS="-L${OUTDIR}/lib -lhunspell"
8781     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
8783 AC_SUBST(SYSTEM_HUNSPELL)
8784 AC_SUBST(HUNSPELL_CFLAGS)
8785 AC_SUBST(HUNSPELL_LIBS)
8786 AC_SUBST([MINGW_HUNSPELL_DLL])
8788 dnl ===================================================================
8789 dnl Checking for altlinuxhyph
8790 dnl ===================================================================
8791 AC_MSG_CHECKING([which altlinuxhyph to use])
8792 if test "$with_system_altlinuxhyph" = "yes"; then
8793     AC_MSG_RESULT([external])
8794     SYSTEM_HYPH=YES
8795     AC_CHECK_HEADER(hyphen.h, [],
8796        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
8797     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
8798        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
8799        [#include <hyphen.h>])
8800     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
8801         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8802     if test -z "$HYPHEN_LIB"; then
8803         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
8804            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8805     fi
8806     if test -z "$HYPHEN_LIB"; then
8807         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
8808            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
8809     fi
8810     libo_MINGW_CHECK_DLL([HYPHEN], [libhyphen])
8811 else
8812     AC_MSG_RESULT([internal])
8813     SYSTEM_HYPH=NO
8814     BUILD_TYPE="$BUILD_TYPE HYPHEN"
8816 AC_SUBST(SYSTEM_HYPH)
8817 AC_SUBST(HYPHEN_LIB)
8818 AC_SUBST([MINGW_HYPHEN_DLL])
8820 dnl ===================================================================
8821 dnl Checking for mythes
8822 dnl ===================================================================
8823 AC_MSG_CHECKING([which mythes to use])
8824 if test "$with_system_mythes" = "yes"; then
8825     AC_MSG_RESULT([external])
8826     SYSTEM_MYTHES=YES
8827     AC_LANG_PUSH([C++])
8828     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
8829     if test "$MYTHES_PKGCONFIG" = "no"; then
8830         AC_CHECK_HEADER(mythes.hxx, [],
8831             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
8832         AC_CHECK_LIB([mythes-1.2], [main], [:],
8833             [ MYTHES_FOUND=no], [])
8834     if test "$MYTHES_FOUND" = "no"; then
8835         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
8836                 [ MYTHES_FOUND=no], [])
8837     fi
8838     if test "$MYTHES_FOUND" = "no"; then
8839         AC_MSG_ERROR([mythes library not found!.])
8840     fi
8841     fi
8842     AC_LANG_POP([C++])
8843     libo_MINGW_CHECK_DLL([MYTHES], [libmythes-1.2])
8844 else
8845     AC_MSG_RESULT([internal])
8846     SYSTEM_MYTHES=NO
8847     BUILD_TYPE="$BUILD_TYPE MYTHES"
8849 AC_SUBST(SYSTEM_MYTHES)
8850 AC_SUBST(MYTHES_CFLAGS)
8851 AC_SUBST(MYTHES_LIBS)
8852 AC_SUBST([MINGW_MYTHES_DLL])
8854 dnl ===================================================================
8855 dnl Checking for lpsolve
8856 dnl ===================================================================
8857 AC_MSG_CHECKING([which lpsolve to use])
8858 if test "$with_system_lpsolve" = "yes"; then
8859     AC_MSG_RESULT([external])
8860     SYSTEM_LPSOLVE=YES
8861     AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
8862        [ AC_MSG_ERROR(lpsolve headers not found.)], [])
8863     save_LIBS=$LIBS
8864     # some systems need this. Like Ubuntu....
8865     AC_CHECK_LIB(m, floor)
8866     AC_CHECK_LIB(dl, dlopen)
8867     AC_CHECK_LIB([lpsolve55], [make_lp], [:],
8868         [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
8869     LIBS=$save_LIBS
8870     libo_MINGW_CHECK_DLL([LPSOLVE], [lpsolve55])
8871 else
8872     AC_MSG_RESULT([internal])
8873     SYSTEM_LPSOLVE=NO
8874     BUILD_TYPE="$BUILD_TYPE LPSOLVE"
8876 AC_SUBST(SYSTEM_LPSOLVE)
8877 AC_SUBST([MINGW_LPSOLVE_DLL])
8879 dnl ===================================================================
8880 dnl Checking for libexttextcat
8881 dnl ===================================================================
8882 AC_MSG_CHECKING([which libexttextcat to use])
8883 if test "$with_system_libexttextcat" = "yes"; then
8884     AC_MSG_RESULT([external])
8885     SYSTEM_LIBEXTTEXTCAT=YES
8886     PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
8887     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
8888 else
8889     AC_MSG_RESULT([internal])
8890     SYSTEM_LIBEXTTEXTCAT=NO
8891     BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
8893 AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
8894 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
8895 AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
8896 AC_SUBST(LIBEXTTEXTCAT_LIBS)
8898 dnl ***************************************
8899 dnl testing libc version for Linux...
8900 dnl ***************************************
8901 if test "$_os" = "Linux"; then
8902     AC_MSG_CHECKING([whether libc is >= 2.1.1])
8903     exec 6>/dev/null # no output
8904     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
8905     exec 6>&1 # output on again
8906     if test "$HAVE_LIBC"; then
8907         AC_MSG_RESULT([yes])
8908     else
8909         AC_MSG_ERROR([no, upgrade libc])
8910     fi
8913 if test "$_os" != "WINNT"; then
8914     AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
8915     AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
8916     if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
8917         SYSTEM_LIBC=YES
8918     fi
8919 else
8920     HAVE_GETOPT=NO
8921     HAVE_READDIR_R=NO
8922     SYSTEM_LIBC=YES
8924 AC_SUBST(HAVE_GETOPT)
8925 AC_SUBST(HAVE_READDIR_R)
8926 AC_SUBST(SYSTEM_LIBC)
8928 dnl =========================================
8929 dnl Check for the Windows  SDK.
8930 dnl =========================================
8931 dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
8932 dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
8933 if test "$_os" = "WINNT"; then
8934     AC_MSG_CHECKING([for Windows SDK])
8935     if test "$build_os" = "cygwin"; then
8936         if test -z "$with_windows_sdk_home"; then
8937             # This first line will detect a February 2003 Microsoft Platform SDK
8938             WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
8939             # But there might be also an April 2005 PSDK, unfortunately MS changed
8940             # the registry entry. (we prefer the old version!?)
8941             if test -z "$WINDOWS_SDK_HOME"; then
8942                 WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
8943             fi
8944             # normalize if found
8945             if test -n "$WINDOWS_SDK_HOME"; then
8946                 WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
8947                 WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8949                 # If this sdk is incomplete, lets see if the one
8950                 # recommended to be installed is available.
8952                 # This refers to the Windows SDK 8 (as distributed
8953                 # with Visual Studio 2012, or maybe also
8954                 # separately), I assume.
8956                 # I wouldn't say that it is "incomplete", it is
8957                 # just structured differtently. We do seem to try
8958                 # to adapt to that structure below (look for the
8959                 # Include/um etc stuff), so rejecting it here is a
8960                 # bit premature... *but* then one notices that
8961                 # compiling with MSVS2008 and trying to use SDK 8
8962                 # leads to horrible errors in ICU at least. Oh
8963                 # well.
8965                 if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe"; then
8966                     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`
8967                     if test -n "$WINDOWS_SDK7_HOME"; then
8968                         WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK7_HOME"`
8969                         WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
8970                     fi
8971                 fi
8972             fi
8973         else
8974             WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
8975         fi
8976     fi
8977     if test -n "$WINDOWS_SDK_HOME"; then
8978         # Remove a possible trailing backslash
8979         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
8980         # Problem with current PSDK (iz 49865)
8981         # (What "current" does that mean?)
8982         if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
8983             AC_MSG_ERROR([
8984 Some modules do not build correctly with MS Platform SDK - April 2005
8985 Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
8986 Remove/rename/backup that file and restart configure. Details about this
8987 problem can be found in issue 49856.])
8988         fi
8990         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
8991              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
8992              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
8993             HAVE_PSDK_H="yes"
8994         elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
8995              -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
8996              -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
8997             HAVE_PSDK_H="yes"
8998         else
8999             HAVE_PSDK_H="no"
9000         fi
9001         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
9002             HAVE_PSDK_LIB="yes"
9003         elif test -f "$WINDOWS_SDK_HOME/lib/win8/um/$SDK_ARCH/user32.lib"; then
9004             HAVE_PSDK_LIB="yes"
9005         else
9006             HAVE_PSDK_LIB="no"
9007         fi
9009         if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
9010             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
9011 the  Windows SDK are installed.])
9012         fi
9014         if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
9015              -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
9016              -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
9017              -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
9018         elif test ! -x "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
9019              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
9020              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
9021              -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
9022         else
9023             AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
9024         fi
9025     fi
9027     if test -z "$WINDOWS_SDK_HOME"; then
9028         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
9029     elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
9030         WINDOWS_SDK_VERSION=61
9031         AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
9032     elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
9033         WINDOWS_SDK_VERSION=60
9034         AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
9035     elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
9036         WINDOWS_SDK_VERSION=70
9037         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
9038     elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
9039         WINDOWS_SDK_VERSION=80
9040         AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
9041     else
9042         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
9043     fi
9044     PathFormat "$WINDOWS_SDK_HOME"
9045     WINDOWS_SDK_HOME="$formatted_path"
9046     if test "$build_os" = "cygwin"; then
9047         SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
9048         if test -d "$WINDOWS_SDK_HOME/include/um"; then
9049             SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
9050         fi
9051     fi
9053 AC_SUBST(WINDOWS_SDK_HOME)
9054 AC_SUBST(WINDOWS_SDK_VERSION)
9056 dnl =========================================
9057 dnl Check for uuidgen
9058 dnl =========================================
9059 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
9060     if test "$WITH_MINGW" = "yes"; then
9061         AC_PATH_PROG([UUIDGEN], [uuid])
9062         if test -z "$UUIDGEN"; then
9063             AC_MSG_WARN([uuid is needed for dev-install])
9064         fi
9065     else
9066         # presence is already tested above in the WINDOWS_SDK_HOME check
9067         UUIDGEN=uuidgen.exe
9068         AC_SUBST(UUIDGEN)
9069     fi
9070 else
9071     AC_PATH_PROG([UUIDGEN], [uuidgen])
9072     if test -z "$UUIDGEN"; then
9073         AC_MSG_WARN([uuid is needed for dev-install])
9074     fi
9077 dnl =========================================
9078 dnl Check for the Microsoft DirectX SDK.
9079 dnl =========================================
9080 if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
9081     AC_MSG_CHECKING([for DirectX SDK])
9082     if test "$build_os" = "cygwin"; then
9083         if test -z "$with_directx_home"; then
9084             dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
9085             if test -n "$DXSDK_DIR"; then
9086                 DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
9087                 DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
9088             fi
9089             # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
9090             # the "DirectX SDK not found" error later
9091         else
9092             DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
9093         fi
9094         # Remove a possible trailing backslash
9095         DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
9096     elif test -n "$with_directx_home"; then
9097         DIRECTXSDK_HOME="$with_directx_home"
9098     fi
9100     if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h"; then
9101         HAVE_DIRECTXSDK_H="yes"
9102     else
9103         HAVE_DIRECTXSDK_H="no"
9104     fi
9106     if test "$BITNESS_OVERRIDE" = 64; then
9107         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x64"
9108     else
9109         DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
9110     fi
9111     PathFormat "$DIRECTXSDK_LIB"
9112     DIRECTXSDK_LIB="$formatted_path"
9114     if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib"; then
9115         HAVE_DIRECTXSDK_LIB="yes"
9116     else
9117         HAVE_DIRECTXSDK_LIB="no"
9118     fi
9120     if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
9121         AC_MSG_RESULT([found])
9122     else
9123         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
9124     fi
9125     PathFormat "$DIRECTXSDK_HOME"
9126     DIRECTXSDK_HOME="$formatted_path"
9127     SOLARINC="$SOLARINC -I$DIRECTXSDK_HOME/include"
9129 AC_SUBST(DIRECTXSDK_HOME)
9130 AC_SUBST(DIRECTXSDK_LIB)
9132 dnl ***************************************
9133 dnl Checking for bison and flex
9134 dnl ***************************************
9135 AC_PATH_PROG(BISON, bison)
9136 ANCIENT_BISON="NO"
9137 if test -z "$BISON"; then
9138     AC_MSG_ERROR([no bison found in \$PATH, install it])
9139 else
9140     AC_MSG_CHECKING([the bison version])
9141     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
9142     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
9143     # Accept newer than 1.875 or older(equal) than 1.75
9144     if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
9145         if test "$_bison_version" = "1.875"; then
9146             AC_MSG_WARN([suspect ($BISON $_bison_version)])
9147             add_warning "Suspect ($BISON $_bison_version) suggest upgrade"
9148         else
9149             AC_MSG_RESULT([checked ($BISON $_bison_version)])
9150         fi
9151     else
9152         AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
9153     fi
9154     if test "$_bison_longver" -lt 2000; then
9155         ANCIENT_BISON="YES"
9156     fi
9158 AC_SUBST(ANCIENT_BISON)
9160 AC_PATH_PROG(FLEX, flex)
9161 if test -z "$FLEX"; then
9162     AC_MSG_ERROR([no flex found in \$PATH, install it])
9164 AC_SUBST([FLEX])
9165 dnl ***************************************
9166 dnl Checking for patch
9167 dnl ***************************************
9168 AC_PATH_PROG(PATCH, patch)
9169 if test -z "$PATCH"; then
9170     AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
9173 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
9174 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
9175     if test -z "$with_gnu_patch"; then
9176         GNUPATCH=$PATCH
9177     else
9178         if test -x "$with_gnu_patch"; then
9179             GNUPATCH=$with_gnu_patch
9180         else
9181             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
9182         fi
9183     fi
9185     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
9186     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
9187         AC_MSG_RESULT([yes])
9188     else
9189         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
9190     fi
9191 else
9192     GNUPATCH=$PATCH
9195 dnl We also need to check for --with-gnu-cp
9197 if test -z "$with_gnu_cp"; then
9198     # check the place where the good stuff is hidden on Solaris...
9199     if test -x /usr/gnu/bin/cp; then
9200         GNUCP=/usr/gnu/bin/cp
9201     else
9202         AC_PATH_PROGS(GNUCP, gnucp cp)
9203     fi
9204     if test -z $GNUCP; then
9205         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
9206     fi
9207 else
9208     if test -x "$with_gnu_cp"; then
9209         GNUCP=$with_gnu_cp
9210     else
9211         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
9212     fi
9215 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
9216 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
9217     AC_MSG_RESULT([yes])
9218 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
9219     AC_MSG_RESULT([yes])
9220 else
9221     case "$build_os" in
9222     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
9223         x_GNUCP=[\#]
9224         GNUCP=''
9225         AC_MSG_RESULT([no gnucp found - using the system's cp command])
9226         ;;
9227     *)
9228         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
9229         ;;
9230     esac
9233 AC_SUBST(GNUPATCH)
9234 AC_SUBST(GNUCP)
9235 AC_SUBST(x_GNUCP)
9237 dnl ***************************************
9238 dnl testing assembler path
9239 dnl ***************************************
9240 ML_EXE=""
9241 if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
9242     if test "$BITNESS_OVERRIDE" = ""; then
9243         assembler=ml.exe
9244         assembler_bin=bin
9245     else
9246         assembler=ml64.exe
9247         assembler_bin=bin/amd64
9248     fi
9249     if test -n "$with_asm_home"; then
9250         with_asm_home=`cygpath -u "$with_asm_home"`
9251     fi
9252     if test -x "$with_asm_home/$assembler"; then
9253         AC_MSG_CHECKING([$assembler assembler path])
9254         AC_MSG_RESULT([$with_asm_home/$assembler])
9255         ML_EXE="$with_asm_home/$assembler"
9256     else
9257         AC_PATH_PROG(ML_EXE, $assembler)
9258         if test -z "$ML_EXE"; then
9259             AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
9260             if test -x "$with_cl_home/$assembler_bin/$assembler"; then
9261                 with_asm_home=$with_cl_home/$assembler_bin
9262                 AC_MSG_RESULT([found])
9263                 ML_EXE="$with_cl_home/$assembler_bin/$assembler"
9264             else
9265                 AC_MSG_ERROR([Configure did not find $assembler assembler.])
9266             fi
9267         else
9268             with_asm_home="ASM_IN_PATH"
9269             ML_EXE="$assembler"
9270         fi
9271     fi
9272     PathFormat "$with_asm_home"
9273     ASM_HOME="$formatted_path"
9274 else
9275     ASM_HOME=""
9278 AC_SUBST(ML_EXE)
9280 dnl ===================================================================
9281 dnl We need zip and unzip
9282 dnl ===================================================================
9283 AC_PATH_PROG(ZIP, zip)
9284 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
9285 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
9286     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],,)
9289 AC_PATH_PROG(UNZIP, unzip)
9290 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
9292 dnl ===================================================================
9293 dnl Zip must be a specific type for different build types.
9294 dnl ===================================================================
9295 if test $build_os = cygwin; then
9296     if test -n "`$ZIP -h | $GREP -i WinNT`"; then
9297         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
9298     fi
9301 dnl ===================================================================
9302 dnl Test which vclplugs have to be built.
9303 dnl ===================================================================
9304 R=""
9305 GTK3_CFLAGS=""
9306 GTK3_LIBS=""
9307 ENABLE_GTK3=""
9308 if test "x$enable_gtk3" = "xyes"; then
9309     if test "$with_system_cairo" != yes; then
9310         AC_MSG_WARN([System cairo required for gtk3 support, please use --with-system-cairo])
9311         add_warning "System cairo required for gtk3 support, please use --with-system-cairo"
9312     fi
9313     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="")
9314     if test "x$ENABLE_GTK3" = "xTRUE"; then
9315         R="gtk3"
9316     else
9317         AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
9318     fi
9320 AC_SUBST(GTK3_LIBS)
9321 AC_SUBST(GTK3_CFLAGS)
9322 AC_SUBST(ENABLE_GTK3)
9324 AC_MSG_CHECKING([which VCLplugs shall be built])
9325 if test "$GUIBASE" != "unx" -o "$enable_headless" = "yes"; then
9326     enable_gtk=no
9328 ENABLE_GTK=""
9329 if test "x$enable_gtk" = "xyes"; then
9330     ENABLE_GTK="TRUE"
9331     R="gtk $R"
9333 AC_SUBST(ENABLE_GTK)
9335 ENABLE_TDE=""
9336 if test "x$enable_tde" = "xyes"; then
9337     # Libs kab and tdeab in connectivity and kdeab and tdeab in shell
9338     # are built from the same sources. So we only allow one of them.
9339     if test "x$enable_kde" = "xyes"; then
9340         AC_MSG_ERROR([enabling both KDE and TDE is not supported])
9341     fi
9342     ENABLE_TDE="TRUE"
9343     R="$R tde"
9345 AC_SUBST(ENABLE_TDE)
9347 ENABLE_KDE=""
9348 if test "x$enable_kde" = "xyes"; then
9349     ENABLE_KDE="TRUE"
9350     R="$R kde"
9352 AC_SUBST(ENABLE_KDE)
9354 ENABLE_KDE4=""
9355 if test "x$enable_kde4" = "xyes"; then
9356     ENABLE_KDE4="TRUE"
9357     R="$R kde4"
9359 AC_SUBST(ENABLE_KDE4)
9361 ENABLE_HEADLESS=""
9362 if test "x$enable_headless" = "xyes"; then
9363     ENABLE_HEADLESS="TRUE"
9364     SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
9365     R="headless"
9367 AC_SUBST(ENABLE_HEADLESS)
9369 if test -z "$R"; then
9370     AC_MSG_RESULT([none])
9371 else
9372     AC_MSG_RESULT([$R])
9375 dnl ===================================================================
9376 dnl GCONF check
9377 dnl ===================================================================
9379 ENABLE_GCONF=""
9380 AC_MSG_CHECKING([whether to enable GConf support])
9381 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
9382     ENABLE_GCONF="TRUE"
9383     AC_MSG_RESULT([yes])
9384     PKG_CHECK_MODULES( GCONF, gconf-2.0 gobject-2.0 )
9385 else
9386     AC_MSG_RESULT([no])
9388 AC_SUBST(GCONF_LIBS)
9389 AC_SUBST(GCONF_CFLAGS)
9390 AC_SUBST(ENABLE_GCONF)
9392 dnl ===================================================================
9393 dnl Gnome VFS check
9394 dnl ===================================================================
9396 ENABLE_GNOMEVFS=""
9397 AC_MSG_CHECKING([whether to enable GNOME VFS support])
9398 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
9399     ENABLE_GNOMEVFS="TRUE"
9400     AC_MSG_RESULT([yes])
9401     PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
9402 else
9403     AC_MSG_RESULT([no])
9405 AC_SUBST(GNOMEVFS_LIBS)
9406 AC_SUBST(GNOMEVFS_CFLAGS)
9407 AC_SUBST(ENABLE_GNOMEVFS)
9409 dnl ===================================================================
9410 dnl check for dbus support
9411 dnl ===================================================================
9412 ENABLE_DBUS=""
9413 DBUS_CFLAGS=""
9414 DBUS_LIBS=""
9416 if test "$enable_dbus" = "no"; then
9417     test_dbus=no
9420 AC_MSG_CHECKING([whether to enable DBUS support])
9421 if test "$test_dbus" = "yes"; then
9422     ENABLE_DBUS="TRUE"
9423     AC_MSG_RESULT([yes])
9424     PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
9425 else
9426     AC_MSG_RESULT([no])
9429 AC_SUBST(ENABLE_DBUS)
9430 AC_SUBST(DBUS_CFLAGS)
9431 AC_SUBST(DBUS_LIBS)
9433 AC_MSG_CHECKING([whether to enable font install via packagekit])
9434 if test "$ENABLE_DBUS" = "TRUE"; then
9435     if test -n "$enable_packagekit" -a "$enable_packagekit" != "no"; then
9436         ENABLE_PACKAGEKIT=YES
9437         AC_MSG_RESULT([yes])
9438     else
9439         ENABLE_PACKAGEKIT=NO
9440         AC_MSG_RESULT([no])
9441     fi
9442 else
9443     AC_MSG_RESULT([no, dbus disabled.])
9445 AC_SUBST(ENABLE_PACKAGEKIT)
9447 AC_MSG_CHECKING([whether to enable Impress remote control])
9448 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
9449     AC_MSG_RESULT([yes])
9450     ENABLE_SDREMOTE=YES
9451     AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
9453     # If not explicitly enabled or disabled, default
9454     if test -z "$enable_sdremote_bluetooth"; then
9455         case "$OS" in
9456         LINUX|MACOSX|WNT)
9457             # Default to yes for these
9458             enable_sdremote_bluetooth=yes
9459             ;;
9460         *)
9461             # otherwise no
9462             enable_sdremote_bluetooth=no
9463             ;;
9464         esac
9465     fi
9466     # $enable_sdremote_bluetooth is guaranteed non-empty now
9468     if test "$enable_sdremote_bluetooth" != "no"; then
9469         if test "$OS" = "LINUX"; then
9470             if test "$ENABLE_DBUS" = "TRUE"; then
9471                 AC_MSG_RESULT([yes])
9472                 ENABLE_SDREMOTE_BLUETOOTH=YES
9473                 dnl ===================================================================
9474                 dnl Check for system bluez
9475                 dnl ===================================================================
9476                 AC_MSG_CHECKING([which Bluetooth header to use])
9477                 if test "$with_system_bluez" = "yes"; then
9478                     AC_MSG_RESULT([external])
9479                     AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
9480                         [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
9481                 else
9482                     AC_MSG_RESULT([internal])
9483                     BUILD_TYPE="$BUILD_TYPE BLUEZ"
9484                 fi
9485             else
9486                 AC_MSG_RESULT([no, dbus disabled])
9487                 ENABLE_SDREMOTE_BLUETOOTH=NO
9488             fi
9489         else
9490             AC_MSG_RESULT([yes])
9491             ENABLE_SDREMOTE_BLUETOOTH=YES
9492         fi
9493     else
9494         AC_MSG_RESULT([no])
9495         ENABLE_SDREMOTE_BLUETOOTH=NO
9496     fi
9497 else
9498     ENABLE_SDREMOTE=NO
9499     AC_MSG_RESULT([no])
9501 AC_SUBST(ENABLE_SDREMOTE)
9502 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
9504 dnl ===================================================================
9505 dnl Check whether the gtk 2.0 libraries are available.
9506 dnl ===================================================================
9508 GTK_CFLAGS=""
9509 GTK_LIBS=""
9510 ENABLE_SYSTRAY_GTK=""
9511 if test  "$test_gtk" = "yes"; then
9513     if test "$ENABLE_GTK" = "TRUE"; then
9514         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]))
9515         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]))
9516         BUILD_TYPE="$BUILD_TYPE GTK"
9518     AC_MSG_CHECKING([whether to enable the systray quickstarter])
9519         if test "x$enable_systray" = "xyes"; then
9520         AC_MSG_RESULT([yes])
9521             PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
9522                             [ ENABLE_SYSTRAY_GTK="TRUE" ],
9523                             [ ENABLE_SYSTRAY_GTK="" ])
9524         else
9525         AC_MSG_RESULT([no])
9526         fi
9528         AC_MSG_CHECKING([whether to enable Gtk print dialog support])
9529         PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
9530                           [ENABLE_GTK_PRINT="TRUE"],
9531                           [ENABLE_GTK_PRINT=""])
9533         AC_MSG_CHECKING([whether to enable GIO support])
9534         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
9535             if test "$ENABLE_GNOMEVFS" = "TRUE"; then
9536                 AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
9537             fi
9538             ENABLE_GIO="TRUE"
9539             AC_MSG_RESULT([yes])
9540             PKG_CHECK_MODULES( GIO, gio-2.0 )
9541         else
9542             AC_MSG_RESULT([no])
9543         fi
9544     fi
9546 AC_SUBST(ENABLE_GIO)
9547 AC_SUBST(GIO_CFLAGS)
9548 AC_SUBST(GIO_LIBS)
9549 AC_SUBST(ENABLE_SYSTRAY_GTK)
9550 AC_SUBST(GTK_CFLAGS)
9551 AC_SUBST(GTK_LIBS)
9552 AC_SUBST(GTHREAD_CFLAGS)
9553 AC_SUBST(GTHREAD_LIBS)
9554 AC_SUBST([ENABLE_GTK_PRINT])
9555 AC_SUBST([GTK_PRINT_CFLAGS])
9556 AC_SUBST([GTK_PRINT_LIBS])
9559 dnl ===================================================================
9560 dnl Check whether the Telepathy libraries are available.
9561 dnl ===================================================================
9563 ENABLE_TELEPATHY=""
9564 TELEPATHY_CFLAGS=""
9565 TELEPATHY_LIBS=""
9567 AC_MSG_CHECKING([whether to enable Telepathy support])
9568 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
9569     ENABLE_TELEPATHY="TRUE"
9570     AC_MSG_RESULT([yes])
9571     PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 )
9572 else
9573     AC_MSG_RESULT([no])
9576 AC_SUBST(ENABLE_TELEPATHY)
9577 AC_SUBST(TELEPATHY_CFLAGS)
9578 AC_SUBST(TELEPATHY_LIBS)
9581 dnl ===================================================================
9583 PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
9584 AC_SUBST(LIBPNG_LIBS)
9585 AC_SUBST(LIBPNG_CFLAGS)
9587 AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
9588 if test "x$enable_unix_qstart_libpng" != "xno"; then
9589     AC_MSG_RESULT([yes])
9590 else
9591     AC_MSG_RESULT([no])
9592     ENABLE_QUICKSTART_LIBPNG=""
9594 AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
9596 SPLIT_APP_MODULES=""
9597 if test "$enable_split_app_modules" = "yes"; then
9598     SPLIT_APP_MODULES="YES"
9600 AC_SUBST(SPLIT_APP_MODULES)
9602 SPLIT_OPT_FEATURES=""
9603 if test "$enable_split_opt_features" = "yes"; then
9604     SPLIT_OPT_FEATURES="YES"
9606 AC_SUBST(SPLIT_OPT_FEATURES)
9608 if test $_os = Darwin -o $_os = WINNT; then
9609     if test "$enable_cairo_canvas" = yes; then
9610         AC_MSG_ERROR([The cairo canvas should not be used for this platform])
9611     fi
9612     enable_cairo_canvas=no
9613 elif test -z "$enable_cairo_canvas"; then
9614     enable_cairo_canvas=yes
9617 ENABLE_CAIRO_CANVAS=""
9618 if test "$enable_cairo_canvas" = "yes"; then
9619     test_cairo=yes
9620     ENABLE_CAIRO_CANVAS="TRUE"
9622 AC_SUBST(ENABLE_CAIRO_CANVAS)
9624 dnl ===================================================================
9625 dnl Check whether the GStreamer libraries are available.
9626 dnl ===================================================================
9628 ENABLE_GSTREAMER=""
9630 if test "$build_gstreamer" = "yes"; then
9632     AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
9633     if test "x$enable_gstreamer" != "xno"; then
9634         ENABLE_GSTREAMER="TRUE"
9635         AC_MSG_RESULT([yes])
9636         PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
9637         GSTREAMER_CFLAGS="`echo $GSTREAMER_CFLAGS | sed -e \"s/-I/${ISYSTEM}/g\"`"
9638     else
9639         AC_MSG_RESULT([no])
9640     fi
9642 AC_SUBST(GSTREAMER_CFLAGS)
9643 AC_SUBST(GSTREAMER_LIBS)
9644 AC_SUBST(ENABLE_GSTREAMER)
9647 ENABLE_GSTREAMER_0_10=""
9648 if test "$build_gstreamer_0_10" = "yes"; then
9650     AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
9651     if test "x$enable_gstreamer_0_10" != "xno"; then
9652         ENABLE_GSTREAMER_0_10="TRUE"
9653         AC_MSG_RESULT([yes])
9654         PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
9655             PKG_CHECK_MODULES(  [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10] )
9656         ])
9657         GSTREAMER_0_10_CFLAGS="`echo $GSTREAMER_0_10_CFLAGS | sed -e \"s/-I/${ISYSTEM}/g\"`"
9658     else
9659         AC_MSG_RESULT([no])
9660     fi
9663 AC_SUBST(GSTREAMER_0_10_CFLAGS)
9664 AC_SUBST(GSTREAMER_0_10_LIBS)
9665 AC_SUBST(ENABLE_GSTREAMER_0_10)
9667 dnl ===================================================================
9668 dnl Check whether the OpenGL libraries are available
9669 dnl ===================================================================
9671 AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
9672 ENABLE_OPENGL=
9674 if test "$_os" = "Darwin"; then
9675     # We use frameworks on Mac OS X, no need for detail checks
9676     ENABLE_OPENGL=TRUE
9677     SYSTEM_MESA_HEADERS=YES
9678     AC_MSG_RESULT([yes])
9679 else
9680     if test "x$enable_opengl" != "xno"; then
9681         if test "$_os" != "WINNT"; then
9682             save_LDFLAGS=$LDFLAGS
9683             LDFLAGS="$LDFLAGS -lm"
9684             AC_MSG_RESULT([yes])
9685             AC_CHECK_LIB([GL], [main], [:],
9686                       [AC_MSG_ERROR(libGL not installed or functional)], [])
9687             LDFLAGS="$LDFLAGS -lGL"
9688             AC_CHECK_LIB([GLU], [main], [:],
9689                       [AC_MSG_ERROR(libGLU not installed or functional)], [])
9690             ENABLE_OPENGL=TRUE
9691             LDFLAGS=$save_LDFLAGS
9693             dnl ===================================================================
9694             dnl Check for system Mesa
9695             dnl ===================================================================
9696             AC_MSG_CHECKING([which Mesa headers to use])
9697             if test "$with_system_mesa_headers" = "yes"; then
9698                 AC_MSG_RESULT([external])
9699                 SYSTEM_MESA_HEADERS=YES
9700                 AC_LANG_PUSH(C)
9701                 AC_CHECK_HEADER(GL/glxext.h, [],
9702                    [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
9703                 AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
9704                 AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
9705                 AC_LANG_POP(C)
9706             else
9707                 AC_MSG_RESULT([internal])
9708                 SYSTEM_MESA_HEADERS=NO
9709                 BUILD_TYPE="$BUILD_TYPE MESA"
9710             fi
9711         else
9712             AC_MSG_RESULT([not on Windows])
9713         fi
9714     else
9715        AC_MSG_RESULT([no])
9716     fi
9719 AC_SUBST(SYSTEM_MESA_HEADERS)
9720 AC_SUBST(ENABLE_OPENGL)
9722 # presenter minimizer extension?
9723 AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
9724 if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
9725    AC_MSG_RESULT([yes])
9726    ENABLE_MINIMIZER=YES
9727 else
9728    AC_MSG_RESULT([no])
9729    ENABLE_MINIMIZER=NO
9730    SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
9732 AC_SUBST(ENABLE_MINIMIZER)
9734 # pdf import?
9735 AC_MSG_CHECKING([whether to build the PDF import])
9736 if test "$_os" != Android -a "$_os" != iOS -a "$ENABLE_PDFIMPORT" != FALSE; then
9737   AC_MSG_RESULT([yes])
9738   ENABLE_PDFIMPORT=TRUE
9740   dnl ===================================================================
9741   dnl Check for system poppler
9742   dnl ===================================================================
9743   AC_MSG_CHECKING([which pdf backend to use])
9744   if test "$with_system_poppler" = "yes"; then
9745       AC_MSG_RESULT([external])
9746       SYSTEM_POPPLER=YES
9747       PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
9748       AC_LANG_PUSH([C++])
9749       save_CXXFLAGS=$CXXFLAGS
9750       save_CPPFLAGS=$CPPFLAGS
9751       CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
9752       CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
9753       AC_CHECK_HEADER([cpp/poppler-version.h], [],
9754                    [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
9755       CXXFLAGS=$save_CXXFLAGS
9756       CPPFLAGS=$save_CPPFLAGS
9757       AC_LANG_POP([C++])
9758       libo_MINGW_CHECK_DLL([POPPLER], [libpoppler])
9759   else
9760       AC_MSG_RESULT([internal])
9761       SYSTEM_POPPLER=NO
9762       BUILD_TYPE="$BUILD_TYPE XPDF"
9763   fi
9764 else
9765   AC_MSG_RESULT([no])
9766   ENABLE_PDFIMPORT=FALSE
9768 AC_SUBST(ENABLE_PDFIMPORT)
9769 AC_SUBST(SYSTEM_POPPLER)
9770 AC_SUBST(POPPLER_CFLAGS)
9771 AC_SUBST(POPPLER_LIBS)
9772 AC_SUBST([MINGW_POPPLER_DLL])
9774 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
9775 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9776   AC_MSG_RESULT([yes])
9777   ENABLE_MEDIAWIKI=YES
9778   BUILD_TYPE="$BUILD_TYPE XSLTML"
9779   if test  "x$with_java" = "xno"; then
9780     AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
9781   fi
9782 else
9783   AC_MSG_RESULT([no])
9784   ENABLE_MEDIAWIKI=NO
9785   SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
9787 AC_SUBST(ENABLE_MEDIAWIKI)
9789 if test "$ENABLE_MEDIAWIKI" = "YES"; then
9790     AC_MSG_CHECKING([which Servlet API Jar to use])
9791     if test "$with_system_servlet_api" = "yes"; then
9792         AC_MSG_RESULT([external])
9793         SYSTEM_SERVLETAPI=YES
9794         if test -z "$SERVLETAPI_JAR"; then
9795             SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
9796         fi
9797         AC_CHECK_FILE($SERVLETAPI_JAR, [],
9798               [AC_MSG_ERROR(servlet-api.jar not found.)], [])
9799     else
9800         AC_MSG_RESULT([internal])
9801         SYSTEM_SERVLETAPI=NO
9802         BUILD_TYPE="$BUILD_TYPE TOMCAT"
9803     fi
9805 AC_SUBST(SYSTEM_SERVLETAPI)
9806 AC_SUBST(SERVLETAPI_JAR)
9808 AC_MSG_CHECKING([whether to build the Report Builder extension])
9809 if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
9810     AC_MSG_RESULT([yes])
9811     ENABLE_REPORTBUILDER=YES
9812     AC_MSG_CHECKING([which jfreereport libs to use])
9813     if test "$with_system_jfreereport" = "yes"; then
9814         SYSTEM_JFREEREPORT=YES
9815         AC_MSG_RESULT([external])
9816         if test -z $SAC_JAR; then
9817             SAC_JAR=/usr/share/java/sac.jar
9818         fi
9819         AC_CHECK_FILE($SAC_JAR, [],
9820              [AC_MSG_ERROR(sac.jar not found.)], [])
9822         if test -z $LIBXML_JAR; then
9823             AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
9824                 [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
9825                 [
9826                     AC_CHECK_FILE(/usr/share/java/libxml.jar,
9827                        [ LIBXML_JAR=/usr/share/java/libxml.jar ],
9828                        [AC_MSG_ERROR(libxml.jar replacement not found.)]
9829                     )
9830                 ]
9831             )
9832         else
9833             AC_CHECK_FILE($LIBXML_JAR, [],
9834                  [AC_MSG_ERROR(libxml.jar not found.)], [])
9835         fi
9837         if test -z $FLUTE_JAR; then
9838             AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
9839                 [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
9840                 [
9841                     AC_CHECK_FILE(/usr/share/java/flute.jar,
9842                         [ FLUTE_JAR=/usr/share/java/flute.jar ],
9843                         [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
9844                     )
9845                 ]
9846             )
9847         else
9848             AC_CHECK_FILE($FLUTE_JAR, [],
9849                  [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
9850         fi
9852         if test -z $JFREEREPORT_JAR; then
9853             AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
9854                 [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
9855                 [
9856                     AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
9857                         [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
9858                         [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
9859                     )
9860                 ]
9861             )
9862         else
9863             AC_CHECK_FILE($JFREEREPORT_JAR, [],
9864                  [AC_MSG_ERROR(jfreereport.jar not found.)], [])
9865         fi
9867         if test -z $LIBLAYOUT_JAR; then
9868             AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
9869                 [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
9870                 [
9871                     AC_CHECK_FILE(/usr/share/java/liblayout.jar,
9872                         [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
9873                         [AC_MSG_ERROR(liblayout.jar replacement not found.)]
9874                     )
9875                 ]
9876             )
9877         else
9878             AC_CHECK_FILE($LIBLAYOUT_JAR, [],
9879                  [AC_MSG_ERROR(liblayout.jar not found.)], [])
9880         fi
9882         if test -z $LIBLOADER_JAR; then
9883             AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
9884                 [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
9885                 [
9886                     AC_CHECK_FILE(/usr/share/java/libloader.jar,
9887                        [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
9888                        [AC_MSG_ERROR(libloader.jar replacement not found.)]
9889                     )
9890                 ]
9891             )
9892         else
9893             AC_CHECK_FILE($LIBLOADER_JAR, [],
9894                 [AC_MSG_ERROR(libloader.jar not found.)], [])
9895         fi
9897         if test -z $LIBFORMULA_JAR; then
9898             AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
9899                  [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
9900                  [
9901                      AC_CHECK_FILE(/usr/share/java/libformula.jar,
9902                          [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
9903                          [AC_MSG_ERROR(libformula.jar replacement not found.)]
9904                      )
9905                  ]
9906             )
9907         else
9908             AC_CHECK_FILE($LIBFORMULA_JAR, [],
9909                 [AC_MSG_ERROR(libformula.jar not found.)], [])
9910         fi
9912         if test -z $LIBREPOSITORY_JAR; then
9913             AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
9914                 [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
9915                 [
9916                     AC_CHECK_FILE(/usr/share/java/librepository.jar,
9917                         [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
9918                         [AC_MSG_ERROR(librepository.jar replacement not found.)]
9919                     )
9920                 ]
9921             )
9922         else
9923             AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
9924                 [AC_MSG_ERROR(librepository.jar not found.)], [])
9925         fi
9927         if test -z $LIBFONTS_JAR; then
9928             AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
9929                 [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
9930                 [
9931                     AC_CHECK_FILE(/usr/share/java/libfonts.jar,
9932                         [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
9933                         [AC_MSG_ERROR(libfonts.jar replacement not found.)]
9934                     )
9935                 ]
9936             )
9937         else
9938             AC_CHECK_FILE($LIBFONTS_JAR, [],
9939                 [AC_MSG_ERROR(libfonts.jar not found.)], [])
9940         fi
9942         if test -z $LIBSERIALIZER_JAR; then
9943             AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
9944                 [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
9945                 [
9946                     AC_CHECK_FILE(/usr/share/java/libserializer.jar,
9947                         [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
9948                         [AC_MSG_ERROR(libserializer.jar replacement not found.)]
9949                     )
9950                 ]
9951             )
9952         else
9953             AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
9954                 [AC_MSG_ERROR(libserializer.jar not found.)], [])
9955         fi
9957         if test -z $LIBBASE_JAR; then
9958             AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
9959                 [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
9960                 [
9961                     AC_CHECK_FILE(/usr/share/java/libbase.jar,
9962                         [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
9963                         [AC_MSG_ERROR(libbase.jar replacement not found.)]
9964                     )
9965                 ]
9966             )
9967         else
9968             AC_CHECK_FILE($LIBBASE_JAR, [],
9969                 [AC_MSG_ERROR(libbase.jar not found.)], [])
9970         fi
9972     else
9973         AC_MSG_RESULT([internal])
9974         SYSTEM_JFREEREPORT=NO
9975         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
9976     fi
9977 else
9978     AC_MSG_RESULT([no])
9979     ENABLE_REPORTBUILDER=NO
9980     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
9981     SYSTEM_JFREEREPORT=NO
9983 AC_SUBST(ENABLE_REPORTBUILDER)
9984 AC_SUBST(SYSTEM_JFREEREPORT)
9985 AC_SUBST(SAC_JAR)
9986 AC_SUBST(LIBXML_JAR)
9987 AC_SUBST(FLUTE_JAR)
9988 AC_SUBST(JFREEREPORT_JAR)
9989 AC_SUBST(LIBBASE_JAR)
9990 AC_SUBST(LIBLAYOUT_JAR)
9991 AC_SUBST(LIBLOADER_JAR)
9992 AC_SUBST(LIBFORMULA_JAR)
9993 AC_SUBST(LIBREPOSITORY_JAR)
9994 AC_SUBST(LIBFONTS_JAR)
9995 AC_SUBST(LIBSERIALIZER_JAR)
9997 # this has to be here because both the Wiki Publisher and the SRB use
9998 # commons-logging
9999 if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
10000     AC_MSG_CHECKING([which Apache commons-* libs to use])
10001     if test "$with_system_apache_commons" = "yes"; then
10002         SYSTEM_APACHE_COMMONS=YES
10003         AC_MSG_RESULT([external])
10004         if test "$ENABLE_MEDIAWIKI" = "YES"; then
10005             if test -z $COMMONS_CODEC_JAR; then
10006                 AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
10007                     [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
10008                     [
10009                         AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
10010                             [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
10011                             [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
10012                         )
10013                     ]
10014                 )
10015             else
10016                 AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
10017                     [AC_MSG_ERROR(commons-codec.jar not found.)], [])
10018             fi
10020             if test -z $COMMONS_LANG_JAR; then
10021                 AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
10022                     [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
10023                     [
10024                         AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
10025                             [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
10026                             [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
10027                             )
10028                     ]
10029                 )
10030             else
10031                 AC_CHECK_FILE($COMMONS_LANG_JAR, [],
10032                     [AC_MSG_ERROR(commons-lang.jar not found.)], [])
10033             fi
10035             if test -z $COMMONS_HTTPCLIENT_JAR; then
10036                 AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
10037                     [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
10038                     [
10039                         AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
10040                             [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
10041                             [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
10042                         )
10043                     ]
10044                 )
10045             else
10046                 AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
10047                     [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
10048             fi
10049         fi
10050         if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
10051             if test -z $COMMONS_LOGGING_JAR; then
10052                 AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
10053                    [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
10054                    [
10055                         AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
10056                             [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
10057                             [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
10058                         )
10059                     ]
10060                 )
10061             else
10062                 AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
10063                     [AC_MSG_ERROR(commons-logging.jar not found.)], [])
10064             fi
10065         fi
10066     else
10067         AC_MSG_RESULT([internal])
10068         SYSTEM_APACHE_COMMONS=NO
10069         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
10070     fi
10072 AC_SUBST(SYSTEM_APACHE_COMMONS)
10073 AC_SUBST(COMMONS_CODEC_JAR)
10074 AC_SUBST(COMMONS_LANG_JAR)
10075 AC_SUBST(COMMONS_HTTPCLIENT_JAR)
10076 AC_SUBST(COMMONS_LOGGING_JAR)
10078 # scripting provider for BeanShell?
10079 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10080 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10081    AC_MSG_RESULT([yes])
10082    ENABLE_SCRIPTING_BEANSHELL=YES
10084    dnl ===================================================================
10085    dnl Check for system beanshell
10086    dnl ===================================================================
10087    AC_MSG_CHECKING([which beanshell to use])
10088    if test "$with_system_beanshell" = "yes"; then
10089        AC_MSG_RESULT([external])
10090        SYSTEM_BSH=YES
10091        if test -z $BSH_JAR; then
10092            BSH_JAR=/usr/share/java/bsh.jar
10093        fi
10094        AC_CHECK_FILE($BSH_JAR, [],
10095                   [AC_MSG_ERROR(bsh.jar not found.)], [])
10096    else
10097        AC_MSG_RESULT([internal])
10098        SYSTEM_BSH=NO
10099        BUILD_TYPE="$BUILD_TYPE BSH"
10100    fi
10101 else
10102    AC_MSG_RESULT([no])
10103    ENABLE_SCRIPTING_BEANSHELL=NO
10104    SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10106 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10107 AC_SUBST(SYSTEM_BSH)
10108 AC_SUBST(BSH_JAR)
10110 # scripting provider for JavaScript?
10111 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10112 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10113    AC_MSG_RESULT([yes])
10114    ENABLE_SCRIPTING_JAVASCRIPT=YES
10116    dnl ===================================================================
10117    dnl Check for system rhino
10118    dnl ===================================================================
10119    AC_MSG_CHECKING([which rhino to use])
10120    if test "$with_system_rhino" = "yes"; then
10121        AC_MSG_RESULT([external])
10122        SYSTEM_RHINO=YES
10123        if test -z $RHINO_JAR; then
10124            RHINO_JAR=/usr/share/java/js.jar
10125        fi
10126        AC_CHECK_FILE($RHINO_JAR, [],
10127                   [AC_MSG_ERROR(js.jar not found.)], [])
10128    else
10129        AC_MSG_RESULT([internal])
10130        SYSTEM_RHINO=NO
10131        BUILD_TYPE="$BUILD_TYPE RHINO"
10132    fi
10133 else
10134    AC_MSG_RESULT([no])
10135    ENABLE_SCRIPTING_JAVASCRIPT=NO
10136    SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10138 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10139 AC_SUBST(SYSTEM_RHINO)
10140 AC_SUBST(RHINO_JAR)
10142 dnl Scripting provider for Python extension?
10143 dnl We always provide this unless we have disabled Python completely
10144 if test $enable_python = no; then
10145     ENABLE_SCRIPTING_PYTHON=NO
10146     SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_PYTHON"
10147 else
10148     ENABLE_SCRIPTING_PYTHON=YES
10150 AC_SUBST(ENABLE_SCRIPTING_PYTHON)
10152 supports_multilib=
10153 case "$host_cpu" in
10154 x86_64 | powerpc64 | s390x)
10155     if test "$SIZEOF_LONG" = "8"; then
10156         supports_multilib="yes"
10157     fi
10158     ;;
10160     ;;
10161 esac
10163 dnl ===================================================================
10164 dnl Check whether the TQt and TDE libraries are available.
10165 dnl ===================================================================
10167 TDE_CFLAGS=""
10168 TDE_LIBS=""
10169 if test "$_os" != "OpenBSD"; then
10170     MOC="moc"
10172 if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
10173     dnl Search paths for TQt and TDE
10174     if test -z "$supports_multilib"; then
10175         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"
10176         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"
10177     else
10178         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"
10179         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"
10180     fi
10181     if test -n "$TQTDIR"; then
10182         tqt_incdirs="$TQTDIR/include $tqt_incdirs"
10183         if test -z "$supports_multilib"; then
10184             tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
10185         else
10186             tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
10187         fi
10188     fi
10189     if test -z "$supports_multilib"; then
10190         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"
10191         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"
10192     else
10193         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"
10194         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"
10195     fi
10196     if test -n "$TDEDIR"; then
10197         tde_incdirs="$TDEDIR/include $tde_incdirs"
10198         if test -z "$supports_multilib"; then
10199             tde_libdirs="$TDEDIR/lib $tde_libdirs"
10200         else
10201             tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
10202         fi
10203     fi
10205     dnl What to test
10206     tqt_test_include="ntqstyle.h"
10207     tde_test_include="kapp.h"
10209     if test "$_os" != "OpenBSD"; then
10210         tqt_test_library="libtqt-mt.so"
10211         tde_test_library="libDCOP.so"
10212     else
10213         tqt_test_library="libtqt-mt.so*"
10214         tde_test_library="libDCOP.so*"
10215     fi
10217     dnl Check for TQt headers
10218     AC_MSG_CHECKING([for TQt headers])
10219     tqt_incdir="no"
10220     for tde_check in $tqt_incdirs; do
10221         if test -r "$tde_check/$tqt_test_include"; then
10222             tqt_incdir="$tde_check"
10223             break
10224         fi
10225     done
10226     AC_MSG_RESULT([$tqt_incdir])
10227     if test "x$tqt_incdir" = "xno"; then
10228         AC_MSG_ERROR([TQt headers not found.  Please specify the root of
10229 your TQt installation by exporting TQTDIR before running "configure".])
10230     fi
10232     dnl Check for TQt libraries
10233     AC_MSG_CHECKING([for TQt libraries])
10234     tqt_libdir="no"
10235     for tqt_check in $tqt_libdirs; do
10236         if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
10237             tqt_libdir="$tqt_check"
10238             break
10239         fi
10240     done
10241     AC_MSG_RESULT([$tqt_libdir])
10242     if test "x$tqt_libdir" = "xno"; then
10243         AC_MSG_ERROR([TQt libraries not found.  Please specify the root of
10244 your TQt installation by exporting TQTDIR before running "configure".])
10245     fi
10247     dnl Check for Meta Object Compiler
10248     AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
10249     if test "$MOC" = "no"; then
10250         AC_MSG_ERROR([TQt Meta Object Compiler not found.  Please specify
10251 the root of your TQt installation by exporting TQTDIR before running "configure".])
10252     fi
10254     dnl Check for TDE headers
10255     AC_MSG_CHECKING([for TDE headers])
10256     tde_incdir="no"
10257     for tde_check in $tde_incdirs; do
10258         if test -r "$tde_check/$tde_test_include"; then
10259             tde_incdir="$tde_check"
10260             break
10261         fi
10262     done
10263     AC_MSG_RESULT([$tde_incdir])
10264     if test "x$tde_incdir" = "xno"; then
10265         AC_MSG_ERROR([TDE headers not found.  Please specify the root of
10266 your TDE installation by exporting TDEDIR before running "configure".])
10267     fi
10269     dnl Check for TDE libraries
10270     AC_MSG_CHECKING([for TDE libraries])
10271     tde_libdir="no"
10272     for tde_check in $tde_libdirs; do
10273         if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
10274             tde_libdir="$tde_check"
10275             break
10276         fi
10277     done
10278     AC_MSG_RESULT([$tde_libdir])
10279     if test "x$tde_libdir" = "xno"; then
10280         AC_MSG_ERROR([TDE libraries not found.  Please specify the root of
10281 your TDE installation by exporting TDEDIR before running "configure".])
10282     fi
10284     dnl Set the variables
10285     TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10286     TDE_LIBS="-L$tde_libdir -L$tqt_libdir -lkio -ltdeui -ltdecore -ltqt -ltqt-mt"
10288 AC_SUBST(TDE_CFLAGS)
10289 AC_SUBST(TDE_LIBS)
10290 AC_SUBST(MOC)
10292 dnl ===================================================================
10293 dnl Check whether the Qt3 and KDE3 libraries are available.
10294 dnl ===================================================================
10296 KDE_CFLAGS=""
10297 KDE_LIBS=""
10298 if test "$_os" != "OpenBSD"; then
10299     MOC="moc"
10301 if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE"; then
10302     dnl Search paths for Qt3 and KDE3
10303     if test -z "$supports_multilib"; then
10304         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"
10305         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"
10306     else
10307         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"
10308         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"
10309     fi
10310     if test -n "$QTDIR"; then
10311         qt_incdirs="$QTDIR/include $qt_incdirs"
10312         if test -z "$supports_multilib"; then
10313             qt_libdirs="$QTDIR/lib $qt_libdirs"
10314         else
10315             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
10316         fi
10317     fi
10318     if test -z "$supports_multilib"; then
10319         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"
10320         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"
10321     else
10322         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"
10323         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"
10324     fi
10325     if test -n "$KDEDIR"; then
10326         kde_incdirs="$KDEDIR/include $kde_incdirs"
10327         if test -z "$supports_multilib"; then
10328             kde_libdirs="$KDEDIR/lib $kde_libdirs"
10329         else
10330             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
10331         fi
10332     fi
10334     dnl What to test
10335     qt_test_include="qstyle.h"
10336     kde_test_include="kapp.h"
10338     if test "$_os" != "OpenBSD"; then
10339         qt_test_library="libqt-mt.so"
10340         kde_test_library="libDCOP.so"
10341     else
10342         qt_test_library="libqt-mt.so*"
10343         kde_test_library="libDCOP.so*"
10344     fi
10346     dnl Check for Qt3 headers
10347     AC_MSG_CHECKING([for Qt3 headers])
10348     qt_incdir="no"
10349     for kde_check in $qt_incdirs; do
10350         if test -r "$kde_check/$qt_test_include"; then
10351             qt_incdir="$kde_check"
10352             break
10353         fi
10354     done
10355     AC_MSG_RESULT([$qt_incdir])
10356     if test "x$qt_incdir" = "xno"; then
10357         AC_MSG_ERROR([Qt3 headers not found.  Please specify the root of
10358 your Qt3 installation by exporting QTDIR before running "configure".])
10359     fi
10361     dnl Check for Qt3 libraries
10362     AC_MSG_CHECKING([for Qt3 libraries])
10363     qt_libdir="no"
10364     for qt_check in $qt_libdirs; do
10365         if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`"; then
10366             qt_libdir="$qt_check"
10367             break
10368         fi
10369     done
10370     AC_MSG_RESULT([$qt_libdir])
10371     if test "x$qt_libdir" = "xno"; then
10372         AC_MSG_ERROR([Qt3 libraries not found.  Please specify the root of
10373 your Qt3 installation by exporting QTDIR before running "configure".])
10374     fi
10376     dnl Check for Meta Object Compiler
10377     AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
10378     if test "$MOC" = "no"; then
10379         AC_MSG_ERROR([Qt3 Meta Object Compiler not found.  Please specify
10380 the root of your Qt3 installation by exporting QTDIR before running "configure".])
10381     fi
10383     dnl Check for KDE3 headers
10384     AC_MSG_CHECKING([for KDE3 headers])
10385     kde_incdir="no"
10386     for kde_check in $kde_incdirs; do
10387         if test -r "$kde_check/$kde_test_include"; then
10388             kde_incdir="$kde_check"
10389             break
10390         fi
10391     done
10392     AC_MSG_RESULT([$kde_incdir])
10393     if test "x$kde_incdir" = "xno"; then
10394         AC_MSG_ERROR([KDE3 headers not found.  Please specify the root of
10395 your KDE3 installation by exporting KDEDIR before running "configure".])
10396     fi
10398     dnl Check for KDE3 libraries
10399     AC_MSG_CHECKING([for KDE3 libraries])
10400     kde_libdir="no"
10401     for kde_check in $kde_libdirs; do
10402         if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`"; then
10403             kde_libdir="$kde_check"
10404             break
10405         fi
10406     done
10407     AC_MSG_RESULT([$kde_libdir])
10408     if test "x$kde_libdir" = "xno"; then
10409         AC_MSG_ERROR([KDE3 libraries not found.  Please specify the root of
10410 your KDE3 installation by exporting KDEDIR before running "configure".])
10411     fi
10413     dnl Set the variables
10414     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10415     KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
10417 AC_SUBST(KDE_CFLAGS)
10418 AC_SUBST(KDE_LIBS)
10419 AC_SUBST(MOC)
10421 dnl ===================================================================
10422 dnl KDE4 Integration
10423 dnl ===================================================================
10425 KDE4_CFLAGS=""
10426 KDE4_LIBS=""
10427 QMAKE4="qmake"
10428 MOC4="moc"
10429 KDE_GLIB_CFLAGS=""
10430 KDE_GLIB_LIBS=""
10431 KDE_HAVE_GLIB=""
10432 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10433     qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10434     qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10436     kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
10437     kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10439     if test -n "$supports_multilib"; then
10440         qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10441         kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10442     fi
10444     if test -n "$QTDIR"; then
10445         qt_incdirs="$QTDIR/include $qt_incdirs"
10446         if test -z "$supports_multilib"; then
10447             qt_libdirs="$QTDIR/lib $qt_libdirs"
10448         else
10449             qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
10450         fi
10451     fi
10452     if test -n "$QT4DIR"; then
10453         qt_incdirs="$QT4DIR/include $qt_incdirs"
10454         if test -z "$supports_multilib"; then
10455             qt_libdirs="$QT4DIR/lib $qt_libdirs"
10456         else
10457             qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
10458         fi
10459     fi
10461     if test -n "$KDEDIR"; then
10462         kde_incdirs="$KDEDIR/include $kde_incdirs"
10463         if test -z "$supports_multilib"; then
10464             kde_libdirs="$KDEDIR/lib $kde_libdirs"
10465         else
10466             kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
10467         fi
10468     fi
10469     if test -n "$KDE4DIR"; then
10470         kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
10471         if test -z "$supports_multilib"; then
10472             kde_libdirs="$KDE4DIR/lib $kde_libdirs"
10473         else
10474             kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
10475         fi
10476     fi
10478     qt_test_include="Qt/qobject.h"
10479     qt_test_library="libQtCore.so"
10480     kde_test_include="kwindowsystem.h"
10481     kde_test_library="libsolid.so"
10483     AC_MSG_CHECKING([for Qt4 headers])
10484     qt_header_dir="no"
10485     for inc_dir in $qt_incdirs; do
10486         if test -r "$inc_dir/$qt_test_include"; then
10487             qt_header_dir="$inc_dir"
10488             break
10489         fi
10490     done
10492     AC_MSG_RESULT([$qt_header_dir])
10493     if test "x$qt_header_dir" = "xno"; then
10494         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10495     fi
10497     dnl Check for qmake
10498     AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
10499     QMAKE4="$QMAKEQT4"
10500     if test "$QMAKE4" = "no"; then
10501         AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
10502         if test "$QMAKE4" = "no"; then
10503             AC_MSG_ERROR([Qmake not found.  Please specify
10504 the root of your Qt installation by exporting QT4DIR before running "configure".])
10505         fi
10506     fi
10508     qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
10509     AC_MSG_CHECKING([for Qt4 libraries])
10510     qt_lib_dir="no"
10511     for lib_dir in $qt_libdirs; do
10512         if test -r "$lib_dir/$qt_test_library"; then
10513             qt_lib_dir="$lib_dir"
10514             PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
10515             break
10516         fi
10517     done
10519     AC_MSG_RESULT([$qt_lib_dir])
10521     if test "x$qt_lib_dir" = "xno"; then
10522         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
10523     fi
10525     dnl Check for Meta Object Compiler
10527     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10528     MOC4="$MOCQT4"
10529     if test "$MOC4" = "no"; then
10530         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
10531         if test "$MOC4" = "no"; then
10532             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
10533 the root of your Qt installation by exporting QT4DIR before running "configure".])
10534         fi
10535     fi
10537     dnl Check for KDE4 headers
10538     AC_MSG_CHECKING([for KDE4 headers])
10539     kde_incdir="no"
10540     for kde_check in $kde_incdirs; do
10541         if test -r "$kde_check/$kde_test_include"; then
10542             kde_incdir="$kde_check"
10543             break
10544         fi
10545     done
10546     AC_MSG_RESULT([$kde_incdir])
10547     if test "x$kde_incdir" = "xno"; then
10548         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10549     fi
10551     dnl Check for KDE4 libraries
10552     AC_MSG_CHECKING([for KDE4 libraries])
10553     kde_libdir="no"
10554     for kde_check in $kde_libdirs; do
10555         if test -r "$kde_check/$kde_test_library"; then
10556             kde_libdir="$kde_check"
10557             break
10558         fi
10559     done
10561     AC_MSG_RESULT([$kde_libdir])
10562     if test "x$kde_libdir" = "xno"; then
10563         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
10564     fi
10566     KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
10567     KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkio -lkfile -lkdeui -lkdecore -lQtCore -lQtGui"
10569     AC_LANG_PUSH([C++])
10570     save_CXXFLAGS=$CXXFLAGS
10571     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
10572     AC_MSG_CHECKING([whether KDE is >= 4.2])
10573        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10574 #include <kdeversion.h>
10576 int main(int argc, char **argv) {
10577        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
10578        else return 1;
10580        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
10581     CXXFLAGS=$save_CXXFLAGS
10582     AC_LANG_POP([C++])
10584    # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
10585     PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
10586         [KDE_HAVE_GLIB=1],
10587         AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
10589 AC_SUBST(KDE4_CFLAGS)
10590 AC_SUBST(KDE4_LIBS)
10591 AC_SUBST(MOC4)
10592 AC_SUBST(KDE_GLIB_CFLAGS)
10593 AC_SUBST(KDE_GLIB_LIBS)
10594 AC_SUBST(KDE_HAVE_GLIB)
10596 dnl ===================================================================
10597 dnl Test for the enabling the lockdown pieces
10598 dnl ===================================================================
10599 AC_MSG_CHECKING([whether to enable the lockdown pieces])
10600 ENABLE_LOCKDOWN=""
10601 if test -n "$enable_lockdown" -a "$enable_lockdown" != "no"; then
10602     ENABLE_LOCKDOWN=YES
10603     AC_MSG_RESULT([yes])
10604 else
10605     AC_MSG_RESULT([no])
10607 AC_SUBST(ENABLE_LOCKDOWN)
10609 dnl ===================================================================
10610 dnl Test whether to include Evolution 2 support
10611 dnl ===================================================================
10612 AC_MSG_CHECKING([whether to enable evolution 2 support])
10613 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
10614     AC_MSG_RESULT([yes])
10615     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
10616     ENABLE_EVOAB2="TRUE"
10617 else
10618     ENABLE_EVOAB2=""
10619     AC_MSG_RESULT([no])
10621 AC_SUBST(ENABLE_EVOAB2)
10622 AC_SUBST(GOBJECT_CFLAGS)
10623 AC_SUBST(GOBJECT_LIBS)
10625 dnl ===================================================================
10626 dnl Test whether to include TDE AB support
10627 dnl ===================================================================
10628 AC_MSG_CHECKING([whether to enable TDE address book support])
10629 if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
10630     AC_MSG_RESULT([yes])
10631     AC_LANG_PUSH([C++])
10632     save_CXXFLAGS=$CXXFLAGS
10633     CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
10634     AC_MSG_CHECKING([whether TDE is at least R14.0])
10635        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10636 #include <tdeversion.h>
10638 int main(int argc, char **argv) {
10639        if (TDE_VERSION_MAJOR >= 14) return 0;
10640        else return 1;
10642        ]])],[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])],[])
10643     CXXFLAGS=$save_CXXFLAGS
10644     AC_LANG_POP([C++])
10645     ENABLE_TDEAB=TRUE
10646 else
10647     AC_MSG_RESULT([no])
10648     ENABLE_TDEAB=
10650 AC_SUBST(ENABLE_TDEAB)
10652 dnl ===================================================================
10653 dnl Test whether to include KDE AB support
10654 dnl ===================================================================
10655 AC_MSG_CHECKING([whether to enable KDE address book support])
10656 if test "$enable_kdeab" = "yes" -a "$enable_kde" = "yes"; then
10657     AC_MSG_RESULT([yes])
10658     AC_LANG_PUSH([C++])
10659     save_CXXFLAGS=$CXXFLAGS
10660     CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
10661     AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
10662        AC_RUN_IFELSE([AC_LANG_SOURCE([[
10663 #include <kdeversion.h>
10665 int main(int argc, char **argv) {
10666        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
10667        else return 1;
10669        ]])],[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])],[])
10670     CXXFLAGS=$save_CXXFLAGS
10671     AC_LANG_POP([C++])
10672     ENABLE_KAB=TRUE
10673 else
10674     AC_MSG_RESULT([no])
10675     ENABLE_KAB=
10677 AC_SUBST(ENABLE_KAB)
10679 dnl ===================================================================
10680 dnl Test whether to include MathMLDTD
10681 dnl ===================================================================
10682 AC_MSG_CHECKING([whether to include MathMLDTD])
10683 if test -n "$enable_mathmldtd"; then
10684     if test "$enable_mathmldtd" = "no"; then
10685         AC_MSG_RESULT([no])
10686         SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10687     else
10688         AC_MSG_RESULT([yes])
10689         BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
10690     fi
10691 else
10692     AC_MSG_RESULT([no])
10693     SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
10696 dnl ===================================================================
10697 dnl Test which themes to include
10698 dnl ===================================================================
10699 AC_MSG_CHECKING([which themes to include])
10700 # if none given use default subset of available themes
10701 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
10702     with_theme="crystal default hicontrast oxygen tango"
10703     test "$ENABLE_RELEASE_BUILD" = "FALSE" && with_theme="$with_theme tango_testing"
10706 WITH_THEMES=""
10707 for theme in $with_theme; do
10708     case $theme in
10709         crystal|default|galaxy|hicontrast|human|industrial|oxygen|tango|tango_testing) : ;;
10710         *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
10711     esac
10712     WITH_THEMES="$WITH_THEMES $theme"
10713     SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
10714 done
10715 AC_MSG_RESULT([$WITH_THEMES])
10716 AC_SUBST([WITH_THEMES])
10718 dnl ===================================================================
10719 dnl Test whether to integrate helppacks into the product's installer
10720 dnl ===================================================================
10721 AC_MSG_CHECKING([for helppack integration])
10722 if test "$with_helppack_integration" = "no"; then
10723     WITH_HELPPACK_INTEGRATION=NO
10724     AC_MSG_RESULT([no integration])
10725 else
10726     WITH_HELPPACK_INTEGRATION=YES
10727     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
10728     AC_MSG_RESULT([integration])
10730 AC_SUBST(WITH_HELPPACK_INTEGRATION)
10732 dnl ===================================================================
10733 dnl Test whether to use CoreText framework
10734 dnl ===================================================================
10735 ENABLE_CORETEXT=NO
10736 if test "$_os" = "Darwin"; then
10737     AC_MSG_CHECKING([whether to use CoreText framework])
10738     if test "$enable_coretext" = yes -o "$BITNESS_OVERRIDE" = 64; then
10739         AC_MSG_RESULT([yes])
10740         ENABLE_CORETEXT=YES
10741     else
10742         AC_MSG_RESULT([no])
10743     fi
10745 AC_SUBST(ENABLE_CORETEXT)
10747 ###############################################################################
10748 # Extensions checking
10749 ###############################################################################
10750 dnl ===================================================================
10751 dnl Test whether to integrate extensions into the product's installer
10752 dnl ===================================================================
10753 AC_MSG_CHECKING([for extensions integration])
10754 if test "x$enable_extension_integration" != "xno"; then
10755     WITH_EXTENSION_INTEGRATION=YES
10756     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
10757     AC_MSG_RESULT([yes, use integration])
10758 else
10759     WITH_EXTENSION_INTEGRATION=NO
10760     AC_MSG_RESULT([no, do not integrate])
10762 AC_SUBST(WITH_EXTENSION_INTEGRATION)
10764 dnl Should any extra extensions be included?
10765 dnl There are standalone tests for each of these below.
10766 WITH_EXTRA_EXTENSIONS=
10767 AC_SUBST([WITH_EXTRA_EXTENSIONS])
10769 dnl ===================================================================
10770 dnl Test whether to include Watch Window extension
10771 dnl ===================================================================
10772 AC_MSG_CHECKING([for Watch Window extension integration])
10773 WATCH_WINDOW_EXTENSION_PACK=
10774 if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10775     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
10776     WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
10777     WITH_EXTRA_EXTENSIONS=YES
10778     AC_MSG_RESULT([yes])
10779 else
10780     AC_MSG_RESULT([no])
10782 AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
10784 dnl ===================================================================
10785 dnl Test whether to include SmART Gallery (Diagram) extension
10786 dnl ===================================================================
10787 AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
10788 DIAGRAM_EXTENSION_PACK=
10789 if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10790     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
10791     DIAGRAM_EXTENSION_PACK="8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt"
10792     WITH_EXTRA_EXTENSIONS=YES
10793     AC_MSG_RESULT([yes])
10794 else
10795     AC_MSG_RESULT([no])
10797 AC_SUBST(DIAGRAM_EXTENSION_PACK)
10799 dnl ===================================================================
10800 dnl Test whether to include Validator extension
10801 dnl ===================================================================
10802 AC_MSG_CHECKING([for Validator extension integration])
10803 VALIDATOR_EXTENSION_PACK=
10804 if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10805     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
10806     VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
10807     WITH_EXTRA_EXTENSIONS=YES
10808     AC_MSG_RESULT([yes])
10809 else
10810     AC_MSG_RESULT([no])
10812 AC_SUBST(VALIDATOR_EXTENSION_PACK)
10814 dnl ===================================================================
10815 dnl Test whether to include Barcode extension
10816 dnl ===================================================================
10817 AC_MSG_CHECKING([for Barcode extension integration])
10818 BARCODE_EXTENSION_PACK=
10819 if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10820     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
10821     BARCODE_EXTENSION_PACK="3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt"
10822     WITH_EXTRA_EXTENSIONS=YES
10823     AC_MSG_RESULT([yes])
10824 else
10825     AC_MSG_RESULT([no])
10827 AC_SUBST([BARCODE_EXTENSION_PACK])
10829 dnl ===================================================================
10830 dnl Test whether to include ConvertTextToNumber extension
10831 dnl ===================================================================
10832 AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
10833 if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10834     BUILD_TYPE="$BUILD_TYPE CT2N"
10835     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
10836     AC_MSG_RESULT([yes])
10837 else
10838     AC_MSG_RESULT([no])
10841 dnl ===================================================================
10842 dnl Test whether to include Numbertext extension
10843 dnl ===================================================================
10844 AC_MSG_CHECKING([for Numbertext extension integration])
10845 NUMBERTEXT_EXTENSION_PACK=
10846 if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10847     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
10848     NUMBERTEXT_EXTENSION_PACK="b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt"
10849     WITH_EXTRA_EXTENSIONS=YES
10850     AC_MSG_RESULT([yes])
10851 else
10852     AC_MSG_RESULT([no])
10854 AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
10856 dnl ===================================================================
10857 dnl Test whether to include Hungarian Cross-reference Toolbar extension
10858 dnl ===================================================================
10859 AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
10860 HUNART_EXTENSION_PACK=
10861 if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10862     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
10863     HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
10864     WITH_EXTRA_EXTENSIONS=YES
10865     AC_MSG_RESULT([yes])
10866 else
10867     AC_MSG_RESULT([no])
10869 AC_SUBST(HUNART_EXTENSION_PACK)
10871 dnl ===================================================================
10872 dnl Test whether to include Typography Toolbar extension
10873 dnl ===================================================================
10874 AC_MSG_CHECKING([for Typography Toolbar extension integration])
10875 TYPO_EXTENSION_PACK=
10876 if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10877     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
10878     TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
10879     WITH_EXTRA_EXTENSIONS=YES
10880     AC_MSG_RESULT([yes])
10881 else
10882     AC_MSG_RESULT([no])
10884 AC_SUBST(TYPO_EXTENSION_PACK)
10886 dnl ===================================================================
10887 dnl Test whether to include Google Docs extension
10888 dnl ===================================================================
10889 AC_MSG_CHECKING([for Google Docs extension integration])
10890 GOOGLE_DOCS_EXTENSION_PACK=
10891 if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
10892     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
10893     GOOGLE_DOCS_EXTENSION_PACK="27211596cf0ad97cab7321239406fde0-gdocs_3.0.1_modified.oxt"
10894     WITH_EXTRA_EXTENSIONS=YES
10895     AC_MSG_RESULT([yes])
10896 else
10897     AC_MSG_RESULT([no])
10899 AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
10901 dnl ===================================================================
10902 dnl Test whether to include NLPSolver extension
10903 dnl ===================================================================
10904 AC_MSG_CHECKING([for NLPSolver extension integration])
10905 if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10906     BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
10907     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
10908     AC_MSG_RESULT([yes])
10909 else
10910     AC_MSG_RESULT([no])
10913 dnl ===================================================================
10914 dnl Test whether to include LanguageTool extension
10915 dnl ===================================================================
10916 AC_MSG_CHECKING([for LanguageTool extension integration])
10917 if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
10918     BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
10919     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
10920     AC_MSG_RESULT([yes])
10921 else
10922     AC_MSG_RESULT([no])
10925 dnl ===================================================================
10926 dnl Test whether to include Sun Professional Template Pack
10927 dnl ===================================================================
10928 AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
10929 if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
10930     AC_MSG_RESULT([no integration])
10931 else
10932     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
10933     sun_supported_langs="en-US de it fr es hu"
10934     if test "$with_sun_templates" = "yes"; then
10935         wanted_sun_templates="$sun_supported_langs"
10936     else
10937         # check whether the langs are supported by Sun
10938         wanted_sun_templates=
10939         for lang in $with_sun_templates; do
10940             if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
10941                 wanted_sun_templates="$wanted_sun_templates $lang"
10942             fi
10943         done
10944     fi
10945     SUNTEMPLATES_LANG=
10946     SUNTEMPLATES_DE_PACK=
10947     SUNTEMPLATES_EN_US_PACK=
10948     SUNTEMPLATES_ES_PACK=
10949     SUNTEMPLATES_FR_PACK=
10950     SUNTEMPLATES_HU_PACK=
10951     SUNTEMPLATES_IT_PACK=
10952     # check whether the langs are requested at all
10953     for lang in $wanted_sun_templates; do
10954     if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
10955         SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
10956         case $lang in
10957         "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
10958         "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
10959         "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
10960         "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
10961         "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
10962         "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
10963         esac
10964     fi
10965     done
10966     WITH_EXTRA_EXTENSIONS=YES
10967     AC_MSG_RESULT([$SUNTEMPLATES_LANG])
10969 AC_SUBST(SUNTEMPLATES_DE_PACK)
10970 AC_SUBST(SUNTEMPLATES_EN_US_PACK)
10971 AC_SUBST(SUNTEMPLATES_ES_PACK)
10972 AC_SUBST(SUNTEMPLATES_FR_PACK)
10973 AC_SUBST(SUNTEMPLATES_HU_PACK)
10974 AC_SUBST(SUNTEMPLATES_IT_PACK)
10976 dnl ===================================================================
10977 dnl Test whether to include fonts
10978 dnl ===================================================================
10979 AC_MSG_CHECKING([whether to include third-party fonts])
10980 if test "$with_fonts" != "no"; then
10981     AC_MSG_RESULT([yes])
10982     WITH_FONTS=YES
10983     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
10984 else
10985     AC_MSG_RESULT([no])
10986     WITH_FONTS=NO
10987     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
10989 AC_SUBST(WITH_FONTS)
10992 # The agfa monotype fonts options seems broken
10993 # there is no assocaited entry in Makefile.fetch
10994 # so we do not fetch the dependencies
10995 # there is no tie-up with MORE_FONTS, but in dmake mode
10996 # without more_fonts that option is meaningless
10997 # so I suspect it is not really used anymore, commenting out for now
10998 #AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
10999 #if test "$with_agfa_monotype_fonts" = "yes"; then
11000 #    AC_MSG_RESULT([yes])
11001 #    WITH_AGFA_MONOTYPE_FONTS=YES
11002 #    SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
11003 #    BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
11004 #else
11005 #    AC_MSG_RESULT([no])
11006 #    WITH_AGFA_MONOTYPE_FONTS=NO
11008 #AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
11010 dnl ===================================================================
11011 dnl Test whether to include ppds
11012 dnl ===================================================================
11013 AC_MSG_CHECKING([whether to include PPDs])
11014 if test "$with_ppds" != "no"; then
11015     AC_MSG_RESULT([yes])
11016 else
11017     AC_MSG_RESULT([no])
11018     WITHOUT_PPDS=YES
11019     SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
11021 AC_SUBST(WITHOUT_PPDS)
11023 dnl ===================================================================
11024 dnl Test whether to include afms
11025 dnl ===================================================================
11026 AC_MSG_CHECKING([whether to include AFMs])
11027 if test "$with_afms" != "no"; then
11028     AC_MSG_RESULT([yes])
11029     BUILD_TYPE="$BUILD_TYPE AFMS"
11030 else
11031     AC_MSG_RESULT([no])
11032     WITHOUT_AFMS=YES
11033     SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
11035 AC_SUBST(WITHOUT_AFMS)
11037 dnl ===================================================================
11038 dnl Test whether to include extra galleries
11039 dnl ===================================================================
11040 AC_MSG_CHECKING([whether to include extra galleries])
11041 if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
11042     AC_MSG_RESULT([no])
11043     WITH_EXTRA_GALLERY=NO
11044     OOOP_GALLERY_PACK=""
11045 else
11046     AC_MSG_RESULT([yes])
11047     WITH_EXTRA_GALLERY=YES
11048     BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
11049     SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
11050     OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
11052 AC_SUBST(WITH_EXTRA_GALLERY)
11053 AC_SUBST(OOOP_GALLERY_PACK)
11055 dnl ===================================================================
11056 dnl Test whether to include extra templates
11057 dnl ===================================================================
11058 AC_MSG_CHECKING([whether to include extra templates])
11059 if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
11060     AC_MSG_RESULT([no])
11061     WITH_EXTRA_TEMPLATE=NO
11062     OOOP_TEMPLATES_PACK=""
11063 else
11064     AC_MSG_RESULT([yes])
11065     WITH_EXTRA_TEMPLATE=YES
11066     BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
11067     SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
11068     OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
11070 AC_SUBST(WITH_EXTRA_TEMPLATE)
11071 AC_SUBST(OOOP_TEMPLATES_PACK)
11073 dnl ===================================================================
11074 dnl Test whether to include extra samples
11075 dnl ===================================================================
11076 AC_MSG_CHECKING([whether to include extra samples])
11077 if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
11078     AC_MSG_RESULT([no])
11079     WITH_EXTRA_SAMPLE=NO
11080     OOOP_SAMPLES_PACK=""
11081 else
11082     AC_MSG_RESULT([yes])
11083     WITH_EXTRA_SAMPLE=YES
11084     BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
11085     SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
11086     OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
11088 AC_SUBST(WITH_EXTRA_SAMPLE)
11089 AC_SUBST(OOOP_SAMPLES_PACK)
11091 dnl ===================================================================
11092 dnl Test whether to include extra fonts
11093 dnl ===================================================================
11094 AC_MSG_CHECKING([whether to include extra fonts])
11095 if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
11096     AC_MSG_RESULT([no])
11097     WITH_EXTRA_FONT=NO
11098     OOOP_FONTS_PACK=""
11099 else
11100     AC_MSG_RESULT([yes])
11101     WITH_EXTRA_FONT=YES
11102     BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
11103     SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
11104     OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
11106 AC_SUBST(WITH_EXTRA_FONT)
11107 AC_SUBST(OOOP_FONTS_PACK)
11109 dnl ===================================================================
11110 dnl Test whether to enable online update service
11111 dnl ===================================================================
11112 AC_MSG_CHECKING([whether to enable online update])
11113 ENABLE_ONLINE_UPDATE=
11114 if test "$enable_online_update" = ""; then
11115     if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11116         AC_MSG_RESULT([yes])
11117         ENABLE_ONLINE_UPDATE="TRUE"
11118     else
11119         AC_MSG_RESULT([no])
11120     fi
11121 else
11122     if test "$enable_online_update" = "yes"; then
11123         AC_MSG_RESULT([yes])
11124         ENABLE_ONLINE_UPDATE="TRUE"
11125     else
11126         AC_MSG_RESULT([no])
11127     fi
11129 AC_SUBST(ENABLE_ONLINE_UPDATE)
11131 dnl ===================================================================
11132 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11133 dnl ===================================================================
11134 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11135 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11136     AC_MSG_RESULT([no])
11137     ENABLE_SILENT_MSI="FALSE"
11138 else
11139     AC_MSG_RESULT([yes])
11140     ENABLE_SILENT_MSI="TRUE"
11141     SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11143 AC_SUBST(ENABLE_SILENT_MSI)
11145 AC_MSG_CHECKING([whether and how to use Xinerama])
11146 if test "$_os" = "Darwin"; then
11147     USE_XINERAMA=YES
11148     XINERAMA_LINK=dynamic
11149     AC_MSG_RESULT([yes])
11150 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11151     if test "$x_libraries" = "default_x_libraries"; then
11152         XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11153         if test "x$XINERAMALIB" = x; then
11154            XINERAMALIB="/usr/lib"
11155         fi
11156     else
11157         XINERAMALIB="$x_libraries"
11158     fi
11159     if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11160         # we have both versions, let the user decide but use the dynamic one
11161         # per default
11162         USE_XINERAMA=YES
11163         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11164             XINERAMA_LINK=dynamic
11165         else
11166             XINERAMA_LINK=static
11167         fi
11168     elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11169         # we have only the dynamic version
11170         USE_XINERAMA=YES
11171         XINERAMA_LINK=dynamic
11172     elif test -e "$XINERAMALIB/libXinerama.a"; then
11173         # static version
11174         if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11175             USE_XINERAMA=YES
11176             XINERAMA_LINK=static
11177         else
11178             USE_XINERAMA=NO
11179             XINERAMA_LINK=none
11180         fi
11181     else
11182         # no Xinerama
11183         USE_XINERAMA=NO
11184         XINERAMA_LINK=none
11185     fi
11186     if test "$USE_XINERAMA" = "YES"; then
11187         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11188         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11189             [AC_MSG_ERROR(Xinerama header not found.)], [])
11190         XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11191         if test "x$XEXTLIB" = x; then
11192            XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11193         fi
11194         XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11195         if test "$_os" = "FreeBSD"; then
11196             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11197         fi
11198         if test "$_os" = "Linux"; then
11199             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11200         fi
11201         AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11202             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11203     else
11204         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11205     fi
11206 else
11207     USE_XINERAMA=NO
11208     XINERAMA_LINK=none
11209     AC_MSG_RESULT([no])
11211 AC_SUBST(USE_XINERAMA)
11212 AC_SUBST(XINERAMA_LINK)
11214 dnl ===================================================================
11215 dnl Test whether to build cairo or rely on the system version
11216 dnl ===================================================================
11218 if test "$GUIBASE" = "unx"; then
11219     # Used in vcl/Library_vclplug_gen.mk
11220     test_cairo=yes
11223 if test "$test_cairo" = "yes"; then
11224     AC_MSG_CHECKING([whether to use the system cairo])
11226     if test "$with_system_cairo" = "yes"; then
11227         SYSTEM_CAIRO=YES
11228         AC_MSG_RESULT([yes])
11230         PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
11232         if test "$test_xrender" = "yes"; then
11233             if test "$with_system_xextensions_headers" != "no"; then
11234                 AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11235                 AC_LANG_PUSH([C])
11236                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11237 #ifdef PictStandardA8
11238 #else
11239       return fail;
11240 #endif
11241 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11243                 AC_LANG_POP([C])
11244             fi
11245         fi
11246         libo_MINGW_CHECK_DLL([CAIRO], [libcairo])
11247         libo_MINGW_TRY_DLL([FONTCONFIG], [libfontconfig])
11248         libo_MINGW_TRY_DLL([FREETYPE], [libfreetype])
11249         libo_MINGW_TRY_DLL([PIXMAN], [libpixman])
11250         libo_MINGW_TRY_DLL([PNG15], [libpng15])
11251     else
11252         SYSTEM_CAIRO=NO
11253         AC_MSG_RESULT([no])
11255         BUILD_TYPE="$BUILD_TYPE CAIRO"
11256         SCPDEFS="$SCPDEFS -DNEED_CAIRO"
11257     fi
11260 AC_SUBST(SYSTEM_CAIRO)
11261 AC_SUBST(CAIRO_CFLAGS)
11262 AC_SUBST(CAIRO_LIBS)
11263 AC_SUBST([MINGW_CAIRO_DLL])
11264 AC_SUBST([MINGW_FONTCONFIG_DLL])
11265 AC_SUBST([MINGW_FREETYPE_DLL])
11266 AC_SUBST([MINGW_PIXMAN_DLL])
11267 AC_SUBST([MINGW_PNG15_DLL])
11269 dnl ===================================================================
11270 dnl Test whether to use liblangtag
11271 dnl ===================================================================
11272 ENABLE_LIBLANGTAG=
11273 SYSTEM_LIBLANGTAG=
11274 AC_MSG_CHECKING([whether to use liblangtag])
11275 if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a $_os != Android -a $_os != iOS \); then
11276     ENABLE_LIBLANGTAG=YES
11277     AC_MSG_RESULT([yes])
11278     AC_MSG_CHECKING([whether to use system liblangtag])
11279     if test "$with_system_liblangtag" = yes; then
11280         SYSTEM_LIBLANGTAG=YES
11281         AC_MSG_RESULT([yes])
11282         PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11283         libo_MINGW_CHECK_DLL([LIBLANGTAG], [liblangtag])
11284     else
11285         SYSTEM_LIBLANGTAG=NO
11286         AC_MSG_RESULT([no])
11287         BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11288     fi
11289 else
11290     ENABLE_LIBLANGTAG=NO
11291     AC_MSG_RESULT([no])
11293 AC_SUBST(ENABLE_LIBLANGTAG)
11294 AC_SUBST(SYSTEM_LIBLANGTAG)
11295 AC_SUBST(LIBLANGTAG_CFLAGS)
11296 AC_SUBST(LIBLANGTAG_LIBS)
11297 AC_SUBST([MINGW_LIBLANGTAG_DLL])
11299 dnl ===================================================================
11300 dnl Test whether to build libpng or rely on the system version
11301 dnl ===================================================================
11303 AC_MSG_CHECKING([whether to use the system libpng])
11305 dnl How should and does this interact with the checks for libpng
11306 dnl related to use of libpng in the quickstarter above? This needs to
11307 dnl be unified.
11309 if test "$with_system_libpng" = "auto"; then
11310     case "$_os" in
11311     WINNT|Darwin|iOS|Android)
11312         with_system_libpng="$with_system_libs"
11313         ;;
11314     *)
11315         with_system_libpng=yes
11316         ;;
11317     esac
11320 if test "$with_system_libpng" = yes; then
11321     SYSTEM_LIBPNG=YES
11322     AC_MSG_RESULT([yes])
11323 else
11324     SYSTEM_LIBPNG=NO
11325     BUILD_TYPE="$BUILD_TYPE LIBPNG"
11326     AC_MSG_RESULT([no])
11328 AC_SUBST(SYSTEM_LIBPNG)
11330 dnl ===================================================================
11331 dnl Check for runtime JVM search path
11332 dnl ===================================================================
11333 if test "$SOLAR_JAVA" != ""; then
11334     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11335     if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11336         AC_MSG_RESULT([yes])
11337         if ! test -d "$with_jvm_path"; then
11338             AC_MSG_ERROR(["$with_jvm_path" not a directory])
11339         fi
11340         if ! test -d "$with_jvm_path"jvm; then
11341             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11342         fi
11343         JVM_ONE_PATH_CHECK="$with_jvm_path"
11344         AC_SUBST(JVM_ONE_PATH_CHECK)
11345     else
11346         AC_MSG_RESULT([no])
11347     fi
11350 dnl ===================================================================
11351 dnl Test for the presence of Ant and that it works
11352 dnl ===================================================================
11354 if test "$SOLAR_JAVA" != ""; then
11355     ANT_HOME=; export ANT_HOME
11356     WITH_ANT_HOME=; export WITH_ANT_HOME
11357     if test -z "$with_ant_home"; then
11358         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11359     else
11360         if test "$_os" = "WINNT"; then
11361             with_ant_home=`cygpath -u "$with_ant_home"`
11362         fi
11363         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11364         WITH_ANT_HOME=$with_ant_home
11365         ANT_HOME=$with_ant_home
11366     fi
11368     if test -z "$ANT"; then
11369         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11370     else
11371         # resolve relative or absolute symlink
11372         while test -h "$ANT"; do
11373             a_cwd=`pwd`
11374             a_basename=`basename "$ANT"`
11375             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11376             cd "`dirname "$ANT"`"
11377             cd "`dirname "$a_script"`"
11378             ANT="`pwd`"/"`basename "$a_script"`"
11379             cd "$a_cwd"
11380         done
11382         AC_MSG_CHECKING([if $ANT works])
11383         cat > conftest.java << EOF
11384         public class conftest {
11385             int testmethod(int a, int b) {
11386                     return a + b;
11387             }
11388         }
11391         cat > conftest.xml << EOF
11392         <project name="conftest" default="conftest">
11393         <target name="conftest">
11394             <javac srcdir="." includes="conftest.java">
11395             </javac>
11396         </target>
11397         </project>
11400         oldJAVA_HOME=$JAVA_HOME
11401         if test "$JAVACISGCJ" = "yes"; then
11402             JAVA_HOME=; export JAVA_HOME
11403             ant_gcj="-Dbuild.compiler=gcj"
11404         fi
11405         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11406         if test $? = 0 -a -f ./conftest.class; then
11407             AC_MSG_RESULT([Ant works])
11408             if test -z "$WITH_ANT_HOME"; then
11409                 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11410                 if test -z "$ANT_HOME"; then
11411                     ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11412                 fi
11413             else
11414                 ANT_HOME="$WITH_ANT_HOME"
11415             fi
11416         else
11417             echo "configure: Ant test failed" >&5
11418             cat conftest.java >&5
11419             cat conftest.xml >&5
11420             AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
11421             ANT_HOME=""
11422             add_warning "Ant does not work - Some Java projects will not build!"
11423         fi
11424         JAVA_HOME=$oldJAVA_HOME
11425         rm -f conftest* core core.* *.core
11426     fi
11427     if test -z "$ANT_HOME"; then
11428         ANT_HOME="NO_ANT_HOME"
11429     else
11430         PathFormat "$ANT_HOME"
11431         ANT_HOME="$formatted_path"
11432         PathFormat "$ANT"
11433         ANT="$ANT"
11434     fi
11435     AC_SUBST(ANT_HOME)
11436     AC_SUBST(ANT)
11438     dnl Checking for ant.jar
11439     if test "$ANT_HOME" != "NO_ANT_HOME"; then
11440         AC_MSG_CHECKING([Ant lib directory])
11441         if test -f $ANT_HOME/lib/ant.jar; then
11442             ANT_LIB="$ANT_HOME/lib"
11443         else
11444             if test -f $ANT_HOME/ant.jar; then
11445                 ANT_LIB="$ANT_HOME"
11446             else
11447                 if test -f /usr/share/java/ant.jar; then
11448                     ANT_LIB=/usr/share/java
11449                 else
11450                     if test -f /usr/share/ant-core/lib/ant.jar; then
11451                         ANT_LIB=/usr/share/ant-core/lib
11452                     else
11453                         if test -f $ANT_HOME/lib/ant/ant.jar; then
11454                             ANT_LIB="$ANT_HOME/lib/ant"
11455                         else
11456                             if test -f /usr/share/lib/ant/ant.jar; then
11457                                 ANT_LIB=/usr/share/lib/ant
11458                             else
11459                                 AC_MSG_ERROR([Ant libraries not found!])
11460                             fi
11461                         fi
11462                     fi
11463                 fi
11464             fi
11465         fi
11466         PathFormat "$ANT_LIB"
11467         ANT_LIB="$formatted_path"
11468         AC_MSG_RESULT([Ant lib directory found.])
11469     fi
11470     AC_SUBST(ANT_LIB)
11472     ant_minver=1.6.0
11473     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11475     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11476     ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11477     ant_version_major=`echo $ant_version | cut -d. -f1`
11478     ant_version_minor=`echo $ant_version | cut -d. -f2`
11479     echo "configure: ant_version $ant_version " >&5
11480     echo "configure: ant_version_major $ant_version_major " >&5
11481     echo "configure: ant_version_minor $ant_version_minor " >&5
11482     if test "$ant_version_major" -ge "2"; then
11483         AC_MSG_RESULT([yes, $ant_version])
11484     elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11485         AC_MSG_RESULT([yes, $ant_version])
11486     else
11487         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11488     fi
11490     if test "$ENABLE_MEDIAWIKI" = "YES"; then
11491         AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
11492         rm -rf confdir
11493         mkdir confdir
11494         cat > conftest.java << EOF
11495             public class conftest {
11496                 int testmethod(int a, int b) {
11497                     return a + b;
11498                 }
11499             }
11502         cat > conftest.xml << EOF
11503             <project name="conftest" default="conftest">
11504             <target name="conftest" depends="copytest">
11505                 <javac srcdir="." includes="conftest.java">
11506                 </javac>
11507             </target>
11508             <target name="copytest">
11509                  <copy todir="confdir">
11510                  <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
11511                  <filterset/>
11512                  <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
11513                  </copy>
11514             </target>
11515             </project>
11518         if test "$JAVACISGCJ" = "yes"; then
11519             JAVA_HOME=; export JAVA_HOME
11520             ant_gcj="-Dbuild.compiler=gcj"
11521         fi
11522         AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
11523         if test $? = 0 -a -f ./conftest.class; then
11524             AC_MSG_RESULT([yes])
11525             rm -rf confdir
11526         else
11527             echo "configure: Ant test failed" >&5
11528             cat conftest.java >&5
11529             cat conftest.xml >&5
11530             rm -rf confdir
11531             AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
11532         fi
11533     fi
11534     rm -f conftest* core core.* *.core
11537 OOO_JUNIT_JAR=
11538 if test "$SOLAR_JAVA" != "" -a "$with_junit" != "no"; then
11539     AC_MSG_CHECKING([for JUnit 4])
11540     if test "$with_junit" = "yes"; then
11541         if test -e /usr/share/java/junit4.jar; then
11542             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11543         else
11544            if test -e /usr/share/lib/java/junit.jar; then
11545               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11546            else
11547               OOO_JUNIT_JAR=/usr/share/java/junit.jar
11548            fi
11549         fi
11550     else
11551         OOO_JUNIT_JAR=$with_junit
11552     fi
11553     if test "$_os" = "WINNT"; then
11554         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11555     fi
11556     "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
11557         grep org/junit/Before.class > /dev/null 2>&5
11558     if test $? -eq 0; then
11559         # check if either class-path entry is available for hamcrest or
11560         # it's bundled
11561         if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
11562             "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
11563             AC_MSG_RESULT([$OOO_JUNIT_JAR])
11564         else
11565             AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
11566 provide a full junit jar or use --without-junit])
11567         fi
11568     else
11569         AC_MSG_RESULT([no])
11570         AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
11571 location (/usr/share/java), specify its pathname via
11572 --with-junit=..., or disable it via --without-junit])
11573     fi
11574     if test $OOO_JUNIT_JAR != ""; then
11575     BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11576     fi
11578 AC_SUBST(OOO_JUNIT_JAR)
11580 if test "$enable_odk" = no; then
11581     unset DOXYGEN
11582 else
11583     if test "$with_doxygen" = no; then
11584         AC_MSG_CHECKING([for doxygen])
11585         unset DOXYGEN
11586         AC_MSG_RESULT([no])
11587     else
11588         if test "$with_doxygen" = yes; then
11589             AC_PATH_PROG([DOXYGEN], [doxygen])
11590             if test -z "$DOXYGEN"; then
11591                 AC_MSG_RESULT([no])
11592                 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
11593             fi
11594         else
11595             AC_MSG_CHECKING([for doxygen])
11596             DOXYGEN=$with_doxygen
11597             AC_MSG_RESULT([$DOXYGEN])
11598         fi
11599     fi
11601 AC_SUBST([DOXYGEN])
11603 AC_SUBST(SCPDEFS)
11606 # check for wget and md5sum
11608 WGET=
11609 MD5SUM=
11610 CURL=
11612 if test "$enable_fetch_external" != "no"; then
11614 CURL=`which curl 2>/dev/null`
11616 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
11617     eval "$i --version" > /dev/null 2>&1
11618     ret=$?
11619     if test $ret -eq 0; then
11620         WGET=$i
11621         break
11622     fi
11623 done
11625 if test -z "$WGET" -a -z "$CURL"; then
11626     AC_MSG_ERROR([neither wget nor curl found!])
11629 for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
11630     if test "$i" = "md5"; then
11631         eval "$i -x" > /dev/null 2>&1
11632     else
11633         eval "$i --version" > /dev/null 2>&1
11634     fi
11635     ret=$?
11636     if test $ret -eq 0; then
11637         MD5SUM=$i
11638         break
11639     fi
11640 done
11642 if test "$MD5SUM" = "md5"; then
11643     if md5 -r < /dev/null > /dev/null 2>/dev/null; then
11644         MD5SUM="$MD5SUM -r"
11645     elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
11646         MD5SUM="$MD5SUM -n"
11647     fi
11650 if test -z "$MD5SUM"; then
11651     AC_MSG_WARN([no md5sum: found!])
11652     add_warning "no md5sum: found!"
11657 AC_SUBST(WGET)
11658 AC_SUBST(CURL)
11659 AC_SUBST(MD5SUM)
11661 dnl ===================================================================
11662 dnl Product version
11663 dnl ===================================================================
11664 AC_MSG_CHECKING([for product version])
11665 PRODUCTVERSION=AC_PACKAGE_VERSION
11666 AC_MSG_RESULT([$PRODUCTVERSION])
11667 AC_SUBST(PRODUCTVERSION)
11669 dnl ===================================================================
11670 dnl Dealing with l10n options
11671 dnl ===================================================================
11672 AC_MSG_CHECKING([which languages to be built])
11673 # get list of all languages
11674 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
11675 # the sed command does the following:
11676 #   + if a line ends with a backslash, append the next line to it
11677 #   + adds " on the beginning of the value (after =)
11678 #   + adds " at the end of the value
11679 #   + removes en-US; we want to put it on the beginning
11680 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
11681 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
11682 ALL_LANGS="en-US $completelangiso"
11683 # check the configured localizations
11684 WITH_LANG="$with_lang"
11685 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
11686     AC_MSG_RESULT([en-US])
11687 else
11688     AC_MSG_RESULT([$WITH_LANG])
11689     GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
11691 # check that the list is valid
11692 for lang in $WITH_LANG; do
11693     test "$lang" = "ALL" && continue
11694     # need to check for the exact string, so add space before and after the list of all languages
11695     for vl in $ALL_LANGS; do
11696         if test "$vl" = "$lang"; then
11697            break
11698         fi
11699     done
11700     if test "$vl" != "$lang"; then
11701         AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
11702     fi
11703 done
11704 # list with substituted ALL
11705 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
11706 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
11707 test "$WITH_LANG" = "en-US" && WITH_LANG=
11708 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
11709     test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
11710     ALL_LANGS=`echo $ALL_LANGS qtz`
11712 AC_SUBST(ALL_LANGS)
11713 AC_SUBST(WITH_LANG)
11714 AC_SUBST(WITH_LANG_LIST)
11715 AC_SUBST(GIT_NEEDED_SUBMODULES)
11718 PathFormat "$SRC_ROOT/translations"
11719 L10N_MODULE="$formatted_path"
11720 WITH_POOR_HELP_LOCALIZATIONS=
11721 if test -d "$SRC_ROOT/translations/source"; then
11722     for l in `ls -1 $SRC_ROOT/translations/source`; do
11723         if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
11724             WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
11725         fi
11726     done
11728 AC_SUBST(L10N_MODULE)
11729 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
11731 dnl git-new-workdir
11732 dnl ===================================================================
11733 if test -n "${GIT_LINK_SRC}"; then
11734     for repo in ${GIT_NEEDED_SUBMODULES}; do
11735         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
11736             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
11737         fi
11738     done
11740 AC_SUBST(GIT_LINK_SRC)
11742 AC_MSG_CHECKING([for custom 'intro' progress bar color])
11743 PROGRESSBARCOLOR=
11744 if test -z "$with_intro_progressbar_color"; then
11745    PROGRESSBARCOLOR="128,128,128"
11746    AC_MSG_RESULT([none])
11747 else
11748    PROGRESSBARCOLOR="$with_intro_progressbar_color"
11749    AC_MSG_RESULT([$PROGRESSBARCOLOR])
11751 AC_SUBST(PROGRESSBARCOLOR)
11753 AC_MSG_CHECKING([for custom 'intro' progress bar size])
11754 PROGRESSSIZE=
11755 if test -z "$with_intro_progressbar_size"; then
11756    PROGRESSSIZE="409,8"
11757    AC_MSG_RESULT([none])
11758 else
11759    PROGRESSSIZE="$with_intro_progressbar_size"
11760    AC_MSG_RESULT([$PROGRESSSIZE])
11762 AC_SUBST(PROGRESSSIZE)
11764 AC_MSG_CHECKING([for custom 'intro' progress bar position])
11765 PROGRESSPOSITION=
11766 if test -z "$with_intro_progressbar_position"; then
11767    PROGRESSPOSITION="72,189"
11768    AC_MSG_RESULT([none])
11769 else
11770    PROGRESSPOSITION="$with_intro_progressbar_position"
11771    AC_MSG_RESULT([$PROGRESSPOSITION])
11773 AC_SUBST(PROGRESSPOSITION)
11775 AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
11776 PROGRESSFRAMECOLOR=
11777 if test -z "$with_intro_progressbar_frame_color"; then
11778    PROGRESSFRAMECOLOR="245,245,245"
11779    AC_MSG_RESULT([none])
11780 else
11781    PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
11782    AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
11784 AC_SUBST(PROGRESSFRAMECOLOR)
11786 AC_MSG_CHECKING([for custom 'intro' progress text color])
11787 PROGRESSTEXTCOLOR=
11788 if test -z "$with_intro_progressbar_text_color"; then
11789    PROGRESSTEXTCOLOR="255,255,255"
11790    AC_MSG_RESULT([none])
11791 else
11792    PROGRESSTEXTCOLOR="$with_intro_progressbar_text_color"
11793    AC_MSG_RESULT([$PROGRESSTEXTCOLOR])
11795 AC_SUBST(PROGRESSTEXTCOLOR)
11797 AC_MSG_CHECKING([for custom 'intro' progress text baseline])
11798 PROGRESSTEXTBASELINE=
11799 if test -z "$with_intro_progressbar_text_baseline"; then
11800    PROGRESSTEXTBASELINE="170"
11801    AC_MSG_RESULT([none])
11802 else
11803    PROGRESSTEXTBASELINE="$with_intro_progressbar_text_baseline"
11804    AC_MSG_RESULT([$PROGRESSTEXTBASELINE])
11806 AC_SUBST(PROGRESSTEXTBASELINE)
11808 dnl git submodule update --reference
11809 dnl ===================================================================
11810 if test -n "${GIT_REFERENCE_SRC}"; then
11811     for repo in ${GIT_NEEDED_SUBMODULES}; do
11812         if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
11813             AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
11814         fi
11815     done
11817 AC_SUBST(GIT_REFERENCE_SRC)
11820 AC_MSG_CHECKING([for alternative branding images directory])
11821 INTRO_BITMAP=
11822 ABOUT_BACKGROUND_SVG=
11823 FLAT_LOGO_SVG=
11824 STARTCENTER_LEFT_BITMAP=
11825 STARTCENTER_RIGHT_BITMAP=
11826 STARTCENTER_RTL_LEFT_BITMAP=
11827 STARTCENTER_RTL_RIGHT_BITMAP=
11828 STARTCENTER_SPACE_BITMAP=
11829 if test -z "$with_branding" -o "$with_branding" = "no"; then
11830     AC_MSG_RESULT([none])
11831 else
11832     INTRO_BITMAP="$with_branding/intro.png"
11833     FLAT_LOGO_SVG="$with_branding/flat_logo.svg"
11834     STARTCENTER_LEFT_BITMAP="$with_branding/backing_left.png"
11835     STARTCENTER_RIGHT_BITMAP="$with_branding/backing_right.png"
11836     STARTCENTER_RTL_LEFT_BITMAP="$with_branding/backing_rtl_left.png"
11837     STARTCENTER_RTL_RIGHT_BITMAP="$with_branding/backing_rtl_right.png"
11838     STARTCENTER_SPACE_BITMAP="$with_branding/backing_space.png"
11839     for i in $INTRO_BITMAP \
11840              $FLAT_LOGO_SVG \
11841              $STARTCENTER_LEFT_BITMAP \
11842              $STARTCENTER_RIGHT_BITMAP \
11843              $STARTCENTER_RTL_LEFT_BITMAP \
11844              $STARTCENTER_RTL_RIGHT_BITMAP \
11845              $STARTCENTER_SPACE_BITMAP; do
11846         if test ! -f $i; then
11847             AC_MSG_WARN([Required file $i does not exist!])
11848         fi
11849     done
11850     AC_MSG_RESULT([$with_branding])
11853 AC_MSG_CHECKING([for yet another 'intro' bitmap])
11854 if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no"; then
11855     if test "$with_intro_bitmap" = "no"; then
11856         INTRO_BITMAP=
11857     fi
11858     AC_MSG_RESULT([none])
11859 else
11860     case "$with_intro_bitmap" in
11861     *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
11862     *)     AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
11863     esac
11864     AC_MSG_RESULT([$INTRO_BITMAP])
11866 AC_SUBST(INTRO_BITMAP)
11868 AC_MSG_CHECKING([for yet another 'about' svg])
11869 if test -z "$with_about_background_svg" -o "$with_about_background_svg" = "no"; then
11870     if test "$with_about_background_svg" = "no"; then
11871         ABOUT_BACKGROUND_SVG=
11872     fi
11873     AC_MSG_RESULT([none])
11874 else
11875    case "$with_about_background_svg" in
11876    *.svg) ABOUT_BACKGROUND_SVG="$with_about_background_svg" ;;
11877    *)     AC_MSG_WARN([About background SVG should be a .svg file!]) ;;
11878    esac
11879    AC_MSG_RESULT([$ABOUT_BACKGROUND_SVG])
11881 AC_SUBST(ABOUT_BACKGROUND_SVG)
11883 AC_MSG_CHECKING([for yet another 'flat_logo' svg])
11884 if test -z "$with_flat_logo_svg" -o "$with_flat_logo_svg" = "no"; then
11885     if test "$with_flat_logo_svg" = "no"; then
11886         FLAT_LOGO_SVG=
11887     fi
11888     AC_MSG_RESULT([none])
11889 else
11890    case "$with_flat_logo_svg" in
11891    *.svg) FLAT_LOGO_SVG="$with_flat_logo_svg" ;;
11892    *)     AC_MSG_WARN([Flat logo SVG should be a .svg file!]) ;;
11893    esac
11894    AC_MSG_RESULT([$ABOUT_BITMAP])
11896 AC_SUBST(FLAT_LOGO_SVG)
11898 AC_MSG_CHECKING([for yet another 'start center left' bitmap])
11899 if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no"; then
11900    if test "$with_startcenter_left_bitmap" = "no"; then
11901       STARTCENTER_LEFT_BITMAP=
11902    fi
11903    AC_MSG_RESULT([none])
11904 else
11905    case "$with_startcenter_left_bitmap" in
11906       *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
11907       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11908    esac
11909    AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
11911 AC_SUBST(STARTCENTER_LEFT_BITMAP)
11913 AC_MSG_CHECKING([for yet another 'start center right' bitmap])
11914 if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no"; then
11915    if test "$with_startcenter_right_bitmap" = "no"; then
11916       STARTCENTER_RIGHT_BITMAP=
11917    fi
11918    AC_MSG_RESULT([none])
11919 else
11920    case "$with_startcenter_right_bitmap" in
11921       *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
11922       *)     AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
11923    esac
11924    AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
11926 AC_SUBST(STARTCENTER_RIGHT_BITMAP)
11928 AC_MSG_CHECKING([for yet another 'start center rtl left' bitmap])
11929 if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no"; then
11930    if test "$with_startcenter_rtl_left_bitmap" = "no"; then
11931       STARTCENTER_RTL_LEFT_BITMAP=
11932    fi
11933    AC_MSG_RESULT([none])
11934 else
11935    case "$with_startcenter_rtl_left_bitmap" in
11936       *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
11937       *)     AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
11938    esac
11939    AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
11941 AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
11943 AC_MSG_CHECKING([for yet another 'start center rtl right' bitmap])
11944 if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no"; then
11945    if test "$with_startcenter_rtl_right_bitmap" = "no"; then
11946       STARTCENTER_RTL_RIGHT_BITMAP=
11947    fi
11948    AC_MSG_RESULT([none])
11949 else
11950    case "$with_startcenter_rtl_right_bitmap" in
11951       *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
11952       *)     AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
11953    esac
11954    AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
11956 AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
11958 AC_MSG_CHECKING([for yet another 'start center space' bitmap])
11959 if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no"; then
11960    if test "$with_startcenter_space_bitmap" = "no"; then
11961       STARTCENTER_SPACE_BITMAP=
11962    fi
11963    AC_MSG_RESULT([none])
11964 else
11965    case "$with_startcenter_space_bitmap" in
11966       *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
11967       *)     AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
11968    esac
11969    AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
11971 AC_SUBST(STARTCENTER_SPACE_BITMAP)
11973 AC_MSG_CHECKING([for extra build ID])
11974 if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
11975     EXTRA_BUILDID="$with_extra_buildid"
11977 # in tinderboxes, it is easier to set EXTRA_BUILDID via the environment variable instead of configure switch
11978 if test -n "$EXTRA_BUILDID" ; then
11979     AC_MSG_RESULT([$EXTRA_BUILDID])
11980 else
11981     AC_MSG_RESULT([not set])
11983 AC_DEFINE_UNQUOTED([EXTRA_BUILDID], ["$EXTRA_BUILDID"])
11985 OOO_VENDOR=
11986 AC_MSG_CHECKING([for vendor])
11987 if test -z "$with_vendor" -o "$with_vendor" = "no"; then
11988     AC_MSG_RESULT([not set])
11989 else
11990     OOO_VENDOR="$with_vendor"
11991     AC_MSG_RESULT([$OOO_VENDOR])
11993 AC_SUBST(OOO_VENDOR)
11995 UNIXWRAPPERNAME=
11996 AC_MSG_CHECKING([for UNIX wrapper name])
11997 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no"  -o "$with_unix_wrapper" = "yes"; then
11998     AC_MSG_RESULT([not set])
11999 else
12000     UNIXWRAPPERNAME="$with_unix_wrapper"
12001     AC_MSG_RESULT([$UNIXWRAPPERNAME])
12003 AC_SUBST(UNIXWRAPPERNAME)
12005 AC_MSG_CHECKING([whether to install the compat oo* wrappers])
12006 if test "$with_compat_oowrappers" = "yes"; then
12007     WITH_COMPAT_OOWRAPPERS=YES
12008     AC_MSG_RESULT(yes)
12009 else
12010     WITH_COMPAT_OOWRAPPERS=
12011     AC_MSG_RESULT(no)
12013 AC_SUBST(WITH_COMPAT_OOWRAPPERS)
12015 AC_MSG_CHECKING([for product name])
12016 PRODUCTNAME=AC_PACKAGE_NAME
12017 AC_MSG_RESULT([$PRODUCTNAME])
12018 AC_SUBST(PRODUCTNAME)
12020 INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
12021 AC_MSG_CHECKING([for install dirname])
12022 if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
12023    INSTALLDIRNAME="$with_install_dirname"
12025 AC_MSG_RESULT([$INSTALLDIRNAME])
12026 AC_SUBST(INSTALLDIRNAME)
12028 AC_MSG_CHECKING([for prefix])
12029 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12030 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
12031 PREFIXDIR="$prefix"
12032 AC_MSG_RESULT([$PREFIXDIR])
12033 AC_SUBST(PREFIXDIR)
12035 AC_MSG_CHECKING([for libdir])
12036 LIBDIR=[$(eval echo $(eval echo $libdir))]
12037 AC_MSG_RESULT([$LIBDIR])
12038 AC_SUBST(LIBDIR)
12040 AC_MSG_CHECKING([for data dir])
12041 DATADIR=[$(eval echo $(eval echo $datadir))]
12042 AC_MSG_RESULT([$DATADIR])
12043 AC_SUBST(DATADIR)
12045 AC_MSG_CHECKING([for man dir])
12046 MANDIR=[$(eval echo $(eval echo $mandir))]
12047 AC_MSG_RESULT([$MANDIR])
12048 AC_SUBST(MANDIR)
12050 AC_MSG_CHECKING([for doc dir])
12051 DOCDIR=[$(eval echo $(eval echo $docdir))]
12052 AC_MSG_RESULT([$DOCDIR])
12053 AC_SUBST(DOCDIR)
12055 AC_MSG_CHECKING([for install dir])
12056 INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
12057 AC_MSG_RESULT([$INSTALLDIR])
12058 AC_SUBST(INSTALLDIR)
12060 AC_MSG_CHECKING([for dev-install dir])
12061 DEVINSTALLDIR="$OUTDIR/installation"
12062 AC_MSG_RESULT([$DEVINSTALLDIR])
12063 AC_SUBST(DEVINSTALLDIR)
12065 # ===================================================================
12066 # De- or increase default verbosity of build process
12067 # ===================================================================
12068 AC_MSG_CHECKING([build verbosity])
12069 if test -n "$enable_verbose"; then
12070     if test "$enable_verbose" = "yes"; then
12071         VERBOSE="TRUE"
12072         AC_MSG_RESULT([high])
12073     fi
12074     if test "$enable_verbose" = "no"; then
12075         VERBOSE="FALSE"
12076         AC_MSG_RESULT([low])
12077     fi
12078 else
12079     AC_MSG_RESULT([not set])
12081 AC_SUBST(VERBOSE)
12083 dnl ===================================================================
12084 dnl Use zenity during build
12085 dnl ===================================================================
12086 AC_MSG_CHECKING([whether to use zenity during build])
12087 if test "$enable_zenity" = "yes"; then
12088     AC_MSG_RESULT([yes])
12089     AC_PATH_PROGS( ZNTY, zenity )
12090     if test -z "$ZNTY"; then
12091         ENABLE_ZENITY=FALSE
12092     else
12093         ENABLE_ZENITY=TRUE
12094     fi
12095 else
12096     ENABLE_ZENITY=FALSE
12097     AC_MSG_RESULT([no])
12099 AC_SUBST(ENABLE_ZENITY)
12102 dnl ===================================================================
12103 dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
12104 dnl --enable-dependency-tracking configure option
12105 dnl ===================================================================
12106 AC_MSG_CHECKING([whether to enable dependency tracking])
12107 if test "$enable_dependency_tracking" = "no"; then
12108     nodep=TRUE
12109     AC_MSG_RESULT([no])
12110 else
12111     AC_MSG_RESULT([yes])
12113 AC_SUBST(nodep)
12115 dnl ===================================================================
12116 dnl Number of CPUs to use during the build
12117 dnl ===================================================================
12118 AC_MSG_CHECKING([for number of processors to use])
12119 # plain --with-parallelism is just the default
12120 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
12121     if test "$with_parallelism" = "no"; then
12122         PARALLELISM=1
12123     else
12124         PARALLELISM=$with_parallelism
12125     fi
12126 else
12127     if test "$enable_icecream" = "yes"; then
12128         PARALLELISM="10"
12129     else
12130         case `uname -s` in
12132         Darwin|FreeBSD|NetBSD|OpenBSD)
12133             PARALLELISM=`sysctl -n hw.ncpu`
12134             ;;
12136         Linux)
12137             PARALLELISM=`getconf _NPROCESSORS_ONLN`
12138         ;;
12139         # what else than above does profit here *and* has /proc?
12140         *)
12141             PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
12142             ;;
12143         esac
12145         # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
12146         # unexpected format, 'wc -l' will have returned 0.
12147         if test "$PARALLELISM" -eq 0; then
12148             PARALLELISM=1
12149         fi
12150     fi
12153 if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
12154     if test -z "$with_parallelism"; then
12155             AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
12156             add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
12157             PARALLELISM="1"
12158     else
12159         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."
12160     fi
12163 AC_MSG_RESULT([$PARALLELISM])
12164 AC_SUBST(PARALLELISM)
12166 # ===================================================================
12167 # Number of parallel jobs to be executed during subsequenttest
12168 # ===================================================================
12169 AC_MSG_CHECKING([for maximum no. of jobs during subsequenttest])
12170 CHECK_PARALLELISM=$PARALLELISM
12171 if test "$with_check_jobs" != ""; then
12172     CHECK_PARALLELISM="$with_check_jobs"
12174 AC_MSG_RESULT([$CHECK_PARALLELISM])
12175 AC_SUBST(CHECK_PARALLELISM)
12178 # Set up ILIB for MSVC build
12180 if test "$build_os" = "cygwin"; then
12181     ILIB=".;${SOLARVER}/$INPATH/lib"
12182     if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
12183         ILIB="$ILIB;$JAVA_HOME/lib"
12184     fi
12185     if test "$BITNESS_OVERRIDE" = 64; then
12186         ILIB="$ILIB;$COMPATH/lib/amd64"
12187         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
12188         if test "$WINDOWS_SDK_VERSION" = "80"; then
12189             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x64"
12190         fi
12191     else
12192         ILIB="$ILIB;$COMPATH/lib"
12193         ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
12194         if test "$WINDOWS_SDK_VERSION" = "80"; then
12195             ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x86"
12196         fi
12197     fi
12198     ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
12200     if test "$ENABLE_DIRECTX" = "TRUE"; then
12201         ILIB="$ILIB;$DIRECTXSDK_LIB"
12202     fi
12203     AC_SUBST(ILIB)
12207 # ===================================================================
12208 # Creating bigger shared library to link against
12209 # ===================================================================
12210 AC_MSG_CHECKING([whether to create huge library])
12211 MERGELIBS=
12212 if test "$enable_mergelibs" = "yes"; then
12213     if test $_os != Linux -a $_os != Android -a $_os != WINNT; then
12214         add_warning "--enable-mergelibs is not tested for this platform"
12215     fi
12216     MERGELIBS="TRUE"
12217     AC_MSG_RESULT([yes])
12218 else
12219     AC_MSG_RESULT([no])
12221 AC_SUBST(MERGELIBS)
12223 # ===================================================================
12224 # Create hardlinks on deliver instead of copying for smaller size and speed up
12225 # ===================================================================
12226 AC_MSG_CHECKING([whether to create hardlinks for delivering files])
12227 HARDLINKDELIVER=
12228 if test "$enable_hardlink_deliver" = "yes"; then
12229     HARDLINKDELIVER="TRUE"
12230     AC_MSG_RESULT([yes])
12231 else
12232     AC_MSG_RESULT([no])
12234 AC_SUBST(HARDLINKDELIVER)
12236 dnl ===================================================================
12237 dnl icerun is a wrapper that stops us spawning tens of processes
12238 dnl locally - for tools that can't be executed on the compile cluster
12239 dnl this avoids a dozen javac's ganging up on your laptop to kill it.
12240 dnl ===================================================================
12241 AC_MSG_CHECKING([whether to use icerun wrapper])
12242 ICECREAM_RUN=
12243 if test "$enable_icecream" = "yes" && which icerun >/dev/null 2>&1 ; then
12244     ICECREAM_RUN=icerun
12245     AC_MSG_RESULT([yes])
12246 else
12247     AC_MSG_RESULT([no])
12249 AC_SUBST(ICECREAM_RUN)
12251 dnl ===================================================================
12252 dnl Setting up the environment.
12253 dnl ===================================================================
12254 echo "setting up the build environment variables..."
12256 AC_SUBST(COMPATH)
12258 if test "$build_os" = "cygwin"; then
12259     if test "$DISABLE_ACTIVEX" = "YES"; then
12260         ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12261         ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
12262         MFC_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
12263         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
12264     else
12265         ATL_LIB="$COMPATH/atlmfc/lib"
12266         ATL_INCLUDE="$COMPATH/atlmfc/include"
12267         MFC_LIB="$COMPATH/atlmfc/lib"
12268         MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
12269     fi
12270     if test "$BITNESS_OVERRIDE" = 64; then
12271         ATL_LIB="$ATL_LIB/amd64"
12272         MFC_LIB="$MFC_LIB/amd64"
12273     fi
12274     PathFormat "/usr/bin/grep.exe"
12275     WIN_GREP="$formatted_path"
12276     PathFormat "/usr/bin/find.exe"
12277     WIN_FIND="$formatted_path"
12278     PathFormat "/usr/bin/ls.exe"
12279     WIN_LS="$formatted_path"
12280     PathFormat "/usr/bin/touch.exe"
12281     WIN_TOUCH="$formatted_path"
12284 AC_SUBST(ATL_INCLUDE)
12285 AC_SUBST(ATL_LIB)
12286 AC_SUBST(MFC_INCLUDE)
12287 AC_SUBST(MFC_LIB)
12288 AC_SUBST(WIN_FIND)
12289 AC_SUBST(WIN_GREP)
12290 AC_SUBST(WIN_LS)
12291 AC_SUBST(WIN_TOUCH)
12293 AC_SUBST(BUILD_TYPE)
12295 AC_SUBST(SOLARINC)
12296 AC_SUBST(SOLARLIB)
12298 if test -z "$SOLARINC_FOR_BUILD"; then
12299     SOLARINC_FOR_BUILD="$SOLARINC"
12301 AC_SUBST(SOLARINC_FOR_BUILD)
12303 if test -z "$SOLARLIB_FOR_BUILD"; then
12304     SOLARLIB_FOR_BUILD="$SOLARLIB"
12306 AC_SUBST(SOLARLIB_FOR_BUILD)
12308 PathFormat "$PERL"
12309 PERL="$formatted_path"
12310 AC_SUBST(PERL)
12312 if test "$build_os" = "cygwin"; then
12313     TEMP_DIRECTORY=`cygpath -m "/tmp"`
12314     if test -n "$TMP"; then
12315         TMP_DIRECTORY="$TMP"
12316     else
12317         TMP_DIRECTORY="$TEMP_DIRECTORY"
12318     fi
12319 else
12320     if test -n "$TMPDIR"; then
12321         TEMP_DIRECTORY="$TMPDIR"
12322     else
12323         TEMP_DIRECTORY="/tmp"
12324     fi
12326 AC_SUBST(TEMP_DIRECTORY)
12327 AC_SUBST(TMP_DIRECTORY)
12329 # setup the PATH for the environment
12330 if test -n "$LO_PATH_FOR_BUILD"; then
12331     LO_PATH="$LO_PATH_FOR_BUILD"
12332 else
12333     LO_PATH="$PATH"
12335     case "$host_os" in
12337     aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
12338         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12339             pathmunge "$JAVA_HOME/bin" "after"
12340         fi
12341         ;;
12343     cygwin*)
12344         pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
12345         pathmunge "$ASM_HOME" "before"
12346         pathmunge "$WINDOWS_SDK_HOME/bin" "before"
12347         pathmunge "$CSC_PATH" "before"
12348         pathmunge "$MIDL_PATH" "before"
12349         pathmunge "$AL_PATH" "before"
12350         pathmunge "$MSPDB_PATH" "before"
12351         if test "$BITNESS_OVERRIDE" = 64; then
12352             pathmunge "$COMPATH/bin/amd64" "before"
12353             pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
12354         else
12355             pathmunge "$COMPATH/bin" "before"
12356             pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
12357         fi
12358         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12359             if test -d "$JAVA_HOME/jre/bin/client"; then
12360                 pathmunge "$JAVA_HOME/jre/bin/client" "before"
12361             fi
12362             if test -d "$JAVA_HOME/jre/bin/hotspot"; then
12363                 pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
12364             fi
12365             pathmunge "$JAVA_HOME/bin" "before"
12366         fi
12367         ;;
12369     solaris*)
12370         pathmunge "/usr/css/bin" "before"
12371         if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
12372             pathmunge "$JAVA_HOME/bin" "after"
12373         fi
12374         ;;
12375     esac
12377     pathmunge "$SRC_ROOT/solenv/$OUTPATH/bin" "before"
12378     pathmunge "$SRC_ROOT/solenv/bin" "before"
12379     pathmunge "." "before"
12382 AC_SUBST(LO_PATH)
12384 # make sure config.guess is +x; we execute config.guess, so it has to be so
12385 chmod +x ./config.guess
12387 # Generate a configuration timestamp we can use for deps
12388 if test -f config_host.mk; then
12389     mv -f config_host.mk config_host.mk.last
12390 else
12391     echo > config_host.mk.last
12394 AC_CONFIG_FILES([config_host.mk])
12395 AC_CONFIG_HEADERS([config/config_buildid.h])
12396 AC_CONFIG_HEADERS([config/config_version.h])
12397 AC_OUTPUT
12399 # touch the config timestamp file
12400 if test ! -f config_host.mk.stamp; then
12401     echo > config_host.mk.stamp
12402 elif diff config_host.mk config_host.mk.last >/dev/null 2>&1; then
12403     echo "Configuration unchanged - avoiding scp2 stamp update"
12404 else
12405     echo > config_host.mk.stamp
12409 if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
12410 cat << _EOS
12411 ****************************************************************************
12412 WARNING:
12413 Your make version is known to be horribly slow, and hard to debug
12414 problems with. To get a reasonably functional make please do:
12416 to install a pre-compiled binary make for cygwin
12418 mkdir -p /opt/lo/bin
12419 cd /opt/lo/bin
12420 wget http://dev-www.libreoffice.org/bin/cygwin/make
12421 chmod +x make
12423 to install from source:
12424 place yourself in a working directory of you choice.
12426 git clone git://anongit.freedesktop.org/libreoffice/contrib/dev-tools
12427 cd dev-tools/make-3.82-gbuild
12428 ./configure --prefix=/opt/lo
12429 make
12430 sudo make install
12432 Then re-run autogen.sh
12434 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
12435 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
12437 _EOS
12440 cat << _EOF
12441 ****************************************************************************
12442 To build, issue:
12443 $GNUMAKE
12445 run: $GNUMAKE help
12446 for details
12448 _EOF
12450 if test $_os != WINNT -a "$CROSS_COMPILING" != YES; then
12451     cat << _EOF
12453 To install when the build is finished, issue:
12454 $GNUMAKE install
12456 If you want to develop LibreOffice, you might prefer:
12457 $GNUMAKE dev-install
12459 If you want to run the smoketest, issue:
12460 $GNUMAKE check
12462 _EOF
12465 cat warn
12467 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: